You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
6.9 KiB

2 years ago
  1. /** layui-v2.1.5 MIT License By http://www.layui.com */
  2. ; !function (e) { "use strict"; var t = document, o = { modules: {}, status: {}, timeout: 10, event: {} }, n = function () { this.v = "2.1.5" }, r = function () { var e = t.scripts, o = e[e.length - 1].src; return o.substring(0, o.lastIndexOf("/") + 1) }(), a = function (t) { e.console && console.error && console.error("Layui hint: " + t) }, i = "undefined" != typeof opera && "[object Opera]" === opera.toString(), u = { 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" }; n.prototype.cache = o, n.prototype.define = function (e, t) { var n = this, r = "function" == typeof e, a = function () { return "function" == typeof t && t(function (e, t) { layui[e] = t, o.status[e] = !0 }), this }; return r && (t = e, e = []), layui["layui.all"] || !layui["layui.all"] && layui["layui.mobile"] ? a.call(n) : (n.use(e, a), n) }, n.prototype.use = function (e, n, l) { function s(e, t) { var n = "PLaySTATION 3" === navigator.platform ? /^complete$/ : /^(complete|loaded)$/; ("load" === e.type || n.test((e.currentTarget || e.srcElement).readyState)) && (o.modules[f] = t, d.removeChild(v), function r() { return ++m > 1e3 * o.timeout / 4 ? a(f + " is not a valid module") : void (o.status[f] ? c() : setTimeout(r, 4)) }()) } function c() { l.push(layui[f]), e.length > 1 ? y.use(e.slice(1), n, l) : "function" == typeof n && n.apply(layui, l) } var y = this, p = o.dir = o.dir ? o.dir : r, d = t.getElementsByTagName("head")[0]; e = "string" == typeof e ? [e] : e, window.jQuery && jQuery.fn.on && (y.each(e, function (t, o) { "jquery" === o && e.splice(t, 1) }), layui.jquery = layui.$ = jQuery); var f = e[0], m = 0; if (l = l || [], o.host = o.host || (p.match(/\/\/([\s\S]+?)\//) || ["//" + location.host + "/"])[0], 0 === e.length || layui["layui.all"] && u[f] || !layui["layui.all"] && layui["layui.mobile"] && u[f]) return c(), y; if (o.modules[f]) !function g() { return ++m > 1e3 * o.timeout / 4 ? a(f + " is not a valid module") : void ("string" == typeof o.modules[f] && o.status[f] ? c() : setTimeout(g, 4)) }(); else { var v = t.createElement("script"), h = (u[f] ? p + "lay/" : o.base || "") + (y.modules[f] || f) + ".js"; v.async = !0, v.charset = "utf-8", v.src = h + function () { var e = o.version === !0 ? o.v || (new Date).getTime() : o.version || ""; return e ? "?v=" + e : "" }(), d.appendChild(v), !v.attachEvent || v.attachEvent.toString && v.attachEvent.toString().indexOf("[native code") < 0 || i ? v.addEventListener("load", function (e) { s(e, h) }, !1) : v.attachEvent("onreadystatechange", function (e) { s(e, h) }), o.modules[f] = h } return y }, n.prototype.getStyle = function (t, o) { var n = t.currentStyle ? t.currentStyle : e.getComputedStyle(t, null); return n[n.getPropertyValue ? "getPropertyValue" : "getAttribute"](o) }, n.prototype.link = function (e, n, r) { var i = this, u = t.createElement("link"), l = t.getElementsByTagName("head")[0]; "string" == typeof n && (r = n); var s = (r || e).replace(/\.|\//g, ""), c = u.id = "layuicss-" + s, y = 0; return u.rel = "stylesheet", u.href = e + (o.debug ? "?v=" + (new Date).getTime() : ""), u.media = "all", t.getElementById(c) || l.appendChild(u), "function" != typeof n ? i : (function p() { return ++y > 1e3 * o.timeout / 100 ? a(e + " timeout") : void (1989 === parseInt(i.getStyle(t.getElementById(c), "width")) ? function () { n() }() : setTimeout(p, 100)) }(), i) }, n.prototype.addcss = function (e, t, n) { return layui.link(o.dir + "css/" + e, t, n) }, n.prototype.img = function (e, t, o) { var n = new Image; return n.src = e, n.complete ? t(n) : (n.onload = function () { n.onload = null, t(n) }, void (n.onerror = function (e) { n.onerror = null, o(e) })) }, n.prototype.config = function