|
|
!function(n){"use strict";var r=document,t={modules:{},status:{},timeout:10,event:{}},i=function(){this.v="2.1.5"},e=function(){var n=r.scripts,t=n[n.length-1].src;return t.substring(0,t.lastIndexOf("/")+1)}(),u=function(t){n.console&&console.error&&console.error("Layui hint: "+t)},o="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),f={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};i.prototype.cache=t;i.prototype.define=function(n,i){var r=this,f="function"==typeof n,u=function(){return"function"==typeof i&&i(function(n,i){layui[n]=i;t.status[n]=!0}),this};return f&&(i=n,n=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?u.call(r):(r.use(n,u),r)};i.prototype.use=function(n,i,s){function p(n,i){var r="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===n.type||r.test((n.currentTarget||n.srcElement).readyState))&&(t.modules[h]=i,b.removeChild(c),function f(){return++y>250*t.timeout?u(h+" is not a valid module"):void(t.status[h]?v():setTimeout(f,4))}())}function v(){s.push(layui[h]);n.length>1?l.use(n.slice(1),i,s):"function"==typeof i&&i.apply(layui,s)}var l=this,w=t.dir=t.dir?t.dir:e,b=r.getElementsByTagName("head")[0],h,y,c,a;return(n="string"==typeof n?[n]:n,window.jQuery&&jQuery.fn.on&&(l.each(n,function(t,i){"jquery"===i&&n.splice(t,1)}),layui.jquery=layui.$=jQuery),h=n[0],y=0,s=s||[],t.host=t.host||(w.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===n.length||layui["layui.all"]&&f[h]||!layui["layui.all"]&&layui["layui.mobile"]&&f[h])?(v(),l):(t.modules[h]?!function k(){return++y>250*t.timeout?u(h+" is not a valid module"):void("string"==typeof t.modules[h]&&t.status[h]?v():setTimeout(k,4))}():(c=r.createElement("script"),a=(f[h]?w+"lay/":t.base||"")+(l.modules[h]||h)+".js",c.async=!0,c.charset="utf-8",c.src=a+function(){var n=t.version===!0?t.v||(new Date).getTime():t.version||"";return n?"?v="+n:""}(),b.appendChild(c),!c.attachEvent||c.attachEvent.toString&&c.attachEvent.toString().indexOf("[native code")<0||o?c.addEventListener("load",function(n){p(n,a)},!1):c.attachEvent("onreadystatechange",function(n){p(n,a)}),t.modules[h]=a),l)};i.prototype.getStyle=function(t,i){var r=t.currentStyle?t.currentStyle:n.getComputedStyle(t,null);return r[r.getPropertyValue?"getPropertyValue":"getAttribute"](i)};i.prototype.link=function(n,i,f){var o=this,e=r.createElement("link"),h=r.getElementsByTagName("head")[0];"string"==typeof i&&(f=i);var c=(f||n).replace(/\.|\//g,""),s=e.id="layuicss-"+c,l=0;return e.rel="stylesheet",e.href=n+(t.debug?"?v="+(new Date).getTime():""),e.media="all",r.getElementById(s)||h.appendChild(e),"function"!=typeof i?o:(function a(){return++l>10*t.timeout?u(n+" timeout"):void(1989===parseInt(o.getStyle(r.getElementById(s),"width"))?function(){i()}():setTimeout(a,100))}(),o)};i.prototype.addcss=function(n,i,r){return layui.link(t.dir+"css/"+n,i,r)};i.prototype.img=function(n,t,i){var r=new Image;return r.src=n,r.complete?t(r):(r.onload=function(){r.onload=null;t(r)},void(r.onerror=function(n){r.onerror=null;i(n)}))};i.prototype.config=function(n){n=n||{};for(var i in n)t[i]=n[i];return this};i.prototype.modules=function(){var n={};for(var t in f)n[t]=f[t];return n}();i.prototype.extend=function(n){var i=this,t;n=n||{};for(t in n)i[t]||i.modules[t]?u("模块名 "+t+" 已被占用"):i.modules[t]=n[t];return i};i.prototype.router=function(n){var i=this,n=n||location.hash,t={path:[],search:{},hash:(n.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(n)?(n=n.replace(/^#\//,"").replace(/([^#])(#.*$)/,"$1").split("/")||[],i.each(n,function(n,i){/^\w+=/.test(i)?function(){i=i.split("=");t.search[i[0]]=i[1]}():t.path.push(i)}),t):t};i.prototype.data=function(t,i){var r;if(t=t
|