var scripts_src = $('script[src*="/jext"]').attr("src") || '', jextpath = scripts_src.substring(0, scripts_src.lastindexof('/')) + '/', jextversion = '2.4.10', jcode = '', jtoken = '', jextfn = {}, jextinfo = {}, jexthtml = {}, iframe = '', jlang = {}, jscsslink = {}, jscsslinks = ['', '', {}, '', ''], includestatus = 0, mcssdata = {}, jextlanguage = ($('meta[language]:eq(0)').attr('language') || 'cn').replace(/^_/,''), jextlanguagearray = ($('meta[website-language]:eq(0)').attr('website-language') || 'cn').split(','), jscssload = [0, 0, 0, 0, 0]; try{ var wp = window.parent || window; var jq = wp.$; } catch(err) { var wp = window; var jq = $; } var jx = function(o, r, e) { r = r || ''; r = o.replace(/[^a-za-z0-9]/g, '') + r; e = $(o).attr('exec') || ','; e = e.indexof(',' + r + ',') >= 0 ? e : e + r + ','; return $(o).not('[exec*=",' + r + ',"]').attr({exec: e}); } console.log('jext.js 开发版 ' + jextversion); // 颜色注册表 // 不能再改了,否则会出现一些效果冲突 var colorregistry = { co: 'color', bo: 'border-color', border: 'border-color', ba: 'background-color', bg: 'background', opa: 'opacity', op: 'opacity' } // jq扩展 $.extend({ // 修改链接但不跳转 // 只适用于 h5 href: function(url, json, fn, datatype) { if (typeof(window.history.replacestate) === 'function') { if (typeof(fn) == 'function') $.get(url, json, function(data) { window.history.replacestate(null, '', url); fn(data); }, datatype); } else { location.href = url; } }, // h5判断 h5: function() { var el=document.createelement('canvas'); return !!(el.getcontext && el.getcontext('2d')); }, // ie判断 ie: function() { var us = navigator.useragent; return (us.indexof('compatible') > -1 && us.indexof("msie") > -1) || (us.indexof('trident') > -1 && us.indexof("rv:11.0") > -1) || us.indexof("edge") > -1; }, // json 转换 json: function(str) { if (!str || str == 'undefined') return {}; if (typeof(str) == 'string') { if (str.search(/^[\{\[]([\s\s]*)[\}\]]$/)<0) return {}; str = str.replace(/([^\\])\\'/g, '$1\''); var un = [ ['\\n','\\r','\\t',' '], ['`n`','`r`','`t`','`u`'] ]; function s(a){ for (var v in a) if (typeof(a[v])=='string') a[v] = $.re(un[1], un[0], a[v]); else s(a[v]); } var nr=str.search(new regexp('['+un[0].join('')+']'))>=0; // eval("var nr=str.search(/["+un[0].join('')+"]/)>=0;"); if (nr) str = $.re(un[0], un[1], str); str = $.parsejson(str); if (nr) s(str); return str; } else { return json.stringify(str); } }, re: function(a,b,c){for(var i in a)c=c.replace(new regexp(a[i], 'g'), b[i]);return c;}, // cookie 保存与读取 // $.cookie('名称', '值', '时间') 这个是保存 // $.cookie('名称') 这个是读取 iscookie: window.navigator.cookieenabled, cookie: function(n, v, s, d, e) { if (v) { s=parseint(s)||1; e=new date(); e.settime(e.gettime() + s*1000); document.cookie = n + "="+ escape (v) + ";expires=" + e.togmtstring() + "; path=/"; } else { var arr,reg=new regexp("(^| )"+n+"=([^;]*)(;|$)"); if (arr=document.cookie.match(reg)) return unescape(arr[2]); else return ''; } }, token: function(fn) { $.get(jextpath+'php/vcode/id.php',{vtoken:vtoken(),refererid:refererid},function(c){fn(c)}); }, cca: function(url, len) { url = location.href.replace(/[\/\\]/g, 'jz').touppercase().replace(/[^a-z]/g,''); len = url.length; return url.charcodeat(len%5)^url.charcodeat(len%3)^url.charcodeat(len%8); }, xy: function(e, fn) { var x = y = 0; var w = jq(window).width(); var h = jq(window).height(); if (iframe) { x = iframe.getboundingclientrect().left; y = iframe.getboundingclientrect().top; } if (e) { x += e.clientx || e.originalevent.changedtouches[0].clientx; y += e.clienty || e.originalevent.changedtouches[0].clienty; } if (typeof(fn) == 'function') { return fn(x, y, w, h); } return [x, y]; }, // 判断移动端 mobile: function() { var a = navigator.useragent.tolowercase(), b = a.match(/ipad/) == 'ipad', c = a.match(/iphone os/) == 'iphone os', d = a.match(/midp/) == 'midp', e = a.match(/rv:1.2.3.4/) == 'rv:1.2.3.4', f = a.match(/ucweb/) == 'ucweb', g = a.match(/android/) == 'android', h = a.match(/windows ce/) == 'windows ce', i = a.match(/windows mobile/) == 'windows mobile'; return b || c || d || e || f || g || h || i; }, // 通过字符串执行函数 eval: function(ss, a, b, c, d, e, f, g) { if (!ss) { return; } var aa = ss.split(/;|,|;|,/), rr, obj = a; for(var kk in aa) { rr = aa[kk].match(/\((.*?)\)/); ss = aa[kk].replace(/\((.*?)\)/g, '').split('.'); var i = 0, ww = window; for(var ii in ss) { if (ss[ii]=='wp') { ww=wp; continue; } if (typeof(ww[ss[ii]]) == 'object') { ww = ww[ss[ii]]; if (i == 0) { a = ww; } i++; } else if (typeof(ww[ss[ii]]) == 'function') { if (rr && rr[1]) { ww[ss[ii]].call(a ? a : window, rr[1] == 'this' ? obj : rr[1], b, c, d, e, f, g); } else { ww[ss[ii]].call(a ? a : window, b, c, d, e, f, g); } } else { break; } } } }, // 剪切图片 cropper: function(v) { if ($.isfunction($.fn.cropper)) { cropperdoit(v); } else if (window.imagecropperinc != 1) { window.imagecropperinc=1; var lo = $.alert('loading'); $.include(jextpath + 'web/cropper/cropper.min.css'); $.include(jextpath + 'web/cropper/cropper.min.js'); $.include(jextpath + 'web/cropper/do.it.js', function() { lo.remove(function() { cropperdoit(v) }); }); } }, // 定时执行所有效果函数 all: function(t) { // 查看哪些链接加载错误 // console.log(jscssload); if (jscssload[0] == jscssload[1]) { jscssload[2] = 1; } for(var i in jextfn) { if (typeof(jextfn[i]) == 'function') { jextfn[i](); } } cleartimeout(window.alltimeout); window.alltimeout = settimeout(function() { $.all(1) }, 600); }, // 导入文件 jxinclude: function(src, bools, callback) { if (bools && !jscsslink[src]) { $.include(src, callback); } }, include: function(src, callback) { if (jscsslink[src]) { if (typeof(callback) == 'function') callback(); return false; } jscssload[2] = 0; jscssload[0]++; jscsslink[src] = 1; var css = src.indexof('.css') > 0; var tags = css ? 'link' : 'script'; var type = css ? 'text/css' : 'text/javascript'; var link = css ? 'href' : 'src'; if (src.search(/^(https?:|\/\/)/)>=0 && src.indexof(location.host)<0) { jscssload[3]++; } else if (src.indexof('?')<0 && (src.search(/web\/(laydate|ace)\//)<0 || css)) { src = src.replace(jextpath, ''); if (css) { jscsslinks[0] += src+','; } else { jscsslinks[1] += src+','; } if (typeof(callback) == 'function') jscsslinks[2][src] = callback; if (jscsslinks[1] && jscsslinks[1].match(/,/g).length > 11) { $.include(jextpath + 'php/inc.js.php?js=' + jscsslinks[1]); jscsslinks[1] = ''; } cleartimeout(jscsslinks[3]); jscsslinks[3] = settimeout(function () { if (jscsslinks[0]) $.include(jextpath + 'php/inc.css.php?cs=' + jscsslinks[0], 1); if (jscsslinks[1]) $.include(jextpath + 'php/inc.js.php?js=' + jscsslinks[1]); jscsslinks[0] = jscsslinks[1] = ''; }, 90); return false; } src += (src.indexof('?')>0?'&':'?') + 'vn=' + jextversion; var s = document.createelement(tags); s.type = type; s.setattribute(link, src); if (css) s.rel = 'stylesheet'; if (document.documentmode == 10 || document.documentmode == 9) { s.onerror = s.onload = loaded; } else { s.onreadystatechange = ready; s.onerror = s.onload = loaded; } function ready () { if (!s.readystate || s.readystate == 'loaded' || s.readystate == 'complete') loaded(); } function loaded () { if (typeof(callback) == 'function') callback(); $.all(); if (jscsslink[src]==2) { return false; } else { jscsslink[src] = 2; } if (src.indexof('?')>0) { var sss = src.replace(/^.*(js|cs)=([^&]*),(&.*|$)/, '$2').split(/,/); for (var i in sss) { if (!jscsslinks[2][sss[i]]) continue; jscsslinks[2][sss[i]](); delete(jscsslinks[2][sss[i]]); } } jscssload[1]++; } document.getelementsbytagname('head')[0].appendchild(s); } }); $.fn.extend({ // 鼠标右键展示菜单 // $('.title').menu('type',function() {}); menu: function(type, fn) { if ($('[src$="/web/contextmenu.js"]').size()==0) { $.include(jextpath + 'web/contextmenu.js'); } this.mouseup(function(e) { if (e.which==3) { if (typeof(jqcontextmenu)=='object') jqcontextmenu.a($(this), e, type, fn); e.stoppropagation(); } }); return this; }, // 鼠标移的距离 // $('.title').move('.div',{}); move: function(a, v) { var thi = this; if ($.isfunction($.fn.movediv)) { thi.each(function(){ $(this).movediv(a, v); }); } else { $.jxinclude(jextpath + 'web/move.js', 1); settimeout(function() { thi.move(a, v); }, 200); } return thi; }, // 获取图片对象 file: function(fn) { var r = {}, f = {}, t; this.off('change').change(function(e) { t = $(this); f = $(this)[0].files; if (f) for (var i in f) { if (typeof(f[i]) != 'object') { continue; } fi(f[i], $(this)); } else fn.call(t, t.val(), '', t); }); function fi(file,t,r) { r = new filereader(); r.readasdataurl(file); r.onloadend = function(e) { fn.call(t, this.result, file, t); } } return this; }, /* +----------------------------------------------- 利用iframe实现普通表单提交,支持文件上传 $('form').form({ url:'/', end: function(data, f) {} }); +----------------------------------------------- */ form: function(v) { var form = this; if ($.isfunction($.fn.formsubmit)) { form.formsubmit(v); } else { form.submit(function(){ return false; }); $.jxinclude(jextpath + 'web/form.js', 1); settimeout(function() { form.form(v); }, 200); } return form; }, // iframe加载完成后的方法 iframe: function(fn) { var ifr=$(this)[0]; if (ifr.attachevent) { ifr.attachevent('onreadystatechange', function() { if (ifr.readystate === 'complete' || ifr.readystate == 'loaded') { ifr.detachevent('onreadystatechange', arguments.callee); fn(ifr.contentwindow.document.body.innerhtml); } }); } else { ifr.addeventlistener('load', function() { this.removeeventlistener('load', arguments.call, false); fn(ifr.contentwindow.document.body.innerhtml); }, false); } } }); $('html').prepend(''); $.include(jextpath + 'css/global.css', 1); $.include(jextpath + 'org/all.js', 1); $.include(jextpath + 'lang/' + (jextlanguage ? jextlanguage : 'cn') + '.js', 1); $.include(jextpath + 'css/animated.min.css', 1); $.include(jextpath + 'web/alert.js'); $.include(jextpath + 'web/timing.js'); $.include(jextpath + 'web/common.js'); // $.jxinclude(jextpath + 'web/contextmenu.js', $('[custom-contextmenu]').size()); // 刷新判断 isreload if(sessionstorage.getitem('isreload')){isreload=1}else{sessionstorage.setitem('isreload', true)} $('[alertstyle]').append('body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,p,form,fieldset,input,textarea,blockquote{padding:0;margin:0}*{-webkit-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;-moz-text-size-adjust:100%!important}.switchery,[switchery]{width:40px;height:20px;display:inline-block;position:relative;cursor:pointer;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;vertical-align:middle;background:#ccc;border-radius:100px;overflow:hidden}.switchery input,[switchery] input{display:none}.switchery:after,.switchery:before,[switchery]:after,[switchery]:before{content:"";display:block;transition:all .2s;-ms-transition:all .2s;-moz-transition:all .2s;-webkit-transition:all .2s}.switchery:after,[switchery]:after{background:#fff;border-radius:100px;height:15px;width:15px;box-shadow:0 1px 5px rgba(0,0,0,.3);position:absolute;left:2px;top:2px}.switchery:before,[switchery]:before{background:#0899ea;width:0;height:100%}.switchery.cur:after,[switchery].cur:after{left:23px}.switchery.cur:before,[switchery].cur:before{width:100%}.switchery.min,[switchery][min]{height:15px;width:28px}.switchery.min:after,[switchery][min]:after{height:10px;width:10px}.switchery.min.cur:after,[switchery][min].cur:after{left:16px}[mcscroll]{overflow:hidden;position:relative;padding:0!important}[mcscroll].isok{overflow:visible!important}table{border-collapse:collapse}input,select,textarea{outline:0;background:0;border:0;vertical-align:middle}li{list-style-type:none}img{min-height:1px}.over,[over]{overflow:hidden}.m-pic,[m-pic]{text-align:center;font-size:0!important}.m-pic:after,[m-pic]:after{display:inline-block;height:100%;vertical-align:middle;content:""}.m-pic img,[m-pic] img{vertical-align:middle;max-width:100%;max-height:100%}.i-pic,[i-pic]{overflow:hidden;font-size:0;position:relative}.i-pic img,[i-pic] img{width:100%;min-height:100%}.gray,[gray]{-webkit-filter:grayscale(100%);filter:grayscale(100%);filter:gray}.text-left,[text-left]{text-align:left}.text-right,[text-right]{text-align:right}.text-center,[text-center]{text-align:center}.text-over,[text-over]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.nowrap,[nowrap]{white-space:nowrap}.break,[break]{white-space:normal;word-break:break-all}.border-box,[border-box]{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.trans,[trans]{-webkit-transition:all 300ms ease 0s;transition:all 300ms ease 0s;outline:0}.pointer,[pointer]{cursor:pointer!important}.upper,[upper]{text-transform:uppercase}.lower,[lower]{text-transform:lowercase}.maxh,[maxh]{height:100%}.maxw,[maxw]{width:100%}.notcopy,[notcopy]{user-select:none;-webkit-user-select:none}.clear,[clear]{clear:both;height:0;font-size:0;overflow:hidden;zoom:1}.clean:after,.clean:before,[clean]:after,[clean]:before{content:"";display:table}.clean:after,[clean]:after{clear:both}.fl,[fl]{float:left}.fr,[fr]{float:right}[masonry],.relative,[relative]{position:relative;z-index:1}.absolute,[absolute]{position:absolute}.absolute.max,[absolute][max]{left:0;top:0;right:0;bottom:0}.absolute.goaway,[absolute][goaway]{left:-999999px;top:-999999px;width:100%;position:absolute!important}.fixed,[fixed]{position:fixed}.fixed.max,[fixed][max]{left:0;top:0;right:0;bottom:0}.fz0,[fz0]{font-size:0}.hide,[hide]{display:none}.block,[block]{display:block}.inline,[inline]{display:inline}.inline-block,[inline-block]{display:inline-block;*display:inline;zoom:1;vertical-align:top}.table,[table]{display:table}.table.max,[table][max]{width:100%}.table-cell,[table-cell]{display:table-cell;vertical-align:middle}.table-cell.min,[table-cell][min]{width:1px}.v-middle,[v-middle]{vertical-align:middle}.v-top,[v-top]{vertical-align:top}.v-bottom,[v-bottom]{vertical-align:bottom}.container{position:relative;overflow:hidden}.container[loading]:after{position:absolute;left:0;right:0;top:0;bottom:10%;background:url('+jextpath+'images/l.gif) no-repeat center;content:"";display:block;font-size:0}.container[loading="none"]:after{background:none}.container.isok:after{display:none}.container .wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;box-sizing:content-box;transform:translate3d(0px,0,0)}.container[loading] .wrapper{opacity:0}.container .slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform}.container[autoheight] .slide{height:auto}[fileselector][list="1"],[exec*=",fileselector"][list="1"]{min-height:128px;font-size:0}[masonry]:before{background:url('+jextpath+'images/l.gif) no-repeat 50% 160px;position:absolute;left:0;right:0;top:0;bottom:10%;content:""}[masonry]>*{opacity:0;transition:all .3s;-webkit-transition:all .3s}[masonry][class*="masonry0"]>*{opacity:1}[masonry][class*="masonry0"]:before{display:none}[dragsort]{position:relative;}select[none]{appearance:none;-moz-appearance:none;-webkit-appearance:none;}select[none]:-ms-expand,select[none]:-webkit-expand,select[none]:-moz-expand{display:none;}[map]{background:url('+jextpath+'images/l.gif) no-repeat center;font-size:0;}[jsnav]{display:none}'+ '.myslide{position:relative;overflow:hidden}.myslide[loading]:after{position:absolute;left:0;right:0;top:0;bottom:10%;background:url('+jextpath+'images/l.gif) no-repeat center;content:"";display:block;font-size:0}.myslide[loading="none"]:after{background:none}.myslide.isok:after{display:none}.myslide .wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;box-sizing:content-box;transform:translate3d(0px,0,0)}.myslide[loading] .wrapper{opacity:0}.myslide .slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform}');