biliob/Web/layui/layui.js

1 line
360 KiB
JavaScript
Raw Normal View History

2024-10-25 17:52:03 +08:00
/** v2.9.18 | MIT Licensed */;!function(d){"use strict";var t,h=d.document,m={modules:{},status:{},timeout:10,event:{}},o=function(){this.v="2.9.18"},e=d.LAYUI_GLOBAL||{},v=(t=h.currentScript&&"SCRIPT"===h.currentScript.tagName.toUpperCase()?h.currentScript.src:function(){for(var t,e=h.getElementsByTagName("script"),n=e.length-1,o=n;0<o;o--)if("interactive"===e[o].readyState){t=e[o].src;break}return t||e[n].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",form:"form",upload:"upload",dropdown:"dropdown",transfer:"transfer",tree:"tree",table:"table",treeTable:"treeTable",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=(o.prototype.cache=m,o.prototype.define=function(t,o){return"function"==typeof t&&(o=t,t=[]),this.use(t,function(){var n=function(t,e){layui[t]=e,m.status[t]=!0};return"function"==typeof o&&o(function(t,e){n(t,e),m.callback[t]=function(){o(n)}}),this},null,"define"),this},o.prototype.use=function(n,t,e,o){var r,i,a=this,u=m.dir=m.dir||v,l=h.getElementsByTagName("head")[0],s=(n="string"==typeof n?[n]:"function"==typeof n?(t=n,["all"]):n,d.jQuery&&jQuery.fn.on&&(a.each(n,function(t,e){"jquery"===e&&n.splice(t,1)}),layui.jquery=layui.$=jQuery),n[0]),c=0;function p(t,e){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;"load"!==t.type&&!n.test((t.currentTarget||t.srcElement).readyState)||(m.modules[s]=e,l.removeChild(r),function o(){return++c>1e3*m.timeout/4?g(s+" is not a valid module","error"):void(m.status[s]?y():setTimeout(o,4))}())}function y(){e.push(layui[s]),1<n.length?a.use(n.slice(1),t,e,o):"function"==typeof t&&(layui.jquery&&"function"==typeof layui.jquery&&"define"!==o?layui.jquery(function(){t.apply(layui,e)}):t.apply(layui,e))}return e=e||[],m.host=m.host||(u.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===n.length||layui["layui.all"]&&N[s]?y():(i=(i=(N[s]?u+"modules/":!/^\{\/\}/.test(a.modules[s])&&m.base||"")+(a.modules[s]||s)+".js").replace(/^\{\/\}/,""),!m.modules[s]&&layui[s]&&(m.modules[s]=i),m.modules[s]?function f(){return++c>1e3*m.timeout/4?g(s+" is not a valid module","error"):void("string"==typeof m.modules[s]&&m.status[s]?y():setTimeout(f,4))}():((r=h.createElement("script"))["async"]=!0,r.charset="utf-8",r.src=i+((u=!0===m.version?m.v||(new Date).getTime():m.version||"")?"?v="+u:""),l.appendChild(r),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||b?r.addEventListener("load",function(t){p(t,i)},!1):r.attachEvent("onreadystatechange",function(t){p(t,i)}),m.modules[s]=i)),a},o.prototype.disuse=function(t){var n=this;return t=n.isArray(t)?t:[t],n.each(t,function(t,e){m.status[e],delete n[e],delete N[e],delete n.modules[e],delete m.status[e],delete m.modules[e]}),n},o.prototype.getStyle=function(t,e){t=t.currentStyle||d.getComputedStyle(t,null);return t[t.getPropertyValue?"getPropertyValue":"getAttribute"](e)},o.prototype.link=function(n,o,t){var r=this,e=h.getElementsByTagName("head")[0],i=h.createElement("link"),a="layuicss-"+((t="string"==typeof o?o:t)||n).replace(/\.|\//g,""),u="creating",l=0;return i.href=n+(m.debug?"?v="+(new Date).getTime():""),i.rel="stylesheet",i.id=a,i.media="all",h.getElementById(a)||e.appendChild(i),"function"==typeof o&&function s(t){var e=h.getElementById(a);return++l>1e3*m.timeout/100?g(n+" timeout"):void(1989===parseInt(r.getStyle(e,"width"))?(t===u&&e.removeAttribute("lay-status"),e.getAttribute("lay-status")===u?setTimeout(s,100):o()):(e.setAttribute("lay-status",u),setTimeout(function(){s(u)},100)))}(),r},o.prototype.addcss=function(t,e,n){return layui.link(m.dir+"css/"+t,e,n)},m.callback={},o.prototype.factory=function(t){if(layui[t])return"function"==typeof m.callback[t]?m.callback[t]:null},o.pro