纽威
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
22 KiB

3 years ago
  1. /*! layer-v2.3 弹层组件 License LGPL http://layer.layui.com/ By 贤心 */
  2. ; !function (a, b) { "use strict"; var c, d, e = { getPath: function () { var a = document.scripts, b = a[a.length - 1], c = b.src; if (!b.getAttribute("merge")) return c.substring(0, c.lastIndexOf("/") + 1) }(), enter: function (a) { 13 === a.keyCode && a.preventDefault() }, config: {}, end: {}, btn: ["&#x786E;&#x5B9A;", "&#x53D6;&#x6D88;"], type: ["dialog", "page", "iframe", "loading", "tips"] }, f = { v: "2.3", ie6: !!a.ActiveXObject && !a.XMLHttpRequest, index: 0, path: e.getPath, config: function (a, b) { var d = 0; return a = a || {}, f.cache = e.config = c.extend(e.config, a), f.path = e.config.path || f.path, "string" == typeof a.extend && (a.extend = [a.extend]), f.use("dialog.css", a.extend && a.extend.length > 0 ? function g() { var c = a.extend; f.use(c[c[d] ? d : d - 1], d < c.length ? function () { return ++d, g }() : b) }() : b), this }, use: function (a, b, d) { var e = c("head")[0], a = a.replace(/\s/g, ""), g = /\.css$/.test(a), h = document.createElement(g ? "link" : "script"), i = "layui_layer_" + a.replace(/\.|\//g, ""); return f.path ? (g && (h.rel = "stylesheet"), h[g ? "href" : "src"] = /^http:\/\//.test(a) ? a : f.path + a, h.id = i, c("#" + i)[0] || e.appendChild(h), function j() { (g ? 1989 === parseInt(c("#" + i).css("width")) : f[d || i]) ? function () { b && b(); try { g || e.removeChild(h) } catch (a) { } }() : setTimeout(j, 100) }(), this) : void 0 }, ready: function (a, b) { var d = "function" == typeof a; return d && (b = a), f.config(c.extend(e.config, function () { return d ? {} : { path: a } }()), b), this }, alert: function (a, b, d) { var e = "function" == typeof b; return e && (d = b), f.open(c.extend({ content: a, yes: d }, e ? {} : b)) }, confirm: function (a, b, d, g) { var h = "function" == typeof b; return h && (g = d, d = b), f.open(c.extend({ content: a, btn: e.btn, yes: d, btn2: g }, h ? {} : b)) }, msg: function (a, d, g) { var i = "function" == typeof d, j = e.config.skin, k = (j ? j + " " + j + "-msg" : "") || "layui-layer-msg", l = h.anim.length - 1; return i && (g = d), f.open(c.extend({ content: a, time: 3e3, shade: !1, skin: k, title: !1, closeBtn: !1, btn: !1, end: g }, i && !e.config.skin ? { skin: k + " layui-layer-hui", shift: l } : function () { return d = d || {}, (-1 === d.icon || d.icon === b && !e.config.skin) && (d.skin = k + " " + (d.skin || "layui-layer-hui")), d }())) }, load: function (a, b) { return f.open(c.extend({ type: 3, icon: a || 0, shade: .01 }, b)) }, tips: function (a, b, d) { return f.open(c.extend({ type: 4, content: [a, b], closeBtn: !1, time: 3e3, shade: !1, maxWidth: 210 }, d)) } }, g = function (a) { var b = this; b.index = ++f.index, b.config = c.extend({}, b.config, e.config, a), b.creat() }; g.pt = g.prototype; var h = ["layui-layer", ".layui-layer-title", ".layui-layer-main", ".layui-layer-dialog", "layui-layer-iframe", "layui-layer-content", "layui-layer-btn", "layui-layer-close"]; h.anim = ["layer-anim", "layer-anim-01", "layer-anim-02", "layer-anim-03", "layer-anim-04", "layer-anim-05", "layer-anim-06"], g.pt.config = { type: 0, shade: .2, fix: !0, move: h[1], title: "&#x4FE1;&#x606F;", offset: "auto", area: "auto", closeBtn: 1, time: 0, zIndex: 10001, maxWidth: 360, shift: 0, icon: -1, scrollbar: !0, tips: 2 }, g.pt.vessel = function (a, b) { var c = this, d = c.index, f = c.config, g = f.zIndex + d, i = "object" == typeof f.title, j = f.maxmin && (1 === f.type || 2 === f.type), k = f.title ? '<div class="layui-layer-title" style="' + (i ? f.title[1] : "") + '">' + (i ? f.title[0] : f.title) + "</div>" : ""; return f.zIndex = g, b([f.shade ? '<div class="layui-layer-shade" id="layui-layer-shade' + d + '" times="' + d + '" style="' + ("z-index:" + (g - 1) + "; background-color:" + (f.shade[1] || "#000") + "; opacity:" + (f.shade[0] || f.shade) + "; filter:alpha(opacity=" + (100 * f.shade[0] || 100 * f.shade) + ");") + '"></div>' : "", '<div class="' + h[0] + " " + (h.anim[f.shift] || "") + (" layui-layer-" + e.type[f.type]) + (0 != f.type && 2 != f.type || f.shade ? "" : " layui-layer-border") + " " + (f.skin || "") + '" id="' +