web_toolset/web/layui/layui.js

1 line
284 KiB
JavaScript
Raw Normal View History

/** 2.7.6 | MIT Licensed */;!function(d){"use strict";var t,h=d.document,m={modules:{},status:{},timeout:10,event:{}},r=function(){this.v="2.7.6"},e=d.LAYUI_GLOBAL||{},v=(t=h.currentScript?h.currentScript.src:function(){for(var t,e=h.scripts,o=e.length-1,r=o;0<r;r--)if("interactive"===e[r].readyState){t=e[r].src;break}return t||e[o].src}(),m.dir=e.dir||t.substring(0,t.lastIndexOf("/")+1)),g=function(t,e){e=e||"log",d.console&&console[e]&&console[e]("layui error hint: "+t)},b="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),N=m.builtin={lay:"lay",layer:"layer",laydate:"laydate",laypage:"laypage",laytpl:"laytpl",layedit:"layedit",form:"form",upload:"upload",dropdown:"dropdown",transfer:"transfer",tree:"tree",table:"table",element:"element",rate:"rate",colorpicker:"colorpicker",slider:"slider",carousel:"carousel",flow:"flow",util:"util",code:"code",jquery:"jquery",all:"all","layui.all":"layui.all"},s=(r.prototype.cache=m,r.prototype.define=function(t,r){return"function"==typeof t&&(r=t,t=[]),this.use(t,function(){var o=function(t,e){layui[t]=e,m.status[t]=!0};return"function"==typeof r&&r(function(t,e){o(t,e),m.callback[t]=function(){r(o)}}),this},null,"define"),this},r.prototype.use=function(o,t,e,r){var n=this,i=m.dir=m.dir||v,a=h.getElementsByTagName("head")[0],u=(o="string"==typeof o?[o]:"function"==typeof o?(t=o,["all"]):o,d.jQuery&&jQuery.fn.on&&(n.each(o,function(t,e){"jquery"===e&&o.splice(t,1)}),layui.jquery=layui.$=jQuery),o[0]),l=0;function s(t,e){var o="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;"load"!==t.type&&!o.test((t.currentTarget||t.srcElement).readyState)||(m.modules[u]=e,a.removeChild(p),function r(){return++l>1e3*m.timeout/4?g(u+" is not a valid module","error"):void(m.status[u]?c():setTimeout(r,4))}())}function c(){e.push(layui[u]),1<o.length?n.use(o.slice(1),t,e,r):"function"==typeof t&&(layui.jquery&&"function"==typeof layui.jquery&&"define"!==r?layui.jquery(function(){t.apply(layui,e)}):t.apply(layui,e))}if(e=e||[],m.host=m.host||(i.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===o.length||layui["layui.all"]&&N[u])return c(),n;var p,y=(y=(N[u]?i+"modules/":!/^\{\/\}/.test(n.modules[u])&&m.base||"")+(n.modules[u]||u)+".js").replace(/^\{\/\}/,"");return!m.modules[u]&&layui[u]&&(m.modules[u]=y),m.modules[u]?function f(){return++l>1e3*m.timeout/4?g(u+" is not a valid module","error"):void("string"==typeof m.modules[u]&&m.status[u]?c():setTimeout(f,4))}():((p=h.createElement("script"))["async"]=!0,p.charset="utf-8",p.src=y+((i=!0===m.version?m.v||(new Date).getTime():m.version||"")?"?v="+i:""),a.appendChild(p),!p.attachEvent||p.attachEvent.toString&&p.attachEvent.toString().indexOf("[native code")<0||b?p.addEventListener("load",function(t){s(t,y)},!1):p.attachEvent("onreadystatechange",function(t){s(t,y)}),m.modules[u]=y),n},r.prototype.disuse=function(t){var o=this;return t=o.isArray(t)?t:[t],o.each(t,function(t,e){m.status[e],delete o[e],delete N[e],delete o.modules[e],delete m.status[e],delete m.modules[e]}),o},r.prototype.getStyle=function(t,e){t=t.currentStyle||d.getComputedStyle(t,null);return t[t.getPropertyValue?"getPropertyValue":"getAttribute"](e)},r.prototype.link=function(o,r,t){var n=this,e=h.getElementsByTagName("head")[0],i=h.createElement("link"),t=((t="string"==typeof r?r:t)||o).replace(/\.|\//g,""),a=i.id="layuicss-"+t,u="creating",l=0;return i.rel="stylesheet",i.href=o+(m.debug?"?v="+(new Date).getTime():""),i.media="all",h.getElementById(a)||e.appendChild(i),"function"!=typeof r||function s(t){var e=h.getElementById(a);return++l>1e3*m.timeout/100?g(o+" timeout"):void(1989===parseInt(n.getStyle(e,"width"))?(t===u&&e.removeAttribute("lay-status"),e.getAttribute("lay-status")===u?setTimeout(s,100):r()):(e.setAttribute("lay-status",u),setTimeout(function(){s(u)},100)))}(),n},r.prototype.addcss=function(t,e,o){return layui.link(m.dir+"css/"+t,e,o)},m.callback={},r.prototype.factory=function(t){if(layui[t])return"function"==typeof m.callback[t]?m.callback[t]:null},r.prototype.img=function(t,e,o){var r=new Image;if(r.src=t,r.complete)re