193 lines
478 KiB
JavaScript
193 lines
478 KiB
JavaScript
!function (e) { var t = {}; function __webpack_require__(i) { if (t[i]) return t[i].exports; var n = t[i] = { i: i, l: !1, exports: {} }; return e[i].call(n.exports, n, n.exports, __webpack_require__), n.l = !0, n.exports } __webpack_require__.m = e, __webpack_require__.c = t, __webpack_require__.d = function (e, t, i) { __webpack_require__.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: i }) }, __webpack_require__.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }, __webpack_require__.t = function (e, t) { if (1 & t && (e = __webpack_require__(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var i = Object.create(null); if (__webpack_require__.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var n in e) __webpack_require__.d(i, n, function (t) { return e[t] }.bind(null, n)); return i }, __webpack_require__.n = function (e) { var t = e && e.__esModule ? function getDefault() { return e.default } : function getModuleExports() { return e }; return __webpack_require__.d(t, "a", t), t }, __webpack_require__.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 0) }([function (e, t, i) { i(1), i(2), i(3), i(4), i(5), i(6), i(7), i(8), i(9), i(10), i(11), i(12), i(14), i(15), i(16), i(17), i(18), i(19), i(20), i(21), i(22), i(23), i(24), e.exports = i(25) }, function (e, t, i) {
|
||
/*!
|
||
* jQuery JavaScript Library v1.12.3
|
||
* http://jquery.com/
|
||
*
|
||
* Includes Sizzle.js
|
||
* http://sizzlejs.com/
|
||
*
|
||
* Copyright jQuery Foundation and other contributors
|
||
* Released under the MIT license
|
||
* http://jquery.org/license
|
||
*
|
||
* Date: 2016-04-05T19:16Z
|
||
*/var n, o; n = "undefined" != typeof window ? window : this, o = function (e, t) {
|
||
var i = [], n = e.document, o = i.slice, r = i.concat, s = i.push, c = i.indexOf, d = {}, u = d.toString, h = d.hasOwnProperty, p = {}, jQuery = function (e, t) { return new jQuery.fn.init(e, t) }, y = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, m = /^-ms-/, g = /-([\da-z])/gi, fcamelCase = function (e, t) { return t.toUpperCase() }; function isArrayLike(e) { var t = !!e && "length" in e && e.length, i = jQuery.type(e); return "function" !== i && !jQuery.isWindow(e) && ("array" === i || 0 === t || "number" == typeof t && t > 0 && t - 1 in e) } jQuery.fn = jQuery.prototype = { jquery: "1.12.3", constructor: jQuery, selector: "", length: 0, toArray: function () { return o.call(this) }, get: function (e) { return null != e ? e < 0 ? this[e + this.length] : this[e] : o.call(this) }, pushStack: function (e) { var t = jQuery.merge(this.constructor(), e); return t.prevObject = this, t.context = this.context, t }, each: function (e) { return jQuery.each(this, e) }, map: function (e) { return this.pushStack(jQuery.map(this, (function (t, i) { return e.call(t, i, t) }))) }, slice: function () { return this.pushStack(o.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (e) { var t = this.length, i = +e + (e < 0 ? t : 0); return this.pushStack(i >= 0 && i < t ? [this[i]] : []) }, end: function () { return this.prevObject || this.constructor() }, push: s, sort: i.sort, splice: i.splice }, jQuery.extend = jQuery.fn.extend = function () { var e, t, i, n, o, r, s = arguments[0] || {}, c = 1, d = arguments.length, u = !1; for ("boolean" == typeof s && (u = s, s = arguments[c] || {}, c++), "object" == typeof s || jQuery.isFunction(s) || (s = {}), c === d && (s = this, c--); c < d; c++)if (null != (o = arguments[c])) for (n in o) e = s[n], s !== (i = o[n]) && (u && i && (jQuery.isPlainObject(i) || (t = jQuery.isArray(i))) ? (t ? (t = !1, r = e && jQuery.isArray(e) ? e : []) : r = e && jQuery.isPlainObject(e) ? e : {}, s[n] = jQuery.extend(u, r, i)) : void 0 !== i && (s[n] = i)); return s }, jQuery.extend({ expando: "jQuery" + ("1.12.3" + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (e) { throw new Error(e) }, noop: function () { }, isFunction: function (e) { return "function" === jQuery.type(e) }, isArray: Array.isArray || function (e) { return "array" === jQuery.type(e) }, isWindow: function (e) { return null != e && e == e.window }, isNumeric: function (e) { var t = e && e.toString(); return !jQuery.isArray(e) && t - parseFloat(t) + 1 >= 0 }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, isPlainObject: function (e) { var t; if (!e || "object" !== jQuery.type(e) || e.nodeType || jQuery.isWindow(e)) return !1; try { if (e.constructor && !h.call(e, "constructor") && !h.call(e.constructor.prototype, "isPrototypeOf")) return !1 } catch (e) { return !1 } if (!p.ownFirst) for (t in e) return h.call(e, t); for (t in e); return void 0 === t || h.call(e, t) }, type: function (e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? d[u.call(e)] || "object" : typeof e }, globalEval: function (t) { t && jQuery.trim(t) && (e.execScript || function (t) { e.eval.call(e, t) })(t) }, camelCase: function (e) { return e.replace(m, "ms-").replace(g, fcamelCase) }, nodeName: function (e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() }, each: function (e, t) { var i, n = 0; if (isArrayLike(e)) for (i = e.length; n < i && !1 !== t.call(e[n], n, e[n]); n++); else for (n in e) if (!1 === t.call(e[n], n, e[n])) break; return e }, trim: function (e) { return null == e ? "" : (e + "").replace(y, "") }, makeArray: function (e, t) { var i = t || []; return null != e && (isArrayLike(Object(e)) ? jQuery.merge(i, "string" == typeof e ? [e] : e) : s.call(i, e)), i }, inArray: function (e, t, i) { var n; if (t) { if (c) return c.call(t, e, i); for (n = t.length, i = i ? i < 0 ? Math.max(0, n + i) : i : 0; i < n; i++)if (i in t && t[i] === e) return i } return -1 }, merge: function (e, t) { for (var i = +t.length, n = 0, o = e.length; n < i;)e[o++] = t[n++]; if (i != i) for (; void 0 !== t[n];)e[o++] = t[n++]; return e.length = o, e }, grep: function (e, t, i) { for (var n = [], o = 0, r = e.length, s = !i; o < r; o++)!t(e[o], o) !== s && n.push(e[o]); return n }, map: function (e, t, i) { var n, o, s = 0, c = []; if (isArrayLike(e)) for (n = e.length; s < n; s++)null != (o = t(e[s], s, i)) && c.push(o); else for (s in e) null != (o = t(e[s], s, i)) && c.push(o); return r.apply([], c) }, guid: 1, proxy: function (e, t) { var i, n, r; if ("string" == typeof t && (r = e[t], t = e, e = r), jQuery.isFunction(e)) return i = o.call(arguments, 2), (n = function () { return e.apply(t || this, i.concat(o.call(arguments))) }).guid = e.guid = e.guid || jQuery.guid++, n }, now: function () { return +new Date }, support: p }), "function" == typeof Symbol && (jQuery.fn[Symbol.iterator] = i[Symbol.iterator]), jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), (function (e, t) { d["[object " + t + "]"] = t.toLowerCase() })); var b =
|
||
/*!
|
||
* Sizzle CSS Selector Engine v2.2.1
|
||
* http://sizzlejs.com/
|
||
*
|
||
* Copyright jQuery Foundation and other contributors
|
||
* Released under the MIT license
|
||
* http://jquery.org/license
|
||
*
|
||
* Date: 2015-10-17
|
||
*/
|
||
function (e) { var t, i, n, o, r, s, c, d, u, h, p, y, m, g, b, k, w, C, D, E = "sizzle" + 1 * new Date, S = e.document, L = 0, N = 0, A = createCache(), _ = createCache(), F = createCache(), sortOrder = function (e, t) { return e === t && (p = !0), 0 }, I = {}.hasOwnProperty, j = [], H = j.pop, O = j.push, z = j.push, P = j.slice, indexOf = function (e, t) { for (var i = 0, n = e.length; i < n; i++)if (e[i] === t) return i; return -1 }, R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", B = "[\\x20\\t\\r\\n\\f]", W = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", Y = "\\[" + B + "*(" + W + ")(?:" + B + "*([*^$|!~]?=)" + B + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + W + "))|)" + B + "*\\]", X = ":(" + W + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + Y + ")*)|.*)\\)|)", U = new RegExp(B + "+", "g"), K = new RegExp("^" + B + "+|((?:^|[^\\\\])(?:\\\\.)*)" + B + "+$", "g"), V = new RegExp("^" + B + "*," + B + "*"), G = new RegExp("^" + B + "*([>+~]|" + B + ")" + B + "*"), J = new RegExp("=" + B + "*([^\\]'\"]*?)" + B + "*\\]", "g"), Z = new RegExp(X), Q = new RegExp("^" + W + "$"), ee = { ID: new RegExp("^#(" + W + ")"), CLASS: new RegExp("^\\.(" + W + ")"), TAG: new RegExp("^(" + W + "|[*])"), ATTR: new RegExp("^" + Y), PSEUDO: new RegExp("^" + X), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + B + "*(even|odd|(([+-]|)(\\d*)n|)" + B + "*(?:([+-]|)" + B + "*(\\d+)|))" + B + "*\\)|)", "i"), bool: new RegExp("^(?:" + R + ")$", "i"), needsContext: new RegExp("^" + B + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + B + "*((?:-\\d)?\\d*)" + B + "*\\)|)(?=[^-]|$)", "i") }, te = /^(?:input|select|textarea|button)$/i, ie = /^h\d$/i, ae = /^[^{]+\{\s*\[native \w/, ne = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, le = /[+~]/, oe = /'|\\/g, re = new RegExp("\\\\([\\da-f]{1,6}" + B + "?|(" + B + ")|.)", "ig"), funescape = function (e, t, i) { var n = "0x" + t - 65536; return n != n || i ? t : n < 0 ? String.fromCharCode(n + 65536) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320) }, unloadHandler = function () { y() }; try { z.apply(j = P.call(S.childNodes), S.childNodes), j[S.childNodes.length].nodeType } catch (e) { z = { apply: j.length ? function (e, t) { O.apply(e, P.call(t)) } : function (e, t) { for (var i = e.length, n = 0; e[i++] = t[n++];); e.length = i - 1 } } } function Sizzle(e, t, n, o) { var r, c, u, h, p, g, w, C, L = t && t.ownerDocument, N = t ? t.nodeType : 9; if (n = n || [], "string" != typeof e || !e || 1 !== N && 9 !== N && 11 !== N) return n; if (!o && ((t ? t.ownerDocument || t : S) !== m && y(t), t = t || m, b)) { if (11 !== N && (g = ne.exec(e))) if (r = g[1]) { if (9 === N) { if (!(u = t.getElementById(r))) return n; if (u.id === r) return n.push(u), n } else if (L && (u = L.getElementById(r)) && D(t, u) && u.id === r) return n.push(u), n } else { if (g[2]) return z.apply(n, t.getElementsByTagName(e)), n; if ((r = g[3]) && i.getElementsByClassName && t.getElementsByClassName) return z.apply(n, t.getElementsByClassName(r)), n } if (i.qsa && !F[e + " "] && (!k || !k.test(e))) { if (1 !== N) L = t, C = e; else if ("object" !== t.nodeName.toLowerCase()) { for ((h = t.getAttribute("id")) ? h = h.replace(oe, "\\$&") : t.setAttribute("id", h = E), c = (w = s(e)).length, p = Q.test(h) ? "#" + h : "[id='" + h + "']"; c--;)w[c] = p + " " + toSelector(w[c]); C = w.join(","), L = le.test(e) && testContext(t.parentNode) || t } if (C) try { return z.apply(n, L.querySelectorAll(C)), n } catch (e) { } finally { h === E && t.removeAttribute("id") } } } return d(e.replace(K, "$1"), t, n, o) } function createCache() { var e = []; return function cache(t, i) { return e.push(t + " ") > n.cacheLength && delete cache[e.shift()], cache[t + " "] = i } } function markFunction(e) { return e[E] = !0, e } function assert(e) { var t = m.createElement("div"); try { return !!e(t) } catch (e) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function addHandle(e, t) { for (var i = e.split("|"), o = i.length; o--;)n.attrHandle[i[o]] = t } function siblingCheck(e, t) { var i = t && e, n = i && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || 1 << 31) - (~e.sourceIndex || 1 << 31); if (n) return n; if (i) for (; i = i.nextSibling;)if (i === t) return -1; return e ? 1 : -1 } function createInputPseudo(e) { return function (t) { return "input" === t.nodeName.toLowerCase() && t.type === e } } function createButtonPseudo(e) { return function (t) { var i = t.nodeName.toLowerCase(); return ("input" === i || "button" === i) && t.type === e } } function createPositionalPseudo(e) { return markFunction((function (t) { return t = +t, markFunction((function (i, n) { for (var o, r = e([], i.length, t), s = r.length; s--;)i[o = r[s]] && (i[o] = !(n[o] = i[o])) })) })) } function testContext(e) { return e && void 0 !== e.getElementsByTagName && e } for (t in i = Sizzle.support = {}, r = Sizzle.isXML = function (e) { var t = e && (e.ownerDocument || e).documentElement; return !!t && "HTML" !== t.nodeName }, y = Sizzle.setDocument = function (e) { var t, o, s = e ? e.ownerDocument || e : S; return s !== m && 9 === s.nodeType && s.documentElement ? (g = (m = s).documentElement, b = !r(m), (o = m.defaultView) && o.top !== o && (o.addEventListener ? o.addEventListener("unload", unloadHandler, !1) : o.attachEvent && o.attachEvent("onunload", unloadHandler)), i.attributes = assert((function (e) { return e.className = "i", !e.getAttribute("className") })), i.getElementsByTagName = assert((function (e) { return e.appendChild(m.createComment("")), !e.getElementsByTagName("*").length })), i.getElementsByClassName = ae.test(m.getElementsByClassName), i.getById = assert((function (e) { return g.appendChild(e).id = E, !m.getElementsByName || !m.getElementsByName(E).length })), i.getById ? (n.find.ID = function (e, t) { if (void 0 !== t.getElementById && b) { var i = t.getElementById(e); return i ? [i] : [] } }, n.filter.ID = function (e) { var t = e.replace(re, funescape); return function (e) { return e.getAttribute("id") === t } }) : (delete n.find.ID, n.filter.ID = function (e) { var t = e.replace(re, funescape); return function (e) { var i = void 0 !== e.getAttributeNode && e.getAttributeNode("id"); return i && i.value === t } }), n.find.TAG = i.getElementsByTagName ? function (e, t) { return void 0 !== t.getElementsByTagName ? t.getElementsByTagName(e) : i.qsa ? t.querySelectorAll(e) : void 0 } : function (e, t) { var i, n = [], o = 0, r = t.getElementsByTagName(e); if ("*" === e) { for (; i = r[o++];)1 === i.nodeType && n.push(i); return n } return r }, n.find.CLASS = i.getElementsByClassName && function (e, t) { if (void 0 !== t.getElementsByClassName && b) return t.getElementsByClassName(e) }, w = [], k = [], (i.qsa = ae.test(m.querySelectorAll)) && (assert((function (e) { g.appendChild(e).innerHTML = "<a id='" + E + "'></a><select id='" + E + "-\r\\' msallowcapture=''><option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && k.push("[*^$]=" + B + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || k.push("\\[" + B + "*(?:value|" + R + ")"), e.querySelectorAll("[id~=" + E + "-]").length || k.push("~="), e.querySelectorAll(":checked").length || k.push(":checked"), e.querySelectorAll("a#" + E + "+*").length || k.push(".#.+[+~]") })), assert((function (e) { var t = m.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && k.push("name" + B + "*[*^$|!~]?="), e.querySelectorAll(":enabled").length || k.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), k.push(",.*:") }))), (i.matchesSelector = ae.test(C = g.matches || g.webkitMatchesSelector || g.mozMatchesSelector || g.oMatchesSelector || g.msMatchesSelector)) && assert((function (e) { i.disconnectedMatch = C.call(e, "div"), C.call(e, "[s!='']:x"), w.push("!=", X) })), k = k.length && new RegExp(k.join("|")), w = w.length && new RegExp(w.join("|")), t = ae.test(g.compareDocumentPosition), D = t || ae.test(g.contains) ? function (e, t) { var i = 9 === e.nodeType ? e.documentElement : e, n = t && t.parentNode; return e === n || !(!n || 1 !== n.nodeType || !(i.contains ? i.contains(n) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(n))) } : function (e, t) { if (t) for (; t = t.parentNode;)if (t === e) return !0; return !1 }, sortOrder = t ? function (e, t) { if (e === t) return p = !0, 0; var n = !e.compareDocumentPosition - !t.compareDocumentPosition; return n || (1 & (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !i.sortDetached && t.compareDocumentPosition(e) === n ? e === m || e.ownerDocument === S && D(S, e) ? -1 : t === m || t.ownerDocument === S && D(S, t) ? 1 : h ? indexOf(h, e) - indexOf(h, t) : 0 : 4 & n ? -1 : 1) } : function (e, t) { if (e === t) return p = !0, 0; var i, n = 0, o = e.parentNode, r = t.parentNode, s = [e], c = [t]; if (!o || !r) return e === m ? -1 : t === m ? 1 : o ? -1 : r ? 1 : h ? indexOf(h, e) - indexOf(h, t) : 0; if (o === r) return siblingCheck(e, t); for (i = e; i = i.parentNode;)s.unshift(i); for (i = t; i = i.parentNode;)c.unshift(i); for (; s[n] === c[n];)n++; return n ? siblingCheck(s[n], c[n]) : s[n] === S ? -1 : c[n] === S ? 1 : 0 }, m) : m }, Sizzle.matches = function (e, t) { return Sizzle(e, null, null, t) }, Sizzle.matchesSelector = function (e, t) { if ((e.ownerDocument || e) !== m && y(e), t = t.replace(J, "='$1']"), i.matchesSelector && b && !F[t + " "] && (!w || !w.test(t)) && (!k || !k.test(t))) try { var n = C.call(e, t); if (n || i.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (e) { } return Sizzle(t, m, null, [e]).length > 0 }, Sizzle.contains = function (e, t) { return (e.ownerDocument || e) !== m && y(e), D(e, t) }, Sizzle.attr = function (e, t) { (e.ownerDocument || e) !== m && y(e); var o = n.attrHandle[t.toLowerCase()], r = o && I.call(n.attrHandle, t.toLowerCase()) ? o(e, t, !b) : void 0; return void 0 !== r ? r : i.attributes || !b ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }, Sizzle.error = function (e) { throw new Error("Syntax error, unrecognized expression: " + e) }, Sizzle.uniqueSort = function (e) { var t, n = [], o = 0, r = 0; if (p = !i.detectDuplicates, h = !i.sortStable && e.slice(0), e.sort(sortOrder), p) { for (; t = e[r++];)t === e[r] && (o = n.push(r)); for (; o--;)e.splice(n[o], 1) } return h = null, e }, o = Sizzle.getText = function (e) { var t, i = "", n = 0, r = e.nodeType; if (r) { if (1 === r || 9 === r || 11 === r) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling)i += o(e) } else if (3 === r || 4 === r) return e.nodeValue } else for (; t = e[n++];)i += o(t); return i }, (n = Sizzle.selectors = { cacheLength: 50, createPseudo: markFunction, match: ee, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(re, funescape), e[3] = (e[3] || e[4] || e[5] || "").replace(re, funescape), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || Sizzle.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && Sizzle.error(e[0]), e }, PSEUDO: function (e) { var t, i = !e[6] && e[2]; return ee.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : i && Z.test(i) && (t = s(i, !0)) && (t = i.indexOf(")", i.length - t) - i.length) && (e[0] = e[0].slice(0, t), e[2] = i.slice(0, t)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(re, funescape).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = A[e + " "]; return t || (t = new RegExp("(^|" + B + ")" + e + "(" + B + "|$)")) && A(e, (function (e) { return t.test("string" == typeof e.className && e.className || void 0 !== e.getAttribute && e.getAttribute("class") || "") })) }, ATTR: function (e, t, i) { return function (n) { var o = Sizzle.attr(n, e); return null == o ? "!=" === t : !t || (o += "", "=" === t ? o === i : "!=" === t ? o !== i : "^=" === t ? i && 0 === o.indexOf(i) : "*=" === t ? i && o.indexOf(i) > -1 : "$=" === t ? i && o.slice(-i.length) === i : "~=" === t ? (" " + o.replace(U, " ") + " ").indexOf(i) > -1 : "|=" === t && (o === i || o.slice(0, i.length + 1) === i + "-")) } }, CHILD: function (e, t, i, n, o) { var r = "nth" !== e.slice(0, 3), s = "last" !== e.slice(-4), c = "of-type" === t; return 1 === n && 0 === o ? function (e) { return !!e.parentNode } : function (t, i, d) { var u, h, p, y, m, g, b = r !== s ? "nextSibling" : "previousSibling", k = t.parentNode, w = c && t.nodeName.toLowerCase(), C = !d && !c, D = !1; if (k) { if (r) { for (; b;) { for (y = t; y = y[b];)if (c ? y.nodeName.toLowerCase() === w : 1 === y.nodeType) return !1; g = b = "only" === e && !g && "nextSibling" } return !0 } if (g = [s ? k.firstChild : k.lastChild], s && C) { for (D = (m = (u = (h = (p = (y = k)[E] || (y[E] = {}))[y.uniqueID] || (p[y.uniqueID] = {}))[e] || [])[0] === L && u[1]) && u[2], y = m && k.childNodes[m]; y = ++m && y && y[b] || (D = m = 0) || g.pop();)if (1 === y.nodeType && ++D && y === t) { h[e] = [L, m, D]; break } } else if (C && (D = m = (u = (h = (p = (y = t)[E] || (y[E] = {}))[y.uniqueID] || (p[y.uniqueID] = {}))[e] || [])[0] === L && u[1]), !1 === D) for (; (y = ++m && y && y[b] || (D = m = 0) || g.pop()) && ((c ? y.nodeName.toLowerCase() !== w : 1 !== y.nodeType) || !++D || (C && ((h = (p = y[E] || (y[E] = {}))[y.uniqueID] || (p[y.uniqueID] = {}))[e] = [L, D]), y !== t));); return (D -= o) === n || D % n == 0 && D / n >= 0 } } }, PSEUDO: function (e, t) { var i, o = n.pseudos[e] || n.setFilters[e.toLowerCase()] || Sizzle.error("unsupported pseudo: " + e); return o[E] ? o(t) : o.length > 1 ? (i = [e, e, "", t], n.setFilters.hasOwnProperty(e.toLowerCase()) ? markFunction((function (e, i) { for (var n, r = o(e, t), s = r.length; s--;)e[n = indexOf(e, r[s])] = !(i[n] = r[s]) })) : function (e) { return o(e, 0, i) }) : o } }, pseudos: { not: markFunction((function (e) { var t = [], i = [], n = c(e.replace(K, "$1")); return n[E] ? markFunction((function (e, t, i, o) { for (var r, s = n(e, null, o, []), c = e.length; c--;)(r = s[c]) && (e[c] = !(t[c] = r)) })) : function (e, o, r) { return t[0] = e, n(t, null, r, i), t[0] = null, !i.pop() } })), has: markFunction((function (e) { return function (t) { return Sizzle(e, t).length > 0 } })), contains: markFunction((function (e) { return e = e.replace(re, funescape), function (t) { return (t.textContent || t.innerText || o(t)).indexOf(e) > -1 } })), lang: markFunction((function (e) { return Q.test(e || "") || Sizzle.error("unsupported lang: " + e), e = e.replace(re, funescape).toLowerCase(), function (t) { var i; do { if (i = b ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (i = i.toLowerCase()) === e || 0 === i.indexOf(e + "-") } while ((t = t.parentNode) && 1 === t.nodeType); return !1 } })), target: function (t) { var i = e.location && e.location.hash; return i && i.slice(1) === t.id }, root: function (e) { return e === g }, focus: function (e) { return e === m.activeElement && (!m.hasFocus || m.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: function (e) { return !1 === e.disabled }, disabled: function (e) { return !0 === e.disabled }, checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling)if (e.nodeType < 6) return !1; return !0 }, parent: function (e) { return !n.pseudos.empty(e) }, header: function (e) { return ie.test(e.nodeName) }, input: function (e) { return te.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase()) }, first: createPositionalPseudo((function () { return [0] })), last: createPositionalPseudo((function (e, t) { return [t - 1] })), eq: createPositionalPseudo((function (e, t, i) { return [i < 0 ? i + t : i] })), even: createPositionalPseudo((function (e, t) { for (var i = 0; i < t; i += 2)e.push(i); return e })), odd: createPositionalPseudo((function (e, t) { for (var i = 1; i < t; i += 2)e.push(i); return e })), lt: createPositionalPseudo((function (e, t, i) { for (var n = i < 0 ? i + t : i; --n >= 0;)e.push(n); return e })), gt: createPositionalPseudo((function (e, t, i) { for (var n = i < 0 ? i + t : i; ++n < t;)e.push(n); return e })) } }).pseudos.nth = n.pseudos.eq, { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) n.pseudos[t] = createInputPseudo(t); for (t in { submit: !0, reset: !0 }) n.pseudos[t] = createButtonPseudo(t); function setFilters() { } function toSelector(e) { for (var t = 0, i = e.length, n = ""; t < i; t++)n += e[t].value; return n } function addCombinator(e, t, i) { var n = t.dir, o = i && "parentNode" === n, r = N++; return t.first ? function (t, i, r) { for (; t = t[n];)if (1 === t.nodeType || o) return e(t, i, r) } : function (t, i, s) { var c, d, u, h = [L, r]; if (s) { for (; t = t[n];)if ((1 === t.nodeType || o) && e(t, i, s)) return !0 } else for (; t = t[n];)if (1 === t.nodeType || o) { if ((c = (d = (u = t[E] || (t[E] = {}))[t.uniqueID] || (u[t.uniqueID] = {}))[n]) && c[0] === L && c[1] === r) return h[2] = c[2]; if (d[n] = h, h[2] = e(t, i, s)) return !0 } } } function elementMatcher(e) { return e.length > 1 ? function (t, i, n) { for (var o = e.length; o--;)if (!e[o](t, i, n)) return !1; return !0 } : e[0] } function condense(e, t, i, n, o) { for (var r, s = [], c = 0, d = e.length, u = null != t; c < d; c++)(r = e[c]) && (i && !i(r, n, o) || (s.push(r), u && t.push(c))); return s } function setMatcher(e, t, i, n, o, r) { return n && !n[E] && (n = setMatcher(n)), o && !o[E] && (o = setMatcher(o, r)), markFunction((function (r, s, c, d) { var u, h, p, y = [], m = [], g = s.length, b = r || function multipleContexts(e, t, i) { for (var n = 0, o = t.length; n < o; n++)Sizzle(e, t[n], i); return i }(t || "*", c.nodeType ? [c] : c, []), k = !e || !r && t ? b : condense(b, y, e, c, d), w = i ? o || (r ? e : g || n) ? [] : s : k; if (i && i(k, w, c, d), n) for (u = condense(w, m), n(u, [], c, d), h = u.length; h--;)(p = u[h]) && (w[m[h]] = !(k[m[h]] = p)); if (r) { if (o || e) { if (o) { for (u = [], h = w.length; h--;)(p = w[h]) && u.push(k[h] = p); o(null, w = [], u, d) } for (h = w.length; h--;)(p = w[h]) && (u = o ? indexOf(r, p) : y[h]) > -1 && (r[u] = !(s[u] = p)) } } else w = condense(w === s ? w.splice(g, w.length) : w), o ? o(null, s, w, d) : z.apply(s, w) })) } function matcherFromTokens(e) { for (var t, i, o, r = e.length, s = n.relative[e[0].type], c = s || n.relative[" "], d = s ? 1 : 0, h = addCombinator((function (e) { return e === t }), c, !0), p = addCombinator((function (e) { return indexOf(t, e) > -1 }), c, !0), y = [function (e, i, n) { var o = !s && (n || i !== u) || ((t = i).nodeType ? h(e, i, n) : p(e, i, n)); return t = null, o }]; d < r; d++)if (i = n.relative[e[d].type]) y = [addCombinator(elementMatcher(y), i)]; else { if ((i = n.filter[e[d].type].apply(null, e[d].matches))[E]) { for (o = ++d; o < r && !n.relative[e[o].type]; o++); return setMatcher(d > 1 && elementMatcher(y), d > 1 && toSelector(e.slice(0, d - 1).concat({ value: " " === e[d - 2].type ? "*" : "" })).replace(K, "$1"), i, d < o && matcherFromTokens(e.slice(d, o)), o < r && matcherFromTokens(e = e.slice(o)), o < r && toSelector(e)) } y.push(i) } return elementMatcher(y) } return setFilters.prototype = n.filters = n.pseudos, n.setFilters = new setFilters, s = Sizzle.tokenize = function (e, t) { var i, o, r, s, c, d, u, h = _[e + " "]; if (h) return t ? 0 : h.slice(0); for (c = e, d = [], u = n.preFilter; c;) { for (s in i && !(o = V.exec(c)) || (o && (c = c.slice(o[0].length) || c), d.push(r = [])), i = !1, (o = G.exec(c)) && (i = o.shift(), r.push({ value: i, type: o[0].replace(K, " ") }), c = c.slice(i.length)), n.filter) !(o = ee[s].exec(c)) || u[s] && !(o = u[s](o)) || (i = o.shift(), r.push({ value: i, type: s, matches: o }), c = c.slice(i.length)); if (!i) break } return t ? c.length : c ? Sizzle.error(e) : _(e, d).slice(0) }, c = Sizzle.compile = function (e, t) { var i, o = [], r = [], c = F[e + " "]; if (!c) { for (t || (t = s(e)), i = t.length; i--;)(c = matcherFromTokens(t[i]))[E] ? o.push(c) : r.push(c); (c = F(e, function matcherFromGroupMatchers(e, t) { var i = t.length > 0, o = e.length > 0, superMatcher = function (r, s, c, d, h) { var p, g, k, w = 0, C = "0", D = r && [], E = [], S = u, N = r || o && n.find.TAG("*", h), A = L += null == S ? 1 : Math.random() || .1, _ = N.length; for (h && (u = s === m || s || h); C !== _ && null != (p = N[C]); C++) { if (o && p) { for (g = 0, s || p.ownerDocument === m || (y(p), c = !b); k = e[g++];)if (k(p, s || m, c)) { d.push(p); break } h && (L = A) } i && ((p = !k && p) && w--, r && D.push(p)) } if (w += C, i && C !== w) { for (g = 0; k = t[g++];)k(D, E, s, c); if (r) { if (w > 0) for (; C--;)D[C] || E[C] || (E[C] = H.call(d)); E = condense(E) } z.apply(d, E), h && !r && E.length > 0 && w + t.length > 1 && Sizzle.uniqueSort(d) } return h && (L = A, u = S), D }; return i ? markFunction(superMatcher) : superMatcher }(r, o))).selector = e } return c }, d = Sizzle.select = function (e, t, o, r) { var d, u, h, p, y, m = "function" == typeof e && e, g = !r && s(e = m.selector || e); if (o = o || [], 1 === g.length) { if ((u = g[0] = g[0].slice(0)).length > 2 && "ID" === (h = u[0]).type && i.getById && 9 === t.nodeType && b && n.relative[u[1].type]) { if (!(t = (n.find.ID(h.matches[0].replace(re, funescape), t) || [])[0])) return o; m && (t = t.parentNode), e = e.slice(u.shift().value.length) } for (d = ee.needsContext.test(e) ? 0 : u.length; d-- && (h = u[d], !n.relative[p = h.type]);)if ((y = n.find[p]) && (r = y(h.matches[0].replace(re, funescape), le.test(u[0].type) && testContext(t.parentNode) || t))) { if (u.splice(d, 1), !(e = r.length && toSelector(u))) return z.apply(o, r), o; break } } return (m || c(e, g))(r, t, !b, o, !t || le.test(e) && testContext(t.parentNode) || t), o }, i.sortStable = E.split("").sort(sortOrder).join("") === E, i.detectDuplicates = !!p, y(), i.sortDetached = assert((function (e) { return 1 & e.compareDocumentPosition(m.createElement("div")) })), assert((function (e) { return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href") })) || addHandle("type|href|height|width", (function (e, t, i) { if (!i) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2) })), i.attributes && assert((function (e) { return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") })) || addHandle("value", (function (e, t, i) { if (!i && "input" === e.nodeName.toLowerCase()) return e.defaultValue })), assert((function (e) { return null == e.getAttribute("disabled") })) || addHandle(R, (function (e, t, i) { var n; if (!i) return !0 === e[t] ? t.toLowerCase() : (n = e.getAttributeNode(t)) && n.specified ? n.value : null })), Sizzle }(e); jQuery.find = b, jQuery.expr = b.selectors, jQuery.expr[":"] = jQuery.expr.pseudos, jQuery.uniqueSort = jQuery.unique = b.uniqueSort, jQuery.text = b.getText, jQuery.isXMLDoc = b.isXML, jQuery.contains = b.contains; var dir = function (e, t, i) { for (var n = [], o = void 0 !== i; (e = e[t]) && 9 !== e.nodeType;)if (1 === e.nodeType) { if (o && jQuery(e).is(i)) break; n.push(e) } return n }, siblings = function (e, t) { for (var i = []; e; e = e.nextSibling)1 === e.nodeType && e !== t && i.push(e); return i }, k = jQuery.expr.match.needsContext, w = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/, C = /^.[^:#\[\.,]*$/; function winnow(e, t, i) { if (jQuery.isFunction(t)) return jQuery.grep(e, (function (e, n) { return !!t.call(e, n, e) !== i })); if (t.nodeType) return jQuery.grep(e, (function (e) { return e === t !== i })); if ("string" == typeof t) { if (C.test(t)) return jQuery.filter(t, e, i); t = jQuery.filter(t, e) } return jQuery.grep(e, (function (e) { return jQuery.inArray(e, t) > -1 !== i })) } jQuery.filter = function (e, t, i) { var n = t[0]; return i && (e = ":not(" + e + ")"), 1 === t.length && 1 === n.nodeType ? jQuery.find.matchesSelector(n, e) ? [n] : [] : jQuery.find.matches(e, jQuery.grep(t, (function (e) { return 1 === e.nodeType }))) }, jQuery.fn.extend({ find: function (e) { var t, i = [], n = this, o = n.length; if ("string" != typeof e) return this.pushStack(jQuery(e).filter((function () { for (t = 0; t < o; t++)if (jQuery.contains(n[t], this)) return !0 }))); for (t = 0; t < o; t++)jQuery.find(e, n[t], i); return (i = this.pushStack(o > 1 ? jQuery.unique(i) : i)).selector = this.selector ? this.selector + " " + e : e, i }, filter: function (e) { return this.pushStack(winnow(this, e || [], !1)) }, not: function (e) { return this.pushStack(winnow(this, e || [], !0)) }, is: function (e) { return !!winnow(this, "string" == typeof e && k.test(e) ? jQuery(e) : e || [], !1).length } }); var D, E = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/; (jQuery.fn.init = function (e, t, i) { var o, r; if (!e) return this; if (i = i || D, "string" == typeof e) { if (!(o = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : E.exec(e)) || !o[1] && t) return !t || t.jquery ? (t || i).find(e) : this.constructor(t).find(e); if (o[1]) { if (t = t instanceof jQuery ? t[0] : t, jQuery.merge(this, jQuery.parseHTML(o[1], t && t.nodeType ? t.ownerDocument || t : n, !0)), w.test(o[1]) && jQuery.isPlainObject(t)) for (o in t) jQuery.isFunction(this[o]) ? this[o](t[o]) : this.attr(o, t[o]); return this } if ((r = n.getElementById(o[2])) && r.parentNode) { if (r.id !== o[2]) return D.find(e); this.length = 1, this[0] = r } return this.context = n, this.selector = e, this } return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : jQuery.isFunction(e) ? void 0 !== i.ready ? i.ready(e) : e(jQuery) : (void 0 !== e.selector && (this.selector = e.selector, this.context = e.context), jQuery.makeArray(e, this)) }).prototype = jQuery.fn, D = jQuery(n); var S = /^(?:parents|prev(?:Until|All))/, L = { children: !0, contents: !0, next: !0, prev: !0 }; function sibling(e, t) { do { e = e[t] } while (e && 1 !== e.nodeType); return e } jQuery.fn.extend({ has: function (e) { var t, i = jQuery(e, this), n = i.length; return this.filter((function () { for (t = 0; t < n; t++)if (jQuery.contains(this, i[t])) return !0 })) }, closest: function (e, t) { for (var i, n = 0, o = this.length, r = [], s = k.test(e) || "string" != typeof e ? jQuery(e, t || this.context) : 0; n < o; n++)for (i = this[n]; i && i !== t; i = i.parentNode)if (i.nodeType < 11 && (s ? s.index(i) > -1 : 1 === i.nodeType && jQuery.find.matchesSelector(i, e))) { r.push(i); break } return this.pushStack(r.length > 1 ? jQuery.uniqueSort(r) : r) }, index: function (e) { return e ? "string" == typeof e ? jQuery.inArray(this[0], jQuery(e)) : jQuery.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(e, t)))) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }), jQuery.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return dir(e, "parentNode") }, parentsUntil: function (e, t, i) { return dir(e, "parentNode", i) }, next: function (e) { return sibling(e, "nextSibling") }, prev: function (e) { return sibling(e, "previousSibling") }, nextAll: function (e) { return dir(e, "nextSibling") }, prevAll: function (e) { return dir(e, "previousSibling") }, nextUntil: function (e, t, i) { return dir(e, "nextSibling", i) }, prevUntil: function (e, t, i) { return dir(e, "previousSibling", i) }, siblings: function (e) { return siblings((e.parentNode || {}).firstChild, e) }, children: function (e) { return siblings(e.firstChild) }, contents: function (e) { return jQuery.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : jQuery.merge([], e.childNodes) } }, (function (e, t) { jQuery.fn[e] = function (i, n) { var o = jQuery.map(this, t, i); return "Until" !== e.slice(-5) && (n = i), n && "string" == typeof n && (o = jQuery.filter(n, o)), this.length > 1 && (L[e] || (o = jQuery.uniqueSort(o)), S.test(e) && (o = o.reverse())), this.pushStack(o) } })); var N, A, _ = /\S+/g; function detach() { n.addEventListener ? (n.removeEventListener("DOMContentLoaded", completed), e.removeEventListener("load", completed)) : (n.detachEvent("onreadystatechange", completed), e.detachEvent("onload", completed)) } function completed() { (n.addEventListener || "load" === e.event.type || "complete" === n.readyState) && (detach(), jQuery.ready()) } for (A in jQuery.Callbacks = function (e) { e = "string" == typeof e ? function createOptions(e) { var t = {}; return jQuery.each(e.match(_) || [], (function (e, i) { t[i] = !0 })), t }(e) : jQuery.extend({}, e); var t, i, n, o, r = [], s = [], c = -1, fire = function () { for (o = e.once, n = t = !0; s.length; c = -1)for (i = s.shift(); ++c < r.length;)!1 === r[c].apply(i[0], i[1]) && e.stopOnFalse && (c = r.length, i = !1); e.memory || (i = !1), t = !1, o && (r = i ? [] : "") }, d = { add: function () { return r && (i && !t && (c = r.length - 1, s.push(i)), function add(t) { jQuery.each(t, (function (t, i) { jQuery.isFunction(i) ? e.unique && d.has(i) || r.push(i) : i && i.length && "string" !== jQuery.type(i) && add(i) })) }(arguments), i && !t && fire()), this }, remove: function () { return jQuery.each(arguments, (function (e, t) { for (var i; (i = jQuery.inArray(t, r, i)) > -1;)r.splice(i, 1), i <= c && c-- })), this }, has: function (e) { return e ? jQuery.inArray(e, r) > -1 : r.length > 0 }, empty: function () { return r && (r = []), this }, disable: function () { return o = s = [], r = i = "", this }, disabled: function () { return !r }, lock: function () { return o = !0, i || d.disable(), this }, locked: function () { return !!o }, fireWith: function (e, i) { return o || (i = [e, (i = i || []).slice ? i.slice() : i], s.push(i), t || fire()), this }, fire: function () { return d.fireWith(this, arguments), this }, fired: function () { return !!n } }; return d }, jQuery.extend({ Deferred: function (e) { var t = [["resolve", "done", jQuery.Callbacks("once memory"), "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"], ["notify", "progress", jQuery.Callbacks("memory")]], i = "pending", n = { state: function () { return i }, always: function () { return o.done(arguments).fail(arguments), this }, then: function () { var e = arguments; return jQuery.Deferred((function (i) { jQuery.each(t, (function (t, r) { var s = jQuery.isFunction(e[t]) && e[t]; o[r[1]]((function () { var e = s && s.apply(this, arguments); e && jQuery.isFunction(e.promise) ? e.promise().progress(i.notify).done(i.resolve).fail(i.reject) : i[r[0] + "With"](this === n ? i.promise() : this, s ? [e] : arguments) })) })), e = null })).promise() }, promise: function (e) { return null != e ? jQuery.extend(e, n) : n } }, o = {}; return n.pipe = n.then, jQuery.each(t, (function (e, r) { var s = r[2], c = r[3]; n[r[1]] = s.add, c && s.add((function () { i = c }), t[1 ^ e][2].disable, t[2][2].lock), o[r[0]] = function () { return o[r[0] + "With"](this === o ? n : this, arguments), this }, o[r[0] + "With"] = s.fireWith })), n.promise(o), e && e.call(o, o), o }, when: function (e) { var t, i, n, r = 0, s = o.call(arguments), c = s.length, d = 1 !== c || e && jQuery.isFunction(e.promise) ? c : 0, u = 1 === d ? e : jQuery.Deferred(), updateFunc = function (e, i, n) { return function (r) { i[e] = this, n[e] = arguments.length > 1 ? o.call(arguments) : r, n === t ? u.notifyWith(i, n) : --d || u.resolveWith(i, n) } }; if (c > 1) for (t = new Array(c), i = new Array(c), n = new Array(c); r < c; r++)s[r] && jQuery.isFunction(s[r].promise) ? s[r].promise().progress(updateFunc(r, i, t)).done(updateFunc(r, n, s)).fail(u.reject) : --d; return d || u.resolveWith(n, s), u.promise() } }), jQuery.fn.ready = function (e) { return jQuery.ready.promise().done(e), this }, jQuery.extend({ isReady: !1, readyWait: 1, holdReady: function (e) { e ? jQuery.readyWait++ : jQuery.ready(!0) }, ready: function (e) { (!0 === e ? --jQuery.readyWait : jQuery.isReady) || (jQuery.isReady = !0, !0 !== e && --jQuery.readyWait > 0 || (N.resolveWith(n, [jQuery]), jQuery.fn.triggerHandler && (jQuery(n).triggerHandler("ready"), jQuery(n).off("ready")))) } }), jQuery.ready.promise = function (t) { if (!N) if (N = jQuery.Deferred(), "complete" === n.readyState || "loading" !== n.readyState && !n.documentElement.doScroll) e.setTimeout(jQuery.ready); else if (n.addEventListener) n.addEventListener("DOMContentLoaded", completed), e.addEventListener("load", completed); else { n.attachEvent("onreadystatechange", completed), e.attachEvent("onload", completed); var i = !1; try { i = null == e.frameElement && n.documentElement } catch (e) { } i && i.doScroll && function doScrollCheck() { if (!jQuery.isReady) { try { i.doScroll("left") } catch (t) { return e.setTimeout(doScrollCheck, 50) } detach(), jQuery.ready() } }() } return N.promise(t) }, jQuery.ready.promise(), jQuery(p)) break; p.ownFirst = "0" === A, p.inlineBlockNeedsLayout = !1, jQuery((function () { var e, t, i, o; (i = n.getElementsByTagName("body")[0]) && i.style && (t = n.createElement("div"), (o = n.createElement("div")).style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", i.appendChild(o).appendChild(t), void 0 !== t.style.zoom && (t.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", p.inlineBlockNeedsLayout = e = 3 === t.offsetWidth, e && (i.style.zoom = 1)), i.removeChild(o)) })), function () { var e = n.createElement("div"); p.deleteExpando = !0; try { delete e.test } catch (e) { p.deleteExpando = !1 } e = null }(); var F, acceptData = function (e) { var t = jQuery.noData[(e.nodeName + " ").toLowerCase()], i = +e.nodeType || 1; return (1 === i || 9 === i) && (!t || !0 !== t && e.getAttribute("classid") === t) }, I = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, j = /([A-Z])/g; function dataAttr(e, t, i) { if (void 0 === i && 1 === e.nodeType) { var n = "data-" + t.replace(j, "-$1").toLowerCase(); if ("string" == typeof (i = e.getAttribute(n))) { try { i = "true" === i || "false" !== i && ("null" === i ? null : +i + "" === i ? +i : I.test(i) ? jQuery.parseJSON(i) : i) } catch (e) { } jQuery.data(e, t, i) } else i = void 0 } return i } function isEmptyDataObject(e) { var t; for (t in e) if (("data" !== t || !jQuery.isEmptyObject(e[t])) && "toJSON" !== t) return !1; return !0 } function internalData(e, t, n, o) { if (acceptData(e)) { var r, s, c = jQuery.expando, d = e.nodeType, u = d ? jQuery.cache : e, h = d ? e[c] : e[c] && c; if (h && u[h] && (o || u[h].data) || void 0 !== n || "string" != typeof t) return h || (h = d ? e[c] = i.pop() || jQuery.guid++ : c), u[h] || (u[h] = d ? {} : { toJSON: jQuery.noop }), "object" != typeof t && "function" != typeof t || (o ? u[h] = jQuery.extend(u[h], t) : u[h].data = jQuery.extend(u[h].data, t)), s = u[h], o || (s.data || (s.data = {}), s = s.data), void 0 !== n && (s[jQuery.camelCase(t)] = n), "string" == typeof t ? null == (r = s[t]) && (r = s[jQuery.camelCase(t)]) : r = s, r } } function internalRemoveData(e, t, i) { if (acceptData(e)) { var n, o, r = e.nodeType, s = r ? jQuery.cache : e, c = r ? e[jQuery.expando] : jQuery.expando; if (s[c]) { if (t && (n = i ? s[c] : s[c].data)) { o = (t = jQuery.isArray(t) ? t.concat(jQuery.map(t, jQuery.camelCase)) : t in n || (t = jQuery.camelCase(t)) in n ? [t] : t.split(" ")).length; for (; o--;)delete n[t[o]]; if (i ? !isEmptyDataObject(n) : !jQuery.isEmptyObject(n)) return } (i || (delete s[c].data, isEmptyDataObject(s[c]))) && (r ? jQuery.cleanData([e], !0) : p.deleteExpando || s != s.window ? delete s[c] : s[c] = void 0) } } } jQuery.extend({ cache: {}, noData: { "applet ": !0, "embed ": !0, "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function (e) { return !!(e = e.nodeType ? jQuery.cache[e[jQuery.expando]] : e[jQuery.expando]) && !isEmptyDataObject(e) }, data: function (e, t, i) { return internalData(e, t, i) }, removeData: function (e, t) { return internalRemoveData(e, t) }, _data: function (e, t, i) { return internalData(e, t, i, !0) }, _removeData: function (e, t) { return internalRemoveData(e, t, !0) } }), jQuery.fn.extend({ data: function (e, t) { var i, n, o, r = this[0], s = r && r.attributes; if (void 0 === e) { if (this.length && (o = jQuery.data(r), 1 === r.nodeType && !jQuery._data(r, "parsedAttrs"))) { for (i = s.length; i--;)s[i] && 0 === (n = s[i].name).indexOf("data-") && dataAttr(r, n = jQuery.camelCase(n.slice(5)), o[n]); jQuery._data(r, "parsedAttrs", !0) } return o } return "object" == typeof e ? this.each((function () { jQuery.data(this, e) })) : arguments.length > 1 ? this.each((function () { jQuery.data(this, e, t) })) : r ? dataAttr(r, e, jQuery.data(r, e)) : void 0 }, removeData: function (e) { return this.each((function () { jQuery.removeData(this, e) })) } }), jQuery.extend({ queue: function (e, t, i) { var n; if (e) return t = (t || "fx") + "queue", n = jQuery._data(e, t), i && (!n || jQuery.isArray(i) ? n = jQuery._data(e, t, jQuery.makeArray(i)) : n.push(i)), n || [] }, dequeue: function (e, t) { t = t || "fx"; var i = jQuery.queue(e, t), n = i.length, o = i.shift(), r = jQuery._queueHooks(e, t); "inprogress" === o && (o = i.shift(), n--), o && ("fx" === t && i.unshift("inprogress"), delete r.stop, o.call(e, (function () { jQuery.dequeue(e, t) }), r)), !n && r && r.empty.fire() }, _queueHooks: function (e, t) { var i = t + "queueHooks"; return jQuery._data(e, i) || jQuery._data(e, i, { empty: jQuery.Callbacks("once memory").add((function () { jQuery._removeData(e, t + "queue"), jQuery._removeData(e, i) })) }) } }), jQuery.fn.extend({ queue: function (e, t) { var i = 2; return "string" != typeof e && (t = e, e = "fx", i--), arguments.length < i ? jQuery.queue(this[0], e) : void 0 === t ? this : this.each((function () { var i = jQuery.queue(this, e, t); jQuery._queueHooks(this, e), "fx" === e && "inprogress" !== i[0] && jQuery.dequeue(this, e) })) }, dequeue: function (e) { return this.each((function () { jQuery.dequeue(this, e) })) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, t) { var i, n = 1, o = jQuery.Deferred(), r = this, s = this.length, resolve = function () { --n || o.resolveWith(r, [r]) }; for ("string" != typeof e && (t = e, e = void 0), e = e || "fx"; s--;)(i = jQuery._data(r[s], e + "queueHooks")) && i.empty && (n++, i.empty.add(resolve)); return resolve(), o.promise(t) } }), p.shrinkWrapBlocks = function () { return null != F ? F : (F = !1, (t = n.getElementsByTagName("body")[0]) && t.style ? (e = n.createElement("div"), (i = n.createElement("div")).style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", t.appendChild(i).appendChild(e), void 0 !== e.style.zoom && (e.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", e.appendChild(n.createElement("div")).style.width = "5px", F = 3 !== e.offsetWidth), t.removeChild(i), F) : void 0); var e, t, i }; var H = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, O = new RegExp("^(?:([+-])=|)(" + H + ")([a-z%]*)$", "i"), z = ["Top", "Right", "Bottom", "Left"], isHidden = function (e, t) { return e = t || e, "none" === jQuery.css(e, "display") || !jQuery.contains(e.ownerDocument, e) }; function adjustCSS(e, t, i, n) { var o, r = 1, s = 20, c = n ? function () { return n.cur() } : function () { return jQuery.css(e, t, "") }, d = c(), u = i && i[3] || (jQuery.cssNumber[t] ? "" : "px"), h = (jQuery.cssNumber[t] || "px" !== u && +d) && O.exec(jQuery.css(e, t)); if (h && h[3] !== u) { u = u || h[3], i = i || [], h = +d || 1; do { h /= r = r || ".5", jQuery.style(e, t, h + u) } while (r !== (r = c() / d) && 1 !== r && --s) } return i && (h = +h || +d || 0, o = i[1] ? h + (i[1] + 1) * i[2] : +i[2], n && (n.unit = u, n.start = h, n.end = o)), o } var P, R, B, access = function (e, t, i, n, o, r, s) { var c = 0, d = e.length, u = null == i; if ("object" === jQuery.type(i)) for (c in o = !0, i) access(e, t, c, i[c], !0, r, s); else if (void 0 !== n && (o = !0, jQuery.isFunction(n) || (s = !0), u && (s ? (t.call(e, n), t = null) : (u = t, t = function (e, t, i) { return u.call(jQuery(e), i) })), t)) for (; c < d; c++)t(e[c], i, s ? n : n.call(e[c], c, t(e[c], i))); return o ? e : u ? t.call(e) : d ? t(e[0], i) : r }, W = /^(?:checkbox|radio)$/i, Y = /<([\w:-]+)/, X = /^$|\/(?:java|ecma)script/i, U = /^\s+/, K = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video"; function createSafeFragment(e) { var t = K.split("|"), i = e.createDocumentFragment(); if (i.createElement) for (; t.length;)i.createElement(t.pop()); return i } P = n.createElement("div"), R = n.createDocumentFragment(), B = n.createElement("input"), P.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", p.leadingWhitespace = 3 === P.firstChild.nodeType, p.tbody = !P.getElementsByTagName("tbody").length, p.htmlSerialize = !!P.getElementsByTagName("link").length, p.html5Clone = "<:nav></:nav>" !== n.createElement("nav").cloneNode(!0).outerHTML, B.type = "checkbox", B.checked = !0, R.appendChild(B), p.appendChecked = B.checked, P.innerHTML = "<textarea>x</textarea>", p.noCloneChecked = !!P.cloneNode(!0).lastChild.defaultValue, R.appendChild(P), (B = n.createElement("input")).setAttribute("type", "radio"), B.setAttribute("checked", "checked"), B.setAttribute("name", "t"), P.appendChild(B), p.checkClone = P.cloneNode(!0).cloneNode(!0).lastChild.checked, p.noCloneEvent = !!P.addEventListener, P[jQuery.expando] = 1, p.attributes = !P.getAttribute(jQuery.expando); var V = { option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], area: [1, "<map>", "</map>"], param: [1, "<object>", "</object>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: p.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] }; function getAll(e, t) { var i, n, o = 0, r = void 0 !== e.getElementsByTagName ? e.getElementsByTagName(t || "*") : void 0 !== e.querySelectorAll ? e.querySelectorAll(t || "*") : void 0; if (!r) for (r = [], i = e.childNodes || e; null != (n = i[o]); o++)!t || jQuery.nodeName(n, t) ? r.push(n) : jQuery.merge(r, getAll(n, t)); return void 0 === t || t && jQuery.nodeName(e, t) ? jQuery.merge([e], r) : r } function setGlobalEval(e, t) { for (var i, n = 0; null != (i = e[n]); n++)jQuery._data(i, "globalEval", !t || jQuery._data(t[n], "globalEval")) } V.optgroup = V.option, V.tbody = V.tfoot = V.colgroup = V.caption = V.thead, V.th = V.td; var G = /<|&#?\w+;/, J = /<tbody/i; function fixDefaultChecked(e) { W.test(e.type) && (e.defaultChecked = e.checked) } function buildFragment(e, t, i, n, o) { for (var r, s, c, d, u, h, y, m = e.length, g = createSafeFragment(t), b = [], k = 0; k < m; k++)if ((s = e[k]) || 0 === s) if ("object" === jQuery.type(s)) jQuery.merge(b, s.nodeType ? [s] : s); else if (G.test(s)) { for (d = d || g.appendChild(t.createElement("div")), u = (Y.exec(s) || ["", ""])[1].toLowerCase(), y = V[u] || V._default, d.innerHTML = y[1] + jQuery.htmlPrefilter(s) + y[2], r = y[0]; r--;)d = d.lastChild; if (!p.leadingWhitespace && U.test(s) && b.push(t.createTextNode(U.exec(s)[0])), !p.tbody) for (r = (s = "table" !== u || J.test(s) ? "<table>" !== y[1] || J.test(s) ? 0 : d : d.firstChild) && s.childNodes.length; r--;)jQuery.nodeName(h = s.childNodes[r], "tbody") && !h.childNodes.length && s.removeChild(h); for (jQuery.merge(b, d.childNodes), d.textContent = ""; d.firstChild;)d.removeChild(d.firstChild); d = g.lastChild } else b.push(t.createTextNode(s)); for (d && g.removeChild(d), p.appendChecked || jQuery.grep(getAll(b, "input"), fixDefaultChecked), k = 0; s = b[k++];)if (n && jQuery.inArray(s, n) > -1) o && o.push(s); else if (c = jQuery.contains(s.ownerDocument, s), d = getAll(g.appendChild(s), "script"), c && setGlobalEval(d), i) for (r = 0; s = d[r++];)X.test(s.type || "") && i.push(s); return d = null, g } !function () { var t, i, o = n.createElement("div"); for (t in { submit: !0, change: !0, focusin: !0 }) i = "on" + t, (p[t] = i in e) || (o.setAttribute(i, "t"), p[t] = !1 === o.attributes[i].expando); o = null }(); var Z = /^(?:input|select|textarea)$/i, Q = /^key/, ee = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, te = /^(?:focusinfocus|focusoutblur)$/, ie = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return !0 } function returnFalse() { return !1 } function safeActiveElement() { try { return n.activeElement } catch (e) { } } function on(e, t, i, n, o, r) { var s, c; if ("object" == typeof t) { for (c in "string" != typeof i && (n = n || i, i = void 0), t) on(e, c, i, n, t[c], r); return e } if (null == n && null == o ? (o = i, n = i = void 0) : null == o && ("string" == typeof i ? (o = n, n = void 0) : (o = n, n = i, i = void 0)), !1 === o) o = returnFalse; else if (!o) return e; return 1 === r && (s = o, (o = function (e) { return jQuery().off(e), s.apply(this, arguments) }).guid = s.guid || (s.guid = jQuery.guid++)), e.each((function () { jQuery.event.add(this, t, o, n, i) })) } jQuery.event = { global: {}, add: function (e, t, i, n, o) { var r, s, c, d, u, h, p, y, m, g, b, k = jQuery._data(e); if (k) { for (i.handler && (i = (d = i).handler, o = d.selector), i.guid || (i.guid = jQuery.guid++), (s = k.events) || (s = k.events = {}), (h = k.handle) || ((h = k.handle = function (e) { return void 0 === jQuery || e && jQuery.event.triggered === e.type ? void 0 : jQuery.event.dispatch.apply(h.elem, arguments) }).elem = e), c = (t = (t || "").match(_) || [""]).length; c--;)m = b = (r = ie.exec(t[c]) || [])[1], g = (r[2] || "").split(".").sort(), m && (u = jQuery.event.special[m] || {}, m = (o ? u.delegateType : u.bindType) || m, u = jQuery.event.special[m] || {}, p = jQuery.extend({ type: m, origType: b, data: n, handler: i, guid: i.guid, selector: o, needsContext: o && jQuery.expr.match.needsContext.test(o), namespace: g.join(".") }, d), (y = s[m]) || ((y = s[m] = []).delegateCount = 0, u.setup && !1 !== u.setup.call(e, n, g, h) || (e.addEventListener ? e.addEventListener(m, h, !1) : e.attachEvent && e.attachEvent("on" + m, h))), u.add && (u.add.call(e, p), p.handler.guid || (p.handler.guid = i.guid)), o ? y.splice(y.delegateCount++, 0, p) : y.push(p), jQuery.event.global[m] = !0); e = null } }, remove: function (e, t, i, n, o) { var r, s, c, d, u, h, p, y, m, g, b, k = jQuery.hasData(e) && jQuery._data(e); if (k && (h = k.events)) { for (u = (t = (t || "").match(_) || [""]).length; u--;)if (m = b = (c = ie.exec(t[u]) || [])[1], g = (c[2] || "").split(".").sort(), m) { for (p = jQuery.event.special[m] || {}, y = h[m = (n ? p.delegateType : p.bindType) || m] || [], c = c[2] && new RegExp("(^|\\.)" + g.join("\\.(?:.*\\.|)") + "(\\.|$)"), d = r = y.length; r--;)s = y[r], !o && b !== s.origType || i && i.guid !== s.guid || c && !c.test(s.namespace) || n && n !== s.selector && ("**" !== n || !s.selector) || (y.splice(r, 1), s.selector && y.delegateCount--, p.remove && p.remove.call(e, s)); d && !y.length && (p.teardown && !1 !== p.teardown.call(e, g, k.handle) || jQuery.removeEvent(e, m, k.handle), delete h[m]) } else for (m in h) jQuery.event.remove(e, m + t[u], i, n, !0); jQuery.isEmptyObject(h) && (delete k.handle, jQuery._removeData(e, "events")) } }, trigger: function (t, i, o, r) { var s, c, d, u, p, y, m, g = [o || n], b = h.call(t, "type") ? t.type : t, k = h.call(t, "namespace") ? t.namespace.split(".") : []; if (d = y = o = o || n, 3 !== o.nodeType && 8 !== o.nodeType && !te.test(b + jQuery.event.triggered) && (b.indexOf(".") > -1 && (k = b.split("."), b = k.shift(), k.sort()), c = b.indexOf(":") < 0 && "on" + b, (t = t[jQuery.expando] ? t : new jQuery.Event(b, "object" == typeof t && t)).isTrigger = r ? 2 : 3, t.namespace = k.join("."), t.rnamespace = t.namespace ? new RegExp("(^|\\.)" + k.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = o), i = null == i ? [t] : jQuery.makeArray(i, [t]), p = jQuery.event.special[b] || {}, r || !p.trigger || !1 !== p.trigger.apply(o, i))) { if (!r && !p.noBubble && !jQuery.isWindow(o)) { for (u = p.delegateType || b, te.test(u + b) || (d = d.parentNode); d; d = d.parentNode)g.push(d), y = d; y === (o.ownerDocument || n) && g.push(y.defaultView || y.parentWindow || e) } for (m = 0; (d = g[m++]) && !t.isPropagationStopped();)t.type = m > 1 ? u : p.bindType || b, (s = (jQuery._data(d, "events") || {})[t.type] && jQuery._data(d, "handle")) && s.apply(d, i), (s = c && d[c]) && s.apply && acceptData(d) && (t.result = s.apply(d, i), !1 === t.result && t.preventDefault()); if (t.type = b, !r && !t.isDefaultPrevented() && (!p._default || !1 === p._default.apply(g.pop(), i)) && acceptData(o) && c && o[b] && !jQuery.isWindow(o)) { (y = o[c]) && (o[c] = null), jQuery.event.triggered = b; try { o[b]() } catch (e) { } jQuery.event.triggered = void 0, y && (o[c] = y) } return t.result } }, dispatch: function (e) { e = jQuery.event.fix(e); var t, i, n, r, s, c = [], d = o.call(arguments), u = (jQuery._data(this, "events") || {})[e.type] || [], h = jQuery.event.special[e.type] || {}; if (d[0] = e, e.delegateTarget = this, !h.preDispatch || !1 !== h.preDispatch.call(this, e)) { for (c = jQuery.event.handlers.call(this, e, u), t = 0; (r = c[t++]) && !e.isPropagationStopped();)for (e.currentTarget = r.elem, i = 0; (s = r.handlers[i++]) && !e.isImmediatePropagationStopped();)e.rnamespace && !e.rnamespace.test(s.namespace) || (e.handleObj = s, e.data = s.data, void 0 !== (n = ((jQuery.event.special[s.origType] || {}).handle || s.handler).apply(r.elem, d)) && !1 === (e.result = n) && (e.preventDefault(), e.stopPropagation())); return h.postDispatch && h.postDispatch.call(this, e), e.result } }, handlers: function (e, t) { var i, n, o, r, s = [], c = t.delegateCount, d = e.target; if (c && d.nodeType && ("click" !== e.type || isNaN(e.button) || e.button < 1)) for (; d != this; d = d.parentNode || this)if (1 === d.nodeType && (!0 !== d.disabled || "click" !== e.type)) { for (n = [], i = 0; i < c; i++)void 0 === n[o = (r = t[i]).selector + " "] && (n[o] = r.needsContext ? jQuery(o, this).index(d) > -1 : jQuery.find(o, this, null, [d]).length), n[o] && n.push(r); n.length && s.push({ elem: d, handlers: n }) } return c < t.length && s.push({ elem: this, handlers: t.slice(c) }), s }, fix: function (e) { if (e[jQuery.expando]) return e; var t, i, o, r = e.type, s = e, c = this.fixHooks[r]; for (c || (this.fixHooks[r] = c = ee.test(r) ? this.mouseHooks : Q.test(r) ? this.keyHooks : {}), o = c.props ? this.props.concat(c.props) : this.props, e = new jQuery.Event(s), t = o.length; t--;)e[i = o[t]] = s[i]; return e.target || (e.target = s.srcElement || n), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey = !!e.metaKey, c.filter ? c.filter(e, s) : e }, props: "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (e, t) { return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (e, t) { var i, o, r, s = t.button, c = t.fromElement; return null == e.pageX && null != t.clientX && (r = (o = e.target.ownerDocument || n).documentElement, i = o.body, e.pageX = t.clientX + (r && r.scrollLeft || i && i.scrollLeft || 0) - (r && r.clientLeft || i && i.clientLeft || 0), e.pageY = t.clientY + (r && r.scrollTop || i && i.scrollTop || 0) - (r && r.clientTop || i && i.clientTop || 0)), !e.relatedTarget && c && (e.relatedTarget = c === e.target ? t.toElement : c), e.which || void 0 === s || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e } }, special: { load: { noBubble: !0 }, focus: { trigger: function () { if (this !== safeActiveElement() && this.focus) try { return this.focus(), !1 } catch (e) { } }, delegateType: "focusin" }, blur: { trigger: function () { if (this === safeActiveElement() && this.blur) return this.blur(), !1 }, delegateType: "focusout" }, click: { trigger: function () { if (jQuery.nodeName(this, "input") && "checkbox" === this.type && this.click) return this.click(), !1 }, _default: function (e) { return jQuery.nodeName(e.target, "a") } }, beforeunload: { postDispatch: function (e) { void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result) } } }, simulate: function (e, t, i) { var n = jQuery.extend(new jQuery.Event, i, { type: e, isSimulated: !0 }); jQuery.event.trigger(n, null, t), n.isDefaultPrevented() && i.preventDefault() } }, jQuery.removeEvent = n.removeEventListener ? function (e, t, i) { e.removeEventListener && e.removeEventListener(t, i) } : function (e, t, i) { var n = "on" + t; e.detachEvent && (void 0 === e[n] && (e[n] = null), e.detachEvent(n, i)) }, jQuery.Event = function (e, t) { if (!(this instanceof jQuery.Event)) return new jQuery.Event(e, t); e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? returnTrue : returnFalse) : this.type = e, t && jQuery.extend(this, t), this.timeStamp = e && e.timeStamp || jQuery.now(), this[jQuery.expando] = !0 }, jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = returnTrue, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = returnTrue, e && !this.isSimulated && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0) }, stopImmediatePropagation: function () { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue, e && e.stopImmediatePropagation && e.stopImmediatePropagation(), this.stopPropagation() } }, jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, (function (e, t) { jQuery.event.special[e] = { delegateType: t, bindType: t, handle: function (e) { var i, n = this, o = e.relatedTarget, r = e.handleObj; return o && (o === n || jQuery.contains(n, o)) || (e.type = r.origType, i = r.handler.apply(this, arguments), e.type = t), i } } })), p.submit || (jQuery.event.special.submit = { setup: function () { if (jQuery.nodeName(this, "form")) return !1; jQuery.event.add(this, "click._submit keypress._submit", (function (e) { var t = e.target, i = jQuery.nodeName(t, "input") || jQuery.nodeName(t, "button") ? jQuery.prop(t, "form") : void 0; i && !jQuery._data(i, "submit") && (jQuery.event.add(i, "submit._submit", (function (e) { e._submitBubble = !0 })), jQuery._data(i, "submit", !0)) })) }, postDispatch: function (e) { e._submitBubble && (delete e._submitBubble, this.parentNode && !e.isTrigger && jQuery.event.simulate("submit", this.parentNode, e)) }, teardown: function () { if (jQuery.nodeName(this, "form")) return !1; jQuery.event.remove(this, "._submit") } }), p.change || (jQuery.event.special.change = { setup: function () { if (Z.test(this.nodeName)) return "checkbox" !== this.type && "radio" !== this.type || (jQuery.event.add(this, "propertychange._change", (function (e) { "checked" === e.originalEvent.propertyName && (this._justChanged = !0) })), jQuery.event.add(this, "click._change", (function (e) { this._justChanged && !e.isTrigger && (this._justChanged = !1), jQuery.event.simulate("change", this, e) }))), !1; jQuery.event.add(this, "beforeactivate._change", (function (e) { var t = e.target; Z.test(t.nodeName) && !jQuery._data(t, "change") && (jQuery.event.add(t, "change._change", (function (e) { !this.parentNode || e.isSimulated || e.isTrigger || jQuery.event.simulate("change", this.parentNode, e) })), jQuery._data(t, "change", !0)) })) }, handle: function (e) { var t = e.target; if (this !== t || e.isSimulated || e.isTrigger || "radio" !== t.type && "checkbox" !== t.type) return e.handleObj.handler.apply(this, arguments) }, teardown: function () { return jQuery.event.remove(this, "._change"), !Z.test(this.nodeName) } }), p.focusin || jQuery.each({ focus: "focusin", blur: "focusout" }, (function (e, t) { var handler = function (e) { jQuery.event.simulate(t, e.target, jQuery.event.fix(e)) }; jQuery.event.special[t] = { setup: function () { var i = this.ownerDocument || this, n = jQuery._data(i, t); n || i.addEventListener(e, handler, !0), jQuery._data(i, t, (n || 0) + 1) }, teardown: function () { var i = this.ownerDocument || this, n = jQuery._data(i, t) - 1; n ? jQuery._data(i, t, n) : (i.removeEventListener(e, handler, !0), jQuery._removeData(i, t)) } } })), jQuery.fn.extend({ on: function (e, t, i, n) { return on(this, e, t, i, n) }, one: function (e, t, i, n) { return on(this, e, t, i, n, 1) }, off: function (e, t, i) { var n, o; if (e && e.preventDefault && e.handleObj) return n = e.handleObj, jQuery(e.delegateTarget).off(n.namespace ? n.origType + "." + n.namespace : n.origType, n.selector, n.handler), this; if ("object" == typeof e) { for (o in e) this.off(o, t, e[o]); return this } return !1 !== t && "function" != typeof t || (i = t, t = void 0), !1 === i && (i = returnFalse), this.each((function () { jQuery.event.remove(this, e, i, t) })) }, trigger: function (e, t) { return this.each((function () { jQuery.event.trigger(e, t, this) })) }, triggerHandler: function (e, t) { var i = this[0]; if (i) return jQuery.event.trigger(e, t, i, !0) } }); var ae = / jQuery\d+="(?:null|\d+)"/g, ne = new RegExp("<(?:" + K + ")[\\s/>]", "i"), le = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, oe = /<script|<style|<link/i, re = /checked\s*(?:[^=]|=\s*.checked.)/i, se = /^true\/(.*)/, ce = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, de = createSafeFragment(n).appendChild(n.createElement("div")); function manipulationTarget(e, t) { return jQuery.nodeName(e, "table") && jQuery.nodeName(11 !== t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e } function disableScript(e) { return e.type = (null !== jQuery.find.attr(e, "type")) + "/" + e.type, e } function restoreScript(e) { var t = se.exec(e.type); return t ? e.type = t[1] : e.removeAttribute("type"), e } function cloneCopyEvent(e, t) { if (1 === t.nodeType && jQuery.hasData(e)) { var i, n, o, r = jQuery._data(e), s = jQuery._data(t, r), c = r.events; if (c) for (i in delete s.handle, s.events = {}, c) for (n = 0, o = c[i].length; n < o; n++)jQuery.event.add(t, i, c[i][n]); s.data && (s.data = jQuery.extend({}, s.data)) } } function fixCloneNodeIssues(e, t) { var i, n, o; if (1 === t.nodeType) { if (i = t.nodeName.toLowerCase(), !p.noCloneEvent && t[jQuery.expando]) { for (n in (o = jQuery._data(t)).events) jQuery.removeEvent(t, n, o.handle); t.removeAttribute(jQuery.expando) } "script" === i && t.text !== e.text ? (disableScript(t).text = e.text, restoreScript(t)) : "object" === i ? (t.parentNode && (t.outerHTML = e.outerHTML), p.html5Clone && e.innerHTML && !jQuery.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : "input" === i && W.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : "option" === i ? t.defaultSelected = t.selected = e.defaultSelected : "input" !== i && "textarea" !== i || (t.defaultValue = e.defaultValue) } } function domManip(e, t, i, n) { t = r.apply([], t); var o, s, c, d, u, h, y = 0, m = e.length, g = m - 1, b = t[0], k = jQuery.isFunction(b); if (k || m > 1 && "string" == typeof b && !p.checkClone && re.test(b)) return e.each((function (o) { var r = e.eq(o); k && (t[0] = b.call(this, o, r.html())), domManip(r, t, i, n) })); if (m && (o = (h = buildFragment(t, e[0].ownerDocument, !1, e, n)).firstChild, 1 === h.childNodes.length && (h = o), o || n)) { for (c = (d = jQuery.map(getAll(h, "script"), disableScript)).length; y < m; y++)s = h, y !== g && (s = jQuery.clone(s, !0, !0), c && jQuery.merge(d, getAll(s, "script"))), i.call(e[y], s, y); if (c) for (u = d[d.length - 1].ownerDocument, jQuery.map(d, restoreScript), y = 0; y < c; y++)s = d[y], X.test(s.type || "") && !jQuery._data(s, "globalEval") && jQuery.contains(u, s) && (s.src ? jQuery._evalUrl && jQuery._evalUrl(s.src) : jQuery.globalEval((s.text || s.textContent || s.innerHTML || "").replace(ce, ""))); h = o = null } return e } function remove(e, t, i) { for (var n, o = t ? jQuery.filter(t, e) : e, r = 0; null != (n = o[r]); r++)i || 1 !== n.nodeType || jQuery.cleanData(getAll(n)), n.parentNode && (i && jQuery.contains(n.ownerDocument, n) && setGlobalEval(getAll(n, "script")), n.parentNode.removeChild(n)); return e } jQuery.extend({ htmlPrefilter: function (e) { return e.replace(le, "<$1></$2>") }, clone: function (e, t, i) { var n, o, r, s, c, d = jQuery.contains(e.ownerDocument, e); if (p.html5Clone || jQuery.isXMLDoc(e) || !ne.test("<" + e.nodeName + ">") ? r = e.cloneNode(!0) : (de.innerHTML = e.outerHTML, de.removeChild(r = de.firstChild)), !(p.noCloneEvent && p.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || jQuery.isXMLDoc(e))) for (n = getAll(r), c = getAll(e), s = 0; null != (o = c[s]); ++s)n[s] && fixCloneNodeIssues(o, n[s]); if (t) if (i) for (c = c || getAll(e), n = n || getAll(r), s = 0; null != (o = c[s]); s++)cloneCopyEvent(o, n[s]); else cloneCopyEvent(e, r); return (n = getAll(r, "script")).length > 0 && setGlobalEval(n, !d && getAll(e, "script")), n = c = o = null, r }, cleanData: function (e, t) { for (var n, o, r, s, c = 0, d = jQuery.expando, u = jQuery.cache, h = p.attributes, y = jQuery.event.special; null != (n = e[c]); c++)if ((t || acceptData(n)) && (s = (r = n[d]) && u[r])) { if (s.events) for (o in s.events) y[o] ? jQuery.event.remove(n, o) : jQuery.removeEvent(n, o, s.handle); u[r] && (delete u[r], h || void 0 === n.removeAttribute ? n[d] = void 0 : n.removeAttribute(d), i.push(r)) } } }), jQuery.fn.extend({ domManip: domManip, detach: function (e) { return remove(this, e, !0) }, remove: function (e) { return remove(this, e) }, text: function (e) { return access(this, (function (e) { return void 0 === e ? jQuery.text(this) : this.empty().append((this[0] && this[0].ownerDocument || n).createTextNode(e)) }), null, e, arguments.length) }, append: function () { return domManip(this, arguments, (function (e) { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || manipulationTarget(this, e).appendChild(e) })) }, prepend: function () { return domManip(this, arguments, (function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = manipulationTarget(this, e); t.insertBefore(e, t.firstChild) } })) }, before: function () { return domManip(this, arguments, (function (e) { this.parentNode && this.parentNode.insertBefore(e, this) })) }, after: function () { return domManip(this, arguments, (function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) })) }, empty: function () { for (var e, t = 0; null != (e = this[t]); t++) { for (1 === e.nodeType && jQuery.cleanData(getAll(e, !1)); e.firstChild;)e.removeChild(e.firstChild); e.options && jQuery.nodeName(e, "select") && (e.options.length = 0) } return this }, clone: function (e, t) { return e = null != e && e, t = null == t ? e : t, this.map((function () { return jQuery.clone(this, e, t) })) }, html: function (e) { return access(this, (function (e) { var t = this[0] || {}, i = 0, n = this.length; if (void 0 === e) return 1 === t.nodeType ? t.innerHTML.replace(ae, "") : void 0; if ("string" == typeof e && !oe.test(e) && (p.htmlSerialize || !ne.test(e)) && (p.leadingWhitespace || !U.test(e)) && !V[(Y.exec(e) || ["", ""])[1].toLowerCase()]) { e = jQuery.htmlPrefilter(e); try { for (; i < n; i++)1 === (t = this[i] || {}).nodeType && (jQuery.cleanData(getAll(t, !1)), t.innerHTML = e); t = 0 } catch (e) { } } t && this.empty().append(e) }), null, e, arguments.length) }, replaceWith: function () { var e = []; return domManip(this, arguments, (function (t) { var i = this.parentNode; jQuery.inArray(this, e) < 0 && (jQuery.cleanData(getAll(this)), i && i.replaceChild(t, this)) }), e) } }), jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, (function (e, t) { jQuery.fn[e] = function (e) { for (var i, n = 0, o = [], r = jQuery(e), c = r.length - 1; n <= c; n++)i = n === c ? this : this.clone(!0), jQuery(r[n])[t](i), s.apply(o, i.get()); return this.pushStack(o) } })); var ue, fe = { HTML: "block", BODY: "block" }; function actualDisplay(e, t) { var i = jQuery(t.createElement(e)).appendTo(t.body), n = jQuery.css(i[0], "display"); return i.detach(), n } function defaultDisplay(e) { var t = n, i = fe[e]; return i || ("none" !== (i = actualDisplay(e, t)) && i || ((t = ((ue = (ue || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentWindow || ue[0].contentDocument).document).write(), t.close(), i = actualDisplay(e, t), ue.detach()), fe[e] = i), i } var he = /^margin/, pe = new RegExp("^(" + H + ")(?!px)[a-z%]+$", "i"), swap = function (e, t, i, n) { var o, r, s = {}; for (r in t) s[r] = e.style[r], e.style[r] = t[r]; for (r in o = i.apply(e, n || []), t) e.style[r] = s[r]; return o }, ye = n.documentElement; !function () { var t, i, o, r, s, c, d = n.createElement("div"), u = n.createElement("div"); function computeStyleTests() { var h, p, y = n.documentElement; y.appendChild(d), u.style.cssText = "-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%", t = o = c = !1, i = s = !0, e.getComputedStyle && (p = e.getComputedStyle(u), t = "1%" !== (p || {}).top, c = "2px" === (p || {}).marginLeft, o = "4px" === (p || { width: "4px" }).width, u.style.marginRight = "50%", i = "4px" === (p || { marginRight: "4px" }).marginRight, (h = u.appendChild(n.createElement("div"))).style.cssText = u.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", h.style.marginRight = h.style.width = "0", u.style.width = "1px", s = !parseFloat((e.getComputedStyle(h) || {}).marginRight), u.removeChild(h)), u.style.display = "none", (r = 0 === u.getClientRects().length) && (u.style.display = "", u.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", (h = u.getElementsByTagName("td"))[0].style.cssText = "margin:0;border:0;padding:0;display:none", (r = 0 === h[0].offsetHeight) && (h[0].style.display = "", h[1].style.display = "none", r = 0 === h[0].offsetHeight)), y.removeChild(d) } u.style && (u.style.cssText = "float:left;opacity:.5", p.opacity = "0.5" === u.style.opacity, p.cssFloat = !!u.style.cssFloat, u.style.backgroundClip = "content-box", u.cloneNode(!0).style.backgroundClip = "", p.clearCloneStyle = "content-box" === u.style.backgroundClip, (d = n.createElement("div")).style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute", u.innerHTML = "", d.appendChild(u), p.boxSizing = "" === u.style.boxSizing || "" === u.style.MozBoxSizing || "" === u.style.WebkitBoxSizing, jQuery.extend(p, { reliableHiddenOffsets: function () { return null == t && computeStyleTests(), r }, boxSizingReliable: function () { return null == t && computeStyleTests(), o }, pixelMarginRight: function () { return null == t && computeStyleTests(), i }, pixelPosition: function () { return null == t && computeStyleTests(), t }, reliableMarginRight: function () { return null == t && computeStyleTests(), s }, reliableMarginLeft: function () { return null == t && computeStyleTests(), c } })) }(); var me, ve, ge = /^(top|right|bottom|left)$/; function addGetHookIf(e, t) { return { get: function () { if (!e()) return (this.get = t).apply(this, arguments); delete this.get } } } e.getComputedStyle ? (me = function (t) { var i = t.ownerDocument.defaultView; return i && i.opener || (i = e), i.getComputedStyle(t) }, ve = function (e, t, i) { var n, o, r, s, c = e.style; return "" !== (s = (i = i || me(e)) ? i.getPropertyValue(t) || i[t] : void 0) && void 0 !== s || jQuery.contains(e.ownerDocument, e) || (s = jQuery.style(e, t)), i && !p.pixelMarginRight() && pe.test(s) && he.test(t) && (n = c.width, o = c.minWidth, r = c.maxWidth, c.minWidth = c.maxWidth = c.width = s, s = i.width, c.width = n, c.minWidth = o, c.maxWidth = r), void 0 === s ? s : s + "" }) : ye.currentStyle && (me = function (e) { return e.currentStyle }, ve = function (e, t, i) { var n, o, r, s, c = e.style; return null == (s = (i = i || me(e)) ? i[t] : void 0) && c && c[t] && (s = c[t]), pe.test(s) && !ge.test(t) && (n = c.left, (r = (o = e.runtimeStyle) && o.left) && (o.left = e.currentStyle.left), c.left = "fontSize" === t ? "1em" : s, s = c.pixelLeft + "px", c.left = n, r && (o.left = r)), void 0 === s ? s : s + "" || "auto" }); var be = /alpha\([^)]*\)/i, xe = /opacity\s*=\s*([^)]*)/i, ke = /^(none|table(?!-c[ea]).+)/, we = new RegExp("^(" + H + ")(.*)$", "i"), Ce = { position: "absolute", visibility: "hidden", display: "block" }, Te = { letterSpacing: "0", fontWeight: "400" }, De = ["Webkit", "O", "Moz", "ms"], Ee = n.createElement("div").style; function vendorPropName(e) { if (e in Ee) return e; for (var t = e.charAt(0).toUpperCase() + e.slice(1), i = De.length; i--;)if ((e = De[i] + t) in Ee) return e } function showHide(e, t) { for (var i, n, o, r = [], s = 0, c = e.length; s < c; s++)(n = e[s]).style && (r[s] = jQuery._data(n, "olddisplay"), i = n.style.display, t ? (r[s] || "none" !== i || (n.style.display = ""), "" === n.style.display && isHidden(n) && (r[s] = jQuery._data(n, "olddisplay", defaultDisplay(n.nodeName)))) : (o = isHidden(n), (i && "none" !== i || !o) && jQuery._data(n, "olddisplay", o ? i : jQuery.css(n, "display")))); for (s = 0; s < c; s++)(n = e[s]).style && (t && "none" !== n.style.display && "" !== n.style.display || (n.style.display = t ? r[s] || "" : "none")); return e } function setPositiveNumber(e, t, i) { var n = we.exec(t); return n ? Math.max(0, n[1] - (i || 0)) + (n[2] || "px") : t } function augmentWidthOrHeight(e, t, i, n, o) { for (var r = i === (n ? "border" : "content") ? 4 : "width" === t ? 1 : 0, s = 0; r < 4; r += 2)"margin" === i && (s += jQuery.css(e, i + z[r], !0, o)), n ? ("content" === i && (s -= jQuery.css(e, "padding" + z[r], !0, o)), "margin" !== i && (s -= jQuery.css(e, "border" + z[r] + "Width", !0, o))) : (s += jQuery.css(e, "padding" + z[r], !0, o), "padding" !== i && (s += jQuery.css(e, "border" + z[r] + "Width", !0, o))); return s } function getWidthOrHeight(t, i, o) { var r = !0, s = "width" === i ? t.offsetWidth : t.offsetHeight, c = me(t), d = p.boxSizing && "border-box" === jQuery.css(t, "boxSizing", !1, c); if (n.msFullscreenElement && e.top !== e && t.getClientRects().length && (s = Math.round(100 * t.getBoundingClientRect()[i])), s <= 0 || null == s) { if (((s = ve(t, i, c)) < 0 || null == s) && (s = t.style[i]), pe.test(s)) return s; r = d && (p.boxSizingReliable() || s === t.style[i]), s = parseFloat(s) || 0 } return s + augmentWidthOrHeight(t, i, o || (d ? "border" : "content"), r, c) + "px" } function Tween(e, t, i, n, o) { return new Tween.prototype.init(e, t, i, n, o) } jQuery.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var i = ve(e, "opacity"); return "" === i ? "1" : i } } } }, cssNumber: { animationIterationCount: !0, columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { float: p.cssFloat ? "cssFloat" : "styleFloat" }, style: function (e, t, i, n) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var o, r, s, c = jQuery.camelCase(t), d = e.style; if (t = jQuery.cssProps[c] || (jQuery.cssProps[c] = vendorPropName(c) || c), s = jQuery.cssHooks[t] || jQuery.cssHooks[c], void 0 === i) return s && "get" in s && void 0 !== (o = s.get(e, !1, n)) ? o : d[t]; if ("string" == (r = typeof i) && (o = O.exec(i)) && o[1] && (i = adjustCSS(e, t, o), r = "number"), null != i && i == i && ("number" === r && (i += o && o[3] || (jQuery.cssNumber[c] ? "" : "px")), p.clearCloneStyle || "" !== i || 0 !== t.indexOf("background") || (d[t] = "inherit"), !s || !("set" in s) || void 0 !== (i = s.set(e, i, n)))) try { d[t] = i } catch (e) { } } }, css: function (e, t, i, n) { var o, r, s, c = jQuery.camelCase(t); return t = jQuery.cssProps[c] || (jQuery.cssProps[c] = vendorPropName(c) || c), (s = jQuery.cssHooks[t] || jQuery.cssHooks[c]) && "get" in s && (r = s.get(e, !0, i)), void 0 === r && (r = ve(e, t, n)), "normal" === r && t in Te && (r = Te[t]), "" === i || i ? (o = parseFloat(r), !0 === i || isFinite(o) ? o || 0 : r) : r } }), jQuery.each(["height", "width"], (function (e, t) { jQuery.cssHooks[t] = { get: function (e, i, n) { if (i) return ke.test(jQuery.css(e, "display")) && 0 === e.offsetWidth ? swap(e, Ce, (function () { return getWidthOrHeight(e, t, n) })) : getWidthOrHeight(e, t, n) }, set: function (e, i, n) { var o = n && me(e); return setPositiveNumber(0, i, n ? augmentWidthOrHeight(e, t, n, p.boxSizing && "border-box" === jQuery.css(e, "boxSizing", !1, o), o) : 0) } } })), p.opacity || (jQuery.cssHooks.opacity = { get: function (e, t) { return xe.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : "" }, set: function (e, t) { var i = e.style, n = e.currentStyle, o = jQuery.isNumeric(t) ? "alpha(opacity=" + 100 * t + ")" : "", r = n && n.filter || i.filter || ""; i.zoom = 1, (t >= 1 || "" === t) && "" === jQuery.trim(r.replace(be, "")) && i.removeAttribute && (i.removeAttribute("filter"), "" === t || n && !n.filter) || (i.filter = be.test(r) ? r.replace(be, o) : r + " " + o) } }), jQuery.cssHooks.marginRight = addGetHookIf(p.reliableMarginRight, (function (e, t) { if (t) return swap(e, { display: "inline-block" }, ve, [e, "marginRight"]) })), jQuery.cssHooks.marginLeft = addGetHookIf(p.reliableMarginLeft, (function (e, t) { if (t) return (parseFloat(ve(e, "marginLeft")) || (jQuery.contains(e.ownerDocument, e) ? e.getBoundingClientRect().left - swap(e, { marginLeft: 0 }, (function () { return e.getBoundingClientRect().left })) : 0)) + "px" })), jQuery.each({ margin: "", padding: "", border: "Width" }, (function (e, t) { jQuery.cssHooks[e + t] = { expand: function (i) { for (var n = 0, o = {}, r = "string" == typeof i ? i.split(" ") : [i]; n < 4; n++)o[e + z[n] + t] = r[n] || r[n - 2] || r[0]; return o } }, he.test(e) || (jQuery.cssHooks[e + t].set = setPositiveNumber) })), jQuery.fn.extend({ css: function (e, t) { return access(this, (function (e, t, i) { var n, o, r = {}, s = 0; if (jQuery.isArray(t)) { for (n = me(e), o = t.length; s < o; s++)r[t[s]] = jQuery.css(e, t[s], !1, n); return r } return void 0 !== i ? jQuery.style(e, t, i) : jQuery.css(e, t) }), e, t, arguments.length > 1) }, show: function () { return showHide(this, !0) }, hide: function () { return showHide(this) }, toggle: function (e) { return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each((function () { isHidden(this) ? jQuery(this).show() : jQuery(this).hide() })) } }), jQuery.Tween = Tween, Tween.prototype = { constructor: Tween, init: function (e, t, i, n, o, r) { this.elem = e, this.prop = i, this.easing = o || jQuery.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = n, this.unit = r || (jQuery.cssNumber[i] ? "" : "px") }, cur: function () { var e = Tween.propHooks[this.prop]; return e && e.get ? e.get(this) : Tween.propHooks._default.get(this) }, run: function (e) { var t, i = Tween.propHooks[this.prop]; return this.options.duration ? this.pos = t = jQuery.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), i && i.set ? i.set(this) : Tween.propHooks._default.set(this), this } }, Tween.prototype.init.prototype = Tween.prototype, Tween.propHooks = { _default: { get: function (e) { var t; return 1 !== e.elem.nodeType || null != e.elem[e.prop] && null == e.elem.style[e.prop] ? e.elem[e.prop] : (t = jQuery.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0 }, set: function (e) { jQuery.fx.step[e.prop] ? jQuery.fx.step[e.prop](e) : 1 !== e.elem.nodeType || null == e.elem.style[jQuery.cssProps[e.prop]] && !jQuery.cssHooks[e.prop] ? e.elem[e.prop] = e.now : jQuery.style(e.elem, e.prop, e.now + e.unit) } } }, Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function (e) { e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now) } }, jQuery.easing = { linear: function (e) { return e }, swing: function (e) { return .5 - Math.cos(e * Math.PI) / 2 }, _default: "swing" }, jQuery.fx = Tween.prototype.init, jQuery.fx.step = {}; var Se, Le, Ne = /^(?:toggle|show|hide)$/, Ae = /queueHooks$/; function createFxNow() { return e.setTimeout((function () { Se = void 0 })), Se = jQuery.now() } function genFx(e, t) { var i, n = { height: e }, o = 0; for (t = t ? 1 : 0; o < 4; o += 2 - t)n["margin" + (i = z[o])] = n["padding" + i] = e; return t && (n.opacity = n.width = e), n } function createTween(e, t, i) { for (var n, o = (Animation.tweeners[t] || []).concat(Animation.tweeners["*"]), r = 0, s = o.length; r < s; r++)if (n = o[r].call(i, t, e)) return n } function Animation(e, t, i) { var n, o, r = 0, s = Animation.prefilters.length, c = jQuery.Deferred().always((function () { delete tick.elem })), tick = function () { if (o) return !1; for (var t = Se || createFxNow(), i = Math.max(0, d.startTime + d.duration - t), n = 1 - (i / d.duration || 0), r = 0, s = d.tweens.length; r < s; r++)d.tweens[r].run(n); return c.notifyWith(e, [d, n, i]), n < 1 && s ? i : (c.resolveWith(e, [d]), !1) }, d = c.promise({ elem: e, props: jQuery.extend({}, t), opts: jQuery.extend(!0, { specialEasing: {}, easing: jQuery.easing._default }, i), originalProperties: t, originalOptions: i, startTime: Se || createFxNow(), duration: i.duration, tweens: [], createTween: function (t, i) { var n = jQuery.Tween(e, d.opts, t, i, d.opts.specialEasing[t] || d.opts.easing); return d.tweens.push(n), n }, stop: function (t) { var i = 0, n = t ? d.tweens.length : 0; if (o) return this; for (o = !0; i < n; i++)d.tweens[i].run(1); return t ? (c.notifyWith(e, [d, 1, 0]), c.resolveWith(e, [d, t])) : c.rejectWith(e, [d, t]), this } }), u = d.props; for (function propFilter(e, t) { var i, n, o, r, s; for (i in e) if (o = t[n = jQuery.camelCase(i)], r = e[i], jQuery.isArray(r) && (o = r[1], r = e[i] = r[0]), i !== n && (e[n] = r, delete e[i]), (s = jQuery.cssHooks[n]) && "expand" in s) for (i in r = s.expand(r), delete e[n], r) i in e || (e[i] = r[i], t[i] = o); else t[n] = o }(u, d.opts.specialEasing); r < s; r++)if (n = Animation.prefilters[r].call(d, e, u, d.opts)) return jQuery.isFunction(n.stop) && (jQuery._queueHooks(d.elem, d.opts.queue).stop = jQuery.proxy(n.stop, n)), n; return jQuery.map(u, createTween, d), jQuery.isFunction(d.opts.start) && d.opts.start.call(e, d), jQuery.fx.timer(jQuery.extend(tick, { elem: e, anim: d, queue: d.opts.queue })), d.progress(d.opts.progress).done(d.opts.done, d.opts.complete).fail(d.opts.fail).always(d.opts.always) } jQuery.Animation = jQuery.extend(Animation, { tweeners: { "*": [function (e, t) { var i = this.createTween(e, t); return adjustCSS(i.elem, e, O.exec(t), i), i }] }, tweener: function (e, t) { jQuery.isFunction(e) ? (t = e, e = ["*"]) : e = e.match(_); for (var i, n = 0, o = e.length; n < o; n++)i = e[n], Animation.tweeners[i] = Animation.tweeners[i] || [], Animation.tweeners[i].unshift(t) }, prefilters: [function defaultPrefilter(e, t, i) { var n, o, r, s, c, d, u, h = this, y = {}, m = e.style, g = e.nodeType && isHidden(e), b = jQuery._data(e, "fxshow"); for (n in i.queue || (null == (c = jQuery._queueHooks(e, "fx")).unqueued && (c.unqueued = 0, d = c.empty.fire, c.empty.fire = function () { c.unqueued || d() }), c.unqueued++, h.always((function () { h.always((function () { c.unqueued--, jQuery.queue(e, "fx").length || c.empty.fire() })) }))), 1 === e.nodeType && ("height" in t || "width" in t) && (i.overflow = [m.overflow, m.overflowX, m.overflowY], "inline" === ("none" === (u = jQuery.css(e, "display")) ? jQuery._data(e, "olddisplay") || defaultDisplay(e.nodeName) : u) && "none" === jQuery.css(e, "float") && (p.inlineBlockNeedsLayout && "inline" !== defaultDisplay(e.nodeName) ? m.zoom = 1 : m.display = "inline-block")), i.overflow && (m.overflow = "hidden", p.shrinkWrapBlocks() || h.always((function () { m.overflow = i.overflow[0], m.overflowX = i.overflow[1], m.overflowY = i.overflow[2] }))), t) if (o = t[n], Ne.exec(o)) { if (delete t[n], r = r || "toggle" === o, o === (g ? "hide" : "show")) { if ("show" !== o || !b || void 0 === b[n]) continue; g = !0 } y[n] = b && b[n] || jQuery.style(e, n) } else u = void 0; if (jQuery.isEmptyObject(y)) "inline" === ("none" === u ? defaultDisplay(e.nodeName) : u) && (m.display = u); else for (n in b ? "hidden" in b && (g = b.hidden) : b = jQuery._data(e, "fxshow", {}), r && (b.hidden = !g), g ? jQuery(e).show() : h.done((function () { jQuery(e).hide() })), h.done((function () { var t; for (t in jQuery._removeData(e, "fxshow"), y) jQuery.style(e, t, y[t]) })), y) s = createTween(g ? b[n] : 0, n, h), n in b || (b[n] = s.start, g && (s.end = s.start, s.start = "width" === n || "height" === n ? 1 : 0)) }], prefilter: function (e, t) { t ? Animation.prefilters.unshift(e) : Animation.prefilters.push(e) } }), jQuery.speed = function (e, t, i) { var n = e && "object" == typeof e ? jQuery.extend({}, e) : { complete: i || !i && t || jQuery.isFunction(e) && e, duration: e, easing: i && t || t && !jQuery.isFunction(t) && t }; return n.duration = jQuery.fx.off ? 0 : "number" == typeof n.duration ? n.duration : n.duration in jQuery.fx.speeds ? jQuery.fx.speeds[n.duration] : jQuery.fx.speeds._default, null != n.queue && !0 !== n.queue || (n.queue = "fx"), n.old = n.complete, n.complete = function () { jQuery.isFunction(n.old) && n.old.call(this), n.queue && jQuery.dequeue(this, n.queue) }, n }, jQuery.fn.extend({ fadeTo: function (e, t, i, n) { return this.filter(isHidden).css("opacity", 0).show().end().animate({ opacity: t }, e, i, n) }, animate: function (e, t, i, n) { var o = jQuery.isEmptyObject(e), r = jQuery.speed(t, i, n), doAnimation = function () { var t = Animation(this, jQuery.extend({}, e), r); (o || jQuery._data(this, "finish")) && t.stop(!0) }; return doAnimation.finish = doAnimation, o || !1 === r.queue ? this.each(doAnimation) : this.queue(r.queue, doAnimation) }, stop: function (e, t, i) { var stopQueue = function (e) { var t = e.stop; delete e.stop, t(i) }; return "string" != typeof e && (i = t, t = e, e = void 0), t && !1 !== e && this.queue(e || "fx", []), this.each((function () { var t = !0, n = null != e && e + "queueHooks", o = jQuery.timers, r = jQuery._data(this); if (n) r[n] && r[n].stop && stopQueue(r[n]); else for (n in r) r[n] && r[n].stop && Ae.test(n) && stopQueue(r[n]); for (n = o.length; n--;)o[n].elem !== this || null != e && o[n].queue !== e || (o[n].anim.stop(i), t = !1, o.splice(n, 1)); !t && i || jQuery.dequeue(this, e) })) }, finish: function (e) { return !1 !== e && (e = e || "fx"), this.each((function () { var t, i = jQuery._data(this), n = i[e + "queue"], o = i[e + "queueHooks"], r = jQuery.timers, s = n ? n.length : 0; for (i.finish = !0, jQuery.queue(this, e, []), o && o.stop && o.stop.call(this, !0), t = r.length; t--;)r[t].elem === this && r[t].queue === e && (r[t].anim.stop(!0), r.splice(t, 1)); for (t = 0; t < s; t++)n[t] && n[t].finish && n[t].finish.call(this); delete i.finish })) } }), jQuery.each(["toggle", "show", "hide"], (function (e, t) { var i = jQuery.fn[t]; jQuery.fn[t] = function (e, n, o) { return null == e || "boolean" == typeof e ? i.apply(this, arguments) : this.animate(genFx(t, !0), e, n, o) } })), jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, (function (e, t) { jQuery.fn[e] = function (e, i, n) { return this.animate(t, e, i, n) } })), jQuery.timers = [], jQuery.fx.tick = function () { var e, t = jQuery.timers, i = 0; for (Se = jQuery.now(); i < t.length; i++)(e = t[i])() || t[i] !== e || t.splice(i--, 1); t.length || jQuery.fx.stop(), Se = void 0 }, jQuery.fx.timer = function (e) { jQuery.timers.push(e), e() ? jQuery.fx.start() : jQuery.timers.pop() }, jQuery.fx.interval = 13, jQuery.fx.start = function () { Le || (Le = e.setInterval(jQuery.fx.tick, jQuery.fx.interval)) }, jQuery.fx.stop = function () { e.clearInterval(Le), Le = null }, jQuery.fx.speeds = { slow: 600, fast: 200, _default: 400 }, jQuery.fn.delay = function (t, i) { return t = jQuery.fx && jQuery.fx.speeds[t] || t, i = i || "fx", this.queue(i, (function (i, n) { var o = e.setTimeout(i, t); n.stop = function () { e.clearTimeout(o) } })) }, function () { var e, t = n.createElement("input"), i = n.createElement("div"), o = n.createElement("select"), r = o.appendChild(n.createElement("option")); (i = n.createElement("div")).setAttribute("className", "t"), i.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", e = i.getElementsByTagName("a")[0], t.setAttribute("type", "checkbox"), i.appendChild(t), (e = i.getElementsByTagName("a")[0]).style.cssText = "top:1px", p.getSetAttribute = "t" !== i.className, p.style = /top/.test(e.getAttribute("style")), p.hrefNormalized = "/a" === e.getAttribute("href"), p.checkOn = !!t.value, p.optSelected = r.selected, p.enctype = !!n.createElement("form").enctype, o.disabled = !0, p.optDisabled = !r.disabled, (t = n.createElement("input")).setAttribute("value", ""), p.input = "" === t.getAttribute("value"), t.value = "t", t.setAttribute("type", "radio"), p.radioValue = "t" === t.value }(); var _e = /\r/g, Me = /[\x20\t\r\n\f]+/g; jQuery.fn.extend({ val: function (e) { var t, i, n, o = this[0]; return arguments.length ? (n = jQuery.isFunction(e), this.each((function (i) { var o; 1 === this.nodeType && (null == (o = n ? e.call(this, i, jQuery(this).val()) : e) ? o = "" : "number" == typeof o ? o += "" : jQuery.isArray(o) && (o = jQuery.map(o, (function (e) { return null == e ? "" : e + "" }))), (t = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]) && "set" in t && void 0 !== t.set(this, o, "value") || (this.value = o)) }))) : o ? (t = jQuery.valHooks[o.type] || jQuery.valHooks[o.nodeName.toLowerCase()]) && "get" in t && void 0 !== (i = t.get(o, "value")) ? i : "string" == typeof (i = o.value) ? i.replace(_e, "") : null == i ? "" : i : void 0 } }), jQuery.extend({ valHooks: { option: { get: function (e) { var t = jQuery.find.attr(e, "value"); return null != t ? t : jQuery.trim(jQuery.text(e)).replace(Me, " ") } }, select: { get: function (e) { for (var t, i, n = e.options, o = e.selectedIndex, r = "select-one" === e.type || o < 0, s = r ? null : [], c = r ? o + 1 : n.length, d = o < 0 ? c : r ? o : 0; d < c; d++)if (((i = n[d]).selected || d === o) && (p.optDisabled ? !i.disabled : null === i.getAttribute("disabled")) && (!i.parentNode.disabled || !jQuery.nodeName(i.parentNode, "optgroup"))) { if (t = jQuery(i).val(), r) return t; s.push(t) } return s }, set: function (e, t) { for (var i, n, o = e.options, r = jQuery.makeArray(t), s = o.length; s--;)if (n = o[s], jQuery.inArray(jQuery.valHooks.option.get(n), r) > -1) try { n.selected = i = !0 } catch (e) { n.scrollHeight } else n.selected = !1; return i || (e.selectedIndex = -1), o } } } }), jQuery.each(["radio", "checkbox"], (function () { jQuery.valHooks[this] = { set: function (e, t) { if (jQuery.isArray(t)) return e.checked = jQuery.inArray(jQuery(e).val(), t) > -1 } }, p.checkOn || (jQuery.valHooks[this].get = function (e) { return null === e.getAttribute("value") ? "on" : e.value }) })); var Fe, Ie, je = jQuery.expr.attrHandle, He = /^(?:checked|selected)$/i, $e = p.getSetAttribute, Oe = p.input; jQuery.fn.extend({ attr: function (e, t) { return access(this, jQuery.attr, e, t, arguments.length > 1) }, removeAttr: function (e) { return this.each((function () { jQuery.removeAttr(this, e) })) } }), jQuery.extend({ attr: function (e, t, i) { var n, o, r = e.nodeType; if (3 !== r && 8 !== r && 2 !== r) return void 0 === e.getAttribute ? jQuery.prop(e, t, i) : (1 === r && jQuery.isXMLDoc(e) || (t = t.toLowerCase(), o = jQuery.attrHooks[t] || (jQuery.expr.match.bool.test(t) ? Ie : Fe)), void 0 !== i ? null === i ? void jQuery.removeAttr(e, t) : o && "set" in o && void 0 !== (n = o.set(e, i, t)) ? n : (e.setAttribute(t, i + ""), i) : o && "get" in o && null !== (n = o.get(e, t)) ? n : null == (n = jQuery.find.attr(e, t)) ? void 0 : n) }, attrHooks: { type: { set: function (e, t) { if (!p.radioValue && "radio" === t && jQuery.nodeName(e, "input")) { var i = e.value; return e.setAttribute("type", t), i && (e.value = i), t } } } }, removeAttr: function (e, t) { var i, n, o = 0, r = t && t.match(_); if (r && 1 === e.nodeType) for (; i = r[o++];)n = jQuery.propFix[i] || i, jQuery.expr.match.bool.test(i) ? Oe && $e || !He.test(i) ? e[n] = !1 : e[jQuery.camelCase("default-" + i)] = e[n] = !1 : jQuery.attr(e, i, ""), e.removeAttribute($e ? i : n) } }), Ie = { set: function (e, t, i) { return !1 === t ? jQuery.removeAttr(e, i) : Oe && $e || !He.test(i) ? e.setAttribute(!$e && jQuery.propFix[i] || i, i) : e[jQuery.camelCase("default-" + i)] = e[i] = !0, i } }, jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), (function (e, t) { var i = je[t] || jQuery.find.attr; Oe && $e || !He.test(t) ? je[t] = function (e, t, n) { var o, r; return n || (r = je[t], je[t] = o, o = null != i(e, t, n) ? t.toLowerCase() : null, je[t] = r), o } : je[t] = function (e, t, i) { if (!i) return e[jQuery.camelCase("default-" + t)] ? t.toLowerCase() : null } })), Oe && $e || (jQuery.attrHooks.value = { set: function (e, t, i) { if (!jQuery.nodeName(e, "input")) return Fe && Fe.set(e, t, i); e.defaultValue = t } }), $e || (Fe = { set: function (e, t, i) { var n = e.getAttributeNode(i); if (n || e.setAttributeNode(n = e.ownerDocument.createAttribute(i)), n.value = t += "", "value" === i || t === e.getAttribute(i)) return t } }, je.id = je.name = je.coords = function (e, t, i) { var n; if (!i) return (n = e.getAttributeNode(t)) && "" !== n.value ? n.value : null }, jQuery.valHooks.button = { get: function (e, t) { var i = e.getAttributeNode(t); if (i && i.specified) return i.value }, set: Fe.set }, jQuery.attrHooks.contenteditable = { set: function (e, t, i) { Fe.set(e, "" !== t && t, i) } }, jQuery.each(["width", "height"], (function (e, t) { jQuery.attrHooks[t] = { set: function (e, i) { if ("" === i) return e.setAttribute(t, "auto"), i } } }))), p.style || (jQuery.attrHooks.style = { get: function (e) { return e.style.cssText || void 0 }, set: function (e, t) { return e.style.cssText = t + "" } }); var ze = /^(?:input|select|textarea|button|object)$/i, Pe = /^(?:a|area)$/i; jQuery.fn.extend({ prop: function (e, t) { return access(this, jQuery.prop, e, t, arguments.length > 1) }, removeProp: function (e) { return e = jQuery.propFix[e] || e, this.each((function () { try { this[e] = void 0, delete this[e] } catch (e) { } })) } }), jQuery.extend({ prop: function (e, t, i) { var n, o, r = e.nodeType; if (3 !== r && 8 !== r && 2 !== r) return 1 === r && jQuery.isXMLDoc(e) || (t = jQuery.propFix[t] || t, o = jQuery.propHooks[t]), void 0 !== i ? o && "set" in o && void 0 !== (n = o.set(e, i, t)) ? n : e[t] = i : o && "get" in o && null !== (n = o.get(e, t)) ? n : e[t] }, propHooks: { tabIndex: { get: function (e) { var t = jQuery.find.attr(e, "tabindex"); return t ? parseInt(t, 10) : ze.test(e.nodeName) || Pe.test(e.nodeName) && e.href ? 0 : -1 } } }, propFix: { for: "htmlFor", class: "className" } }), p.hrefNormalized || jQuery.each(["href", "src"], (function (e, t) { jQuery.propHooks[t] = { get: function (e) { return e.getAttribute(t, 4) } } })), p.optSelected || (jQuery.propHooks.selected = { get: function (e) { var t = e.parentNode; return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null }, set: function (e) { var t = e.parentNode; t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex) } }), jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], (function () { jQuery.propFix[this.toLowerCase()] = this })), p.enctype || (jQuery.propFix.enctype = "encoding"); var Re = /[\t\r\n\f]/g; function getClass(e) { return jQuery.attr(e, "class") || "" } jQuery.fn.extend({ addClass: function (e) { var t, i, n, o, r, s, c, d = 0; if (jQuery.isFunction(e)) return this.each((function (t) { jQuery(this).addClass(e.call(this, t, getClass(this))) })); if ("string" == typeof e && e) for (t = e.match(_) || []; i = this[d++];)if (o = getClass(i), n = 1 === i.nodeType && (" " + o + " ").replace(Re, " ")) { for (s = 0; r = t[s++];)n.indexOf(" " + r + " ") < 0 && (n += r + " "); o !== (c = jQuery.trim(n)) && jQuery.attr(i, "class", c) } return this }, removeClass: function (e) { var t, i, n, o, r, s, c, d = 0; if (jQuery.isFunction(e)) return this.each((function (t) { jQuery(this).removeClass(e.call(this, t, getClass(this))) })); if (!arguments.length) return this.attr("class", ""); if ("string" == typeof e && e) for (t = e.match(_) || []; i = this[d++];)if (o = getClass(i), n = 1 === i.nodeType && (" " + o + " ").replace(Re, " ")) { for (s = 0; r = t[s++];)for (; n.indexOf(" " + r + " ") > -1;)n = n.replace(" " + r + " ", " "); o !== (c = jQuery.trim(n)) && jQuery.attr(i, "class", c) } return this }, toggleClass: function (e, t) { var i = typeof e; return "boolean" == typeof t && "string" === i ? t ? this.addClass(e) : this.removeClass(e) : jQuery.isFunction(e) ? this.each((function (i) { jQuery(this).toggleClass(e.call(this, i, getClass(this), t), t) })) : this.each((function () { var t, n, o, r; if ("string" === i) for (n = 0, o = jQuery(this), r = e.match(_) || []; t = r[n++];)o.hasClass(t) ? o.removeClass(t) : o.addClass(t); else void 0 !== e && "boolean" !== i || ((t = getClass(this)) && jQuery._data(this, "__className__", t), jQuery.attr(this, "class", t || !1 === e ? "" : jQuery._data(this, "__className__") || "")) })) }, hasClass: function (e) { var t, i, n = 0; for (t = " " + e + " "; i = this[n++];)if (1 === i.nodeType && (" " + getClass(i) + " ").replace(Re, " ").indexOf(t) > -1) return !0; return !1 } }), jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), (function (e, t) { jQuery.fn[t] = function (e, i) { return arguments.length > 0 ? this.on(t, null, e, i) : this.trigger(t) } })), jQuery.fn.extend({ hover: function (e, t) { return this.mouseenter(e).mouseleave(t || e) } }); var qe = e.location, Be = jQuery.now(), We = /\?/, Ye = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; jQuery.parseJSON = function (t) { if (e.JSON && e.JSON.parse) return e.JSON.parse(t + ""); var i, n = null, o = jQuery.trim(t + ""); return o && !jQuery.trim(o.replace(Ye, (function (e, t, o, r) { return i && t && (n = 0), 0 === n ? e : (i = o || t, n += !r - !o, "") }))) ? Function("return " + o)() : jQuery.error("Invalid JSON: " + t) }, jQuery.parseXML = function (t) { var i; if (!t || "string" != typeof t) return null; try { e.DOMParser ? i = (new e.DOMParser).parseFromString(t, "text/xml") : ((i = new e.ActiveXObject("Microsoft.XMLDOM")).async = "false", i.loadXML(t)) } catch (e) { i = void 0 } return i && i.documentElement && !i.getElementsByTagName("parsererror").length || jQuery.error("Invalid XML: " + t), i }; var Xe = /#.*$/, Ue = /([?&])_=[^&]*/, Ke = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Ve = /^(?:GET|HEAD)$/, Ge = /^\/\//, Je = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, Ze = {}, Qe = {}, et = "*/".concat("*"), tt = qe.href, it = Je.exec(tt.toLowerCase()) || []; function addToPrefiltersOrTransports(e) { return function (t, i) { "string" != typeof t && (i = t, t = "*"); var n, o = 0, r = t.toLowerCase().match(_) || []; if (jQuery.isFunction(i)) for (; n = r[o++];)"+" === n.charAt(0) ? (n = n.slice(1) || "*", (e[n] = e[n] || []).unshift(i)) : (e[n] = e[n] || []).push(i) } } function inspectPrefiltersOrTransports(e, t, i, n) { var o = {}, r = e === Qe; function inspect(s) { var c; return o[s] = !0, jQuery.each(e[s] || [], (function (e, s) { var d = s(t, i, n); return "string" != typeof d || r || o[d] ? r ? !(c = d) : void 0 : (t.dataTypes.unshift(d), inspect(d), !1) })), c } return inspect(t.dataTypes[0]) || !o["*"] && inspect("*") } function ajaxExtend(e, t) { var i, n, o = jQuery.ajaxSettings.flatOptions || {}; for (n in t) void 0 !== t[n] && ((o[n] ? e : i || (i = {}))[n] = t[n]); return i && jQuery.extend(!0, e, i), e } function getDisplay(e) { return e.style && e.style.display || jQuery.css(e, "display") } jQuery.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: tt, type: "GET", isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(it[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": et, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, converters: { "* text": String, "text html": !0, "text json": jQuery.parseJSON, "text xml": jQuery.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function (e, t) { return t ? ajaxExtend(ajaxExtend(e, jQuery.ajaxSettings), t) : ajaxExtend(jQuery.ajaxSettings, e) }, ajaxPrefilter: addToPrefiltersOrTransports(Ze), ajaxTransport: addToPrefiltersOrTransports(Qe), ajax: function (t, i) { "object" == typeof t && (i = t, t = void 0), i = i || {}; var n, o, r, s, c, d, u, h, p = jQuery.ajaxSetup({}, i), y = p.context || p, m = p.context && (y.nodeType || y.jquery) ? jQuery(y) : jQuery.event, g = jQuery.Deferred(), b = jQuery.Callbacks("once memory"), k = p.statusCode || {}, w = {}, C = {}, D = 0, E = "canceled", S = { readyState: 0, getResponseHeader: function (e) { var t; if (2 === D) { if (!h) for (h = {}; t = Ke.exec(s);)h[t[1].toLowerCase()] = t[2]; t = h[e.toLowerCase()] } return null == t ? null : t }, getAllResponseHeaders: function () { return 2 === D ? s : null }, setRequestHeader: function (e, t) { var i = e.toLowerCase(); return D || (e = C[i] = C[i] || e, w[e] = t), this }, overrideMimeType: function (e) { return D || (p.mimeType = e), this }, statusCode: function (e) { var t; if (e) if (D < 2) for (t in e) k[t] = [k[t], e[t]]; else S.always(e[S.status]); return this }, abort: function (e) { var t = e || E; return u && u.abort(t), done(0, t), this } }; if (g.promise(S).complete = b.add, S.success = S.done, S.error = S.fail, p.url = ((t || p.url || tt) + "").replace(Xe, "").replace(Ge, it[1] + "//"), p.type = i.method || i.type || p.method || p.type, p.dataTypes = jQuery.trim(p.dataType || "*").toLowerCase().match(_) || [""], null == p.crossDomain && (n = Je.exec(p.url.toLowerCase()), p.crossDomain = !(!n || n[1] === it[1] && n[2] === it[2] && (n[3] || ("http:" === n[1] ? "80" : "443")) === (it[3] || ("http:" === it[1] ? "80" : "443")))), p.data && p.processData && "string" != typeof p.data && (p.data = jQuery.param(p.data, p.traditional)), inspectPrefiltersOrTransports(Ze, p, i, S), 2 === D) return S; for (o in (d = jQuery.event && p.global) && 0 == jQuery.active++ && jQuery.event.trigger("ajaxStart"), p.type = p.type.toUpperCase(), p.hasContent = !Ve.test(p.type), r = p.url, p.hasContent || (p.data && (r = p.url += (We.test(r) ? "&" : "?") + p.data, delete p.data), !1 === p.cache && (p.url = Ue.test(r) ? r.replace(Ue, "$1_=" + Be++) : r + (We.test(r) ? "&" : "?") + "_=" + Be++)), p.ifModified && (jQuery.lastModified[r] && S.setRequestHeader("If-Modified-Since", jQuery.lastModified[r]), jQuery.etag[r] && S.setRequestHeader("If-None-Match", jQuery.etag[r])), (p.data && p.hasContent && !1 !== p.contentType || i.contentType) && S.setRequestHeader("Content-Type", p.contentType), S.setRequestHeader("Accept", p.dataTypes[0] && p.accepts[p.dataTypes[0]] ? p.accepts[p.dataTypes[0]] + ("*" !== p.dataTypes[0] ? ", " + et + "; q=0.01" : "") : p.accepts["*"]), p.headers) S.setRequestHeader(o, p.headers[o]); if (p.beforeSend && (!1 === p.beforeSend.call(y, S, p) || 2 === D)) return S.abort(); for (o in E = "abort", { success: 1, error: 1, complete: 1 }) S[o](p[o]); if (u = inspectPrefiltersOrTransports(Qe, p, i, S)) { if (S.readyState = 1, d && m.trigger("ajaxSend", [S, p]), 2 === D) return S; p.async && p.timeout > 0 && (c = e.setTimeout((function () { S.abort("timeout") }), p.timeout)); try { D = 1, u.send(w, done) } catch (e) { if (!(D < 2)) throw e; done(-1, e) } } else done(-1, "No Transport"); function done(t, i, n, o) { var h, w, C, E, L, N = i; 2 !== D && (D = 2, c && e.clearTimeout(c), u = void 0, s = o || "", S.readyState = t > 0 ? 4 : 0, h = t >= 200 && t < 300 || 304 === t, n && (E = function ajaxHandleResponses(e, t, i) { for (var n, o, r, s, c = e.contents, d = e.dataTypes; "*" === d[0];)d.shift(), void 0 === o && (o = e.mimeType || t.getResponseHeader("Content-Type")); if (o) for (s in c) if (c[s] && c[s].test(o)) { d.unshift(s); break } if (d[0] in i) r = d[0]; else { for (s in i) { if (!d[0] || e.converters[s + " " + d[0]]) { r = s; break } n || (n = s) } r = r || n } if (r) return r !== d[0] && d.unshift(r), i[r] }(p, S, n)), E = function ajaxConvert(e, t, i, n) { var o, r, s, c, d, u = {}, h = e.dataTypes.slice(); if (h[1]) for (s in e.converters) u[s.toLowerCase()] = e.converters[s]; for (r = h.shift(); r;)if (e.responseFields[r] && (i[e.responseFields[r]] = t), !d && n && e.dataFilter && (t = e.dataFilter(t, e.dataType)), d = r, r = h.shift()) if ("*" === r) r = d; else if ("*" !== d && d !== r) { if (!(s = u[d + " " + r] || u["* " + r])) for (o in u) if ((c = o.split(" "))[1] === r && (s = u[d + " " + c[0]] || u["* " + c[0]])) { !0 === s ? s = u[o] : !0 !== u[o] && (r = c[0], h.unshift(c[1])); break } if (!0 !== s) if (s && e.throws) t = s(t); else try { t = s(t) } catch (e) { return { state: "parsererror", error: s ? e : "No conversion from " + d + " to " + r } } } return { state: "success", data: t } }(p, E, S, h), h ? (p.ifModified && ((L = S.getResponseHeader("Last-Modified")) && (jQuery.lastModified[r] = L), (L = S.getResponseHeader("etag")) && (jQuery.etag[r] = L)), 204 === t || "HEAD" === p.type ? N = "nocontent" : 304 === t ? N = "notmodified" : (N = E.state, w = E.data, h = !(C = E.error))) : (C = N, !t && N || (N = "error", t < 0 && (t = 0))), S.status = t, S.statusText = (i || N) + "", h ? g.resolveWith(y, [w, N, S]) : g.rejectWith(y, [S, N, C]), S.statusCode(k), k = void 0, d && m.trigger(h ? "ajaxSuccess" : "ajaxError", [S, p, h ? w : C]), b.fireWith(y, [S, N]), d && (m.trigger("ajaxComplete", [S, p]), --jQuery.active || jQuery.event.trigger("ajaxStop"))) } return S }, getJSON: function (e, t, i) { return jQuery.get(e, t, i, "json") }, getScript: function (e, t) { return jQuery.get(e, void 0, t, "script") } }), jQuery.each(["get", "post"], (function (e, t) { jQuery[t] = function (e, i, n, o) { return jQuery.isFunction(i) && (o = o || n, n = i, i = void 0), jQuery.ajax(jQuery.extend({ url: e, type: t, dataType: o, data: i, success: n }, jQuery.isPlainObject(e) && e)) } })), jQuery._evalUrl = function (e) { return jQuery.ajax({ url: e, type: "GET", dataType: "script", cache: !0, async: !1, global: !1, throws: !0 }) }, jQuery.fn.extend({ wrapAll: function (e) { if (jQuery.isFunction(e)) return this.each((function (t) { jQuery(this).wrapAll(e.call(this, t)) })); if (this[0]) { var t = jQuery(e, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && t.insertBefore(this[0]), t.map((function () { for (var e = this; e.firstChild && 1 === e.firstChild.nodeType;)e = e.firstChild; return e })).append(this) } return this }, wrapInner: function (e) { return jQuery.isFunction(e) ? this.each((function (t) { jQuery(this).wrapInner(e.call(this, t)) })) : this.each((function () { var t = jQuery(this), i = t.contents(); i.length ? i.wrapAll(e) : t.append(e) })) }, wrap: function (e) { var t = jQuery.isFunction(e); return this.each((function (i) { jQuery(this).wrapAll(t ? e.call(this, i) : e) })) }, unwrap: function () { return this.parent().each((function () { jQuery.nodeName(this, "body") || jQuery(this).replaceWith(this.childNodes) })).end() } }), jQuery.expr.filters.hidden = function (e) { return p.reliableHiddenOffsets() ? e.offsetWidth <= 0 && e.offsetHeight <= 0 && !e.getClientRects().length : function filterHidden(e) { for (; e && 1 === e.nodeType;) { if ("none" === getDisplay(e) || "hidden" === e.type) return !0; e = e.parentNode } return !1 }(e) }, jQuery.expr.filters.visible = function (e) { return !jQuery.expr.filters.hidden(e) }; var at = /%20/g, nt = /\[\]$/, lt = /\r?\n/g, ot = /^(?:submit|button|image|reset|file)$/i, rt = /^(?:input|select|textarea|keygen)/i; function buildParams(e, t, i, n) { var o; if (jQuery.isArray(t)) jQuery.each(t, (function (t, o) { i || nt.test(e) ? n(e, o) : buildParams(e + "[" + ("object" == typeof o && null != o ? t : "") + "]", o, i, n) })); else if (i || "object" !== jQuery.type(t)) n(e, t); else for (o in t) buildParams(e + "[" + o + "]", t[o], i, n) } jQuery.param = function (e, t) { var i, n = [], add = function (e, t) { t = jQuery.isFunction(t) ? t() : null == t ? "" : t, n[n.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t) }; if (void 0 === t && (t = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional), jQuery.isArray(e) || e.jquery && !jQuery.isPlainObject(e)) jQuery.each(e, (function () { add(this.name, this.value) })); else for (i in e) buildParams(i, e[i], t, add); return n.join("&").replace(at, "+") }, jQuery.fn.extend({ serialize: function () { return jQuery.param(this.serializeArray()) }, serializeArray: function () { return this.map((function () { var e = jQuery.prop(this, "elements"); return e ? jQuery.makeArray(e) : this })).filter((function () { var e = this.type; return this.name && !jQuery(this).is(":disabled") && rt.test(this.nodeName) && !ot.test(e) && (this.checked || !W.test(e)) })).map((function (e, t) { var i = jQuery(this).val(); return null == i ? null : jQuery.isArray(i) ? jQuery.map(i, (function (e) { return { name: t.name, value: e.replace(lt, "\r\n") } })) : { name: t.name, value: i.replace(lt, "\r\n") } })).get() } }), jQuery.ajaxSettings.xhr = void 0 !== e.ActiveXObject ? function () { return this.isLocal ? createActiveXHR() : n.documentMode > 8 ? createStandardXHR() : /^(get|post|head|put|delete|options)$/i.test(this.type) && createStandardXHR() || createActiveXHR() } : createStandardXHR; var st = 0, ct = {}, dt = jQuery.ajaxSettings.xhr(); function createStandardXHR() { try { return new e.XMLHttpRequest } catch (e) { } } function createActiveXHR() { try { return new e.ActiveXObject("Microsoft.XMLHTTP") } catch (e) { } } e.attachEvent && e.attachEvent("onunload", (function () { for (var e in ct) ct[e](void 0, !0) })), p.cors = !!dt && "withCredentials" in dt, (dt = p.ajax = !!dt) && jQuery.ajaxTransport((function (t) { var i; if (!t.crossDomain || p.cors) return { send: function (n, o) { var r, s = t.xhr(), c = ++st; if (s.open(t.type, t.url, t.async, t.username, t.password), t.xhrFields) for (r in t.xhrFields) s[r] = t.xhrFields[r]; for (r in t.mimeType && s.overrideMimeType && s.overrideMimeType(t.mimeType), t.crossDomain || n["X-Requested-With"] || (n["X-Requested-With"] = "XMLHttpRequest"), n) void 0 !== n[r] && s.setRequestHeader(r, n[r] + ""); s.send(t.hasContent && t.data || null), i = function (e, n) { var r, d, u; if (i && (n || 4 === s.readyState)) if (delete ct[c], i = void 0, s.onreadystatechange = jQuery.noop, n) 4 !== s.readyState && s.abort(); else { u = {}, r = s.status, "string" == typeof s.responseText && (u.text = s.responseText); try { d = s.statusText } catch (e) { d = "" } r || !t.isLocal || t.crossDomain ? 1223 === r && (r = 204) : r = u.text ? 200 : 404 } u && o(r, d, u, s.getAllResponseHeaders()) }, t.async ? 4 === s.readyState ? e.setTimeout(i) : s.onreadystatechange = ct[c] = i : i() }, abort: function () { i && i(void 0, !0) } } })), jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function (e) { return jQuery.globalEval(e), e } } }), jQuery.ajaxPrefilter("script", (function (e) { void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1) })), jQuery.ajaxTransport("script", (function (e) { if (e.crossDomain) { var t, i = n.head || jQuery("head")[0] || n.documentElement; return { send: function (o, r) { (t = n.createElement("script")).async = !0, e.scriptCharset && (t.charset = e.scriptCharset), t.src = e.url, t.onload = t.onreadystatechange = function (e, i) { (i || !t.readyState || /loaded|complete/.test(t.readyState)) && (t.onload = t.onreadystatechange = null, t.parentNode && t.parentNode.removeChild(t), t = null, i || r(200, "success")) }, i.insertBefore(t, i.firstChild) }, abort: function () { t && t.onload(void 0, !0) } } } })); var ut = [], ft = /(=)\?(?=&|$)|\?\?/; jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var e = ut.pop() || jQuery.expando + "_" + Be++; return this[e] = !0, e } }), jQuery.ajaxPrefilter("json jsonp", (function (t, i, n) { var o, r, s, c = !1 !== t.jsonp && (ft.test(t.url) ? "url" : "string" == typeof t.data && 0 === (t.contentType || "").indexOf("application/x-www-form-urlencoded") && ft.test(t.data) && "data"); if (c || "jsonp" === t.dataTypes[0]) return o = t.jsonpCallback = jQuery.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, c ? t[c] = t[c].replace(ft, "$1" + o) : !1 !== t.jsonp && (t.url += (We.test(t.url) ? "&" : "?") + t.jsonp + "=" + o), t.converters["script json"] = function () { return s || jQuery.error(o + " was not called"), s[0] }, t.dataTypes[0] = "json", r = e[o], e[o] = function () { s = arguments }, n.always((function () { void 0 === r ? jQuery(e).removeProp(o) : e[o] = r, t[o] && (t.jsonpCallback = i.jsonpCallback, ut.push(o)), s && jQuery.isFunction(r) && r(s[0]), s = r = void 0 })), "script" })), jQuery.parseHTML = function (e, t, i) { if (!e || "string" != typeof e) return null; "boolean" == typeof t && (i = t, t = !1), t = t || n; var o = w.exec(e), r = !i && []; return o ? [t.createElement(o[1])] : (o = buildFragment([e], t, r), r && r.length && jQuery(r).remove(), jQuery.merge([], o.childNodes)) }; var ht = jQuery.fn.load; function getWindow(e) { return jQuery.isWindow(e) ? e : 9 === e.nodeType && (e.defaultView || e.parentWindow) } return jQuery.fn.load = function (e, t, i) { if ("string" != typeof e && ht) return ht.apply(this, arguments); var n, o, r, s = this, c = e.indexOf(" "); return c > -1 && (n = jQuery.trim(e.slice(c, e.length)), e = e.slice(0, c)), jQuery.isFunction(t) ? (i = t, t = void 0) : t && "object" == typeof t && (o = "POST"), s.length > 0 && jQuery.ajax({ url: e, type: o || "GET", dataType: "html", data: t }).done((function (e) { r = arguments, s.html(n ? jQuery("<div>").append(jQuery.parseHTML(e)).find(n) : e) })).always(i && function (e, t) { s.each((function () { i.apply(this, r || [e.responseText, t, e]) })) }), this }, jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], (function (e, t) { jQuery.fn[t] = function (e) { return this.on(t, e) } })), jQuery.expr.filters.animated = function (e) { return jQuery.grep(jQuery.timers, (function (t) { return e === t.elem })).length }, jQuery.offset = { setOffset: function (e, t, i) { var n, o, r, s, c, d, u = jQuery.css(e, "position"), h = jQuery(e), p = {}; "static" === u && (e.style.position = "relative"), c = h.offset(), r = jQuery.css(e, "top"), d = jQuery.css(e, "left"), ("absolute" === u || "fixed" === u) && jQuery.inArray("auto", [r, d]) > -1 ? (s = (n = h.position()).top, o = n.left) : (s = parseFloat(r) || 0, o = parseFloat(d) || 0), jQuery.isFunction(t) && (t = t.call(e, i, jQuery.extend({}, c))), null != t.top && (p.top = t.top - c.top + s), null != t.left && (p.left = t.left - c.left + o), "using" in t ? t.using.call(e, p) : h.css(p) } }, jQuery.fn.extend({ offset: function (e) { if (arguments.length) return void 0 === e ? this : this.each((function (t) { jQuery.offset.setOffset(this, e, t) })); var t, i, n = { top: 0, left: 0 }, o = this[0], r = o && o.ownerDocument; return r ? (t = r.documentElement, jQuery.contains(t, o) ? (void 0 !== o.getBoundingClientRect && (n = o.getBoundingClientRect()), i = getWindow(r), { top: n.top + (i.pageYOffset || t.scrollTop) - (t.clientTop || 0), left: n.left + (i.pageXOffset || t.scrollLeft) - (t.clientLeft || 0) }) : n) : void 0 }, position: function () { if (this[0]) { var e, t, i = { top: 0, left: 0 }, n = this[0]; return "fixed" === jQuery.css(n, "position") ? t = n.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), jQuery.nodeName(e[0], "html") || (i = e.offset()), i.top += jQuery.css(e[0], "borderTopWidth", !0), i.left += jQuery.css(e[0], "borderLeftWidth", !0)), { top: t.top - i.top - jQuery.css(n, "marginTop", !0), left: t.left - i.left - jQuery.css(n, "marginLeft", !0) } } }, offsetParent: function () { return this.map((function () { for (var e = this.offsetParent; e && !jQuery.nodeName(e, "html") && "static" === jQuery.css(e, "position");)e = e.offsetParent; return e || ye })) } }), jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, (function (e, t) { var i = /Y/.test(t); jQuery.fn[e] = function (n) { return access(this, (function (e, n, o) { var r = getWindow(e); if (void 0 === o) return r ? t in r ? r[t] : r.document.documentElement[n] : e[n]; r ? r.scrollTo(i ? jQuery(r).scrollLeft() : o, i ? o : jQuery(r).scrollTop()) : e[n] = o }), e, n, arguments.length, null) } })), jQuery.each(["top", "left"], (function (e, t) { jQuery.cssHooks[t] = addGetHookIf(p.pixelPosition, (function (e, i) { if (i) return i = ve(e, t), pe.test(i) ? jQuery(e).position()[t] + "px" : i })) })), jQuery.each({ Height: "height", Width: "width" }, (function (e, t) { jQuery.each({ padding: "inner" + e, content: t, "": "outer" + e }, (function (i, n) { jQuery.fn[n] = function (n, o) { var r = arguments.length && (i || "boolean" != typeof n), s = i || (!0 === n || !0 === o ? "margin" : "border"); return access(this, (function (t, i, n) { var o; return jQuery.isWindow(t) ? t.document.documentElement["client" + e] : 9 === t.nodeType ? (o = t.documentElement, Math.max(t.body["scroll" + e], o["scroll" + e], t.body["offset" + e], o["offset" + e], o["client" + e])) : void 0 === n ? jQuery.css(t, i, s) : jQuery.style(t, i, n, s) }), t, r ? n : void 0, r, null) } })) })), jQuery.fn.extend({ bind: function (e, t, i) { return this.on(e, null, t, i) }, unbind: function (e, t) { return this.off(e, null, t) }, delegate: function (e, t, i, n) { return this.on(t, e, i, n) }, undelegate: function (e, t, i) { return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", i) } }), jQuery.fn.size = function () { return this.length }, jQuery.fn.andSelf = jQuery.fn.addBack, layui.define((function (e) { layui.$ = jQuery, e("jquery", jQuery) })), jQuery
|
||
}, "object" == typeof e.exports ? e.exports = n.document ? o(n) : function (e) { if (!e.document) throw new Error("jQuery requires a window with a document"); return o(e) } : o(n)
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.carousel 轮播模块
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("jquery", (function (e) { "use strict"; var t = layui.$, i = (layui.hint(), layui.device(), { config: {}, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, n, e, t) } }), n = "carousel", o = "layui-this", r = "layui-carousel-left", s = "layui-carousel-right", c = "layui-carousel-arrow", d = "layui-carousel-ind", Class = function (e) { this.config = t.extend({}, this.config, i.config, e), this.render() }; Class.prototype.config = { width: "600px", height: "280px", full: !1, arrow: "hover", indicator: "inside", autoplay: !0, interval: 3e3, anim: "", trigger: "click", index: 0 }, Class.prototype.render = function () { var e = this.config; e.elem = t(e.elem), e.elem[0] && (this.elemItem = e.elem.find(">*[carousel-item]>*"), e.index < 0 && (e.index = 0), e.index >= this.elemItem.length && (e.index = this.elemItem.length - 1), e.interval < 800 && (e.interval = 800), e.full ? e.elem.css({ position: "fixed", width: "100%", height: "100%", zIndex: 9999 }) : e.elem.css({ width: e.width, height: e.height }), e.elem.attr("lay-anim", e.anim), this.elemItem.eq(e.index).addClass(o), this.elemItem.length <= 1 || (this.indicator(), this.arrow(), this.autoplay(), this.events())) }, Class.prototype.reload = function (e) { clearInterval(this.timer), this.config = t.extend({}, this.config, e), this.render() }, Class.prototype.prevIndex = function () { var e = this.config.index - 1; return e < 0 && (e = this.elemItem.length - 1), e }, Class.prototype.nextIndex = function () { var e = this.config.index + 1; return e >= this.elemItem.length && (e = 0), e }, Class.prototype.addIndex = function (e) { var t = this.config; e = e || 1, t.index = t.index + e, t.index >= this.elemItem.length && (t.index = 0) }, Class.prototype.subIndex = function (e) { var t = this.config; e = e || 1, t.index = t.index - e, t.index < 0 && (t.index = this.elemItem.length - 1) }, Class.prototype.autoplay = function () { var e = this, t = e.config; t.autoplay && (e.timer = setInterval((function () { e.slide() }), t.interval)) }, Class.prototype.arrow = function () { var e = this, i = e.config, n = t(['<button class="layui-icon ' + c + '" lay-type="sub">' + ("updown" === i.anim ? "" : "") + "</button>", '<button class="layui-icon ' + c + '" lay-type="add">' + ("updown" === i.anim ? "" : "") + "</button>"].join("")); i.elem.attr("lay-arrow", i.arrow), i.elem.find("." + c)[0] && i.elem.find("." + c).remove(), i.elem.append(n), n.on("click", (function () { var i = t(this).attr("lay-type"); e.slide(i) })) }, Class.prototype.indicator = function () { var e, i = this, n = i.config, o = i.elemInd = t(['<div class="' + d + '"><ul>', (e = [], layui.each(i.elemItem, (function (t) { e.push("<li" + (n.index === t ? ' class="layui-this"' : "") + "></li>") })), e.join("")), "</ul></div>"].join("")); n.elem.attr("lay-indicator", n.indicator), n.elem.find("." + d)[0] && n.elem.find("." + d).remove(), n.elem.append(o), "updown" === n.anim && o.css("margin-top", -o.height() / 2), o.find("li").on("hover" === n.trigger ? "mouseover" : n.trigger, (function () { var e = t(this).index(); e > n.index ? i.slide("add", e - n.index) : e < n.index && i.slide("sub", n.index - e) })) }, Class.prototype.slide = function (e, t) { var i = this, c = i.elemItem, d = i.config, u = d.index, h = d.elem.attr("lay-filter"); i.haveSlide || ("sub" === e ? (i.subIndex(t), c.eq(d.index).addClass("layui-carousel-prev"), setTimeout((function () { c.eq(u).addClass(s), c.eq(d.index).addClass(s) }), 50)) : (i.addIndex(t), c.eq(d.index).addClass("layui-carousel-next"), setTimeout((function () { c.eq(u).addClass(r), c.eq(d.index).addClass(r) }), 50)), setTimeout((function () { c.removeClass(o + " layui-carousel-prev layui-carousel-next " + r + " " + s), c.eq(d.index).addClass(o), i.haveSlide = !1 }), 300), i.elemInd.find("li").eq(d.index).addClass(o).siblings().removeClass(o), i.haveSlide = !0, layui.event.call(this, n, "change(" + h + ")", { index: d.index, prevIndex: u, item: c.eq(d.index) })) }, Class.prototype.events = function () { var e = this, t = e.config; t.elem.data("haveEvents") || (t.elem.on("mouseenter", (function () { clearInterval(e.timer) })).on("mouseleave", (function () { e.autoplay() })), t.elem.data("haveEvents", !0)) }, i.render = function (e) { return new Class(e) }, e(n, i) }))
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.code 代码修饰器
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("jquery", (function (e) { "use strict"; var t = layui.$; e("code", (function (e) { var i = []; (e = e || {}).elem = t(e.elem || ".layui-code"), e.about = !("about" in e) || e.about, e.elem.each((function () { i.push(this) })), layui.each(i.reverse(), (function (i, n) { var o = t(n), r = o.html(); (o.attr("lay-encode") || e.encode) && (r = r.replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, """)), o.html('<ol class="layui-code-ol"><li>' + r.replace(/[\r\t\n]+/g, "</li><li>") + "</li></ol>"), o.find(">.layui-code-h3")[0] || o.prepend('<h3 class="layui-code-h3">' + (o.attr("lay-title") || e.title || "code") + (e.about ? '<a href="http://www.layui.com/doc/modules/code.html" target="_blank">layui.code</a>' : "") + "</h3>"); var s = o.find(">.layui-code-ol"); o.addClass("layui-box layui-code-view"), (o.attr("lay-skin") || e.skin) && o.addClass("layui-code-" + (o.attr("lay-skin") || e.skin)), (s.find("li").length / 100 | 0) > 0 && s.css("margin-left", (s.find("li").length / 100 | 0) + "px"), (o.attr("lay-height") || e.height) && s.css("max-height", o.attr("lay-height") || e.height) })) })) })).addcss("modules/code.css", "skincodecss")
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Title: layui.colorpicker 颜色选择器
|
||
@Author: star1029
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("jquery", (function (e) { "use strict"; var t = layui.jquery, i = { config: {}, index: layui.colorpicker ? layui.colorpicker.index + 1e4 : 0, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, "colorpicker", e, t) } }, thisColorPicker = function () { return { config: this.config } }, n = "layui-colorpicker", o = ".layui-colorpicker-main", r = "layui-colorpicker-trigger-span", s = "layui-colorpicker-trigger-i", c = "layui-colorpicker-alpha-bgcolor", d = "layui-colorpicker-alpha-slider", u = "layui-colorpicker-main-input", RGBToHSB = function (e) { var t = { h: 0, s: 0, b: 0 }, i = Math.min(e.r, e.g, e.b), n = Math.max(e.r, e.g, e.b), o = n - i; return t.b = n, t.s = 0 != n ? 255 * o / n : 0, 0 != t.s ? e.r == n ? t.h = (e.g - e.b) / o : e.g == n ? t.h = 2 + (e.b - e.r) / o : t.h = 4 + (e.r - e.g) / o : t.h = -1, n == i && (t.h = 0), t.h *= 60, t.h < 0 && (t.h += 360), t.s *= 100 / 255, t.b *= 100 / 255, t }, HSBToRGB = function (e) { var t = {}, i = e.h, n = 255 * e.s / 100, o = 255 * e.b / 100; if (0 == n) t.r = t.g = t.b = o; else { var r = o, s = (255 - n) * o / 255, c = i % 60 * (r - s) / 60; 360 == i && (i = 0), i < 60 ? (t.r = r, t.b = s, t.g = s + c) : i < 120 ? (t.g = r, t.b = s, t.r = r - c) : i < 180 ? (t.g = r, t.r = s, t.b = s + c) : i < 240 ? (t.b = r, t.r = s, t.g = r - c) : i < 300 ? (t.b = r, t.g = s, t.r = s + c) : i < 360 ? (t.r = r, t.g = s, t.b = r - c) : (t.r = 0, t.g = 0, t.b = 0) } return { r: Math.round(t.r), g: Math.round(t.g), b: Math.round(t.b) } }, HSBToHEX = function (e) { var i = HSBToRGB(e), n = [i.r.toString(16), i.g.toString(16), i.b.toString(16)]; return t.each(n, (function (e, t) { 1 == t.length && (n[e] = "0" + t) })), n.join("") }, RGBSTo = function (e) { var t = e.match(/[0-9]{1,3}/g) || []; return { r: t[0], g: t[1], b: t[2] } }, h = t(window), p = t(document), Class = function (e) { this.index = ++i.index, this.config = t.extend({}, this.config, i.config, e), this.render() }; Class.prototype.config = { color: "", size: null, alpha: !1, format: "hex", predefine: !1, colors: ["#009688", "#5FB878", "#1E9FFF", "#FF5722", "#FFB800", "#01AAED", "#999", "#c00", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585", "rgb(0, 186, 189)", "rgb(255, 120, 0)", "rgb(250, 212, 0)", "#393D49", "rgba(0,0,0,.5)", "rgba(255, 69, 0, 0.68)", "rgba(144, 240, 144, 0.5)", "rgba(31, 147, 255, 0.73)"] }, Class.prototype.render = function () { var e, i = this.config, n = t(['<div class="layui-unselect layui-colorpicker">', "<span " + ("rgb" == i.format && i.alpha ? 'class="layui-colorpicker-trigger-bgcolor"' : "") + ">", '<span class="layui-colorpicker-trigger-span" ', 'lay-type="' + ("rgb" == i.format ? i.alpha ? "rgba" : "torgb" : "") + '" ', 'style="' + (e = "", (i.color ? (e = i.color, (i.color.match(/[0-9]{1,3}/g) || []).length > 3 && (i.alpha && "rgb" == i.format || (e = "#" + HSBToHEX(RGBToHSB(RGBSTo(i.color))))), "background: " + e) : e) + '">'), '<i class="layui-icon layui-colorpicker-trigger-i ' + (i.color ? "layui-icon-down" : "layui-icon-close") + '"></i>', "</span>", "</span>", "</div>"].join("")), o = t(i.elem); i.size && n.addClass("layui-colorpicker-" + i.size), o.addClass("layui-inline").html(this.elemColorBox = n), this.color = this.elemColorBox.find("." + r)[0].style.background, this.events() }, Class.prototype.renderPicker = function () { var e = this.config, i = this.elemColorBox[0], n = this.elemPicker = t(['<div id="layui-colorpicker' + this.index + '" data-index="' + this.index + '" class="layui-anim layui-anim-upbit layui-colorpicker-main">', '<div class="layui-colorpicker-main-wrapper">', '<div class="layui-colorpicker-basis">', '<div class="layui-colorpicker-basis-white"></div>', '<div class="layui-colorpicker-basis-black"></div>', '<div class="layui-colorpicker-basis-cursor"></div>', "</div>", '<div class="layui-colorpicker-side">', '<div class="layui-colorpicker-side-slider"></div>', "</div>", "</div>", '<div class="layui-colorpicker-main-alpha ' + (e.alpha ? "layui-show" : "") + '">', '<div class="layui-colorpicker-alpha-bgcolor">', '<div class="layui-colorpicker-alpha-slider"></div>', "</div>", "</div>", function () { if (e.predefine) { var t = ['<div class="layui-colorpicker-main-pre">']; return layui.each(e.colors, (function (e, i) { t.push(['<div class="layui-colorpicker-pre' + ((i.match(/[0-9]{1,3}/g) || []).length > 3 ? " layui-colorpicker-pre-isalpha" : "") + '">', '<div style="background:' + i + '"></div>', "</div>"].join("")) })), t.push("</div>"), t.join("") } return "" }(), '<div class="layui-colorpicker-main-input">', '<div class="layui-inline">', '<input type="text" class="layui-input">', "</div>", '<div class="layui-btn-container">', '<button class="layui-btn layui-btn-primary layui-btn-sm" colorpicker-events="clear">清空</button>', '<button class="layui-btn layui-btn-sm" colorpicker-events="confirm">确定</button>', "</div", "</div>", "</div>"].join("")); this.elemColorBox.find("." + r)[0]; t(o)[0] && t(o).data("index") == this.index ? this.removePicker(Class.thisElemInd) : (this.removePicker(Class.thisElemInd), t("body").append(n)), Class.thisElemInd = this.index, Class.thisColor = i.style.background, this.position(), this.pickerEvents() }, Class.prototype.removePicker = function (e) { this.config; return t("#layui-colorpicker" + (e || this.index)).remove(), this }, Class.prototype.position = function () { var e = this.config, t = this.bindElem || this.elemColorBox[0], i = this.elemPicker[0], n = t.getBoundingClientRect(), o = i.offsetWidth, r = i.offsetHeight, scrollArea = function (e) { return e = e ? "scrollLeft" : "scrollTop", document.body[e] | document.documentElement[e] }, winArea = function (e) { return document.documentElement[e ? "clientWidth" : "clientHeight"] }, s = n.left, c = n.bottom; c += 5, (s -= (o - t.offsetWidth) / 2) + o + 5 > winArea("width") ? s = winArea("width") - o - 5 : s < 5 && (s = 5), c + r + 5 > winArea() && (c = n.top > r ? n.top - r : winArea() - r, c -= 10), e.position && (i.style.position = e.position), i.style.left = s + ("fixed" === e.position ? 0 : scrollArea(1)) + "px", i.style.top = c + ("fixed" === e.position ? 0 : scrollArea()) + "px" }, Class.prototype.val = function () { this.config; var e = this.elemColorBox.find("." + r), t = this.elemPicker.find("." + u), i = e[0].style.backgroundColor; if (i) { var n = RGBToHSB(RGBSTo(i)), o = e.attr("lay-type"); if (this.select(n.h, n.s, n.b), "torgb" === o && t.find("input").val(i), "rgba" === o) { var s = RGBSTo(i); if (3 == (i.match(/[0-9]{1,3}/g) || []).length) t.find("input").val("rgba(" + s.r + ", " + s.g + ", " + s.b + ", 1)"), this.elemPicker.find("." + d).css("left", 280); else { t.find("input").val(i); var h = 280 * i.slice(i.lastIndexOf(",") + 1, i.length - 1); this.elemPicker.find("." + d).css("left", h) } this.elemPicker.find("." + c)[0].style.background = "linear-gradient(to right, rgba(" + s.r + ", " + s.g + ", " + s.b + ", 0), rgb(" + s.r + ", " + s.g + ", " + s.b + "))" } } else this.select(0, 100, 100), t.find("input").val(""), this.elemPicker.find("." + c)[0].style.background = "", this.elemPicker.find("." + d).css("left", 280) }, Class.prototype.side = function () { var e = this, i = e.config, n = e.elemColorBox.find("." + r), o = n.attr("lay-type"), p = e.elemPicker.find(".layui-colorpicker-side"), y = e.elemPicker.find(".layui-colorpicker-side-slider"), m = e.elemPicker.find(".layui-colorpicker-basis"), g = e.elemPicker.find(".layui-colorpicker-basis-cursor"), b = e.elemPicker.find("." + c), k = e.elemPicker.find("." + d), w = y[0].offsetTop / 180 * 360, C = 100 - (g[0].offsetTop + 3) / 180 * 100, D = (g[0].offsetLeft + 3) / 260 * 100, E = Math.round(k[0].offsetLeft / 280 * 100) / 100, S = e.elemColorBox.find("." + s), L = e.elemPicker.find(".layui-colorpicker-pre").children("div"), change = function (t, r, s, c) { e.select(t, r, s); var d = HSBToRGB({ h: t, s: r, b: s }); if (S.addClass("layui-icon-down").removeClass("layui-icon-close"), n[0].style.background = "rgb(" + d.r + ", " + d.g + ", " + d.b + ")", "torgb" === o && e.elemPicker.find("." + u).find("input").val("rgb(" + d.r + ", " + d.g + ", " + d.b + ")"), "rgba" === o) { var h; h = 280 * c, k.css("left", h), e.elemPicker.find("." + u).find("input").val("rgba(" + d.r + ", " + d.g + ", " + d.b + ", " + c + ")"), n[0].style.background = "rgba(" + d.r + ", " + d.g + ", " + d.b + ", " + c + ")", b[0].style.background = "linear-gradient(to right, rgba(" + d.r + ", " + d.g + ", " + d.b + ", 0), rgb(" + d.r + ", " + d.g + ", " + d.b + "))" } i.change && i.change(e.elemPicker.find("." + u).find("input").val()) }, N = t(['<div class="layui-auxiliar-moving" id="LAY-colorpicker-moving"></div'].join("")), createMoveElem = function (e) { t("#LAY-colorpicker-moving")[0] || t("body").append(N), N.on("mousemove", e), N.on("mouseup", (function () { N.remove() })).on("mouseleave", (function () { N.remove() })) }; y.on("mousedown", (function (e) { var t = this.offsetTop, i = e.clientY; createMoveElem((function (e) { var n = t + (e.clientY - i), o = p[0].offsetHeight; n < 0 && (n = 0), n > o && (n = o); var r = n / 180 * 360; w = r, change(r, D, C, E), e.preventDefault() })), e.preventDefault() })), p.on("click", (function (e) { var i = e.clientY - t(this).offset().top; i < 0 && (i = 0), i > this.offsetHeight && (i = this.offsetHeight); var n = i / 180 * 360; w = n, change(n, D, C, E), e.preventDefault() })), g.on("mousedown", (function (e) { var t = this.offsetTop, i = this.offsetLeft, n = e.clientY, o = e.clientX; layui.stope(e), createMoveElem((function (e) { var r = t + (e.clientY - n), s = i + (e.clientX - o), c = m[0].offsetHeight - 3, d = m[0].offsetWidth - 3; r < -3 && (r = -3), r > c && (r = c), s < -3 && (s = -3), s > d && (s = d); var u = (s + 3) / 260 * 100, h = 100 - (r + 3) / 180 * 100; C = h, D = u, change(w, u, h, E), e.preventDefault() })), e.preventDefault() })), m.on("mousedown", (function (e) { var i = e.clientY - t(this).offset().top - 3 + h.scrollTop(), n = e.clientX - t(this).offset().left - 3 + h.scrollLeft(); i < -3 && (i = -3), i > this.offsetHeight - 3 && (i = this.offsetHeight - 3), n < -3 && (n = -3), n > this.offsetWidth - 3 && (n = this.offsetWidth - 3); var o = (n + 3) / 260 * 100, r = 100 - (i + 3) / 180 * 100; C = r, D = o, change(w, o, r, E), e.preventDefault(), g.trigger(e, "mousedown") })), k.on("mousedown", (function (e) { var t = this.offsetLeft, i = e.clientX; createMoveElem((function (e) { var n = t + (e.clientX - i), o = b[0].offsetWidth; n < 0 && (n = 0), n > o && (n = o); var r = Math.round(n / 280 * 100) / 100; E = r, change(w, D, C, r), e.preventDefault() })), e.preventDefault() })), b.on("click", (function (e) { var i = e.clientX - t(this).offset().left; i < 0 && (i = 0), i > this.offsetWidth && (i = this.offsetWidth); var n = Math.round(i / 280 * 100) / 100; E = n, change(w, D, C, n), e.preventDefault() })), L.each((function () { t(this).on("click", (function () { t(this).parent(".layui-colorpicker-pre").addClass("selected").siblings().removeClass("selected"); var e = this.style.backgroundColor, i = RGBToHSB(RGBSTo(e)), n = e.slice(e.lastIndexOf(",") + 1, e.length - 1); w = i.h, D = i.s, C = i.b, 3 == (e.match(/[0-9]{1,3}/g) || []).length && (n = 1), E = n, change(i.h, i.s, i.b, n) })) })) }, Class.prototype.select = function (e, t, i, n) { this.config; var o = HSBToHEX({ h: e, s: 100, b: 100 }), r = HSBToHEX({ h: e, s: t, b: i }), s = e / 360 * 180, c = 180 - i / 100 * 180 - 3, d = t / 100 * 260 - 3; this.elemPicker.find(".layui-colorpicker-side-slider").css("top", s), this.elemPicker.find(".layui-colorpicker-basis")[0].style.background = "#" + o, this.elemPicker.find(".layui-colorpicker-basis-cursor").css({ top: c, left: d }), "change" !== n && this.elemPicker.find("." + u).find("input").val("#" + r) }, Class.prototype.pickerEvents = function () { var e = this, i = e.config, n = e.elemColorBox.find("." + r), o = e.elemPicker.find("." + u + " input"), c = { clear: function (t) { n[0].style.background = "", e.elemColorBox.find("." + s).removeClass("layui-icon-down").addClass("layui-icon-close"), e.color = "", i.done && i.done(""), e.removePicker() }, confirm: function (t, r) { var c = o.val(), u = c, h = {}; if (c.indexOf(",") > -1) { if (h = RGBToHSB(RGBSTo(c)), e.select(h.h, h.s, h.b), n[0].style.background = u = "#" + HSBToHEX(h), (c.match(/[0-9]{1,3}/g) || []).length > 3 && "rgba" === n.attr("lay-type")) { var p = 280 * c.slice(c.lastIndexOf(",") + 1, c.length - 1); e.elemPicker.find("." + d).css("left", p), n[0].style.background = c, u = c } } else h = function (e) { if (3 == (e = e.indexOf("#") > -1 ? e.substring(1) : e).length) { var t = e.split(""); e = t[0] + t[0] + t[1] + t[1] + t[2] + t[2] } return e = parseInt(e, 16), RGBToHSB({ r: e >> 16, g: (65280 & e) >> 8, b: 255 & e }) }(c), n[0].style.background = u = "#" + HSBToHEX(h), e.elemColorBox.find("." + s).removeClass("layui-icon-close").addClass("layui-icon-down"); if ("change" === r) return e.select(h.h, h.s, h.b, r), void (i.change && i.change(u)); e.color = c, i.done && i.done(c), e.removePicker() } }; e.elemPicker.on("click", "*[colorpicker-events]", (function () { var e = t(this), i = e.attr("colorpicker-events"); c[i] && c[i].call(this, e) })), o.on("keyup", (function (e) { var i = t(this); c.confirm.call(this, i, 13 === e.keyCode ? null : "change") })) }, Class.prototype.events = function () { var e = this, i = e.config, c = e.elemColorBox.find("." + r); e.elemColorBox.on("click", (function () { e.renderPicker(), t(o)[0] && (e.val(), e.side()) })), i.elem && i.elem[0] && !e.elemColorBox[0].eventHandler && (p.on("click", (function (i) { if (!t(i.target).hasClass(n) && !t(i.target).parents("." + n)[0] && !t(i.target).hasClass(o.replace(/\./g, "")) && !t(i.target).parents(o)[0] && e.elemPicker) { if (e.color) { var r = RGBToHSB(RGBSTo(e.color)); e.select(r.h, r.s, r.b) } else e.elemColorBox.find("." + s).removeClass("layui-icon-down").addClass("layui-icon-close"); c[0].style.background = e.color || "", e.removePicker() } })), h.on("resize", (function () { if (!e.elemPicker || !t(o)[0]) return !1; e.position() })), e.elemColorBox[0].eventHandler = !0) }, i.render = function (e) { var t = new Class(e); return thisColorPicker.call(t) }, e("colorpicker", i) }))
|
||
}, function (e, t) { layui.define(["laytpl", "laypage", "layer", "form"], (function (e) { "use strict"; var t = layui.$, i = layui.laytpl, n = layui.laypage, o = layui.layer, r = layui.form, s = layui.hint(), c = layui.device(), d = { config: { indexName: "lay_table_index", cols: { isCheckName: "lay_is_checked", isRadio: "lay_is_radio", isOpen: "lay_is_open", isShow: "lay_is_show", level: "lay_level", children: "children", cheDisabled: "lay_che_disabled", radDisabled: "lay_rad_disabled" } }, cache: { tableId: { data: { list: [], map: {}, treeList: [] } }, cla: { claIds: { tableId: !0 }, claObjs: { tableId: {} } }, selectcode: { demokey: [{ key: { value: "" } }] } }, index: layui.table ? layui.table.index + 1e4 : 0, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, u, e, t) }, getClass: function (e) { return d.cache.cla.claObjs[e] }, pushClass: function (e, t) { d.cache.cla.claObjs[e] = t }, isCalss: function (e) { return (this.cache.cla.claIds || {}).hasOwnProperty(e) || !1 }, isClassYes: function (e) { return (this.cache.cla.claIds || {})[e] || !1 }, pushClassIds: function (e, t) { this.cache.cla.claIds[e] = t }, setObj: function (e, t, i) { this.obj[e] || (this.obj[e] = {}), this.obj[e][t] = i }, getObj: function (e, t) { return this.obj[e] ? this.obj[e][t] : null }, getDataList: function (e) { return d.cache[e] ? d.cache[e].data.list : [] }, setDataList: function (e, t) { d.cache[e] || (d.cache[e] = {}), d.cache[e].data || (d.cache[e].data = {}), d.cache[e].data.list || (d.cache[e].data.list = []), d.cache[e].data.list = t }, getDataMap: function (e) { return d.cache[e] ? d.cache[e].data.map : {} }, setDataMap: function (e, t) { d.cache[e] || (d.cache[e] = {}), d.cache[e].data || (d.cache[e].data = {}), d.cache[e].data.map || (d.cache[e].data.map = {}), d.cache[e].data.map = t }, getDataTreeList: function (e) { return d.cache[e] ? d.cache[e].data.treeList : [] }, setDataTreeList: function (e, t) { d.cache[e] || (d.cache[e] = {}), d.cache[e].data || (d.cache[e].data = {}), d.cache[e].data.treeList || (d.cache[e].data.treeList = {}), d.cache[e].data.treeList = t }, init: function (e, i) { i = i || {}; var n = t(e ? 'table[lay-filter="' + e + '"]' : h + "[lay-data]"), o = "Table element property lay-data configuration item has a syntax error: "; return n.each((function () { var n = t(this), r = n.attr("lay-data"); try { r = new Function("return " + r)() } catch (e) { s.error(o + r) } var c = [], u = t.extend({ elem: this, cols: [], data: [], skin: n.attr("lay-skin"), size: n.attr("lay-size"), even: "string" == typeof n.attr("lay-even") }, d.config, i, r); e && n.hide(), n.find("thead>tr").each((function (e) { u.cols[e] = [], t(this).children().each((function (i) { var n = t(this), r = n.attr("lay-data"); try { r = new Function("return " + r)() } catch (e) { return s.error(o + r) } var d = t.extend({ title: n.text(), colspan: n.attr("colspan") || 0, rowspan: n.attr("rowspan") || 0 }, r); d.colspan < 2 && c.push(d), u.cols[e].push(d) })) })), n.find("tbody>tr").each((function (e) { var i = t(this), n = {}; i.children("td").each((function (e, i) { var o = t(this), r = o.data("field"); if (r) return n[r] = o.html() })), layui.each(c, (function (e, t) { var o = i.children("td").eq(e); n[t.field] = o.html() })), u.data[e] = n })), d.render(u) })), this }, render: function (e) { d.pushClassIds(e.id); var t = new Class(e); return thisTable.call(t) }, ready: function (e, t) { var i = !1, n = new Date; e && t && setTimeout((function isReady() { if (e) { var o = d.getClass(e); if (o && o.hasOwnProperty("layBody")) t(o), i = !0; else (new Date).getTime() - n.getTime() <= 1e4 && !i && setTimeout(isReady, 50) } }), 50) }, checkStatus: function (e) { var t = 0, i = 0, n = [], o = d.getDataList(e) || []; return layui.each(o, (function (e, o) { o.constructor !== Array ? o[d.config.cols.isCheckName] && (t++, n.push(d.clearCacheKey(o))) : i++ })), { data: n, isAll: !!o.length && t === o.length - i } }, setCheckStatus: function (e, t, i) { var n = d.getClass(e), o = d.getDataList(e) || []; n.layBody.find('input[name="layTableCheckbox"]'); t && i && (i.split(",").forEach((function (e) { var i = null; if (o.forEach((function (n) { n[t] + "" != e + "" || (i = n) })), i) { var r = i[d.config.indexName]; n.layBody.find('input[name="layTableCheckbox"][value="' + r + '"]').prop("checked", !0), n.setCheckData(r, !0) } })), n.syncCheckAll(), n.renderForm("checkbox")); return null }, radioStatus: function (e) { var i = null, n = d.getDataList(e) || [], o = t("input[name='" + b + e + "']:checked").val(); return o = parseInt(o), n.forEach((function (e) { e[d.config.indexName] != o || (i = e) })), i }, setRadioStatus: function (e, i, n) { var o = null, s = d.getDataList(e) || []; if (i && n && (s.forEach((function (e) { e[i] + "" != n + "" || (o = e) })), o)) { var c = o[d.config.indexName]; t("input:radio[name='" + b + e + "'][value='" + c + "']").prop("checked", !0), r.render("radio") } return o }, clearCacheKey: function (e) { return delete (e = t.extend({}, e))[d.config.cols.isCheckName], delete e[d.config.indexName], e }, query: function (e, i) { var n = d.getClass(e); n.renderTdCss(), n.config.data && n.config.data.constructor === Array && delete n.config.data, n.config = t.extend({}, n.config, i), n.pullData(n.page, n.loading()) }, reload: function (e, i) { var n = thisTable.config[e]; return i = i || {}, n ? (i.data && i.data.constructor === Array && delete n.data, d.render(t.extend(!0, {}, n, i))) : s.error("The ID option was not found in the table instance") }, addRow: function (e, i, n) { var o = d.getClass(e), r = o.config, s = d.getDataList(e) || []; if (s.splice(i, 0, n), d.restNumbers(s), o.resetData(s), r.isTree) { var c = o.treeFindUpData(n); c && (o.treeNodeOpen(c, !0), o.renderTreeConvertShowName(c)) } var u = o.renderTr(n, n[d.config.indexName]), h = '<tr data-index="' + n[d.config.indexName] + '"' + o.renderTrUpids(n) + ">" + u.join("") + "</tr>"; if (0 == i) { var p = o.layBody.find("table tbody"); t(p).prepend(h), o.layBody.find(".layui-none").remove() } else { var y = o.layBody.find("[data-index=" + (i - 1) + "]"); t(y).after(h) } o.renderForm(), o.renderPage(o.config.page.count + 1), o.restNumbers() }, delRow: function (e, t) { var i = d.getClass(e), n = i.config, o = d.getDataList(e), r = [], s = {}, c = [], u = []; if (i && t) { d.kit.isArray(t) ? c = t : c[0] = t, c.forEach((function (e) { var t = i.treeFindUpData(e); t && u.push(t) })), (r = n.isTree ? d.treeFindSonList(i.config.id, c) : c).forEach((function (e) { var t = e[d.config.indexName]; s[t] = t, i.layBody.find('tr[data-index="' + t + '"]').remove() })), i.restNumbers(); for (var h = [], p = 0, y = o.length; p < y; p++) { var m = !0; r.forEach((function (e) { e[d.config.indexName] === o[p][d.config.indexName] && (m = !1) })), m && h.push(o[p]) } d.restNumbers(h), i.resetData(h), u.forEach((function (e) { i.renderTreeConvertShowName(e) })), n.page && i.renderPage(i.config.page.count - Object.keys(s).length) } }, restNumbers: function (e) { if (e) { var t = 0; e.forEach((function (e) { e[d.config.indexName] = t, t++ })) } }, treeNodeOpen: function (e, t) { var i = d.getClass(tableId); i && e && i.treeNodeOpen(e, t) }, treeOpenAll: function (e, t) { if (d.getClass(e)) { void 0 === t && (t = !0); var i = d.getDataList(e); i && i.forEach((function (e) { d.treeNodeOpen(e, t) })) } }, treeFindSonList: function (e, t) { var i = d.getClass(e); if (!i || !t) return []; var n = [], o = [], r = {}; return d.kit.isArray(t) ? n = t : n[0] = t, n.forEach((function (e) { e.children.length > 0 && i.treeFindSonData(e).forEach((function (e) { r[e[d.config.indexName]] || (o.push(e), r[e[d.config.indexName]] = e[d.config.indexName]) })); o.push(e), r[e[d.config.indexName]] = e[d.config.indexName] })), o }, treeFindUpDatas: function (e, t) { var i = d.getClass(e); return i && t ? i.treeFindUpDatas(t) : [] }, treeFindSonIds: function (e, t) { var i = []; return d.treeFindSonList(e, t).forEach((function (e) { i.push([d.config.indexName]) })), i }, treeFindSonIdFields: function (e, t) { var i = [], n = d.getClass(e); return d.treeFindSonList(e, t).forEach((function (e) { i.push(e[n.config.idField]) })), i }, kit: { isArray: function (e) { return "[object Array]" === Object.prototype.toString.call(e) } } }, thisTable = function () { var e = this, t = e.config, i = t.id; return i && (thisTable.config[i] = t), { reload: function (t) { e.reload.call(e, t) }, config: t } }, u = "dltable", h = ".layui-table", p = "layui-none", y = "layui-table-view", m = ".layui-table-sort", g = "layui-table-edit", b = "table_radio_", TPL_HEADER = function (e) { return ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', "<thead>", "{{# layui.each(d.data.cols, function(i1, item1){ }}", "<tr>", "{{# layui.each(item1, function(i2, item2){ }}", '{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}', '{{# if(item2.fixed === "right"){ right = true; } }}', (e = e || {}).fixed && "right" !== e.fixed ? '{{# if(item2.fixed && item2.fixed !== "right"){ }}' : "right" === e.fixed ? '{{# if(item2.fixed === "right"){ }}' : "", '<th data-field="{{ item2.field||i2 }}" {{# if(item2.minWidth){ }}data-minwidth="{{item2.minWidth}}"{{# } }} {{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}} {{# if(item2.unresize){ }}data-unresize="true"{{# } }}>', '<div class="layui-table-cell laytable-cell-', "{{# if(item2.colspan > 1){ }}", "group", "{{# } else { }}", "{{d.index}}-{{item2.field || i2}}", '{{# if(item2.type !== "normal"){ }}', " laytable-cell-{{ item2.type }}", "{{# } }}", "{{# } }}", '" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>', '{{# if(item2.type === "checkbox"){ }}', '<input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose">', "{{# } else { }}", '<span>{{item2.title||""}}</span>', "{{# if(!(item2.colspan > 1) && item2.sort){ }}", '<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc"></i><i class="layui-edge layui-table-sort-desc"></i></span>', "{{# } }}", "{{# } }}", "</div>", "</th>", e.fixed ? "{{# }; }}" : "", "{{# }); }}", "</tr>", "{{# }); }}", "</thead>", "</table>"].join("") }, k = ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', "<tbody></tbody>", "</table>"].join(""), w = ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}" lay-filter="LAY-table-{{d.index}}" style="{{# if(d.data.width){ }}width:{{d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{d.data.height}}px;{{# } }}">', "{{# if(d.data.toolbar){ }}", '<div class="layui-table-tool"></div>', "{{# } }}", '<div class="layui-table-box">', "{{# var left, right; }}", '<div class="layui-table-header">', TPL_HEADER(), "</div>", '<div class="layui-table-filter">', void 0, "</div>", '<div class="layui-table-body layui-table-main">', k, "</div>", "{{# if(left){ }}", '<div class="layui-table-fixed layui-table-fixed-l">', '<div class="layui-table-header">', TPL_HEADER({ fixed: !0 }), "</div>", '<div class="layui-table-body">', k, "</div>", "</div>", "{{# }; }}", "{{# if(right){ }}", '<div class="layui-table-fixed layui-table-fixed-r">', '<div class="layui-table-header">', TPL_HEADER({ fixed: "right" }), '<div class="layui-table-mend"></div>', "</div>", '<div class="layui-table-body">', k, "</div>", "</div>", "{{# }; }}", "</div>", "{{# if(d.data.page){ }}", '<div class="layui-table-page">', '<div id="layui-table-page{{d.index}}"></div>', "</div>", "{{# } }}", "</div>"].join(""), C = t(window), D = t(document), Class = function (e) { this.index = ++d.index, this.config = t.extend({}, this.config, d.config, e), this.render(), d.pushClass(e.id, this) }; Class.prototype.config = { limit: 10, loading: !0, cellMinWidth: 60, text: { none: "无数据" }, isFilter: !1, method: "post", radDisabledNum: 0, cheDisabledNum: 0 }, Class.prototype.render = function () { var e = this.config; if (e.elem = t(e.elem), e.where = e.where || {}, e.id = e.id || e.elem.attr("id"), e.request = t.extend({ pageName: "page", limitName: "limit" }, e.request), e.response = t.extend({ statusName: "code", statusCode: 0, msgName: "msg", dataName: "data", countName: "count" }, e.response), "object" == typeof e.page && (e.limit = e.page.limit || e.limit, e.limits = e.page.limits || e.limits, this.page = e.page.curr = e.page.curr || 1, delete e.page.elem, delete e.page.jump), !e.elem[0]) return this; this.setArea(); var n = e.elem, o = n.next("." + y), r = this.elem = t(i(w).render({ VIEW_CLASS: y, data: e, index: this.index })); if (e.index = this.index, o[0] && o.remove(), n.after(r), this.renderTdCss(), this.layHeader = r.find(".layui-table-header"), this.layMain = r.find(".layui-table-main"), this.layBody = r.find(".layui-table-body"), this.layFixed = r.find(".layui-table-fixed"), this.layFixLeft = r.find(".layui-table-fixed-l"), this.layFixRight = r.find(".layui-table-fixed-r"), this.layTool = r.find(".layui-table-tool"), this.layPage = r.find(".layui-table-page"), this.layFilter = r.find(".layui-table-filter"), this.layTool.html(i(t(e.toolbar).html() || "").render(e)), e.height && this.fullSize(), e.cols.length > 1) { var s = this.layFixed.find(".layui-table-header").find("th"); s.height(this.layHeader.height() - 1 - parseFloat(s.css("padding-top")) - parseFloat(s.css("padding-bottom"))) } e.isFilter && this.layFilter.html(this.renderFilter()), this.pullData(this.page), this.events() }, Class.prototype.initOpts = function (e) { var t = this.config; e.checkbox && (e.type = "checkbox"), e.space && (e.type = "space"), e.type || (e.type = "normal"), "normal" !== e.type && (e.unresize = !0, e.width = e.width || { checkbox: 48, space: 15, numbers: 40 }[e.type]), t.isFilter && 0 != e.isFilter && (e.isFilter = !0) }, Class.prototype.setArea = function () { var e, t = this, i = t.config, n = 0, o = 0, r = 0, s = 0, c = i.width || (e = function (t) { var n, o; n = (t = t || i.elem.parent()).width(); try { o = "none" === t.css("display") } catch (e) { } return !t[0] || n && !o ? n : e(t.parent()) })(); t.eachCols((function () { n++ })), c -= "line" === i.skin || "nob" === i.skin ? 2 : n + 1, layui.each(i.cols, (function (e, i) { layui.each(i, (function (e, n) { var r; n ? (t.initOpts(n), r = n.width || 0, n.colspan > 1 || (/\d+%$/.test(r) ? n.width = r = Math.floor(parseFloat(r) / 100 * c) : !n._is_width_dev && r || (n._is_width_dev = !0, n.width = r = 0, o++), s += r)) : i.splice(e, 1) })) })), t.autoColNums = o, c > s && o && (r = (c - s) / o), layui.each(i.cols, (function (e, t) { layui.each(t, (function (e, t) { var n = t.minWidth || i.cellMinWidth; t.colspan > 1 || 0 === t.width && (t.width = Math.floor(r >= n ? r : n)) })) })); var d = t.getParentDivHeight(i.id); t.fullHeightGap = 0, i.height && /^full-\d+$/.test(i.height) && (t.fullHeightGap = i.height.split("-")[1]), i.height = d - t.fullHeightGap, layui.each(i.cols, (function (e, t) { layui.each(t, (function (e, t) { })) })) }, Class.prototype.getParentDivHeight = function (e) { return t("#" + e).parent().height() }, Class.prototype.reload = function (e) { this.config.data && this.config.data.constructor === Array && delete this.config.data, this.config = t.extend({}, this.config, e), this.render() }, Class.prototype.page = 1, Class.prototype.restNumbers = function () { this.config; var e = this.layBody.find("table tbody tr"), i = 0; e.each((function (e) { t(this).attr("data-index", i), t(this).find(".laytable-cell-numbers p").text(i + 1), t(this).data("index", i), i++ })) }, Class.prototype.resetData = function (e) { var t = this, i = t.config, n = i.treeId, o = i.treeUpId, r = [], s = [], c = [], u = {}; if (r.push(c), r.push(s), r.push(u), null == e || e.length <= 0) return r; for (var h = 0; h < e.length; h++) { var p = e[h]; i.isTree && (p.hasOwnProperty(d.config.cols.isOpen) || (p[d.config.cols.isOpen] = !0), p.hasOwnProperty(d.config.cols.isShow) || (p[d.config.cols.isShow] = !0)), p.hasOwnProperty(d.config.cols.cheDisabled) || (p[d.config.cols.cheDisabled] = !1), p[d.config.cols.cheDisabled] && i.cheDisabledNum++, p[d.config.cols.radDisabled] && i.radDisabledNum++ } if (e.forEach((function (e) { u[e[n]] = e })), i.isTree) { var y = [], m = {}; for (h = 0; h < e.length; h++) { var g = e[h]; u[g[o]] || (m[g[o]] = g[o]) } for (var b in m) y.push(m[b]); var fa = function (t) { for (var i = [], r = 0; r < e.length; r++) { var s = e[r]; s[o] === t && (s.children = fa(s[n]), i.push(s)) } return i }; y.forEach((function (e) { var t = fa(e); t && t.forEach((function (e) { s.push(e) })) })); var fa2 = function (e, t) { for (var i = 0; i < e.length; i++) { var n = e[i]; n[d.config.cols.level] = t, c.push(n), n.children && n.children.length > 0 && fa2(n.children, 1 + t) } }; fa2(s, 1) } else c = e; return d.setDataList(t.config.id, c), d.setDataTreeList(t.config.id, s), d.setDataMap(t.config.id, u), c.forEach((function (e) { var i = t.treeFindUpData(e); !i || i[d.config.cols.isOpen] && i[d.config.cols.isShow] ? e[d.config.cols.isShow] = !0 : e[d.config.cols.isShow] = !1 })), r }, Class.prototype.treeFindDataById = function (e) { var t = this.config, i = null, n = d.getDataList(this.key), o = t.treeId; return n.forEach((function (t) { t[o] != e || (i = t) })), i }, Class.prototype.treeFindUpData = function (e) { var t = this.config.treeUpId; return d.getDataMap(this.config.id)[e[t]] }, Class.prototype.treeFindUpDatas = function (e) { var t = this, i = (t.config, []), temf = function (e) { var n = t.treeFindUpData(e); n && (i.push(n), temf(n)) }; return temf(e), i }, Class.prototype.treeFindSonData = function (e) { var t = []; return function f(e) { e.children.length > 0 && e.children.forEach((function (e) { t.push(e), e.children.length > 0 && f(e) })) }(e), t }, Class.prototype.treeConvertShowName = function (e) { this.config; var t, i, n = e.children && e.children.length > 0; return '<div style="float: left;height: 28px;line-height: 28px;padding-left: ' + (n ? "5px" : "21px") + '">' + function () { for (var t = "<i>", i = 1; i < e[d.config.cols.level]; i++)t += " "; return t += "</i>" }() + (t = "", i = e[d.config.cols.isOpen] ? "" : "", n && (t = '<i class="layui-icon layui-tree-head" style="cursor: pointer;">' + i + "</i> "), t + "</div>") }, Class.prototype.treeNodeOpen = function (e, t) { var i = this, n = (i.config, i.layBody.find('tr[data-index="' + e[d.config.indexName] + '"]')); e[d.config.cols.isOpen] = t; var fa = function (t) { if (t.children && t.children.length > 0) for (var n = t.children, o = 0; o < n.length; o++) { var r = n[o]; if (e[d.config.cols.isOpen]) { if (t[d.config.cols.isOpen] && t[d.config.cols.isShow]) i.layBody.find('tr[data-index="' + r[d.config.indexName] + '"]').show(), r[d.config.cols.isShow] = !0 } else i.layBody.find('tr[data-index="' + r[d.config.indexName] + '"]').hide(), r[d.config.cols.isShow] = !1; fa(r) } }; fa(e); var o = n.find(".layui-tree-head"); e[d.config.cols.isOpen] ? o.html("") : o.html("") }, Class.prototype.pullData = function (e, i) { var n = this, r = n.config, s = r.request, c = r.response, sort = function () { "object" == typeof r.initSort && n.sort(r.initSort.field, r.initSort.type) }; if (n.startTime = (new Date).getTime(), r.url) { var u = {}; u[s.pageName] = e, u[s.limitName] = r.limit; var h = n.layFilter.find("[name^='filter_']"); layui.each(h, (function (e, i) { u[i.name] = t(i).val() })), t.ajax({ type: r.method || "get", url: r.url, data: t.extend(u, r.where), dataType: "json", success: function (t) { n.resetData(t[c.dataName]), t[c.dataName] = d.getDataList(r.id), t[c.statusName] != c.statusCode ? (n.renderForm(), n.layMain.html('<div class="' + p + '">' + (t[c.msgName] || "返回的数据状态异常") + "</div>")) : (n.renderData(t, e, t[c.countName]), sort(), r.time = (new Date).getTime() - n.startTime + " ms"), i && o.close(i), "function" == typeof r.done && r.done(t, e, t[c.countName]) }, error: function (e, t) { n.layMain.html('<div class="' + p + '">数据接口请求异常</div>'), n.renderForm(), i && o.close(i) } }) } else if (r.data && r.data.constructor === Array) { var y = {}, m = e * r.limit - r.limit; y[c.dataName] = r.data.concat().splice(m, r.limit), y[c.countName] = r.data.length, n.renderData(y, e, r.data.length), sort(), "function" == typeof r.done && r.done(y, e, y[c.countName]) } }, Class.prototype.eachCols = function (e) { var i = t.extend(!0, [], this.config.cols), n = [], o = 0; layui.each(i, (function (e, t) { layui.each(t, (function (t, r) { if (r.colspan > 1) { var s = 0; o++, r.CHILD_COLS = [], layui.each(i[e + 1], (function (e, t) { t.PARENT_COL || s == r.colspan || (t.PARENT_COL = o, r.CHILD_COLS.push(t), s += t.colspan > 1 ? t.colspan : 1) })) } r.PARENT_COL || n.push(r) })) })); var eachArrs = function (t) { layui.each(t || n, (function (t, i) { if (i.CHILD_COLS) return eachArrs(i.CHILD_COLS); e(t, i) })) }; eachArrs() }, Class.prototype.renderTreeConvertShowName = function (e) { var i = this.config, n = (i.elem.next("." + y), this.treeConvertShowName(e)), o = this.layBody.find('tr[data-index="' + e[d.config.indexName] + '"]').find("td[data-field=" + i.treeShowName + "]").find(".layui-table-cell"); t(o).find("div").remove(), t(o).prepend(n) }, Class.prototype.renderTdCss = function () { var e = this, t = e.config.elem.next("." + y), i = e.index + "_dltable_td_style"; t.find("#" + i).remove(); var n, o = '<style id="' + i + '">' + (n = "", layui.each(e.config.cols, (function (t, i) { layui.each(i, (function (t, i) { n += ".laytable-cell-" + e.index + "-" + (i.field || t) + "{width:" + (i.width ? i.width + "px" : "0px") + "}" })) })), n + "</style>"); t.append(o) }, Class.prototype.renderTrUpids = function (e) { var t = this.config, i = t.treeUpId, n = (e.upIds, ' u_id="' + e[i] + '" '); return t.isTree ? n : "" }, Class.prototype.renderTd = function (e) { var n, o, r = this.config, s = e.cols, c = e.obj, u = e.numbers, h = e.i3, p = null == c[s.field] ? "" : String(c[s.field]), y = s.field || h, m = p, g = (this.getColElem(this.layHeader, y), ""); return r.isTree && r.treeShowName == s.field && (g = this.treeConvertShowName(c)), ['<td data-field="' + y + '" ' + (o = [], s.edit && o.push('data-edit="' + s.edit + '"'), s.align && o.push('align="' + s.align + '"'), s.templet && o.push('data-content="' + m + '"'), s.toolbar && o.push('data-off="true"'), s.event && o.push('lay-event="' + s.event + '"'), s.style && o.push('style="' + s.style + '"'), s.minWidth && o.push('data-minwidth="' + s.minWidth + '"'), o.join(" ") + ">"), '<div class="layui-table-cell laytable-cell-' + (n = r.index + "-" + y, ("normal" === s.type ? n : n + " laytable-cell-" + s.type) + '">') + g + '<p style="width: auto;height: 100%;">' + function () { var e, n = t.extend(!0, { LAY_INDEX: u }, c); if ("checkbox" === s.type) return n[d.config.cols.cheDisabled] ? "" : '<input type="checkbox" name="layTableCheckbox" value="' + n[d.config.indexName] + '" lay-skin="primary" ' + (e = d.config.cols.isCheckName, (s[e] ? (c[e] = s[e], s[e] ? "checked" : "") : n[e] ? "checked" : "") + ">"); if ("numbers" === s.type) return u; if ("drop" === s.type) { var o = dl.ui.table.drop.findFieldObj(r.cols[0], y); if (o && o.drop) { dl.cache.code.get(o.drop); return dl.ui.table.drop.findDropLable(o.drop, m) } } else if ("radio" === s.type) return n[d.config.cols.radDisabled] ? "" : '<input type="radio" name="' + b + r.id + '" value="' + n[d.config.indexName] + '" checked="">'; return s.toolbar ? i(t(s.toolbar).html() || "").render(n) : s.templet ? "function" == typeof s.templet ? s.templet(n) : i(t(s.templet).html() || String(m)).render(n) : m }(), "</p></div></td>"].join("") }, Class.prototype.renderTr = function (e, t) { var i = this, n = (i.config, []); return i.eachCols((function (o, r) { var s = r.field || o, c = e[s]; i.getColElem(i.layHeader, s); if (null == c && (c = ""), !(r.colspan > 1)) { var d = i.renderTd({ obj: e, numbers: t, cols: r, i3: o }); n.push(d) } })), n }, Class.prototype.renderData = function (e, t, i, n) { var r = this, s = r.config, c = e[s.response.dataName] || [], u = [], h = [], y = [], render = function () { if (!n && r.sortKey) return r.sort(r.sortKey.field, r.sortKey.sort, !0); layui.each(c, (function (e, i) { r.treeFindUpData(i); var o = ""; i[d.config.cols.isShow] || (o = "display: none;"); var c = [], p = e + s.limit * (t - 1) + 1; 0 !== i.length && (n || (i[d.config.indexName] = e), c = r.renderTr(i, p), u.push('<tr style="' + o + '" data-index="' + e + '" ' + r.renderTrUpids(i) + ">" + c.join("") + "</tr>"), h.push('<tr data-index="' + e + '">' + [].join("") + "</tr>"), y.push('<tr data-index="' + e + '">' + [].join("") + "</tr>")) })), r.layBody.scrollTop(0), r.layMain.find("." + p).remove(), r.layMain.find("tbody").html(u.join("")), r.layFixLeft.find("tbody").html(h.join("")), r.layFixRight.find("tbody").html(y.join("")), r.renderForm(), r.syncCheckAll(), r.haveInit ? r.scrollPatch() : setTimeout((function () { r.scrollPatch() }), 50), r.haveInit = !0, o.close(r.tipsIndex) }; if (r.key = s.id || s.index, d.setDataList(r.key, c), r.layPage[0 === c.length && 1 == t ? "addClass" : "removeClass"]("layui-hide"), n) return render(); if (0 === c.length) { r.renderForm(), r.layFixed.remove(), r.layMain.find("tbody").html(""), r.layMain.find("." + p).remove(); var m = 0, g = 0, b = 0, k = 0; return r.layMain.height() > 150 ? (m = "40px", g = "80px", b = "22px", k = "10px") : (m = "10px", g = "40px", b = "14px", k = "5px"), r.layMain.append('<div class="' + p + '" style="padding-bottom: 0;"> <div class="empty-data" style="text-align:center;padding-top: ' + m + ';font-size: 25px;color: #ccc;font-family: tahoma ,微软雅黑;"> <i class="layui-icon layui-icon-search" style="font-size: ' + g + ';"></i> <div style="padding-top: ' + k + ";font-size: " + b + ';">' + s.text.none + "</div> </div></div>") } render(), r.renderPage(i), d.pushClassIds(s.id, !0), r.syncCheckAll(), layui.each(s.cols, (function (e, t) { layui.each(t, (function (e, t) { })) })) }, Class.prototype.renderPage = function (e) { var i = this, o = i.config; o.page && (o.page = t.extend({ elem: "layui-table-page" + o.index, count: e, limit: o.limit, limits: o.limits || [10, 15, 20, 30, 40, 50, 60, 70, 80, 90], groups: 3, layout: ["prev", "page", "next", "skip", "count", "limit"], prev: '<i class="layui-icon"></i>', next: '<i class="layui-icon"></i>', jump: function (e, t) { t || (i.page = e.curr, o.limit = e.limit, i.pullData(e.curr, i.loading())) } }, o.page), o.page.count = e, n.render(o.page)) }, Class.prototype.renderFilter = function () { var e = this.config, t = this.index, i = []; return i.push('<form method="post" id="' + e.id + '_filter_form">'), i.push('<table cellspacing="0" cellpadding="0" border="0" class="layui-table"><thead><tr>'), layui.each(e.cols, (function (e, n) { layui.each(n, (function (e, n) { var o, r = n.field || e, s = n.minWidth ? "data-minwidth='" + n.minWidth + "'" : "", c = n.colspan ? 'colspan="' + n.colspan + '"' : "", d = n.rowspan ? 'rowspan="' + n.rowspan + '"' : "", u = n.unresize ? 'data-unresize="true"' : ""; i.push('<th data-field="' + r + '"' + s + c + d + u + ">"), i.push('<div class="layui-table-cell laytable-cell-' + (o = "", n.colspan > 1 ? o = "group" : (o = t + "-" + r, "normal" !== n.type && (o += " laytable-cell-" + n.type)), o + '">')), n.isFilter && n.field ? i.push('<input class="layui-input ' + g + '" id="filter_' + n.field + '" name="filter_' + n.field + '">') : i.push(""), i.push("</div></th>") })) })), i.push("</tr></thead></table>"), i.push("</form>"), i.join("") }, Class.prototype.getColElem = function (e, t) { var i = this.config; return e.eq(0).find(".laytable-cell-" + i.index + "-" + t + ":eq(0)") }, Class.prototype.renderForm = function (e) { r.render(e, "LAY-table-" + this.index) }, Class.prototype.sort = function (e, i, n, o) { var r, c = {}, h = this.config, p = h.elem.attr("lay-filter"), y = d.getDataList(this.key); "string" == typeof e && this.layHeader.find("th").each((function (i, n) { var o = t(this), r = o.data("field"); if (r === e) return e = o, g = r, !1 })); try { var g = g || e.data("field"); if (this.sortKey && !n && g === this.sortKey.field && i === this.sortKey.sort) return; var b = this.layHeader.find("th .laytable-cell-" + h.index + "-" + g).find(m); this.layHeader.find("th").find(m).removeAttr("lay-sort"), b.attr("lay-sort", i || null), this.layFixed.find("th") } catch (e) { return s.error("Table modules: Did not match to field") } this.sortKey = { field: g, sort: i }, "asc" === i ? r = layui.sort(y, g) : "desc" === i ? r = layui.sort(y, g, !0) : (r = layui.sort(y, d.config.indexName), delete this.sortKey), c[h.response.dataName] = r, this.renderData(c, this.page, this.count, !0), o && layui.event.call(e, u, "sort(" + p + ")", { field: g, type: i }) }, Class.prototype.loading = function () { var e = this.config; if (e.loading && e.url) return o.msg("数据请求中", { icon: 16, offset: [this.elem.offset().top + this.elem.height() / 2 - 35 - C.scrollTop() + "px", this.elem.offset().left + this.elem.width() / 2 - 90 - C.scrollLeft() + "px"], time: -1, anim: -1, fixed: !1 }) }, Class.prototype.setCheckData = function (e, t) { this.config; var i = d.getDataList(this.key); i[e] && i[e].constructor !== Array && (i[e][d.config.cols.isCheckName] = t) }, Class.prototype.syncCheckAll = function () { var e = this, t = e.config, i = d.getDataList(e.config.id); if (i) { var n = !0, o = 0; if (i.forEach((function (t) { t[d.config.cols.cheDisabled] || (t[d.config.cols.isCheckName] ? (e.layBody.find("tr[data-index=" + t[d.config.indexName] + "]").find('input[name="layTableCheckbox"]').prop("checked", !0), o++) : (n = !1, e.layBody.find("tr[data-index=" + t[d.config.indexName] + "]").find('input[name="layTableCheckbox"]').prop("checked", !1))) })), n) e.layHeader.find('input[name="layTableCheckbox"]').prop("checked", !0); if (o < i.length - t.cheDisabledNum) e.layHeader.find('input[name="layTableCheckbox"]').prop("checked", !1); e.renderForm("checkbox") } }, Class.prototype.getCssRule = function (e, t) { var i = this, n = i.elem.find("style")[0], o = n.sheet || n.styleSheet || {}, r = o.cssRules || o.rules; layui.each(r, (function (n, o) { if (o.selectorText === ".laytable-cell-" + i.index + "-" + e) return t(o), !0 })) }, Class.prototype.resize = function () { this.setArea(), this.fullSize(), this.resizeWidth(), this.scrollPatch() }, Class.prototype.resizeWidth = function () { this.renderTdCss() }, Class.prototype.fullSize = function () { var e, t = this.config, i = t.height; i < 135 && (i = 135), this.elem.css("height", i); var n = t.isFilter ? 76 : 38; e = parseFloat(i) - n - 1, t.toolbar && (e -= this.layTool.outerHeight()), t.page && (e = e - this.layPage.outerHeight() - 1), this.layMain.css("height", e) }, Class.prototype.getScrollWidth = function (e) { var t = 0; return e ? t = e.offsetWidth - e.clientWidth : ((e = document.createElement("div")).style.width = "100px", e.style.height = "100px", e.style.overflowY = "scroll", document.body.appendChild(e), t = e.offsetWidth - e.clientWidth, document.body.removeChild(e)), t }, Class.prototype.scrollPatch = function () { var e = this, i = e.layMain.children("table"), n = e.layMain.width() - e.layMain.prop("clientWidth"), o = e.layMain.height() - e.layMain.prop("clientHeight"), r = e.getScrollWidth(e.layMain[0]), s = i.outerWidth() - e.layMain.width(); if (e.autoColNums && s < 5 && !e.scrollPatchWStatus) { var c = e.layHeader.eq(0).find("thead th:last-child"), d = c.data("field"); e.getCssRule(d, (function (t) { var i = t.style.width || c.outerWidth(); t.style.width = parseFloat(i) - r - s + "px", e.layMain.height() - e.layMain.prop("clientHeight") > 0 && (t.style.width = parseFloat(t.style.width) - 1 + "px"), e.scrollPatchWStatus = !0 })) } if (n && o) { if (e.elem.find(".layui-table-patch").length <= 0) { var u = t('<th class="layui-table-patch"><div class="layui-table-cell"></div></th>'); u.find("div").css({ width: n }), e.layHeader.eq(0).find("thead tr").append(u) } } else e.layFilter.eq(0).find(".layui-table-patch").remove(), e.layHeader.eq(0).find(".layui-table-patch").remove(); var h = e.layMain.height() - o; e.layFixed.find(".layui-table-body").css("height", i.height() > h ? h : "auto"), e.layFixRight[s > 0 ? "removeClass" : "addClass"]("layui-hide"), e.layFixRight.css("right", n - 1) }, Class.prototype.events = function () { var e, n = this, r = n.config, s = t("body"), h = {}, p = n.layHeader.find("th"), y = ".layui-table-cell", b = r.elem.attr("lay-filter"); n.layFilter.find("[name^='filter_']").on("keyup", (function () { n.page = 1, n.pullData(n.page, n.loading()) })), p.on("mousemove", (function (e) { var i = t(this), n = i.offset().left, o = e.clientX - n; i.attr("colspan") > 1 || i.data("unresize") || h.resizeStart || (h.allowResize = i.width() - o <= 10, s.css("cursor", h.allowResize ? "col-resize" : "")) })).on("mouseleave", (function () { t(this); h.resizeStart || s.css("cursor", "") })).on("mousedown", (function (e) { var i = t(this); if (h.allowResize) { var o = i.data("field"); e.preventDefault(), h.resizeStart = !0, h.offset = [e.clientX, e.clientY], n.getCssRule(o, (function (e) { var t = e.style.width || i.outerWidth(); h.rule = e, h.ruleWidth = parseFloat(t), h.minWidth = i.data("minwidth") || r.cellMinWidth })) } })), D.on("mousemove", (function (t) { if (h.resizeStart) { if (t.preventDefault(), h.rule) { var i = h.ruleWidth + t.clientX - h.offset[0]; i < h.minWidth && (i = h.minWidth), h.rule.style.width = i + "px", o.close(n.tipsIndex) } e = 1 } })).on("mouseup", (function (t) { h.resizeStart && (h = {}, s.css("cursor", ""), n.scrollPatch()), 2 === e && (e = null) })), p.on("click", (function () { var i, o = t(this), r = o.find(m), s = r.attr("lay-sort"); if (!r[0] || 1 === e) return e = 2; i = "asc" === s ? "desc" : "desc" === s ? null : "asc", n.sort(o, i, null, !0) })).find(m + " .layui-edge ").on("click", (function (e) { var i = t(this), o = i.index(), r = i.parents("th").eq(0).data("field"); layui.stope(e), 0 === o ? n.sort(r, "asc", null, !0) : n.sort(r, "desc", null, !0) })), n.elem.on("click", "i.layui-tree-head", (function () { var e = t(this).parents("tr").eq(0).data("index"), i = (n.layBody.find('tr[data-index="' + e + '"]'), n.config.treeId, d.getDataList(n.key)[e]); n.treeNodeOpen(i, !i[d.config.cols.isOpen]) })), n.elem.on("click", 'input[name="layTableCheckbox"]+', (function () { var e = t(this).prev(), i = (n.layBody.find('input[name="layTableCheckbox"]'), e.parents("tr").eq(0).data("index")), o = e[0].checked, s = d.getDataList(n.config.id)[i], c = "layTableAllChoose" === e.attr("lay-filter"); if (c) { d.getDataList(n.key).forEach((function (e) { e[d.config.cols.cheDisabled] || n.setCheckData(e[d.config.indexName], o) })), n.syncCheckAll() } else { if (n.setCheckData(i, o), r.isTree) { n.treeFindSonData(s).forEach((function (e) { e[d.config.cols.cheDisabled] || n.setCheckData(e[d.config.indexName], o) })); var h = n.treeFindUpData(s); if (h && h.children.length > 0) { var p = !0; h.children.forEach((function (e) { e[d.config.cols.isCheckName] || (p = !1) })), p && n.setCheckData(h[d.config.indexName], o) } } n.syncCheckAll() } layui.event.call(this, u, "checkbox(" + b + ")", { checked: o, data: d.getDataList(n.key) && d.getDataList(n.key)[i] || {}, type: c ? "all" : "one" }) })), n.layBody.on("mouseenter", "tr", (function () { var e = t(this).index(); n.layBody.find("tr:eq(" + e + ")").addClass("layui-table-hover") })), n.layBody.on("mouseleave", "tr", (function () { var e = t(this).index(); n.layBody.find("tr:eq(" + e + ")").removeClass("layui-table-hover") })), n.layBody.on("change", "." + g, (function () { var e = t(this), i = this.value, o = e.parent().data("field"), r = e.parents("tr").eq(0).data("index"), s = d.getDataList(n.key)[r]; s[o] = i, layui.event.call(this, u, "edit(" + b + ")", { value: i, data: s, field: o }) })), n.layBody.on("blur", "." + g, (function () { var e, o = t(this), r = o.parent().data("field"), s = o.parents("tr").eq(0).data("index"), c = o.parent().data("edit"), u = d.getDataList(n.key)[s], h = n.config; n.eachCols((function (t, i) { i.field == r && i.templet && (e = i.templet) })); var p = ""; if ("select" === c) { var m = dl.ui.table.drop.findFieldObj(h.cols[0], r); if (m && m.drop) { dl.cache.code.get(m.drop); p = dl.ui.table.drop.findDropLable(m.drop, this.value) } o.parent().find(y + " p").html(e ? i(t(e).html() || p).render(u) : p) } else o.parent().find(y + " p").html(e ? i(t(e).html() || this.value).render(u) : this.value); o.parent().data("content", this.value), o.remove() })), n.layBody.on("click", "td div.layui-table-cell p", (function () { var e = t(this).parent().parent(), i = e.data("field"), r = e.data("edit"), s = e.parents("tr").eq(0).data("index"), u = d.getDataList(n.key)[s], h = e.children(y), p = n.config; if (o.close(n.tipsIndex), !e.data("off")) if (r) if ("select" === r) { e.data("drop"); var m = dl.ui.table.drop.findFieldObj(p.cols[0], i), b = "", k = dl.cache.code.get(m.drop).syscodevaluecache; for (var w in k) { var C = ""; k[w].scv_value == u[i] && (C = "selected='selected'"), b += "<option " + C + ' value="' + k[w].scv_value + '">' + k[w].scv_show_name + "</option>" } var D = t('<select class="' + g + '" lay-ignore>' + b + "</select>"); e.find("." + g)[0] || e.append(D) } else { var E = t('<input class="layui-input ' + g + '">'); E[0].value = t.trim(t(this).text()), e.find("." + g)[0] || e.append(E), E.focus() } else h.find(".layui-form-switch,.layui-form-checkbox")[0] || Math.round(h.prop("scrollWidth")) > Math.round(h.outerWidth()) && (n.tipsIndex = o.tips(['<div class="layui-table-tips-main" style="margin-top: -' + (h.height() + 16) + "px;" + ("sm" === p.size ? "padding: 4px 15px; font-size: 12px;" : "lg" === p.size ? "padding: 14px 15px;" : "") + '">', h.html(), "</div>", '<i class="layui-icon layui-table-tips-c">ဆ</i>'].join(""), h[0], { tips: [3, ""], time: -1, anim: -1, maxWidth: c.ios || c.android ? 300 : 600, isOutAnim: !1, skin: "layui-table-tips", success: function (e, t) { e.find(".layui-table-tips-c").on("click", (function () { o.close(t) })) } })) })), n.layBody.on("click", "*[lay-event]", (function () { var e = t(this), o = e.parents("tr").eq(0).data("index"), s = n.layBody.find('tr[data-index="' + o + '"]'), c = (d.getDataList(n.key), d.getDataList(n.key)[o]); layui.event.call(this, u, "tool(" + b + ")", { data: c, event: e.attr("lay-event"), tr: s, del: function () { d.delRow(r.id, c) }, update: function (e) { e = e || {}, layui.each(e, (function (e, o) { if (e in c) { var r, d = s.children('td[data-field="' + e + '"]'); c[e] = o, n.eachCols((function (t, i) { i.field == e && i.templet && (r = i.templet) })), d.children(y).html(r ? i(t(r).html() || o).render(c) : o), d.data("content", o) } })) } }), s.addClass("layui-table-click").siblings("tr").removeClass("layui-table-click") })), n.layMain.on("scroll", (function () { var e = t(this), i = e.scrollLeft(), r = e.scrollTop(); n.layHeader.scrollLeft(i), n.layFixed.find(".layui-table-body").scrollTop(r), o.close(n.tipsIndex) })), C.on("resize", (function () { n.resize() })) }, thisTable.config = {}, d.init(), e(u, d) })) }, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.dropdown 下拉按钮
|
||
@Author:First
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("jquery", (function (e) { var t, i = layui.$, n = layui.device(), o = n.android || n.ios ? "click" : "mouseover"; Dropdown = function () { this.inst = null, this.currReElem = null }; var __hideDropdown = function (e) { isClosable(e.target) && isClosable(e.target.parentElement) && isClosable(e.target.parentElement.parentElement) && t.hide() }, isClosable = function (e) { return e && -1 == e.className.indexOf("layui-btn-dropdown") && -1 == e.className.indexOf("layui-dropdown-menu") }; Dropdown.prototype.hide = function () { t && t.inst && t.inst.is(":visible") && (t.inst.css("display", "none"), i("body").off(o, __hideDropdown)) }, Dropdown.prototype.render = function () { t = this, i(".layui-btn-dropdown").each((function (e, r) { var s = i(r); s.data("id", "dropdown-" + e), o = n.android || n.ios ? "click" : "mouseover", s[o]((function () { if (!t.inst || t.currReElem.data("id") != s.data("id") || t.currReElem.data("id") == s.data("id") && !t.inst.is(":visible")) { t.hide(); var e = s.find(".layui-dropdown-menu"), n = s.offset().left - i(window).scrollLeft(), r = s.offset().top + s.height() - i(window).scrollTop() - 2, c = s.width(), d = e.width(), u = n + c, h = { display: "block", position: "fixed", top: r + "px", left: n + "px" }; n + d > i(window).width() && i.extend(!0, h, { left: u - d + "px" }), e.css(h).on("click", "li", (function () { e.css("display", "none") })), t.inst = e, t.currReElem = s, i("body").on(o, __hideDropdown) } })) })) }; var r = new Dropdown; r.render(), i(window).scroll((function () { r.hide() })), e("dropdown", r) }))
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.element 常用元素操作
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("jquery", (function (e) { "use strict"; var t = layui.$, i = (layui.hint(), layui.device()), n = "layui-this", o = "layui-show", Element = function () { this.config = {} }; Element.prototype.set = function (e) { return t.extend(!0, this.config, e), this }, Element.prototype.on = function (e, t) { return layui.onevent.call(this, "element", e, t) }, Element.prototype.tabAdd = function (e, i) { var n = t(".layui-tab[lay-filter=" + e + "]"), o = n.children(".layui-tab-title"), r = o.children(".layui-tab-bar"), s = n.children(".layui-tab-content"), c = '<li lay-id="' + (i.id || "") + '"' + (i.attr ? ' lay-attr="' + i.attr + '"' : "") + ">" + (i.title || "unnaming") + "</li>"; return r[0] ? r.before(c) : o.append(c), s.append('<div class="layui-tab-item">' + (i.content || "") + "</div>"), u.hideTabMore(!0), u.tabAuto(), this }, Element.prototype.tabDelete = function (e, i) { var n = t(".layui-tab[lay-filter=" + e + "]").children(".layui-tab-title").find('>li[lay-id="' + i + '"]'); return u.tabDelete(null, n), this }, Element.prototype.tabChange = function (e, i) { var n = t(".layui-tab[lay-filter=" + e + "]").children(".layui-tab-title").find('>li[lay-id="' + i + '"]'); return u.tabClick.call(n[0], null, null, n), this }, Element.prototype.tab = function (e) { e = e || {}, p.on("click", e.headerElem, (function (i) { var n = t(this).index(); u.tabClick.call(this, i, n, null, e) })) }, Element.prototype.progress = function (e, i) { var n = "layui-progress", o = t("." + n + "[lay-filter=" + e + "]").find("." + n + "-bar"), r = o.find("." + n + "-text"); return o.css("width", i), r.text(i), this }; var r = "layui-nav-tree", s = "layui-nav-child", c = "layui-nav-more", d = "layui-anim layui-anim-upbit", u = { tabClick: function (e, i, r, s) { s = s || {}; var c = r || t(this), d = (i = i || c.parent().children("li").index(c), s.headerElem ? c.parent() : c.parents(".layui-tab").eq(0)), u = s.bodyElem ? t(s.bodyElem) : d.children(".layui-tab-content").children(".layui-tab-item"), h = c.find("a"), p = d.attr("lay-filter"); "javascript:;" !== h.attr("href") && "_blank" === h.attr("target") || (c.addClass(n).siblings().removeClass(n), u.eq(i).addClass(o).siblings().removeClass(o)), layui.event.call(this, "element", "tab(" + p + ")", { elem: d, index: i }) }, tabDelete: function (e, i) { var o = i || t(this).parent(), r = o.index(), s = o.parents(".layui-tab").eq(0), c = s.children(".layui-tab-content").children(".layui-tab-item"), d = s.attr("lay-filter"); o.hasClass(n) && (o.next()[0] ? u.tabClick.call(o.next()[0], null, r + 1) : o.prev()[0] && u.tabClick.call(o.prev()[0], null, r - 1)), o.remove(), c.eq(r).remove(), setTimeout((function () { u.tabAuto() }), 50), layui.event.call(this, "element", "tabDelete(" + d + ")", { elem: s, index: r }) }, tabAuto: function () { var e = "layui-tab-bar", n = this; t(".layui-tab").each((function () { var o = t(this), r = o.children(".layui-tab-title"), s = (o.children(".layui-tab-content").children(".layui-tab-item"), 'lay-stope="tabmore"'), c = t('<span class="layui-unselect layui-tab-bar" ' + s + "><i " + s + ' class="layui-icon"></i></span>'); if (n === window && 8 != i.ie && u.hideTabMore(!0), o.attr("lay-allowClose") && r.find("li").each((function () { var e = t(this); if (!e.find(".layui-tab-close")[0]) { var i = t('<i class="layui-icon layui-unselect layui-tab-close">ဆ</i>'); i.on("click", u.tabDelete), e.append(i) } })), "string" != typeof o.attr("lay-unauto")) if (r.prop("scrollWidth") > r.outerWidth() + 1) { if (r.find("." + e)[0]) return; r.append(c), o.attr("overflow", ""), c.on("click", (function (e) { r[this.title ? "removeClass" : "addClass"]("layui-tab-more"), this.title = this.title ? "" : "收缩" })) } else r.find("." + e).remove(), o.removeAttr("overflow") })) }, hideTabMore: function (e) { var i = t(".layui-tab-title"); !0 !== e && "tabmore" === t(e.target).attr("lay-stope") || (i.removeClass("layui-tab-more"), i.find(".layui-tab-bar").attr("title", "")) }, clickThis: function () { var e = t(this), i = e.parents(".layui-nav"), o = i.attr("lay-filter"), c = e.parent(), u = e.siblings("." + s), h = "string" == typeof c.attr("lay-unselect"); "javascript:;" !== e.attr("href") && "_blank" === e.attr("target") || h || u[0] || (i.find("." + n).removeClass(n), c.addClass(n)), i.hasClass(r) && (u.removeClass(d), u[0] && (c["none" === u.css("display") ? "addClass" : "removeClass"]("layui-nav-itemed"), "all" === i.attr("lay-shrink") && c.siblings().removeClass("layui-nav-itemed"))), layui.event.call(this, "element", "nav(" + o + ")", e) }, collapse: function () { var e = t(this), i = e.find(".layui-colla-icon"), n = e.siblings(".layui-colla-content"), r = e.parents(".layui-collapse").eq(0), s = r.attr("lay-filter"), c = "none" === n.css("display"); if ("string" == typeof r.attr("lay-accordion")) { var d = r.children(".layui-colla-item").children("." + o); d.siblings(".layui-colla-title").children(".layui-colla-icon").html(""), d.removeClass(o) } n[c ? "addClass" : "removeClass"](o), i.html(c ? "" : ""), layui.event.call(this, "element", "collapse(" + s + ")", { title: e, content: n, show: c }) } }; Element.prototype.init = function (e, n) { var h = n ? '[lay-filter="' + n + '"]' : "", p = { tab: function () { u.tabAuto.call({}) }, nav: function () { var e = {}, n = {}, p = {}, follow = function (u, h, y) { var m = t(this), g = m.find("." + s); h.hasClass(r) ? u.css({ top: m.position().top, height: m.children("a").outerHeight(), opacity: 1 }) : (g.addClass(d), u.css({ left: m.position().left + parseFloat(m.css("marginLeft")), top: m.position().top + m.height() - u.height() }), e[y] = setTimeout((function () { u.css({ width: m.width(), opacity: 1 }) }), i.ie && i.ie < 10 ? 0 : 200), clearTimeout(p[y]), "block" === g.css("display") && clearTimeout(n[y]), n[y] = setTimeout((function () { g.addClass(o), m.find("." + c).addClass(c + "d") }), 300)) }; t(".layui-nav" + h).each((function (i) { var d = t(this), h = t('<span class="layui-nav-bar"></span>'), y = d.find(".layui-nav-item"); d.find(".layui-nav-bar")[0] || (d.append(h), y.on("mouseenter", (function () { follow.call(this, h, d, i) })).on("mouseleave", (function () { d.hasClass(r) || (clearTimeout(n[i]), n[i] = setTimeout((function () { d.find("." + s).removeClass(o), d.find("." + c).removeClass(c + "d") }), 300)) })), d.on("mouseleave", (function () { clearTimeout(e[i]), p[i] = setTimeout((function () { d.hasClass(r) ? h.css({ height: 0, top: h.position().top + h.height() / 2, opacity: 0 }) : h.css({ width: 0, left: h.position().left + h.width() / 2, opacity: 0 }) }), 200) }))), y.find("a").each((function () { var e = t(this); e.parent(); e.siblings("." + s)[0] && !e.children("." + c)[0] && e.append('<span class="' + c + '"></span>'), e.off("click", u.clickThis).on("click", u.clickThis) })) })) }, breadcrumb: function () { t(".layui-breadcrumb" + h).each((function () { var e = t(this), i = e.attr("lay-separator") || "/", n = e.find("a"); n.next("span[lay-separator]")[0] || (n.each((function (e) { e !== n.length - 1 && t(this).after("<span lay-separator>" + i + "</span>") })), e.css("visibility", "visible")) })) }, progress: function () { var e = "layui-progress"; t("." + e + h).each((function () { var i = t(this), n = i.find(".layui-progress-bar"), o = n.attr("lay-percent"); n.css("width", /^.+\/.+$/.test(o) ? 100 * new Function("return " + o)() + "%" : o), i.attr("lay-showPercent") && setTimeout((function () { n.html('<span class="' + e + '-text">' + o + "</span>") }), 350) })) }, collapse: function () { t(".layui-collapse" + h).each((function () { t(this).find(".layui-colla-item").each((function () { var e = t(this), i = e.find(".layui-colla-title"), n = "none" === e.find(".layui-colla-content").css("display"); i.find(".layui-colla-icon").remove(), i.append('<i class="layui-icon layui-colla-icon">' + (n ? "" : "") + "</i>"), i.off("click", u.collapse).on("click", u.collapse) })) })) } }; return p[e] ? p[e]() : layui.each(p, (function (e, t) { t() })) }, Element.prototype.render = Element.prototype.init; var h = new Element, p = t(document); h.render(); p.on("click", ".layui-tab-title li", u.tabClick), p.on("click", u.hideTabMore), t(window).on("resize", u.tabAuto), e("element", h) }))
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.flow 流加载
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("jquery", (function (e) { "use strict"; var t = layui.$, Flow = function (e) { }; Flow.prototype.load = function (e) { var i, n, o, r = 0, s = t((e = e || {}).elem); if (s[0]) { var c = t(e.scrollElem || document), d = e.mb || 50, u = !("isAuto" in e) || e.isAuto, h = e.end || "没有更多了", p = e.scrollElem && e.scrollElem !== document, y = t('<div class="layui-flow-more"><a href="javascript:;"><cite>加载更多</cite></a></div>'); s.find(".layui-flow-more")[0] || s.append(y); var next = function (e, o) { e = t(e), y.before(e), (o = 0 == o || null) ? y.html(h) : y.find("a").html("<cite>加载更多</cite>"), n = o, i = null, m && m() }, done = function () { i = !0, y.find("a").html('<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon "></i>'), "function" == typeof e.done && e.done(++r, next) }; if (done(), y.find("a").on("click", (function () { t(this); n || i || done() })), e.isLazyimg) var m = this.lazyimg({ elem: e.elem + " img", scrollElem: e.scrollElem }); return u ? (c.on("scroll", (function () { var e = t(this), r = e.scrollTop(); o && clearTimeout(o), n || (o = setTimeout((function () { var n = p ? e.height() : t(window).height(); (p ? e.prop("scrollHeight") : document.documentElement.scrollHeight) - r - n <= d && (i || done()) }), 100)) })), this) : this } }, Flow.prototype.lazyimg = function (e) { var i, n, o = this, r = 0, s = t((e = e || {}).scrollElem || document), c = e.elem || "img", d = e.scrollElem && e.scrollElem !== document, show = function (e, t) { var i = s.scrollTop(), n = i + t, c = d ? e.offset().top - s.offset().top + i : e.offset().top; if (c >= i && c <= n && !e.attr("src")) { var u = e.attr("lay-src"); layui.img(u, (function () { var t = o.lazyimg.elem.eq(r); e.attr("src", u).removeAttr("lay-src"), t[0] && render(t), r++ })) } }, render = function (e, i) { var n = d ? (i || s).height() : t(window).height(), u = s.scrollTop(), h = u + n; if (o.lazyimg.elem = t(c), e) show(e, n); else for (var p = 0; p < o.lazyimg.elem.length; p++) { var y = o.lazyimg.elem.eq(p), m = d ? y.offset().top - s.offset().top + u : y.offset().top; if (show(y, n), r = p, m > h) break } }; (render(), i) || (s.on("scroll", (function () { var e = t(this); n && clearTimeout(n), n = setTimeout((function () { render(null, e) }), 50) })), i = !0); return render }, e("flow", new Flow) }))
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.form 表单组件
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("layer", (function (e) { "use strict"; var t = layui.$, i = layui.layer, n = layui.hint(), o = layui.device(), r = ".layui-form", s = "layui-this", c = "layui-hide", d = "layui-disabled", Form = function () { this.config = { verify: { required: [/[\S]+/, "必填项不能为空!"], phone: function (e) { var t = /^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/; if (e) if (-1 != e.indexOf("-")) { var i = e.split("-").length - 1; if (!t.test(e) && 1 == i) return "请输入正确的固定电话!"; if ("400" == e.substring(0, 3) && !/^400[0-9]{7}/.test(e) && 2 == i) return "请输入正确的400固话(400-6050-322或4000-809-009)!" } else { if ("800" == e.substring(0, 3) && !/^800[0-9]{7}/.test(e)) return "请输入正确的800固话(8007878789)!"; if (11 == e.length && !/^1\d{10}$/.test(e)) return "请输入正确的手机号!"; if (11 != e.length && !t.test(e) && "800" != e.substring(0, 3) && "400" != e.substring(0, 3)) return "请输入有效手机号或固定电话!" } }, email: function (e) { if (e && !/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)) return "邮箱格式不正确!" }, hrefurl: function (e) { if (e && !/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/.test(e)) return "链接格式不正确!" }, number: function (e) { if (isNaN(e)) return "只能填写数字" }, numberInt: function (e) { if (e && !/^\d+$/.test(e)) return "只能填写正整数" }, date: function (e) { if (e && !/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/.test(e)) return "日期格式不正确!" }, identity: function (e) { if (e && !/(^\d{15}$)|(^\d{17}(x|X|\d)$)/.test(e)) return "请输入正确的身份证号!" }, postalCode: function (e) { if (e && !/^[0-9]{6}$/.test(e)) return "请输入正确的邮政编码!" }, url: function (e) { if (e && !/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/.test(e)) return "请输入正确的链接地址!" }, name: function (e) { if (e && !/^[\u4E00-\u9FA5·sA-Za-z]{2,32}$/.test(e)) return "请输入正确的中英文名字,并且字符长度大于2小于等于32个字符!" }, specialCharacters: function (e) { if (e && (/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im.test(e) || /[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im.test(e))) return "不能输入特殊字符!" } } } }; Array.prototype.indexOf || (Array.prototype.indexOf = function (e) { var t = this.length >>> 0, i = Number(arguments[1]) || 0; for ((i = i < 0 ? Math.ceil(i) : Math.floor(i)) < 0 && (i += t); i < t; i++)if (i in this && this[i] === e) return i; return -1 }), Form.prototype.set = function (e) { return t.extend(!0, this.config, e), this }, Form.prototype.verify = function (e) { return t.extend(!0, this.config.verify, e), this }, Form.prototype.on = function (e, t) { return layui.onevent.call(this, "form", e, t) }, Form.prototype.val = function (e, i) { return t(r + '[lay-filter="' + e + '"]').each((function (e, n) { var o = t(this); layui.each(i, (function (e, t) { var i, n = o.find('[name="' + e + '"]'); n[0] && ("checkbox" === (i = n[0].type) ? n[0].checked = t : "radio" === i ? n.each((function () { this.value === t && (this.checked = !0) })) : n.val(t)) })) })), u.render(null, e), this.getValue(e) }, Form.prototype.getValue = function (e, i) { i = i || t(r + '[lay-filter="' + e + '"]').eq(0); var n = {}, o = {}, s = i.find("input,select,textarea"); return layui.each(s, (function (e, i) { if (i.name = (i.name || "").replace(/^\s*|\s*&/, ""), i.name) { if (/^.*\[\]$/.test(i.name)) { var r = i.name.match(/^(.*)\[\]$/g)[0]; n[r] = 0 | n[r], i.name = i.name.replace(/^(.*)\[\]$/, "$1[" + n[r]++ + "]") } if (/^checkbox|radio$/.test(i.type)) { var s = t(i).attr("valueformat"); if (s) i.checked ? o[i.name] = s.split("|")[0] : o[i.name] = s.split("|")[1]; else if (!i.checked && t(i).attr("lay-skin")) o[i.name] = "1"; else { if (!i.checked) return; o[i.name] = i.value } } else o[i.name] = i.value } })), o }, Form.prototype.render = function (e, i) { var o = t(r + (i ? '[lay-filter="' + i + '"]' : "")), u = { extrCompoment: function () { o.find("[zlcomponent]").each((function (e, i) { var n = t(this).attr("name"), o = { elem: i, value: void 0 }, r = t(i.tagName + '[name="' + n + '"]'); r.length > 0 && r.each((function (e, t) { null != t.attributes.loaded && "1" == t.attributes.loaded.nodeValue || layui.event("WM_USERDEF", "WM_DRAW", o) })) })) }, addAsterisk: function () { o.find("[lay-verify]").each((function () { var e = t(this).attr("lay-verify").split("|"), i = t(this).parents(".layui-input-block"); -1 === i.prev().text().indexOf("*") && e.indexOf("required") > -1 && i.prev().prepend('<span style="color:red">*</span>') })) }, select: function () { var e, i = "layui-form-select", n = "layui-select-title", r = "layui-select-none", u = "", h = o.find("select"), hide = function (o, r) { t(o.target).parent().hasClass(n) && !r || (t("." + i).removeClass(i + "ed " + i + "up"), e && u && e.val(u)), e = null }, events = function (o, h, y, m) { var g, b = t(this), k = o.find("." + n), w = k.find("input"), C = o.find("dl"), D = C.children("dd"), E = this.selectedIndex; if (!h && !m) { var showDown = function () { var e = o.offset().top + o.outerHeight() + 5 - p.scrollTop(), t = C.outerHeight(); E = b[0].selectedIndex, o.addClass(i + "ed"), D.removeClass(c), g = null, D.eq(E).addClass(s).siblings().removeClass(s), e + t > p.height() && e >= t && o.addClass(i + "up"), followScroll() }, hideDown = function (e) { o.removeClass(i + "ed " + i + "up"), w.blur(), g = null, e || notOption(w.val(), (function (e) { e && (u = C.find("." + s).html(), w && w.val(u)) })) }, followScroll = function () { var e = C.children("dd." + s); if (e[0]) { var t = e.position().top, i = C.height(), n = e.height(); t > i && C.scrollTop(t + C.scrollTop() - i + n - 5), t < 0 && C.scrollTop(t + C.scrollTop() - 5) } }; k.on("click", (function (e) { o.hasClass(i + "ed") ? hideDown() : (hide(e, !0), showDown()), C.find("." + r).remove() })), k.find(".layui-edge").on("click", (function () { w.focus() })), w.on("keyup", (function (e) { 9 === e.keyCode && showDown() })).on("keydown", (function (e) { var t = e.keyCode; 9 === t && hideDown(); var setThisDd = function (t, i) { var n, o; e.preventDefault(); var r = function () { var e = C.children("dd." + s); if (C.children("dd." + c)[0] && "next" === t) { var n = C.children("dd:not(." + c + ",." + d + ")"), o = n.eq(0).index(); if (o >= 0 && o < e.index() && !n.hasClass(s)) return n.eq(0).prev()[0] ? n.eq(0).prev() : C.children(":last") } return i && i[0] ? i : g && g[0] ? g : e }(); return o = r[t](), n = r[t]("dd:not(." + c + ")"), o[0] ? (g = r[t](), n[0] && !n.hasClass(d) || !g[0] ? (n.addClass(s).siblings().removeClass(s), void followScroll()) : setThisDd(t, g)) : g = null }; 38 === t && setThisDd("prev"), 40 === t && setThisDd("next"), 13 === t && (e.preventDefault(), C.children("dd." + s).trigger("click")) })); var notOption = function (e, i, n) { var o = 0; layui.each(D, (function () { var i = t(this), r = i.text(), s = -1 === r.indexOf(e); ("" === e || "blur" === n ? e !== r : s) && o++, "keyup" === n && i[s ? "addClass" : "removeClass"](c) })); var r = o === D.length; return i(r), r }; y && w.on("keyup", (function (e) { var t = this.value, i = e.keyCode; if (9 === i || 13 === i || 37 === i || 38 === i || 39 === i || 40 === i) return !1; notOption(t, (function (e) { e ? C.find("." + r)[0] || C.append('<p class="' + r + '">无匹配项</p>') : C.find("." + r).remove() }), "keyup"), "" === t && C.find("." + r).remove(), followScroll() })).on("blur", (function (i) { var n = b[0].selectedIndex; e = w, u = t(b[0].options[n]).html(), setTimeout((function () { notOption(w.val(), (function (e) { u || w.val("") }), "blur") }), 200) })), D.on("click", (function () { var e = t(this), i = e.attr("lay-value"), n = b.attr("lay-filter"); return e.hasClass(d) || (e.hasClass("layui-select-tips") ? w.val("") : (w.val(e.text()), e.addClass(s)), e.siblings().removeClass(s), b.val(i).removeClass("layui-form-danger"), layui.event.call(this, "form", "select(" + n + ")", { elem: b[0], value: i, othis: o }), hideDown(!0)), !1 })), o.find("dl>dt").on("click", (function (e) { return !1 })), t(document).off("click", hide).on("click", hide) } }; h.each((function (e, o) { var r = t(this), c = r.next("." + i), u = this.disabled, h = r.attr("readonly"), p = o.value, y = t(o.options[-1 == o.selectedIndex ? 0 : o.selectedIndex]), m = o.options[0]; if ("string" == typeof r.attr("lay-ignore")) return r.show(); var g = "string" == typeof r.attr("lay-search"), b = m ? m.value ? "请选择" : m.innerHTML || "请选择" : "请选择", k = t(['<div class="' + (g ? "" : "layui-unselect ") + i, (u ? " layui-select-disabled" : "") + '">', '<div class="' + n + '">', '<input type="text" placeholder="' + b + '" value="' + (p ? y.html() : "") + '"' + (g ? "" : " readonly") + ' class="layui-input' + (g ? "" : " layui-unselect") + (u ? " " + d : "") + '">', '<i class="layui-edge"></i></div>', '<dl class="layui-anim layui-anim-upbit' + (r.find("optgroup")[0] ? " layui-select-group" : "") + '">', function (e) { var t = []; return layui.each(e, (function (e, i) { 0 !== e || i.value ? "optgroup" === i.tagName.toLowerCase() ? t.push("<dt>" + i.label + "</dt>") : t.push('<dd lay-value="' + i.value + '" class="' + (p === i.value ? s : "") + (i.disabled ? " " + d : "") + '">' + i.innerHTML + "</dd>") : t.push('<dd lay-value="" class="layui-select-tips">' + (i.innerHTML || "请选择") + "</dd>") })), 0 === t.length && t.push('<dd lay-value="" class="' + d + '">没有选项</dd>'), t.join("") }(r.find("*")) + "</dl>", "</div>"].join("")); c[0] && c.remove(), r.after(k), events.call(this, k, u, g, h) })) }, checkbox: function () { var e = { checkbox: ["layui-form-checkbox", "layui-form-checked", "checkbox"], _switch: ["layui-form-switch", "layui-form-onswitch", "switch"] }, i = o.find("input[type=checkbox]"), events = function (e, i) { var n = t(this); e.on("click", (function () { var o = n.attr("lay-filter"), r = (n.attr("lay-text") || "").split("|"); n[0].disabled || "readonly" != t(n[0]).attr("readonly") && (n[0].checked ? (n[0].checked = !1, e.removeClass(i[1]).find("em").text(r[1])) : (n[0].checked = !0, e.addClass(i[1]).find("em").text(r[0])), layui.event.call(n[0], "form", i[2] + "(" + o + ")", { elem: n[0], value: n[0].value, othis: e })) })) }; i.each((function (i, n) { var o = t(this), r = o.attr("lay-skin"), s = (o.attr("lay-text") || "").split("|"), c = this.disabled; "switch" === r && (r = "_" + r); var u = e[r] || e.checkbox; if ("string" == typeof o.attr("lay-ignore")) return o.show(); var h = o.next("." + u[0]), p = t(['<div class="layui-unselect ' + u[0], n.checked ? " " + u[1] : "", c ? " layui-checkbox-disbaled " + d : "", '"', r ? ' lay-skin="' + r + '"' : "", ">", function () { var e = { checkbox: [n.title.replace(/\s/g, "") ? "<span>" + n.title + "</span>" : "", '<i class="layui-icon layui-icon-ok"></i>'].join(""), _switch: "<em>" + ((n.checked ? s[0] : s[1]) || "") + "</em><i></i>" }; return e[r] || e.checkbox }(), "</div>"].join("")); h[0] && h.remove(), o.after(p), events.call(this, p, u) })) }, radio: function () { var e = "layui-form-radio", i = ["", ""], n = o.find("input[type=radio]"), events = function (n) { var o = t(this), s = "layui-anim-scaleSpring"; n.on("click", (function () { var c = o[0].name, d = o.parents(r), u = o.attr("lay-filter"), h = d.find("input[name=" + c.replace(/(\.|#|\[|\])/g, "\\$1") + "]"); o[0].disabled || "readonly" != t(o[0]).attr("readonly") && (layui.each(h, (function () { var n = t(this).next("." + e); this.checked = !1, n.removeClass(e + "ed"), n.find(".layui-icon").removeClass(s).html(i[1]) })), o[0].checked = !0, n.addClass(e + "ed"), n.find(".layui-icon").addClass(s).html(i[0]), layui.event.call(o[0], "form", "radio(" + u + ")", { elem: o[0], value: o[0].value, othis: n })) })) }; n.each((function (n, o) { var r = t(this), s = r.next("." + e), c = this.disabled; if ("string" == typeof r.attr("lay-ignore")) return r.show(); s[0] && s.remove(); var u, h = t(['<div class="layui-unselect ' + e, o.checked ? " " + e + "ed" : "", (c ? " layui-radio-disbaled " + d : "") + '">', '<i class="layui-anim layui-icon">' + i[o.checked ? 0 : 1] + "</i>", "<div>" + (u = o.title || "", "string" == typeof r.next().attr("lay-radio") && (u = r.next().html(), r.next().remove()), u + "</div>"), "</div>"].join("")); r.after(h), events.call(this, h) })) } }; return e ? u[e] ? u[e]() : n.error("不支持的" + e + "表单渲染") : layui.each(u, (function (e, t) { t() })), this }; var submit = function () { var e = t(this), n = u.config.verify, s = null, c = {}, d = e.parents(r), h = d.find("*[lay-verify]"), p = e.parents("form")[0], y = d.find("input,select,textarea"), m = e.attr("lay-filter"); if (layui.each(h, (function (e, r) { var c, d = t(this), u = d.attr("lay-verify").split("|"), h = d.attr("lay-verType"); if (c = void 0 === t(this).attr("zlcomponent") || "SELECT" == t(this)[0].tagName ? d.val() : d.find("input").val(), d.removeClass("layui-form-danger"), layui.each(u, (function (e, t) { var u = "", p = "function" == typeof n[t]; if (n[t]) { var y = p ? u = n[t](c, r) : !n[t][0].test(c); if (u = u || n[t][1], y) return "tips" === h ? i.tips(u, "string" == typeof d.attr("lay-ignore") || "select" !== r.tagName.toLowerCase() && !/^checkbox|radio$/.test(r.type) ? d : d.next(), { tips: 1 }) : "alert" === h ? i.alert(u, { title: "提示", shadeClose: !0 }) : i.msg(u, { icon: 5, shift: 6 }), o.android || o.ios || r.focus(), d.addClass("layui-form-danger"), s = !0 } })), s) return s })), s) return !1; var g = {}; return layui.each(y, (function (e, i) { if (i.name = (i.name || "").replace(/^\s*|\s*&/, ""), i.name) { if (/^.*\[\]$/.test(i.name)) { var n = i.name.match(/^(.*)\[\]$/g)[0]; g[n] = 0 | g[n], i.name = i.name.replace(/^(.*)\[\]$/, "$1[" + g[n]++ + "]") } if (/^checkbox|radio$/.test(i.type)) { var o = t(i).attr("valueformat"); if (o) i.checked ? c[i.name] = o.split("|")[0] : c[i.name] = o.split("|")[1]; else if (!i.checked && t(i).attr("lay-skin")) c[i.name] = "1"; else { if (!i.checked) return; c[i.name] = i.value } } else c[i.name] = i.value } })), layui.event.call(this, "form", "submit(" + m + ")", { elem: this, form: p, field: c }) }, u = new Form, h = t(document), p = t(window); u.render(), h.on("reset", r, (function () { var e = t(this).attr("lay-filter"); setTimeout((function () { u.render(null, e) }), 50) })), h.on("submit", r, submit).on("click", "*[lay-submit]", submit), e("form", u) }))
|
||
}, function (e, t, i) {
|
||
var n;
|
||
/**
|
||
|
||
@Name : layDate 5.0.9 日期时间控件
|
||
@Author: 贤心
|
||
@Site:http://www.layui.com/laydate/
|
||
@License:MIT
|
||
|
||
*/!function () { "use strict"; var o, r, s = window.layui && layui.define, c = { getPath: (o = document.currentScript ? document.currentScript.src : function () { for (var e, t = document.scripts, i = t.length - 1, n = i; n > 0; n--)if ("interactive" === t[n].readyState) { e = t[n].src; break } return e || t[i].src }(), o.substring(0, o.lastIndexOf("/") + 1)), getStyle: function (e, t) { var i = e.currentStyle ? e.currentStyle : window.getComputedStyle(e, null); return i[i.getPropertyValue ? "getPropertyValue" : "getAttribute"](t) }, link: function (e, t, i) { if (d.path) { var n = document.getElementsByTagName("head")[0], o = document.createElement("link"); "string" == typeof t && (i = t); var r = "layuicss-" + (i || e).replace(/\.|\//g, ""), s = 0; o.rel = "stylesheet", o.href = d.path + e, o.id = r, document.getElementById(r) || n.appendChild(o), "function" == typeof t && function poll() { if (++s > 80) return window.console && void 0; 1989 === parseInt(c.getStyle(document.getElementById(r), "width")) ? t() : setTimeout(poll, 100) }() } } }, d = { v: "5.0.9", config: {}, index: window.laydate && window.laydate.v ? 1e5 : 0, path: c.getPath, set: function (e) { return this.config = lay.extend({}, this.config, e), this }, ready: function (e) { var t = (s ? "modules/laydate/" : "theme/") + "default/laydate.css?v=" + d.v; return s ? layui.addcss(t, e, "laydate") : c.link(t, e, "laydate"), this } }, thisDate = function () { var e = this; return { hint: function (t) { e.hint.call(e, t) }, config: e.config } }, u = "layui-this", h = "laydate-disabled", p = "开始日期超出了结束日期<br>建议重新选择", y = [100, 2e5], m = "layui-laydate-list", g = "layui-laydate-hint", b = ".laydate-btns-confirm", Class = function (e) { var t = this; t.index = ++d.index, t.config = lay.extend({}, t.config, d.config, e), d.ready((function () { t.init() })) }, lay = function (e) { return new LAY(e) }, LAY = function (e) { for (var t = 0, i = "object" == typeof e ? [e] : (this.selector = e, document.querySelectorAll(e || null)); t < i.length; t++)this.push(i[t]) }; LAY.prototype = [], LAY.prototype.constructor = LAY, lay.extend = function () { var e = 1, t = arguments, clone = function (e, t) { for (var i in e = e || (t.constructor === Array ? [] : {}), t) e[i] = t[i] && t[i].constructor === Object ? clone(e[i], t[i]) : t[i]; return e }; for (t[0] = "object" == typeof t[0] ? t[0] : {}; e < t.length; e++)"object" == typeof t[e] && clone(t[0], t[e]); return t[0] }, lay.ie = (r = navigator.userAgent.toLowerCase(), !(!window.ActiveXObject && !("ActiveXObject" in window)) && ((r.match(/msie\s(\d+)/) || [])[1] || "11")), lay.stope = function (e) { (e = e || window.event).stopPropagation ? e.stopPropagation() : e.cancelBubble = !0 }, lay.each = function (e, t) { var i; if ("function" != typeof t) return this; if ((e = e || []).constructor === Object) { for (i in e) if (t.call(e[i], i, e[i])) break } else for (i = 0; i < e.length && !t.call(e[i], i, e[i]); i++); return this }, lay.digit = function (e, t, i) { var n = ""; t = t || 2; for (var o = (e = String(e)).length; o < t; o++)n += "0"; return e < Math.pow(10, t) ? n + (0 | e) : e }, lay.elem = function (e, t) { var i = document.createElement(e); return lay.each(t || {}, (function (e, t) { i.setAttribute(e, t) })), i }, LAY.addStr = function (e, t) { return e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "), lay.each(t, (function (t, i) { new RegExp("\\b" + i + "\\b").test(e) || (e = e + " " + i) })), e.replace(/^\s|\s$/, "") }, LAY.removeStr = function (e, t) { return e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "), lay.each(t, (function (t, i) { var n = new RegExp("\\b" + i + "\\b"); n.test(e) && (e = e.replace(n, "")) })), e.replace(/\s+/, " ").replace(/^\s|\s$/, "") }, LAY.prototype.find = function (e) { var t = this, i = 0, n = [], o = "object" == typeof e; return this.each((function (r, s) { for (var c = o ? [e] : s.querySelectorAll(e || null); i < c.length; i++)n.push(c[i]); t.shift() })), o || (t.selector = (t.selector ? t.selector + " " : "") + e), lay.each(n, (function (e, i) { t.push(i) })), t }, LAY.prototype.each = function (e) { return lay.each.call(this, this, e) }, LAY.prototype.addClass = function (e, t) { return this.each((function (i, n) { n.className = LAY[t ? "removeStr" : "addStr"](n.className, e) })) }, LAY.prototype.removeClass = function (e) { return this.addClass(e, !0) }, LAY.prototype.hasClass = function (e) { var t = !1; return this.each((function (i, n) { new RegExp("\\b" + e + "\\b").test(n.className) && (t = !0) })), t }, LAY.prototype.attr = function (e, t) { var i = this; return void 0 === t ? function () { if (i.length > 0) return i[0].getAttribute(e) }() : i.each((function (i, n) { n.setAttribute(e, t) })) }, LAY.prototype.removeAttr = function (e) { return this.each((function (t, i) { i.removeAttribute(e) })) }, LAY.prototype.html = function (e) { return this.each((function (t, i) { i.innerHTML = e })) }, LAY.prototype.val = function (e) { return this.each((function (t, i) { i.value = e })) }, LAY.prototype.append = function (e) { return this.each((function (t, i) { "object" == typeof e ? i.appendChild(e) : i.innerHTML = i.innerHTML + e })) }, LAY.prototype.remove = function (e) { return this.each((function (t, i) { e ? i.removeChild(e) : i.parentNode.removeChild(i) })) }, LAY.prototype.on = function (e, t) { return this.each((function (i, n) { n.attachEvent ? n.attachEvent("on" + e, (function (e) { e.target = e.srcElement, t.call(n, e) })) : n.addEventListener(e, t, !1) })) }, LAY.prototype.off = function (e, t) { return this.each((function (i, n) { n.detachEvent ? n.detachEvent("on" + e, t) : n.removeEventListener(e, t, !1) })) }, Class.isLeapYear = function (e) { return e % 4 == 0 && e % 100 != 0 || e % 400 == 0 }, Class.prototype.config = { type: "date", range: !1, format: "yyyy-MM-dd", value: null, isInitValue: !0, min: "1900-1-1", max: "2099-12-31", trigger: "focus", show: !1, showBottom: !0, btns: ["clear", "now", "confirm"], lang: "cn", theme: "default", position: null, calendar: !1, mark: {}, zIndex: null, done: null, change: null }, Class.prototype.lang = function () { var e = { cn: { weeks: ["日", "一", "二", "三", "四", "五", "六"], time: ["时", "分", "秒"], timeTips: "选择时间", startTime: "开始时间", endTime: "结束时间", dateTips: "返回日期", month: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"], tools: { confirm: "确定", clear: "清空", now: "现在" } }, en: { weeks: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], time: ["Hours", "Minutes", "Seconds"], timeTips: "Select Time", startTime: "Start Time", endTime: "End Time", dateTips: "Select Date", month: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], tools: { confirm: "Confirm", clear: "Clear", now: "Now" } } }; return e[this.config.lang] || e.cn }, Class.prototype.init = function () { var e = this, t = e.config, i = "yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s", n = "static" === t.position, o = { year: "yyyy", month: "yyyy-MM", date: "yyyy-MM-dd", time: "HH:mm:ss", datetime: "yyyy-MM-dd HH:mm:ss" }; t.elem = lay(t.elem), t.eventElem = lay(t.eventElem), t.elem[0] && (!0 === t.range && (t.range = "-"), t.format === o.date && (t.format = o[t.type]), e.format = t.format.match(new RegExp(i + "|.", "g")) || [], e.EXP_IF = "", e.EXP_SPLIT = "", lay.each(e.format, (function (t, n) { var o = new RegExp(i).test(n) ? "\\d{" + (new RegExp(i).test(e.format[0 === t ? t + 1 : t - 1] || "") ? /^yyyy|y$/.test(n) ? 4 : n.length : /^yyyy$/.test(n) ? "1,4" : /^y$/.test(n) ? "1,308" : "1,2") + "}" : "\\" + n; e.EXP_IF = e.EXP_IF + o, e.EXP_SPLIT = e.EXP_SPLIT + "(" + o + ")" })), e.EXP_IF = new RegExp("^" + (t.range ? e.EXP_IF + "\\s\\" + t.range + "\\s" + e.EXP_IF : e.EXP_IF) + "$"), e.EXP_SPLIT = new RegExp("^" + e.EXP_SPLIT + "$", ""), e.isInput(t.elem[0]) || "focus" === t.trigger && (t.trigger = "click"), t.elem.attr("lay-key") || (t.elem.attr("lay-key", e.index), t.eventElem.attr("lay-key", e.index)), t.mark = lay.extend({}, t.calendar && "cn" === t.lang ? { "0-1-1": "元旦", "0-2-14": "情人", "0-3-8": "妇女", "0-3-12": "植树", "0-4-1": "愚人", "0-5-1": "劳动", "0-5-4": "青年", "0-6-1": "儿童", "0-9-10": "教师", "0-9-18": "国耻", "0-10-1": "国庆", "0-12-25": "圣诞" } : {}, t.mark), lay.each(["min", "max"], (function (e, i) { var n = [], o = []; if ("number" == typeof t[i]) { var r = t[i], s = (new Date).getTime(), c = new Date(r ? r < 864e5 ? s + 864e5 * r : r : s); n = [c.getFullYear(), c.getMonth() + 1, c.getDate()], r < 864e5 || (o = [c.getHours(), c.getMinutes(), c.getSeconds()]) } else n = (t[i].match(/\d+-\d+-\d+/) || [""])[0].split("-"), o = (t[i].match(/\d+:\d+:\d+/) || [""])[0].split(":"); t[i] = { year: 0 | n[0] || (new Date).getFullYear(), month: n[1] ? (0 | n[1]) - 1 : (new Date).getMonth(), date: 0 | n[2] || (new Date).getDate(), hours: 0 | o[0], minutes: 0 | o[1], seconds: 0 | o[2] } })), e.elemID = "layui-laydate" + t.elem.attr("lay-key"), (t.show || n) && e.render(), n || e.events(), t.value && t.isInitValue && (t.value.constructor === Date ? e.setValue(e.parse(0, e.systemDate(t.value))) : e.setValue(t.value))) }, Class.prototype.render = function () { var e, t, i = this.config, n = this.lang(), o = "static" === i.position, r = this.elem = lay.elem("div", { id: this.elemID, class: ["layui-laydate", i.range ? " layui-laydate-range" : "", o ? " layui-laydate-static" : "", i.theme && "default" !== i.theme && !/^#/.test(i.theme) ? " laydate-theme-" + i.theme : ""].join("") }), s = this.elemMain = [], c = this.elemHeader = [], d = this.elemCont = [], u = this.table = [], h = this.footer = lay.elem("div", { class: "layui-laydate-footer" }); if (i.zIndex && (r.style.zIndex = i.zIndex), lay.each(new Array(2), (function (e) { if (!i.range && e > 0) return !0; var t = lay.elem("div", { class: "layui-laydate-header" }), o = [function () { var e = lay.elem("i", { class: "layui-icon laydate-icon laydate-prev-y" }); return e.innerHTML = "", e }(), function () { var e = lay.elem("i", { class: "layui-icon laydate-icon laydate-prev-m" }); return e.innerHTML = "", e }(), function () { var e = lay.elem("div", { class: "laydate-set-ym" }), t = lay.elem("span"), i = lay.elem("span"); return e.appendChild(t), e.appendChild(i), e }(), function () { var e = lay.elem("i", { class: "layui-icon laydate-icon laydate-next-m" }); return e.innerHTML = "", e }(), function () { var e = lay.elem("i", { class: "layui-icon laydate-icon laydate-next-y" }); return e.innerHTML = "", e }()], r = lay.elem("div", { class: "layui-laydate-content" }), h = lay.elem("table"), p = lay.elem("thead"), y = lay.elem("tr"); lay.each(o, (function (e, i) { t.appendChild(i) })), p.appendChild(y), lay.each(new Array(6), (function (e) { var t = h.insertRow(0); lay.each(new Array(7), (function (i) { if (0 === e) { var o = lay.elem("th"); o.innerHTML = n.weeks[i], y.appendChild(o) } t.insertCell(i) })) })), h.insertBefore(p, h.children[0]), r.appendChild(h), s[e] = lay.elem("div", { class: "layui-laydate-main laydate-main-list-" + e }), s[e].appendChild(t), s[e].appendChild(r), c.push(o), d.push(r), u.push(h) })), lay(h).html((e = [], t = [], "datetime" === i.type && e.push('<span lay-type="datetime" class="laydate-btns-time">' + n.timeTips + "</span>"), lay.each(i.btns, (function (e, r) { var s = n.tools[r] || "btn"; i.range && "now" === r || (o && "clear" === r && (s = "cn" === i.lang ? "重置" : "Reset"), t.push('<span lay-type="' + r + '" class="laydate-btns-' + r + '">' + s + "</span>")) })), e.push('<div class="laydate-footer-btns">' + t.join("") + "</div>"), e.join(""))), lay.each(s, (function (e, t) { r.appendChild(t) })), i.showBottom && r.appendChild(h), /^#/.test(i.theme)) { var p = lay.elem("style"), y = ["#{{id}} .layui-laydate-header{background-color:{{theme}};}", "#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g, this.elemID).replace(/{{theme}}/g, i.theme); "styleSheet" in p ? (p.setAttribute("type", "text/css"), p.styleSheet.cssText = y) : p.innerHTML = y, lay(r).addClass("laydate-theme-molv"), r.appendChild(p) } this.remove(Class.thisElemDate), o ? i.elem.append(r) : (document.body.appendChild(r), this.position()), this.checkDate().calendar(), this.changeEvent(), Class.thisElemDate = this.elemID, "function" == typeof i.ready && i.ready(lay.extend({}, i.dateTime, { month: i.dateTime.month + 1 })) }, Class.prototype.remove = function (e) { this.config; var t = lay("#" + (e || this.elemID)); return t.hasClass("layui-laydate-static") || this.checkDate((function () { t.remove() })), this }, Class.prototype.position = function () { var e = this.config, t = (this.bindElem || e.elem[0]).getBoundingClientRect(), i = this.elem.offsetWidth, n = this.elem.offsetHeight, scrollArea = function (e) { return e = e ? "scrollLeft" : "scrollTop", document.body[e] | document.documentElement[e] }, winArea = function (e) { return document.documentElement[e ? "clientWidth" : "clientHeight"] }, o = t.left, r = t.bottom; o + i + 5 > winArea("width") && (o = winArea("width") - i - 5), r + n + 5 > winArea() && (r = t.top > n ? t.top - n : winArea() - n, r -= 10), e.position && (this.elem.style.position = e.position), this.elem.style.left = o + ("fixed" === e.position ? 0 : scrollArea(1)) + "px", this.elem.style.top = r + ("fixed" === e.position ? 0 : scrollArea()) + "px" }, Class.prototype.hint = function (e) { var t = this, i = (t.config, lay.elem("div", { class: g })); t.elem && (i.innerHTML = e || "", lay(t.elem).find("." + g).remove(), t.elem.appendChild(i), clearTimeout(t.hinTimer), t.hinTimer = setTimeout((function () { lay(t.elem).find("." + g).remove() }), 3e3)) }, Class.prototype.getAsYM = function (e, t, i) { return i ? t-- : t++, t < 0 && (t = 11, e--), t > 11 && (t = 0, e++), [e, t] }, Class.prototype.systemDate = function (e) { var t = e || new Date; return { year: t.getFullYear(), month: t.getMonth(), date: t.getDate(), hours: e ? e.getHours() : 0, minutes: e ? e.getMinutes() : 0, seconds: e ? e.getSeconds() : 0 } }, Class.prototype.checkDate = function (e) { var t, i, n = this, o = (new Date, n.config), r = o.dateTime = o.dateTime || n.systemDate(), s = n.bindElem || o.elem[0], c = (n.isInput(s), n.isInput(s) ? s.value : "static" === o.position ? "" : s.innerHTML), checkValid = function (e) { e.year > y[1] && (e.year = y[1], i = !0), e.month > 11 && (e.month = 11, i = !0), e.hours > 23 && (e.hours = 0, i = !0), e.minutes > 59 && (e.minutes = 0, e.hours++, i = !0), e.seconds > 59 && (e.seconds = 0, e.minutes++, i = !0), t = d.getEndDate(e.month + 1, e.year), e.date > t && (e.date = t, i = !0) }, initDate = function (e, t, r) { var s = ["startTime", "endTime"]; t = (t.match(n.EXP_SPLIT) || []).slice(1), r = r || 0, o.range && (n[s[r]] = n[s[r]] || {}), lay.each(n.format, (function (c, d) { var u = parseFloat(t[c]); t[c].length < d.length && (i = !0), /yyyy|y/.test(d) ? (u < y[0] && (u = y[0], i = !0), e.year = u) : /MM|M/.test(d) ? (u < 1 && (u = 1, i = !0), e.month = u - 1) : /dd|d/.test(d) ? (u < 1 && (u = 1, i = !0), e.date = u) : /HH|H/.test(d) ? (u < 1 && (u = 0, i = !0), e.hours = u, o.range && (n[s[r]].hours = u)) : /mm|m/.test(d) ? (u < 1 && (u = 0, i = !0), e.minutes = u, o.range && (n[s[r]].minutes = u)) : /ss|s/.test(d) && (u < 1 && (u = 0, i = !0), e.seconds = u, o.range && (n[s[r]].seconds = u)) })), checkValid(e) }; return "limit" === e ? (checkValid(r), n) : ("string" == typeof (c = c || o.value) && (c = c.replace(/\s+/g, " ").replace(/^\s|\s$/g, "")), n.startState && !n.endState && (delete n.startState, n.endState = !0), "string" == typeof c && c ? n.EXP_IF.test(c) ? o.range ? (c = c.split(" " + o.range + " "), n.startDate = n.startDate || n.systemDate(), n.endDate = n.endDate || n.systemDate(), o.dateTime = lay.extend({}, n.startDate), lay.each([n.startDate, n.endDate], (function (e, t) { initDate(t, c[e], e) }))) : initDate(r, c) : (n.hint("日期格式不合法<br>必须遵循下述格式:<br>" + (o.range ? o.format + " " + o.range + " " + o.format : o.format) + "<br>已为你重置"), i = !0) : c && c.constructor === Date ? o.dateTime = n.systemDate(c) : (o.dateTime = n.systemDate(), delete n.startState, delete n.endState, delete n.startDate, delete n.endDate, delete n.startTime, delete n.endTime), checkValid(r), i && c && n.setValue(o.range ? n.endDate ? n.parse() : "" : n.parse()), e && e(), n) }, Class.prototype.mark = function (e, t) { var i, n = this.config; return lay.each(n.mark, (function (e, n) { var o = e.split("-"); o[0] != t[0] && 0 != o[0] || o[1] != t[1] && 0 != o[1] || o[2] != t[2] || (i = n || t[2]) })), i && e.html('<span class="laydate-day-mark">' + i + "</span>"), this }, Class.prototype.limit = function (e, t, i, n) { var o, r = this, s = r.config, c = {}, d = s[i > 41 ? "endDate" : "dateTime"], u = lay.extend({}, d, t || {}); return lay.each({ now: u, min: s.min, max: s.max }, (function (e, t) { var i; c[e] = r.newDate(lay.extend({ year: t.year, month: t.month, date: t.date }, (i = {}, lay.each(n, (function (e, n) { i[n] = t[n] })), i))).getTime() })), o = c.now < c.min || c.now > c.max, e && e[o ? "addClass" : "removeClass"](h), o }, Class.prototype.calendar = function (e) { var t, i, n, o = this, r = o.config, s = e || r.dateTime, c = new Date, h = o.lang(), p = "date" !== r.type && "datetime" !== r.type, m = e ? 1 : 0, g = lay(o.table[m]).find("td"), k = lay(o.elemHeader[m][2]).find("span"); if (s.year < y[0] && (s.year = y[0], o.hint("最低只能支持到公元" + y[0] + "年")), s.year > y[1] && (s.year = y[1], o.hint("最高只能支持到公元" + y[1] + "年")), o.firstDate || (o.firstDate = lay.extend({}, s)), c.setFullYear(s.year, s.month, 1), t = c.getDay(), i = d.getEndDate(s.month || 12, s.year), n = d.getEndDate(s.month + 1, s.year), lay.each(g, (function (e, c) { var d = [s.year, s.month], h = 0; (c = lay(c)).removeAttr("class"), e < t ? (h = i - t + e, c.addClass("laydate-day-prev"), d = o.getAsYM(s.year, s.month, "sub")) : e >= t && e < n + t ? (h = e - t, r.range || h + 1 === s.date && c.addClass(u)) : (h = e - n - t, c.addClass("laydate-day-next"), d = o.getAsYM(s.year, s.month)), d[1]++, d[2] = h + 1, c.attr("lay-ymd", d.join("-")).html(d[2]), o.mark(c, d).limit(c, { year: d[0], month: d[1] - 1, date: d[2] }, e) })), lay(k[0]).attr("lay-ym", s.year + "-" + (s.month + 1)), lay(k[1]).attr("lay-ym", s.year + "-" + (s.month + 1)), "cn" === r.lang ? (lay(k[0]).attr("lay-type", "year").html(s.year + "年"), lay(k[1]).attr("lay-type", "month").html(s.month + 1 + "月")) : (lay(k[0]).attr("lay-type", "month").html(h.month[s.month]), lay(k[1]).attr("lay-type", "year").html(s.year)), p && (r.range && (e ? o.endDate = o.endDate || { year: s.year + ("year" === r.type ? 1 : 0), month: s.month + ("month" === r.type ? 0 : -1) } : o.startDate = o.startDate || { year: s.year, month: s.month }, e && (o.listYM = [[o.startDate.year, o.startDate.month + 1], [o.endDate.year, o.endDate.month + 1]], o.list(r.type, 0).list(r.type, 1), "time" === r.type ? o.setBtnStatus("时间", lay.extend({}, o.systemDate(), o.startTime), lay.extend({}, o.systemDate(), o.endTime)) : o.setBtnStatus(!0))), r.range || (o.listYM = [[s.year, s.month + 1]], o.list(r.type, 0))), r.range && !e) { var w = o.getAsYM(s.year, s.month); o.calendar(lay.extend({}, s, { year: w[0], month: w[1] })) } return r.range || o.limit(lay(o.footer).find(b), null, 0, ["hours", "minutes", "seconds"]), r.range && e && !p && o.stampRange(), o }, Class.prototype.list = function (e, t) { var i = this, n = i.config, o = n.dateTime, r = i.lang(), s = n.range && "date" !== n.type && "datetime" !== n.type, c = lay.elem("ul", { class: m + " " + { year: "laydate-year-list", month: "laydate-month-list", time: "laydate-time-list" }[e] }), d = i.elemHeader[t], p = lay(d[2]).find("span"), y = i.elemCont[t || 0], g = lay(y).find("." + m)[0], k = "cn" === n.lang, w = k ? "年" : "", C = i.listYM[t] || {}, D = ["hours", "minutes", "seconds"], E = ["startTime", "endTime"][t]; if (C[0] < 1 && (C[0] = 1), "year" === e) { var S, L = S = C[0] - 7; L < 1 && (L = S = 1), lay.each(new Array(15), (function (e) { var o = lay.elem("li", { "lay-ym": S }), r = { year: S }; S == C[0] && lay(o).addClass(u), o.innerHTML = S + w, c.appendChild(o), S < i.firstDate.year ? (r.month = n.min.month, r.date = n.min.date) : S >= i.firstDate.year && (r.month = n.max.month, r.date = n.max.date), i.limit(lay(o), r, t), S++ })), lay(p[k ? 0 : 1]).attr("lay-ym", S - 8 + "-" + C[1]).html(L + w + " - " + (S - 1 + w)) } else if ("month" === e) lay.each(new Array(12), (function (e) { var o = lay.elem("li", { "lay-ym": e }), s = { year: C[0], month: e }; e + 1 == C[1] && lay(o).addClass(u), o.innerHTML = r.month[e] + (k ? "月" : ""), c.appendChild(o), C[0] < i.firstDate.year ? s.date = n.min.date : C[0] >= i.firstDate.year && (s.date = n.max.date), i.limit(lay(o), s, t) })), lay(p[k ? 0 : 1]).attr("lay-ym", C[0] + "-" + C[1]).html(C[0] + w); else if ("time" === e) { var setTimeStatus = function () { lay(c).find("ol").each((function (e, n) { lay(n).find("li").each((function (n, o) { i.limit(lay(o), [{ hours: n }, { hours: i[E].hours, minutes: n }, { hours: i[E].hours, minutes: i[E].minutes, seconds: n }][e], t, [["hours"], ["hours", "minutes"], ["hours", "minutes", "seconds"]][e]) })) })), n.range || i.limit(lay(i.footer).find(b), i[E], 0, ["hours", "minutes", "seconds"]) }; n.range ? i[E] || (i[E] = { hours: 0, minutes: 0, seconds: 0 }) : i[E] = o, lay.each([24, 60, 60], (function (e, t) { var n = lay.elem("li"), o = ["<p>" + r.time[e] + "</p><ol>"]; lay.each(new Array(t), (function (t) { o.push("<li" + (i[E][D[e]] === t ? ' class="' + u + '"' : "") + ">" + lay.digit(t, 2) + "</li>") })), n.innerHTML = o.join("") + "</ol>", c.appendChild(n) })), setTimeStatus() } if (g && y.removeChild(g), y.appendChild(c), "year" === e || "month" === e) lay(i.elemMain[t]).addClass("laydate-ym-show"), lay(c).find("li").on("click", (function () { var r = 0 | lay(this).attr("lay-ym"); if (!lay(this).hasClass(h)) { if (0 === t) o[e] = r, s && (i.startDate[e] = r), i.limit(lay(i.footer).find(b), null, 0); else if (s) i.endDate[e] = r; else { var d = "year" === e ? i.getAsYM(r, C[1] - 1, "sub") : i.getAsYM(C[0], r, "sub"); lay.extend(o, { year: d[0], month: d[1] }) } "year" === n.type || "month" === n.type ? (lay(c).find("." + u).removeClass(u), lay(this).addClass(u), "month" === n.type && "year" === e && (i.listYM[t][0] = r, s && (i[["startDate", "endDate"][t]].year = r), i.list("month", t))) : (i.checkDate("limit").calendar(), i.closeList()), i.setBtnStatus(), n.range || i.done(null, "change"), lay(i.footer).find(".laydate-btns-time").removeClass(h) } })); else { var N = lay.elem("span", { class: "laydate-time-text" }), scroll = function () { lay(c).find("ol").each((function (e) { var t = this, n = lay(t).find("li"); t.scrollTop = 30 * (i[E][D[e]] - 2), t.scrollTop <= 0 && n.each((function (e, i) { if (!lay(this).hasClass(h)) return t.scrollTop = 30 * (e - 2), !0 })) })) }, A = lay(d[2]).find(".laydate-time-text"); scroll(), N.innerHTML = n.range ? [r.startTime, r.endTime][t] : r.timeTips, lay(i.elemMain[t]).addClass("laydate-time-show"), A[0] && A.remove(), d[2].appendChild(N), lay(c).find("ol").each((function (e) { var t = this; lay(t).find("li").on("click", (function () { var r = 0 | this.innerHTML; lay(this).hasClass(h) || (n.range ? i[E][D[e]] = r : o[D[e]] = r, lay(t).find("." + u).removeClass(u), lay(this).addClass(u), setTimeStatus(), scroll(), (i.endDate || "time" === n.type) && i.done(null, "change"), i.setBtnStatus()) })) })) } return i }, Class.prototype.listYM = [], Class.prototype.closeList = function () { var e = this; e.config; lay.each(e.elemCont, (function (t, i) { lay(this).find("." + m).remove(), lay(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show") })), lay(e.elem).find(".laydate-time-text").remove() }, Class.prototype.setBtnStatus = function (e, t, i) { var n, o = this.config, r = lay(this.footer).find(b); o.range && "date" !== o.type && "time" !== o.type && (t = t || this.startDate, i = i || this.endDate, n = this.newDate(t).getTime() > this.newDate(i).getTime(), this.limit(null, t) || this.limit(null, i) ? r.addClass(h) : r[n ? "addClass" : "removeClass"](h), e && n && this.hint("string" == typeof e ? p.replace(/日期/g, e) : p)) }, Class.prototype.parse = function (e, t) { var i = this.config, n = t || (e ? lay.extend({}, this.endDate, this.endTime) : i.range ? lay.extend({}, this.startDate, this.startTime) : i.dateTime), o = this.format.concat(); return lay.each(o, (function (e, t) { /yyyy|y/.test(t) ? o[e] = lay.digit(n.year, t.length) : /MM|M/.test(t) ? o[e] = lay.digit(n.month + 1, t.length) : /dd|d/.test(t) ? o[e] = lay.digit(n.date, t.length) : /HH|H/.test(t) ? o[e] = lay.digit(n.hours, t.length) : /mm|m/.test(t) ? o[e] = lay.digit(n.minutes, t.length) : /ss|s/.test(t) && (o[e] = lay.digit(n.seconds, t.length)) })), i.range && !e ? o.join("") + " " + i.range + " " + this.parse(1) : o.join("") }, Class.prototype.newDate = function (e) { return e = e || {}, new Date(e.year || 1, e.month || 0, e.date || 1, e.hours || 0, e.minutes || 0, e.seconds || 0) }, Class.prototype.setValue = function (e) { var t = this.config, i = this.bindElem || t.elem[0], n = this.isInput(i) ? "val" : "html"; return "static" === t.position || lay(i)[n](e || ""), this }, Class.prototype.stampRange = function () { var e, t, i = this, n = i.config, o = lay(i.elem).find("td"); if (n.range && !i.endDate && lay(i.footer).find(b).addClass(h), i.endDate) { if (e = i.newDate({ year: i.startDate.year, month: i.startDate.month, date: i.startDate.date }).getTime(), t = i.newDate({ year: i.endDate.year, month: i.endDate.month, date: i.endDate.date }).getTime(), e > t) return i.hint(p); lay.each(o, (function (n, o) { var r = lay(o).attr("lay-ymd").split("-"), s = i.newDate({ year: r[0], month: r[1] - 1, date: r[2] }).getTime(); lay(o).removeClass("laydate-selected " + u), s !== e && s !== t || lay(o).addClass(lay(o).hasClass("laydate-day-prev") || lay(o).hasClass("laydate-day-next") ? "laydate-selected" : u), s > e && s < t && lay(o).addClass("laydate-selected") })) } }, Class.prototype.done = function (e, t) { var i = this.config, n = lay.extend({}, this.startDate ? lay.extend(this.startDate, this.startTime) : i.dateTime), o = lay.extend({}, lay.extend(this.endDate, this.endTime)); return lay.each([n, o], (function (e, t) { "month" in t && lay.extend(t, { month: t.month + 1 }) })), e = e || [this.parse(), n, o], "function" == typeof i[t || "done"] && i[t || "done"].apply(i, e), this }, Class.prototype.choose = function (e) { var t = this, i = t.config, n = i.dateTime, o = lay(t.elem).find("td"), r = e.attr("lay-ymd").split("-"), setDateTime = function (e) { new Date; e && lay.extend(n, r), i.range && (t.startDate ? lay.extend(t.startDate, r) : t.startDate = lay.extend({}, r, t.startTime), t.startYMD = r) }; if (r = { year: 0 | r[0], month: (0 | r[1]) - 1, date: 0 | r[2] }, !e.hasClass(h)) if (i.range) { if (lay.each(["startTime", "endTime"], (function (e, i) { t[i] = t[i] || { hours: 0, minutes: 0, seconds: 0 } })), t.endState) setDateTime(), delete t.endState, delete t.endDate, t.startState = !0, o.removeClass(u + " laydate-selected"), e.addClass(u); else if (t.startState) { if (e.addClass(u), t.endDate ? lay.extend(t.endDate, r) : t.endDate = lay.extend({}, r, t.endTime), t.newDate(r).getTime() < t.newDate(t.startYMD).getTime()) { var s = lay.extend({}, t.endDate, { hours: t.startDate.hours, minutes: t.startDate.minutes, seconds: t.startDate.seconds }); lay.extend(t.endDate, t.startDate, { hours: t.endDate.hours, minutes: t.endDate.minutes, seconds: t.endDate.seconds }), t.startDate = s } i.showBottom || t.done(), t.stampRange(), t.endState = !0, t.done(null, "change") } else e.addClass(u), setDateTime(), t.startState = !0; lay(t.footer).find(b)[t.endDate ? "removeClass" : "addClass"](h) } else "static" === i.position ? (setDateTime(!0), t.calendar().done().done(null, "change")) : "date" === i.type ? (setDateTime(!0), t.setValue(t.parse()).remove().done()) : "datetime" === i.type && (setDateTime(!0), t.calendar().done(null, "change")) }, Class.prototype.tool = function (e, t) { var i = this, n = i.config, o = n.dateTime, r = "static" === n.position, s = { datetime: function () { lay(e).hasClass(h) || (i.list("time", 0), n.range && i.list("time", 1), lay(e).attr("lay-type", "date").html(i.lang().dateTips)) }, date: function () { i.closeList(), lay(e).attr("lay-type", "datetime").html(i.lang().timeTips) }, clear: function () { i.setValue("").remove(), r && (lay.extend(o, i.firstDate), i.calendar()), n.range && (delete i.startState, delete i.endState, delete i.endDate, delete i.startTime, delete i.endTime), i.done(["", {}, {}]) }, now: function () { var e = new Date; lay.extend(o, i.systemDate(), { hours: e.getHours(), minutes: e.getMinutes(), seconds: e.getSeconds() }), i.setValue(i.parse()).remove(), r && i.calendar(), i.done() }, confirm: function () { if (n.range) { if (!i.endDate) return i.hint("请先选择日期范围"); if (lay(e).hasClass(h)) return i.hint("time" === n.type ? p.replace(/日期/g, "时间") : p) } else if (lay(e).hasClass(h)) return i.hint("不在有效日期或时间范围内"); i.done(), i.setValue(i.parse()).remove() } }; s[t] && s[t]() }, Class.prototype.change = function (e) { var t = this, i = t.config, n = i.dateTime, o = i.range && ("year" === i.type || "month" === i.type), r = t.elemCont[e || 0], s = t.listYM[e], addSubYeay = function (c) { var d = ["startDate", "endDate"][e], u = lay(r).find(".laydate-year-list")[0], h = lay(r).find(".laydate-month-list")[0]; return u && (s[0] = c ? s[0] - 15 : s[0] + 15, t.list("year", e)), h && (c ? s[0]-- : s[0]++, t.list("month", e)), (u || h) && (lay.extend(n, { year: s[0] }), o && (t[d].year = s[0]), i.range || t.done(null, "change"), t.setBtnStatus(), i.range || t.limit(lay(t.footer).find(b), { year: s[0] })), u || h }; return { prevYear: function () { addSubYeay("sub") || (n.year--, t.checkDate("limit").calendar(), i.range || t.done(null, "change")) }, prevMonth: function () { var e = t.getAsYM(n.year, n.month, "sub"); lay.extend(n, { year: e[0], month: e[1] }), t.checkDate("limit").calendar(), i.range || t.done(null, "change") }, nextMonth: function () { var e = t.getAsYM(n.year, n.month); lay.extend(n, { year: e[0], month: e[1] }), t.checkDate("limit").calendar(), i.range || t.done(null, "change") }, nextYear: function () { addSubYeay() || (n.year++, t.checkDate("limit").calendar(), i.range || t.done(null, "change")) } } }, Class.prototype.changeEvent = function () { var e = this; e.config; lay(e.elem).on("click", (function (e) { lay.stope(e) })), lay.each(e.elemHeader, (function (t, i) { lay(i[0]).on("click", (function (i) { e.change(t).prevYear() })), lay(i[1]).on("click", (function (i) { e.change(t).prevMonth() })), lay(i[2]).find("span").on("click", (function (i) { var n = lay(this), o = n.attr("lay-ym"), r = n.attr("lay-type"); o && (o = o.split("-"), e.listYM[t] = [0 | o[0], 0 | o[1]], e.list(r, t), lay(e.footer).find(".laydate-btns-time").addClass(h)) })), lay(i[3]).on("click", (function (i) { e.change(t).nextMonth() })), lay(i[4]).on("click", (function (i) { e.change(t).nextYear() })) })), lay.each(e.table, (function (t, i) { lay(i).find("td").on("click", (function () { e.choose(lay(this)) })) })), lay(e.footer).find("span").on("click", (function () { var t = lay(this).attr("lay-type"); e.tool(this, t) })) }, Class.prototype.isInput = function (e) { return /input|textarea/.test(e.tagName.toLocaleLowerCase()) }, Class.prototype.events = function () { var e = this, t = e.config, showEvent = function (i, n) { i.on(t.trigger, (function () { n && (e.bindElem = this), e.render() })) }; t.elem[0] && !t.elem[0].eventHandler && (showEvent(t.elem, "bind"), showEvent(t.eventElem), lay(document).on("click", (function (i) { i.target !== t.elem[0] && i.target !== t.eventElem[0] && i.target !== lay(t.closeStop)[0] && e.remove() })).on("keydown", (function (t) { 13 === t.keyCode && lay("#" + e.elemID)[0] && e.elemID === Class.thisElem && (t.preventDefault(), lay(e.footer).find(b)[0].click()) })), lay(window).on("resize", (function () { if (!e.elem || !lay(".layui-laydate")[0]) return !1; e.position() })), t.elem[0].eventHandler = !0) }, d.render = function (e) { var t = new Class(e); return thisDate.call(t) }, d.getEndDate = function (e, t) { var i = new Date; return i.setFullYear(t || i.getFullYear(), e || i.getMonth() + 1, 1), new Date(i.getTime() - 864e5).getDate() }, window.lay = window.lay || lay, s ? (d.ready(), layui.define((function (e) { d.path = layui.cache.dir, e("laydate", d) }))) : void 0 === (n = function () { return d }.call(t, i, t, e)) || (e.exports = n) }()
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.layedit 富文本编辑器
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define(["layer", "form"], (function (e) { "use strict"; var t = layui.$, i = layui.layer, n = layui.form, o = (layui.hint(), layui.device()), r = "layui-disabled", Edit = function () { this.index = 0, this.config = { tool: ["strong", "italic", "underline", "del", "|", "left", "center", "right", "|", "link", "unlink", "face", "image"], hideTool: [], height: 280 } }; Edit.prototype.set = function (e) { return t.extend(!0, this.config, e), this }, Edit.prototype.on = function (e, t) { return layui.onevent("layedit", e, t) }, Edit.prototype.build = function (e, i) { i = i || {}; var n, r, c = this.config, d = "layui-layedit", u = t("string" == typeof e ? "#" + e : e), h = "LAY_layedit_" + ++this.index, p = u.next("." + d), y = t.extend({}, c, i), m = (n = [], r = {}, layui.each(y.hideTool, (function (e, t) { r[t] = !0 })), layui.each(y.tool, (function (e, t) { s[t] && !r[t] && n.push(s[t]) })), n.join("")), g = t(['<div class="' + d + '">', '<div class="layui-unselect layui-layedit-tool">' + m + "</div>", '<div class="layui-layedit-iframe">', '<iframe id="' + h + '" name="' + h + '" textarea="' + e + '" frameborder="0"></iframe>', "</div>", "</div>"].join("")); return o.ie && o.ie < 8 ? u.removeClass("layui-hide").addClass("layui-show") : (p[0] && p.remove(), setIframe.call(this, g, u[0], y), u.addClass("layui-hide").after(g), this.index) }, Edit.prototype.getContent = function (e) { var t = getWin(e); if (t[0]) return toLower(t[0].document.body.innerHTML) }, Edit.prototype.getText = function (e) { var i = getWin(e); if (i[0]) return t(i[0].document.body).text() }, Edit.prototype.setContent = function (e, i, n) { var o = getWin(e); o[0] && (n ? t(o[0].document.body).append(i) : t(o[0].document.body).html(i), layedit.sync(e)) }, Edit.prototype.sync = function (e) { var i = getWin(e); i[0] && t("#" + i[1].attr("textarea")).val(toLower(i[0].document.body.innerHTML)) }, Edit.prototype.getSelection = function (e) { var t = getWin(e); if (t[0]) { var i = Range(t[0].document); return document.selection ? i.text : i.toString() } }; var setIframe = function (e, i, n) { var o = this, r = e.find("iframe"); r.css({ height: n.height }).on("load", (function () { var s = r.contents(), c = r.prop("contentWindow"), d = s.find("head"), u = t(["<style>", "*{margin: 0; padding: 0;}", "body{padding: 10px; line-height: 20px; overflow-x: hidden; word-wrap: break-word; font: 14px Helvetica Neue,Helvetica,PingFang SC,Microsoft YaHei,Tahoma,Arial,sans-serif; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}", "a{color:#01AAED; text-decoration:none;}a:hover{color:#c00}", "p{margin-bottom: 10px;}", "img{display: inline-block; border: none; vertical-align: middle;}", "pre{margin: 10px 0; padding: 10px; line-height: 20px; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}", "</style>"].join("")), h = s.find("body"); d.append(u), h.attr("contenteditable", "true").css({ "min-height": n.height }).html(i.value || ""), hotkey.apply(o, [c, r, i, n]), toolActive.call(o, c, e, n) })) }, getWin = function (e) { var i = t("#LAY_layedit_" + e); return [i.prop("contentWindow"), i] }, toLower = function (e) { return 8 == o.ie && (e = e.replace(/<.+>/g, (function (e) { return e.toLowerCase() }))), e }, hotkey = function (e, n, r, s) { var c = e.document, d = t(c.body); d.on("keydown", (function (e) { if (13 === e.keyCode) { var t = Range(c); if ("pre" === getContainer(t).parentNode.tagName.toLowerCase()) { if (e.shiftKey) return; return i.msg("请暂时用shift+enter"), !1 } c.execCommand("formatBlock", !1, "<p>") } })), t(r).parents("form").on("submit", (function () { var e = d.html(); 8 == o.ie && (e = e.replace(/<.+>/g, (function (e) { return e.toLowerCase() }))), r.value = e })), d.on("paste", (function (t) { c.execCommand("formatBlock", !1, "<p>"), setTimeout((function () { filter.call(e, d), r.value = d.html() }), 100) })) }, filter = function (e) { this.document; e.find("*[style]").each((function () { var e = this.style.textAlign; this.removeAttribute("style"), t(this).css({ "text-align": e || "" }) })), e.find("table").addClass("layui-table"), e.find("script,link").remove() }, Range = function (e) { return e.selection ? e.selection.createRange() : e.getSelection().getRangeAt(0) }, getContainer = function (e) { return e.endContainer || e.parentElement().childNodes[0] }, insertInline = function (e, i, n) { var o = this.document, r = document.createElement(e); for (var s in i) r.setAttribute(s, i[s]); if (r.removeAttribute("text"), o.selection) { var c = n.text || i.text; if ("a" === e && !c) return; c && (r.innerHTML = c), n.pasteHTML(t(r).prop("outerHTML")), n.select() } else { c = n.toString() || i.text; if ("a" === e && !c) return; c && (r.innerHTML = c), n.deleteContents(), n.insertNode(r) } }, toolCheck = function (e, i) { var n = this.document, o = "layedit-tool-active", s = getContainer(Range(n)), item = function (t) { return e.find(".layedit-tool-" + t) }; i && i[i.hasClass(o) ? "removeClass" : "addClass"](o), e.find(">i").removeClass(o), item("unlink").addClass(r), t(s).parents().each((function () { var e = this.tagName.toLowerCase(), t = this.style.textAlign; "b" !== e && "strong" !== e || item("b").addClass(o), "i" !== e && "em" !== e || item("i").addClass(o), "u" === e && item("u").addClass(o), "strike" === e && item("d").addClass(o), "p" === e && ("center" === t ? item("center").addClass(o) : "right" === t ? item("right").addClass(o) : item("left").addClass(o)), "a" === e && (item("link").addClass(o), item("unlink").removeClass(r)) })) }, toolActive = function (e, n, o) { var s = e.document, c = t(s.body), d = { link: function (i) { var n = getContainer(i), o = t(n).parent(); link.call(c, { href: o.attr("href"), target: o.attr("target") }, (function (t) { var n = o[0]; "A" === n.tagName ? n.href = t.url : insertInline.call(e, "a", { target: t.target, href: t.url, text: t.url }, i) })) }, unlink: function (e) { s.execCommand("unlink") }, face: function (t) { face.call(this, (function (i) { insertInline.call(e, "img", { src: i.src, alt: i.alt }, t) })) }, image: function (n) { var r = this; layui.use("upload", (function (s) { var c = o.uploadImage || {}; s.render({ url: c.url, method: c.type, elem: t(r).find("input")[0], done: function (t) { 0 == t.code ? (t.data = t.data || {}, insertInline.call(e, "img", { src: t.data.src, alt: t.data.title }, n)) : i.msg(t.msg || "上传失败") } }) })) }, code: function (t) { code.call(c, (function (i) { insertInline.call(e, "pre", { text: i.code, "lay-lang": i.lang }, t) })) }, help: function () { i.open({ type: 2, title: "帮助", area: ["600px", "380px"], shadeClose: !0, shade: .1, skin: "layui-layer-msg", content: ["http://www.layui.com/about/layedit/help.html", "no"] }) } }, u = n.find(".layui-layedit-tool"), click = function () { var i = t(this), n = i.attr("layedit-event"), o = i.attr("lay-command"); if (!i.hasClass(r)) { c.focus(); var h = Range(s); h.commonAncestorContainer; o ? (s.execCommand(o), /justifyLeft|justifyCenter|justifyRight/.test(o) && s.execCommand("formatBlock", !1, "<p>"), setTimeout((function () { c.focus() }), 10)) : d[n] && d[n].call(this, h), toolCheck.call(e, u, i) } }, h = /image/; u.find(">i").on("mousedown", (function () { var e = t(this).attr("layedit-event"); h.test(e) || click.call(this) })).on("click", (function () { var e = t(this).attr("layedit-event"); h.test(e) && click.call(this) })), c.on("click", (function () { toolCheck.call(e, u), i.close(face.index) })) }, link = function (e, t) { var o = this, r = i.open({ type: 1, id: "LAY_layedit_link", area: "350px", shade: .05, shadeClose: !0, moveType: 1, title: "超链接", skin: "layui-layer-msg", content: ['<ul class="layui-form" style="margin: 15px;">', '<li class="layui-form-item">', '<label class="layui-form-label" style="width: 60px;">URL</label>', '<div class="layui-input-block" style="margin-left: 90px">', '<input name="url" lay-verify="url" value="' + (e.href || "") + '" autofocus="true" autocomplete="off" class="layui-input">', "</div>", "</li>", '<li class="layui-form-item">', '<label class="layui-form-label" style="width: 60px;">打开方式</label>', '<div class="layui-input-block" style="margin-left: 90px">', '<input type="radio" name="target" value="_self" class="layui-input" title="当前窗口"' + ("_self" !== e.target && e.target ? "" : "checked") + ">", '<input type="radio" name="target" value="_blank" class="layui-input" title="新窗口" ' + ("_blank" === e.target ? "checked" : "") + ">", "</div>", "</li>", '<li class="layui-form-item" style="text-align: center;">', '<button type="button" lay-submit lay-filter="layedit-link-yes" class="layui-btn"> 确定 </button>', '<button style="margin-left: 20px;" type="button" class="layui-btn layui-btn-primary"> 取消 </button>', "</li>", "</ul>"].join(""), success: function (e, r) { n.render("radio"), e.find(".layui-btn-primary").on("click", (function () { i.close(r), o.focus() })), n.on("submit(layedit-link-yes)", (function (e) { i.close(link.index), t && t(e.field) })) } }); link.index = r }, face = function (e) { var n, o, r = (n = {}, layui.each(["[微笑]", "[嘻嘻]", "[哈哈]", "[可爱]", "[可怜]", "[挖鼻]", "[吃惊]", "[害羞]", "[挤眼]", "[闭嘴]", "[鄙视]", "[爱你]", "[泪]", "[偷笑]", "[亲亲]", "[生病]", "[太开心]", "[白眼]", "[右哼哼]", "[左哼哼]", "[嘘]", "[衰]", "[委屈]", "[吐]", "[哈欠]", "[抱抱]", "[怒]", "[疑问]", "[馋嘴]", "[拜拜]", "[思考]", "[汗]", "[困]", "[睡]", "[钱]", "[失望]", "[酷]", "[色]", "[哼]", "[鼓掌]", "[晕]", "[悲伤]", "[抓狂]", "[黑线]", "[阴险]", "[怒骂]", "[互粉]", "[心]", "[伤心]", "[猪头]", "[熊猫]", "[兔子]", "[ok]", "[耶]", "[good]", "[NO]", "[赞]", "[来]", "[弱]", "[草泥马]", "[神马]", "[囧]", "[浮云]", "[给力]", "[围观]", "[威武]", "[奥特曼]", "[礼物]", "[钟]", "[话筒]", "[蜡烛]", "[蛋糕]"], (function (e, t) { n[t] = layui.cache.dir + "images/face/" + e + ".gif" })), n); return face.hide = face.hide || function (e) { "face" !== t(e.target).attr("layedit-event") && i.close(face.index) }, face.index = i.tips((o = [], layui.each(r, (function (e, t) { o.push('<li title="' + e + '"><img src="' + t + '" alt="' + e + '"></li>') })), '<ul class="layui-clear">' + o.join("") + "</ul>"), this, { tips: 1, time: 0, skin: "layui-box layui-util-face", maxWidth: 500, success: function (n, o) { n.css({ marginTop: -4, marginLeft: -10 }).find(".layui-clear>li").on("click", (function () { e && e({ src: r[this.title], alt: this.title }), i.close(o) })), t(document).off("click", face.hide).on("click", face.hide) } }) }, code = function (e) { var t = this, o = i.open({ type: 1, id: "LAY_layedit_code", area: "550px", shade: .05, shadeClose: !0, moveType: 1, title: "插入代码", skin: "layui-layer-msg", content: ['<ul class="layui-form layui-form-pane" style="margin: 15px;">', '<li class="layui-form-item">', '<label class="layui-form-label">请选择语言</label>', '<div class="layui-input-block">', '<select name="lang">', '<option value="JavaScript">JavaScript</option>', '<option value="HTML">HTML</option>', '<option value="CSS">CSS</option>', '<option value="Java">Java</option>', '<option value="PHP">PHP</option>', '<option value="C#">C#</option>', '<option value="Python">Python</option>', '<option value="Ruby">Ruby</option>', '<option value="Go">Go</option>', "</select>", "</div>", "</li>", '<li class="layui-form-item layui-form-text">', '<label class="layui-form-label">代码</label>', '<div class="layui-input-block">', '<textarea name="code" lay-verify="required" autofocus="true" class="layui-textarea" style="height: 200px;"></textarea>', "</div>", "</li>", '<li class="layui-form-item" style="text-align: center;">', '<button type="button" lay-submit lay-filter="layedit-code-yes" class="layui-btn"> 确定 </button>', '<button style="margin-left: 20px;" type="button" class="layui-btn layui-btn-primary"> 取消 </button>', "</li>", "</ul>"].join(""), success: function (o, r) { n.render("select"), o.find(".layui-btn-primary").on("click", (function () { i.close(r), t.focus() })), n.on("submit(layedit-code-yes)", (function (t) { i.close(code.index), e && e(t.field) })) } }); code.index = o }, s = { html: '<i class="layui-icon layedit-tool-html" title="HTML源代码" lay-command="html" layedit-event="html""></i><span class="layedit-tool-mid"></span>', strong: '<i class="layui-icon layedit-tool-b" title="加粗" lay-command="Bold" layedit-event="b""></i>', italic: '<i class="layui-icon layedit-tool-i" title="斜体" lay-command="italic" layedit-event="i""></i>', underline: '<i class="layui-icon layedit-tool-u" title="下划线" lay-command="underline" layedit-event="u""></i>', del: '<i class="layui-icon layedit-tool-d" title="删除线" lay-command="strikeThrough" layedit-event="d""></i>', "|": '<span class="layedit-tool-mid"></span>', left: '<i class="layui-icon layedit-tool-left" title="左对齐" lay-command="justifyLeft" layedit-event="left""></i>', center: '<i class="layui-icon layedit-tool-center" title="居中对齐" lay-command="justifyCenter" layedit-event="center""></i>', right: '<i class="layui-icon layedit-tool-right" title="右对齐" lay-command="justifyRight" layedit-event="right""></i>', link: '<i class="layui-icon layedit-tool-link" title="插入链接" layedit-event="link""></i>', unlink: '<i class="layui-icon layedit-tool-unlink layui-disabled" title="清除链接" lay-command="unlink" layedit-event="unlink""></i>', face: '<i class="layui-icon layedit-tool-face" title="表情" layedit-event="face""></i>', image: '<i class="layui-icon layedit-tool-image" title="图片" layedit-event="image"><input type="file" name="file"></i>', code: '<i class="layui-icon layedit-tool-code" title="插入代码" layedit-event="code"></i>', help: '<i class="layui-icon layedit-tool-help" title="帮助" layedit-event="help"></i>' }; e("layedit", new Edit) }))
|
||
}, function (e, t, i) {
|
||
var n, o;
|
||
/**
|
||
|
||
@Name:layer v3.1.2 Web弹层组件
|
||
@Author:贤心
|
||
@Site:http://layer.layui.com
|
||
@License:MIT
|
||
|
||
*/!function (r, s) { "use strict"; var c, d, u, h, p = r.layui && layui.define, y = { getPath: (u = document.currentScript ? document.currentScript.src : function () { for (var e, t = document.scripts, i = t.length - 1, n = i; n > 0; n--)if ("interactive" === t[n].readyState) { e = t[n].src; break } return e || t[i].src }(), u.substring(0, u.lastIndexOf("/") + 1)), config: {}, end: {}, minIndex: 0, minLeft: [], btn: ["确定", "取消"], type: ["dialog", "page", "iframe", "loading", "tips"], getStyle: function (e, t) { var i = e.currentStyle ? e.currentStyle : r.getComputedStyle(e, null); return i[i.getPropertyValue ? "getPropertyValue" : "getAttribute"](t) }, link: function (e, t, i) { if (m.path) { var n = document.getElementsByTagName("head")[0], o = document.createElement("link"); "string" == typeof t && (i = t); var s = "layuicss-" + (i || e).replace(/\.|\//g, ""), c = 0; o.rel = "stylesheet", o.href = m.path + e, o.id = s, document.getElementById(s) || n.appendChild(o), "function" == typeof t && function poll() { if (++c > 80) return r.console && void 0; 1989 === parseInt(y.getStyle(document.getElementById(s), "width")) ? t() : setTimeout(poll, 100) }() } } }, m = { v: "3.1.1", ie: (h = navigator.userAgent.toLowerCase(), !(!r.ActiveXObject && !("ActiveXObject" in r)) && ((h.match(/msie\s(\d+)/) || [])[1] || "11")), index: r.layer && r.layer.v ? 1e5 : 0, path: y.getPath, config: function (e, t) { return e = e || {}, m.cache = y.config = c.extend({}, y.config, e), m.path = y.config.path || m.path, "string" == typeof e.extend && (e.extend = [e.extend]), y.config.path && m.ready(), e.extend ? (p ? layui.addcss("modules/layer/" + e.extend) : y.link("theme/" + e.extend), this) : this }, ready: function (e) { var t = (p ? "modules/layer/" : "theme/") + "default/layer.css?v=" + m.v; return p ? layui.addcss(t, e, "layer") : y.link(t, e, "layer"), this }, alert: function (e, t, i) { var n = "function" == typeof t; return n && (i = t), m.open(c.extend({ content: e, yes: i }, n ? {} : t)) }, confirm: function (e, t, i, n) { var o = "function" == typeof t; return o && (n = i, i = t), m.open(c.extend({ content: e, btn: y.btn, yes: i, btn2: n }, o ? {} : t)) }, msg: function (e, t, i) { var n = "function" == typeof t, o = y.config.skin, r = (o ? o + " " + o + "-msg" : "") || "layui-layer-msg", s = g.anim.length - 1; return n && (i = t), m.open(c.extend({ content: e, time: 3e3, shade: !1, skin: r, title: !1, closeBtn: !1, btn: !1, resize: !1, end: i }, n && !y.config.skin ? { skin: r + " layui-layer-hui", anim: s } : ((-1 === (t = t || {}).icon || void 0 === t.icon && !y.config.skin) && (t.skin = r + " " + (t.skin || "layui-layer-hui")), t))) }, load: function (e, t) { return m.open(c.extend({ type: 3, icon: e || 0, resize: !1, shade: .01 }, t)) }, tips: function (e, t, i) { return m.open(c.extend({ type: 4, content: [e, t], closeBtn: !1, time: 3e3, shade: !1, resize: !1, fixed: !1, maxWidth: 210 }, i)) } }, Class = function (e) { var t = this; t.index = ++m.index, t.config = c.extend({}, t.config, y.config, e), document.body ? t.creat() : setTimeout((function () { t.creat() }), 30) }; Class.pt = Class.prototype; var g = ["layui-layer", ".layui-layer-title", ".layui-layer-main", ".layui-layer-dialog", "layui-layer-iframe", "layui-layer-content", "layui-layer-btn", "layui-layer-close"]; g.anim = ["layer-anim-00", "layer-anim-01", "layer-anim-02", "layer-anim-03", "layer-anim-04", "layer-anim-05", "layer-anim-06"], Class.pt.config = { type: 0, shade: .3, fixed: !0, move: g[1], title: "信息", offset: "auto", area: "auto", closeBtn: 1, time: 0, zIndex: 19891014, maxWidth: 360, anim: 0, isOutAnim: !0, icon: -1, moveType: 1, resize: !0, scrollbar: !0, tips: 2 }, Class.pt.vessel = function (e, t) { var i, n = this.index, o = this.config, r = o.zIndex + n, s = "object" == typeof o.title, d = o.maxmin && (1 === o.type || 2 === o.type), u = o.title ? '<div class="layui-layer-title" style="' + (s ? o.title[1] : "") + '">' + (s ? o.title[0] : o.title) + "</div>" : ""; return o.zIndex = r, t([o.shade ? '<div class="layui-layer-shade" id="layui-layer-shade' + n + '" times="' + n + '" style="z-index:' + (r - 1) + '; "></div>' : "", '<div class="' + g[0] + " layui-layer-" + y.type[o.type] + (0 != o.type && 2 != o.type || o.shade ? "" : " layui-layer-border") + " " + (o.skin || "") + '" id="' + g[0] + n + '" type="' + y.type[o.type] + '" times="' + n + '" showtime="' + o.time + '" conType="' + (e ? "object" : "string") + '" style="z-index: ' + r + "; width:" + o.area[0] + ";height:" + o.area[1] + (o.fixed ? "" : ";position:absolute;") + '">' + (e && 2 != o.type ? "" : u) + '<div id="' + (o.id || "") + '" class="layui-layer-content' + (0 == o.type && -1 !== o.icon ? " layui-layer-padding" : "") + (3 == o.type ? " layui-layer-loading" + o.icon : "") + '">' + (0 == o.type && -1 !== o.icon ? '<i class="layui-layer-ico layui-layer-ico' + o.icon + '"></i>' : "") + (1 == o.type && e ? "" : o.content || "") + '</div><span class="layui-layer-setwin">' + (i = d ? '<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>' : "", o.closeBtn && (i += '<a class="layui-layer-ico ' + g[7] + " " + g[7] + (o.title ? o.closeBtn : 4 == o.type ? "1" : "2") + '" href="javascript:;"></a>'), i + "</span>") + (o.btn ? function () { var e = ""; "string" == typeof o.btn && (o.btn = [o.btn]); for (var t = 0, i = o.btn.length; t < i; t++)e += '<a class="' + g[6] + t + '">' + o.btn[t] + "</a>"; return '<div class="' + g[6] + " layui-layer-btn-" + (o.btnAlign || "") + '">' + e + "</div>" }() : "") + (o.resize ? '<span class="layui-layer-resize"></span>' : "") + "</div>"], u, c('<div class="layui-layer-move"></div>')), this }, Class.pt.creat = function () { var e = this, t = e.config, i = e.index, n = t.content, o = "object" == typeof n, r = c("body"), s = t.content; if (!t.id || !c("#" + t.id)[0]) { switch ("string" == typeof t.area && (t.area = "auto" === t.area ? ["", ""] : [t.area, ""]), t.shift && (t.anim = t.shift), 6 == m.ie && (t.fixed = !1), t.type) { case 0: t.btn = "btn" in t ? t.btn : y.btn[0], m.closeAll("dialog"); break; case 2: var u = null == t.method || "get" == t.method && null == t.params ? t.content : ""; t.content = '<iframe scrolling="' + (t.content[1] || "auto") + '" allowtransparency="true" id="' + g[4] + i + '" name="' + g[4] + i + '" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="' + u + '"></iframe>'; break; case 3: delete t.title, delete t.closeBtn, -1 === t.icon && t.icon, m.closeAll("loading"); break; case 4: o || (t.content = [t.content, "body"]), t.follow = t.content[1], t.content = t.content[0] + '<i class="layui-layer-TipsG"></i>', delete t.title, t.tips = "object" == typeof t.tips ? t.tips : [t.tips, !0], t.tipsMore || m.closeAll("tips") }if (e.vessel(o, (function (d, u, h) { if (r.append(d[0]), o ? 2 == t.type || 4 == t.type ? c("body").append(d[1]) : n.parents("." + g[0])[0] || (n.data("display", n.css("display")).show().addClass("layui-layer-wrap").wrap(d[1]), c("#" + g[0] + i).find("." + g[5]).before(u)) : r.append(d[1]), null != t.params || null != t.method && "get" != t.method) { var p, m = t.params, b = g[4] + "" + i, k = c("#" + t.id), w = t.method ? t.method : "get", C = c("<form id='" + b + "' name='" + b + "' action='' target='" + b + "' method='" + w + "'/>"); if (!s) return; if (C.appendTo(k), m) for (var D in C.html(""), m) (p = c("<input type='hidden' name='" + D + "' />")).val(m[D]), p.appendTo(C); C.attr("action", s), c("body").append(C), C.submit(), C.remove() } c(".layui-layer-move")[0] || r.append(y.moveElem = h), e.layero = c("#" + g[0] + i), t.scrollbar || g.html.css("overflow", "hidden").attr("layer-full", i) })).auto(i), c("#layui-layer-shade" + e.index).css({ "background-color": t.shade[1] || "#000", opacity: t.shade[0] || t.shade }), 2 == t.type && 6 == m.ie && e.layero.find("iframe").attr("src", n[0]), 4 == t.type ? e.tips() : e.offset(), t.fixed && d.on("resize", (function () { e.offset(), (/^\d+%$/.test(t.area[0]) || /^\d+%$/.test(t.area[1])) && e.auto(i), 4 == t.type && e.tips() })), g.anim[t.anim]) { var h = "layer-anim " + g.anim[t.anim]; e.layero.addClass(h).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", (function () { c(this).removeClass(h) })) } t.time <= 0 || setTimeout((function () { m.close(e.index) }), t.time), e.move().callback(), t.isOutAnim && e.layero.data("isOutAnim", !0) } }, Class.pt.auto = function (e) { var t = this.config, i = c("#" + g[0] + e); "" === t.area[0] && t.maxWidth > 0 && (m.ie && m.ie < 8 && t.btn && i.width(i.innerWidth()), i.outerWidth() > t.maxWidth && i.width(t.maxWidth)); var n = [i.innerWidth(), i.innerHeight()], o = i.find(g[1]).outerHeight() || 0, r = i.find("." + g[6]).outerHeight() || 0, setHeight = function (e) { (e = i.find(e)).height(n[1] - o - r - 2 * (0 | parseFloat(e.css("padding-top")))) }; switch (t.type) { case 2: setHeight("iframe"); break; default: "" === t.area[1] ? t.maxHeight > 0 && i.outerHeight() > t.maxHeight ? (n[1] = t.maxHeight, setHeight("." + g[5])) : t.fixed && n[1] >= d.height() && (n[1] = d.height(), setHeight("." + g[5])) : setHeight("." + g[5]) }return this }, Class.pt.offset = function () { var e = this.config, t = this.layero, i = [t.outerWidth(), t.outerHeight()], n = "object" == typeof e.offset; this.offsetTop = (d.height() - i[1]) / 2, this.offsetLeft = (d.width() - i[0]) / 2, n ? (this.offsetTop = e.offset[0], this.offsetLeft = e.offset[1] || this.offsetLeft) : "auto" !== e.offset && ("t" === e.offset ? this.offsetTop = 0 : "r" === e.offset ? this.offsetLeft = d.width() - i[0] : "b" === e.offset ? this.offsetTop = d.height() - i[1] : "l" === e.offset ? this.offsetLeft = 0 : "lt" === e.offset ? (this.offsetTop = 0, this.offsetLeft = 0) : "lb" === e.offset ? (this.offsetTop = d.height() - i[1], this.offsetLeft = 0) : "rt" === e.offset ? (this.offsetTop = 0, this.offsetLeft = d.width() - i[0]) : "rb" === e.offset ? (this.offsetTop = d.height() - i[1], this.offsetLeft = d.width() - i[0]) : this.offsetTop = e.offset), e.fixed || (this.offsetTop = /%$/.test(this.offsetTop) ? d.height() * parseFloat(this.offsetTop) / 100 : parseFloat(this.offsetTop), this.offsetLeft = /%$/.test(this.offsetLeft) ? d.width() * parseFloat(this.offsetLeft) / 100 : parseFloat(this.offsetLeft), this.offsetTop += d.scrollTop(), this.offsetLeft += d.scrollLeft()), t.attr("minLeft") && (this.offsetTop = d.height() - (t.find(g[1]).outerHeight() || 0), this.offsetLeft = t.css("left")), t.css({ top: this.offsetTop, left: this.offsetLeft }) }, Class.pt.tips = function () { var e = this.config, t = this.layero, i = [t.outerWidth(), t.outerHeight()], n = c(e.follow); n[0] || (n = c("body")); var o = { width: n.outerWidth(), height: n.outerHeight(), top: n.offset().top, left: n.offset().left }, r = t.find(".layui-layer-TipsG"), s = e.tips[0]; e.tips[1] || r.remove(), o.autoLeft = function () { o.left + i[0] - d.width() > 0 ? (o.tipLeft = o.left + o.width - i[0], r.css({ right: 12, left: "auto" })) : o.tipLeft = o.left }, o.where = [function () { o.autoLeft(), o.tipTop = o.top - i[1] - 10, r.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color", e.tips[1]) }, function () { o.tipLeft = o.left + o.width + 10, o.tipTop = o.top, r.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color", e.tips[1]) }, function () { o.autoLeft(), o.tipTop = o.top + o.height + 10, r.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color", e.tips[1]) }, function () { o.tipLeft = o.left - i[0] - 10, o.tipTop = o.top, r.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color", e.tips[1]) }], o.where[s - 1](), 1 === s ? o.top - (d.scrollTop() + i[1] + 16) < 0 && o.where[2]() : 2 === s ? d.width() - (o.left + o.width + i[0] + 16) > 0 || o.where[3]() : 3 === s ? o.top - d.scrollTop() + o.height + i[1] + 16 - d.height() > 0 && o.where[0]() : 4 === s && i[0] + 16 - o.left > 0 && o.where[1](), t.find("." + g[5]).css({ "background-color": e.tips[1], "padding-right": e.closeBtn ? "30px" : "" }), t.css({ left: o.tipLeft - (e.fixed ? d.scrollLeft() : 0), top: o.tipTop - (e.fixed ? d.scrollTop() : 0) }) }, Class.pt.move = function () { var e = this, t = e.config, i = c(document), n = e.layero, o = n.find(t.move), r = n.find(".layui-layer-resize"), s = {}; return t.move && o.css("cursor", "move"), o.on("mousedown", (function (e) { e.preventDefault(), t.move && (s.moveStart = !0, s.offset = [e.clientX - parseFloat(n.css("left")), e.clientY - parseFloat(n.css("top"))], y.moveElem.css("cursor", "move").show()) })), r.on("mousedown", (function (e) { e.preventDefault(), s.resizeStart = !0, s.offset = [e.clientX, e.clientY], s.area = [n.outerWidth(), n.outerHeight()], y.moveElem.css("cursor", "se-resize").show() })), i.on("mousemove", (function (i) { if (s.moveStart) { var o = i.clientX - s.offset[0], r = i.clientY - s.offset[1], c = "fixed" === n.css("position"); if (i.preventDefault(), s.stX = c ? 0 : d.scrollLeft(), s.stY = c ? 0 : d.scrollTop(), !t.moveOut) { var u = d.width() - n.outerWidth() + s.stX, h = d.height() - n.outerHeight() + s.stY; o < s.stX && (o = s.stX), o > u && (o = u), r < s.stY && (r = s.stY), r > h && (r = h) } n.css({ left: o, top: r }) } if (t.resize && s.resizeStart) { o = i.clientX - s.offset[0], r = i.clientY - s.offset[1]; i.preventDefault(), m.style(e.index, { width: s.area[0] + o, height: s.area[1] + r }), s.isResize = !0, t.resizing && t.resizing(n) } })).on("mouseup", (function (e) { s.moveStart && (delete s.moveStart, y.moveElem.hide(), t.moveEnd && t.moveEnd(n)), s.resizeStart && (delete s.resizeStart, y.moveElem.hide()) })), e }, Class.pt.callback = function () { var e = this, t = e.layero, i = e.config; e.openLayer(), i.success && (2 == i.type ? t.find("iframe").on("load", (function () { i.success(t, e.index) })) : i.success(t, e.index)), 6 == m.ie && e.IE6(t), 0 == i.type && (document.onkeydown = function (n) { var o = document.all ? r.event : n; if (27 == o.keyCode) !1 === (i.cancel && i.cancel(e.index, t)) || m.close(e.index); else if (13 == o.keyCode) { if ("TEXTAREA" != o.target.tagName.toUpperCase()) return t.find("." + g[6]).children("a").click(), !1 } }), t.find("." + g[6]).children("a").on("click", (function () { var n = c(this).index(); 0 === n ? i.yes ? i.yes(e.index, t) : i.btn1 ? i.btn1(e.index, t) : m.close(e.index) : !1 === (i["btn" + (n + 1)] && i["btn" + (n + 1)](e.index, t)) || m.close(e.index) })), t.find("." + g[7]).on("click", (function cancel() { !1 === (i.cancel && i.cancel(e.index, t)) || m.close(e.index) })), i.shadeClose && c("#layui-layer-shade" + e.index).on("click", (function () { m.close(e.index) })), t.find(".layui-layer-min").on("click", (function () { !1 === (i.min && i.min(t)) || m.min(e.index, i) })), t.find(".layui-layer-max").on("click", (function () { c(this).hasClass("layui-layer-maxmin") ? (m.restore(e.index), i.restore && i.restore(t)) : (m.full(e.index, i), setTimeout((function () { i.full && i.full(t) }), 100)) })), i.end && (y.end[e.index] = i.end) }, y.reselect = function () { c.each(c("select"), (function (e, t) { var i = c(this); i.parents("." + g[0])[0] || 1 == i.attr("layer") && c("." + g[0]).length < 1 && i.removeAttr("layer").show(), i = null })) }, Class.pt.IE6 = function (e) { c("select").each((function (e, t) { var i = c(this); i.parents("." + g[0])[0] || "none" === i.css("display") || i.attr({ layer: "1" }).hide(), i = null })) }, Class.pt.openLayer = function () { m.zIndex = this.config.zIndex, m.setTop = function (e) { return m.zIndex = parseInt(e[0].style.zIndex), e.on("mousedown", (function () { m.zIndex++, e.css("z-index", m.zIndex + 1) })), m.zIndex } }, y.record = function (e) { var t = [e.width(), e.height(), e.position().top, e.position().left + parseFloat(e.css("margin-left"))]; e.find(".layui-layer-max").addClass("layui-layer-maxmin"), e.attr({ area: t }) }, y.rescollbar = function (e) { g.html.attr("layer-full") == e && (g.html[0].style.removeProperty ? g.html[0].style.removeProperty("overflow") : g.html[0].style.removeAttribute("overflow"), g.html.removeAttr("layer-full")) }, r.layer = m, m.getChildFrame = function (e, t) { return t = t || c("." + g[4]).attr("times"), c("#" + g[0] + t).find("iframe").contents().find(e) }, m.getFrameIndex = function (e) { return c("#" + e).parents("." + g[4]).attr("times") }, m.iframeAuto = function (e) { if (e) { var t = m.getChildFrame("html", e).outerHeight(), i = c("#" + g[0] + e), n = i.find(g[1]).outerHeight() || 0, o = i.find("." + g[6]).outerHeight() || 0; i.css({ height: t + n + o }), i.find("iframe").css({ height: t }) } }, m.iframeSrc = function (e, t) { c("#" + g[0] + e).find("iframe").attr("src", t) }, m.style = function (e, t, i) { var n = c("#" + g[0] + e), o = n.find(".layui-layer-content"), r = n.attr("type"), s = n.find(g[1]).outerHeight() || 0, d = n.find("." + g[6]).outerHeight() || 0; n.attr("minLeft"); r !== y.type[3] && r !== y.type[4] && (i || (parseFloat(t.width) <= 260 && (t.width = 260), parseFloat(t.height) - s - d <= 64 && (t.height = 64 + s + d)), n.css(t), d = n.find("." + g[6]).outerHeight(), r === y.type[2] ? n.find("iframe").css({ height: parseFloat(t.height) - s - d }) : o.css({ height: parseFloat(t.height) - s - d - parseFloat(o.css("padding-top")) - parseFloat(o.css("padding-bottom")) })) }, m.min = function (e, t) { var i = c("#" + g[0] + e), n = i.find(g[1]).outerHeight() || 0, o = i.attr("minLeft") || 181 * y.minIndex + "px", r = i.css("position"); y.record(i), y.minLeft[0] && (o = y.minLeft[0], y.minLeft.shift()), i.attr("position", r), m.style(e, { width: 180, height: n, left: o, top: d.height() - n, position: "fixed", overflow: "hidden" }, !0), i.find(".layui-layer-min").hide(), "page" === i.attr("type") && i.find(g[4]).hide(), y.rescollbar(e), i.attr("minLeft") || y.minIndex++, i.attr("minLeft", o) }, m.restore = function (e) { var t = c("#" + g[0] + e), i = t.attr("area").split(","); t.attr("type"); m.style(e, { width: parseFloat(i[0]), height: parseFloat(i[1]), top: parseFloat(i[2]), left: parseFloat(i[3]), position: t.attr("position"), overflow: "visible" }, !0), t.find(".layui-layer-max").removeClass("layui-layer-maxmin"), t.find(".layui-layer-min").show(), "page" === t.attr("type") && t.find(g[4]).show(), y.rescollbar(e) }, m.full = function (e) { var t, i = c("#" + g[0] + e); y.record(i), g.html.attr("layer-full") || g.html.css("overflow", "hidden").attr("layer-full", e), clearTimeout(t), t = setTimeout((function () { var t = "fixed" === i.css("position"); m.style(e, { top: t ? 0 : d.scrollTop(), left: t ? 0 : d.scrollLeft(), width: d.width(), height: d.height() }, !0), i.find(".layui-layer-min").hide() }), 100) }, m.title = function (e, t) { c("#" + g[0] + (t || m.index)).find(g[1]).html(e) }, m.close = function (e) { var t = c("#" + g[0] + e), i = t.attr("type"); if (t[0]) { var n = "layui-layer-wrap", remove = function () { if (i === y.type[1] && "object" === t.attr("conType")) { t.children(":not(." + g[5] + ")").remove(); for (var o = t.find("." + n), r = 0; r < 2; r++)o.unwrap(); o.css("display", o.data("display")).removeClass(n) } else { if (i === y.type[2]) try { var s = c("#" + g[4] + e)[0]; s.contentWindow.document.write(""), s.contentWindow.close(), t.find("." + g[5])[0].removeChild(s) } catch (e) { } t[0].innerHTML = "", t.remove() } "function" == typeof y.end[e] && y.end[e](), delete y.end[e] }; t.data("isOutAnim") && t.addClass("layer-anim layer-anim-close"), c("#layui-layer-moves, #layui-layer-shade" + e).remove(), 6 == m.ie && y.reselect(), y.rescollbar(e), t.attr("minLeft") && (y.minIndex--, y.minLeft.push(t.attr("minLeft"))), m.ie && m.ie < 10 || !t.data("isOutAnim") ? remove() : setTimeout((function () { remove() }), 200) } }, m.closeAll = function (e) { c.each(c("." + g[0]), (function () { var t = c(this), i = e ? t.attr("type") === e : 1; i && m.close(t.attr("times")), i = null })) }; var b = m.cache || {}, skin = function (e) { return b.skin ? " " + b.skin + " " + b.skin + "-" + e : "" }; m.prompt = function (e, t) { var i = ""; if ("function" == typeof (e = e || {}) && (t = e), e.area) { var n = e.area; i = 'style="width: ' + n[0] + "; height: " + n[1] + ';"', delete e.area } var o, r = 2 == e.formType ? '<textarea class="layui-layer-input"' + i + "></textarea>" : '<input type="' + (1 == e.formType ? "password" : "text") + '" class="layui-layer-input">', s = e.success; return delete e.success, m.open(c.extend({ type: 1, btn: ["确定", "取消"], content: r, skin: "layui-layer-prompt" + skin("prompt"), maxWidth: d.width(), success: function (t) { (o = t.find(".layui-layer-input")).val(e.value || "").focus(), "function" == typeof s && s(t) }, resize: !1, yes: function (i) { var n = o.val(); "" === n ? o.focus() : n.length > (e.maxlength || 500) ? m.tips("最多输入" + (e.maxlength || 500) + "个字数", o, { tips: 1 }) : t && t(n, i, o) } }, e)) }, m.tab = function (e) { var t = (e = e || {}).tab || {}, i = "layui-this", n = e.success; return delete e.success, m.open(c.extend({ type: 1, skin: "layui-layer-tab" + skin("tab"), resize: !1, title: function () { var e = t.length, n = 1, o = ""; if (e > 0) for (o = '<span class="' + i + '">' + t[0].title + "</span>"; n < e; n++)o += "<span>" + t[n].title + "</span>"; return o }(), content: '<ul class="layui-layer-tabmain">' + function () { var e = t.length, n = 1, o = ""; if (e > 0) for (o = '<li class="layui-layer-tabli ' + i + '">' + (t[0].content || "no content") + "</li>"; n < e; n++)o += '<li class="layui-layer-tabli">' + (t[n].content || "no content") + "</li>"; return o }() + "</ul>", success: function (t) { var o = t.find(".layui-layer-title").children(), r = t.find(".layui-layer-tabmain").children(); o.on("mousedown", (function (t) { t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0; var n = c(this), o = n.index(); n.addClass(i).siblings().removeClass(i), r.eq(o).show().siblings().hide(), "function" == typeof e.change && e.change(o) })), "function" == typeof n && n(t) } }, e)) }, m.photos = function (e, t, i) { var n = {}; if ((e = e || {}).photos) { var o = e.photos.constructor === Object, s = o ? e.photos : {}, d = s.data || [], u = s.start || 0; n.imgIndex = 1 + (0 | u), e.img = e.img || "img"; var h = e.success; if (delete e.success, o) { if (0 === d.length) return m.msg("没有图片") } else { var p = c(e.photos), pushData = function () { d = [], p.find(e.img).each((function (e) { var t = c(this); t.attr("layer-index", e), d.push({ alt: t.attr("alt"), pid: t.attr("layer-pid"), src: t.attr("layer-src") || t.attr("src"), thumb: t.attr("src") }) })) }; if (pushData(), 0 === d.length) return; if (t || p.on("click", e.img, (function () { var t = c(this).attr("layer-index"); m.photos(c.extend(e, { photos: { start: t, data: d, tab: e.tab }, full: e.full }), !0), pushData() })), !t) return } n.imgprev = function (e) { n.imgIndex--, n.imgIndex < 1 && (n.imgIndex = d.length), n.tabimg(e) }, n.imgnext = function (e, t) { n.imgIndex++, n.imgIndex > d.length && (n.imgIndex = 1, t) || n.tabimg(e) }, n.keyup = function (e) { if (!n.end) { var t = e.keyCode; e.preventDefault(), 37 === t ? n.imgprev(!0) : 39 === t ? n.imgnext(!0) : 27 === t && m.close(n.index) } }, n.tabimg = function (t) { if (!(d.length <= 1)) return s.start = n.imgIndex - 1, m.close(n.index), m.photos(e, !0, t) }, n.event = function () { n.bigimg.hover((function () { n.imgsee.show() }), (function () { n.imgsee.hide() })), n.bigimg.find(".layui-layer-imgprev").on("click", (function (e) { e.preventDefault(), n.imgprev() })), n.bigimg.find(".layui-layer-imgnext").on("click", (function (e) { e.preventDefault(), n.imgnext() })), c(document).on("keyup", n.keyup) }, n.loadi = m.load(1, { shade: !("shade" in e) && .9, scrollbar: !1 }), function loadImage(e, t, i) { var n = new Image; if (n.src = e, n.complete) return t(n); n.onload = function () { n.onload = null, t(n) }, n.onerror = function (e) { n.onerror = null, i(e) } }(d[u].src, (function (t) { m.close(n.loadi), n.index = m.open(c.extend({ type: 1, id: "layui-layer-photos", area: function () { var i = [t.width, t.height], n = [c(r).width() - 100, c(r).height() - 100]; if (!e.full && (i[0] > n[0] || i[1] > n[1])) { var o = [i[0] / n[0], i[1] / n[1]]; o[0] > o[1] ? (i[0] = i[0] / o[0], i[1] = i[1] / o[0]) : o[0] < o[1] && (i[0] = i[0] / o[1], i[1] = i[1] / o[1]) } return [i[0] + "px", i[1] + "px"] }(), title: !1, shade: .9, shadeClose: !0, closeBtn: !1, move: ".layui-layer-phimg img", moveType: 1, scrollbar: !1, moveOut: !0, isOutAnim: !1, skin: "layui-layer-photos" + skin("photos"), content: '<div class="layui-layer-phimg"><img src="' + d[u].src + '" alt="' + (d[u].alt || "") + '" layer-pid="' + d[u].pid + '"><div class="layui-layer-imgsee">' + (d.length > 1 ? '<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>' : "") + '<div class="layui-layer-imgbar" style="display:' + (i ? "block" : "") + '"><span class="layui-layer-imgtit"><a href="javascript:;">' + (d[u].alt || "") + "</a><em>" + n.imgIndex + "/" + d.length + "</em></span></div></div></div>", success: function (t, i) { n.bigimg = t.find(".layui-layer-phimg"), n.imgsee = t.find(".layui-layer-imguide,.layui-layer-imgbar"), n.event(t), e.tab && e.tab(d[u], t), "function" == typeof h && h(t) }, end: function () { n.end = !0, c(document).off("keyup", n.keyup) } }, e)) }), (function () { m.close(n.loadi), m.msg("当前图片地址异常<br>是否继续查看下一张?", { time: 3e4, btn: ["下一张", "不看了"], yes: function () { d.length > 1 && n.imgnext(!0, !0) } }) })) } }, y.run = function (e) { d = (c = e)(r), g.html = c("html"), m.open = function (e) { return new Class(e).index } }, r.layui && layui.define ? (m.ready(), layui.define("jquery", (function (e) { m.path = layui.cache.dir, y.run(layui.$), r.layer = m, e("layer", m) }))) : (n = [i(13)], void 0 === (o = function () { return y.run(r.jQuery), m }.apply(t, n)) || (e.exports = o)) }(window)
|
||
}, function (e, t) { e.exports = jQuery }, function (e, t) {
|
||
/**
|
||
|
||
@Name:layim v3.7.6 Pro 商用版
|
||
@Author:贤心
|
||
@Site:http://layim.layui.com
|
||
@License:LGPL
|
||
|
||
*/
|
||
layui.define(["layer", "laytpl", "upload"], (function (e) { var t = "3.7.6", i = layui.$, n = layui.layer, o = layui.laytpl, r = layui.device(), s = "layui-show", c = "layim-this", d = {}, LAYIM = function () { this.v = t, i("body").on("click", "*[layim-event]", (function (e) { var t = i(this), n = t.attr("layim-event"); F[n] && F[n].call(this, t, e) })) }; LAYIM.prototype.config = function (e) { var t = []; if (layui.each(Array(5), (function (e) { t.push(layui.cache.dir + "css/modules/layim/skin/" + (e + 1) + ".jpg") })), (e = e || {}).skin = e.skin || [], layui.each(e.skin, (function (e, i) { t.unshift(i) })), e.skin = t, e = i.extend({ isfriend: !0, isgroup: !0, voice: "default.mp3" }, e), window.JSON && window.JSON.parse) return init(e), this }, LAYIM.prototype.on = function (e, t) { return "function" == typeof t && (d[e] ? d[e].push(t) : d[e] = [t]), this }, LAYIM.prototype.cache = function () { return S }, LAYIM.prototype.chat = function (e) { if (window.JSON && window.JSON.parse) return popchat(e), this }, LAYIM.prototype.setChatMin = function () { return setChatMin(), this }, LAYIM.prototype.setChatStatus = function (e) { var t = thisChat(); if (t) return t.elem.find(".layim-chat-status").html(e), this }, LAYIM.prototype.getMessage = function (e) { return getMessage(e), this }, LAYIM.prototype.notice = function (e) { return notice(e), this }, LAYIM.prototype.add = function (e) { return popAdd(e), this }, LAYIM.prototype.setFriendGroup = function (e) { return popAdd(e, "setGroup"), this }, LAYIM.prototype.msgbox = function (e) { return msgbox(e), this }, LAYIM.prototype.addList = function (e) { return addList(e), this }, LAYIM.prototype.removeList = function (e) { return removeList(e), this }, LAYIM.prototype.setFriendStatus = function (e, t) { i(".layim-friend" + e)["online" === t ? "removeClass" : "addClass"]("layim-list-gray") }, LAYIM.prototype.content = function (e) { return layui.data.content(e) }; var listTpl = function (e) { return (e = e || {}).item = e.item || "d." + e.type, ["{{# var length = 0; layui.each(" + e.item + ", function(i, data){ length++; }}", '<li layim-event="chat" data-type="' + e.type + '" data-index="{{ ' + (e.index || "i") + ' }}" class="layim-' + ("history" === e.type ? "{{i}}" : e.type + "{{data.id}}") + ' {{ data.status === "offline" ? "layim-list-gray" : "" }}"><img src="{{ data.avatar }}"><span>{{ data.username||data.groupname||data.name||"佚名" }}</span><p>{{ data.remark||data.sign||"" }}</p><span class="layim-msg-status">new</span></li>', "{{# }); if(length === 0){ }}", '<li class="layim-null">' + ({ friend: "该分组下暂无好友", group: "暂无群组", history: "暂无历史会话" }[e.type] || "暂无数据") + "</li>", "{{# } }}"].join("") }, u = ['<div class="layui-layim-main">', '<div class="layui-layim-info">', '<div class="layui-layim-user">{{ d.mine.username }}</div>', '<div class="layui-layim-status">', '{{# if(d.mine.status === "online"){ }}', '<span class="layui-icon layim-status-online" layim-event="status" lay-type="show"></span>', '{{# } else if(d.mine.status === "hide") { }}', '<span class="layui-icon layim-status-hide" layim-event="status" lay-type="show"></span>', "{{# } }}", '<ul class="layui-anim layim-menu-box">', '<li {{d.mine.status === "online" ? "class=layim-this" : ""}} layim-event="status" lay-type="online"><i class="layui-icon"></i><cite class="layui-icon layim-status-online"></cite>在线</li>', '<li {{d.mine.status === "hide" ? "class=layim-this" : ""}} layim-event="status" lay-type="hide"><i class="layui-icon"></i><cite class="layui-icon layim-status-hide"></cite>隐身</li>', "</ul>", "</div>", '<input class="layui-layim-remark" placeholder="编辑签名" value="{{ d.mine.remark||d.mine.sign||"" }}">', "</div>", '<ul class="layui-unselect layui-layim-tab{{# if(!d.base.isfriend || !d.base.isgroup){ }}', " layim-tab-two", '{{# } }}">', '<li class="layui-icon', "{{# if(!d.base.isfriend){ }}", " layim-hide", "{{# } else { }}", " layim-this", "{{# } }}", '" title="联系人" layim-event="tab" lay-type="friend"></li>', '<li class="layui-icon', "{{# if(!d.base.isgroup){ }}", " layim-hide", "{{# } else if(!d.base.isfriend) { }}", " layim-this", "{{# } }}", '" title="群组" layim-event="tab" lay-type="group"></li>', '<li class="layui-icon" title="历史会话" layim-event="tab" lay-type="history"></li>', "</ul>", '<ul class="layui-unselect layim-tab-content {{# if(d.base.isfriend){ }}layui-show{{# } }} layim-list-friend">', '{{# layui.each(d.friend, function(index, item){ var spread = d.local["spread"+index]; }}', "<li>", '<h5 layim-event="spread" lay-type="{{ spread }}"><i class="layui-icon">{{# if(spread === "true"){ }}{{# } else { }}{{# } }}</i><span>{{ item.groupname||"未命名分组"+index }}</span><em>(<cite class="layim-count"> {{ (item.list||[]).length }}</cite>)</em></h5>', '<ul class="layui-layim-list {{# if(spread === "true"){ }}', " layui-show", '{{# } }}">', listTpl({ type: "friend", item: "item.list", index: "index" }), "</ul>", "</li>", "{{# }); if(d.friend.length === 0){ }}", '<li><ul class="layui-layim-list layui-show"><li class="layim-null">暂无联系人</li></ul>', "{{# } }}", "</ul>", '<ul class="layui-unselect layim-tab-content {{# if(!d.base.isfriend && d.base.isgroup){ }}layui-show{{# } }}">', "<li>", '<ul class="layui-layim-list layui-show layim-list-group">', listTpl({ type: "group" }), "</ul>", "</li>", "</ul>", '<ul class="layui-unselect layim-tab-content {{# if(!d.base.isfriend && !d.base.isgroup){ }}layui-show{{# } }}">', "<li>", '<ul class="layui-layim-list layui-show layim-list-history">', listTpl({ type: "history" }), "</ul>", "</li>", "</ul>", '<ul class="layui-unselect layim-tab-content">', "<li>", '<ul class="layui-layim-list layui-show" id="layui-layim-search"></ul>', "</li>", "</ul>", '<ul class="layui-unselect layui-layim-tool">', '<li class="layui-icon layim-tool-search" layim-event="search" title="搜索"></li>', "{{# if(d.base.msgbox){ }}", '<li class="layui-icon layim-tool-msgbox" layim-event="msgbox" title="消息盒子"><span class="layui-anim"></span></li>', "{{# } }}", "{{# if(d.base.find){ }}", '<li class="layui-icon layim-tool-find" layim-event="find" title="查找"></li>', "{{# } }}", '<li class="layui-icon layim-tool-skin" layim-event="skin" title="更换背景"></li>', "{{# if(!d.base.copyright){ }}", '<li class="layui-icon layim-tool-about" layim-event="about" title="关于"></li>', "{{# } }}", "</ul>", '<div class="layui-layim-search"><input><label class="layui-icon" layim-event="closeSearch">ဇ</label></div>', "</div>"].join(""), h = ['<ul class="layui-layim-skin">', "{{# layui.each(d.skin, function(index, item){ }}", '<li><img layim-event="setSkin" src="{{ item }}"></li>', "{{# }); }}", '<li layim-event="setSkin"><cite>简约</cite></li>', "</ul>"].join(""), p = ['<div class="layim-chat layim-chat-{{d.data.type}}{{d.first ? " layui-show" : ""}}">', '<div class="layui-unselect layim-chat-title">', '<div class="layim-chat-other">', '<img class="layim-{{ d.data.type }}{{ d.data.id }}" src="{{ d.data.avatar }}"><span class="layim-chat-username" layim-event="{{ d.data.type==="group" ? "groupMembers" : "" }}">{{ d.data.name||"佚名" }} {{d.data.temporary ? "<cite>临时会话</cite>" : ""}} {{# if(d.data.type==="group"){ }} <em class="layim-chat-members"></em><i class="layui-icon"></i> {{# } }}</span>', '<p class="layim-chat-status"></p>', "</div>", "</div>", '<div class="layim-chat-main">', "<ul></ul>", "</div>", '<div class="layim-chat-footer">', '<div class="layui-unselect layim-chat-tool" data-json="{{encodeURIComponent(JSON.stringify(d.data))}}">', '<span class="layui-icon layim-tool-face" title="选择表情" layim-event="face"></span>', "{{# if(d.base && d.base.uploadImage){ }}", '<span class="layui-icon layim-tool-image" title="上传图片" layim-event="image"><input type="file" name="file"></span>', "{{# }; }}", "{{# if(d.base && d.base.uploadFile){ }}", '<span class="layui-icon layim-tool-image" title="发送文件" layim-event="image" data-type="file"><input type="file" name="file"></span>', "{{# }; }}", "{{# if(d.base && d.base.isAudio){ }}", '<span class="layui-icon layim-tool-audio" title="发送网络音频" layim-event="media" data-type="audio"></span>', "{{# }; }}", "{{# if(d.base && d.base.isVideo){ }}", '<span class="layui-icon layim-tool-video" title="发送网络视频" layim-event="media" data-type="video"></span>', "{{# }; }}", "{{# layui.each(d.base.tool, function(index, item){ }}", '<span class="layui-icon layim-tool-{{item.alias}}" title="{{item.title}}" layim-event="extend" lay-filter="{{ item.alias }}">{{item.icon}}</span>', "{{# }); }}", "{{# if(d.base && d.base.chatLog){ }}", '<span class="layim-tool-log" layim-event="chatLog"><i class="layui-icon"></i>聊天记录</span>', "{{# }; }}", "</div>", '<div class="layim-chat-textarea"><textarea></textarea></div>', '<div class="layim-chat-bottom">', '<div class="layim-chat-send">', "{{# if(!d.base.brief){ }}", '<span class="layim-send-close" layim-event="closeThisChat">关闭</span>', "{{# } }}", '<span class="layim-send-btn" layim-event="send">发送</span>', '<span class="layim-send-set" layim-event="setSend" lay-type="show"><em class="layui-edge"></em></span>', '<ul class="layui-anim layim-menu-box">', '<li {{d.local.sendHotKey !== "Ctrl+Enter" ? "class=layim-this" : ""}} layim-event="setSend" lay-type="Enter"><i class="layui-icon"></i>按Enter键发送消息</li>', '<li {{d.local.sendHotKey === "Ctrl+Enter" ? "class=layim-this" : ""}} layim-event="setSend" lay-type="Ctrl+Enter"><i class="layui-icon"></i>按Ctrl+Enter键发送消息</li>', "</ul>", "</div>", "</div>", "</div>", "</div>"].join(""), y = ['<div class="layim-add-box">', '<div class="layim-add-img"><img class="layui-circle" src="{{ d.data.avatar }}"><p>{{ d.data.name||"" }}</p></div>', '<div class="layim-add-remark">', '{{# if(d.data.type === "friend" && d.type === "setGroup"){ }}', "<p>选择分组</p>", '{{# } if(d.data.type === "friend"){ }}', '<select class="layui-select" id="LAY_layimGroup">', "{{# layui.each(d.data.group, function(index, item){ }}", '<option value="{{ item.id }}">{{ item.groupname }}</option>', "{{# }); }}", "</select>", "{{# } }}", '{{# if(d.data.type === "group"){ }}', "<p>请输入验证信息</p>", '{{# } if(d.type !== "setGroup"){ }}', '<textarea id="LAY_layimRemark" placeholder="验证信息" class="layui-textarea"></textarea>', "{{# } }}", "</div>", "</div>"].join(""), m = ['<li {{ d.mine ? "class=layim-chat-mine" : "" }} {{# if(d.cid){ }}data-cid="{{d.cid}}"{{# } }}>', '<div class="layim-chat-user"><img src="{{ d.avatar }}"><cite>', "{{# if(d.mine){ }}", '<i>{{ layui.data.date(d.timestamp) }}</i>{{ d.username||"佚名" }}', "{{# } else { }}", '{{ d.username||"佚名" }}<i>{{ layui.data.date(d.timestamp) }}</i>', "{{# } }}", "</cite></div>", '<div class="layim-chat-text">{{ layui.data.content(d.content||" ") }}</div>', "</li>"].join(""), g = '<li class="layim-{{ d.data.type }}{{ d.data.id }} layim-chatlist-{{ d.data.type }}{{ d.data.id }} layim-this" layim-event="tabChat"><img src="{{ d.data.avatar }}"><span>{{ d.data.name||"佚名" }}</span>{{# if(!d.base.brief){ }}<i class="layui-icon" layim-event="closeChat">ဇ</i>{{# } }}</li>', digit = function (e) { return e < 10 ? "0" + (0 | e) : e }; layui.data.date = function (e) { var t = new Date(e || new Date); return t.getFullYear() + "-" + digit(t.getMonth() + 1) + "-" + digit(t.getDate()) + " " + digit(t.getHours()) + ":" + digit(t.getMinutes()) + ":" + digit(t.getSeconds()) }, layui.data.content = function (e) { var html = function (e) { return new RegExp("\\n*\\[" + (e || "") + "(code|pre|div|span|p|table|thead|th|tbody|tr|td|ul|li|ol|li|dl|dt|dd|h2|h3|h4|h5)([\\s\\S]*?)\\]\\n*", "g") }; return e = (e || "").replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, """).replace(/@(\S+)(\s+?|$)/g, '@<a href="javascript:;">$1</a>$2').replace(/face\[([^\s\[\]]+?)\]/g, (function (e) { var t = e.replace(/^face/g, ""); return '<img alt="' + t + '" title="' + t + '" src="' + N[t] + '">' })).replace(/img\[([^\s]+?)\]/g, (function (e) { return '<img class="layui-layim-photos" src="' + e.replace(/(^img\[)|(\]$)/g, "") + '">' })).replace(/file\([\s\S]+?\)\[[\s\S]*?\]/g, (function (e) { var t = (e.match(/file\(([\s\S]+?)\)\[/) || [])[1], i = (e.match(/\)\[([\s\S]*?)\]/) || [])[1]; return t ? '<a class="layui-layim-file" href="' + t + '" download target="_blank"><i class="layui-icon"></i><cite>' + (i || t) + "</cite></a>" : e })).replace(/audio\[([^\s]+?)\]/g, (function (e) { return '<div class="layui-unselect layui-layim-audio" layim-event="playAudio" data-src="' + e.replace(/(^audio\[)|(\]$)/g, "") + '"><i class="layui-icon"></i><p>音频消息</p></div>' })).replace(/video\[([^\s]+?)\]/g, (function (e) { return '<div class="layui-unselect layui-layim-video" layim-event="playVideo" data-src="' + e.replace(/(^video\[)|(\]$)/g, "") + '"><i class="layui-icon"></i></div>' })).replace(/a\([\s\S]+?\)\[[\s\S]*?\]/g, (function (e) { var t = (e.match(/a\(([\s\S]+?)\)\[/) || [])[1], i = (e.match(/\)\[([\s\S]*?)\]/) || [])[1]; return t ? '<a href="' + t + '" target="_blank">' + (i || t) + "</a>" : e })).replace(html(), "<$1 $2>").replace(html("/"), "</$1>").replace(/\n/g, "<br>") }; var b, k, w, C, D, E, post = function (e, t, o) { return e = e || {}, i.ajax({ url: e.url, type: e.type || "get", data: e.data, dataType: e.dataType || "json", cache: !1, success: function (e) { 0 == e.code ? t && t(e.data || {}) : n.msg(e.msg || (o || "Error") + ": LAYIM_NOT_GET_DATA", { time: 5e3 }) }, error: function (e, t) { window.console && console.log } }) }, S = { message: {}, chat: [] }, init = function (e) { var t = e.init || {}, n = t.mine || {}, r = layui.data("layim")[n.id] || {}, s = { base: e, local: r, mine: n, history: r.history || {} }, create = function (t) { var n = t.mine || {}, r = layui.data("layim")[n.id] || {}, s = { base: e, local: r, mine: n, friend: t.friend || [], group: t.group || [], history: r.history || {} }; S = i.extend(S, s), popim(o(u).render(s)), (r.close || e.min) && popmin(), layui.each(d.ready, (function (e, t) { t && t(s) })) }; if (S = i.extend(S, s), e.brief) return layui.each(d.ready, (function (e, t) { t && t(s) })); t.url ? post(t, create, "INIT") : create(t) }, popim = function (e) { return n.open({ type: 1, area: ["260px", "520px"], skin: "layui-box layui-layim", title: "​", offset: "rb", id: "layui-layim", shade: !1, anim: 2, resize: !1, content: e, success: function (e) { b = e, setSkin(e), S.base.right && e.css("margin-left", "-" + S.base.right), k && n.close(k.attr("times")); var t = [], o = e.find(".layim-list-history"); o.find("li").each((function () { t.push(i(this).prop("outerHTML")) })), t.length > 0 && (t.reverse(), o.html(t.join(""))), banRightMenu(), F.sign() }, cancel: function (e) { popmin(); var t = layui.data("layim")[S.mine.id] || {}; return t.close = !0, layui.data("layim", { key: S.mine.id, value: t }), !1 } }) }, banRightMenu = function () { b.on("contextmenu", (function (e) { return e.cancelBubble = !0, e.returnValue = !1, !1 })); var hide = function () { n.closeAll("tips") }; b.find(".layim-list-history").on("contextmenu", "li", (function (e) { var t = i(this), o = '<ul data-id="' + t[0].id + '" data-index="' + t.data("index") + '"><li layim-event="menuHistory" data-type="one">移除该会话</li><li layim-event="menuHistory" data-type="all">清空全部会话列表</li></ul>'; t.hasClass("layim-null") || (n.tips(o, this, { tips: 1, time: 0, anim: 5, fixed: !0, skin: "layui-box layui-layim-contextmenu", success: function (e) { var stopmp = function (e) { A(e) }; e.off("mousedown", stopmp).on("mousedown", stopmp) } }), i(document).off("mousedown", hide).on("mousedown", hide), i(window).off("resize", hide).on("resize", hide)) })) }, popmin = function (e) { return k && n.close(k.attr("times")), b && b.hide(), S.mine = S.mine || {}, n.open({ type: 1, title: !1, id: "layui-layim-close", skin: "layui-box layui-layim-min layui-layim-close", shade: !1, closeBtn: !1, anim: 2, offset: "rb", resize: !1, content: '<img src="' + (S.mine.avatar || layui.cache.dir + "css/pc/layim/skin/logo.jpg") + '"><span>' + (e || S.base.title || "我的LayIM") + "</span>", move: "#layui-layim-close img", success: function (e, t) { k = e, S.base.right && e.css("margin-left", "-" + S.base.right), e.on("click", (function () { n.close(t), b.show(); var e = layui.data("layim")[S.mine.id] || {}; delete e.close, layui.data("layim", { key: S.mine.id, value: e }) })) } }) }, popchat = function (e) { e = e || {}; var t = i("#layui-layim-chat"), r = { data: e, base: S.base, local: S.local }; if (!e.id) return n.msg("非法用户"); if (t[0]) { var s = w.find(".layim-chat-list"), c = s.find(".layim-chatlist-" + e.type + e.id), u = w.find(".layui-layer-max").hasClass("layui-layer-maxmin"), h = t.children(".layim-chat-box"); return "none" === w.css("display") && w.show(), C && n.close(C.attr("times")), 1 !== s.find("li").length || c[0] || (u || w.css("width", 800), s.css({ height: w.height() }).show(), h.css("margin-left", "200px")), c[0] || (s.append(o(g).render(r)), h.append(o(p).render(r)), syncGray(e), resizeChat()), changeChat(s.find(".layim-chatlist-" + e.type + e.id)), c[0] || viewChatlog(), setHistory(e), hotkeySend(), D } r.first = !0; var y = D = n.open({ type: 1, area: "600px", skin: "layui-box layui-layim-chat", id: "layui-layim-chat", title: "​", shade: !1, maxmin: !0, offset: e.offset || "auto", anim: e.anim || 0, closeBtn: !S.base.brief && 1, content: o('<ul class="layui-unselect layim-chat-list">' + g + '</ul><div class="layim-chat-box">' + p + "</div>").render(r), success: function (t) { w = t, t.css({ "min-width": "500px", "min-height": "420px" }), syncGray(e), "function" == typeof e.success && e.success(t), hotkeySend(), setSkin(t), setHistory(e), viewChatlog(), showOffMessage(), layui.each(d.chatChange, (function (e, t) { t && t(thisChat()) })), t.on("dblclick", ".layui-layim-photos", (function () { var e = this.src; n.close(popchat.photosIndex), n.photos({ photos: { data: [{ alt: "大图模式", src: e }] }, shade: .01, closeBtn: 2, anim: 0, resize: !1, success: function (e, t) { popchat.photosIndex = t } }) })) }, full: function (e) { n.style(y, { width: "100%", height: "100%" }, !0), resizeChat() }, resizing: resizeChat, restore: resizeChat, min: function () { return setChatMin(), !1 }, end: function () { n.closeAll("tips"), w = null } }); return y }, syncGray = function (e) { i(".layim-" + e.type + e.id).each((function () { i(this).hasClass("layim-list-gray") && layui.layim.setFriendStatus(e.id, "offline") })) }, resizeChat = function () { var e = w.find(".layim-chat-list"), t = w.find(".layim-chat-main"), i = w.height(); e.css({ height: i }), t.css({ height: i - 20 - 80 - 158 }) }, setChatMin = function (e) { var t = e || thisChat().data, o = layui.layim.cache().base; w && !e && w.hide(), n.close(setChatMin.index), setChatMin.index = n.open({ type: 1, title: !1, skin: "layui-box layui-layim-min", shade: !1, closeBtn: !1, anim: t.anim || 2, offset: "b", move: "#layui-layim-min", resize: !1, area: ["182px", "50px"], content: '<img id="layui-layim-min" src="' + t.avatar + '"><span>' + t.name + "</span>", success: function (t, r) { e || (C = t), o.minRight && n.style(r, { left: i(window).width() - t.outerWidth() - parseFloat(o.minRight) }), t.find(".layui-layer-content span").on("click", (function () { n.close(r), e ? layui.each(S.chat, (function (e, t) { popchat(t) })) : w.show(), e && (S.chat = [], chatListMore()) })), t.find(".layui-layer-content img").on("click", (function (e) { A(e) })) } }) }, popAdd = function (e, t) { return e = e || {}, n.close(popAdd.index), popAdd.index = n.open({ type: 1, area: "430px", title: { friend: "添加好友", group: "加入群组" }[e.type] || "", shade: !1, resize: !1, btn: t ? ["确认", "取消"] : ["发送申请", "关闭"], content: o(y).render({ data: { name: e.username || e.groupname, avatar: e.avatar, group: e.group || parent.layui.layim.cache().friend || [], type: e.type }, type: t }), yes: function (i, n) { var o = n.find("#LAY_layimGroup"), r = n.find("#LAY_layimRemark"); t ? e.submit && e.submit(o.val(), i) : e.submit && e.submit(o.val(), r.val(), i) } }) }, changeChat = function (e, t) { var o = -1 === (e = e || i(".layim-chat-list ." + c)).index() ? 0 : e.index(), r = ".layim-chat", u = w.find(r).eq(o), h = w.find(".layui-layer-max").hasClass("layui-layer-maxmin"); if (t) { e.hasClass(c) && changeChat(0 === o ? e.next() : e.prev()); var p = w.find(r).length; return 1 === p ? n.close(D) : (e.remove(), u.remove(), 2 === p && (w.find(".layim-chat-list").hide(), h || w.css("width", "600px"), w.find(".layim-chat-box").css("margin-left", 0)), !1) } e.addClass(c).siblings().removeClass(c), u.addClass(s).siblings(r).removeClass(s), u.find("textarea").focus(), layui.each(d.chatChange, (function (e, t) { t && t(thisChat()) })), showOffMessage() }, showOffMessage = function () { var e = thisChat(); S.message[e.data.type + e.data.id] && delete S.message[e.data.type + e.data.id] }, thisChat = function () { if (w) { var e = i(".layim-chat-list ." + c).index(), t = w.find(".layim-chat").eq(e), n = JSON.parse(decodeURIComponent(t.find(".layim-chat-tool").data("json"))); return { elem: t, data: n, textarea: t.find("textarea") } } }, setSkin = function (e) { var t = (layui.data("layim")[S.mine.id] || {}).skin; e.css({ "background-image": t ? "url(" + t + ")" : S.base.initSkin ? "url(" + layui.cache.dir + "css/modules/layim/skin/" + S.base.initSkin + ")" : "none" }) }, setHistory = function (e) { var t = layui.data("layim")[S.mine.id] || {}, i = {}, n = t.history || {}, r = n[e.type + e.id]; if (b) { var s = b.find(".layim-list-history"); if (e.historyTime = (new Date).getTime(), n[e.type + e.id] = e, t.history = n, layui.data("layim", { key: S.mine.id, value: t }), !r) { i[e.type + e.id] = e; var c = o(listTpl({ type: "history", item: "d.data" })).render({ data: i }); s.prepend(c), s.find(".layim-null").remove() } } }, sendMessage = function () { var e = { username: S.mine ? S.mine.username : "访客", avatar: S.mine ? S.mine.avatar : layui.cache.dir + "css/pc/layim/skin/logo.jpg", id: S.mine ? S.mine.id : null, mine: !0 }, t = thisChat(), i = t.elem.find(".layim-chat-main ul"), r = S.base.maxLength || 3e3; if (e.content = t.textarea.val(), "" !== e.content.replace(/\s/g, "")) { if (e.content.length > r) return n.msg("内容最长不能超过" + r + "个字符"); i.append(o(m).render(e)); var s = { mine: e, to: t.data }, c = { username: s.mine.username, avatar: s.mine.avatar, id: s.to.id, type: s.to.type, content: s.mine.content, timestamp: (new Date).getTime(), mine: !0 }; pushChatlog(c), layui.each(d.sendMessage, (function (e, t) { t && t(s) })) } chatListMore(), t.textarea.val("").focus() }, notice = function (e) { if (e = e || {}, window.Notification) if ("granted" === Notification.permission) new Notification(e.title || "", { body: e.content || "", icon: e.avatar || "http://tp2.sinaimg.cn/5488749285/50/5719808192/1" }); else Notification.requestPermission() }, getMessage = function (e) { var t = i(".layim-chatlist-" + (e = e || {}).type + e.id), n = {}, s = t.index(); if (e.timestamp = e.timestamp || (new Date).getTime(), e.fromid == S.mine.id && (e.mine = !0), e.system || pushChatlog(e), JSON.parse(JSON.stringify(e)), S.base.voice && function () { if (!(r.ie && r.ie < 9)) { var e = document.createElement("audio"); e.src = layui.cache.dir + "css/modules/layim/voice/" + S.base.voice, e.play() } }(), !w && e.content || -1 === s) { var c; if (S.message[e.type + e.id]) S.message[e.type + e.id].push(e); else if (S.message[e.type + e.id] = [e], "friend" === e.type) layui.each(S.friend, (function (t, i) { if (layui.each(i.list, (function (t, i) { if (i.id == e.id) return i.type = "friend", i.name = i.username, S.chat.push(i), c = !0 })), c) return !0 })), c || (e.name = e.username, e.temporary = !0, S.chat.push(e)); else if ("group" === e.type) { var d; layui.each(S.group, (function (t, i) { if (i.id == e.id) return i.type = "group", i.name = i.groupname, S.chat.push(i), d = !0 })), d || (e.name = e.groupname, S.chat.push(e)) } else e.name = e.name || e.username || e.groupname, S.chat.push(e); if ("group" === e.type && layui.each(S.group, (function (t, i) { if (i.id == e.id) return n.avatar = i.avatar, !0 })), !e.system) return S.base.notice && notice({ title: "来自 " + e.username + " 的消息", content: e.content, avatar: n.avatar || e.avatar }), setChatMin({ name: "收到新消息", avatar: n.avatar || e.avatar, anim: 6 }) } if (w) { var u = thisChat(); u.data.type + u.data.id !== e.type + e.id && (t.addClass("layui-anim layer-anim-06"), setTimeout((function () { t.removeClass("layui-anim layer-anim-06") }), 300)); var h = w.find(".layim-chat").eq(s).find(".layim-chat-main ul"); e.system ? -1 !== s && h.append('<li class="layim-chat-system"><span>' + e.content + "</span></li>") : "" !== e.content.replace(/\s/g, "") && h.append(o(m).render(e)), chatListMore() } }, L = "layui-anim-loop layer-anim-05", msgbox = function (e) { b.find(".layim-tool-msgbox").find("span").addClass(L).html(e) }, pushChatlog = function (e) { var t = layui.data("layim")[S.mine.id] || {}; t.chatlog = t.chatlog || {}; var i, n = t.chatlog[e.type + e.id]; n ? (layui.each(n, (function (t, n) { n.timestamp === e.timestamp && n.type === e.type && n.id === e.id && n.content === e.content && (i = !0) })), i || e.fromid == S.mine.id || n.push(e), n.length > 20 && n.shift()) : t.chatlog[e.type + e.id] = [e]; layui.data("layim", { key: S.mine.id, value: t }) }, viewChatlog = function () { var e = layui.data("layim")[S.mine.id] || {}, t = thisChat(), i = e.chatlog || {}, n = t.elem.find(".layim-chat-main ul"); layui.each(i[t.data.type + t.data.id], (function (e, t) { n.append(o(m).render(t)) })), chatListMore() }, addList = function (e) { var t, i = {}, r = b.find(".layim-list-" + e.type); if (S[e.type]) if ("friend" === e.type) layui.each(S.friend, (function (o, r) { if (e.groupid == r.id) return layui.each(S.friend[o].list, (function (i, n) { if (n.id == e.id) return t = !0 })), t ? n.msg("好友 [" + (e.username || "") + "] 已经存在列表中", { anim: 6 }) : (S.friend[o].list = S.friend[o].list || [], i[S.friend[o].list.length] = e, e.groupIndex = o, S.friend[o].list.push(e), !0) })); else if ("group" === e.type) { if (layui.each(S.group, (function (i, n) { if (n.id == e.id) return t = !0 })), t) return n.msg("您已是 [" + (e.groupname || "") + "] 的群成员", { anim: 6 }); i[S.group.length] = e, S.group.push(e) } if (!t) { var s = o(listTpl({ type: e.type, item: "d.data", index: "friend" === e.type ? "data.groupIndex" : null })).render({ data: i }); if ("friend" === e.type) { var c = r.find(">li").eq(e.groupIndex); c.find(".layui-layim-list").append(s), c.find(".layim-count").html(S.friend[e.groupIndex].list.length), c.find(".layim-null")[0] && c.find(".layim-null").remove() } else "group" === e.type && (r.append(s), r.find(".layim-null")[0] && r.find(".layim-null").remove()) } }, removeList = function (e) { var t = b.find(".layim-list-" + e.type); S[e.type] && ("friend" === e.type ? layui.each(S.friend, (function (i, n) { layui.each(n.list, (function (n, o) { if (e.id == o.id) { var r = t.find(">li").eq(i); r.find(".layui-layim-list>li"); return r.find(".layui-layim-list>li").eq(n).remove(), S.friend[i].list.splice(n, 1), r.find(".layim-count").html(S.friend[i].list.length), 0 === S.friend[i].list.length && r.find(".layui-layim-list").html('<li class="layim-null">该分组下已无好友了</li>'), !0 } })) })) : "group" === e.type && layui.each(S.group, (function (i, n) { if (e.id == n.id) return t.find(">li").eq(i).remove(), S.group.splice(i, 1), 0 === S.group.length && t.html('<li class="layim-null">暂无群组</li>'), !0 }))) }, chatListMore = function () { var e = thisChat().elem.find(".layim-chat-main"), t = e.find("ul"), i = t.find("li").length; if (i >= 20) { var n = t.find("li").eq(0); t.prev().hasClass("layim-chat-system") || t.before('<div class="layim-chat-system"><span layim-event="chatLog">查看更多记录</span></div>'), i > 20 && n.remove() } e.scrollTop(e[0].scrollHeight + 1e3), e.find("ul li:last").find("img").load((function () { e.scrollTop(e[0].scrollHeight + 1e3) })) }, hotkeySend = function () { var e = thisChat().textarea; e.focus(), e.off("keydown").on("keydown", (function (t) { var i = layui.data("layim")[S.mine.id] || {}, n = t.keyCode; if ("Ctrl+Enter" !== i.sendHotKey) { if (13 === n) { if (t.ctrlKey) return e.val(e.val() + "\n"); if (t.shiftKey) return; t.preventDefault(), sendMessage() } } else t.ctrlKey && 13 === n && sendMessage() })) }, N = (E = {}, layui.each(["[微笑]", "[嘻嘻]", "[哈哈]", "[可爱]", "[可怜]", "[挖鼻]", "[吃惊]", "[害羞]", "[挤眼]", "[闭嘴]", "[鄙视]", "[爱你]", "[泪]", "[偷笑]", "[亲亲]", "[生病]", "[太开心]", "[白眼]", "[右哼哼]", "[左哼哼]", "[嘘]", "[衰]", "[委屈]", "[吐]", "[哈欠]", "[抱抱]", "[怒]", "[疑问]", "[馋嘴]", "[拜拜]", "[思考]", "[汗]", "[困]", "[睡]", "[钱]", "[失望]", "[酷]", "[色]", "[哼]", "[鼓掌]", "[晕]", "[悲伤]", "[抓狂]", "[黑线]", "[阴险]", "[怒骂]", "[互粉]", "[心]", "[伤心]", "[猪头]", "[熊猫]", "[兔子]", "[ok]", "[耶]", "[good]", "[NO]", "[赞]", "[来]", "[弱]", "[草泥马]", "[神马]", "[囧]", "[浮云]", "[给力]", "[围观]", "[威武]", "[奥特曼]", "[礼物]", "[钟]", "[话筒]", "[蜡烛]", "[蛋糕]"], (function (e, t) { E[t] = layui.cache.dir + "images/face/" + e + ".gif" })), E), A = layui.stope, focusInsert = function (e, t) { var i, n = e.value; e.focus(), document.selection ? (i = document.selection.createRange(), document.selection.empty(), i.text = t) : (i = [n.substring(0, e.selectionStart), t, n.substr(e.selectionEnd)], e.focus(), e.value = i.join("")) }, _ = "layui-anim-upbit", F = { status: function (e, t) { var hide = function () { e.next().hide().removeClass(_) }, n = e.attr("lay-type"); if ("show" === n) A(t), e.next().show().addClass(_), i(document).off("click", hide).on("click", hide); else { var o = e.parent().prev(); e.addClass(c).siblings().removeClass(c), o.html(e.find("cite").html()), o.removeClass("layim-status-" + ("online" === n ? "hide" : "online")).addClass("layim-status-" + n), layui.each(d.online, (function (e, t) { t && t(n) })) } }, sign: function () { var e = b.find(".layui-layim-remark"); e.on("change", (function () { var e = this.value; layui.each(d.sign, (function (t, i) { i && i(e) })) })), e.on("keyup", (function (e) { 13 === e.keyCode && this.blur() })) }, tab: function (e) { var t, i = ".layim-tab-content", n = b.find(".layui-layim-tab>li"); "number" == typeof e ? (t = e, e = n.eq(t)) : t = e.index(), t > 2 ? n.removeClass(c) : (F.tab.index = t, e.addClass(c).siblings().removeClass(c)), b.find(i).eq(t).addClass(s).siblings(i).removeClass(s) }, spread: function (e) { var t = e.attr("lay-type"), i = "true" === t ? "false" : "true", n = layui.data("layim")[S.mine.id] || {}; e.next()["true" === t ? "removeClass" : "addClass"](s), n["spread" + e.parent().index()] = i, layui.data("layim", { key: S.mine.id, value: n }), e.attr("lay-type", i), e.find(".layui-icon").html("true" === i ? "" : "") }, search: function (e) { var t = b.find(".layui-layim-search"), i = b.find("#layui-layim-search"), n = t.find("input"), find = function (e) { var t = n.val().replace(/\s/); if ("" === t) F.tab(0 | F.tab.index); else { for (var o = [], r = S.friend || [], s = S.group || [], c = "", d = 0; d < r.length; d++)for (var u = 0; u < (r[d].list || []).length; u++)-1 !== r[d].list[u].username.indexOf(t) && (r[d].list[u].type = "friend", r[d].list[u].index = d, r[d].list[u].list = u, o.push(r[d].list[u])); for (var h = 0; h < s.length; h++)-1 !== s[h].groupname.indexOf(t) && (s[h].type = "group", s[h].index = h, s[h].list = h, o.push(s[h])); if (o.length > 0) for (var p = 0; p < o.length; p++)c += '<li layim-event="chat" data-type="' + o[p].type + '" data-index="' + o[p].index + '" data-list="' + o[p].list + '"><img src="' + o[p].avatar + '"><span>' + (o[p].username || o[p].groupname || "佚名") + "</span><p>" + (o[p].remark || o[p].sign || "") + "</p></li>"; else c = '<li class="layim-null">无搜索结果</li>'; i.html(c), F.tab(3) } }; !S.base.isfriend && S.base.isgroup ? F.tab.index = 1 : S.base.isfriend || S.base.isgroup || (F.tab.index = 2), t.show(), n.focus(), n.off("keyup", find).on("keyup", find) }, closeSearch: function (e) { e.parent().hide(), F.tab(0 | F.tab.index) }, msgbox: function () { var e = b.find(".layim-tool-msgbox"); return n.close(F.msgbox.index), e.find("span").removeClass(L).html(""), F.msgbox.index = n.open({ type: 2, title: "消息盒子", shade: !1, maxmin: !0, area: ["600px", "520px"], skin: "layui-box layui-layer-border", resize: !1, content: S.base.msgbox }) }, find: function () { return n.close(F.find.index), F.find.index = n.open({ type: 2, title: "查找", shade: !1, maxmin: !0, area: ["1000px", "520px"], skin: "layui-box layui-layer-border", resize: !1, content: S.base.find }) }, skin: function () { n.open({ type: 1, title: "更换背景", shade: !1, area: "300px", skin: "layui-box layui-layer-border", id: "layui-layim-skin", zIndex: 66666666, resize: !1, content: o(h).render({ skin: S.base.skin }) }) }, about: function () { n.alert('版本: 3.7.6<br>版权所有:<a href="http://www.kdayun.com.cn/" target="_blank">上海快搭科技(上海)有限公司</a>', { title: "关于", shade: !1 }) }, setSkin: function (e) { var t = e.attr("src"), i = layui.data("layim")[S.mine.id] || {}; i.skin = t, t || delete i.skin, layui.data("layim", { key: S.mine.id, value: i }); try { b.css({ "background-image": t ? "url(" + t + ")" : "none" }), w.css({ "background-image": t ? "url(" + t + ")" : "none" }) } catch (e) { } layui.each(d.setSkin, (function (e, i) { var n = (t || "").replace(layui.cache.dir + "css/modules/layim/skin/", ""); i && i(n, t) })) }, chat: function (e) { var t = layui.data("layim")[S.mine.id] || {}, i = e.data("type"), n = e.data("index"), o = e.attr("data-list") || e.index(), r = {}; "friend" === i ? r = S[i][n].list[o] : "group" === i ? r = S[i][o] : "history" === i && (r = (t.history || {})[n] || {}), r.name = r.name || r.username || r.groupname, "history" !== i && (r.type = i), popchat(r) }, tabChat: function (e) { changeChat(e) }, closeChat: function (e, t) { changeChat(e.parent(), 1), A(t) }, closeThisChat: function () { changeChat(null, 1) }, groupMembers: function (e, t) { var o = e.find(".layui-icon"), hide = function () { o.html(""), e.data("down", null), n.close(F.groupMembers.index) }, stopmp = function (e) { A(e) }; e.data("down") ? hide() : (o.html(""), e.data("down", !0), F.groupMembers.index = n.tips('<ul class="layim-members-list"></ul>', e, { tips: 3, time: 0, anim: 5, fixed: !0, skin: "layui-box layui-layim-members", success: function (t) { var n = S.base.members || {}, o = thisChat(), r = t.find(".layim-members-list"), s = "", c = {}, u = w.find(".layui-layer-max").hasClass("layui-layer-maxmin"), h = "none" === w.find(".layim-chat-list").css("display"); u && r.css({ width: i(window).width() - 22 - (h || 200) }), n.data = i.extend(n.data, { id: o.data.id }), post(n, (function (t) { layui.each(t.list, (function (e, t) { s += '<li data-uid="' + t.id + '"><a href="javascript:;"><img src="' + t.avatar + '"><cite>' + t.username + "</cite></a></li>", c[t.id] = t })), r.html(s), e.find(".layim-chat-members").html(t.members || (t.list || []).length + "人"), r.find("li").on("click", (function () { var e = i(this).data("uid"), t = c[e]; popchat({ name: t.username, type: "friend", avatar: t.avatar, id: t.id }), hide() })), layui.each(d.members, (function (e, i) { i && i(t) })) })), t.on("mousedown", (function (e) { A(e) })) } }), i(document).off("mousedown", hide).on("mousedown", hide), i(window).off("resize", hide).on("resize", hide), e.off("mousedown", stopmp).on("mousedown", stopmp)) }, send: function () { sendMessage() }, setSend: function (e, t) { var n = F.setSend.box = e.siblings(".layim-menu-box"), o = e.attr("lay-type"); if ("show" === o) A(t), n.show().addClass(_), i(document).off("click", F.setSendHide).on("click", F.setSendHide); else { e.addClass(c).siblings().removeClass(c); var r = layui.data("layim")[S.mine.id] || {}; r.sendHotKey = o, layui.data("layim", { key: S.mine.id, value: r }), F.setSendHide(t, e.parent()) } }, setSendHide: function (e, t) { (t || F.setSend.box).hide().removeClass(_) }, face: function (e, t) { var o = "", r = thisChat(); for (var s in N) o += '<li title="' + s + '"><img src="' + N[s] + '"></li>'; o = '<ul class="layui-clear layim-face-list">' + o + "</ul>", F.face.index = n.tips(o, e, { tips: 1, time: 0, fixed: !0, skin: "layui-box layui-layim-face", success: function (e) { e.find(".layim-face-list>li").on("mousedown", (function (e) { A(e) })).on("click", (function () { focusInsert(r.textarea[0], "face" + this.title + " "), n.close(F.face.index) })) } }), i(document).off("mousedown", F.faceHide).on("mousedown", F.faceHide), i(window).off("resize", F.faceHide).on("resize", F.faceHide), A(t) }, faceHide: function () { n.close(F.face.index) }, image: function (e) { var t = e.data("type") || "images", i = thisChat(), o = S.base[{ images: "uploadImage", file: "uploadFile" }[t]] || {}; layui.upload.render({ url: o.url || "", method: o.type, elem: e.find("input")[0], accept: t, done: function (e) { 0 == e.code ? (e.data = e.data || {}, "images" === t ? focusInsert(i.textarea[0], "img[" + (e.data.src || "") + "]") : "file" === t && focusInsert(i.textarea[0], "file(" + (e.data.src || "") + ")[" + (e.data.name || "下载文件") + "]"), sendMessage()) : n.msg(e.msg || "上传失败") } }) }, media: function (e) { var t = e.data("type"), o = thisChat(); n.prompt({ title: "请输入网络" + { audio: "音频", video: "视频" }[t] + "地址", shade: !1, offset: [e.offset().top - i(window).scrollTop() - 158 + "px", e.offset().left + "px"] }, (function (e, i) { focusInsert(o.textarea[0], t + "[" + e + "]"), sendMessage(), n.close(i) })) }, extend: function (e) { var t = e.attr("lay-filter"), i = thisChat(); layui.each(d["tool(" + t + ")"], (function (t, n) { n && n.call(e, (function (e) { focusInsert(i.textarea[0], e) }), sendMessage, i) })) }, playAudio: function (e) { var t = e.data("audio"), i = t || document.createElement("audio"), pause = function () { i.pause(), e.removeAttr("status"), e.find("i").html("") }; return e.data("error") ? n.msg("播放音频源异常") : i.play ? void (e.attr("status") ? pause() : (t || (i.src = e.data("src")), i.play(), e.attr("status", "pause"), e.data("audio", i), e.find("i").html(""), i.onended = function () { pause() }, i.onerror = function () { n.msg("播放音频源异常"), e.data("error", !0), pause() })) : n.msg("您的浏览器不支持audio") }, playVideo: function (e) { var t = e.data("src"); if (!document.createElement("video").play) return n.msg("您的浏览器不支持video"); n.close(F.playVideo.index), F.playVideo.index = n.open({ type: 1, title: "播放视频", area: ["460px", "300px"], maxmin: !0, shade: !1, content: '<div style="background-color: #000; height: 100%;"><video style="position: absolute; width: 100%; height: 100%;" src="' + t + '" loop="loop" autoplay="autoplay"></video></div>' }) }, chatLog: function (e) { var t = thisChat(); return S.base.chatLog ? (n.close(F.chatLog.index), F.chatLog.index = n.open({ type: 2, maxmin: !0, title: "与 " + t.data.name + " 的聊天记录", area: ["450px", "100%"], shade: !1, offset: "rb", skin: "layui-box", anim: 2, id: "layui-layim-chatlog", content: S.base.chatLog + "?id=" + t.data.id + "&type=" + t.data.type })) : n.msg("未开启更多聊天记录") }, menuHistory: function (e, t) { var o = layui.data("layim")[S.mine.id] || {}, r = e.parent(), s = e.data("type"), c = b.find(".layim-list-history"), d = '<li class="layim-null">暂无历史会话</li>'; if ("one" === s) { var u = o.history; delete u[r.data("index")], o.history = u, layui.data("layim", { key: S.mine.id, value: o }), i("#" + r.data("id")).remove(), 0 === c.find("li").length && c.html(d) } else "all" === s && (delete o.history, layui.data("layim", { key: S.mine.id, value: o }), c.html(d)); n.closeAll("tips") } }; e("layim", new LAYIM) })).addcss("modules/layim/layim.css?v=3.7.6", "skinlayimcss")
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name : layui.laypage 分页组件
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define((function (e) { "use strict"; var t = document, i = "getElementById", n = "getElementsByTagName", Class = function (e) { this.config = e || {}, this.config.index = ++o.index, this.render(!0) }; Class.prototype.type = function () { var e = this.config; if ("object" == typeof e.elem) return void 0 === e.elem.length ? 2 : 3 }, Class.prototype.view = function () { var e = this.config, t = e.groups = "groups" in e ? 0 | e.groups : 5; e.layout = "object" == typeof e.layout ? e.layout : ["prev", "page", "next"], e.count = 0 | e.count, e.curr = 0 | e.curr || 1, e.limits = "object" == typeof e.limits ? e.limits : [10, 20, 30, 40, 50], e.limit = 0 | e.limit || 10, e.pages = Math.ceil(e.count / e.limit) || 1, e.curr > e.pages && (e.curr = e.pages), t < 0 ? t = 1 : t > e.pages && (t = e.pages), e.prev = "prev" in e ? e.prev : "上一页", e.next = "next" in e ? e.next : "下一页"; var i, n = e.pages > t ? Math.ceil((e.curr + (t > 1 ? 1 : 0)) / (t > 0 ? t : 1)) : 1, o = { prev: e.prev ? '<a href="javascript:;" class="layui-laypage-prev' + (1 == e.curr ? " layui-disabled" : "") + '" data-page="' + (e.curr - 1) + '">' + e.prev + "</a>" : "", page: function () { var i = []; if (e.count < 1) return ""; n > 1 && !1 !== e.first && 0 !== t && i.push('<a href="javascript:;" class="layui-laypage-first" data-page="1" title="首页">' + (e.first || 1) + "</a>"); var o, r = Math.floor((t - 1) / 2), s = n > 1 ? e.curr - r : 1, c = n > 1 ? (o = e.curr + (t - r - 1)) > e.pages ? e.pages : o : t; for (c - s < t - 1 && (s = c - t + 1), !1 !== e.first && s > 2 && i.push('<span class="layui-laypage-spr">…</span>'); s <= c; s++)s === e.curr ? i.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" ' + (/^#/.test(e.theme) ? 'style="background-color:' + e.theme + ';"' : "") + "></em><em>" + s + "</em></span>") : i.push('<a href="javascript:;" data-page="' + s + '">' + s + "</a>"); return e.pages > t && e.pages > c && !1 !== e.last && (c + 1 < e.pages && i.push('<span class="layui-laypage-spr">…</span>'), 0 !== t && i.push('<a href="javascript:;" class="layui-laypage-last" title="尾页" data-page="' + e.pages + '">' + (e.last || e.pages) + "</a>")), i.join("") }(), next: e.next ? '<a href="javascript:;" class="layui-laypage-next' + (e.curr == e.pages ? " layui-disabled" : "") + '" data-page="' + (e.curr + 1) + '">' + e.next + "</a>" : "", count: '<span class="layui-laypage-count">共 ' + e.count + " 条</span>", limit: function () { var t = ['<span class="layui-laypage-limits"><select lay-ignore>']; return layui.each(e.limits, (function (i, n) { t.push('<option value="' + n + '"' + (n === e.limit ? "selected" : "") + ">" + n + " 条/页</option>") })), t.join("") + "</select></span>" }(), refresh: ['<a href="javascript:;" data-page="' + e.curr + '" class="layui-laypage-refresh">', '<i class="layui-icon layui-icon-refresh"></i>', "</a>"].join(""), skip: ['<span class="layui-laypage-skip">到第', '<input type="text" min="1" value="' + e.curr + '" class="layui-input">', '页<button type="button" class="layui-laypage-btn">确定</button>', "</span>"].join("") }; return ['<div class="layui-box layui-laypage layui-laypage-' + (e.theme ? /^#/.test(e.theme) ? "molv" : e.theme : "default") + '" id="layui-laypage-' + e.index + '">', (i = [], layui.each(e.layout, (function (e, t) { o[t] && i.push(o[t]) })), i.join("")), "</div>"].join("") }, Class.prototype.jump = function (e, t) { if (e) { var i = this, r = i.config, s = e.children, c = e[n]("button")[0], d = e[n]("input")[0], u = e[n]("select")[0], skip = function () { var e = 0 | d.value.replace(/\s|\D/g, ""); e && (r.curr = e, i.render()) }; if (t) return skip(); for (var h = 0, p = s.length; h < p; h++)"a" === s[h].nodeName.toLowerCase() && o.on(s[h], "click", (function () { var e = 0 | this.getAttribute("data-page"); e < 1 || e > r.pages || (r.curr = e, i.render()) })); u && o.on(u, "change", (function () { var e = this.value; r.curr * e > r.count && (r.curr = Math.ceil(r.count / e)), r.limit = e, i.render() })), c && o.on(c, "click", (function () { skip() })) } }, Class.prototype.skip = function (e) { if (e) { var t = this, i = e[n]("input")[0]; i && o.on(i, "keyup", (function (i) { var n = this.value, o = i.keyCode; /^(37|38|39|40)$/.test(o) || (/\D/.test(n) && (this.value = n.replace(/\D/, "")), 13 === o && t.jump(e, !0)) })) } }, Class.prototype.render = function (e) { var n = this.config, o = this.type(), r = this.view(); 2 === o ? n.elem && (n.elem.innerHTML = r) : 3 === o ? n.elem.html(r) : t[i](n.elem) && (t[i](n.elem).innerHTML = r), n.jump && n.jump(n, e); var s = t[i]("layui-laypage-" + n.index); this.jump(s), n.hash && !e && (location.hash = "!" + n.hash + "=" + n.curr), this.skip(s) }; var o = { render: function (e) { return new Class(e).index }, index: layui.laypage ? layui.laypage.index + 1e4 : 0, on: function (e, t, i) { return e.attachEvent ? e.attachEvent("on" + t, (function (t) { t.target = t.srcElement, i.call(e, t) })) : e.addEventListener(t, i, !1), this } }; e("laypage", o) }))
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name : layui.laytpl 模板引擎
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define((function (e) { "use strict"; var t = { open: "{{", close: "}}" }, tool_query = function (e, i, n) { var o = ["#([\\s\\S])+?", "([^{#}])*?"][e || 0]; return exp((i || "") + t.open + o + t.close + (n || "")) }, tool_escape = function (e) { return String(e || "").replace(/&(?!#?[a-zA-Z0-9]+;)/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, """) }, tool_error = function (e, t) { return "Laytpl Error:" + e }, exp = function (e) { return new RegExp(e, "g") }, Tpl = function (e) { this.tpl = e }; Tpl.pt = Tpl.prototype, window.errors = 0, Tpl.pt.parse = function (e, i) { var n = e, o = exp("^" + t.open + "#", ""), r = exp(t.close + "$", ""); e = '"use strict";var view = "' + (e = e.replace(/\s+|\r|\t|\n/g, " ").replace(exp(t.open + "#"), t.open + "# ").replace(exp(t.close + "}"), "} " + t.close).replace(/\\/g, "\\\\").replace(exp(t.open + "!(.+?)!" + t.close), (function (e) { return e = e.replace(exp("^" + t.open + "!"), "").replace(exp("!" + t.close), "").replace(exp(t.open + "|" + t.close), (function (e) { return e.replace(/(.)/g, "\\$1") })) })).replace(/(?="|')/g, "\\").replace(tool_query(), (function (e) { return '";' + (e = e.replace(o, "").replace(r, "")).replace(/\\/g, "") + ';view+="' })).replace(tool_query(1), (function (e) { var i = '"+('; return e.replace(/\s/g, "") === t.open + t.close ? "" : (e = e.replace(exp(t.open + "|" + t.close), ""), /^=/.test(e) && (e = e.replace(/^=/, ""), i = '"+_escape_('), i + e.replace(/\\/g, "") + ')+"') }))) + '";return view;'; try { return this.cache = e = new Function("d, _escape_", e), e(i, tool_escape) } catch (e) { return delete this.cache, tool_error(e, n) } }, Tpl.pt.render = function (e, t) { var i; return e ? (i = this.cache ? this.cache(e, tool_escape) : this.parse(this.tpl, e), t ? void t(i) : i) : tool_error("no data") }; var laytpl = function (e) { return "string" != typeof e ? tool_error("Template not found") : new Tpl(e) }; laytpl.config = function (e) { for (var i in e = e || {}) t[i] = e[i] }, laytpl.v = "1.2.0", e("laytpl", laytpl) }))
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui 移动模块入口 | 构建后则为移动模块集合
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui["layui.mobile"] || layui.config({ base: layui.cache.dir + "lay/modules/mobile/" }).extend({ "layer-mobile": "layer-mobile", zepto: "zepto", "upload-mobile": "upload-mobile", "layim-mobile": "layim-mobile" }), layui.define(["layer-mobile", "zepto", "layim-mobile"], (function (e) { e("mobile", { layer: layui["layer-mobile"], layim: layui["layim-mobile"] }) }))
|
||
}, function (e, t) { layui.define("jquery", (function (e) { "use strict"; var t = layui.jquery, i = { config: {}, index: layui.rate ? layui.rate.index + 1e4 : 0, set: function (e) { var i = this; return i.config = t.extend({}, i.config, e), i }, on: function (e, t) { return layui.onevent.call(this, n, e, t) } }, l = function () { var e = this; return { setvalue: function (t) { e.setvalue.call(e, t) }, config: e.config } }, n = "rate", o = "layui-icon-rate", r = "layui-icon-rate-solid", s = "layui-icon-rate-half", c = "layui-icon-rate-solid layui-icon-rate-half", d = "layui-icon-rate layui-icon-rate-half", v = function (e) { var n = this; n.index = ++i.index, n.config = t.extend({}, n.config, i.config, e), n.render() }; v.prototype.config = { length: 5, text: !1, readonly: !1, half: !1, value: 0, theme: "" }, v.prototype.render = function () { var e = this, i = e.config, n = i.theme ? 'style="color: ' + i.theme + ';"' : ""; i.elem = t(i.elem), parseInt(i.value) !== i.value && (i.half || (i.value = Math.ceil(i.value) - i.value < .5 ? Math.ceil(i.value) : Math.floor(i.value))); for (var s = '<ul class="layui-rate" ' + (i.readonly ? "readonly" : "") + ">", c = 1; c <= i.length; c++) { var d = '<li class="layui-inline"><i class="layui-icon ' + (c > Math.floor(i.value) ? o : r) + '" ' + n + "></i></li>"; i.half && parseInt(i.value) !== i.value && c == Math.ceil(i.value) ? s = s + '<li><i class="layui-icon layui-icon-rate-half" ' + n + "></i></li>" : s += d } s += "</ul>" + (i.text ? '<span class="layui-inline">' + i.value + "星" : "") + "</span>"; var u = i.elem, h = u.next(".layui-rate"); h[0] && h.remove(), e.elemTemp = t(s), i.span = e.elemTemp.next("span"), i.setText && i.setText(i.value), u.html(e.elemTemp), u.addClass("layui-inline"), i.readonly || e.action() }, v.prototype.setvalue = function (e) { this.config.value = e, this.render() }, v.prototype.action = function () { var e = this.config, i = this.elemTemp, n = i.find("i").width(); i.children("li").each((function (u) { var h = u + 1, p = t(this); p.on("click", (function (o) { (e.value = h, e.half) && (o.pageX - t(this).offset().left <= n / 2 && (e.value = e.value - .5)); e.text && i.next("span").text(e.value + "星"), e.choose && e.choose(e.value), e.setText && e.setText(e.value) })), p.on("mousemove", (function (u) { (i.find("i").each((function () { t(this).addClass(o).removeClass(c) })), i.find("i:lt(" + h + ")").each((function () { t(this).addClass(r).removeClass(d) })), e.half) && (u.pageX - t(this).offset().left <= n / 2 && p.children("i").addClass(s).removeClass(r)) })), p.on("mouseleave", (function () { i.find("i").each((function () { t(this).addClass(o).removeClass(c) })), i.find("i:lt(" + Math.floor(e.value) + ")").each((function () { t(this).addClass(r).removeClass(d) })), e.half && parseInt(e.value) !== e.value && i.children("li:eq(" + Math.floor(e.value) + ")").children("i").addClass(s).removeClass("layui-icon-rate-solid layui-icon-rate") })) })) }, v.prototype.events = function () { this.config }, i.render = function (e) { var t = new v(e); return l.call(t) }, e(n, i) })) }, function (e, t) { layui.define(["layer"], (function (e) { "use strict"; e("select", { fillData: function (e) { var t = e.attr("dataurl"); t && "SELECT" == e[0].tagName && (e.empty(), $.ajax({ type: "get", async: !1, url: t, dataType: "json", success: function (t) { if ("OK" == t.state) { var i = t.obj; layui.each(i, (function (t, i) { e.append("<option value='" + i.KEY + "' >" + i.VALUE + "</option>") })), null == e.val() && e.val(e.attr("default")) } }, error: function (e, t) { } })) } }) })) }, function (e, t) { layui.define("jquery", (function (e) { "use strict"; var t = layui.jquery, i = { config: {}, index: layui.slider ? layui.slider.index + 1e4 : 0, set: function (e) { var i = this; return i.config = t.extend({}, i.config, e), i }, on: function (e, t) { return layui.onevent.call(this, n, e, t) } }, a = function () { var e = this; return { setValue: function (t, i) { return e.slide("set", t, i || 0) }, config: e.config } }, n = "slider", o = "layui-disabled", r = "layui-slider-bar", s = "layui-slider-wrap", c = "layui-slider-wrap-btn", d = "layui-slider-tips", u = "layui-slider-input-txt", h = "layui-slider-input-btn", p = "layui-slider-hover", f = function (e) { var n = this; n.index = ++i.index, n.config = t.extend({}, n.config, i.config, e), n.render() }; f.prototype.config = { type: "default", min: 0, max: 100, value: 0, step: 1, showstep: !1, tips: !0, input: !1, range: !1, height: 200, disabled: !1, theme: "#009688" }, f.prototype.render = function () { var e = this, i = e.config; if (i.step < 1 && (i.step = 1), i.max < i.min && (i.max = i.min + i.step), i.range) { i.value = "object" == typeof i.value ? i.value : [i.min, i.value]; var n = Math.min(i.value[0], i.value[1]), r = Math.max(i.value[0], i.value[1]); i.value[0] = n > i.min ? n : i.min, i.value[1] = r > i.min ? r : i.min, i.value[0] = i.value[0] > i.max ? i.max : i.value[0], i.value[1] = i.value[1] > i.max ? i.max : i.value[1]; var h = Math.floor((i.value[0] - i.min) / (i.max - i.min) * 100), p = Math.floor((i.value[1] - i.min) / (i.max - i.min) * 100), y = p - h + "%"; h += "%", p += "%" } else { "object" == typeof i.value && (i.value = Math.min.apply(null, i.value)), i.value < i.min && (i.value = i.min), i.value > i.max && (i.value = i.max); y = Math.floor((i.value - i.min) / (i.max - i.min) * 100) + "%" } var m = i.disabled ? "#c2c2c2" : i.theme, g = '<div class="layui-slider ' + ("vertical" === i.type ? "layui-slider-vertical" : "") + '">' + (i.tips ? '<div class="layui-slider-tips"></div>' : "") + '<div class="layui-slider-bar" style="background:' + m + "; " + ("vertical" === i.type ? "height" : "width") + ":" + y + ";" + ("vertical" === i.type ? "bottom" : "left") + ":" + (h || 0) + ';"></div><div class="layui-slider-wrap" style="' + ("vertical" === i.type ? "bottom" : "left") + ":" + (h || y) + ';"><div class="layui-slider-wrap-btn" style="border: 2px solid ' + m + ';"></div></div>' + (i.range ? '<div class="layui-slider-wrap" style="' + ("vertical" === i.type ? "bottom" : "left") + ":" + p + ';"><div class="layui-slider-wrap-btn" style="border: 2px solid ' + m + ';"></div></div>' : "") + "</div>", b = t(i.elem), k = b.next(".layui-slider"); if (k[0] && k.remove(), e.elemTemp = t(g), i.range ? (e.elemTemp.find("." + s).eq(0).data("value", i.value[0]), e.elemTemp.find("." + s).eq(1).data("value", i.value[1])) : e.elemTemp.find("." + s).data("value", i.value), b.html(e.elemTemp), "vertical" === i.type && e.elemTemp.height(i.height + "px"), i.showstep) { for (var w = (i.max - i.min) / i.step, C = "", D = 1; D < w + 1; D++) { var E = 100 * D / w; E < 100 && (C += '<div class="layui-slider-step" style="' + ("vertical" === i.type ? "bottom" : "left") + ":" + E + '%"></div>') } e.elemTemp.append(C) } if (i.input && !i.range) { var S = t('<div class="layui-slider-input layui-input"><div class="layui-slider-input-txt"><input type="text" class="layui-input"></div><div class="layui-slider-input-btn"><i class="layui-icon layui-icon-up"></i><i class="layui-icon layui-icon-down"></i></div></div>'); b.css("position", "relative"), b.append(S), b.find("." + u).children("input").val(i.value), "vertical" === i.type ? S.css({ left: 0, top: -48 }) : e.elemTemp.css("margin-right", S.outerWidth() + 15) } i.disabled ? (e.elemTemp.addClass(o), e.elemTemp.find("." + c).addClass(o)) : e.slide(), e.elemTemp.find("." + c).on("mouseover", (function () { var n = "vertical" === i.type ? i.height : e.elemTemp[0].offsetWidth, o = e.elemTemp.find("." + s), r = ("vertical" === i.type ? n - t(this).parent()[0].offsetTop - o.height() : t(this).parent()[0].offsetLeft) / n * 100, c = t(this).parent().data("value"), u = i.setTips ? i.setTips(c) : c; e.elemTemp.find("." + d).html(u), "vertical" === i.type ? e.elemTemp.find("." + d).css({ bottom: r + "%", "margin-bottom": "20px", display: "inline-block" }) : e.elemTemp.find("." + d).css({ left: r + "%", display: "inline-block" }) })).on("mouseout", (function () { e.elemTemp.find("." + d).css("display", "none") })) }, f.prototype.slide = function (e, i, n) { var o = this.config, y = this.elemTemp, f = function () { return "vertical" === o.type ? o.height : y[0].offsetWidth }, m = y.find("." + s), g = y.next(".layui-slider-input"), b = g.children("." + u).children("input").val(), k = 100 / ((o.max - o.min) / Math.ceil(o.step)), x = function (e, t) { e = (e = Math.ceil(e) * k > 100 ? Math.ceil(e) * k : Math.round(e) * k) > 100 ? 100 : e, m.eq(t).css("vertical" === o.type ? "bottom" : "left", e + "%"); var i = T(m[0].offsetLeft), n = o.range ? T(m[1].offsetLeft) : 0; "vertical" === o.type ? (y.find("." + d).css({ bottom: e + "%", "margin-bottom": "20px" }), i = T(f() - m[0].offsetTop - m.height()), n = o.range ? T(f() - m[1].offsetTop - m.height()) : 0) : y.find("." + d).css("left", e + "%"), i = i > 100 ? 100 : i, n = n > 100 ? 100 : n; var s = Math.min(i, n), c = Math.abs(i - n); "vertical" === o.type ? y.find("." + r).css({ height: c + "%", bottom: s + "%" }) : y.find("." + r).css({ width: c + "%", left: s + "%" }); var h = o.min + Math.round((o.max - o.min) * e / 100); if (b = h, g.children("." + u).children("input").val(b), m.eq(t).data("value", h), h = o.setTips ? o.setTips(h) : h, y.find("." + d).html(h), o.range) { var p = [m.eq(0).data("value"), m.eq(1).data("value")]; p[0] > p[1] && p.reverse() } o.change && o.change(o.range ? p : h) }, T = function (e) { var t = e / f() * 100 / k, i = Math.round(t) * k; return e == f() && (i = Math.ceil(t) * k), i }, w = t(['<div class="layui-auxiliar-moving" id="LAY-slider-moving"></div'].join("")), M = function (e, i) { var a = function () { i && i(), w.remove() }; t("#LAY-slider-moving")[0] || t("body").append(w), w.on("mousemove", e), w.on("mouseup", a).on("mouseleave", a) }; if ("set" === e) return x(i, n); y.find("." + c).each((function (e) { var i = t(this); i.on("mousedown", (function (t) { t = t || window.event; var n = i.parent()[0].offsetLeft, r = t.clientX; "vertical" === o.type && (n = f() - i.parent()[0].offsetTop - m.height(), r = t.clientY); M((function (t) { t = t || window.event; var s = n + ("vertical" === o.type ? r - t.clientY : t.clientX - r); s < 0 && (s = 0), s > f() && (s = f()); var c = s / f() * 100 / k; x(c, e), i.addClass(p), y.find("." + d).show(), t.preventDefault() }), (function () { i.removeClass(p), y.find("." + d).hide() })) })) })), y.on("click", (function (e) { var i = t("." + c); if (!i.is(event.target) && 0 === i.has(event.target).length && i.length) { var n, r = "vertical" === o.type ? f() - e.clientY + t(this).offset().top : e.clientX - t(this).offset().left; r < 0 && (r = 0), r > f() && (r = f()); var s = r / f() * 100 / k; n = o.range ? "vertical" === o.type ? Math.abs(r - parseInt(t(m[0]).css("bottom"))) > Math.abs(r - parseInt(t(m[1]).css("bottom"))) ? 1 : 0 : Math.abs(r - m[0].offsetLeft) > Math.abs(r - m[1].offsetLeft) ? 1 : 0 : 0, x(s, n), e.preventDefault() } })), g.hover((function () { t(this).children("." + h).fadeIn("fast") }), (function () { t(this).children("." + h).fadeOut("fast") })), g.children("." + h).children("i").each((function (e) { t(this).on("click", (function () { var t = ((b = 1 == e ? b - o.step < o.min ? o.min : Number(b) - o.step : Number(b) + o.step > o.max ? o.max : Number(b) + o.step) - o.min) / (o.max - o.min) * 100 / k; x(t, 0) })) })); var q = function () { var e = this.value; e = (e = (e = isNaN(e) ? 0 : e) < o.min ? o.min : e) > o.max ? o.max : e, this.value = e; var t = (e - o.min) / (o.max - o.min) * 100 / k; x(t, 0) }; g.children("." + u).children("input").on("keydown", (function (e) { 13 === e.keyCode && (e.preventDefault(), q.call(this)) })).on("change", q) }, f.prototype.events = function () { this.config }, i.render = function (e) { var t = new f(e); return a.call(t) }, e(n, i) })) }, function (module, exports) {
|
||
/**
|
||
@Name:layui.table 表格操作
|
||
@Author:贤心
|
||
@License:MIT
|
||
@version:2.4.5
|
||
|
||
*/
|
||
layui.define(["laytpl", "laypage", "layer", "form", "util"], (function (exports) { "use strict"; var $ = layui.$, laytpl = layui.laytpl, laypage = layui.laypage, layer = layui.layer, form = layui.form, util = layui.util, hint = layui.hint(), device = layui.device(), table = { config: { checkName: "LAY_CHECKED", indexName: "LAY_TABLE_INDEX" }, cache: {}, checkedMultiList: [], index: layui.table ? layui.table.index + 1e4 : 0, set: function (e) { return this.config = $.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, MOD_NAME, e, t) } }, thisTable = function () { var e = this, t = e.config, i = t.id || t.index; return i && (thisTable.config[i] = t), { reload: function (t) { return e.reload.call(e, t), e.getSortcols(), thisTable.config[i] = $.extend({}, e.config, t) }, setColsWidth: function () { e.setColsWidth.call(e) }, resize: function () { e.resize.call(e) }, config: t } }, MOD_NAME = "table", ELEM = ".layui-table", THIS = "layui-this", SHOW = "layui-show", HIDE = "layui-hide", DISABLED = "layui-disabled", NONE = "layui-none", ELEM_VIEW = "layui-table-view", ELEM_TOOL = ".layui-table-tool", ELEM_BOX = ".layui-table-box", ELEM_INIT = ".layui-table-init", ELEM_HEADER = ".layui-table-header", ELEM_BODY = ".layui-table-body", ELEM_MAIN = ".layui-table-main", ELEM_FIXED = ".layui-table-fixed", ELEM_FIXL = ".layui-table-fixed-l", ELEM_FIXR = ".layui-table-fixed-r", ELEM_TOTAL = ".layui-table-total", ELEM_PAGE = ".layui-table-page", ELEM_SORT = ".layui-table-sort", ELEM_EDIT = "layui-table-edit", ELEM_HOVER = "layui-table-hover", TPL_HEADER = function (e, t) { return t = t || {}, "cardListMode" == e ? ['<ul class="tab-sort">', "{{# layui.each(d.data.sortcols, function(i1, item1){ }}", "{{# layui.each(item1, function(i2, item2){ }}", '<li data-field="{{ item2.field||i2 }}" data-key="{{# if(item2.key){ }}{{d.index}}-{{item2.key}}{{# } else { }}{{d.index}}-{{i1}}-{{i2}} {{# } }}" class="{{# if(item2.hide){ }}layui-hide{{# } }}">', '<div class="layui-table-cell laytable-cell-', "{{# if(item2.key){ }}{{d.index}}-{{item2.key}}{{# } else { }}{{d.index}}-{{i1}}-{{i2}} {{# } }}", '{{# if(item2.type !== "normal"){ }}', " laytable-cell-{{ item2.type }}", "{{# } }}", '"{{#if(item2.align){}}align="{{item2.align}}"{{#}}}>', '{{# if(item2.type === "checkbox"){ }}', '<span style="margin-right:5px"><input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose"></span>', "{{# } }}", '<span>{{item2.title||""}}</span>', '{{# if(item2.type != "checkbox"){ }}', '<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc" title="升序"></i><i class="layui-edge layui-table-sort-desc" title="降序"></i></span>', "{{# } }}", "</div>", "</li>", "{{# }); }}", "{{# }); }}", "</ul>"].join("") : ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', "<thead>", "{{# layui.each(d.data.cols, function(i1, item1){ }}", "<tr>", "{{# layui.each(item1, function(i2, item2){ }}", '{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}', '{{# if(item2.fixed === "right"){ right = true; } }}', t.fixed && "right" !== t.fixed ? '{{# if(item2.fixed && item2.fixed !== "right"){ }}' : "right" === t.fixed ? '{{# if(item2.fixed === "right"){ }}' : "", "{{# var isSort = !(item2.colGroup) && item2.sort; }}", '<th data-field="{{ item2.field||i2 }}" data-key="{{d.index}}-{{i1}}-{{i2}}" {{# if( item2.parentKey){ }}data-parentkey="{{ item2.parentKey }}"{{# } }} {{# if(item2.minWidth){ }}data-minwidth="{{item2.minWidth}}"{{# } }} {{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}} {{# if(item2.unresize || item2.colGroup){ }}data-unresize="true"{{# } }} class="{{# if(item2.hide){ }}layui-hide{{# } }}{{# if(isSort){ }} layui-unselect{{# } }}{{# if(!item2.field){ }} layui-table-col-special{{# } }}">', '<div class="layui-table-cell laytable-cell-', "{{# if(item2.colGroup){ }}", "group", "{{# } else { }}", "{{d.index}}-{{i1}}-{{i2}}", '{{# if(item2.type !== "normal"){ }}', " laytable-cell-{{ item2.type }}", "{{# } }}", "{{# } }}", '" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>', '{{# if(item2.type === "checkbox"){ }}', '<input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose" {{# if(item2[d.data.checkName]){ }}checked{{# }; }}>', "{{# } else { }}", '<span>{{item2.title||""}}</span>', "{{# if(isSort){ }}", '<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc" title="升序"></i><i class="layui-edge layui-table-sort-desc" title="降序"></i></span>', "{{# } }}", "{{# } }}", "</div>", "</th>", t.fixed ? "{{# }; }}" : "", "{{# }); }}", "</tr>", "{{# }); }}", "</thead>", "</table>"].join("") }, TPL_BODY = function (e) { return "cardListMode" == e ? ['<div class="layui-table card-list layui-row layui-col-space10" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', "</div>"].join("") : ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', "<tbody></tbody>", "</table>"].join("") }, TPL_MAIN = function (e) { return "cardListMode" == e ? ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}" lay-filter="LAY-table-{{d.index}}" lay-id="{{ d.data.id }}" style="{{# if(d.data.width){ }}width:{{d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{d.data.height}}px;{{# } }}">', "{{# if(d.data.toolbar){ }}", '<div class="layui-table-tool">', '<div class="layui-table-tool-temp"></div>', '<div class="layui-table-tool-self"></div>', "</div>", "{{# } }}", '<div class="layui-table-box">', "{{# if(d.data.loading){ }}", '<div class="layui-table-init" style="background-color: #fff;">', '<i class="layui-icon layui-icon-loading layui-icon"></i>', "</div>", "{{# } }}", "{{# var left, right; }}", '<div class="layui-table-header">', TPL_HEADER(e), "</div>", '<div class="layui-table-body layui-table-main">', TPL_BODY(e), "</div>", "</div>", "{{# if(d.data.totalRow){ }}", '<div class="layui-table-total">', '<div class="layui-table-total-box" style="overflow: hidden; padding:5px 0">', '<div class="layui-table-cell" style="visibility: hidden;">Total</div>', "</div>", "</div>", "{{# } }}", "{{# if(d.data.page){ }}", '<div class="layui-table-page">', '<div id="layui-table-page{{d.index}}"></div>', "</div>", "{{# } }}", "<style>", "</style>", "</div>"].join("") : ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}" lay-filter="LAY-table-{{d.index}}" style="{{# if(d.data.width){ }}width:{{d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{d.data.height}}px;{{# } }}">', "{{# if(d.data.toolbar){ }}", '<div class="layui-table-tool">', '<div class="layui-table-tool-temp"></div>', '<div class="layui-table-tool-self"></div>', "</div>", "{{# } }}", '<div class="layui-table-box">', "{{# if(d.loading){ }}", '<div class="layui-table-init" style="background-color: #fff;">', '<i class="layui-icon layui-icon-loading layui-icon"></i>', "</div>", "{{# } }}", "{{# var left, right; }}", '<div class="layui-table-header">', TPL_HEADER(e), "</div>", '<div class="layui-table-body layui-table-main">', TPL_BODY(e), "</div>", "{{# if(left){ }}", '<div class="layui-table-fixed layui-table-fixed-l">', '<div class="layui-table-header">', TPL_HEADER(e, { fixed: !0 }), "</div>", '<div class="layui-table-body">', TPL_BODY(e), "</div>", "</div>", "{{# }; }}", "{{# if(right){ }}", '<div class="layui-table-fixed layui-table-fixed-r">', '<div class="layui-table-header">', TPL_HEADER(e, { fixed: "right" }), '<div class="layui-table-mend"></div>', "</div>", '<div class="layui-table-body">', TPL_BODY(e), "</div>", "</div>", "{{# }; }}", "</div>", '{{# if(d.data.totalRow && d.data.mode!="cardListMode"){ }}', '<div class="layui-table-total">', '<table cellspacing="0" cellpadding="0" border="0" class="layui-table" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', '<tbody><tr><td><div class="layui-table-cell" style="visibility: hidden;">Total</div></td></tr></tbody>', "</table>", "</div>", "{{# } }}", "{{# if(d.data.page){ }}", '<div class="layui-table-page">', '<div id="layui-table-page{{d.index}}"></div>', "</div>", "{{# } }}", "<style>", "{{# layui.each(d.data.cols, function(i1, item1){", "layui.each(item1, function(i2, item2){ }}", ".laytable-cell-{{d.index}}-{{i1}}-{{i2}}{ ", "{{# if(item2.width){ }}", "width: {{item2.width}}px;", "{{# } }}", " }", "{{# });", "}); }}", "</style>", "</div>"].join("") }, _WIN = $(window), _DOC = $(document), Class = function (e) { if (this.index = ++table.index, e.response = $.extend({ statusName: "code", statusCode: 0, msgName: "msg", dataName: "data", countName: "count" }, e.response), !e.sortcols && "cardListMode" == e.mode) { var t = []; layui.each(e.cols, (function (e, i) { layui.each(i, (function (e, i) { i.field && "image" != i.type && t.push(i) })) })), this.config.sortcols = this.config.sortcols.concat([t]) } this.config = $.extend({}, this.config, table.config, e); var i = this.getUserPdata(); i && this.setUserPdata(i), this.render() }; Class.prototype.config = { limit: 20, loading: !0, cellMinWidth: 60, defaultToolbar: ["filter", "exports", "print"], mode: "listMode", sortcols: [[{ type: "checkbox", title: "全选" }]], vertical: !1, text: { none: "无数据" }, flipCheck: !1, onlyKey: "RWID", attachFieldsName: [] }, Class.prototype.render = function () { var e = this.config; if (e.elem = $(e.elem), e.where = e.where || {}, e.id = e.id || e.elem.attr("id") || e.index, e.sortload = null == e.sortload || e.sortload, e.request = $.extend({ pageName: "page", limitName: "limit" }, e.request), "object" == typeof e.page && (e.limit = e.page.limit || e.limit, e.limits = e.page.limits || e.limits, this.page = e.page.curr = e.page.curr || 1, delete e.page.elem, delete e.page.jump), !e.elem[0]) return this; e.height && /^full-\d+$/.test(e.height) && (this.fullHeightGap = e.height.split("-")[1], e.height = _WIN.height() - this.fullHeightGap), this.setInit(); var t = e.elem, i = "listMode" == e.mode ? ELEM_VIEW : ELEM_VIEW + " layui-table-ext", n = t.next("." + ELEM_VIEW), o = this.elem = $(laytpl(TPL_MAIN(e.mode)).render({ VIEW_CLASS: i, data: e, index: this.index })); if (e.index = this.index, n[0] && n.remove(), t.after(o), this.layTool = o.find(ELEM_TOOL), this.layBox = o.find(ELEM_BOX), this.layHeader = o.find(ELEM_HEADER), this.layMain = o.find(ELEM_MAIN), this.layBody = o.find(ELEM_BODY), this.layFixed = o.find(ELEM_FIXED), this.layFixLeft = o.find(ELEM_FIXL), this.layFixRight = o.find(ELEM_FIXR), this.layTotal = o.find(ELEM_TOTAL), this.layPage = o.find(ELEM_PAGE), this.renderToolbar(), this.fullSize(), e.cols.length > 1) { var r = this.layFixed.find(ELEM_HEADER).find("th"); r.height(this.layHeader.height() - 1 - parseFloat(r.css("padding-top")) - parseFloat(r.css("padding-bottom"))) } this.pullData(this.page), this.events() }, Class.prototype.getSortcols = function (e) { var t = this.config; if (1 == t.sortcols[0].length && "cardListMode" == t.mode) { var i = []; this.eachCols((function (e, t) { if (t.field && "normal" == t.type) { var n = { field: t.field, title: t.title, hide: t.hide, key: t.key }; i.push(n) } })); var n = [], o = function (e) { for (var t = [], i = [], n = e.length, o = 0; o < n; o++) { for (var r = o + 1; r < n; r++)e[o].field === e[r].field && (r = ++o); t.push(e[o]), i.push(o) } return t }(this.config.sortcols[0].concat(i)); n.push(o), this.config.sortcols = n } }, Class.prototype.getUserPdata = function () { var e = this.config; if (e && e.updId) { var t, i = { updId: e.updId }; if ($.ajax({ type: "post", url: layui.cache.contentPath + "/admin/coreupd/query", async: !1, data: i, dataType: "json", success: function (i) { i && i[e.response.statusName] == e.response.statusCode && (t = i[e.response.dataName] || []) }, error: function (e, t) { } }), t) return t } }, Class.prototype.setUserPdata = function (updColumns) { var that = this, options = that.config; if (options && options.updId && updColumns) { var datas = {}; layui.each(updColumns, (function (i1, data1) { data1 && data1.UPD_CONTENT && (data1 = eval("(" + data1.UPD_CONTENT + ")"), layui.each(data1, (function (e, t) { t && t.field && (datas[t.field] = t) }))) })), that.config.userPdatas || $.extend(that.config, { userPdatas: {} }), $.extend(that.config.userPdatas, datas), layui.each(options.cols, (function (e, t) { layui.each(t, (function (e, t) { t.field && datas[t.field] && (t.hide = datas[t.field].hide) })) })) } }, Class.prototype.saveUserPdata = function (e) { var t = this.config; if (t && t.updId && e) { var i = {}; layui.each(e, (function (e, t) { t && t.field && (i[t.field] = t) })), this.config.userPdatas || $.extend(this.config, { userPdatas: {} }), $.extend(this.config.userPdatas, i); var n = []; $.each(this.config.userPdatas, (function (e, t) { n.push(t) })); var o = { UPD_CONTENT: JSON.stringify(n), UPD_SHIYCJID: t.updId, UPD_SHIFQY: 1 }; $.ajax({ type: "post", url: layui.cache.contentPath + "/admin/coreupd/modify", data: o, dataType: "json", success: function (e) { }, error: function (e, t) { } }) } }, Class.prototype.initOpts = function (e) { this.config; e.checkbox && (e.type = "checkbox"), e.space && (e.type = "space"), e.type || (e.type = "normal"), "normal" !== e.type && (e.unresize = !0, e.width = e.width || { checkbox: 48, radio: 48, space: 15, numbers: 40 }[e.type]) }, Class.prototype.setInit = function (e) { var t, i = this, n = i.config; if (n.clientWidth = n.width || (t = function (e) { var i, o; i = (e = e || n.elem.parent()).width(); try { o = "none" === e.css("display") } catch (e) { } return !e[0] || i && !o ? i : t(e.parent()) })(), "width" === e) return n.clientWidth; layui.each(n.cols, (function (e, t) { layui.each(t, (function (o, r) { if (r) { if (r.key = e + "-" + o, r.hide = r.hide || !1, r.colGroup || r.colspan > 1) { var s = 0; layui.each(n.cols[e + 1], (function (t, i) { i.HAS_PARENT || s > 1 && s == r.colspan || (i.HAS_PARENT = !0, i.parentKey = e + "-" + o, s += parseInt(i.colspan > 1 ? i.colspan : 1)) })), r.colGroup = !0 } i.initOpts(r) } else t.splice(o, 1) })) })) }, Class.prototype.renderToolbar = function () { var e = this.config, t = ['<div class="layui-inline" lay-event="add"><i class="layui-icon layui-icon-add-1"></i></div>', '<div class="layui-inline" lay-event="update"><i class="layui-icon layui-icon-edit"></i></div>', '<div class="layui-inline" lay-event="delete"><i class="layui-icon layui-icon-delete"></i></div>'].join(""), i = this.layTool.find(".layui-table-tool-temp"); if ("default" === e.toolbar) i.html(t); else if (e.toolbar) { var n = $(e.toolbar).html() || ""; n && i.html(laytpl(n).render(e)) } var o = { filter: { title: "筛选列", layEvent: "LAYTABLE_COLS", icon: "layui-icon-cols" }, exports: { title: "导出", layEvent: "LAYTABLE_EXPORT", icon: "layui-icon-export" }, print: { title: "打印", layEvent: "LAYTABLE_PRINT", icon: "layui-icon-print" } }, r = []; "object" == typeof e.defaultToolbar && layui.each(e.defaultToolbar, (function (e, t) { var i = o[t]; i && r.push('<div class="layui-inline" title="' + i.title + '" lay-event="' + i.layEvent + '"><i class="layui-icon ' + i.icon + '"></i></div>') })), this.layTool.find(".layui-table-tool-self").html(r.join("")); var s = this.layTool.find(".layui-table-tool-self"); i.css("padding-right", s.width() + 17 + "px") }, Class.prototype.setParentCol = function (e, t) { var i = this.config, n = this.layHeader.find('th[data-key="' + i.index + "-" + t + '"]'), o = parseInt(n.attr("colspan")) || 0; if (n[0]) { var r = t.split("-"), s = i.cols[r[0]][r[1]]; e ? o-- : o++, n.attr("colspan", o), n[o < 1 ? "addClass" : "removeClass"](HIDE), s.colspan = o, s.hide = o < 1; var c = n.data("parentkey"); c && this.setParentCol(e, c) } }, Class.prototype.setColsPatch = function () { var e = this, t = e.config; layui.each(t.cols, (function (t, i) { layui.each(i, (function (t, i) { i.hide && e.setParentCol(i.hide, i.parentKey) })) })) }, Class.prototype.setColsWidth = function () { var e = this, t = e.config, i = 0, n = 0, o = 0, r = 0, s = e.setInit("width"); e.eachCols((function (e, t) { t.hide || i++ })), s = s - ("line" === t.skin || "nob" === t.skin ? 2 : i + 1) - e.getScrollWidth(e.layMain[0]) - 1; var getAutoWidth = function (e) { layui.each(t.cols, (function (i, c) { layui.each(c, (function (i, d) { var u = 0, h = d.minWidth || t.cellMinWidth; d ? d.colGroup || d.hide || (e ? o && o < h && (n--, u = h) : (u = d.width || 0, /\d+%$/.test(u) ? (u = Math.floor(parseFloat(u) / 100 * s)) < h && (u = h) : u || (d.width = u = 0, n++)), d.hide && (u = 0), r += u) : c.splice(i, 1) })) })), s > r && n && (o = (s - r) / n) }; getAutoWidth(), getAutoWidth(!0), e.autoColNums = n, e.eachCols((function (i, n) { var r = n.minWidth || t.cellMinWidth; n.colGroup || n.hide || (0 === n.width ? e.getCssRule(t.index + "-" + n.key, (function (e) { e.style.width = Math.floor(o >= r ? o : r) + "px" })) : /\d+%$/.test(n.width) && e.getCssRule(t.index + "-" + n.key, (function (e) { e.style.width = Math.floor(parseFloat(n.width) / 100 * s) + "px" }))) })); var c = e.layMain.width() - e.getScrollWidth(e.layMain[0]) - e.layMain.children("table").outerWidth(); if (e.autoColNums && c >= -i && c <= i) { var getEndTh = function (t) { return !(t = t || e.layHeader.eq(0).find("thead th:last-child")).data("field") && t.prev()[0] ? getEndTh(t.prev()) : t }, d = getEndTh(), u = d.data("key"); e.getCssRule(u, (function (t) { var i = t.style.width || d.outerWidth(); t.style.width = parseFloat(i) + c + "px", e.layMain.height() - e.layMain.prop("clientHeight") > 0 && (t.style.width = parseFloat(t.style.width) - 1 + "px") })) } e.loading(!0) }, Class.prototype.resize = function () { this.fullSize(), this.setColsWidth(), this.scrollPatch() }, Class.prototype.reload = function (e) { var t = this.config; this.config.data && this.config.data.constructor === Array && delete this.config.data; var i = !1; if (t.updId && t.mode && e.mode && t.mode != e.mode && (i = !0), this.config = $.extend({}, this.config, e), i) { var n = this.getUserPdata(); n && this.setUserPdata(n) } this.render() }, Class.prototype.page = 1, Class.prototype.pullData = function (e) { var t = this, i = t.config, n = i.request, o = i.response, sort = function () { if ("object" == typeof i.initSort) if (i.dataSource && i.initSort) for (var e in i.initSort) t.sort(e, i.initSort[e]); else t.sort(i.initSort.field, i.initSort.type) }; if (t.startTime = (new Date).getTime(), i.url) { var r = {}; i.page && (r[n.pageName] = String(e), r[n.limitName] = String(i.limit)); var s = $.extend(r, i.where); i.contentType && 0 == i.contentType.indexOf("application/json") && (s = JSON.stringify(s)), $.ajax({ type: i.method || "get", url: i.url, contentType: i.contentType, traditional: i.traditional, data: s, dataType: "json", headers: i.headers || {}, success: function (n) { "function" == typeof i.parseData && (n = i.parseData(n) || n), n[o.statusName] != o.statusCode ? (t.renderForm(), t.layMain.html('<div class="' + NONE + '">' + (n[o.msgName] || "返回的数据不符合规范,正确的成功状态码 (" + o.statusName + ") 应为:" + o.statusCode) + "</div>")) : (t.renderData(n, e, n[o.countName]), sort(), i.time = (new Date).getTime() - t.startTime + " ms"), t.setColsWidth(), "function" == typeof i.done && i.done(n, e, n[o.countName]) }, error: function (e, i) { t.layMain.html('<div class="' + NONE + '">数据接口请求异常:' + i + "</div>"), t.renderForm(), t.setColsWidth() } }) } else if (i.dataSource) { var c = {}, d = e * i.limit - i.limit; "function" == typeof i.parseData && (c = i.parseData(c) || c), c[o.dataName] = i.data, c[o.countName] = i.count, t.renderData(c, e, c[o.countName]), sort(), i.time = (new Date).getTime() - t.startTime + " ms", t.setColsWidth(), "function" == typeof i.done && i.done(c, e, c[o.countName]) } else if (i.data && i.data.constructor === Array) { c = {}, d = e * i.limit - i.limit; c[o.dataName] = i.data.concat().splice(d, i.limit), c[o.countName] = i.data.length, t.renderData(c, e, i.data.length), sort(), t.setColsWidth(), "function" == typeof i.done && i.done(c, e, c[o.countName]) } }, Class.prototype.eachCols = function (e) { return table.eachCols(null, e, this.config.cols), this }, Class.prototype.eachTotalCols = function (e) { return table.eachTotalCols(null, e, this.config.totalcols), this }, Class.prototype.renderData = function (e, t, i, n) { var o = this, r = o.config, s = e[r.response.dataName] || [], c = [], d = [], u = [], render = function () { var e; if (!n && o.sortKey) return o.sort(o.sortKey.field, o.sortKey.sort, !0); if (layui.each(s, (function (i, s) { var h = [], p = [], y = [], m = [], g = [], b = i + r.limit * (t - 1) + 1; if (n || (s[table.config.indexName] = i), o.eachCols((function (t, n) { var c = n.field || t, d = r.index + "-" + n.key, u = s[c], k = n.title; if (null == u && (u = ""), !n.colGroup) { if ("imgListMode" == r.mode) { if ("checkbox" == n.type || "radio" == n.type || "numbers" == n.type) { var w = []; w = ['<td data-field="' + c + '" data-key="' + d + '" ' + (A = [], n.edit && A.push('data-edit="' + n.edit + '"'), n.align && A.push('align="' + n.align + '"'), n.templet && A.push('data-content="' + u + '"'), n.toolbar && A.push('data-off="true"'), n.event && A.push('lay-event="' + n.event + '"'), n.style && A.push('style="' + n.style + '"'), n.minWidth && A.push('data-minwidth="' + n.minWidth + '"'), A.join(" ") + ' class="') + (N = [], n.hide && N.push(HIDE), n.field || N.push("layui-table-col-special"), N.join(" ") + '">'), '<div class="layui-table-cell laytable-cell-' + ("normal" === n.type ? d : d + " laytable-cell-" + n.type) + '">' + function () { var t = $.extend(!0, { LAY_INDEX: b }, s), c = table.config.checkName; switch (n.type) { case "checkbox": var d = s[o.config.onlyKey]; return '<input type="checkbox" ' + o.checkedDefault(d, i) + ' name="layTableCheckbox" lay-skin="primary" ' + (n[c] ? (s[c] = n[c], n[c] ? "checked" : "") : t[c] ? "checked" : "") + ">"; case "radio": return t[c] && (e = i), '<input type="radio" name="layTableRadio_' + r.index + '" ' + (t[c] ? "checked" : "") + ' lay-type="layTableRadio">'; case "numbers": return b } }(), "</div></td>"].join("") } else { var C = []; C = ['<li data-field="' + c + '" data-key="' + d + '" ' + function () { var e = []; return n.edit && e.push('data-edit="' + n.edit + '"'), n.align && e.push('align="' + n.align + '"'), n.templet && e.push('data-content="' + u + '"'), n.toolbar && e.push('data-off="true"'), n.event && e.push('lay-event="' + n.event + '"'), n.style && e.push('style="' + n.style + '"'), n.minWidth && e.push('data-minwidth="' + n.minWidth + '"'), e.join(" ") }() + ' class="' + function () { var e = []; return n.hide && e.push(HIDE), n.field || e.push("layui-table-col-special"), e.join(" ") }() + '">', '<div class="layui-table-cell laytable-cell-' + ("normal" === n.type ? d : d + " laytable-cell-" + n.type) + '">' + function () { var e = $.extend(!0, { LAY_INDEX: b }, s); return n.toolbar ? laytpl($(n.toolbar).html() || "").render(e) : n.templet ? "function" == typeof n.templet ? n.templet(e) : laytpl($(n.templet).html() || String(u)).render(e) : u }(), "</div></li>"].join("") } m.push(C) } else if ("cardListMode" == r.mode) { var D = $.extend(!0, { LAY_INDEX: b }, s), E = table.config.checkName, S = (w = [], []); switch (n.type) { case "checkbox": var L = s[o.config.onlyKey]; w = ['<div class="item-sub item-checkbox" data-field="' + c + '"><input type="checkbox" ' + o.checkedDefault(L, i) + ' name="layTableCheckbox" lay-skin="primary" ' + (n[E] ? (s[E] = n[E], n[E] ? "checked" : "") : D[E] ? "checked" : "") + "></div>"].join(""); break; case "radio": D[E] && (e = i), w = ['<div class="item-sub item-checkbox" data-field="' + c + '"><input type="radio" name="layTableRadio_' + r.index + '" ' + (D[E] ? "checked" : "") + ' lay-type="layTableRadio"></div>'].join(""); break; case "image": w = ['<div data-field="' + c + '" data-key="' + d + '" ' + function () { var e = []; return n.align && e.push('align="' + n.align + '"'), n.templet && e.push('data-content="' + u + '"'), n.event && e.push('lay-event="' + n.event + '"'), n.style && e.push('style="' + n.style + '"'), e.join(" ") }() + ' class="imgbox item-sub"><a href="javascript:;">' + function () { var e = $.extend(!0, { LAY_INDEX: b }, s); return n.templet ? "function" == typeof n.templet ? n.templet(e) : laytpl($(n.templet).html() || String(u)).render(e) : u }(), "</a></div>"].join(""); break; default: S = ['<div data-field="' + c + '" data-key="' + d + '" ' + function () { var e = []; return n.align && e.push('align="' + n.align + '"'), n.templet && e.push('data-content="' + u + '"'), n.event && e.push('lay-event="' + n.event + '"'), n.style && e.push('style="' + n.style + '"'), e.join(" ") }() + ' class="layui-table-cell ' + function () { var e = []; return n.hide && e.push(HIDE), n.field || e.push("layui-table-col-special"), e.join(" ") }() + '">' + function () { var e = $.extend(!0, { LAY_INDEX: b }, s); return n.toolbar ? laytpl($(n.toolbar).html() || "").render(e) : n.templet ? "function" == typeof n.templet ? n.templet(e) : laytpl($(n.templet).html() || String(u)).render(e) : k + ":" + u }(), "</div>"].join("") }0 != S.length && g.push(S) } else w = ['<td data-field="' + c + '" data-key="' + d + '" ' + function () { var e = []; return n.edit && e.push('data-edit="' + n.edit + '"'), n.align && e.push('align="' + n.align + '"'), n.templet && e.push('data-content="' + u + '"'), n.toolbar && e.push('data-off="true"'), n.event && e.push('lay-event="' + n.event + '"'), n.style && e.push('style="' + n.style + '"'), n.minWidth && e.push('data-minwidth="' + n.minWidth + '"'), n.currency && e.push('data-currency="' + n.currency + '"'), e.join(" ") }() + ' class="' + function () { var e = []; return n.hide && e.push(HIDE), n.field || e.push("layui-table-col-special"), e.join(" ") }() + '">', '<div class="layui-table-cell laytable-cell-' + ("normal" === n.type ? d : d + " laytable-cell-" + n.type) + '">' + function () { var t = $.extend(!0, { LAY_INDEX: b }, s), c = table.config.checkName; switch (n.type) { case "checkbox": var d = s[o.config.onlyKey]; return '<input type="checkbox" ' + o.checkedDefault(d, i) + ' name="layTableCheckbox" lay-skin="primary" ' + (n[c] ? (s[c] = n[c], n[c] ? "checked" : "") : t[c] ? "checked" : "") + ">"; case "radio": return t[c] && (e = i), '<input type="radio" name="layTableRadio_' + r.index + '" ' + (t[c] ? "checked" : "") + ' lay-type="layTableRadio">'; case "numbers": return b; case "currency": if (!n.templet) return n.tofix ? table.formatNumberByPermil(parseFloat(s[n.field]).toFixed(parseInt(n.tofix))) : table.formatNumberByPermil(s[n.field]) }return n.toolbar ? laytpl($(n.toolbar).html() || "").render(t) : n.templet ? "function" == typeof n.templet ? n.templet(t) : laytpl($(n.templet).html() || String(u)).render(t) : n.tofix ? parseFloat(u).toFixed(parseInt(n.tofix)) : u }(), "</div></td>"].join(""); var N, A; h.push(w), "cardListMode" != r.mode && (n.fixed && "right" !== n.fixed && p.push(w), "right" === n.fixed && y.push(w)) } })), "imgListMode" == r.mode) { var k = r.setsing, w = ""; if (k) { for (var C = [], D = 0, E = k.length; D < E; D++)s && C.push("<li><span>" + k[D].title + ":</span>" + s[k[D].field] + "</li>"); w = '<div class="layui-table-cell table-info-cell"><ul class="ul-list">' + C.join("") + "</ul></div>" } c.push('<tr class="layu-trhead" data-index="' + i + '">' + h.join("") + '<td colspan="' + (r.cols[0].length - h.length) + '">' + w + '<div vlass="layui-table-cell table-images-cell"><ul class="ul-info-list">' + m.join("") + "</ul></div></td></tr>") } else "cardListMode" == r.mode ? r.vertical ? c.push('<div class=" card-item vertical-item" data-index="' + i + '"><div class="tp">' + h.join("") + '</div><div class="text">' + g.join("") + "</div></div>") : c.push('<div class=" card-item" data-index="' + i + '"><div class=" layui-row grid-demo item">' + h.join("") + '<div class="text">' + g.join("") + "</div></div></div>") : (c.push('<tr data-index="' + i + '">' + h.join("") + "</tr>"), d.push('<tr data-index="' + i + '">' + p.join("") + "</tr>"), u.push('<tr data-index="' + i + '">' + y.join("") + "</tr>")) })), o.layBody.scrollTop(0), o.layMain.find("." + NONE).remove(), "cardListMode" == r.mode) var i = ".layui-table"; else i = "tbody"; if (o.layMain.find(i).html(c.join("")), "listMode" == r.mode && (o.layFixLeft.find("tbody").html(d.join("")), o.layFixRight.find("tbody").html(u.join(""))), $(".imgbox a").length > 0) { var h = $(".imgbox a").height(); h && $(".imgbox a").css("line-height", h + "px") } $(".layui-table-cell").find("select").length > 0 && ($(".layui-table-cell").find("select").parent(".layui-table-cell").css("overflow", "visible"), $(".layui-table-cell").find("select").parent(".layui-table-cell").addClass("layui-table-cell-active")), o.renderForm(), "number" == typeof e && o.setThisRowChecked(e), o.syncCheckAll(), o.scrollPatch(), layer.close(o.tipsIndex), o.loadingnews(!0), r.HAS_SET_COLS_PATCH || o.setColsPatch(), r.HAS_SET_COLS_PATCH = !0 }; if (o.key = r.id || r.index, table.cache[o.key] = s, o.config.flipCheck && null == table.checkedMultiList[o.key] && (table.checkedMultiList[o.key] = []), o.layPage[0 == i || 0 === s.length && 1 == t ? "addClass" : "removeClass"](HIDE), n) return render(); if (0 === s.length) { o.renderForm(), o.layFixed.remove(), o.layMain.find("tbody").html(""), o.layMain.find("." + NONE).remove(); var h = 0, p = 0, y = 0, m = 0; return o.layMain.height() > 150 ? (h = "40px", p = "80px", y = "22px", m = "10px") : (h = "10px", p = "40px", y = "14px", m = "5px"), o.layMain.append('<div class="' + NONE + '" style="padding-bottom: 0;"> <div class="empty-data" style="text-align:center;padding-top: ' + h + ';font-size: 25px;color: #ccc;font-family: tahoma ,微软雅黑;"> <i class="layui-icon layui-icon-search" style="font-size: ' + p + ';"></i> <div style="padding-top: ' + m + ";font-size: " + y + ';">' + r.text.none + "</div> </div></div>") } render(), o.renderTotal(s), r.page && (r.page = $.extend({ elem: "layui-table-page" + r.index, count: i, limit: r.limit, limits: r.limits || [20, 50, 100, 200, 500, 1e3], groups: 3, layout: ["prev", "page", "next", "skip", "count", "limit"], prev: '<i class="layui-icon"></i>', next: '<i class="layui-icon"></i>', jump: function (e, t) { t || (r.limit = e.limit, o.loadingnews(), r.dataSource ? r.dataSource.reload({ params: { page: e.curr, limit: e.limit } }) : o.pullData(e.curr)) } }, r.page), r.page.count = i, laypage.render(r.page)) }, Class.prototype.renderTotal = function (e) { var t = this, i = t.config, n = {}; if (i.totalRow) { layui.each(e, (function (e, o) { 0 !== o.length && ("cardListMode" == i.mode ? t.eachTotalCols((function (e, i) { var r = i.field || e, s = o[r]; i.totalRow && (n[r] = t.add(n[r] || 0, parseFloat(s) || 0)) })) : t.eachCols((function (e, i) { var r = i.field || e, s = o[r]; i.totalRow && (n[r] = t.add(n[r] || 0, parseFloat(s) || 0)) }))) })); var o = []; "cardListMode" == i.mode ? (t.eachTotalCols((function (e, t) { var i = t.field || e; if (!t.hide) { var r, s, c, d, u, h, p = ['<div data-field="' + i + '" ' + (h = [], t.align && h.push('align="' + t.align + '"'), t.style && h.push('style="' + t.style + '"'), h.join(" ") + ' class="layui-table-cell total-box">') + (r = t.totalRowText || "", s = t.unit || "", c = parseFloat(t.total) || 0, d = t.classname || "total" + e, u = t.decimal, t.totalRow && !t.checkstate ? t.totalRow ? r + '<span class="' + d + '">' + (u ? n[i].toFixed(2) : n[i]) + "</span>" + s : r : r + '<span class="' + d + '">' + (u ? c.toFixed(2) : c) + "</span>" + s), "</div>"].join(""); o.push(p) } })), t.layTotal.find(".layui-table-total-box").html(o.join(""))) : (t.eachCols((function (e, t) { var r = t.field || e; if (!t.hide) { t.tofix && (n[r] = parseFloat(n[r]).toFixed(parseInt(t.tofix))); var s, c, d, u = ['<td data-field="' + r + '" data-key="' + i.index + "-" + t.key + '" ' + (d = [], t.align && d.push('align="' + t.align + '"'), t.style && d.push('style="' + t.style + '"'), t.minWidth && d.push('data-minwidth="' + t.minWidth + '"'), d.join(" ") + ">"), '<div class="layui-table-cell laytable-cell-' + (c = i.index + "-" + t.key, ("normal" === t.type ? c : c + " laytable-cell-" + t.type) + '">') + (s = t.totalRowText || "", t.totalRow ? "currency" === t.type ? table.formatNumberByPermil(n[r] || s) : n[r] || s : s), "</div></td>"].join(""); o.push(u) } })), t.layTotal.find("tbody").html("<tr>" + o.join("") + "</tr>")) } }, Class.prototype.renderCheckTotal = function (e) { var t = this, i = t.config, n = {}; i.totalRow && (layui.each(e, (function (e, i) { 0 !== i.length && t.eachTotalCols((function (e, o) { var r = o.field || e, s = i[r]; o.totalRow && (n[r] = t.add(n[r] || 0, parseFloat(s) || 0)) })) })), t.eachTotalCols((function (i, o) { var r = o.field || i; if (!o.hide) { o.totalRowText, o.unit; var s = o.classname || "total" + i, c = o.decimal, d = n[r] ? n[r] : 0; o.checkstate && (o.field ? t.layTotal.find(".layui-table-total-box ." + s).text(c ? d.toFixed(2) : d) : t.layTotal.find(".layui-table-total-box ." + s).text(e.length)) } }))) }, Class.prototype.add = function (e, t) { var i, n, o, r; try { i = e.toString().split(".")[1].length } catch (e) { i = 0 } try { n = t.toString().split(".")[1].length } catch (e) { n = 0 } if (r = Math.abs(i - n), o = Math.pow(10, Math.max(i, n)), r > 0) { var s = Math.pow(10, r); i > n ? (e = Number(e.toString().replace(".", "")), t = Number(t.toString().replace(".", "")) * s) : (e = Number(e.toString().replace(".", "")) * s, t = Number(t.toString().replace(".", ""))) } else e = Number(e.toString().replace(".", "")), t = Number(t.toString().replace(".", "")); return (e + t) / o }, Class.prototype.getColElem = function (e, t) { var i = this.config; return e.eq(0).find(".laytable-cell-" + i.index + "-" + t + ":eq(0)") }, Class.prototype.renderForm = function (e) { form.render(e, "LAY-table-" + this.index) }, Class.prototype.setThisRowChecked = function (e) { var t = "cardListMode" == this.config.mode ? ".card-item" : "tr"; this.layBody.find(t + '[data-index="' + e + '"]').addClass("layui-table-click").siblings("tr").removeClass("layui-table-click") }, Class.prototype.sort = function (e, t, i, n) { var o, r = {}, s = this.config, c = "cardListMode" == s.mode ? "li" : "th", d = s.elem.attr("lay-filter"), u = table.cache[this.key]; "string" == typeof e && this.layHeader.find(c).each((function (t, i) { var n = $(this), o = n.data("field"); if (o === e) return e = n, h = o, !1 })); try { var h = h || e.data("field"), p = e.data("key"); if (this.sortKey && !i && h === this.sortKey.field && t === this.sortKey.sort) return; var y = this.layHeader.find(c + " .laytable-cell-" + p).find(ELEM_SORT); s.dataSource || this.layHeader.find(c).find(ELEM_SORT).removeAttr("lay-sort"), y.attr("lay-sort", t || null), "cardListMode" != s.mode && this.layFixed.find("th") } catch (e) { return hint.error("Table modules: Did not match to field") } this.sortKey = { field: h, sort: t }, s.sortload || ("asc" === t ? o = layui.sort(u, h) : "desc" === t ? o = layui.sort(u, h, !0) : (o = layui.sort(u, table.config.indexName), delete this.sortKey)), r[s.response.dataName] = o || u, this.renderData(r, this.page, this.count, !0), n && layui.event.call(e, MOD_NAME, "sort(" + d + ")", { field: h, type: t }) }, Class.prototype.loading = function (e) { this.config.loading && (e ? (this.layInit && this.layInit.remove(), delete this.layInit, this.layBox.find(ELEM_INIT).remove()) : (this.layInit = $(['<div class="layui-table-init">', '<i class="layui-icon layui-icon-loading layui-icon"></i>', "</div>"].join("")), this.layBox.append(this.layInit))) }, Class.prototype.loadingnews = function (e) { var t = layer.msg("数据查询中,请稍候...", { icon: 16, time: !1, shade: .1 }); e && layer.close(t) }, Class.prototype.setCheckData = function (e, t) { var i = this.config, n = table.cache[this.key]; n[e] && n[e].constructor !== Array && (n[e][i.checkName] = t) }, Class.prototype.syncCheckAll = function () { var e = this, t = e.config, i = e.layHeader.find('input[name="layTableCheckbox"]'), syncColsCheck = function (i) { return e.eachCols((function (e, n) { "checkbox" === n.type && (n[t.checkName] = i) })), i }; i[0] && (table.checkStatus(e.key).isAll ? (i[0].checked || (i.prop("checked", !0), e.renderForm("checkbox")), syncColsCheck(!0)) : (i[0].checked && (i.prop("checked", !1), e.renderForm("checkbox")), syncColsCheck(!1))) }, Class.prototype.getCssRule = function (e, t) { var i = this.elem.find("style")[0], n = i.sheet || i.styleSheet || {}, o = n.cssRules || n.rules; layui.each(o, (function (i, n) { if (n.selectorText === ".laytable-cell-" + e) return t(n), !0 })) }, Class.prototype.fullSize = function () { var e, t = this.config, i = t.height; this.fullHeightGap && ((i = _WIN.height() - this.fullHeightGap) < 135 && (i = 135), this.elem.css("height", i)), i && (e = parseFloat(i) - (this.layHeader.outerHeight() || 38), t.toolbar && (e -= this.layTool.outerHeight() || 50), t.totalRow && (e -= this.layTotal.outerHeight() || 40), t.page && (e = e - (this.layPage.outerHeight() || 41) - 2), this.layMain.css("height", e)) }, Class.prototype.getScrollWidth = function (e) { var t = 0; return e ? t = e.offsetWidth - e.clientWidth : ((e = document.createElement("div")).style.width = "100px", e.style.height = "100px", e.style.overflowY = "scroll", document.body.appendChild(e), t = e.offsetWidth - e.clientWidth, document.body.removeChild(e)), t }, Class.prototype.scrollPatch = function () { var e = "cardListMode" == this.config.mode ? ".layui-table" : "table", t = this.layMain.children(e), i = this.layMain.width() - this.layMain.prop("clientWidth"), n = this.layMain.height() - this.layMain.prop("clientHeight"), o = (this.getScrollWidth(this.layMain[0]), t.outerWidth() - this.layMain.width()), addPatch = function (e) { if (i && n) { if (!(e = e.eq(0)).find(".layui-table-patch")[0]) { var t = $('<th class="layui-table-patch"><div class="layui-table-cell"></div></th>'); t.find("div").css({ width: i }), e.find("tr").append(t) } } else e.find(".layui-table-patch").remove() }; addPatch(this.layHeader), addPatch(this.layTotal); var r = this.layMain.height() - n; this.layFixed.find(ELEM_BODY).css("height", t.height() > r ? r : "auto"), this.layFixRight[o > 0 ? "removeClass" : "addClass"](HIDE), this.layFixRight.css("right", i - 1) }, Class.prototype.checkedDefault = function (e, t) { var i = ""; if (this.config.flipCheck) { var n = this.config.onlyKey; if (null != table.checkedMultiList[this.key] && table.checkedMultiList[this.key].length > 0) { var o = table.checkedMultiList[this.key].filter((function (t, i) { return t[n] == e })); null != o && o.length > 0 && (i = "checked", this.setCheckData(t, !0)) } this.syncCheckAll() } return i }, Class.prototype.events = function () { var e, t = this, i = t.config, n = $("body"), o = "cardListMode" == i.mode ? "li" : "th", r = "cardListMode" == i.mode ? ".card-item" : "tr", s = {}, c = t.layHeader.find(o), d = ".layui-table-cell", u = i.elem.attr("lay-filter"); t.layTool.on("click", "*[lay-event]", (function (e) { var n, o = $(this), r = o.attr("lay-event"), openPanel = function (e) { var i = $(e.list), n = $('<ul class="layui-table-tool-panel"></ul>'); n.html(i), o.find(".layui-table-tool-panel")[0] || o.append(n), t.renderForm(), n.on("click", (function (e) { layui.stope(e) })), e.done && e.done(n, i) }; switch (layui.stope(e), _DOC.trigger("table.tool.panel.remove"), layer.close(t.tipsIndex), r) { case "LAYTABLE_COLS": openPanel({ list: (n = [], t.eachCols((function (e, t) { t.field && "normal" == t.type && n.push('<li><input type="checkbox" name="' + t.field + '" data-key="' + t.key + '" data-parentkey="' + (t.parentKey || "") + '" lay-skin="primary" ' + (t.hide ? "" : "checked") + ' title="' + (t.title || t.field) + '" lay-filter="LAY_TABLE_TOOL_COLS"></li>') })), n.join("")), done: function () { form.on("checkbox(LAY_TABLE_TOOL_COLS)", (function (e) { var n = $(e.elem), o = this.checked, r = n.data("key"), s = n.data("parentkey"), c = [], d = { field: n.attr("name"), title: n.attr("title"), hide: !o, key: r }; if (layui.each(i.cols, (function (e, n) { layui.each(n, (function (n, d) { if (e + "-" + n === r) { var u = d.hide; d.hide = !o, t.elem.find('*[data-key="' + i.index + "-" + r + '"]')[o ? "removeClass" : "addClass"](HIDE), u != d.hide && t.setParentCol(!o, s), t.fullSize(), t.scrollPatch(), t.setColsWidth() } d.field && "normal" == d.type && c.push({ field: d.field, hide: d.hide }) })) })), t.saveUserPdata(c), 1 == i.sortcols[0].length && "cardListMode" == i.mode) { for (var u = t.config.sortcols[0], h = 0; h < u.length; h++)u[h].field == d.field && (u[h] = d); var p = []; p.push(u), t.config.sortcols = p } })) } }); break; case "LAYTABLE_EXPORT": device.ie ? layer.tips("导出功能不支持 IE,请用 Chrome 等高级浏览器导出", this, { tips: 3 }) : openPanel({ list: ['<li data-type="csv">导出到 Csv 文件</li>', '<li data-type="xls">导出到 Excel 文件</li>'].join(""), done: function (e, t) { t.on("click", (function () { var e = $(this).data("type"); table.exportFile(i.id, null, e) })) } }); break; case "LAYTABLE_PRINT": var s = window.open("打印窗口", "_blank"), c = ["<style>", "body{font-size: 12px; color: #666;}", "table{width: 100%; border-collapse: collapse; border-spacing: 0;}", "th,td{line-height: 20px; padding: 9px 15px; border: 1px solid #ccc; text-align: left; font-size: 12px; color: #666;}", "a{color: #666; text-decoration:none;}", "*.layui-hide{display: none}", "</style>"].join(""), d = $(t.layHeader.html()); d.append(t.layMain.find("table").html()), d.find("th.layui-table-patch").remove(), d.find(".layui-table-col-special").remove(), s.document.write(c + d.prop("outerHTML")), s.document.close(), s.print(), s.close() }layui.event.call(this, MOD_NAME, "toolbar(" + u + ")", $.extend({ event: r, config: i }, {})) })), c.on("mousemove", (function (e) { var t = $(this), i = t.offset().left, o = e.clientX - i; t.data("unresize") || s.resizeStart || (s.allowResize = t.width() - o <= 10, n.css("cursor", s.allowResize ? "col-resize" : "")) })).on("mouseleave", (function () { $(this); s.resizeStart || n.css("cursor", "") })).on("mousedown", (function (e) { var n = $(this); if (s.allowResize) { var o = n.data("key"); e.preventDefault(), s.resizeStart = !0, s.offset = [e.clientX, e.clientY], t.getCssRule(o, (function (e) { var t = e.style.width || n.outerWidth(); s.rule = e, s.ruleWidth = parseFloat(t), s.minWidth = n.data("minwidth") || i.cellMinWidth })) } })).on("mouseup", (function (e) { var i = $(this), n = i.data("field"), o = i.data("key"); e.preventDefault(), t.getCssRule(o, (function (e) { var o = e.style.width || i.outerWidth(); layui.each(t.config.cols, (function (e, t) { layui.each(t, (function (e, t) { t.field && t.field == n && (t.width = parseFloat(o)) })) })) })) })), _DOC.on("mousemove", (function (i) { if (s.resizeStart) { if (i.preventDefault(), s.rule) { var n = s.ruleWidth + i.clientX - s.offset[0]; n < s.minWidth && (n = s.minWidth), s.rule.style.width = n + "px", layer.close(t.tipsIndex) } e = 1 } })).on("mouseup", (function (i) { s.resizeStart && (s = {}, n.css("cursor", ""), t.scrollPatch()), 2 === e && (e = null) })), c.on("click", (function (n) { var o, r = $(this), s = r.find(ELEM_SORT), c = s.attr("lay-sort"), d = r.data("field"); if (!s[0] || 1 === e) return e = 2; if (o = "asc" === c ? "desc" : "desc" === c ? null : "asc", t.config.sortload) if (t.loadingnews(), i.dataSource) { var u = i.dataSource, h = {}; t.config.initSort = t.config.initSort || {}; var p = t.config.initSort; for (var y in p) h[y] = p[y]; h[d] = null != o ? o : "", t.config.initSort[d] = o, u.reload({ sort: h }) } else table.reload(t.config.id, { initSort: { field: d, type: o }, where: { FIELD: d, ORDER: o } }); else t.sort(r, o, null, !0) })).find(ELEM_SORT + " .layui-edge ").on("click", (function (e) { var n, o = $(this), r = o.index(), s = o.parents("th").eq(0).data("field"); if (layui.stope(e), n = 0 === r ? "asc" : "desc", t.config.sortload) if (t.loadingnews(), i.dataSource) { var c = i.dataSource, d = {}; t.config.initSort = t.config.initSort || {}; var u = t.config.initSort; for (var h in u) d[h] = u[h]; d[s] = n, t.config.initSort[s] = n, c.reload({ sort: d }) } else table.reload(t.config.id, { initSort: { field: s, type: n }, where: { FIELD: s, ORDER: n } }); else t.sort(s, n, null, !0) })); var commonMember = function (e) { var n = $(this), o = "cardListMode" == i.mode ? "dic" : "td", s = n.parents(r).eq(0).data("index"), c = t.layBody.find(r + '[data-index="' + s + '"]'), u = table.cache[t.key][s]; return $.extend({ tr: c, data: table.clearCacheKey(u), del: function () { table.cache[t.key][s] = [], c.remove(), t.scrollPatch() }, update: function (e) { e = e || {}, layui.each(e, (function (e, i) { if (e in u) { var n, r = c.children(o + '[data-field="' + e + '"]'); u[e] = i, t.eachCols((function (t, i) { i.field == e && i.templet && (n = i.templet) })), r.children(d).html(n ? "function" == typeof n ? n(u) : laytpl($(n).html() || i).render(u) : i), r.data("content", i) } })) } }, e) }; t.elem.on("click", 'input[name="layTableCheckbox"]+', (function () { var e = $(this).prev(), i = t.layBody.find('input[name="layTableCheckbox"]'), n = e.parents(r).eq(0).data("index"), o = e[0].checked, s = "layTableAllChoose" === e.attr("lay-filter"); if (s ? (i.each((function (e, i) { i.checked = o, t.setCheckData(e, o) })), t.syncCheckAll(), t.renderForm("checkbox")) : (t.setCheckData(n, o), t.syncCheckAll()), t.config.flipCheck) { var c = [], d = [], h = t.config.onlyKey; if (o) c = table.checkStatus(t.key).data; else if (s) { d = table.cache[t.key] } else { var p = table.cache[t.key]; if (!p[n]) return; if (p[n].constructor === Array) return; d.push(p[n]) } $.each(d, (function (e, i) { var n = i[t.config.onlyKey]; table.checkedMultiList[t.key] = table.checkedMultiList[t.key].filter((function (e, t) { return e[h] != n })) })), $.each(c, (function (e, i) { var n = i[t.config.onlyKey], o = table.checkedMultiList[t.key].filter((function (e, t) { return e[h] == n })); if (null == o || 0 == o.length) { var r = {}; r[h] = n, t.config.attachFieldsName.length > 0 ? $.each(t.config.attachFieldsName, (function (e, t) { r[t] = i[t] })) : r = i, table.checkedMultiList[t.key].push(r) } })) } layui.event.call(e[0], MOD_NAME, "checkbox(" + u + ")", commonMember.call(e[0], { checked: o, type: s ? "all" : "one" })), t.renderCheckTotal(table.checkStatus(t.key).data) })), t.elem.on("click", 'input[lay-type="layTableRadio"]+', (function () { var e = $(this).prev(), i = e[0].checked, n = table.cache[t.key], o = e.parents("tr").eq(0).data("index"); layui.each(n, (function (e, t) { o === e ? t.LAY_CHECKED = !0 : delete t.LAY_CHECKED })), t.setThisRowChecked(o), layui.event.call(this, MOD_NAME, "radio(" + u + ")", commonMember.call(this, { checked: i })) })), t.layBody.on("mouseenter", r, (function () { var e = $(this).index(); t.layBody.find(r + ":eq(" + e + ")").addClass(ELEM_HOVER) })).on("mouseleave", r, (function () { var e = $(this).index(); t.layBody.find(r + ":eq(" + e + ")").removeClass(ELEM_HOVER) })).on("click", r, (function () { setRowEvent.call(this, "row") })).on("dblclick", r, (function () { setRowEvent.call(this, "rowDouble") })); var setRowEvent = function (e) { var t = $(this), n = "cardListMode" == i.mode ? "dic" : "td"; layui.event.call(this, MOD_NAME, e + "(" + u + ")", commonMember.call(t.children(n)[0])) }; t.layBody.on("change", "." + ELEM_EDIT, (function () { var e = $(this), i = this.value, n = e.parent().data("field"), o = e.parents("tr").eq(0).data("index"); table.cache[t.key][o][n] = i, layui.event.call(this, MOD_NAME, "edit(" + u + ")", commonMember.call(this, { value: i, field: n })) })).on("blur", "." + ELEM_EDIT, (function () { var e, i, n = $(this), o = n.parent().data("field"), r = n.parents("tr").eq(0).data("index"), s = table.cache[t.key][r]; t.eachCols((function (t, i) { i.field == o && i.templet && (e = i.templet) })), n.siblings(d).html((i = this.value, e ? function () { return "function" == typeof e ? e(s) : laytpl($(e).html() || this.value).render(s) }() : i)), n.parent().data("content", this.value), n.remove() })), t.layBody.on("dblclick", "td", (function () { var e = $(this), n = e.data("field"), o = (e.data("edit"), e.children(d), e.parents("tr").eq(0).data("index")), r = table.cache[t.key][o]; i.event && i.event.onRowdbClick && ($('tr[data-index="' + o + '"]').addClass("layui-table-click").siblings().removeClass("layui-table-click"), i.event.onRowdbClick(n, r)) })), t.layBody.on("click", "td", (function () { var e = $(this), n = e.data("field"), o = e.data("edit"), r = e.children(d), s = e.parents("tr").eq(0).data("index"), c = table.cache[t.key][s]; if (i.event && i.event.onRowClick && ($('tr[data-index="' + s + '"]').addClass("layui-table-click").siblings().removeClass("layui-table-click"), i.event.onRowClick(n, c)), layer.close(t.tipsIndex), !e.data("off") && o) { var u = $('<input class="layui-input ' + ELEM_EDIT + '">'); return u[0].value = e.data("content") || r.text(), e.find("." + ELEM_EDIT)[0] || e.append(u), void u.focus() } })).on("mouseenter", "td", (function () { gridExpand.call(this) })).on("mouseleave", "td", (function () { gridExpand.call(this, "hide") })); var gridExpand = function (e) { var t = $(this), i = t.children(d); if (e) t.find(".layui-table-grid-down").remove(); else if (i.prop("scrollWidth") > i.outerWidth()) { if (i.find(".layui-table-grid-down")[0]) return; t.append('<div class="layui-table-grid-down"><i class="layui-icon layui-icon-down"></i></div>') } }; if (t.layBody.on("click", ".layui-table-grid-down", (function (e) { var n = $(this).parent().children(d); t.tipsIndex = layer.tips(['<div class="layui-table-tips-main" style="margin-top: -' + (n.height() + 16) + "px;" + ("sm" === i.size ? "padding: 4px 15px; font-size: 12px;" : "lg" === i.size ? "padding: 14px 15px;" : "") + '">', n.html(), "</div>", '<i class="layui-icon layui-table-tips-c layui-icon-close"></i>'].join(""), n[0], { tips: [3, ""], time: -1, anim: -1, maxWidth: device.ios || device.android ? 300 : t.elem.width() / 2, isOutAnim: !1, skin: "layui-table-tips", success: function (e, t) { e.find(".layui-table-tips-c").on("click", (function () { layer.close(t) })) } }), layui.stope(e) })), t.layBody.on("click", "*[lay-event]", (function () { var e = $(this), i = e.parents(r).eq(0).data("index"); layui.event.call(this, MOD_NAME, "tool(" + u + ")", commonMember.call(this, { event: e.attr("lay-event") })), t.setThisRowChecked(i) })), t.layMain.on("scroll", (function () { var e = $(this), i = e.scrollLeft(), n = e.scrollTop(); t.layHeader.scrollLeft(i), t.layTotal.scrollLeft(i), t.layFixed.find(ELEM_BODY).scrollTop(n), layer.close(t.tipsIndex) })), _DOC.on("click", (function () { _DOC.trigger("table.remove.tool.panel") })), _DOC.on("table.remove.tool.panel", (function () { $(".layui-table-tool-panel").remove() })), _WIN.on("resize", (function () { t.fullSize(), t.scrollPatch(), t.setColsWidth() })), void 0 === i.drag || i.drag) { if (i.cols.length > 1) return; var h = (A = $(i.elem)).next().children(".layui-table-box"), p = $.merge(h.children(".layui-table-header").children("table"), h.children(".layui-table-fixed").children(".layui-table-header").children("table")), y = h.children(".layui-table-fixed").children(".layui-table-body").children("table"), m = h.children(".layui-table-body").children("table"), g = $.merge(h.children(".layui-table-body").children("table"), y), b = A.next().children(".layui-table-total").children("table"), k = A.next().children(".layui-table-total").children("table.layui-table-total-fixed"), w = A.next().children(".layui-table-total").children("table:eq(0)"), C = i.id, D = "simple" === i.drag || i.drag && "simple" === i.drag.type, E = i.drag && i.drag.toolbar, S = !1, L = !1; if (!p.attr("drag")) { if (p.attr("drag", !0), E) { h.append('<div class="soul-drag-bar"><div data-type="left">左固定</div><div data-type="none">不固定</div><div data-type="right">右固定</div></div>'); var N = h.children(".soul-drag-bar"); N.children("div").on("mouseenter", (function () { $(this).addClass("active") })).on("mouseleave", (function () { $(this).removeClass("active") })) } p.find("th").each((function () { var e = $(this), t = e.data("field"), n = e.data("key"); if (n) { var o = n.split("-"), r = i.cols[o[1]][o[2]], s = o[1] + "-" + o[2], c = e.parents(".layui-table-fixed").length > 0; $(this).find("span:first,.laytable-cell-checkbox").css("cursor", "move").on("mousedown", (function (o) { if (0 === o.button) { o.preventDefault(); var d = e.clone().css("visibility", "hidden"), u = e.position().left, A = e.offset().top, _ = o.clientX - u, F = e.parents("tr:eq(0)").css("background-color"), I = e.width(), j = $(this), H = r.fixed; L = !0, $(document).bind("selectstart", (function () { return !1 })), $("body").on("mousemove", (function (o) { if (L && d) { h.removeClass("no-left-border"), S || (E && (N.attr("data-type", H || "none"), N.addClass("active")), e.after(d), e.addClass("isDrag").css({ position: "absolute", "z-index": 1, "border-left": "1px solid #e6e6e6", "background-color": F, width: I + 1 }), D || ((c ? y : g).find('td[data-key="' + n + '"]').each((function () { $(this).after($(this).clone().css("visibility", "hidden").attr("data-clone", "")), $(this).addClass("isDrag").css({ position: "absolute", "z-index": 1, "border-left": "1px solid #e6e6e6", "background-color": $(this).css("background-color"), width: I + 1 }) })), b.length > 0 && (c ? k : b).find('td[data-key="' + n + '"]').each((function () { $(this).after($(this).clone().css("visibility", "hidden").attr("data-clone", "")), $(this).addClass("isDrag").css({ position: "absolute", "z-index": 1, "background-color": $(this).parents("tr:eq(0)").css("background-color"), width: I + 1 }) })))), S = !0; var r, u, p, m, w, j = o.clientX - _, O = d.prev().prev(), z = O.length > 0, P = z ? O.data("key").split("-") : [], R = d.next().hasClass("layui-table-patch") ? [] : d.next(), B = R.length > 0, W = B ? R.data("key").split("-") : [], Y = z && d.position().left - j > O.width() / 2, X = B && j - d.position().left > R.width() / 2; if (Math.abs(d.position().left - j), d.position().left - j > 0 ? !z || !!H != !!i.cols[P[1]][P[2]].fixed : !B || !!H != !!i.cols[W[1]][W[2]].fixed) return e.css("left", d.position().left), g.find('td[data-key="' + n + '"][data-clone]').each((function (e) { $(this).prev().css("left", d.position().left) })), b.length > 0 && b.find('td[data-key="' + n + '"][data-clone]').each((function (e) { $(this).prev().css("left", d.position().left) })), void h.addClass("no-left-border"); if (e.css("left", j), Y) { for (d.after(O), $("#soul-columns" + C + ">li[data-value=" + t + "]").after($("#soul-columns" + C + ">li[data-value=" + t + "]").prev()), p = 0; p < i.cols.length; p++) { for (m = 0; m < i.cols[p].length; m++)if (i.cols[p][m].key === s) { r = p, u = m; break } if (void 0 !== r && void 0 !== u) break } w = i.cols[r][u - 1], i.cols[r][u - 1] = i.cols[r][u], i.cols[r][u] = w, i.filter && i.filter.cache && localStorage.setItem(location.pathname + location.hash + i.id, _this.deepStringify(i.cols)) } else if (X) { for (d.prev().before(R), $("#soul-columns" + C + ">li[data-value=" + t + "]").before($("#soul-columns" + C + ">li[data-value=" + t + "]").next()), p = 0; p < i.cols.length; p++) { for (m = 0; m < i.cols[p].length; m++)if (i.cols[p][m].key === s) { r = p, u = m; break } if (void 0 !== r && void 0 !== u) break } w = i.cols[r][u + 1], i.cols[r][u + 1] = i.cols[r][u], i.cols[r][u] = w, i.filter && i.filter.cache && localStorage.setItem(location.pathname + location.hash + i.id, _this.deepStringify(i.cols)) } g.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().css("left", j), Y ? 0 !== $(this).prev().prev().length && $(this).after($(this).prev().prev()) : X && 0 !== $(this).next().length && $(this).prev().before($(this).next()) })), b.length > 0 && b.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().css("left", j), Y ? 0 !== $(this).prev().prev().length && $(this).after($(this).prev().prev()) : X && 0 !== $(this).next().length && $(this).prev().before($(this).next()) })), o.clientY - A < -15 ? (0 === $("#column-remove").length && $("body").append('<i id="column-remove" class="layui-red layui-icon layui-icon-delete"></i>'), $("#column-remove").css({ top: o.clientY - $("#column-remove").height() / 2, left: o.clientX - $("#column-remove").width() / 2, "font-size": A - o.clientY + "px" }), $("#column-remove").show()) : $("#column-remove").hide() } })).on("mouseup", (function () { if ($(document).unbind("selectstart"), $("body").off("mousemove").off("mouseup"), L && d) { if (L = !1, S) { "checkbox" !== r.type && j.on("click", (function (e) { e.stopPropagation() })), S = !1, h.removeClass("no-left-border"), e.removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", "border-left": "inherit", width: "inherit", "background-color": "inherit" }), e.next().remove(); var o = e.prev().data("key"); if (H) { var u = h.children(".layui-table-header").children("table").find('th[data-key="' + n + '"]'); o ? u.parent().children('th[data-key="' + o + '"]').after(u) : "right" === H ? e.siblings().length > 0 && h.children(".layui-table-header").children("table").find('th[data-key="' + e.next().data("key") + '"]').prev().after(u) : (u.parent().prepend('<th class="layui-hide"></th>'), u.parent().children("th:first").after(u), u.parent().children("th:first").remove()) } if (D ? (g.find('td[data-key="' + n + '"]').each((function () { if (o) $(this).parent().children('td[data-key="' + o + '"]').after($(this)); else if ("right" === H) { if (e.siblings().length > 0) { var t = $(this).parent().children('td[data-key="' + e.next().data("key") + '"]').prev(); t.length > 0 ? t.after($(this)) : ($(this).parent().prepend('<td class="layui-hide"></td>'), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove()) } } else $(this).parent().prepend('<td class="layui-hide"></td>'), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove() })), b.length > 0 && b.find('td[data-key="' + n + '"]').each((function () { if (o) $(this).parent().children('td[data-key="' + o + '"]').after($(this)); else if ("right" === H) { var t = $(this).parent().children('td[data-key="' + e.next().data("key") + '"]').prev(); t.length > 0 ? t.after($(this)) : ($(this).parent().prepend('<td class="layui-hide"></td>'), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove()) } else $(this).parent().prepend('<td class="layui-hide"></td>'), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove() }))) : c ? (m.find('td[data-key="' + n + '"]').each((function () { if (o) $(this).parent().children('td[data-key="' + o + '"]').after($(this)); else if ("right" === H) { if (e.siblings().length > 0) { var t = $(this).parent().children('td[data-key="' + e.next().data("key") + '"]').prev(); t.length > 0 ? t.after($(this)) : ($(this).parent().prepend('<td class="layui-hide"></td>'), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove()) } } else $(this).parent().prepend('<td class="layui-hide"></td>'), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove() })), y.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", "border-left": "inherit", width: "inherit", "background-color": "inherit" }), $(this).remove() })), b.length > 0 && (w.find('td[data-key="' + n + '"]').each((function () { if (o) $(this).parent().children('td[data-key="' + o + '"]').after($(this)); else if ("right" === H) { var t = $(this).parent().children('td[data-key="' + e.next().data("key") + '"]').prev(); t.length > 0 ? t.after($(this)) : ($(this).parent().prepend('<td class="layui-hide"></td>'), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove()) } else $(this).parent().prepend('<td class="layui-hide"></td>'), $(this).parent().children("td:first").after($(this)), $(this).parent().children("td:first").remove() })), k.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", width: "inherit", "background-color": "inherit" }), $(this).remove() })))) : (g.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", width: "inherit", "background-color": "inherit" }), $(this).remove() })), b.length > 0 && b.find('td[data-key="' + n + '"][data-clone]').each((function () { $(this).prev().removeClass("isDrag").css({ position: "relative", "z-index": "inherit", left: "inherit", width: "inherit", "background-color": "inherit" }), $(this).remove() }))), d = null, E) { if (N.children(".active").length > 0 && N.children(".active").attr("data-type") !== N.attr("data-type")) { var A, _, F, I, O = N.children(".active").attr("data-type"); for (A = 0; A < i.cols.length; A++)for (_ = 0; _ < i.cols[A].length; _++)"right" === O || "none" === O && "right" === N.attr("data-type") ? void 0 === I && ("right" === i.cols[A][_].fixed ? I = { x: A, y: _ } : _ === i.cols[A].length - 1 && (I = { x: A, y: _ + 1 })) : void 0 !== I || i.cols[A][_].fixed && "right" !== i.cols[A][_].fixed || (I = { x: A, y: _ }), i.cols[A][_].key === s && (F = { x: A, y: _ }); r.fixed = "none" !== O && O, F.y !== I.y && (i.cols[F.x].splice(F.y, 1), F.y < I.y && (I.y -= 1), i.cols[I.x].splice(I.y, 0, r), i.filter && i.filter.cache && localStorage.setItem(location.pathname + location.hash + i.id, _this.deepStringify(i.cols))), table.reload(C) } N.removeClass("active") } } else j.unbind("click"); $("#column-remove").is(":visible") && (p.find("thead>tr>th[data-key=" + n + "]").addClass(HIDE), g.find('tbody>tr>td[data-key="' + n + '"]').addClass(HIDE), b.find('tbody>tr>td[data-key="' + n + '"]').addClass(HIDE), r.hide = !0, i.filter && i.filter.cache && localStorage.setItem(location.pathname + location.hash + i.id, _this.deepStringify(i.cols)), $("#soul-columns" + C).find('li[data-value="' + t + '"]>input').prop("checked", !1), tableFilter.resize(i)), $("#column-remove").hide() } })) } })) } })) } } if (i.rowDrag) { var A = $(i.elem), _ = (y = (h = A.next().children(".layui-table-box")).children(".layui-table-fixed").children(".layui-table-body").children("table"), m = h.children(".layui-table-body").children("table"), g = $.merge(h.children(".layui-table-body").children("table"), y), C = i.id, S = !1, i.rowDrag.trigger || "row"), F = "row" === _ ? g.children("tbody").children("tr") : g.find(_); "row" !== _ && g.find(_).css("cursor", "move"), F.on("mousedown", (function (e) { if (0 === e.button) { var n = "row" === _ ? $(this) : $(this).parents("tr:eq(0)"), o = parseInt(n.data("index")), r = m.children("tbody").children("tr[data-index=" + o + "]"), s = r.clone().css("visibility", "hidden"), c = y.children("tbody").children("tr[data-index=" + o + "]"), d = h.children(".layui-table-body").scrollTop(), u = n.position().top, p = e.clientY - u; $("body").on("mousemove", (function (e) { if (!S) { S = !0; var i = A.next().find("style")[0], n = i.sheet || i.styleSheet || {}; t.addCSSRule(n, ".layui-table-view .layui-table td", "cursor: move"), t.addCSSRule(n, ".layui-table tr", "transition: none"), h.addClass("noselect"), r.after(s), r.css({ position: "absolute", "z-index": 1 }), c.each((function () { $(this).after($(this).clone().css("visibility", "hidden")), $(this).css({ position: "absolute", "z-index": 102 }) })) } var o = e.clientY - p + (h.children(".layui-table-body").scrollTop() - d), u = s.position().top, y = r.prev(), m = y.length > 0, g = s.next(), b = g.length > 0, k = m && u - o > y.height() / 2, w = b && o - u > g.height() / 2; if (u - o > 0 ? !m : !b) return r.css("top", u), void c.each((function () { $(this).css("top", u) })); function updateDataIndex(e, t) { var i = parseInt(e.data("index")) + t; return e.data("index", i), e.attr("data-index", i), e } r.css("top", o), c.each((function () { $(this).css("top", o) })), k ? (updateDataIndex(r, -1), s.after(updateDataIndex(y, 1)), c.each((function () { updateDataIndex($(this), -1), $(this).next().after(updateDataIndex($(this).prev(), 1)) }))) : w && (updateDataIndex(r, 1).before(updateDataIndex(g, -1)), c.each((function () { updateDataIndex($(this), 1), $(this).before(updateDataIndex($(this).next().next(), -1)) }))) })).on("mouseup", (function (e) { if ($("body").off("mousemove").off("mouseup"), S) { S = !1, h.removeClass("noselect"), r.css({ position: "inherit", "z-index": "inherit" }), r.next().remove(), c.each((function () { $(this).css({ position: "inherit", "z-index": "inherit" }), $(this).next().remove() })); var t = A.next().find("style")[0], s = t.sheet || t.styleSheet || {}, d = s.cssRules || s.rules; layui.each(d, (function (e, t) { ".layui-table-view .layui-table td" === t.selectorText && (t.style.cursor = "default") })); var u = n.index(); if (u !== o && "function" == typeof i.rowDrag.done) { var p = layui.table.cache[C], y = p.splice(o, 1)[0]; p.splice(u, 0, y), i.rowDrag.done.call(i, { row: y, newIndex: u, oldIndex: o, cache: p }) } } })) } })) } }, Class.prototype.addCSSRule = function (e, t, i, n) { "insertRule" in e ? e.insertRule(t + "{" + i + "}", n) : "addRule" in e && e.addRule(t, i, n) }, table.init = function (e, t) { t = t || {}; var i = $(e ? 'table[lay-filter="' + e + '"]' : ELEM + "[lay-data]"), n = "Table element property lay-data configuration item has a syntax error: "; return i.each((function () { var i = $(this), o = i.attr("lay-data"); try { o = new Function("return " + o)() } catch (e) { hint.error(n + o) } var r = [], s = $.extend({ elem: this, cols: [], data: [], skin: i.attr("lay-skin"), size: i.attr("lay-size"), even: "string" == typeof i.attr("lay-even") }, table.config, t, o); e && i.hide(), i.find("thead>tr").each((function (e) { s.cols[e] = [], $(this).children().each((function (t) { var i = $(this), o = i.attr("lay-data"); try { o = new Function("return " + o)() } catch (e) { return hint.error(n + o) } var c = $.extend({ title: i.text(), colspan: i.attr("colspan") || 0, rowspan: i.attr("rowspan") || 0 }, o); c.colspan < 2 && r.push(c), s.cols[e].push(c) })) })), i.find("tbody>tr").each((function (e) { var t = $(this), i = {}; t.children("td").each((function (e, t) { var n = $(this), o = n.data("field"); if (o) return i[o] = n.html() })), layui.each(r, (function (e, n) { var o = t.children("td").eq(e); i[n.field] = o.html() })), s.data[e] = i })), table.render(s) })), this }, thisTable.config = {}, table.eachCols = function (e, t, i) { var n = thisTable.config[e] || {}, o = [], r = 0; i = $.extend(!0, [], i || n.cols), layui.each(i, (function (e, t) { layui.each(t, (function (t, n) { if (n.colGroup) { var s = 0; r++, n.CHILD_COLS = [], layui.each(i[e + 1], (function (e, t) { t.PARENT_COL_INDEX || s > 1 && s == n.colspan || (t.PARENT_COL_INDEX = r, n.CHILD_COLS.push(t), s += parseInt(t.colspan > 1 ? t.colspan : 1)) })) } n.PARENT_COL_INDEX || o.push(n) })) })); var eachArrs = function (e) { layui.each(e || o, (function (e, i) { if (i.CHILD_COLS) return eachArrs(i.CHILD_COLS); "function" == typeof t && t(e, i) })) }; eachArrs() }, table.eachTotalCols = function (e, t, i) { var n = thisTable.config[e] || {}, o = [], r = 0; i = $.extend(!0, [], i || n.totalcols), layui.each(i, (function (e, t) { layui.each(t, (function (t, n) { if (n.colGroup) { var s = 0; r++, n.CHILD_COLS = [], layui.each(i[e + 1], (function (e, t) { t.PARENT_COL_INDEX || s > 1 && s == n.colspan || (t.PARENT_COL_INDEX = r, n.CHILD_COLS.push(t), s += parseInt(t.colspan > 1 ? t.colspan : 1)) })) } n.PARENT_COL_INDEX || o.push(n) })) })); var eachArrs = function (e) { layui.each(e || o, (function (e, i) { if (i.CHILD_COLS) return eachArrs(i.CHILD_COLS); "function" == typeof t && t(e, i) })) }; eachArrs() }, table.checkStatus = function (e) { var t = 0, i = 0, n = [], o = table.cache[e] || []; return layui.each(o, (function (e, o) { o.constructor !== Array ? o[table.config.checkName] && (t++, n.push(table.clearCacheKey(o))) : i++ })), { data: n, isAll: !!o.length && t === o.length - i } }, table.exportFileZlDataSource = function (e, t) { var i = thisTable.config[e] || {}, n = layui.cache.contentPath + "/manager/coredatasource/export", o = {}; "0" == t.datalist ? (o[i.request.pageName] = i.page.curr, o[i.request.limitName] = i.limit) : "2" == t.datalist && (o[i.request.pageName] = 1, o[i.request.limitName] = 1e6), o.extraMap = { modelId: t.modelId, dsId: i.dataSource.id }, o.extraMap[i.request.pageName] = o[i.request.pageName], o.extraMap[i.request.limitName] = o[i.request.limitName]; var r = $.extend(o, t), s = $.extend(o, i.where), c = '<form id="downloadexcelform" action="' + n + '" method="post" style="display:none">'; $("#downloadexcelform").length > 0 && $("#downloadexcelform").remove(), r && (r = JSON.stringify(r).replace(/"/g, """).replace(/'/g, "'"), c += '<input name="model" value=\'' + r + "'/>"), s && $.each(s, (function (e, t) { t && (c += '<input name="' + e + "\" value='" + t + "'/>") })), c += "</form>", $("body").append(c), $("#downloadexcelform").prop("action", n), $("#downloadexcelform").submit() }, table.exportFileZl = function (e, t) { var i = thisTable.config[e] || {}; if (i.url) { var n = i.url, o = {}; o[i.request.pageName] = 1, o[i.request.limitName] = 1e6, n.indexOf("?") > -1 ? n = n.substring(0, n.indexOf("?")) + "export" + n.substring(n.indexOf("?"), n.length()) : n += "export"; var r = $.extend(o, i.where), s = '<form id="downloadexcelform" action="' + n + '" method="post" style="display:none">'; $("#downloadexcelform").length > 0 && $("#downloadexcelform").remove(), t && (t = JSON.stringify(t), s += '<input name="model" value=\'' + t + "'/>"), r && $.each(r, (function (e, t) { t && (s += '<input name="' + e + "\" value='" + t + "'/>") })), s += "</form>", $("body").append(s), $("#downloadexcelform").prop("action", n), $("#downloadexcelform").submit() } }, table.exportFile = function (e, t, i) { t = t || table.clearCacheKey(table.cache[e]), i = i || "csv"; var n, o, r = thisTable.config[e] || {}, s = { csv: "text/csv", xls: "application/vnd.ms-excel" }[i], c = document.createElement("a"); if (device.ie) return hint.error("IE_NOT_SUPPORT_EXPORTS"); c.href = "data:" + s + ";charset=utf-8,\ufeff" + encodeURIComponent((n = [], o = [], layui.each(t, (function (t, i) { var r = []; "object" == typeof e ? (layui.each(e, (function (e, i) { 0 == t && n.push(i || "") })), layui.each(table.clearCacheKey(i), (function (e, t) { r.push(t) }))) : table.eachCols(e, (function (e, o) { o.field && "normal" == o.type && !o.hide && (0 == t && n.push(o.title || ""), r.push(i[o.field])) })), o.push(r.join(",")) })), n.join(",") + "\r\n" + o.join("\r\n"))), c.download = (r.title || "table_" + (r.index || "")) + "." + i, document.body.appendChild(c), c.click(), document.body.removeChild(c) }, table.resize = function (e) { if (e) { if (!getThisTableConfig(e)) return; thisTable.that[e].resize() } else layui.each(thisTable.that, (function () { this.resize() })) }, table.reload = function (e, t) { var i = thisTable.config[e]; return t = t || {}, i ? (t.data && t.data.constructor === Array && delete i.data, table.render($.extend(!0, {}, i, t))) : hint.error("The ID option was not found in the table instance") }, table.render = function (e) { var t = new Class(e); return thisTable.call(t) }, table.clearCacheKey = function (e) { return delete (e = $.extend({}, e))[table.config.checkName], delete e[table.config.indexName], e }, table.deleteCheckRows = function (e) { var t = table.cache[e] || []; $.each(t, (function (t, i) { if (i.constructor !== Array && i[table.config.checkName]) { var n = "cardListMode" == table.config.mode ? ".card-item" : "table tbody tr", o = (i[table.config.checkName], i[table.config.indexName]); $("#" + e).next().find(n + "[data-index=" + o + "]").remove(), table.cache[e][o] = [] } })) }, table.formatNumberByPermil = function (e) { var t = ""; -1 != (e = e.toString()).indexOf(".") && (t = "." + e.split(".")[1], e = parseInt(e.split(".")[0])); for (var i = e.toString().split(""), n = -3; i.length + n > 0;)i.splice(n, 0, ","), n -= 4; return i.join("") + t }, table.getValue = function (e) { return table.checkedMultiList[e] }, table.setIds = function (e) { var t = { gridId: "", ids: [] }; $.extend(t, e), table.checkedMultiList[t.gridId] = [], $.each(t.ids, (function (e, i) { table.checkedMultiList[t.gridId].push(i) })) }, table.init(), exports(MOD_NAME, table) }))
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.transfer 穿梭框
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define(["laytpl", "form"], (function (e) { "use strict"; var t = layui.$, i = layui.laytpl, n = layui.form, o = { config: {}, index: layui.transfer ? layui.transfer.index + 1e4 : 0, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, "transfer", e, t) } }, thisModule = function () { var e = this, t = e.config, i = t.id || e.index; return thisModule.that[i] = e, thisModule.config[i] = t, { config: t, reload: function (t) { e.reload.call(e, t) }, getData: function () { return e.getData.call(e) } } }, r = "layui-hide", s = "layui-transfer-box", c = "layui-transfer-data", TPL_BOX = function (e) { return ['<div class="layui-transfer-box" data-index="' + (e = e || {}).index + '">', '<div class="layui-transfer-header">', '<input type="checkbox" name="' + e.checkAllName + '" lay-filter="layTransferCheckbox" lay-type="all" lay-skin="primary" title="{{ d.data.title[' + e.index + "] || 'list" + (e.index + 1) + "' }}\">", "</div>", "{{# if(d.data.showSearch){ }}", '<div class="layui-transfer-search">', '<i class="layui-icon layui-icon-search"></i>', '<input type="input" class="layui-input" placeholder="关键词搜索">', "</div>", "{{# } }}", '<ul class="layui-transfer-data"></ul>', "</div>"].join("") }, d = ['<div class="layui-transfer layui-form layui-border-box" lay-filter="LAY-transfer-{{ d.index }}">', TPL_BOX({ index: 0, checkAllName: "layTransferLeftCheckAll" }), '<div class="layui-transfer-active">', '<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-disabled" data-index="0">', '<i class="layui-icon layui-icon-next"></i>', "</button>", '<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-disabled" data-index="1">', '<i class="layui-icon layui-icon-prev"></i>', "</button>", "</div>", TPL_BOX({ index: 1, checkAllName: "layTransferRightCheckAll" }), "</div>"].join(""), Class = function (e) { this.index = ++o.index, this.config = t.extend({}, this.config, o.config, e), this.render() }; Class.prototype.config = { title: ["列表一", "列表二"], width: 200, height: 360, data: [], value: [], showSearch: !1, id: "", text: { none: "无数据", searchNone: "无匹配数据" } }, Class.prototype.reload = function (e) { var i = this; layui.each(e, (function (e, t) { t.constructor === Array && delete i.config[e] })), i.config = t.extend(!0, {}, i.config, e), i.render() }, Class.prototype.render = function () { var e = this, n = e.config, o = e.elem = t(i(d).render({ data: n, index: e.index })), r = n.elem = t(n.elem); r[0] && (n.data = n.data || [], n.value = n.value || [], e.key = n.id || e.index, r.html(e.elem), e.layBox = e.elem.find("." + s), e.layHeader = e.elem.find(".layui-transfer-header"), e.laySearch = e.elem.find(".layui-transfer-search"), e.layData = o.find("." + c), e.layBtn = o.find(".layui-transfer-active .layui-btn"), e.layBox.css({ width: n.width, height: n.height }), e.layData.css({ height: n.height - e.layHeader.outerHeight() - e.laySearch.outerHeight() - 2 }), e.renderData(), e.events()) }, Class.prototype.renderData = function () { var e = this.config, i = [{ checkName: "layTransferLeftCheck", views: [] }, { checkName: "layTransferRightCheck", views: [] }]; this.parseData((function (e) { var t = e.selected ? 1 : 0, n = ["<li>", '<input type="checkbox" name="' + i[t].checkName + '" lay-skin="primary" lay-filter="layTransferCheckbox" title="' + e.title + '"' + (e.disabled ? " disabled" : "") + (e.checked ? " checked" : "") + ' value="' + e.value + '">', "</li>"].join(""); i[t].views.push(n), delete e.selected })); var n = []; layui.each(e.value, (function (e, o) { layui.each(i[1].views, (function (e, i) { var r = t(i).find("input").attr("value"); o == r && n.push(i) })) })), this.layData.eq(0).html(i[0].views.join("")), this.layData.eq(1).html(n.join("")), this.renderCheckBtn() }, Class.prototype.renderForm = function (e) { n.render(e, "LAY-transfer-" + this.index) }, Class.prototype.renderCheckBtn = function (e) { var i = this, n = i.config; e = e || {}, i.layBox.each((function (o) { var s = t(this), d = s.find("." + c), u = s.find(".layui-transfer-header").find('input[type="checkbox"]'), h = d.find('input[type="checkbox"]'), p = 0, y = !1; if (h.each((function () { var e = t(this).data("hide"); (this.checked || this.disabled || e) && p++, this.checked && !e && (y = !0) })), u.prop("checked", y && p === h.length), i.layBtn.eq(o)[y ? "removeClass" : "addClass"]("layui-btn-disabled"), !e.stopNone) { var m = d.children("li:not(." + r + ")").length; i.noneView(d, m ? "" : n.text.none) } })), i.renderForm("checkbox") }, Class.prototype.noneView = function (e, i) { var n = t('<p class="layui-none">' + (i || "") + "</p>"); e.find(".layui-none")[0] && e.find(".layui-none").remove(), i.replace(/\s/g, "") && e.append(n) }, Class.prototype.setValue = function () { var e = this.config, i = []; return this.layBox.eq(1).find("." + c + ' input[type="checkbox"]').each((function () { t(this).data("hide") || i.push(this.value) })), e.value = i, this }, Class.prototype.parseData = function (e) { var i = this.config, n = []; return layui.each(i.data, (function (o, r) { r = ("function" == typeof i.parseData ? i.parseData(r) : r) || r, n.push(r = t.extend({}, r)), layui.each(i.value, (function (e, t) { t == r.value && (r.selected = !0) })), e && e(r) })), i.data = n, this }, Class.prototype.getData = function (e) { var t = this.config, i = []; return this.setValue(), layui.each(e || t.value, (function (e, n) { layui.each(t.data, (function (e, t) { delete t.selected, n == t.value && i.push(t) })) })), i }, Class.prototype.events = function () { var e = this, i = e.config; e.elem.on("click", 'input[lay-filter="layTransferCheckbox"]+', (function () { var n = t(this).prev(), o = n[0].checked, r = n.parents("." + s).eq(0).find("." + c); if (!n[0].disabled) { if ("all" === n.attr("lay-type") && (null == i.limit || 0 == i.limit || 0 != n.parent().parent().data("index")) && r.find('input[type="checkbox"]').each((function () { this.disabled || (this.checked = o) })), null != i.limit && i.limit > 0 && o) { var d = 0; r.find('input[type="checkbox"]').each((function () { this.checked && d++ })); var u = 0; 0 == n.parent().parent().parent().data("index") && (u = n.parent().parent().parent().next("div").next("div").find("ul li").length), d += u, i.limit < d && (n[0].checked = !1, layer.msg("最多选" + i.limit + "个", { icon: 0, time: 1500, shade: .3 })), u == i.limit && (n[0].checked = !1, layer.msg("最多选" + i.limit + "个", { icon: 0, time: 1500, shade: .3 })) } e.renderCheckBtn({ stopNone: !0 }) } })), e.layBtn.on("click", (function () { var n = t(this), o = n.data("index"), r = e.layBox.eq(o), d = []; if (!n.hasClass("layui-btn-disabled")) { e.layBox.eq(o).each((function (i) { t(this).find("." + c).children("li").each((function () { var i = t(this), n = i.find('input[type="checkbox"]'), o = n.data("hide"); n[0].checked && !o && (n[0].checked = !1, r.siblings("." + s).find("." + c).append(i.clone()), i.remove(), d.push(n[0].value)), e.setValue() })) })), e.renderCheckBtn(); var u = r.siblings("." + s).find(".layui-transfer-search input"); "" === u.val() || u.trigger("keyup"), i.onchange && i.onchange(e.getData(d), o) } })), e.laySearch.find("input").on("keyup", (function () { var n = this.value, o = t(this).parents(".layui-transfer-search").eq(0).siblings("." + c), s = o.children("li"); s.each((function () { var e = t(this), i = e.find('input[type="checkbox"]'), o = -1 !== i[0].title.indexOf(n); e[o ? "removeClass" : "addClass"](r), i.data("hide", !o) })), e.renderCheckBtn(); var d = s.length === o.children("li." + r).length; e.noneView(o, d ? i.text.searchNone : "") })) }, thisModule.that = {}, thisModule.config = {}, o.reload = function (e, t) { var i = thisModule.that[e]; return i.reload(t), thisModule.call(i) }, o.getData = function (e) { return thisModule.that[e].getData() }, o.render = function (e) { var t = new Class(e); return thisModule.call(t) }, e("transfer", o) }))
|
||
}, function (e, t) {
|
||
/**
|
||
|
||
@Name:layui.tree 树组件
|
||
@Author:贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("jquery", (function (e) { "use strict"; var t = layui.$, i = layui.hint(), n = "layui-tree-enter", Tree = function (e) { this.options = e }, o = ["", ""], r = ["", ""], s = ["", ""], c = ["", ""], d = ""; Tree.prototype.init = function (e) { e.addClass("layui-box layui-tree"), this.options.skin && e.addClass("layui-tree-skin-" + this.options.skin), this.tree(e), this.on(e) }, Tree.prototype.tree = function (e, i) { var n = this, u = n.options, h = i || u.nodes; layui.each(h, (function (i, h) { var p = h.children && h.children.length > 0, y = t('<ul class="' + (h.spread ? "layui-show" : "") + '"></ul>'), m = t(["<li " + (h.spread ? 'data-spread="' + h.spread + '"' : "") + ">", p ? '<i class="layui-icon layui-tree-spread">' + (h.spread ? o[1] : o[0]) + "</i>" : "", u.check ? '<i class="layui-icon layui-tree-check">' + ("checkbox" === u.check ? r[0] : "radio" === u.check ? s[0] : "") + "</i>" : "", '<a href="' + (h.href || "javascript:;") + '" ' + (u.target && h.href ? 'target="' + u.target + '"' : "") + '><i class="layui-icon layui-tree-' + (p ? "branch" : "leaf") + '">' + (p ? h.spread ? c[1] : c[0] : d) + "</i><cite>" + (h.name || "未命名") + "</cite></a>", "</li>"].join("")); p && (m.append(y), n.tree(y, h.children)), e.append(m), "function" == typeof u.click && n.click(m, h), n.spread(m, h), u.drag && n.drag(m, h) })) }, Tree.prototype.click = function (e, t) { var i = this.options; e.children("a").on("click", (function (e) { layui.stope(e), i.click(t) })) }, Tree.prototype.spread = function (e, t) { this.options; var i = e.children(".layui-tree-spread"), n = e.children("ul"), r = e.children("a"), open = function () { e.data("spread") ? (e.data("spread", null), n.removeClass("layui-show"), i.html(o[0]), r.find(".layui-icon").html(c[0])) : (e.data("spread", !0), n.addClass("layui-show"), i.html(o[1]), r.find(".layui-icon").html(c[1])) }; n[0] && (i.on("click", open), r.on("dblclick", open)) }, Tree.prototype.on = function (e) { var i = this, o = i.options, r = "layui-tree-drag"; e.find("i").on("selectstart", (function (e) { return !1 })), o.drag && t(document).on("mousemove", (function (e) { var n = i.move; if (n.from) { n.to; var o = t('<div class="layui-box ' + r + '"></div>'); e.preventDefault(), t("." + r)[0] || t("body").append(o); var s = t("." + r)[0] ? t("." + r) : o; s.addClass("layui-show").html(n.from.elem.children("a").html()), s.css({ left: e.pageX + 10, top: e.pageY + 10 }) } })).on("mouseup", (function () { var e = i.move; e.from && (e.from.elem.children("a").removeClass(n), e.to && e.to.elem.children("a").removeClass(n), i.move = {}, t("." + r).remove()) })) }, Tree.prototype.move = {}, Tree.prototype.drag = function (e, i) { var o = this, r = (o.options, e.children("a")), mouseenter = function () { var r = t(this), s = o.move; s.from && (s.to = { item: i, elem: e }, r.addClass(n)) }; r.on("mousedown", (function () { o.move.from = { item: i, elem: e } })), r.on("mouseenter", mouseenter).on("mousemove", mouseenter).on("mouseleave", (function () { var e = t(this), i = o.move; i.from && (delete i.to, e.removeClass(n)) })) }, e("tree", (function (e) { var n = new Tree(e = e || {}), o = t(e.elem); if (!o[0]) return i.error("layui.tree 没有找到" + e.elem + "元素"); n.init(o) })) }))
|
||
}, function (e, t) { layui.config({}).extend({}).define(["laytpl", "laypage", "layer", "form"], (function (e) { "use strict"; var t = layui.$, i = layui.laytpl, n = layui.laypage, o = layui.layer, r = layui.form, s = layui.hint(), c = layui.device(), d = 0, u = { config: { indexName: "lay_table_index", cols: { isCheckName: "lay_is_checked", isRadio: "lay_is_radio", isOpen: "lay_is_open", isShow: "lay_is_show", level: "lay_level", children: "children", cheDisabled: "lay_che_disabled", radDisabled: "lay_rad_disabled", iconOpen: "lay_icon_open", iconClose: "lay_icon_close", icon: "lay_icon" }, initWidth: { checkbox: 48, space: 15, numbers: 40, radio: 48 } }, cache: { tableId: { data: { list: [], map: {}, treeList: [], upIds: [] } }, cla: { claIds: { tableId: !0 }, claObjs: { tableId: {} } }, selectcode: { demokey: [{ key: { value: "" } }] } }, index: layui.table ? layui.table.index + 1e4 : 0, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, h, e, t) }, getClass: function (e) { return u.cache.cla.claObjs[e] }, pushClass: function (e, t) { u.cache.cla.claObjs[e] = t }, isCalss: function (e) { return (this.cache.cla.claIds || {}).hasOwnProperty(e) || !1 }, isClassYes: function (e) { return (this.cache.cla.claIds || {})[e] || !1 }, pushClassIds: function (e, t) { this.cache.cla.claIds[e] = t }, setObj: function (e, t, i) { this.obj[e] || (this.obj[e] = {}), this.obj[e][t] = i }, getObj: function (e, t) { return this.obj[e] ? this.obj[e][t] : null }, getDataList: function (e) { return u.cache[e] ? u.cache[e].data.list : [] }, setDataList: function (e, t) { u.cache[e] || (u.cache[e] = {}), u.cache[e].data || (u.cache[e].data = {}), u.cache[e].data.list || (u.cache[e].data.list = []), u.cache[e].data.list = t }, getDataMap: function (e) { return u.cache[e] ? u.cache[e].data.map : {} }, setDataMap: function (e, t) { u.cache[e] || (u.cache[e] = {}), u.cache[e].data || (u.cache[e].data = {}), u.cache[e].data.map || (u.cache[e].data.map = {}), u.cache[e].data.map = t }, getDataTreeList: function (e) { return u.cache[e] ? u.cache[e].data.treeList : [] }, setDataTreeList: function (e, t) { u.cache[e] || (u.cache[e] = {}), u.cache[e].data || (u.cache[e].data = {}), u.cache[e].data.treeList || (u.cache[e].data.treeList = {}), u.cache[e].data.treeList = t }, getDataRootList: function (e) { return u.cache[e] && u.cache[e].data.upIds || [] }, setDataRootList: function (e, t) { u.cache[e] || (u.cache[e] = {}), u.cache[e].data || (u.cache[e].data = {}), u.cache[e].data.upIds || (u.cache[e].data.upIds = []), u.cache[e].data.upIds = t }, init: function (e, i) { i = i || {}; var n = t(e ? 'table[lay-filter="' + e + '"]' : p + "[lay-data]"), o = "Table element property lay-data configuration item has a syntax error: "; return n.each((function () { var n = t(this), r = n.attr("lay-data"); try { r = new Function("return " + r)() } catch (e) { s.error(o + r) } var c = [], d = t.extend({ elem: this, cols: [], data: [], skin: n.attr("lay-skin"), size: n.attr("lay-size"), even: "string" == typeof n.attr("lay-even") }, u.config, i, r); e && n.hide(), n.find("thead>tr").each((function (e) { d.cols[e] = [], t(this).children().each((function (i) { var n = t(this), r = n.attr("lay-data"); try { r = new Function("return " + r)() } catch (e) { return s.error(o + r) } var u = t.extend({ title: n.text(), colspan: n.attr("colspan") || 0, rowspan: n.attr("rowspan") || 0 }, r); u.colspan < 2 && c.push(u), d.cols[e].push(u) })) })), n.find("tbody>tr").each((function (e) { var i = t(this), n = {}; i.children("td").each((function (e, i) { var o = t(this), r = o.data("field"); if (r) return n[r] = o.html() })), layui.each(c, (function (e, t) { var o = i.children("td").eq(e); n[t.field] = o.html() })), d.data[e] = n })), u.render(d) })), this }, render: function (e) { u.pushClassIds(e.id); var t = new Class(e); return thisTable.call(t) }, ready: function (e, t) { var i = !1, n = new Date; e && t && setTimeout((function isReady() { if (e) { var o = u.getClass(e); if (o && o.hasOwnProperty("layBody")) t(o), i = !0; else (new Date).getTime() - n.getTime() <= 1e4 && !i && setTimeout(isReady, 50) } }), 50) }, checkStatus: function (e) { var t = 0, i = 0, n = [], o = u.getDataList(e) || []; return layui.each(o, (function (e, o) { o.constructor !== Array ? o[u.config.cols.isCheckName] && (t++, n.push(u.clearCacheKey(o))) : i++ })), { data: n, isAll: !!o.length && t === o.length - i } }, setCheckStatus: function (e, t, i) { var n = u.getClass(e), o = u.getDataList(e) || []; n.layBody.find('input[name="layTableCheckbox"]'); t && i && (i.split(",").forEach((function (e) { var i = null; if (o.forEach((function (n) { n[t] + "" != e + "" || (i = n) })), i) { var r = i[u.config.indexName]; n.layBody.find('input[name="layTableCheckbox"][value="' + r + '"]').prop("checked", !0), n.setCheckData(r, !0) } })), n.syncCheckAll(), n.renderForm("checkbox")); return null }, radioStatus: function (e) { var i = null, n = u.getDataList(e) || [], o = t("input[name='" + k + e + "']:checked").val(); return o = parseInt(o), n.forEach((function (e) { e[u.config.indexName] == o && (i = e) })), u.clearCacheKey(i) }, setRadioStatus: function (e, i, n) { var o = null, s = u.getDataList(e) || []; if (i && n && (s.forEach((function (e) { e[i] + "" != n + "" || (o = e) })), o)) { var c = o[u.config.indexName]; t("input:radio[name='" + k + e + "'][value='" + c + "']").prop("checked", !0), r.render("radio") } return o }, clearCacheKey: function (e) { return delete (e = t.extend({}, e))[u.config.cols.isCheckName], delete e[u.config.indexName], e }, query: function (e, i) { var n = u.getClass(e); n.renderTdCss(), n.config.data && n.config.data.constructor === Array && delete n.config.data, n.config = t.extend({}, n.config, i), n.pullData(n.page, n.loading()) }, reload: function (e, i) { var n = thisTable.config[e]; return i = i || {}, n ? (i.data && i.data.constructor === Array && delete n.data, u.render(t.extend(!0, {}, n, i))) : s.error("The ID option was not found in the table instance") }, addRow: function (e, i, n) { var o = u.getClass(e), r = o.config, s = (u.getDataMap(e), u.getDataTreeList(e)), c = u.getDataList(e) || [], fa = function (i, n, o, r, s, c) { if (i.resetData(s), r.splice(c, 0, s), u.restNumbers(r), u.setDataMap(e, i.resetDataMap(r)), n.isTree) { var d = i.treeFindUpData(s); if (d) { d.children; d.children.push(s), s[u.config.cols.level] = d[u.config.cols.level] + 1, i.treeNodeOpen(d, !0), i.renderTreeConvertShowName(d) } else s[u.config.cols.level] = 1, o.push(s) } var h = i.renderTr(s, s[u.config.indexName]), p = '<tr data-index="' + s[u.config.indexName] + '"' + i.renderTrUpids(s) + ">" + h.join("") + "</tr>"; if (0 == c) { var y = i.layBody.find("table tbody"); t(y).prepend(p), i.layBody.find(".layui-none").remove() } else { var m = i.layBody.find("[data-index=" + (c - 1) + "]"), g = u.getDataList(i.key)[c - 1][n.treeId], b = n.treeUpId, addNewRow = function (e, t) { if (e.next("tr").length > 0) { var n = u.getDataList(i.key)[c + 1][b]; g == n ? addNewRow(e, t) : e.after(t) } else e.after(t) }; addNewRow(t(m), p) } i.renderForm(), n.isAsynchronous || i.renderPage(i.config.page.count + 1), i.restNumbers(), i.events() }; if (n instanceof Array) for (var d = 0; d < n.length; d++)0 != d && (i += 1), fa(o, r, s, c, n[d], i); else fa(o, r, s, c, n) }, delRow: function (e, t) { var i = u.getClass(e), n = i.config, o = u.getDataList(e), r = [], s = {}, c = [], d = []; if (i && t) { u.kit.isArray(t) ? c = t : c[0] = t, c.forEach((function (e) { var t = i.treeFindUpData(e); t && d.push(t) })), (r = n.isTree ? u.treeFindSonList(i.config.id, c) : c).forEach((function (e) { var t = e[u.config.indexName]; s[t] = t, i.layBody.find('tr[data-index="' + t + '"]').remove() })), i.restNumbers(); for (var h = [], p = 0, y = o.length; p < y; p++) { var m = !0; r.forEach((function (e) { e[u.config.indexName] === o[p][u.config.indexName] && (m = !1) })), m && h.push(o[p]) } u.restNumbers(h), d.forEach((function (e) { i.renderTreeConvertShowName(e) })), n.isPage && i.renderPage(i.config.page.count - Object.keys(s).length), u.setDataList(e, h), u.setDataMap(e, i.resetDataMap(h)), u.setDataTreeList(e, i.resetDataTreeList(h, u.getDataRootList(e))), i.events() } }, restNumbers: function (e) { if (e) { var t = 0; e.forEach((function (e) { e[u.config.indexName] = t, t++ })) } }, treeNodeOpen: function (e, t, i) { var n = u.getClass(i); n && e && n.treeNodeOpen(e, t) }, treeOpenAll: function (e, t) { var i = u.getClass(e); if (i) { i.config.isOpenDefault ? i.config.isOpenDefault = !1 : i.config.isOpenDefault = !0, void 0 === t && (t = !0); var n = u.getDataList(e); if (n) if (i.config.isAsynchronous && 1 == d && i.config.isOpenDefault) { var o = options.parentid; i.nodeKeyData = {}, i.nodeKeyData[o] = "1", i.pullData(i.page, i.loading()) } else n.forEach((function (i) { u.treeNodeOpen(i, t, e) })) } }, treeFindSonList: function (e, t) { var i = u.getClass(e); if (!i || !t) return []; var n = [], o = [], r = {}; return u.kit.isArray(t) ? n = t : n[0] = t, n.forEach((function (e) { e.children.length > 0 && i.treeFindSonData(e).forEach((function (e) { r[e[u.config.indexName]] || (o.push(e), r[e[u.config.indexName]] = e[u.config.indexName]) })); o.push(e), r[e[u.config.indexName]] = e[u.config.indexName] })), o }, treeFindUpDatas: function (e, t) { var i = u.getClass(e); return i && t ? i.treeFindUpDatas(t) : [] }, treeFindSonIds: function (e, t) { var i = []; return u.treeFindSonList(e, t).forEach((function (e) { i.push([u.config.indexName]) })), i }, treeFindSonIdFields: function (e, t) { var i = [], n = u.getClass(e); return u.treeFindSonList(e, t).forEach((function (e) { i.push(e[n.config.idField]) })), i }, treeIconRender: function (e, t) { var i = u.getClass(e); return i && t ? i.treeIconRender(t, !1) : [] }, kit: { isArray: function (e) { return "[object Array]" === Object.prototype.toString.call(e) } } }, thisTable = function () { var e = this, t = e.config, i = t.id; return i && (thisTable.config[i] = t), { reload: function (t) { e.reload.call(e, t) }, config: t } }, h = "treeGrid", p = ".layui-table", y = "layui-none", m = "layui-table-view", g = ".layui-table-sort", b = "layui-table-edit", k = "table_radio_", TPL_HEADER = function (e) { return ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', "<thead>", "{{# layui.each(d.data.cols, function(i1, item1){ }}", "<tr>", "{{# layui.each(item1, function(i2, item2){ }}", '{{# if(item2.fixed && item2.fixed !== "right"){ left = true; } }}', '{{# if(item2.fixed === "right"){ right = true; } }}', (e = e || {}).fixed && "right" !== e.fixed ? '{{# if(item2.fixed && item2.fixed !== "right"){ }}' : "right" === e.fixed ? '{{# if(item2.fixed === "right"){ }}' : "", '<th data-field="{{ item2.field||i2 }}" {{# if(item2.minWidth){ }}data-minwidth="{{item2.minWidth}}"{{# } }} {{#if(item2.colspan){}} colspan="{{item2.colspan}}"{{#} if(item2.rowspan){}} rowspan="{{item2.rowspan}}"{{#}}} {{# if(item2.unresize){ }}data-unresize="true"{{# } }}>', '<div class="layui-table-cell laytable-cell-', "{{# if(item2.colspan > 1){ }}", "group", "{{# } else { }}", "{{d.index}}-{{item2.field || i2}}", '{{# if(item2.type !== "normal"){ }}', " laytable-cell-{{ item2.type }}", "{{# } }}", "{{# } }}", '" {{#if(item2.align){}}align="{{item2.align}}"{{#}}}>', '{{# if(item2.type === "checkbox"){ }}', '<input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose">', "{{# } else { }}", '<span>{{item2.title||""}}</span>', "{{# if(!(item2.colspan > 1) && item2.sort){ }}", '<span class="layui-table-sort layui-inline"><i class="layui-edge layui-table-sort-asc"></i><i class="layui-edge layui-table-sort-desc"></i></span>', "{{# } }}", "{{# } }}", "</div>", "</th>", e.fixed ? "{{# }; }}" : "", "{{# }); }}", "</tr>", "{{# }); }}", "</thead>", "</table>"].join("") }, w = ['<table cellspacing="0" cellpadding="0" border="0" class="layui-table" ', '{{# if(d.data.skin){ }}lay-skin="{{d.data.skin}}"{{# } }} {{# if(d.data.size){ }}lay-size="{{d.data.size}}"{{# } }} {{# if(d.data.even){ }}lay-even{{# } }}>', "<tbody></tbody>", "</table>"].join(""), C = ['<div class="layui-form layui-border-box {{d.VIEW_CLASS}}" lay-filter="LAY-table-{{d.index}}" style="{{# if(d.data.width){ }}width:{{d.data.width}}px;{{# } }} {{# if(d.data.height){ }}height:{{d.data.height}}px;{{# } }}">', "{{# if(d.data.toolbar){ }}", '<div class="layui-table-tool"></div>', "{{# } }}", '<div class="layui-table-box">', "{{# var left, right; }}", '<div class="layui-table-header">', TPL_HEADER(), "</div>", '<div class="layui-table-filter">', void 0, "</div>", '<div class="layui-table-body layui-table-main">', w, "</div>", "{{# if(left){ }}", '<div class="layui-table-fixed layui-table-fixed-l">', '<div class="layui-table-header">', TPL_HEADER({ fixed: !0 }), "</div>", '<div class="layui-table-body">', w, "</div>", "</div>", "{{# }; }}", "{{# if(right){ }}", '<div class="layui-table-fixed layui-table-fixed-r">', '<div class="layui-table-header">', TPL_HEADER({ fixed: "right" }), '<div class="layui-table-mend"></div>', "</div>", '<div class="layui-table-body">', w, "</div>", "</div>", "{{# }; }}", "</div>", "{{# if(d.data.isPage){ }}", '<div class="layui-table-page">', '<div id="layui-table-page{{d.index}}"></div>', "</div>", "{{# } }}", "</div>"].join(""), D = t(window), E = t(document), Class = function (e) { this.index = ++u.index, this.config = t.extend({}, this.config, u.config, e), this.render(), u.pushClass(e.id, this) }; Class.prototype.config = { limit: 10, loading: !0, cellMinWidth: 60, text: { none: "无数据" }, isFilter: !1, method: "post", radDisabledNum: 0, cheDisabledNum: 0, branch: ["", ""], leaf: "", iconOpen: !0, isOpenDefault: !0, parseData: null, onClickRow: null, onDblClickRow: null, onBeforeCheck: null, isTree: !0, isPage: !1, chkboxType: { Y: "ps", N: "ps" }, isAsynchronous: !1, sysParentid: "" }, Class.prototype.render = function () { var e = this.config; if (e.elem = t(e.elem), e.where = e.where || {}, e.id = e.id || e.elem.attr("id"), e.request = t.extend({ pageName: "page", limitName: "limit" }, e.request), e.response = t.extend({ statusName: "code", statusCode: 0, msgName: "msg", dataName: "data", countName: "count" }, e.response), "object" == typeof e.page && (e.limit = e.page.limit || e.limit, e.limits = e.page.limits || e.limits, this.page = e.page.curr = e.page.curr || 1, delete e.page.elem, delete e.page.jump), !e.elem[0]) return this; this.setArea(); var n = e.elem, o = n.next("." + m), r = this.elem = t(i(C).render({ VIEW_CLASS: m, data: e, index: this.index })); if (e.index = this.index, o[0] && o.remove(), n.after(r), this.renderTdCss(), this.layHeader = r.find(".layui-table-header"), this.layMain = r.find(".layui-table-main"), this.layBody = r.find(".layui-table-body"), this.layFixed = r.find(".layui-table-fixed"), this.layFixLeft = r.find(".layui-table-fixed-l"), this.layFixRight = r.find(".layui-table-fixed-r"), this.layTool = r.find(".layui-table-tool"), this.layPage = r.find(".layui-table-page"), this.layFilter = r.find(".layui-table-filter"), this.layTool.html(i(t(e.toolbar).html() || "").render(e)), e.height && this.fullSize(), e.cols.length > 1) { var s = this.layFixed.find(".layui-table-header").find("th"); s.height(this.layHeader.height() - 1 - parseFloat(s.css("padding-top")) - parseFloat(s.css("padding-bottom"))) } e.isFilter && this.layFilter.html(this.renderFilter()), this.pullData(this.page), this.renderCss() }, Class.prototype.initOpts = function (e) { var t = this.config; e.checkbox && (e.type = "checkbox"), e.space && (e.type = "space"), e.type || (e.type = "normal"), "normal" !== e.type && (e.unresize = !0, e.width = e.width || u.config.initWidth[e.type]), t.isFilter && 0 != e.isFilter && (e.isFilter = !0) }, Class.prototype.getParentDivHeight = function (e) { return t("#" + e).parent().height() }, Class.prototype.getCols = function (e) { var t = this.config.cols[0], i = !1; for (var n in /^[0-9]+.?[0-9]*$/.test(e) && (i = !0), t) if (i) { if (n == parseInt(e)) return t[n] } else if (e == t[n].field) return t[n]; return {} }, Class.prototype.reload = function (e) { return this.config.data && this.config.data.constructor === Array && delete this.config.data, u.render(t.extend(!0, {}, this.config, e)) }, Class.prototype.page = 1, Class.prototype.restNumbers = function () { this.config; var e = this.layBody.find("table tbody tr"), i = 0; e.each((function (e) { t(this).attr("data-index", i), t(this).find(".laytable-cell-numbers p").text(i + 1), t(this).data("index", i), i++ })) }, Class.prototype.resetData = function (e) { var t = this.config; t.isTree && (e.hasOwnProperty(u.config.cols.isOpen) || (e[u.config.cols.isOpen] = t.isOpenDefault), e.hasOwnProperty(u.config.cols.isShow) || (e[u.config.cols.isShow] = !!t.isOpenDefault)), e.hasOwnProperty(u.config.cols.cheDisabled) || (e[u.config.cols.cheDisabled] = !1), e[u.config.cols.cheDisabled] && t.cheDisabledNum++, e[u.config.cols.radDisabled] && t.radDisabledNum++, e.children = [] }, Class.prototype.resetDataMap = function (e) { var t = this.config.treeId, i = {}; return e.forEach((function (e) { i[e[t]] = e })), i }, Class.prototype.resetDataresetRoot = !0, Class.prototype.resetDataRoot = function (e) { var t = this.config, i = (t.treeId, t.treeUpId), n = u.getDataMap(this.config.id), o = u.cache[t.id].data.upIds || [], r = {}; u.cache[t.id].data.upIds = [], o = u.cache[t.id].data.upIds; for (var s = 0; s < e.length; s++) { var c = e[s]; if (!n[c[i]]) { if (!r[c[i]]) { var d = !0; o.forEach((function (e) { e === c[i] && (d = !1) })), d && o.push(c[i]) } r[c[i]] = c[i] } } return o }, Class.prototype.resetDataTreeList = function (e, t) { var i = this.config, n = i.treeId, o = i.treeUpId, r = [], fa = function (t) { for (var i = [], r = 0; r < e.length; r++) { var s = e[r]; s[o] === t && (s.children = fa(s[n]), i.push(s)) } return i }; return t.forEach((function (e) { var t = fa(e); t && t.forEach((function (e) { r.push(e) })) })), r }, Class.prototype.resetDataTableList = function (e) { var t = this, i = t.config, n = (i.treeId, i.treeUpId, []), fa2 = function (e, t) { for (var i = 0; i < e.length; i++) { var o = e[i]; o[u.config.cols.level] = t, n.push(o), o.children && o.children.length > 0 && fa2(o.children, 1 + t) } }; return fa2(e, 1), n.forEach((function (e) { var i = t.treeFindUpData(e); !i || i[u.config.cols.isOpen] && i[u.config.cols.isShow] ? e[u.config.cols.isShow] = !0 : e[u.config.cols.isShow] = !1 })), n }, Class.prototype.resetDatas = function (e) { var t = this.config, i = (t.treeId, t.treeUpId, []), n = [], o = e, r = this.resetDataMap(e); if (i.push(o), i.push(n), i.push(r), u.setDataList(this.config.id, o), u.setDataTreeList(this.config.id, n), u.setDataMap(this.config.id, r), null == e || e.length <= 0) return i; for (var s = 0; s < e.length; s++)this.resetData(e[s]); if (t.isTree) { o = [], u.setDataList(this.config.id, o); var c = u.cache[t.id].data.upIds || []; (c.length <= 0 || this.resetDataresetRoot) && (u.cache[t.id].data.upIds = [], c = this.resetDataRoot(e), this.resetDataresetRoot = !1), n = this.resetDataTreeList(e, c), u.setDataTreeList(this.config.id, n), o = this.resetDataTableList(n), u.setDataList(this.config.id, o) } return i }, Class.prototype.treeFindDataById = function (e) { var t = this.config, i = null, n = u.getDataList(this.key), o = t.treeId; return n.forEach((function (t) { t[o] != e || (i = t) })), i }, Class.prototype.treeFindUpData = function (e) { var t = this.config.treeUpId; return u.getDataMap(this.config.id)[e[t]] }, Class.prototype.treeFindUpDatas = function (e) { var t = this, i = (t.config, []), temf = function (e) { var n = t.treeFindUpData(e); n && (i.push(n), temf(n)) }; return temf(e), i }, Class.prototype.treeFindSonData = function (e) { var t = []; return function f(e) { e.children.length > 0 && e.children.forEach((function (e) { t.push(e), e.children.length > 0 && f(e) })) }(e), t }, Class.prototype.treeConvertShowName = function (e) { var t, i, n = this, o = (n.config, e.children && e.children.length > 0 || e.CHILDCOUNT && e.CHILDCOUNT > 0); return '<div style="float: left;height: 28px;line-height: 25px;padding-left: ' + (o ? "5px" : "21px") + '">' + function () { for (var t = "<i>", i = 1; i < e[u.config.cols.level]; i++)t += " "; return t += "</i>" }() + (t = "", i = e[u.config.cols.isOpen] ? "" : "", o ? t = '<i class="layui-icon layui-tree-head">' + i + "</i>" + n.treeIconRender(e, !0) : t += n.treeIconRender(e, !0), t + "</div>") }, Class.prototype.treeNodeOpen = function (e, t) { var i = this, n = (i.config, i.layBody.find('tr[data-index="' + e[u.config.indexName] + '"]')); e[u.config.cols.isOpen] = t; var fa = function (t) { if (t.children && t.children.length > 0) for (var n = t.children, o = 0; o < n.length; o++) { var r = n[o]; if (e[u.config.cols.isOpen]) { if (t[u.config.cols.isOpen] && t[u.config.cols.isShow]) i.layBody.find('tr[data-index="' + r[u.config.indexName] + '"]').show(), r[u.config.cols.isShow] = !0 } else i.layBody.find('tr[data-index="' + r[u.config.indexName] + '"]').hide(), r[u.config.cols.isShow] = !1; fa(r) } }; fa(e), i.treeIconRender(e, !1); var o = n.find(".layui-tree-head"); e[u.config.cols.isOpen] ? o.html("") : o.html("") }, Class.prototype.treeIconRender = function (e, i) { var n = this.config, o = n.iconOpen, r = e.children && e.children.length > 0 || e.CHILDCOUNT && e.CHILDCOUNT > 0, s = ""; if (!o) return s; var temf = function () { var t = '<i class="layui-tree-' + e[n.idField] + '" style="display:inline-block;width: 16px;height: 16px;background:url('; return r ? e[u.config.cols.isOpen] ? t += e[u.config.cols.iconOpen] : t += e[u.config.cols.iconClose] : t += e[u.config.cols.icon], t += ') 0 0 no-repeat;"></i>' }; if (r ? s = e[u.config.cols.iconOpen] || e[u.config.cols.iconClose] ? temf() : '<i class="layui-icon zlui-icon layui-tree-' + e[n.idField] + " layui-tree-" + (e[u.config.cols.isOpen] ? "branch" : "leaf") + '" ' + o + ">" + (e[u.config.cols.isOpen] ? this.config.branch[1] : this.config.branch[0]) + "</i>" : e[u.config.cols.icon] ? s = temf() : s += '<i class="layui-icon layui-tree-' + e[n.idField] + ' layui-tree-leaf" ' + o + ">" + this.config.leaf + "</i>", i) return s; var c = this.layBody.find('tr[data-index="' + e[u.config.indexName] + '"]').find("td[data-field=" + n.treeShowName + "]").find(".layui-table-cell"); t(c).find("div .layui-tree-" + e[n.idField]).remove(), t(c).find("div").append(s) }, Class.prototype.pullData = function (e, i, n) { var r = this, s = r.config, c = s.request, h = s.response; if (r.startTime = (new Date).getTime(), s.url) { var p = {}; s.page && (p[c.pageName] = String(e), p[c.limitName] = String(s.limit)), r.filterRulesSet(p), p = r.sortSet(p), s.isAsynchronous && (p = r.getParams(p)); var m = t.extend(p, s.where); s.contentType && 0 == s.contentType.indexOf("application/json") && (m = JSON.stringify(m)), t.ajax({ type: s.method || "get", url: s.url, contentType: s.contentType, traditional: s.traditional, data: m, dataType: "json", success: function (t) { if (t[h.dataName] || (t[h.dataName] = [], t[h.statusName] = 0, t[h.countName] = 0, t[h.msgName] = "返回的数据状态异常"), r.resetDataresetRoot = !0, "function" == typeof s.parseData && (t = s.parseData(t) || t), (s.isAsynchronous && 1 != d || null == n) && (r.resetDatas(t[h.dataName]), t[h.dataName] = u.getDataList(s.id)), t[h.statusName] != h.statusCode) r.renderForm(), r.layMain.html('<div class="' + y + '">' + (t[h.msgName] || "返回的数据状态异常") + "</div>"); else if (s.isAsynchronous && 1 == d) if (null != n) { var c = u.getDataList(r.key)[n]; r.treeNodeOpen(c, !c[u.config.cols.isOpen]), u.addRow(r.key, n + 1, t.obj), r.resize(), r.nodeKeyData = {} } else r.renderData(t, e, t[h.countName]), s.time = (new Date).getTime() - r.startTime + " ms"; else d = 1, r.renderData(t, e, t[h.countName]), s.time = (new Date).getTime() - r.startTime + " ms"; i && o.close(i), r.events(), "function" == typeof s.done && s.done(t, e, t[h.countName]) }, error: function (e, t) { r.layMain.html('<div class="' + y + '">数据接口请求异常</div>'), r.renderForm(), i && o.close(i) } }) } else if (s.data && s.data.constructor === Array) { var g = {}, b = e * s.limit - s.limit; g[h.dataName] = s.data.concat().splice(b, s.limit), g[h.countName] = s.data.length, "function" == typeof s.parseData && (g = s.parseData(g) || g), r.resetDatas(g[h.dataName]), g[h.dataName] = u.getDataList(s.id), r.renderData(g, e, s.data.length), "object" == typeof s.initSort && r.sort(s.initSort.field, s.initSort.type), r.events(), "function" == typeof s.done && s.done(g, e, g[h.countName]) } }, Class.prototype.filterRulesSet = function (e) { e.filterRules = JSON.stringify(this.filterRules()) }, Class.prototype.filterRules = function () { var e = [], i = this.layFilter.find("[name^='filter_']"); return layui.each(i, (function (i, n) { if (t(n).val()) { var o = { field: n.name, op: "like", value: t(n).val(), datatype: "string" }; e.push(o) } })), e }, Class.prototype.eachCols = function (e) { var i = t.extend(!0, [], this.config.cols), n = [], o = 0; layui.each(i, (function (e, t) { layui.each(t, (function (t, r) { if (r.colspan > 1) { var s = 0; o++, r.CHILD_COLS = [], layui.each(i[e + 1], (function (e, t) { t.PARENT_COL || s == r.colspan || (t.PARENT_COL = o, r.CHILD_COLS.push(t), s += t.colspan > 1 ? t.colspan : 1) })) } r.PARENT_COL || n.push(r) })) })); var eachArrs = function (t) { layui.each(t || n, (function (t, i) { if (i.CHILD_COLS) return eachArrs(i.CHILD_COLS); e(t, i) })) }; eachArrs() }, Class.prototype.renderTreeConvertShowName = function (e) { var i = this.config, n = (i.elem.next("." + m), this.treeConvertShowName(e)), o = this.layBody.find('tr[data-index="' + e[u.config.indexName] + '"]').find("td[data-field=" + i.treeShowName + "]").find(".layui-table-cell"); t(o).find("div").remove(), t(o).prepend(n) }, Class.prototype.renderTdCss = function () { var e = this, t = e.config.elem.next("." + m), i = e.index + "_" + h + "_td_style"; t.find("#" + i).remove(); var n, o = '<style id="' + i + '">' + (n = "", layui.each(e.config.cols, (function (t, i) { layui.each(i, (function (t, i) { n += ".laytable-cell-" + e.index + "-" + (i.field || t) + "{width:" + (i.width ? i.width + "px" : "0px") + "}" })) })), n + "</style>"); 0 == t.find("#" + e.index + "_" + h + "_style").length ? t.append(o) : t.find("#" + e.index + "_" + h + "_style").before(o) }, Class.prototype.renderCss = function () { var e = this.config.elem.next("." + m), t = this.index + "_" + h + "_style"; e.find("#" + t).remove(); var i = '<style id="' + t + '">.layui-tree-head{cursor: pointer;vertical-align: bottom;}</style>'; 0 == e.find("#" + this.index + "_" + h + "_td_style").length ? e.append(i) : e.find("#" + this.index + "_" + h + "_td_style").after(i) }, Class.prototype.renderTrUpids = function (e) { var t = this.config, i = t.treeUpId, n = (e.upIds, ' u_id="' + e[i] + '" '); return t.isTree ? n : "" }, Class.prototype.renderTd = function (e) { var n, o, r = this.config, s = e.cols, c = e.obj, d = e.numbers, h = e.i3, p = null == c[s.field] ? "" : String(c[s.field]), y = s.field || h, m = p, g = (this.getColElem(this.layHeader, y), ""); return r.isTree && r.treeShowName == s.field && (g = this.treeConvertShowName(c)), ['<td data-field="' + y + '" ' + (o = [], s.edit && o.push('data-edit="' + s.edit + '"'), s.align && o.push('align="' + s.align + '"'), s.templet && o.push('data-content="' + m + '"'), s.toolbar && o.push('data-off="true"'), s.event && o.push('lay-event="' + s.event + '"'), s.style && o.push('style="' + s.style + '"'), s.minWidth && o.push('data-minwidth="' + s.minWidth + '"'), o.join(" ") + ">"), '<div class="layui-table-cell laytable-cell-' + (n = r.index + "-" + y, ("normal" === s.type ? n : n + " laytable-cell-" + s.type) + '">') + g + '<p style="width: auto;height: 100%;">' + function () { var e, n, o = t.extend(!0, { LAY_INDEX: d }, c); if ("checkbox" === s.type) return o[u.config.cols.cheDisabled] ? "" : '<input type="checkbox" name="layTableCheckbox" value="' + o[u.config.indexName] + '" lay-skin="primary" ' + (n = u.config.cols.isCheckName, (s[n] ? (c[n] = s[n], s[n] ? "checked" : "") : o[n] ? "checked" : "") + ">"); if ("numbers" === s.type) return d; if ("drop" === s.type) { var h = dl.ui.table.drop.findFieldObj(r.cols[0], y); if (h && h.drop) { dl.cache.code.get(h.drop); return dl.ui.table.drop.findDropLable(h.drop, m) } } else if ("radio" === s.type) return o[u.config.cols.radDisabled] ? "" : '<input type="radio" name="' + k + r.id + '" ' + (e = u.config.cols.isRadio, (s[e] ? (c[e] = s[e], s[e] ? "checked" : "") : o[e] ? "checked" : "") + ' value="') + o[u.config.indexName] + '" title=" ">'; return s.toolbar ? i(t(s.toolbar).html() || "").render(o) : s.templet ? "function" == typeof s.templet ? s.templet(o) : i(t(s.templet).html() || String(m)).render(o) : m }(), "</p></div></td>"].join("") }, Class.prototype.renderTr = function (e, t) { var i = this, n = (i.config, []); return i.eachCols((function (o, r) { var s = r.field || o, c = e[s]; i.getColElem(i.layHeader, s); if (null == c && (c = ""), !(r.colspan > 1)) { var d = i.renderTd({ obj: e, numbers: t, cols: r, i3: o }); n.push(d) } })), n }, Class.prototype.renderData = function (e, t, i, n) { var r = this, s = r.config, c = e[s.response.dataName] || [], d = [], h = [], p = [], render = function () { if (!n && r.sortKey) return r.sort(r.sortKey.field, r.sortKey.sort, !0); layui.each(c, (function (e, i) { r.treeFindUpData(i); var o = ""; !i[u.config.cols.isShow] && s.isTree && (o = "display: none;"); var c = [], y = e + s.limit * (t - 1) + 1; 0 !== i.length && (n || (i[u.config.indexName] = e), c = r.renderTr(i, y), d.push('<tr style="' + o + '" data-index="' + e + '" ' + r.renderTrUpids(i) + ">" + c.join("") + "</tr>"), h.push('<tr data-index="' + e + '">' + [].join("") + "</tr>"), p.push('<tr data-index="' + e + '">' + [].join("") + "</tr>")) })), r.layBody.scrollTop(0), r.layMain.find("." + y).remove(), r.layMain.find("tbody").html(d.join("")), r.layFixLeft.find("tbody").html(h.join("")), r.layFixRight.find("tbody").html(p.join("")), r.renderForm(), r.syncCheckAll(), r.haveInit ? r.scrollPatch() : setTimeout((function () { r.scrollPatch() }), 50), r.haveInit = !0, o.close(r.tipsIndex) }; if (r.key = s.id || s.index, u.setDataList(r.key, c), r.layPage[0 === c.length && 1 == t ? "addClass" : "removeClass"]("layui-hide"), n) return render(); if (0 === c.length) { r.renderForm(), r.layFixed.remove(), r.layMain.find("tbody").html(""), r.layMain.find("." + y).remove(); var m = 0, g = 0, b = 0, k = 0; return r.layMain.height() > 150 ? (m = "40px", g = "80px", b = "22px", k = "10px") : (m = "10px", g = "40px", b = "14px", k = "5px"), r.layMain.append('<div class="' + y + '" style="padding-bottom: 0;"> <div class="empty-data" style="text-align:center;padding-top: ' + m + ';font-size: 25px;color: #ccc;font-family: tahoma ,微软雅黑;"> <i class="layui-icon layui-icon-search" style="font-size: ' + g + ';"></i> <div style="padding-top: ' + k + ";font-size: " + b + ';">' + s.text.none + "</div> </div></div>") } render(), r.renderPage(i), u.pushClassIds(s.id, !0) }, Class.prototype.renderPage = function (e) { var i = this, o = i.config; o.isPage && (o.page = t.extend({ elem: "layui-table-page" + o.index, count: e, limit: o.limit, limits: o.limits || [10, 15, 20, 30, 40, 50, 60, 70, 80, 90], groups: 3, layout: ["prev", "page", "next", "skip", "count", "limit"], prev: '<i class="layui-icon"></i>', next: '<i class="layui-icon"></i>', jump: function (e, t) { t || (i.page = e.curr, o.limit = e.limit, i.pullData(e.curr, i.loading())) } }, o.page), o.page.count = e, n.render(o.page)) }, Class.prototype.renderFilter = function () { var e = this.config, t = this.index, i = []; return i.push('<form method="post" id="' + e.id + '_filter_form">'), i.push('<table cellspacing="0" cellpadding="0" border="0" class="layui-table"><thead><tr>'), layui.each(e.cols, (function (e, n) { layui.each(n, (function (e, n) { var o, r = n.field || e, s = n.minWidth ? "data-minwidth='" + n.minWidth + "'" : "", c = n.colspan ? 'colspan="' + n.colspan + '"' : "", d = n.rowspan ? 'rowspan="' + n.rowspan + '"' : "", u = n.unresize ? 'data-unresize="true"' : ""; i.push('<th data-field="' + r + '"' + s + c + d + u + ">"), i.push('<div class="layui-table-cell laytable-cell-' + (o = "", n.colspan > 1 ? o = "group" : (o = t + "-" + r, "normal" !== n.type && (o += " laytable-cell-" + n.type)), o + '">')), n.isFilter && n.field ? i.push('<input class="layui-input ' + b + '" id="filter_' + n.field + '" name="filter_' + n.field + '">') : i.push(""), i.push("</div></th>") })) })), i.push("</tr></thead></table>"), i.push("</form>"), i.join("") }, Class.prototype.getColElem = function (e, t) { var i = this.config; return e.eq(0).find(".laytable-cell-" + i.index + "-" + t + ":eq(0)") }, Class.prototype.renderForm = function (e) { r.render(e, "LAY-table-" + this.index) }, Class.prototype.getParams = function (e) { return e = t.extend({}, e, this.nodeKeyData) }, Class.prototype.sortSet = function (e) { return e = t.extend({}, e, this.sortKeyData) }, Class.prototype.sort = function (e, i, n, o) { var r = this.config; r.elem.attr("lay-filter"), u.getDataList(this.key); "string" == typeof e && this.layHeader.find("th").each((function (i, n) { var o = t(this), r = o.data("field"); if (r === e) return e = o, c = r, !1 })); try { var c = c || e.data("field"); if (this.sortKey && !n && c === this.sortKey.field && i === this.sortKey.sort) return; var d = this.layHeader.find("th .laytable-cell-" + r.index + "-" + c).find(g); this.layHeader.find("th").find(g).removeAttr("lay-sort"), d.attr("lay-sort", i || null), this.layFixed.find("th") } catch (e) { return s.error("Table modules: Did not match to field") } this.sortKeyData = { FIELD: c, ORDER: i } }, Class.prototype.loading = function () { var e = this.config; if (e.loading && e.url) return o.msg("数据查询中,请稍候...", { icon: 16, offset: [this.elem.offset().top + this.elem.height() / 2 - 35 - D.scrollTop() + "px", this.elem.offset().left + this.elem.width() / 2 - 90 - D.scrollLeft() + "px"], time: -1, anim: -1, fixed: !1 }) }, Class.prototype.setCheckData = function (e, t) { this.config; var i = u.getDataList(this.key); i[e] && i[e].constructor !== Array && (i[e][u.config.cols.isCheckName] = t) }, Class.prototype.syncCheckAll = function () { var e = this, t = e.config, i = u.getDataList(e.config.id); if (i) { var n = !0, o = 0; if (i.forEach((function (t) { t[u.config.cols.cheDisabled] || (t[u.config.cols.isCheckName] ? (e.layBody.find("tr[data-index=" + t[u.config.indexName] + "]").find('input[name="layTableCheckbox"]').prop("checked", !0), o++) : (n = !1, e.layBody.find("tr[data-index=" + t[u.config.indexName] + "]").find('input[name="layTableCheckbox"]').prop("checked", !1))) })), n) e.layHeader.find('input[name="layTableCheckbox"]').prop("checked", !0); if (o < i.length - t.cheDisabledNum) e.layHeader.find('input[name="layTableCheckbox"]').prop("checked", !1); e.renderForm("checkbox") } }, Class.prototype.getCssRule = function (e, t) { var i = this, n = i.elem.find("style")[0], o = n.sheet || n.styleSheet || {}, r = o.cssRules || o.rules; layui.each(r, (function (n, o) { if (o.selectorText === ".laytable-cell-" + i.index + "-" + e) return t(o), !0 })) }, Class.prototype.resize = function () { this.fullSize(), this.setArea(), this.resizeWidth() }, Class.prototype.setArea = function () { var e, t = this, i = t.config, n = 0, o = 0, r = 0, s = 0, c = i.width || (e = function (t) { var n, o; n = (t = t || i.elem.parent()).width(); try { o = "none" === t.css("display") } catch (e) { } return !t[0] || n && !o ? n : e(t.parent()) })() - 17; t.eachCols((function () { n++ })), c -= "line" === i.skin || "nob" === i.skin ? 2 : n + 1, layui.each(i.cols, (function (e, i) { layui.each(i, (function (e, n) { var r; n ? (t.initOpts(n), r = n.width || 0, n.colspan > 1 || (/\d+%$/.test(r) ? n.width = r = Math.floor(parseFloat(r) / 100 * c) : !n._is_width_dev && r || (n._is_width_dev = !0, n.width = r = 0, o++), s += r)) : i.splice(e, 1) })) })), t.autoColNums = o, c > s && o && (r = (c - s) / o), layui.each(i.cols, (function (e, t) { layui.each(t, (function (e, t) { var n = t.minWidth || i.cellMinWidth; t.colspan > 1 || 0 === t.width && (t.width = Math.floor(r >= n ? r : n)) })) })); var d = t.getParentDivHeight(i.id); i.height && /^full-\d+$/.test(i.height) && (t.fullHeightGap = i.height.split("-")[1]), null != t.fullHeightGap && (i.height = d - t.fullHeightGap) }, Class.prototype.resizeWidth = function () { this.renderTdCss() }, Class.prototype.fullSize = function () { var e, t = this.config, i = this.getParentDivHeight(t.id); null != this.fullHeightGap && (i = this.getParentDivHeight(t.id) - this.fullHeightGap), i < 135 && (i = 135), this.elem.css("height", i); var n = t.isFilter ? 76 : 38; e = parseFloat(i) - n - 1, t.toolbar && (e -= this.layTool.outerHeight()), t.isPage && (e = e - this.layPage.outerHeight() - 1), this.layMain.css("height", e) }, Class.prototype.getScrollWidth = function (e) { var t = 0; return e ? t = e.offsetWidth - e.clientWidth : ((e = document.createElement("div")).style.width = "100px", e.style.height = "100px", e.style.overflowY = "scroll", document.body.appendChild(e), t = e.offsetWidth - e.clientWidth, document.body.removeChild(e)), t }, Class.prototype.scrollPatch = function () { var e = this, i = e.layMain.children("table"), n = e.layMain.width() - e.layMain.prop("clientWidth"), o = e.layMain.height() - e.layMain.prop("clientHeight"), r = e.getScrollWidth(e.layMain[0]), s = i.outerWidth() - e.layMain.width(); if (e.autoColNums && s < 5 && !e.scrollPatchWStatus) { var c = e.layHeader.eq(0).find("thead th:last-child"), d = c.data("field"); e.getCssRule(d, (function (t) { var i = t.style.width || c.outerWidth(); t.style.width = parseFloat(i) - r - s + "px", e.layMain.height() - e.layMain.prop("clientHeight") > 0 && (t.style.width = parseFloat(t.style.width) - 1 + "px"), e.scrollPatchWStatus = !0 })) } if (n && o) { if (e.elem.find(".layui-table-patch").length <= 0) { var u = t('<th class="layui-table-patch"><div class="layui-table-cell"></div></th>'); u.find("div").css({ width: n }), e.layHeader.eq(0).find("thead tr").append(u) } } else e.layFilter.eq(0).find(".layui-table-patch").remove(), e.layHeader.eq(0).find(".layui-table-patch").remove(); var h = e.layMain.height() - o; e.layFixed.find(".layui-table-body").css("height", i.height() > h ? h : "auto"), e.layFixRight[s > 0 ? "removeClass" : "addClass"]("layui-hide"), e.layFixRight.css("right", n - 1) }, Class.prototype.events = function () { var e, i = this, n = i.config, r = t("body"), s = {}, c = i.layHeader.find("th"), d = i.layBody.find("tr"); d.unbind("click").on("click", (function (e) { var o = t(this).attr("data-index"), r = u.getDataList(i.config.id)[o]; "function" == typeof n.onClickRow && n.onClickRow(o, r) })), d.unbind("dblclick").on("dblclick", (function (e) { var o = t(this).attr("data-index"), r = u.getDataList(i.config.id)[o]; "function" == typeof n.onDblClickRow && n.onDblClickRow(o, r) })), c.unbind("mousemove").on("mousemove", (function (e) { var i = t(this), n = i.offset().left, o = e.clientX - n; i.attr("colspan") > 1 || i.data("unresize") || s.resizeStart || (s.allowResize = i.width() - o <= 10, r.css("cursor", s.allowResize ? "col-resize" : "")) })), c.unbind("mouseleave").on("mouseleave", (function () { t(this); s.resizeStart || r.css("cursor", "") })), c.unbind("mousedown").on("mousedown", (function (e) { var o = t(this); if (s.allowResize) { var r = o.data("field"); e.preventDefault(), s.resizeStart = !0, s.offset = [e.clientX, e.clientY], i.getCssRule(r, (function (e) { var t = e.style.width || o.outerWidth(); s.rule = e, s.ruleWidth = parseFloat(t), s.minWidth = o.data("minwidth") || n.cellMinWidth })) } })), c.unbind("mouseup").on("mouseup", (function (e) { var n = t(this), o = n.data("field"); e.preventDefault(), i.getCssRule(o, (function (e) { var t = e.style.width || n.outerWidth(); layui.each(i.config.cols, (function (e, i) { layui.each(i, (function (e, i) { i.field && i.field == o && (i.width = parseFloat(t)) })) })) })) })), E.unbind("mousemove").on("mousemove", (function (t) { if (s.resizeStart) { if (t.preventDefault(), s.rule) { var n = s.ruleWidth + t.clientX - s.offset[0]; n < s.minWidth && (n = s.minWidth), s.rule.style.width = n + "px", o.close(i.tipsIndex) } e = 1 } })), E.unbind("mouseup").on("mouseup", (function (t) { s.resizeStart && (s = {}, r.css("cursor", ""), i.scrollPatch()), 2 === e && (e = null) })), c.unbind("click").on("click", (function () { var n, o = t(this), r = o.find(g), s = r.attr("lay-sort"); if (!r[0] || 1 === e) return e = 2; n = "asc" === s ? "desc" : "desc" === s ? null : "asc", i.sort(o, n, null, !0), u.query(i.key) })), c.find(g + " .layui-edge ").unbind("click").on("click", (function (e) { var n = t(this), o = n.index(), r = n.parents("th").eq(0).data("field"); layui.stope(e), 0 === o ? i.sort(r, "asc", null, !0) : i.sort(r, "desc", null, !0), u.query(i.key) })), i.eventsinitIsRun || (i.eventsinit(), i.eventsinitIsRun = !0), i.layMain.unbind("scroll").on("scroll", (function () { var e = t(this), n = e.scrollLeft(), r = e.scrollTop(); i.layHeader.scrollLeft(n), i.layFilter.scrollLeft(n), i.layFixed.find(".layui-table-body").scrollTop(r), o.close(i.tipsIndex) })), D.unbind("resize").on("resize", (function () { i.resize() })) }, Class.prototype.eventsinitIsRun = !1, Class.prototype.eventsinit = function () { var e = this, n = e.config, r = ".layui-table-cell", s = n.elem.attr("lay-filter"); e.layFilter.on("keyup", "[name^='filter_']", (function () { e.page = 1, e.pullData(e.page, e.loading()) })), e.layBody.on("mouseenter", "tr", (function () { var i = t(this).index(); e.layBody.find("tr:eq(" + i + ")").addClass("layui-table-hover") })), e.layBody.on("mouseleave", "tr", (function () { var i = t(this).index(); e.layBody.find("tr:eq(" + i + ")").removeClass("layui-table-hover") })), e.layBody.on("click", "td div.layui-table-cell p", (function () { var i = t(this).parent().parent(), n = i.data("field"), s = i.data("edit"), d = i.parents("tr").eq(0).data("index"), h = u.getDataList(e.key)[d], p = i.children(r), y = e.config; if (o.close(e.tipsIndex), !i.data("off")) if (s) if ("select" === s) { i.data("drop"); var m = dl.ui.table.drop.findFieldObj(y.cols[0], n), g = "", k = dl.cache.code.get(m.drop).syscodevaluecache; for (var w in k) { var C = ""; k[w].scv_value == h[n] && (C = "selected='selected'"), g += "<option " + C + ' value="' + k[w].scv_value + '">' + k[w].scv_show_name + "</option>" } var D = t('<select class="' + b + '" lay-ignore>' + g + "</select>"); i.find("." + b)[0] || i.append(D) } else { var E = t('<input class="layui-input ' + b + '">'); E[0].value = t.trim(t(this).text()), i.find("." + b)[0] || i.append(E), E.focus() } else { var S = e.getCols(n); if (!u.config.initWidth[S.type]) { if (p.find(".layui-form-switch,.layui-form-checkbox")[0]) return; Math.round(p.prop("scrollWidth")) > Math.round(p.outerWidth()) && (e.tipsIndex = o.tips(['<div class="layui-table-tips-main" style="margin-top: -' + (p.height() + 16) + "px;" + ("sm" === y.size ? "padding: 4px 15px; font-size: 12px;" : "lg" === y.size ? "padding: 14px 15px;" : "") + '">', p.html(), "</div>", '<i class="layui-icon layui-table-tips-c">ဆ</i>'].join(""), p[0], { tips: [3, ""], time: -1, anim: -1, maxWidth: c.ios || c.android ? 300 : 600, isOutAnim: !1, skin: "layui-table-tips", success: function (e, t) { e.find(".layui-table-tips-c").on("click", (function () { o.close(t) })) } })) } } })), e.layBody.on("change", "." + b, (function () { var i = t(this), n = this.value, o = i.parent().data("field"), r = i.parents("tr").eq(0).data("index"), c = u.getDataList(e.key)[r]; c[o] = n, layui.event.call(this, h, "edit(" + s + ")", { value: n, data: c, field: o }) })), e.layBody.on("blur", "." + b, (function () { var n, o = t(this), s = o.parent().data("field"), c = o.parents("tr").eq(0).data("index"), d = o.parent().data("edit"), h = u.getDataList(e.key)[c], p = e.config; e.eachCols((function (e, t) { t.field == s && t.templet && (n = t.templet) })); var y = ""; if ("select" === d) { var m = dl.ui.table.drop.findFieldObj(p.cols[0], s); if (m && m.drop) { dl.cache.code.get(m.drop); y = dl.ui.table.drop.findDropLable(m.drop, this.value) } o.parent().find(r + " p").html(n ? i(t(n).html() || y).render(h) : y) } else o.parent().find(r + " p").html(n ? i(t(n).html() || this.value).render(h) : this.value); o.parent().data("content", this.value), o.remove() })), e.elem.on("click", "i.layui-tree-head", (function () { var i = t(this).parents("tr").eq(0).data("index"), n = e.config, o = u.getDataList(e.key)[i], r = o[n.treeId]; if (!n.isAsynchronous || o.children && 0 != o.children.length) e.treeNodeOpen(o, !o[u.config.cols.isOpen]), e.resize(); else { var s = n.parentid; e.nodeKeyData = {}, e.nodeKeyData[s] = r, e.pullData(e.page, e.loading(), i) } })), e.elem.on("click", 'input[name="layTableCheckbox"]+', (function () { var i = t(this).prev(), o = (e.layBody.find('input[name="layTableCheckbox"]'), i.parents("tr").eq(0).data("index")), r = i[0].checked, c = u.getDataList(e.config.id)[o], d = "layTableAllChoose" === i.attr("lay-filter"); if (d) u.getDataList(e.key).forEach((function (t) { t[u.config.cols.cheDisabled] || e.setCheckData(t[u.config.indexName], r) })); else if (e.setCheckData(o, r), n.isTree) { e.treeFindSonData(c).forEach((function (t) { if (!t[u.config.cols.cheDisabled]) { if (r && ("" == n.chkboxType.Y || "p" == n.chkboxType.Y)) return !1; if (!(r || "" != n.chkboxType.N && "p" != n.chkboxType.N)) return !1; e.setCheckData(t[u.config.indexName], r) } })); var temf = function (t) { if (null != t && t && t.children.length > 0) { var i = !0; if (t.children.forEach((function (e) { e[u.config.cols.isCheckName] || (i = !1) })), i) { if (r && ("" == n.chkboxType.Y || "s" == n.chkboxType.Y)) return !1; if (!(r || "" != n.chkboxType.N && "s" != n.chkboxType.N)) return !1; e.setCheckData(t[u.config.indexName], r) } var o = e.treeFindUpData(t); o && temf(o) } }, p = e.treeFindUpData(c); temf(p) } e.syncCheckAll(), layui.event.call(this, h, "checkbox(" + s + ")", { checked: r, data: u.getDataList(e.key) && c || {}, type: d ? "all" : "one" }) })), e.layBody.on("click", "*[lay-event]", (function () { var o = t(this), c = o.parents("tr").eq(0).data("index"), d = e.layBody.find('tr[data-index="' + c + '"]'), p = (u.getDataList(e.key), u.getDataList(e.key)[c]); layui.event.call(this, h, "tool(" + s + ")", { data: p, event: o.attr("lay-event"), tr: d, del: function () { u.delRow(n.id, p) }, update: function (n) { n = n || {}, layui.each(n, (function (n, o) { if (n in p) { var s, c = d.children('td[data-field="' + n + '"]'); p[n] = o, e.eachCols((function (e, t) { t.field == n && t.templet && (s = t.templet) })), c.children(r).html(s ? i(t(s).html() || o).render(p) : o), c.data("content", o) } })) } }), d.addClass("layui-table-click").siblings("tr").removeClass("layui-table-click") })) }, Class.prototype.lazyLoad = function (e, t, i, n) { }, thisTable.config = {}, u.init(), e(h, u) })) }, function (e, t) {
|
||
/**
|
||
|
||
@Title: layui.upload 文件上传
|
||
@Author: 贤心
|
||
@License:MIT
|
||
|
||
*/
|
||
layui.define("layer", (function (e) { "use strict"; var t = layui.$, i = layui.layer, n = layui.hint(), o = layui.device(), r = { config: {}, set: function (e) { return this.config = t.extend({}, this.config, e), this }, on: function (e, t) { return layui.onevent.call(this, s, e, t) } }, thisUpload = function () { var e = this; return { upload: function (t) { e.upload.call(e, t) }, config: e.config } }, s = "upload", c = "layui-upload-form", d = "layui-upload-iframe", Class = function (e) { this.config = t.extend({}, this.config, r.config, e), this.render() }; Class.prototype.config = { accept: "images", exts: "", auto: !0, bindAction: "", url: "", field: "file", method: "post", data: {}, drag: !0, size: 0, number: 0, multiple: !1 }, Class.prototype.render = function (e) { (e = this.config).elem = t(e.elem), e.bindAction = t(e.bindAction), this.file(), this.events() }, Class.prototype.file = function () { var e = this.config, i = this.elemFile = t(['<input class="layui-upload-file" type="file" accept="' + e.acceptMime + '" name="' + e.field + '"', e.multiple ? " multiple" : "", ">"].join("")), n = e.elem.next(); (n.hasClass("layui-upload-file") || n.hasClass(c)) && n.remove(), o.ie && o.ie < 10 && e.elem.wrap('<div class="layui-upload-wrap"></div>'), this.isFile() ? (this.elemFile = e.elem, e.field = e.elem[0].name) : e.elem.after(i), o.ie && o.ie < 10 && this.initIE() }, Class.prototype.initIE = function () { var e, i = this.config, n = t('<iframe id="' + d + '" class="' + d + '" name="' + d + '" frameborder="0"></iframe>'), o = t(['<form target="' + d + '" class="' + c + '" method="post" key="set-mine" enctype="multipart/form-data" action="' + i.url + '">', "</form>"].join("")); t("#" + d)[0] || t("body").append(n), i.elem.next().hasClass(c) || (this.elemFile.wrap(o), i.elem.next("." + c).append((e = [], layui.each(i.data, (function (t, i) { i = "function" == typeof i ? i() : i, e.push('<input type="hidden" name="' + t + '" value="' + i + '">') })), e.join("")))) }, Class.prototype.msg = function (e) { return i.msg(e, { icon: 2, shift: 6 }) }, Class.prototype.isFile = function () { var e = this.config.elem[0]; if (e) return "input" === e.tagName.toLocaleLowerCase() && "file" === e.type }, Class.prototype.preview = function (e) { window.FileReader && layui.each(this.chooseFiles, (function (t, i) { var n = new FileReader; n.readAsDataURL(i), n.onload = function () { e && e(t, i, this.result) } })) }, Class.prototype.upload = function (e, i) { var n, r, s = this, c = s.config, u = s.elemFile[0], ajaxSend = function () { var i = 0, n = 0, o = e || s.files || s.chooseFiles || u.files, allDone = function () { c.multiple && i + n === s.fileLength && "function" == typeof c.allDone && c.allDone({ total: s.fileLength, successful: i, aborted: n }) }; layui.each(o, (function (e, o) { var r = new FormData; r.append(c.field, o), layui.each(c.data, (function (e, t) { t = "function" == typeof t ? t() : t, r.append(e, t) })), t.ajax({ url: c.url, type: "post", data: r, contentType: !1, processData: !1, dataType: "json", headers: c.headers || {}, success: function (t) { i++, done(e, t), allDone() }, error: function () { n++, s.msg("请求上传接口出现异常"), error(e), allDone() } }) })) }, done = function (e, t) { if (s.elemFile.next(".layui-upload-choose").remove(), u.value = "", "object" != typeof t) try { t = JSON.parse(t) } catch (e) { return t = {}, s.msg("请对上传接口返回有效JSON") } "function" == typeof c.done && c.done(t, e || 0, (function (e) { s.upload(e) })) }, error = function (e) { c.auto && (u.value = ""), "function" == typeof c.error && c.error(e || 0, (function (e) { s.upload(e) })) }, h = c.exts, p = (r = [], layui.each(e || s.chooseFiles, (function (e, t) { r.push(t.name) })), r), y = { preview: function (e) { s.preview(e) }, upload: function (e, t) { var i = {}; i[e] = t, s.upload(i) }, pushFile: function () { return s.files = s.files || {}, layui.each(s.chooseFiles, (function (e, t) { s.files[e] = t })), s.files }, resetFile: function (e, t, i) { var n = new File([t], i); s.files = s.files || {}, s.files[e] = n } }; if (0 !== (p = 0 === p.length ? u.value.match(/[^\/\\]+\..+/g) || [] || "" : p).length) { switch (c.accept) { case "file": if (h && !RegExp("\\w\\.(" + h + ")$", "i").test(escape(p))) return s.msg("选择的文件中包含不支持的格式"), u.value = ""; break; case "video": if (!RegExp("\\w\\.(" + (h || "avi|mp4|wma|rmvb|rm|flash|3gp|flv") + ")$", "i").test(escape(p))) return s.msg("选择的视频中包含不支持的格式"), u.value = ""; break; case "audio": if (!RegExp("\\w\\.(" + (h || "mp3|wav|mid") + ")$", "i").test(escape(p))) return s.msg("选择的音频中包含不支持的格式"), u.value = ""; break; default: if (layui.each(p, (function (e, t) { RegExp("\\w\\.(" + (h || "jpg|png|gif|bmp|jpeg$") + ")", "i").test(escape(t)) || (n = !0) })), n) return s.msg("选择的图片中包含不支持的格式"), u.value = "" }var m, g, b; if (s.fileLength = (m = 0, g = e || s.files || s.chooseFiles || u.files, layui.each(g, (function () { m++ })), m), c.number && s.fileLength > c.number) return s.msg("同时最多只能上传的数量为:" + c.number); if (c.size > 0 && !(o.ie && o.ie < 10)) if (layui.each(s.chooseFiles, (function (e, t) { if (t.size > 1024 * c.size) { var i = c.size / 1024; i = i >= 1 ? i.toFixed(2) + "MB" : c.size + "KB", u.value = "", b = i } })), b) return s.msg("文件不能超过" + b); !function () { if ("choose" !== i && !c.auto || (c.choose && c.choose(y), "choose" !== i)) { if (c.before && c.before(y), o.ie) return o.ie > 9 ? ajaxSend() : (e = t("#" + d), s.elemFile.parent().submit(), clearInterval(Class.timer), void (Class.timer = setInterval((function () { var t, i = e.contents().find("body"); try { t = i.text() } catch (e) { s.msg("获取上传后的响应信息出现异常"), clearInterval(Class.timer), error() } t && (clearInterval(Class.timer), i.html(""), done(0, t)) }), 30))); var e; ajaxSend() } }() } }, Class.prototype.events = function () { var e = this, i = e.config, setChooseFile = function (t) { e.chooseFiles = {}, layui.each(t, (function (t, i) { var n = (new Date).getTime(); e.chooseFiles[n + "-" + t] = i })) }, setChooseText = function (t, n) { var o = e.elemFile, r = t.length > 1 ? t.length + "个文件" : (t[0] || {}).name || o[0].value.match(/[^\/\\]+\..+/g) || [] || ""; o.next().hasClass("layui-upload-choose") && o.next().remove(), e.upload(null, "choose"), e.isFile() || i.choose || o.after('<span class="layui-inline layui-upload-choose">' + r + "</span>") }; i.elem.off("upload.start").on("upload.start", (function () { var o = t(this), r = o.attr("lay-data"); if (r) try { r = new Function("return " + r)(), e.config = t.extend({}, i, r), o.next().attr("accept", e.config.accept), o.next().attr("multiple", e.config.multiple) } catch (e) { n.error("Upload element property lay-data configuration item has a syntax error: " + r) } e.config.item = o, e.elemFile[0].click() })), o.ie && o.ie < 10 || i.elem.off("upload.over").on("upload.over", (function () { t(this).attr("lay-over", "") })).off("upload.leave").on("upload.leave", (function () { t(this).removeAttr("lay-over") })).off("upload.drop").on("upload.drop", (function (n, o) { var r = t(this), s = o.originalEvent.dataTransfer.files || []; r.removeAttr("lay-over"), setChooseFile(s), i.auto ? e.upload(s) : setChooseText(s) })), e.elemFile.off("upload.change").on("upload.change", (function () { var t = this.files || []; setChooseFile(t), i.auto ? e.upload() : setChooseText(t) })), i.bindAction.off("upload.action").on("upload.action", (function () { e.upload() })), i.elem.data("haveEvents") || (e.elemFile.on("change", (function () { t(this).trigger("upload.change") })), i.elem.on("click", (function () { e.isFile() || t(this).trigger("upload.start") })), i.drag && i.elem.on("dragover", (function (e) { e.preventDefault(), t(this).trigger("upload.over") })).on("dragleave", (function (e) { t(this).trigger("upload.leave") })).on("drop", (function (e) { e.preventDefault(), t(this).trigger("upload.drop", e) })), i.bindAction.on("click", (function () { t(this).trigger("upload.action") })), i.elem.data("haveEvents", !0)) }, r.render = function (e) { var t = new Class(e); return thisUpload.call(t) }, e(s, r) }))
|
||
}]); |