var outheight = 80;
var wScrollTop, wHeight;
//鍒ゆ柇PC绔繕鏄Щ鍔ㄧ
if(/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/i.test(navigator.userAgent)) {
// window.location.href = "https://m.msyc.cc/school/";
window.location.href = location.origin + "/m" + location.href.split(location.origin)[1];
}
var onionCategory = [
{id: 1, name: "鍝佺墝瑙侀潰浼?},
{id: 2, name: "ONION鐩涘吀"},
{id: 3, name: "O'Mall娲诲姩"},
{id: 4, name: "娲嬭懕灞曚細"},
{id: 5, name: "ONION浼犳挱浜嬩欢"},
{id: 6, name: "搴椾富鏁呬簨"},
{id: 7, name: "娲嬭懕鍏泭"},
];
// 甯哥敤鍏叡JS宸ュ叿
var msonionUrl = window.location.origin + "/",
msPicPath = "http://img.51msyc.com/",
mspaths, jey = {};
// 鎺ュ彛鎶ラ敊 name: 鎻掑叆dom鐨刢lass,鏂逛究绉婚櫎, msg: 閿欒淇℃伅, func:鏂规硶鍚?瀛楃涓?
function isError(name, msg, func) {
$("body").append(`
`)
}
function getAgain(name, func) {
$("." + name).remove();
func();
}
// 缂哄皯鍙傛暟
function noParams() {
$("body").append(`
鎻愮ず
缂哄皯蹇呰鍙傛暟锛?/p>
杩斿洖棣栭〉
`)
}
jey.parsURL = function (url) {
url = arguments[0] == undefined ? window.location.href : url;
var a = document.createElement('a');
a.href = url;
return {
source: url,
protocol: a.protocol.replace(':', ''),
host: a.hostname,
port: a.port,
query: a.search,
params: (function () {
var ret = {},
seg = a.search.replace(/\?/, '').split('&'),
len = seg.length,
i = 0,
s;
for (; i < len; i++) {
if (!seg[i]) { continue; }
s = seg[i].split('=');
var isw = /\?/.test(s[0]) ? s[0].split("?")[1] : s[0];
ret[isw] = decodeURI(s[1]); //瑙e喅瀛楃涔辩爜闂
}
return ret;
})(),
prefix: a.hostname.split('.')[0],
file: (a.pathname.match(/\/([^\/?#]+)$/i) || [, ''])[1],
hash: a.hash.replace('#', ''),
path: a.pathname.replace(/^([^\/])/, '/$1'),
relative: (a.href.match(/tps?:\/\/[^\/]+(.+)/) || [, ''])[1],
segments: a.pathname.replace(/^\//, '').split('/'),
queryURL: a.search.replace(/^\?/, ''),
};
};
jey.msvideo = function (that) {
var vidurl = $(that).attr("video");
jeBox.open({
title: false,
closeBtn: false,
//type:'iframe',
padding: "0",
boxSize: ['700px', '460px'],
content: "",
maskClose: true,
success: function () {
var flashvars = {
f: vidurl,
c: 0,
p: 2,
h: 3
};
var params = { bgcolor: '#FFF', allowFullScreen: true, allowScriptAccess: 'always', wmode: 'transparent' };
CKobject.embedSWF('js/ckplayer/ckplayer.swf', 'vids', 'ckplayer_a1', '700', '460', flashvars, params);
}
})
}
function wScroll() {
wScrollTop = $(document).scrollTop();
wHeight = $(window).height();
if (wScrollTop <= outheight) {
$(".mstopbox").removeClass("scrollcolor");
if ($(".to-top").length) {
$(".to-top").removeClass("show-to-top")
}
} else {
$(".mstopbox").addClass("scrollcolor");
if ($(".to-top").length) {
$(".to-top").addClass("show-to-top")
}
}
if ($(".bread-crumbs").length && jey.parsURL().file !== 'show.html' && jey.parsURL().file !== 'news-list.html') {
if (wScrollTop <= $(".omall-top").offset().top + $(".omall-top").height() - 100) {
$(".bread-crumbs").removeClass("bread-fiexd")
} else {
$(".bread-crumbs").addClass("bread-fiexd")
}
}
$(".onion-tfty").each(function () {
if($(this).offset().top + $(this).height() > wScrollTop && $(this).offset().top < (wScrollTop + wHeight)) {
$(this).removeClass("onion-tfty");
}
})
$(".onion-ts").each(function () {
if($(this).offset().top + $(this).height() > wScrollTop && $(this).offset().top < (wScrollTop + wHeight)) {
$(this).removeClass("onion-ts");
}
})
$(".tr-title").each(function () {
if($(this).offset().top + $(this).height() > wScrollTop && $(this).offset().top < (wScrollTop + wHeight)) {
var cacheHtml = "";
var cacheText = $(this).text().split('');
cacheText.forEach(function(item, index) {
cacheHtml += `${item}`
});
$(this).html(cacheHtml)
$(this).removeClass("tr-title");
}
})
}
$(function () {
var userAgent = window.navigator.userAgent.toLowerCase();
var isMsie9 = $.browser.msie && /msie 9\.0/i.test(userAgent);
var isMsie8 = $.browser.msie && /msie 8\.0/i.test(userAgent);
if ($(".mstopbox .logo").length > 0) {
$(".mstopbox .logo").on("click", function() {
location.href='/index.html'
})
}
if ($(".top-img").length > 0) {
// 閮ㄥ垎娴忚鍣ㄧ粦瀹歭oad浜嬩欢鍋跺皵浼氭湁bug, 鍥犳鏀逛负杞complete鐘舵€
var imgLoadTimer;
function imgLoad(img, callback) {
imgLoadTimer = setInterval(function() {
if (img.complete) {
clearInterval(imgLoadTimer);
callback();
}
}, 150)
}
imgLoad($(".top-img img")[0], function() {
$(".top-img-box").css({
"opacity": "1",
"-webkit-transform": "scale(1, 1)",
"transform": "scale(1, 1)"
}).one('transitionend', function () {
$(".top-img .je-poa").css("opacity", "1")
})
})
}
wScroll();
$(window).scroll(function (event) {
wScroll()
});
if ($("#msfooter").size() > 0) {
$("#msfooter").load('footer.html', function () {
var host = jey.parsURL().host;
if(host !== 'www.msyc.cc'){
$('#beian-gw').remove();
}
getFootList();
});
}
baiduStatistics();//鐧惧害缁熻
});
function getFootList() {
$.ajax({
type: 'GET',
url: msonionUrl+"webSite/getQualificationInformations/v2",
data:{},
dataType: 'json',
success: function(msg){
if(msg.errCode === 10000 && msg.data && msg.data.length) {
var eqHtml = '';
for (var index = 0; index < msg.data.length; index++) {
msg.data[index]
eqHtml += "" + msg.data[index].title + ""
}
$("#foot-eq").html(eqHtml)
} else {
isError('foot', msg.errMsg && msg.errCode !== 10000 ? msg.errMsg : '鏆傛棤鏁版嵁', 'getFootList')
}
},
error: function(err){
isError('foot', '璧勮川淇℃伅鐨勮姹傚嚭閿欎簡', 'getFootList')
}
});
}
function gotoTop() {
$('html,body').animate({ scrollTop: 0 }, 100)
};
/**
* @author:
* @description: 鐧惧害璁块棶缁熻
* @param
* @return:
*/
function baiduStatistics() {
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?3b9d7b8401f846fcd462fe4172f8378a";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
};
/*
@Name锛歫etpl v1.4 JS妯℃澘寮曟搸
@Author锛氶檲鍥藉啗
@Date锛?016-12-16
@QQ缇わ細516754269
@瀹樼綉锛歨ttp://www.jayui.com/jetpl/ 鎴栥€€ https://github.com/singod/jetpl銆€
*/
! function (a, b) { var d, c = b(a); "function" == typeof define && define.amd ? define("jetpl", function () { return c }) : "object" == typeof exports ? module.exports = c : (d = a.jetpl, c.noConflict = function () { return a.jetpl === c && (a.jetpl = d), c }, a.jetpl = c) }(this, function () {
var e, b = {},
c = { error: function (a, b) { var c = "jetpl "; return "object" == typeof console && console.error(c + a + "\n" + (b || "")), c + a }, keys: function (a) { var b = []; for (b[b.length] in a); return b } },
d = function (a) {
var c = this;
a = a || "", /^\#/.test(a) && (a = document.getElementById(a.substring(1)).innerHTML), c.tpl = a, c.tplinit(), b[a] = c
};
return d.prototype.tplCompiler = function (a) {
var b = 0,
c = a.replace(/\s+/g, " ").replace(//g, "").replace(/(^|%}|}})([\s\S]*?)({{|{%|$)/g, function (a, b, c, d) { return b + 'outStr+= "' + c.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\r?\n/g, "\\n") + '";\n' + d }).replace(/({%=)([\s\S]*?)(%})/g, "outStr+= ($2);\n").replace(/({%)(?!=)([\s\S]*?)(%})/g, "\n$2\n").replace(/{{each\s*([\w."'\][]+)\s*(\w+)\s*(\w+)?}}/g, function (a, c, d, e) {
var f = "tps" + b++,
g = "for(var $p=0; $p<$1.length; $p++){";
return g += d ? "\nvar $2 = $1[$p];\n" : "\nvar $item = $1[$p];\n", g += e ? "\nvar $3 = $p;\n" : "", g.replace(/\$1/g, c).replace(/\$2/g, d).replace(/\$3/g, e).replace(/\$p/g, f)
}).replace(/{{\/each}}/g, "};\n").replace(/{{if\s+(.*?)}}/g, "if($1){").replace(/{{else ?if (.*?)}}/g, "}else if($1){").replace(/{{else}}/g, "}else{").replace(/{{\/if}}/g, "}").replace(/{{=?([\s\S]*?)}}/g, "outStr+=$1;\n");
return c = 'var outStr="";\n' + c + "return outStr;"
}, d.prototype.dataToVars = function (a) { for (var e, b = c.keys(a || {}).sort(), d = ""; b.length;) e = b.shift(), d += "var " + e + '= jedata["' + e + '"];'; return d }, d.prototype.tplinit = function () {
var a = this,
d = a.tpl,
e = function (c, d) { var e, f, g; return b[c] = b[c] || {}, e = a.dataToVars(d), b[c].vars == e ? b[c].refuns : (f = b[c].code || a.tplCompiler(c), g = new Function("jedata", e + f), b[c].vars = e, b[c].code = f, b[c].refuns = g, g) },
f = function (a, b) { var c = e(a, b); return arguments.length > 1 ? c(b) : function (b) { var c = e(a, b); return c(b) } },
g = a.render = function (a, b) {
var e, g;
if (!a) return c.error("no data");
try {
if (e = f(d, a), !b) return g = f(d), g(a);
b(e)
} catch (h) { return b("jetpl " + h), c.error(h, d) }
};
return g
}, e = function (a) { return "string" != typeof a ? c.error("Template not found") : new d(a) }, e.decode = function (a) { return a.replace(/&/g, "&").replace(//g, ">").replace(/"/g, '"').replace(/'/g, "'") }, e.escape = function (a) { return String(a || "").replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&").replace(//g, ">").replace(/'/g, "'").replace(/"/g, """) }, e.toNumber = function (a) { return a.toString() }, e.date = function (a, b) {
var f, c = b || "YYYY-MM-DD",
d = new Date(1e3 * a),
e = { "M+": d.getMonth() + 1, "D+": d.getDate(), "h+": d.getHours(), "m+": d.getMinutes(), "s+": d.getSeconds(), "q+": Math.floor((d.getMonth() + 3) / 3), ms: d.getMilliseconds() };
/(Y+)/.test(c) && (c = c.replace(RegExp.$1, (d.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (f in e) new RegExp("(" + f + ")").test(c) && (c = c.replace(RegExp.$1, 1 == RegExp.$1.length ? e[f] : ("00" + e[f]).substr(("" + e[f]).length)));
return c
}, e.include = function (a, b) {
var c = document.getElementById(a.replace(/\#/g, "")),
d = /input|textarea/i.test(c.nodeName) ? c.value : c.innerHTML;
return e(d).render(b)
}, e.version = "1.4", e
});