Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _taggedTemplateLiteral(e, t) {
- return Object.freeze(Object.defineProperties(e, {
- raw: {
- value: Object.freeze(t)
- }
- }))
- }
- function gup(e) {
- e = e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
- var t = "[\\?&]" + e + "=([^&#]*)",
- n = new RegExp(t),
- o = n.exec(window.location.href);
- return null === o ? "" : o[1]
- }! function(e, t) {
- "use strict";
- "object" == typeof module && "object" == typeof module.exports ? module.exports = e.document ? t(e, !0) : function(e) {
- if (!e.document) throw new Error("jQuery requires a window with a document");
- return t(e)
- } : t(e)
- }("undefined" != typeof window ? window : this, function(e, t) {
- "use strict";
- function n(e, t, n) {
- var o, i = (t = t || re).createElement("script");
- if (i.text = e, n)
- for (o in we) n[o] && (i[o] = n[o]);
- t.head.appendChild(i).parentNode.removeChild(i)
- }
- function o(e) {
- return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? pe[he.call(e)] || "object" : typeof e
- }
- function i(e) {
- var t = !!e && "length" in e && e.length,
- n = o(e);
- return !ve(e) && !ye(e) && ("array" === n || 0 === t || "number" == typeof t && t > 0 && t - 1 in e)
- }
- function a(e, t) {
- return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase()
- }
- function r(e, t, n) {
- return ve(t) ? xe.grep(e, function(e, o) {
- return !!t.call(e, o, e) !== n
- }) : t.nodeType ? xe.grep(e, function(e) {
- return e === t !== n
- }) : "string" != typeof t ? xe.grep(e, function(e) {
- return de.call(t, e) > -1 !== n
- }) : xe.filter(t, e, n)
- }
- function l(e, t) {
- for (;
- (e = e[t]) && 1 !== e.nodeType;);
- return e
- }
- function s(e) {
- var t = {};
- return xe.each(e.match(Se) || [], function(e, n) {
- t[n] = !0
- }), t
- }
- function c(e) {
- return e
- }
- function u(e) {
- throw e
- }
- function d(e, t, n, o) {
- var i;
- try {
- e && ve(i = e.promise) ? i.call(e).done(t).fail(n) : e && ve(i = e.then) ? i.call(e, t, n) : t.apply(void 0, [e].slice(o))
- } catch (e) {
- n.apply(void 0, [e])
- }
- }
- function p() {
- re.removeEventListener("DOMContentLoaded", p), e.removeEventListener("load", p), xe.ready()
- }
- function h(e, t) {
- return t.toUpperCase()
- }
- function f(e) {
- return e.replace(Oe, "ms-").replace(Ne, h)
- }
- function b() {
- this.expando = xe.expando + b.uid++
- }
- function m(e) {
- return "true" === e || "false" !== e && ("null" === e ? null : e === +e + "" ? +e : Ue.test(e) ? JSON.parse(e) : e)
- }
- function g(e, t, n) {
- var o;
- if (void 0 === n && 1 === e.nodeType)
- if (o = "data-" + t.replace(Be, "-$&").toLowerCase(), "string" == typeof(n = e.getAttribute(o))) {
- try {
- n = m(n)
- } catch (e) {}
- He.set(e, t, n)
- } else n = void 0;
- return n
- }
- function v(e, t, n, o) {
- var i, a, r = 20,
- l = o ? function() {
- return o.cur()
- } : function() {
- return xe.css(e, t, "")
- },
- s = l(),
- c = n && n[3] || (xe.cssNumber[t] ? "" : "px"),
- u = (xe.cssNumber[t] || "px" !== c && +s) && We.exec(xe.css(e, t));
- if (u && u[3] !== c) {
- for (s /= 2, c = c || u[3], u = +s || 1; r--;) xe.style(e, t, u + c), (1 - a) * (1 - (a = l() / s || .5)) <= 0 && (r = 0), u /= a;
- u *= 2, xe.style(e, t, u + c), n = n || []
- }
- return n && (u = +u || +s || 0, i = n[1] ? u + (n[1] + 1) * n[2] : +n[2], o && (o.unit = c, o.start = u, o.end = i)), i
- }
- function y(e) {
- var t, n = e.ownerDocument,
- o = e.nodeName,
- i = Ke[o];
- return i || (t = n.body.appendChild(n.createElement(o)), i = xe.css(t, "display"), t.parentNode.removeChild(t), "none" === i && (i = "block"), Ke[o] = i, i)
- }
- function w(e, t) {
- for (var n, o, i = [], a = 0, r = e.length; a < r; a++)(o = e[a]).style && (n = o.style.display, t ? ("none" === n && (i[a] = Re.get(o, "display") || null, i[a] || (o.style.display = "")), "" === o.style.display && ze(o) && (i[a] = y(o))) : "none" !== n && (i[a] = "none", Re.set(o, "display", n)));
- for (a = 0; a < r; a++) null != i[a] && (e[a].style.display = i[a]);
- return e
- }
- function x(e, t) {
- var n;
- return n = void 0 !== e.getElementsByTagName ? e.getElementsByTagName(t || "*") : void 0 !== e.querySelectorAll ? e.querySelectorAll(t || "*") : [], void 0 === t || t && a(e, t) ? xe.merge([e], n) : n
- }
- function _(e, t) {
- for (var n = 0, o = e.length; n < o; n++) Re.set(e[n], "globalEval", !t || Re.get(t[n], "globalEval"))
- }
- function j(e, t, n, i, a) {
- for (var r, l, s, c, u, d, p = t.createDocumentFragment(), h = [], f = 0, b = e.length; f < b; f++)
- if ((r = e[f]) || 0 === r)
- if ("object" === o(r)) xe.merge(h, r.nodeType ? [r] : r);
- else if (Je.test(r)) {
- for (l = l || p.appendChild(t.createElement("div")), s = (Ge.exec(r) || ["", ""])[1].toLowerCase(), c = Ze[s] || Ze._default, l.innerHTML = c[1] + xe.htmlPrefilter(r) + c[2], d = c[0]; d--;) l = l.lastChild;
- xe.merge(h, l.childNodes), (l = p.firstChild).textContent = ""
- } else h.push(t.createTextNode(r));
- for (p.textContent = "", f = 0; r = h[f++];)
- if (i && xe.inArray(r, i) > -1) a && a.push(r);
- else if (u = xe.contains(r.ownerDocument, r), l = x(p.appendChild(r), "script"), u && _(l), n)
- for (d = 0; r = l[d++];) Qe.test(r.type || "") && n.push(r);
- return p
- }
- function T() {
- return !0
- }
- function M() {
- return !1
- }
- function k() {
- try {
- return re.activeElement
- } catch (e) {}
- }
- function C(e, t, n, o, i, a) {
- var r, l;
- if ("object" == typeof t) {
- "string" != typeof n && (o = o || n, n = void 0);
- for (l in t) C(e, l, n, o, t[l], a);
- return e
- }
- if (null == o && null == i ? (i = n, o = n = void 0) : null == i && ("string" == typeof n ? (i = o, o = void 0) : (i = o, o = n, n = void 0)), !1 === i) i = M;
- else if (!i) return e;
- return 1 === a && (r = i, (i = function(e) {
- return xe().off(e), r.apply(this, arguments)
- }).guid = r.guid || (r.guid = xe.guid++)), e.each(function() {
- xe.event.add(this, t, i, o, n)
- })
- }
- function D(e, t) {
- return a(e, "table") && a(11 !== t.nodeType ? t : t.firstChild, "tr") ? xe(e).children("tbody")[0] || e : e
- }
- function $(e) {
- return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e
- }
- function A(e) {
- return "true/" === (e.type || "").slice(0, 5) ? e.type = e.type.slice(5) : e.removeAttribute("type"), e
- }
- function E(e, t) {
- var n, o, i, a, r, l, s, c;
- if (1 === t.nodeType) {
- if (Re.hasData(e) && (a = Re.access(e), r = Re.set(t, a), c = a.events)) {
- delete r.handle, r.events = {};
- for (i in c)
- for (n = 0, o = c[i].length; n < o; n++) xe.event.add(t, i, c[i][n])
- }
- He.hasData(e) && (l = He.access(e), s = xe.extend({}, l), He.set(t, s))
- }
- }
- function S(e, t) {
- var n = t.nodeName.toLowerCase();
- "input" === n && Ve.test(e.type) ? t.checked = e.checked : "input" !== n && "textarea" !== n || (t.defaultValue = e.defaultValue)
- }
- function L(e, t, o, i) {
- t = ce.apply([], t);
- var a, r, l, s, c, u, d = 0,
- p = e.length,
- h = p - 1,
- f = t[0],
- b = ve(f);
- if (b || p > 1 && "string" == typeof f && !ge.checkClone && rt.test(f)) return e.each(function(n) {
- var a = e.eq(n);
- b && (t[0] = f.call(this, n, a.html())), L(a, t, o, i)
- });
- if (p && (a = j(t, e[0].ownerDocument, !1, e, i), r = a.firstChild, 1 === a.childNodes.length && (a = r), r || i)) {
- for (s = (l = xe.map(x(a, "script"), $)).length; d < p; d++) c = a, d !== h && (c = xe.clone(c, !0, !0), s && xe.merge(l, x(c, "script"))), o.call(e[d], c, d);
- if (s)
- for (u = l[l.length - 1].ownerDocument, xe.map(l, A), d = 0; d < s; d++) c = l[d], Qe.test(c.type || "") && !Re.access(c, "globalEval") && xe.contains(u, c) && (c.src && "module" !== (c.type || "").toLowerCase() ? xe._evalUrl && xe._evalUrl(c.src) : n(c.textContent.replace(lt, ""), u, c))
- }
- return e
- }
- function P(e, t, n) {
- for (var o, i = t ? xe.filter(t, e) : e, a = 0; null != (o = i[a]); a++) n || 1 !== o.nodeType || xe.cleanData(x(o)), o.parentNode && (n && xe.contains(o.ownerDocument, o) && _(x(o, "script")), o.parentNode.removeChild(o));
- return e
- }
- function I(e, t, n) {
- var o, i, a, r, l = e.style;
- return (n = n || ct(e)) && ("" !== (r = n.getPropertyValue(t) || n[t]) || xe.contains(e.ownerDocument, e) || (r = xe.style(e, t)), !ge.pixelBoxStyles() && st.test(r) && ut.test(t) && (o = l.width, i = l.minWidth, a = l.maxWidth, l.minWidth = l.maxWidth = l.width = r, r = n.width, l.width = o, l.minWidth = i, l.maxWidth = a)), void 0 !== r ? r + "" : r
- }
- function O(e, t) {
- return {
- get: function() {
- if (!e()) return (this.get = t).apply(this, arguments);
- delete this.get
- }
- }
- }
- function N(e) {
- if (e in mt) return e;
- for (var t = e[0].toUpperCase() + e.slice(1), n = bt.length; n--;)
- if ((e = bt[n] + t) in mt) return e
- }
- function q(e) {
- var t = xe.cssProps[e];
- return t || (t = xe.cssProps[e] = N(e) || e), t
- }
- function R(e, t, n) {
- var o = We.exec(t);
- return o ? Math.max(0, o[2] - (n || 0)) + (o[3] || "px") : t
- }
- function H(e, t, n, o, i, a) {
- var r = "width" === t ? 1 : 0,
- l = 0,
- s = 0;
- if (n === (o ? "border" : "content")) return 0;
- for (; r < 4; r += 2) "margin" === n && (s += xe.css(e, n + Xe[r], !0, i)), o ? ("content" === n && (s -= xe.css(e, "padding" + Xe[r], !0, i)), "margin" !== n && (s -= xe.css(e, "border" + Xe[r] + "Width", !0, i))) : (s += xe.css(e, "padding" + Xe[r], !0, i), "padding" !== n ? s += xe.css(e, "border" + Xe[r] + "Width", !0, i) : l += xe.css(e, "border" + Xe[r] + "Width", !0, i));
- return !o && a >= 0 && (s += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - a - s - l - .5))), s
- }
- function U(e, t, n) {
- var o = ct(e),
- i = I(e, t, o),
- a = "border-box" === xe.css(e, "boxSizing", !1, o),
- r = a;
- if (st.test(i)) {
- if (!n) return i;
- i = "auto"
- }
- return r = r && (ge.boxSizingReliable() || i === e.style[t]), ("auto" === i || !parseFloat(i) && "inline" === xe.css(e, "display", !1, o)) && (i = e["offset" + t[0].toUpperCase() + t.slice(1)], r = !0), (i = parseFloat(i) || 0) + H(e, t, n || (a ? "border" : "content"), r, o, i) + "px"
- }
- function B(e, t, n, o, i) {
- return new B.prototype.init(e, t, n, o, i)
- }
- function F() {
- vt && (!1 === re.hidden && e.requestAnimationFrame ? e.requestAnimationFrame(F) : e.setTimeout(F, xe.fx.interval), xe.fx.tick())
- }
- function W() {
- return e.setTimeout(function() {
- gt = void 0
- }), gt = Date.now()
- }
- function X(e, t) {
- var n, o = 0,
- i = {
- height: e
- };
- for (t = t ? 1 : 0; o < 4; o += 2 - t) i["margin" + (n = Xe[o])] = i["padding" + n] = e;
- return t && (i.opacity = i.width = e), i
- }
- function z(e, t, n) {
- for (var o, i = (V.tweeners[t] || []).concat(V.tweeners["*"]), a = 0, r = i.length; a < r; a++)
- if (o = i[a].call(n, t, e)) return o
- }
- function Y(e, t, n) {
- var o, i, a, r, l, s, c, u, d = "width" in t || "height" in t,
- p = this,
- h = {},
- f = e.style,
- b = e.nodeType && ze(e),
- m = Re.get(e, "fxshow");
- n.queue || (null == (r = xe._queueHooks(e, "fx")).unqueued && (r.unqueued = 0, l = r.empty.fire, r.empty.fire = function() {
- r.unqueued || l()
- }), r.unqueued++, p.always(function() {
- p.always(function() {
- r.unqueued--, xe.queue(e, "fx").length || r.empty.fire()
- })
- }));
- for (o in t)
- if (i = t[o], yt.test(i)) {
- if (delete t[o], a = a || "toggle" === i, i === (b ? "hide" : "show")) {
- if ("show" !== i || !m || void 0 === m[o]) continue;
- b = !0
- }
- h[o] = m && m[o] || xe.style(e, o)
- }
- if ((s = !xe.isEmptyObject(t)) || !xe.isEmptyObject(h)) {
- d && 1 === e.nodeType && (n.overflow = [f.overflow, f.overflowX, f.overflowY], null == (c = m && m.display) && (c = Re.get(e, "display")), "none" === (u = xe.css(e, "display")) && (c ? u = c : (w([e], !0), c = e.style.display || c, u = xe.css(e, "display"), w([e]))), ("inline" === u || "inline-block" === u && null != c) && "none" === xe.css(e, "float") && (s || (p.done(function() {
- f.display = c
- }), null == c && (u = f.display, c = "none" === u ? "" : u)), f.display = "inline-block")), n.overflow && (f.overflow = "hidden", p.always(function() {
- f.overflow = n.overflow[0], f.overflowX = n.overflow[1], f.overflowY = n.overflow[2]
- })), s = !1;
- for (o in h) s || (m ? "hidden" in m && (b = m.hidden) : m = Re.access(e, "fxshow", {
- display: c
- }), a && (m.hidden = !b), b && w([e], !0), p.done(function() {
- b || w([e]), Re.remove(e, "fxshow");
- for (o in h) xe.style(e, o, h[o])
- })), s = z(b ? m[o] : 0, o, p), o in m || (m[o] = s.start, b && (s.end = s.start, s.start = 0))
- }
- }
- function K(e, t) {
- var n, o, i, a, r;
- for (n in e)
- if (o = f(n), i = t[o], a = e[n], Array.isArray(a) && (i = a[1], a = e[n] = a[0]), n !== o && (e[o] = a, delete e[n]), (r = xe.cssHooks[o]) && "expand" in r) {
- a = r.expand(a), delete e[o];
- for (n in a) n in e || (e[n] = a[n], t[n] = i)
- } else t[o] = i
- }
- function V(e, t, n) {
- var o, i, a = 0,
- r = V.prefilters.length,
- l = xe.Deferred().always(function() {
- delete s.elem
- }),
- s = function() {
- if (i) return !1;
- for (var t = gt || W(), n = Math.max(0, c.startTime + c.duration - t), o = 1 - (n / c.duration || 0), a = 0, r = c.tweens.length; a < r; a++) c.tweens[a].run(o);
- return l.notifyWith(e, [c, o, n]), o < 1 && r ? n : (r || l.notifyWith(e, [c, 1, 0]), l.resolveWith(e, [c]), !1)
- },
- c = l.promise({
- elem: e,
- props: xe.extend({}, t),
- opts: xe.extend(!0, {
- specialEasing: {},
- easing: xe.easing._default
- }, n),
- originalProperties: t,
- originalOptions: n,
- startTime: gt || W(),
- duration: n.duration,
- tweens: [],
- createTween: function(t, n) {
- var o = xe.Tween(e, c.opts, t, n, c.opts.specialEasing[t] || c.opts.easing);
- return c.tweens.push(o), o
- },
- stop: function(t) {
- var n = 0,
- o = t ? c.tweens.length : 0;
- if (i) return this;
- for (i = !0; n < o; n++) c.tweens[n].run(1);
- return t ? (l.notifyWith(e, [c, 1, 0]), l.resolveWith(e, [c, t])) : l.rejectWith(e, [c, t]), this
- }
- }),
- u = c.props;
- for (K(u, c.opts.specialEasing); a < r; a++)
- if (o = V.prefilters[a].call(c, e, u, c.opts)) return ve(o.stop) && (xe._queueHooks(c.elem, c.opts.queue).stop = o.stop.bind(o)), o;
- return xe.map(u, z, c), ve(c.opts.start) && c.opts.start.call(e, c), c.progress(c.opts.progress).done(c.opts.done, c.opts.complete).fail(c.opts.fail).always(c.opts.always), xe.fx.timer(xe.extend(s, {
- elem: e,
- anim: c,
- queue: c.opts.queue
- })), c
- }
- function G(e) {
- return (e.match(Se) || []).join(" ")
- }
- function Q(e) {
- return e.getAttribute && e.getAttribute("class") || ""
- }
- function Z(e) {
- return Array.isArray(e) ? e : "string" == typeof e ? e.match(Se) || [] : []
- }
- function J(e, t, n, i) {
- var a;
- if (Array.isArray(t)) xe.each(t, function(t, o) {
- n || Et.test(e) ? i(e, o) : J(e + "[" + ("object" == typeof o && null != o ? t : "") + "]", o, n, i)
- });
- else if (n || "object" !== o(t)) i(e, t);
- else
- for (a in t) J(e + "[" + a + "]", t[a], n, i)
- }
- function ee(e) {
- return function(t, n) {
- "string" != typeof t && (n = t, t = "*");
- var o, i = 0,
- a = t.toLowerCase().match(Se) || [];
- if (ve(n))
- for (; o = a[i++];) "+" === o[0] ? (o = o.slice(1) || "*", (e[o] = e[o] || []).unshift(n)) : (e[o] = e[o] || []).push(n)
- }
- }
- function te(e, t, n, o) {
- function i(l) {
- var s;
- return a[l] = !0, xe.each(e[l] || [], function(e, l) {
- var c = l(t, n, o);
- return "string" != typeof c || r || a[c] ? r ? !(s = c) : void 0 : (t.dataTypes.unshift(c), i(c), !1)
- }), s
- }
- var a = {},
- r = e === Ft;
- return i(t.dataTypes[0]) || !a["*"] && i("*")
- }
- function ne(e, t) {
- var n, o, i = xe.ajaxSettings.flatOptions || {};
- for (n in t) void 0 !== t[n] && ((i[n] ? e : o || (o = {}))[n] = t[n]);
- return o && xe.extend(!0, e, o), e
- }
- function oe(e, t, n) {
- for (var o, i, a, r, l = e.contents, s = e.dataTypes;
- "*" === s[0];) s.shift(), void 0 === o && (o = e.mimeType || t.getResponseHeader("Content-Type"));
- if (o)
- for (i in l)
- if (l[i] && l[i].test(o)) {
- s.unshift(i);
- break
- }
- if (s[0] in n) a = s[0];
- else {
- for (i in n) {
- if (!s[0] || e.converters[i + " " + s[0]]) {
- a = i;
- break
- }
- r || (r = i)
- }
- a = a || r
- }
- if (a) return a !== s[0] && s.unshift(a), n[a]
- }
- function ie(e, t, n, o) {
- var i, a, r, l, s, c = {},
- u = e.dataTypes.slice();
- if (u[1])
- for (r in e.converters) c[r.toLowerCase()] = e.converters[r];
- for (a = u.shift(); a;)
- if (e.responseFields[a] && (n[e.responseFields[a]] = t), !s && o && e.dataFilter && (t = e.dataFilter(t, e.dataType)), s = a, a = u.shift())
- if ("*" === a) a = s;
- else if ("*" !== s && s !== a) {
- if (!(r = c[s + " " + a] || c["* " + a]))
- for (i in c)
- if ((l = i.split(" "))[1] === a && (r = c[s + " " + l[0]] || c["* " + l[0]])) {
- !0 === r ? r = c[i] : !0 !== c[i] && (a = l[0], u.unshift(l[1]));
- break
- }
- if (!0 !== r)
- if (r && e.throws) t = r(t);
- else try {
- t = r(t)
- } catch (e) {
- return {
- state: "parsererror",
- error: r ? e : "No conversion from " + s + " to " + a
- }
- }
- }
- return {
- state: "success",
- data: t
- }
- }
- var ae = [],
- re = e.document,
- le = Object.getPrototypeOf,
- se = ae.slice,
- ce = ae.concat,
- ue = ae.push,
- de = ae.indexOf,
- pe = {},
- he = pe.toString,
- fe = pe.hasOwnProperty,
- be = fe.toString,
- me = be.call(Object),
- ge = {},
- ve = function(e) {
- return "function" == typeof e && "number" != typeof e.nodeType
- },
- ye = function(e) {
- return null != e && e === e.window
- },
- we = {
- type: !0,
- src: !0,
- noModule: !0
- },
- xe = function(e, t) {
- return new xe.fn.init(e, t)
- },
- _e = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
- xe.fn = xe.prototype = {
- jquery: "3.3.1",
- constructor: xe,
- length: 0,
- toArray: function() {
- return se.call(this)
- },
- get: function(e) {
- return null == e ? se.call(this) : e < 0 ? this[e + this.length] : this[e]
- },
- pushStack: function(e) {
- var t = xe.merge(this.constructor(), e);
- return t.prevObject = this, t
- },
- each: function(e) {
- return xe.each(this, e)
- },
- map: function(e) {
- return this.pushStack(xe.map(this, function(t, n) {
- return e.call(t, n, t)
- }))
- },
- slice: function() {
- return this.pushStack(se.apply(this, arguments))
- },
- first: function() {
- return this.eq(0)
- },
- last: function() {
- return this.eq(-1)
- },
- eq: function(e) {
- var t = this.length,
- n = +e + (e < 0 ? t : 0);
- return this.pushStack(n >= 0 && n < t ? [this[n]] : [])
- },
- end: function() {
- return this.prevObject || this.constructor()
- },
- push: ue,
- sort: ae.sort,
- splice: ae.splice
- }, xe.extend = xe.fn.extend = function() {
- var e, t, n, o, i, a, r = arguments[0] || {},
- l = 1,
- s = arguments.length,
- c = !1;
- for ("boolean" == typeof r && (c = r, r = arguments[l] || {}, l++), "object" == typeof r || ve(r) || (r = {}), l === s && (r = this, l--); l < s; l++)
- if (null != (e = arguments[l]))
- for (t in e) n = r[t], r !== (o = e[t]) && (c && o && (xe.isPlainObject(o) || (i = Array.isArray(o))) ? (i ? (i = !1, a = n && Array.isArray(n) ? n : []) : a = n && xe.isPlainObject(n) ? n : {}, r[t] = xe.extend(c, a, o)) : void 0 !== o && (r[t] = o));
- return r
- }, xe.extend({
- expando: "jQuery" + ("3.3.1" + Math.random()).replace(/\D/g, ""),
- isReady: !0,
- error: function(e) {
- throw new Error(e)
- },
- noop: function() {},
- isPlainObject: function(e) {
- var t, n;
- return !(!e || "[object Object]" !== he.call(e) || (t = le(e)) && ("function" != typeof(n = fe.call(t, "constructor") && t.constructor) || be.call(n) !== me))
- },
- isEmptyObject: function(e) {
- var t;
- for (t in e) return !1;
- return !0
- },
- globalEval: function(e) {
- n(e)
- },
- each: function(e, t) {
- var n, o = 0;
- if (i(e))
- for (n = e.length; o < n && !1 !== t.call(e[o], o, e[o]); o++);
- else
- for (o in e)
- if (!1 === t.call(e[o], o, e[o])) break; return e
- },
- trim: function(e) {
- return null == e ? "" : (e + "").replace(_e, "")
- },
- makeArray: function(e, t) {
- var n = t || [];
- return null != e && (i(Object(e)) ? xe.merge(n, "string" == typeof e ? [e] : e) : ue.call(n, e)), n
- },
- inArray: function(e, t, n) {
- return null == t ? -1 : de.call(t, e, n)
- },
- merge: function(e, t) {
- for (var n = +t.length, o = 0, i = e.length; o < n; o++) e[i++] = t[o];
- return e.length = i, e
- },
- grep: function(e, t, n) {
- for (var o = [], i = 0, a = e.length, r = !n; i < a; i++) !t(e[i], i) !== r && o.push(e[i]);
- return o
- },
- map: function(e, t, n) {
- var o, a, r = 0,
- l = [];
- if (i(e))
- for (o = e.length; r < o; r++) null != (a = t(e[r], r, n)) && l.push(a);
- else
- for (r in e) null != (a = t(e[r], r, n)) && l.push(a);
- return ce.apply([], l)
- },
- guid: 1,
- support: ge
- }), "function" == typeof Symbol && (xe.fn[Symbol.iterator] = ae[Symbol.iterator]), xe.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(e, t) {
- pe["[object " + t + "]"] = t.toLowerCase()
- });
- var je = function(e) {
- function t(e, t, n, o) {
- var i, a, r, l, s, u, p, h = t && t.ownerDocument,
- f = t ? t.nodeType : 9;
- if (n = n || [], "string" != typeof e || !e || 1 !== f && 9 !== f && 11 !== f) return n;
- if (!o && ((t ? t.ownerDocument || t : R) !== E && A(t), t = t || E, L)) {
- if (11 !== f && (s = be.exec(e)))
- if (i = s[1]) {
- if (9 === f) {
- if (!(r = t.getElementById(i))) return n;
- if (r.id === i) return n.push(r), n
- } else if (h && (r = h.getElementById(i)) && N(t, r) && r.id === i) return n.push(r), n
- } else {
- if (s[2]) return G.apply(n, t.getElementsByTagName(e)), n;
- if ((i = s[3]) && w.getElementsByClassName && t.getElementsByClassName) return G.apply(n, t.getElementsByClassName(i)), n
- }
- if (w.qsa && !W[e + " "] && (!P || !P.test(e))) {
- if (1 !== f) h = t, p = e;
- else if ("object" !== t.nodeName.toLowerCase()) {
- for ((l = t.getAttribute("id")) ? l = l.replace(ye, we) : t.setAttribute("id", l = q), a = (u = T(e)).length; a--;) u[a] = "#" + l + " " + d(u[a]);
- p = u.join(","), h = me.test(e) && c(t.parentNode) || t
- }
- if (p) try {
- return G.apply(n, h.querySelectorAll(p)), n
- } catch (e) {} finally {
- l === q && t.removeAttribute("id")
- }
- }
- }
- return k(e.replace(ae, "$1"), t, n, o)
- }
- function n() {
- function e(n, o) {
- return t.push(n + " ") > x.cacheLength && delete e[t.shift()], e[n + " "] = o
- }
- var t = [];
- return e
- }
- function o(e) {
- return e[q] = !0, e
- }
- function i(e) {
- var t = E.createElement("fieldset");
- try {
- return !!e(t)
- } catch (e) {
- return !1
- } finally {
- t.parentNode && t.parentNode.removeChild(t), t = null
- }
- }
- function a(e, t) {
- for (var n = e.split("|"), o = n.length; o--;) x.attrHandle[n[o]] = t
- }
- function r(e, t) {
- var n = t && e,
- o = n && 1 === e.nodeType && 1 === t.nodeType && e.sourceIndex - t.sourceIndex;
- if (o) return o;
- if (n)
- for (; n = n.nextSibling;)
- if (n === t) return -1;
- return e ? 1 : -1
- }
- function l(e) {
- return function(t) {
- return "form" in t ? t.parentNode && !1 === t.disabled ? "label" in t ? "label" in t.parentNode ? t.parentNode.disabled === e : t.disabled === e : t.isDisabled === e || t.isDisabled !== !e && _e(t) === e : t.disabled === e : "label" in t && t.disabled === e
- }
- }
- function s(e) {
- return o(function(t) {
- return t = +t, o(function(n, o) {
- for (var i, a = e([], n.length, t), r = a.length; r--;) n[i = a[r]] && (n[i] = !(o[i] = n[i]))
- })
- })
- }
- function c(e) {
- return e && void 0 !== e.getElementsByTagName && e
- }
- function u() {}
- function d(e) {
- for (var t = 0, n = e.length, o = ""; t < n; t++) o += e[t].value;
- return o
- }
- function p(e, t, n) {
- var o = t.dir,
- i = t.next,
- a = i || o,
- r = n && "parentNode" === a,
- l = U++;
- return t.first ? function(t, n, i) {
- for (; t = t[o];)
- if (1 === t.nodeType || r) return e(t, n, i);
- return !1
- } : function(t, n, s) {
- var c, u, d, p = [H, l];
- if (s) {
- for (; t = t[o];)
- if ((1 === t.nodeType || r) && e(t, n, s)) return !0
- } else
- for (; t = t[o];)
- if (1 === t.nodeType || r)
- if (d = t[q] || (t[q] = {}), u = d[t.uniqueID] || (d[t.uniqueID] = {}), i && i === t.nodeName.toLowerCase()) t = t[o] || t;
- else {
- if ((c = u[a]) && c[0] === H && c[1] === l) return p[2] = c[2];
- if (u[a] = p, p[2] = e(t, n, s)) return !0
- } return !1
- }
- }
- function h(e) {
- return e.length > 1 ? function(t, n, o) {
- for (var i = e.length; i--;)
- if (!e[i](t, n, o)) return !1;
- return !0
- } : e[0]
- }
- function f(e, n, o) {
- for (var i = 0, a = n.length; i < a; i++) t(e, n[i], o);
- return o
- }
- function b(e, t, n, o, i) {
- for (var a, r = [], l = 0, s = e.length, c = null != t; l < s; l++)(a = e[l]) && (n && !n(a, o, i) || (r.push(a), c && t.push(l)));
- return r
- }
- function m(e, t, n, i, a, r) {
- return i && !i[q] && (i = m(i)), a && !a[q] && (a = m(a, r)), o(function(o, r, l, s) {
- var c, u, d, p = [],
- h = [],
- m = r.length,
- g = o || f(t || "*", l.nodeType ? [l] : l, []),
- v = !e || !o && t ? g : b(g, p, e, l, s),
- y = n ? a || (o ? e : m || i) ? [] : r : v;
- if (n && n(v, y, l, s), i)
- for (c = b(y, h), i(c, [], l, s), u = c.length; u--;)(d = c[u]) && (y[h[u]] = !(v[h[u]] = d));
- if (o) {
- if (a || e) {
- if (a) {
- for (c = [], u = y.length; u--;)(d = y[u]) && c.push(v[u] = d);
- a(null, y = [], c, s)
- }
- for (u = y.length; u--;)(d = y[u]) && (c = a ? Z(o, d) : p[u]) > -1 && (o[c] = !(r[c] = d))
- }
- } else y = b(y === r ? y.splice(m, y.length) : y), a ? a(null, r, y, s) : G.apply(r, y)
- })
- }
- function g(e) {
- for (var t, n, o, i = e.length, a = x.relative[e[0].type], r = a || x.relative[" "], l = a ? 1 : 0, s = p(function(e) {
- return e === t
- }, r, !0), c = p(function(e) {
- return Z(t, e) > -1
- }, r, !0), u = [function(e, n, o) {
- var i = !a && (o || n !== C) || ((t = n).nodeType ? s(e, n, o) : c(e, n, o));
- return t = null, i
- }]; l < i; l++)
- if (n = x.relative[e[l].type]) u = [p(h(u), n)];
- else {
- if ((n = x.filter[e[l].type].apply(null, e[l].matches))[q]) {
- for (o = ++l; o < i && !x.relative[e[o].type]; o++);
- return m(l > 1 && h(u), l > 1 && d(e.slice(0, l - 1).concat({
- value: " " === e[l - 2].type ? "*" : ""
- })).replace(ae, "$1"), n, l < o && g(e.slice(l, o)), o < i && g(e = e.slice(o)), o < i && d(e))
- }
- u.push(n)
- }
- return h(u)
- }
- function v(e, n) {
- var i = n.length > 0,
- a = e.length > 0,
- r = function(o, r, l, s, c) {
- var u, d, p, h = 0,
- f = "0",
- m = o && [],
- g = [],
- v = C,
- y = o || a && x.find.TAG("*", c),
- w = H += null == v ? 1 : Math.random() || .1,
- _ = y.length;
- for (c && (C = r === E || r || c); f !== _ && null != (u = y[f]); f++) {
- if (a && u) {
- for (d = 0, r || u.ownerDocument === E || (A(u), l = !L); p = e[d++];)
- if (p(u, r || E, l)) {
- s.push(u);
- break
- }
- c && (H = w)
- }
- i && ((u = !p && u) && h--, o && m.push(u))
- }
- if (h += f, i && f !== h) {
- for (d = 0; p = n[d++];) p(m, g, r, l);
- if (o) {
- if (h > 0)
- for (; f--;) m[f] || g[f] || (g[f] = K.call(s));
- g = b(g)
- }
- G.apply(s, g), c && !o && g.length > 0 && h + n.length > 1 && t.uniqueSort(s)
- }
- return c && (H = w, C = v), m
- };
- return i ? o(r) : r
- }
- var y, w, x, _, j, T, M, k, C, D, $, A, E, S, L, P, I, O, N, q = "sizzle" + 1 * new Date,
- R = e.document,
- H = 0,
- U = 0,
- B = n(),
- F = n(),
- W = n(),
- X = function(e, t) {
- return e === t && ($ = !0), 0
- },
- z = {}.hasOwnProperty,
- Y = [],
- K = Y.pop,
- V = Y.push,
- G = Y.push,
- Q = Y.slice,
- Z = function(e, t) {
- for (var n = 0, o = e.length; n < o; n++)
- if (e[n] === t) return n;
- return -1
- },
- J = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
- ee = "[\\x20\\t\\r\\n\\f]",
- te = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
- ne = "\\[" + ee + "*(" + te + ")(?:" + ee + "*([*^$|!~]?=)" + ee + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + te + "))|)" + ee + "*\\]",
- oe = ":(" + te + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + ne + ")*)|.*)\\)|)",
- ie = new RegExp(ee + "+", "g"),
- ae = new RegExp("^" + ee + "+|((?:^|[^\\\\])(?:\\\\.)*)" + ee + "+$", "g"),
- re = new RegExp("^" + ee + "*," + ee + "*"),
- le = new RegExp("^" + ee + "*([>+~]|" + ee + ")" + ee + "*"),
- se = new RegExp("=" + ee + "*([^\\]'\"]*?)" + ee + "*\\]", "g"),
- ce = new RegExp(oe),
- ue = new RegExp("^" + te + "$"),
- de = {
- ID: new RegExp("^#(" + te + ")"),
- CLASS: new RegExp("^\\.(" + te + ")"),
- TAG: new RegExp("^(" + te + "|[*])"),
- ATTR: new RegExp("^" + ne),
- PSEUDO: new RegExp("^" + oe),
- CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + ee + "*(even|odd|(([+-]|)(\\d*)n|)" + ee + "*(?:([+-]|)" + ee + "*(\\d+)|))" + ee + "*\\)|)", "i"),
- bool: new RegExp("^(?:" + J + ")$", "i"),
- needsContext: new RegExp("^" + ee + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + ee + "*((?:-\\d)?\\d*)" + ee + "*\\)|)(?=[^-]|$)", "i")
- },
- pe = /^(?:input|select|textarea|button)$/i,
- he = /^h\d$/i,
- fe = /^[^{]+\{\s*\[native \w/,
- be = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
- me = /[+~]/,
- ge = new RegExp("\\\\([\\da-f]{1,6}" + ee + "?|(" + ee + ")|.)", "ig"),
- ve = function(e, t, n) {
- var o = "0x" + t - 65536;
- return o !== o || n ? t : o < 0 ? String.fromCharCode(o + 65536) : String.fromCharCode(o >> 10 | 55296, 1023 & o | 56320)
- },
- ye = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
- we = function(e, t) {
- return t ? "\0" === e ? "�" : e.slice(0, -1) + "\\" + e.charCodeAt(e.length - 1).toString(16) + " " : "\\" + e
- },
- xe = function() {
- A()
- },
- _e = p(function(e) {
- return !0 === e.disabled && ("form" in e || "label" in e)
- }, {
- dir: "parentNode",
- next: "legend"
- });
- try {
- G.apply(Y = Q.call(R.childNodes), R.childNodes), Y[R.childNodes.length].nodeType
- } catch (e) {
- G = {
- apply: Y.length ? function(e, t) {
- V.apply(e, Q.call(t))
- } : function(e, t) {
- for (var n = e.length, o = 0; e[n++] = t[o++];);
- e.length = n - 1
- }
- }
- }
- w = t.support = {}, j = t.isXML = function(e) {
- var t = e && (e.ownerDocument || e).documentElement;
- return !!t && "HTML" !== t.nodeName
- }, A = t.setDocument = function(e) {
- var t, n, o = e ? e.ownerDocument || e : R;
- return o !== E && 9 === o.nodeType && o.documentElement ? (E = o, S = E.documentElement, L = !j(E), R !== E && (n = E.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", xe, !1) : n.attachEvent && n.attachEvent("onunload", xe)), w.attributes = i(function(e) {
- return e.className = "i", !e.getAttribute("className")
- }), w.getElementsByTagName = i(function(e) {
- return e.appendChild(E.createComment("")), !e.getElementsByTagName("*").length
- }), w.getElementsByClassName = fe.test(E.getElementsByClassName), w.getById = i(function(e) {
- return S.appendChild(e).id = q, !E.getElementsByName || !E.getElementsByName(q).length
- }), w.getById ? (x.filter.ID = function(e) {
- var t = e.replace(ge, ve);
- return function(e) {
- return e.getAttribute("id") === t
- }
- }, x.find.ID = function(e, t) {
- if (void 0 !== t.getElementById && L) {
- var n = t.getElementById(e);
- return n ? [n] : []
- }
- }) : (x.filter.ID = function(e) {
- var t = e.replace(ge, ve);
- return function(e) {
- var n = void 0 !== e.getAttributeNode && e.getAttributeNode("id");
- return n && n.value === t
- }
- }, x.find.ID = function(e, t) {
- if (void 0 !== t.getElementById && L) {
- var n, o, i, a = t.getElementById(e);
- if (a) {
- if ((n = a.getAttributeNode("id")) && n.value === e) return [a];
- for (i = t.getElementsByName(e), o = 0; a = i[o++];)
- if ((n = a.getAttributeNode("id")) && n.value === e) return [a]
- }
- return []
- }
- }), x.find.TAG = w.getElementsByTagName ? function(e, t) {
- return void 0 !== t.getElementsByTagName ? t.getElementsByTagName(e) : w.qsa ? t.querySelectorAll(e) : void 0
- } : function(e, t) {
- var n, o = [],
- i = 0,
- a = t.getElementsByTagName(e);
- if ("*" === e) {
- for (; n = a[i++];) 1 === n.nodeType && o.push(n);
- return o
- }
- return a
- }, x.find.CLASS = w.getElementsByClassName && function(e, t) {
- if (void 0 !== t.getElementsByClassName && L) return t.getElementsByClassName(e)
- }, I = [], P = [], (w.qsa = fe.test(E.querySelectorAll)) && (i(function(e) {
- S.appendChild(e).innerHTML = "<a id='" + q + "'></a><select id='" + q + "-\r\\' msallowcapture=''><option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && P.push("[*^$]=" + ee + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || P.push("\\[" + ee + "*(?:value|" + J + ")"), e.querySelectorAll("[id~=" + q + "-]").length || P.push("~="), e.querySelectorAll(":checked").length || P.push(":checked"), e.querySelectorAll("a#" + q + "+*").length || P.push(".#.+[+~]")
- }), i(function(e) {
- e.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";
- var t = E.createElement("input");
- t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && P.push("name" + ee + "*[*^$|!~]?="), 2 !== e.querySelectorAll(":enabled").length && P.push(":enabled", ":disabled"), S.appendChild(e).disabled = !0, 2 !== e.querySelectorAll(":disabled").length && P.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), P.push(",.*:")
- })), (w.matchesSelector = fe.test(O = S.matches || S.webkitMatchesSelector || S.mozMatchesSelector || S.oMatchesSelector || S.msMatchesSelector)) && i(function(e) {
- w.disconnectedMatch = O.call(e, "*"), O.call(e, "[s!='']:x"), I.push("!=", oe)
- }), P = P.length && new RegExp(P.join("|")), I = I.length && new RegExp(I.join("|")), t = fe.test(S.compareDocumentPosition), N = t || fe.test(S.contains) ? function(e, t) {
- var n = 9 === e.nodeType ? e.documentElement : e,
- o = t && t.parentNode;
- return e === o || !(!o || 1 !== o.nodeType || !(n.contains ? n.contains(o) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(o)))
- } : function(e, t) {
- if (t)
- for (; t = t.parentNode;)
- if (t === e) return !0;
- return !1
- }, X = t ? function(e, t) {
- if (e === t) return $ = !0, 0;
- var n = !e.compareDocumentPosition - !t.compareDocumentPosition;
- return n || (1 & (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !w.sortDetached && t.compareDocumentPosition(e) === n ? e === E || e.ownerDocument === R && N(R, e) ? -1 : t === E || t.ownerDocument === R && N(R, t) ? 1 : D ? Z(D, e) - Z(D, t) : 0 : 4 & n ? -1 : 1)
- } : function(e, t) {
- if (e === t) return $ = !0, 0;
- var n, o = 0,
- i = e.parentNode,
- a = t.parentNode,
- l = [e],
- s = [t];
- if (!i || !a) return e === E ? -1 : t === E ? 1 : i ? -1 : a ? 1 : D ? Z(D, e) - Z(D, t) : 0;
- if (i === a) return r(e, t);
- for (n = e; n = n.parentNode;) l.unshift(n);
- for (n = t; n = n.parentNode;) s.unshift(n);
- for (; l[o] === s[o];) o++;
- return o ? r(l[o], s[o]) : l[o] === R ? -1 : s[o] === R ? 1 : 0
- }, E) : E
- }, t.matches = function(e, n) {
- return t(e, null, null, n)
- }, t.matchesSelector = function(e, n) {
- if ((e.ownerDocument || e) !== E && A(e), n = n.replace(se, "='$1']"), w.matchesSelector && L && !W[n + " "] && (!I || !I.test(n)) && (!P || !P.test(n))) try {
- var o = O.call(e, n);
- if (o || w.disconnectedMatch || e.document && 11 !== e.document.nodeType) return o
- } catch (e) {}
- return t(n, E, null, [e]).length > 0
- }, t.contains = function(e, t) {
- return (e.ownerDocument || e) !== E && A(e), N(e, t)
- }, t.attr = function(e, t) {
- (e.ownerDocument || e) !== E && A(e);
- var n = x.attrHandle[t.toLowerCase()],
- o = n && z.call(x.attrHandle, t.toLowerCase()) ? n(e, t, !L) : void 0;
- return void 0 !== o ? o : w.attributes || !L ? e.getAttribute(t) : (o = e.getAttributeNode(t)) && o.specified ? o.value : null
- }, t.escape = function(e) {
- return (e + "").replace(ye, we)
- }, t.error = function(e) {
- throw new Error("Syntax error, unrecognized expression: " + e)
- }, t.uniqueSort = function(e) {
- var t, n = [],
- o = 0,
- i = 0;
- if ($ = !w.detectDuplicates, D = !w.sortStable && e.slice(0), e.sort(X), $) {
- for (; t = e[i++];) t === e[i] && (o = n.push(i));
- for (; o--;) e.splice(n[o], 1)
- }
- return D = null, e
- }, _ = t.getText = function(e) {
- var t, n = "",
- o = 0,
- i = e.nodeType;
- if (i) {
- if (1 === i || 9 === i || 11 === i) {
- if ("string" == typeof e.textContent) return e.textContent;
- for (e = e.firstChild; e; e = e.nextSibling) n += _(e)
- } else if (3 === i || 4 === i) return e.nodeValue
- } else
- for (; t = e[o++];) n += _(t);
- return n
- }, (x = t.selectors = {
- cacheLength: 50,
- createPseudo: o,
- match: de,
- 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(ge, ve), e[3] = (e[3] || e[4] || e[5] || "").replace(ge, ve), "~=" === 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] || t.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] && t.error(e[0]), e
- },
- PSEUDO: function(e) {
- var t, n = !e[6] && e[2];
- return de.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && ce.test(n) && (t = T(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3))
- }
- },
- filter: {
- TAG: function(e) {
- var t = e.replace(ge, ve).toLowerCase();
- return "*" === e ? function() {
- return !0
- } : function(e) {
- return e.nodeName && e.nodeName.toLowerCase() === t
- }
- },
- CLASS: function(e) {
- var t = B[e + " "];
- return t || (t = new RegExp("(^|" + ee + ")" + e + "(" + ee + "|$)")) && B(e, function(e) {
- return t.test("string" == typeof e.className && e.className || void 0 !== e.getAttribute && e.getAttribute("class") || "")
- })
- },
- ATTR: function(e, n, o) {
- return function(i) {
- var a = t.attr(i, e);
- return null == a ? "!=" === n : !n || (a += "", "=" === n ? a === o : "!=" === n ? a !== o : "^=" === n ? o && 0 === a.indexOf(o) : "*=" === n ? o && a.indexOf(o) > -1 : "$=" === n ? o && a.slice(-o.length) === o : "~=" === n ? (" " + a.replace(ie, " ") + " ").indexOf(o) > -1 : "|=" === n && (a === o || a.slice(0, o.length + 1) === o + "-"))
- }
- },
- CHILD: function(e, t, n, o, i) {
- var a = "nth" !== e.slice(0, 3),
- r = "last" !== e.slice(-4),
- l = "of-type" === t;
- return 1 === o && 0 === i ? function(e) {
- return !!e.parentNode
- } : function(t, n, s) {
- var c, u, d, p, h, f, b = a !== r ? "nextSibling" : "previousSibling",
- m = t.parentNode,
- g = l && t.nodeName.toLowerCase(),
- v = !s && !l,
- y = !1;
- if (m) {
- if (a) {
- for (; b;) {
- for (p = t; p = p[b];)
- if (l ? p.nodeName.toLowerCase() === g : 1 === p.nodeType) return !1;
- f = b = "only" === e && !f && "nextSibling"
- }
- return !0
- }
- if (f = [r ? m.firstChild : m.lastChild], r && v) {
- for (y = (h = (c = (u = (d = (p = m)[q] || (p[q] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] || [])[0] === H && c[1]) && c[2], p = h && m.childNodes[h]; p = ++h && p && p[b] || (y = h = 0) || f.pop();)
- if (1 === p.nodeType && ++y && p === t) {
- u[e] = [H, h, y];
- break
- }
- } else if (v && (y = h = (c = (u = (d = (p = t)[q] || (p[q] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] || [])[0] === H && c[1]), !1 === y)
- for (;
- (p = ++h && p && p[b] || (y = h = 0) || f.pop()) && ((l ? p.nodeName.toLowerCase() !== g : 1 !== p.nodeType) || !++y || (v && ((u = (d = p[q] || (p[q] = {}))[p.uniqueID] || (d[p.uniqueID] = {}))[e] = [H, y]), p !== t)););
- return (y -= i) === o || y % o == 0 && y / o >= 0
- }
- }
- },
- PSEUDO: function(e, n) {
- var i, a = x.pseudos[e] || x.setFilters[e.toLowerCase()] || t.error("unsupported pseudo: " + e);
- return a[q] ? a(n) : a.length > 1 ? (i = [e, e, "", n], x.setFilters.hasOwnProperty(e.toLowerCase()) ? o(function(e, t) {
- for (var o, i = a(e, n), r = i.length; r--;) e[o = Z(e, i[r])] = !(t[o] = i[r])
- }) : function(e) {
- return a(e, 0, i)
- }) : a
- }
- },
- pseudos: {
- not: o(function(e) {
- var t = [],
- n = [],
- i = M(e.replace(ae, "$1"));
- return i[q] ? o(function(e, t, n, o) {
- for (var a, r = i(e, null, o, []), l = e.length; l--;)(a = r[l]) && (e[l] = !(t[l] = a))
- }) : function(e, o, a) {
- return t[0] = e, i(t, null, a, n), t[0] = null, !n.pop()
- }
- }),
- has: o(function(e) {
- return function(n) {
- return t(e, n).length > 0
- }
- }),
- contains: o(function(e) {
- return e = e.replace(ge, ve),
- function(t) {
- return (t.textContent || t.innerText || _(t)).indexOf(e) > -1
- }
- }),
- lang: o(function(e) {
- return ue.test(e || "") || t.error("unsupported lang: " + e), e = e.replace(ge, ve).toLowerCase(),
- function(t) {
- var n;
- do {
- if (n = L ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (n = n.toLowerCase()) === e || 0 === n.indexOf(e + "-")
- } while ((t = t.parentNode) && 1 === t.nodeType);
- return !1
- }
- }),
- target: function(t) {
- var n = e.location && e.location.hash;
- return n && n.slice(1) === t.id
- },
- root: function(e) {
- return e === S
- },
- focus: function(e) {
- return e === E.activeElement && (!E.hasFocus || E.hasFocus()) && !!(e.type || e.href || ~e.tabIndex)
- },
- enabled: l(!1),
- disabled: l(!0),
- 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 !x.pseudos.empty(e)
- },
- header: function(e) {
- return he.test(e.nodeName)
- },
- input: function(e) {
- return pe.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: s(function() {
- return [0]
- }),
- last: s(function(e, t) {
- return [t - 1]
- }),
- eq: s(function(e, t, n) {
- return [n < 0 ? n + t : n]
- }),
- even: s(function(e, t) {
- for (var n = 0; n < t; n += 2) e.push(n);
- return e
- }),
- odd: s(function(e, t) {
- for (var n = 1; n < t; n += 2) e.push(n);
- return e
- }),
- lt: s(function(e, t, n) {
- for (var o = n < 0 ? n + t : n; --o >= 0;) e.push(o);
- return e
- }),
- gt: s(function(e, t, n) {
- for (var o = n < 0 ? n + t : n; ++o < t;) e.push(o);
- return e
- })
- }
- }).pseudos.nth = x.pseudos.eq;
- for (y in {
- radio: !0,
- checkbox: !0,
- file: !0,
- password: !0,
- image: !0
- }) x.pseudos[y] = function(e) {
- return function(t) {
- return "input" === t.nodeName.toLowerCase() && t.type === e
- }
- }(y);
- for (y in {
- submit: !0,
- reset: !0
- }) x.pseudos[y] = function(e) {
- return function(t) {
- var n = t.nodeName.toLowerCase();
- return ("input" === n || "button" === n) && t.type === e
- }
- }(y);
- return u.prototype = x.filters = x.pseudos, x.setFilters = new u, T = t.tokenize = function(e, n) {
- var o, i, a, r, l, s, c, u = F[e + " "];
- if (u) return n ? 0 : u.slice(0);
- for (l = e, s = [], c = x.preFilter; l;) {
- o && !(i = re.exec(l)) || (i && (l = l.slice(i[0].length) || l), s.push(a = [])), o = !1, (i = le.exec(l)) && (o = i.shift(), a.push({
- value: o,
- type: i[0].replace(ae, " ")
- }), l = l.slice(o.length));
- for (r in x.filter) !(i = de[r].exec(l)) || c[r] && !(i = c[r](i)) || (o = i.shift(), a.push({
- value: o,
- type: r,
- matches: i
- }), l = l.slice(o.length));
- if (!o) break
- }
- return n ? l.length : l ? t.error(e) : F(e, s).slice(0)
- }, M = t.compile = function(e, t) {
- var n, o = [],
- i = [],
- a = W[e + " "];
- if (!a) {
- for (t || (t = T(e)), n = t.length; n--;)(a = g(t[n]))[q] ? o.push(a) : i.push(a);
- (a = W(e, v(i, o))).selector = e
- }
- return a
- }, k = t.select = function(e, t, n, o) {
- var i, a, r, l, s, u = "function" == typeof e && e,
- p = !o && T(e = u.selector || e);
- if (n = n || [], 1 === p.length) {
- if ((a = p[0] = p[0].slice(0)).length > 2 && "ID" === (r = a[0]).type && 9 === t.nodeType && L && x.relative[a[1].type]) {
- if (!(t = (x.find.ID(r.matches[0].replace(ge, ve), t) || [])[0])) return n;
- u && (t = t.parentNode), e = e.slice(a.shift().value.length)
- }
- for (i = de.needsContext.test(e) ? 0 : a.length; i-- && (r = a[i], !x.relative[l = r.type]);)
- if ((s = x.find[l]) && (o = s(r.matches[0].replace(ge, ve), me.test(a[0].type) && c(t.parentNode) || t))) {
- if (a.splice(i, 1), !(e = o.length && d(a))) return G.apply(n, o), n;
- break
- }
- }
- return (u || M(e, p))(o, t, !L, n, !t || me.test(e) && c(t.parentNode) || t), n
- }, w.sortStable = q.split("").sort(X).join("") === q, w.detectDuplicates = !!$, A(), w.sortDetached = i(function(e) {
- return 1 & e.compareDocumentPosition(E.createElement("fieldset"))
- }), i(function(e) {
- return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href")
- }) || a("type|href|height|width", function(e, t, n) {
- if (!n) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2)
- }), w.attributes && i(function(e) {
- return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value")
- }) || a("value", function(e, t, n) {
- if (!n && "input" === e.nodeName.toLowerCase()) return e.defaultValue
- }), i(function(e) {
- return null == e.getAttribute("disabled")
- }) || a(J, function(e, t, n) {
- var o;
- if (!n) return !0 === e[t] ? t.toLowerCase() : (o = e.getAttributeNode(t)) && o.specified ? o.value : null
- }), t
- }(e);
- xe.find = je, xe.expr = je.selectors, xe.expr[":"] = xe.expr.pseudos, xe.uniqueSort = xe.unique = je.uniqueSort, xe.text = je.getText, xe.isXMLDoc = je.isXML, xe.contains = je.contains, xe.escapeSelector = je.escape;
- var Te = function(e, t, n) {
- for (var o = [], i = void 0 !== n;
- (e = e[t]) && 9 !== e.nodeType;)
- if (1 === e.nodeType) {
- if (i && xe(e).is(n)) break;
- o.push(e)
- }
- return o
- },
- Me = function(e, t) {
- for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
- return n
- },
- ke = xe.expr.match.needsContext,
- Ce = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
- xe.filter = function(e, t, n) {
- var o = t[0];
- return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === o.nodeType ? xe.find.matchesSelector(o, e) ? [o] : [] : xe.find.matches(e, xe.grep(t, function(e) {
- return 1 === e.nodeType
- }))
- }, xe.fn.extend({
- find: function(e) {
- var t, n, o = this.length,
- i = this;
- if ("string" != typeof e) return this.pushStack(xe(e).filter(function() {
- for (t = 0; t < o; t++)
- if (xe.contains(i[t], this)) return !0
- }));
- for (n = this.pushStack([]), t = 0; t < o; t++) xe.find(e, i[t], n);
- return o > 1 ? xe.uniqueSort(n) : n
- },
- filter: function(e) {
- return this.pushStack(r(this, e || [], !1))
- },
- not: function(e) {
- return this.pushStack(r(this, e || [], !0))
- },
- is: function(e) {
- return !!r(this, "string" == typeof e && ke.test(e) ? xe(e) : e || [], !1).length
- }
- });
- var De, $e = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;
- (xe.fn.init = function(e, t, n) {
- var o, i;
- if (!e) return this;
- if (n = n || De, "string" == typeof e) {
- if (!(o = "<" === e[0] && ">" === e[e.length - 1] && e.length >= 3 ? [null, e, null] : $e.exec(e)) || !o[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e);
- if (o[1]) {
- if (t = t instanceof xe ? t[0] : t, xe.merge(this, xe.parseHTML(o[1], t && t.nodeType ? t.ownerDocument || t : re, !0)), Ce.test(o[1]) && xe.isPlainObject(t))
- for (o in t) ve(this[o]) ? this[o](t[o]) : this.attr(o, t[o]);
- return this
- }
- return (i = re.getElementById(o[2])) && (this[0] = i, this.length = 1), this
- }
- return e.nodeType ? (this[0] = e, this.length = 1, this) : ve(e) ? void 0 !== n.ready ? n.ready(e) : e(xe) : xe.makeArray(e, this)
- }).prototype = xe.fn, De = xe(re);
- var Ae = /^(?:parents|prev(?:Until|All))/,
- Ee = {
- children: !0,
- contents: !0,
- next: !0,
- prev: !0
- };
- xe.fn.extend({
- has: function(e) {
- var t = xe(e, this),
- n = t.length;
- return this.filter(function() {
- for (var e = 0; e < n; e++)
- if (xe.contains(this, t[e])) return !0
- })
- },
- closest: function(e, t) {
- var n, o = 0,
- i = this.length,
- a = [],
- r = "string" != typeof e && xe(e);
- if (!ke.test(e))
- for (; o < i; o++)
- for (n = this[o]; n && n !== t; n = n.parentNode)
- if (n.nodeType < 11 && (r ? r.index(n) > -1 : 1 === n.nodeType && xe.find.matchesSelector(n, e))) {
- a.push(n);
- break
- }
- return this.pushStack(a.length > 1 ? xe.uniqueSort(a) : a)
- },
- index: function(e) {
- return e ? "string" == typeof e ? de.call(xe(e), this[0]) : de.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
- },
- add: function(e, t) {
- return this.pushStack(xe.uniqueSort(xe.merge(this.get(), xe(e, t))))
- },
- addBack: function(e) {
- return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
- }
- }), xe.each({
- parent: function(e) {
- var t = e.parentNode;
- return t && 11 !== t.nodeType ? t : null
- },
- parents: function(e) {
- return Te(e, "parentNode")
- },
- parentsUntil: function(e, t, n) {
- return Te(e, "parentNode", n)
- },
- next: function(e) {
- return l(e, "nextSibling")
- },
- prev: function(e) {
- return l(e, "previousSibling")
- },
- nextAll: function(e) {
- return Te(e, "nextSibling")
- },
- prevAll: function(e) {
- return Te(e, "previousSibling")
- },
- nextUntil: function(e, t, n) {
- return Te(e, "nextSibling", n)
- },
- prevUntil: function(e, t, n) {
- return Te(e, "previousSibling", n)
- },
- siblings: function(e) {
- return Me((e.parentNode || {}).firstChild, e)
- },
- children: function(e) {
- return Me(e.firstChild)
- },
- contents: function(e) {
- return a(e, "iframe") ? e.contentDocument : (a(e, "template") && (e = e.content || e), xe.merge([], e.childNodes))
- }
- }, function(e, t) {
- xe.fn[e] = function(n, o) {
- var i = xe.map(this, t, n);
- return "Until" !== e.slice(-5) && (o = n), o && "string" == typeof o && (i = xe.filter(o, i)), this.length > 1 && (Ee[e] || xe.uniqueSort(i), Ae.test(e) && i.reverse()), this.pushStack(i)
- }
- });
- var Se = /[^\x20\t\r\n\f]+/g;
- xe.Callbacks = function(e) {
- e = "string" == typeof e ? s(e) : xe.extend({}, e);
- var t, n, i, a, r = [],
- l = [],
- c = -1,
- u = function() {
- for (a = a || e.once, i = t = !0; l.length; c = -1)
- for (n = l.shift(); ++c < r.length;) !1 === r[c].apply(n[0], n[1]) && e.stopOnFalse && (c = r.length, n = !1);
- e.memory || (n = !1), t = !1, a && (r = n ? [] : "")
- },
- d = {
- add: function() {
- return r && (n && !t && (c = r.length - 1, l.push(n)), function t(n) {
- xe.each(n, function(n, i) {
- ve(i) ? e.unique && d.has(i) || r.push(i) : i && i.length && "string" !== o(i) && t(i)
- })
- }(arguments), n && !t && u()), this
- },
- remove: function() {
- return xe.each(arguments, function(e, t) {
- for (var n;
- (n = xe.inArray(t, r, n)) > -1;) r.splice(n, 1), n <= c && c--
- }), this
- },
- has: function(e) {
- return e ? xe.inArray(e, r) > -1 : r.length > 0
- },
- empty: function() {
- return r && (r = []), this
- },
- disable: function() {
- return a = l = [], r = n = "", this
- },
- disabled: function() {
- return !r
- },
- lock: function() {
- return a = l = [], n || t || (r = n = ""), this
- },
- locked: function() {
- return !!a
- },
- fireWith: function(e, n) {
- return a || (n = [e, (n = n || []).slice ? n.slice() : n], l.push(n), t || u()), this
- },
- fire: function() {
- return d.fireWith(this, arguments), this
- },
- fired: function() {
- return !!i
- }
- };
- return d
- }, xe.extend({
- Deferred: function(t) {
- var n = [
- ["notify", "progress", xe.Callbacks("memory"), xe.Callbacks("memory"), 2],
- ["resolve", "done", xe.Callbacks("once memory"), xe.Callbacks("once memory"), 0, "resolved"],
- ["reject", "fail", xe.Callbacks("once memory"), xe.Callbacks("once memory"), 1, "rejected"]
- ],
- o = "pending",
- i = {
- state: function() {
- return o
- },
- always: function() {
- return a.done(arguments).fail(arguments), this
- },
- catch: function(e) {
- return i.then(null, e)
- },
- pipe: function() {
- var e = arguments;
- return xe.Deferred(function(t) {
- xe.each(n, function(n, o) {
- var i = ve(e[o[4]]) && e[o[4]];
- a[o[1]](function() {
- var e = i && i.apply(this, arguments);
- e && ve(e.promise) ? e.promise().progress(t.notify).done(t.resolve).fail(t.reject) : t[o[0] + "With"](this, i ? [e] : arguments)
- })
- }), e = null
- }).promise()
- },
- then: function(t, o, i) {
- function a(t, n, o, i) {
- return function() {
- var l = this,
- s = arguments,
- d = function() {
- var e, d;
- if (!(t < r)) {
- if ((e = o.apply(l, s)) === n.promise()) throw new TypeError("Thenable self-resolution");
- d = e && ("object" == typeof e || "function" == typeof e) && e.then, ve(d) ? i ? d.call(e, a(r, n, c, i), a(r, n, u, i)) : (r++, d.call(e, a(r, n, c, i), a(r, n, u, i), a(r, n, c, n.notifyWith))) : (o !== c && (l = void 0, s = [e]), (i || n.resolveWith)(l, s))
- }
- },
- p = i ? d : function() {
- try {
- d()
- } catch (e) {
- xe.Deferred.exceptionHook && xe.Deferred.exceptionHook(e, p.stackTrace), t + 1 >= r && (o !== u && (l = void 0, s = [e]), n.rejectWith(l, s))
- }
- };
- t ? p() : (xe.Deferred.getStackHook && (p.stackTrace = xe.Deferred.getStackHook()), e.setTimeout(p))
- }
- }
- var r = 0;
- return xe.Deferred(function(e) {
- n[0][3].add(a(0, e, ve(i) ? i : c, e.notifyWith)), n[1][3].add(a(0, e, ve(t) ? t : c)), n[2][3].add(a(0, e, ve(o) ? o : u))
- }).promise()
- },
- promise: function(e) {
- return null != e ? xe.extend(e, i) : i
- }
- },
- a = {};
- return xe.each(n, function(e, t) {
- var r = t[2],
- l = t[5];
- i[t[1]] = r.add, l && r.add(function() {
- o = l
- }, n[3 - e][2].disable, n[3 - e][3].disable, n[0][2].lock, n[0][3].lock), r.add(t[3].fire), a[t[0]] = function() {
- return a[t[0] + "With"](this === a ? void 0 : this, arguments), this
- }, a[t[0] + "With"] = r.fireWith
- }), i.promise(a), t && t.call(a, a), a
- },
- when: function(e) {
- var t = arguments.length,
- n = t,
- o = Array(n),
- i = se.call(arguments),
- a = xe.Deferred(),
- r = function(e) {
- return function(n) {
- o[e] = this, i[e] = arguments.length > 1 ? se.call(arguments) : n, --t || a.resolveWith(o, i)
- }
- };
- if (t <= 1 && (d(e, a.done(r(n)).resolve, a.reject, !t), "pending" === a.state() || ve(i[n] && i[n].then))) return a.then();
- for (; n--;) d(i[n], r(n), a.reject);
- return a.promise()
- }
- });
- var Le = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
- xe.Deferred.exceptionHook = function(t, n) {
- e.console && e.console.warn && t && Le.test(t.name) && e.console.warn("jQuery.Deferred exception: " + t.message, t.stack, n)
- }, xe.readyException = function(t) {
- e.setTimeout(function() {
- throw t
- })
- };
- var Pe = xe.Deferred();
- xe.fn.ready = function(e) {
- return Pe.then(e).catch(function(e) {
- xe.readyException(e)
- }), this
- }, xe.extend({
- isReady: !1,
- readyWait: 1,
- ready: function(e) {
- (!0 === e ? --xe.readyWait : xe.isReady) || (xe.isReady = !0, !0 !== e && --xe.readyWait > 0 || Pe.resolveWith(re, [xe]))
- }
- }), xe.ready.then = Pe.then, "complete" === re.readyState || "loading" !== re.readyState && !re.documentElement.doScroll ? e.setTimeout(xe.ready) : (re.addEventListener("DOMContentLoaded", p), e.addEventListener("load", p));
- var Ie = function(e, t, n, i, a, r, l) {
- var s = 0,
- c = e.length,
- u = null == n;
- if ("object" === o(n)) {
- a = !0;
- for (s in n) Ie(e, t, s, n[s], !0, r, l)
- } else if (void 0 !== i && (a = !0, ve(i) || (l = !0), u && (l ? (t.call(e, i), t = null) : (u = t, t = function(e, t, n) {
- return u.call(xe(e), n)
- })), t))
- for (; s < c; s++) t(e[s], n, l ? i : i.call(e[s], s, t(e[s], n)));
- return a ? e : u ? t.call(e) : c ? t(e[0], n) : r
- },
- Oe = /^-ms-/,
- Ne = /-([a-z])/g,
- qe = function(e) {
- return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType
- };
- b.uid = 1, b.prototype = {
- cache: function(e) {
- var t = e[this.expando];
- return t || (t = {}, qe(e) && (e.nodeType ? e[this.expando] = t : Object.defineProperty(e, this.expando, {
- value: t,
- configurable: !0
- }))), t
- },
- set: function(e, t, n) {
- var o, i = this.cache(e);
- if ("string" == typeof t) i[f(t)] = n;
- else
- for (o in t) i[f(o)] = t[o];
- return i
- },
- get: function(e, t) {
- return void 0 === t ? this.cache(e) : e[this.expando] && e[this.expando][f(t)]
- },
- access: function(e, t, n) {
- return void 0 === t || t && "string" == typeof t && void 0 === n ? this.get(e, t) : (this.set(e, t, n), void 0 !== n ? n : t)
- },
- remove: function(e, t) {
- var n, o = e[this.expando];
- if (void 0 !== o) {
- if (void 0 !== t) {
- n = (t = Array.isArray(t) ? t.map(f) : (t = f(t)) in o ? [t] : t.match(Se) || []).length;
- for (; n--;) delete o[t[n]]
- }(void 0 === t || xe.isEmptyObject(o)) && (e.nodeType ? e[this.expando] = void 0 : delete e[this.expando])
- }
- },
- hasData: function(e) {
- var t = e[this.expando];
- return void 0 !== t && !xe.isEmptyObject(t)
- }
- };
- var Re = new b,
- He = new b,
- Ue = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- Be = /[A-Z]/g;
- xe.extend({
- hasData: function(e) {
- return He.hasData(e) || Re.hasData(e)
- },
- data: function(e, t, n) {
- return He.access(e, t, n)
- },
- removeData: function(e, t) {
- He.remove(e, t)
- },
- _data: function(e, t, n) {
- return Re.access(e, t, n)
- },
- _removeData: function(e, t) {
- Re.remove(e, t)
- }
- }), xe.fn.extend({
- data: function(e, t) {
- var n, o, i, a = this[0],
- r = a && a.attributes;
- if (void 0 === e) {
- if (this.length && (i = He.get(a), 1 === a.nodeType && !Re.get(a, "hasDataAttrs"))) {
- for (n = r.length; n--;) r[n] && 0 === (o = r[n].name).indexOf("data-") && (o = f(o.slice(5)), g(a, o, i[o]));
- Re.set(a, "hasDataAttrs", !0)
- }
- return i
- }
- return "object" == typeof e ? this.each(function() {
- He.set(this, e)
- }) : Ie(this, function(t) {
- var n;
- if (a && void 0 === t) {
- if (void 0 !== (n = He.get(a, e))) return n;
- if (void 0 !== (n = g(a, e))) return n
- } else this.each(function() {
- He.set(this, e, t)
- })
- }, null, t, arguments.length > 1, null, !0)
- },
- removeData: function(e) {
- return this.each(function() {
- He.remove(this, e)
- })
- }
- }), xe.extend({
- queue: function(e, t, n) {
- var o;
- if (e) return t = (t || "fx") + "queue", o = Re.get(e, t), n && (!o || Array.isArray(n) ? o = Re.access(e, t, xe.makeArray(n)) : o.push(n)), o || []
- },
- dequeue: function(e, t) {
- t = t || "fx";
- var n = xe.queue(e, t),
- o = n.length,
- i = n.shift(),
- a = xe._queueHooks(e, t),
- r = function() {
- xe.dequeue(e, t)
- };
- "inprogress" === i && (i = n.shift(), o--), i && ("fx" === t && n.unshift("inprogress"), delete a.stop, i.call(e, r, a)), !o && a && a.empty.fire()
- },
- _queueHooks: function(e, t) {
- var n = t + "queueHooks";
- return Re.get(e, n) || Re.access(e, n, {
- empty: xe.Callbacks("once memory").add(function() {
- Re.remove(e, [t + "queue", n])
- })
- })
- }
- }), xe.fn.extend({
- queue: function(e, t) {
- var n = 2;
- return "string" != typeof e && (t = e, e = "fx", n--), arguments.length < n ? xe.queue(this[0], e) : void 0 === t ? this : this.each(function() {
- var n = xe.queue(this, e, t);
- xe._queueHooks(this, e), "fx" === e && "inprogress" !== n[0] && xe.dequeue(this, e)
- })
- },
- dequeue: function(e) {
- return this.each(function() {
- xe.dequeue(this, e)
- })
- },
- clearQueue: function(e) {
- return this.queue(e || "fx", [])
- },
- promise: function(e, t) {
- var n, o = 1,
- i = xe.Deferred(),
- a = this,
- r = this.length,
- l = function() {
- --o || i.resolveWith(a, [a])
- };
- for ("string" != typeof e && (t = e, e = void 0), e = e || "fx"; r--;)(n = Re.get(a[r], e + "queueHooks")) && n.empty && (o++, n.empty.add(l));
- return l(), i.promise(t)
- }
- });
- var Fe = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
- We = new RegExp("^(?:([+-])=|)(" + Fe + ")([a-z%]*)$", "i"),
- Xe = ["Top", "Right", "Bottom", "Left"],
- ze = function(e, t) {
- return "none" === (e = t || e).style.display || "" === e.style.display && xe.contains(e.ownerDocument, e) && "none" === xe.css(e, "display")
- },
- Ye = function(e, t, n, o) {
- var i, a, r = {};
- for (a in t) r[a] = e.style[a], e.style[a] = t[a];
- i = n.apply(e, o || []);
- for (a in t) e.style[a] = r[a];
- return i
- },
- Ke = {};
- xe.fn.extend({
- show: function() {
- return w(this, !0)
- },
- hide: function() {
- return w(this)
- },
- toggle: function(e) {
- return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function() {
- ze(this) ? xe(this).show() : xe(this).hide()
- })
- }
- });
- var Ve = /^(?:checkbox|radio)$/i,
- Ge = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i,
- Qe = /^$|^module$|\/(?:java|ecma)script/i,
- Ze = {
- option: [1, "<select multiple='multiple'>", "</select>"],
- thead: [1, "<table>", "</table>"],
- col: [2, "<table><colgroup>", "</colgroup></table>"],
- tr: [2, "<table><tbody>", "</tbody></table>"],
- td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
- _default: [0, "", ""]
- };
- Ze.optgroup = Ze.option, Ze.tbody = Ze.tfoot = Ze.colgroup = Ze.caption = Ze.thead, Ze.th = Ze.td;
- var Je = /<|&#?\w+;/;
- ! function() {
- var e = re.createDocumentFragment().appendChild(re.createElement("div")),
- t = re.createElement("input");
- t.setAttribute("type", "radio"), t.setAttribute("checked", "checked"), t.setAttribute("name", "t"), e.appendChild(t), ge.checkClone = e.cloneNode(!0).cloneNode(!0).lastChild.checked, e.innerHTML = "<textarea>x</textarea>", ge.noCloneChecked = !!e.cloneNode(!0).lastChild.defaultValue
- }();
- var et = re.documentElement,
- tt = /^key/,
- nt = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
- ot = /^([^.]*)(?:\.(.+)|)/;
- xe.event = {
- global: {},
- add: function(e, t, n, o, i) {
- var a, r, l, s, c, u, d, p, h, f, b, m = Re.get(e);
- if (m)
- for (n.handler && (n = (a = n).handler, i = a.selector), i && xe.find.matchesSelector(et, i), n.guid || (n.guid = xe.guid++), (s = m.events) || (s = m.events = {}), (r = m.handle) || (r = m.handle = function(t) {
- return void 0 !== xe && xe.event.triggered !== t.type ? xe.event.dispatch.apply(e, arguments) : void 0
- }), c = (t = (t || "").match(Se) || [""]).length; c--;) h = b = (l = ot.exec(t[c]) || [])[1], f = (l[2] || "").split(".").sort(), h && (d = xe.event.special[h] || {}, h = (i ? d.delegateType : d.bindType) || h, d = xe.event.special[h] || {}, u = xe.extend({
- type: h,
- origType: b,
- data: o,
- handler: n,
- guid: n.guid,
- selector: i,
- needsContext: i && xe.expr.match.needsContext.test(i),
- namespace: f.join(".")
- }, a), (p = s[h]) || ((p = s[h] = []).delegateCount = 0, d.setup && !1 !== d.setup.call(e, o, f, r) || e.addEventListener && e.addEventListener(h, r)), d.add && (d.add.call(e, u), u.handler.guid || (u.handler.guid = n.guid)), i ? p.splice(p.delegateCount++, 0, u) : p.push(u), xe.event.global[h] = !0)
- },
- remove: function(e, t, n, o, i) {
- var a, r, l, s, c, u, d, p, h, f, b, m = Re.hasData(e) && Re.get(e);
- if (m && (s = m.events)) {
- for (c = (t = (t || "").match(Se) || [""]).length; c--;)
- if (l = ot.exec(t[c]) || [], h = b = l[1], f = (l[2] || "").split(".").sort(), h) {
- for (d = xe.event.special[h] || {}, p = s[h = (o ? d.delegateType : d.bindType) || h] || [], l = l[2] && new RegExp("(^|\\.)" + f.join("\\.(?:.*\\.|)") + "(\\.|$)"), r = a = p.length; a--;) u = p[a], !i && b !== u.origType || n && n.guid !== u.guid || l && !l.test(u.namespace) || o && o !== u.selector && ("**" !== o || !u.selector) || (p.splice(a, 1), u.selector && p.delegateCount--, d.remove && d.remove.call(e, u));
- r && !p.length && (d.teardown && !1 !== d.teardown.call(e, f, m.handle) || xe.removeEvent(e, h, m.handle), delete s[h])
- } else
- for (h in s) xe.event.remove(e, h + t[c], n, o, !0);
- xe.isEmptyObject(s) && Re.remove(e, "handle events")
- }
- },
- dispatch: function(e) {
- var t, n, o, i, a, r, l = xe.event.fix(e),
- s = new Array(arguments.length),
- c = (Re.get(this, "events") || {})[l.type] || [],
- u = xe.event.special[l.type] || {};
- for (s[0] = l, t = 1; t < arguments.length; t++) s[t] = arguments[t];
- if (l.delegateTarget = this, !u.preDispatch || !1 !== u.preDispatch.call(this, l)) {
- for (r = xe.event.handlers.call(this, l, c), t = 0;
- (i = r[t++]) && !l.isPropagationStopped();)
- for (l.currentTarget = i.elem, n = 0;
- (a = i.handlers[n++]) && !l.isImmediatePropagationStopped();) l.rnamespace && !l.rnamespace.test(a.namespace) || (l.handleObj = a, l.data = a.data, void 0 !== (o = ((xe.event.special[a.origType] || {}).handle || a.handler).apply(i.elem, s)) && !1 === (l.result = o) && (l.preventDefault(), l.stopPropagation()));
- return u.postDispatch && u.postDispatch.call(this, l), l.result
- }
- },
- handlers: function(e, t) {
- var n, o, i, a, r, l = [],
- s = t.delegateCount,
- c = e.target;
- if (s && c.nodeType && !("click" === e.type && e.button >= 1))
- for (; c !== this; c = c.parentNode || this)
- if (1 === c.nodeType && ("click" !== e.type || !0 !== c.disabled)) {
- for (a = [], r = {}, n = 0; n < s; n++) void 0 === r[i = (o = t[n]).selector + " "] && (r[i] = o.needsContext ? xe(i, this).index(c) > -1 : xe.find(i, this, null, [c]).length), r[i] && a.push(o);
- a.length && l.push({
- elem: c,
- handlers: a
- })
- }
- return c = this, s < t.length && l.push({
- elem: c,
- handlers: t.slice(s)
- }), l
- },
- addProp: function(e, t) {
- Object.defineProperty(xe.Event.prototype, e, {
- enumerable: !0,
- configurable: !0,
- get: ve(t) ? function() {
- if (this.originalEvent) return t(this.originalEvent)
- } : function() {
- if (this.originalEvent) return this.originalEvent[e]
- },
- set: function(t) {
- Object.defineProperty(this, e, {
- enumerable: !0,
- configurable: !0,
- writable: !0,
- value: t
- })
- }
- })
- },
- fix: function(e) {
- return e[xe.expando] ? e : new xe.Event(e)
- },
- special: {
- load: {
- noBubble: !0
- },
- focus: {
- trigger: function() {
- if (this !== k() && this.focus) return this.focus(), !1
- },
- delegateType: "focusin"
- },
- blur: {
- trigger: function() {
- if (this === k() && this.blur) return this.blur(), !1
- },
- delegateType: "focusout"
- },
- click: {
- trigger: function() {
- if ("checkbox" === this.type && this.click && a(this, "input")) return this.click(), !1
- },
- _default: function(e) {
- return a(e.target, "a")
- }
- },
- beforeunload: {
- postDispatch: function(e) {
- void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result)
- }
- }
- }
- }, xe.removeEvent = function(e, t, n) {
- e.removeEventListener && e.removeEventListener(t, n)
- }, xe.Event = function(e, t) {
- if (!(this instanceof xe.Event)) return new xe.Event(e, t);
- e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? T : M, this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget) : this.type = e, t && xe.extend(this, t), this.timeStamp = e && e.timeStamp || Date.now(), this[xe.expando] = !0
- }, xe.Event.prototype = {
- constructor: xe.Event,
- isDefaultPrevented: M,
- isPropagationStopped: M,
- isImmediatePropagationStopped: M,
- isSimulated: !1,
- preventDefault: function() {
- var e = this.originalEvent;
- this.isDefaultPrevented = T, e && !this.isSimulated && e.preventDefault()
- },
- stopPropagation: function() {
- var e = this.originalEvent;
- this.isPropagationStopped = T, e && !this.isSimulated && e.stopPropagation()
- },
- stopImmediatePropagation: function() {
- var e = this.originalEvent;
- this.isImmediatePropagationStopped = T, e && !this.isSimulated && e.stopImmediatePropagation(), this.stopPropagation()
- }
- }, xe.each({
- altKey: !0,
- bubbles: !0,
- cancelable: !0,
- changedTouches: !0,
- ctrlKey: !0,
- detail: !0,
- eventPhase: !0,
- metaKey: !0,
- pageX: !0,
- pageY: !0,
- shiftKey: !0,
- view: !0,
- char: !0,
- charCode: !0,
- key: !0,
- keyCode: !0,
- button: !0,
- buttons: !0,
- clientX: !0,
- clientY: !0,
- offsetX: !0,
- offsetY: !0,
- pointerId: !0,
- pointerType: !0,
- screenX: !0,
- screenY: !0,
- targetTouches: !0,
- toElement: !0,
- touches: !0,
- which: function(e) {
- var t = e.button;
- return null == e.which && tt.test(e.type) ? null != e.charCode ? e.charCode : e.keyCode : !e.which && void 0 !== t && nt.test(e.type) ? 1 & t ? 1 : 2 & t ? 3 : 4 & t ? 2 : 0 : e.which
- }
- }, xe.event.addProp), xe.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- }, function(e, t) {
- xe.event.special[e] = {
- delegateType: t,
- bindType: t,
- handle: function(e) {
- var n, o = this,
- i = e.relatedTarget,
- a = e.handleObj;
- return i && (i === o || xe.contains(o, i)) || (e.type = a.origType, n = a.handler.apply(this, arguments), e.type = t), n
- }
- }
- }), xe.fn.extend({
- on: function(e, t, n, o) {
- return C(this, e, t, n, o)
- },
- one: function(e, t, n, o) {
- return C(this, e, t, n, o, 1)
- },
- off: function(e, t, n) {
- var o, i;
- if (e && e.preventDefault && e.handleObj) return o = e.handleObj, xe(e.delegateTarget).off(o.namespace ? o.origType + "." + o.namespace : o.origType, o.selector, o.handler), this;
- if ("object" == typeof e) {
- for (i in e) this.off(i, t, e[i]);
- return this
- }
- return !1 !== t && "function" != typeof t || (n = t, t = void 0), !1 === n && (n = M), this.each(function() {
- xe.event.remove(this, e, n, t)
- })
- }
- });
- var it = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
- at = /<script|<style|<link/i,
- rt = /checked\s*(?:[^=]|=\s*.checked.)/i,
- lt = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
- xe.extend({
- htmlPrefilter: function(e) {
- return e.replace(it, "<$1></$2>")
- },
- clone: function(e, t, n) {
- var o, i, a, r, l = e.cloneNode(!0),
- s = xe.contains(e.ownerDocument, e);
- if (!(ge.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || xe.isXMLDoc(e)))
- for (r = x(l), o = 0, i = (a = x(e)).length; o < i; o++) S(a[o], r[o]);
- if (t)
- if (n)
- for (a = a || x(e), r = r || x(l), o = 0, i = a.length; o < i; o++) E(a[o], r[o]);
- else E(e, l);
- return (r = x(l, "script")).length > 0 && _(r, !s && x(e, "script")), l
- },
- cleanData: function(e) {
- for (var t, n, o, i = xe.event.special, a = 0; void 0 !== (n = e[a]); a++)
- if (qe(n)) {
- if (t = n[Re.expando]) {
- if (t.events)
- for (o in t.events) i[o] ? xe.event.remove(n, o) : xe.removeEvent(n, o, t.handle);
- n[Re.expando] = void 0
- }
- n[He.expando] && (n[He.expando] = void 0)
- }
- }
- }), xe.fn.extend({
- detach: function(e) {
- return P(this, e, !0)
- },
- remove: function(e) {
- return P(this, e)
- },
- text: function(e) {
- return Ie(this, function(e) {
- return void 0 === e ? xe.text(this) : this.empty().each(function() {
- 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = e)
- })
- }, null, e, arguments.length)
- },
- append: function() {
- return L(this, arguments, function(e) {
- 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || D(this, e).appendChild(e)
- })
- },
- prepend: function() {
- return L(this, arguments, function(e) {
- if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
- var t = D(this, e);
- t.insertBefore(e, t.firstChild)
- }
- })
- },
- before: function() {
- return L(this, arguments, function(e) {
- this.parentNode && this.parentNode.insertBefore(e, this)
- })
- },
- after: function() {
- return L(this, arguments, function(e) {
- this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
- })
- },
- empty: function() {
- for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (xe.cleanData(x(e, !1)), e.textContent = "");
- return this
- },
- clone: function(e, t) {
- return e = null != e && e, t = null == t ? e : t, this.map(function() {
- return xe.clone(this, e, t)
- })
- },
- html: function(e) {
- return Ie(this, function(e) {
- var t = this[0] || {},
- n = 0,
- o = this.length;
- if (void 0 === e && 1 === t.nodeType) return t.innerHTML;
- if ("string" == typeof e && !at.test(e) && !Ze[(Ge.exec(e) || ["", ""])[1].toLowerCase()]) {
- e = xe.htmlPrefilter(e);
- try {
- for (; n < o; n++) 1 === (t = this[n] || {}).nodeType && (xe.cleanData(x(t, !1)), t.innerHTML = e);
- t = 0
- } catch (e) {}
- }
- t && this.empty().append(e)
- }, null, e, arguments.length)
- },
- replaceWith: function() {
- var e = [];
- return L(this, arguments, function(t) {
- var n = this.parentNode;
- xe.inArray(this, e) < 0 && (xe.cleanData(x(this)), n && n.replaceChild(t, this))
- }, e)
- }
- }), xe.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function(e, t) {
- xe.fn[e] = function(e) {
- for (var n, o = [], i = xe(e), a = i.length - 1, r = 0; r <= a; r++) n = r === a ? this : this.clone(!0), xe(i[r])[t](n), ue.apply(o, n.get());
- return this.pushStack(o)
- }
- });
- var st = new RegExp("^(" + Fe + ")(?!px)[a-z%]+$", "i"),
- ct = function(t) {
- var n = t.ownerDocument.defaultView;
- return n && n.opener || (n = e), n.getComputedStyle(t)
- },
- ut = new RegExp(Xe.join("|"), "i");
- ! function() {
- function t() {
- if (c) {
- s.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", c.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", et.appendChild(s).appendChild(c);
- var t = e.getComputedStyle(c);
- o = "1%" !== t.top, l = 12 === n(t.marginLeft), c.style.right = "60%", r = 36 === n(t.right), i = 36 === n(t.width), c.style.position = "absolute", a = 36 === c.offsetWidth || "absolute", et.removeChild(s), c = null
- }
- }
- function n(e) {
- return Math.round(parseFloat(e))
- }
- var o, i, a, r, l, s = re.createElement("div"),
- c = re.createElement("div");
- c.style && (c.style.backgroundClip = "content-box", c.cloneNode(!0).style.backgroundClip = "", ge.clearCloneStyle = "content-box" === c.style.backgroundClip, xe.extend(ge, {
- boxSizingReliable: function() {
- return t(), i
- },
- pixelBoxStyles: function() {
- return t(), r
- },
- pixelPosition: function() {
- return t(), o
- },
- reliableMarginLeft: function() {
- return t(), l
- },
- scrollboxSize: function() {
- return t(), a
- }
- }))
- }();
- var dt = /^(none|table(?!-c[ea]).+)/,
- pt = /^--/,
- ht = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
- },
- ft = {
- letterSpacing: "0",
- fontWeight: "400"
- },
- bt = ["Webkit", "Moz", "ms"],
- mt = re.createElement("div").style;
- xe.extend({
- cssHooks: {
- opacity: {
- get: function(e, t) {
- if (t) {
- var n = I(e, "opacity");
- return "" === n ? "1" : n
- }
- }
- }
- },
- 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: {},
- style: function(e, t, n, o) {
- if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
- var i, a, r, l = f(t),
- s = pt.test(t),
- c = e.style;
- if (s || (t = q(l)), r = xe.cssHooks[t] || xe.cssHooks[l], void 0 === n) return r && "get" in r && void 0 !== (i = r.get(e, !1, o)) ? i : c[t];
- "string" == (a = typeof n) && (i = We.exec(n)) && i[1] && (n = v(e, t, i), a = "number"), null != n && n === n && ("number" === a && (n += i && i[3] || (xe.cssNumber[l] ? "" : "px")), ge.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (c[t] = "inherit"), r && "set" in r && void 0 === (n = r.set(e, n, o)) || (s ? c.setProperty(t, n) : c[t] = n))
- }
- },
- css: function(e, t, n, o) {
- var i, a, r, l = f(t);
- return pt.test(t) || (t = q(l)), (r = xe.cssHooks[t] || xe.cssHooks[l]) && "get" in r && (i = r.get(e, !0, n)), void 0 === i && (i = I(e, t, o)), "normal" === i && t in ft && (i = ft[t]), "" === n || n ? (a = parseFloat(i), !0 === n || isFinite(a) ? a || 0 : i) : i
- }
- }), xe.each(["height", "width"], function(e, t) {
- xe.cssHooks[t] = {
- get: function(e, n, o) {
- if (n) return !dt.test(xe.css(e, "display")) || e.getClientRects().length && e.getBoundingClientRect().width ? U(e, t, o) : Ye(e, ht, function() {
- return U(e, t, o)
- })
- },
- set: function(e, n, o) {
- var i, a = ct(e),
- r = "border-box" === xe.css(e, "boxSizing", !1, a),
- l = o && H(e, t, o, r, a);
- return r && ge.scrollboxSize() === a.position && (l -= Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - parseFloat(a[t]) - H(e, t, "border", !1, a) - .5)), l && (i = We.exec(n)) && "px" !== (i[3] || "px") && (e.style[t] = n, n = xe.css(e, t)), R(e, n, l)
- }
- }
- }), xe.cssHooks.marginLeft = O(ge.reliableMarginLeft, function(e, t) {
- if (t) return (parseFloat(I(e, "marginLeft")) || e.getBoundingClientRect().left - Ye(e, {
- marginLeft: 0
- }, function() {
- return e.getBoundingClientRect().left
- })) + "px"
- }), xe.each({
- margin: "",
- padding: "",
- border: "Width"
- }, function(e, t) {
- xe.cssHooks[e + t] = {
- expand: function(n) {
- for (var o = 0, i = {}, a = "string" == typeof n ? n.split(" ") : [n]; o < 4; o++) i[e + Xe[o] + t] = a[o] || a[o - 2] || a[0];
- return i
- }
- }, "margin" !== e && (xe.cssHooks[e + t].set = R)
- }), xe.fn.extend({
- css: function(e, t) {
- return Ie(this, function(e, t, n) {
- var o, i, a = {},
- r = 0;
- if (Array.isArray(t)) {
- for (o = ct(e), i = t.length; r < i; r++) a[t[r]] = xe.css(e, t[r], !1, o);
- return a
- }
- return void 0 !== n ? xe.style(e, t, n) : xe.css(e, t)
- }, e, t, arguments.length > 1)
- }
- }), xe.Tween = B, B.prototype = {
- constructor: B,
- init: function(e, t, n, o, i, a) {
- this.elem = e, this.prop = n, this.easing = i || xe.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = o, this.unit = a || (xe.cssNumber[n] ? "" : "px")
- },
- cur: function() {
- var e = B.propHooks[this.prop];
- return e && e.get ? e.get(this) : B.propHooks._default.get(this)
- },
- run: function(e) {
- var t, n = B.propHooks[this.prop];
- return this.options.duration ? this.pos = t = xe.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), n && n.set ? n.set(this) : B.propHooks._default.set(this), this
- }
- }, B.prototype.init.prototype = B.prototype, B.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 = xe.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0
- },
- set: function(e) {
- xe.fx.step[e.prop] ? xe.fx.step[e.prop](e) : 1 !== e.elem.nodeType || null == e.elem.style[xe.cssProps[e.prop]] && !xe.cssHooks[e.prop] ? e.elem[e.prop] = e.now : xe.style(e.elem, e.prop, e.now + e.unit)
- }
- }
- }, B.propHooks.scrollTop = B.propHooks.scrollLeft = {
- set: function(e) {
- e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
- }
- }, xe.easing = {
- linear: function(e) {
- return e
- },
- swing: function(e) {
- return .5 - Math.cos(e * Math.PI) / 2
- },
- _default: "swing"
- }, xe.fx = B.prototype.init, xe.fx.step = {};
- var gt, vt, yt = /^(?:toggle|show|hide)$/,
- wt = /queueHooks$/;
- xe.Animation = xe.extend(V, {
- tweeners: {
- "*": [function(e, t) {
- var n = this.createTween(e, t);
- return v(n.elem, e, We.exec(t), n), n
- }]
- },
- tweener: function(e, t) {
- ve(e) ? (t = e, e = ["*"]) : e = e.match(Se);
- for (var n, o = 0, i = e.length; o < i; o++) n = e[o], V.tweeners[n] = V.tweeners[n] || [], V.tweeners[n].unshift(t)
- },
- prefilters: [Y],
- prefilter: function(e, t) {
- t ? V.prefilters.unshift(e) : V.prefilters.push(e)
- }
- }), xe.speed = function(e, t, n) {
- var o = e && "object" == typeof e ? xe.extend({}, e) : {
- complete: n || !n && t || ve(e) && e,
- duration: e,
- easing: n && t || t && !ve(t) && t
- };
- return xe.fx.off ? o.duration = 0 : "number" != typeof o.duration && (o.duration in xe.fx.speeds ? o.duration = xe.fx.speeds[o.duration] : o.duration = xe.fx.speeds._default), null != o.queue && !0 !== o.queue || (o.queue = "fx"), o.old = o.complete, o.complete = function() {
- ve(o.old) && o.old.call(this), o.queue && xe.dequeue(this, o.queue)
- }, o
- }, xe.fn.extend({
- fadeTo: function(e, t, n, o) {
- return this.filter(ze).css("opacity", 0).show().end().animate({
- opacity: t
- }, e, n, o)
- },
- animate: function(e, t, n, o) {
- var i = xe.isEmptyObject(e),
- a = xe.speed(t, n, o),
- r = function() {
- var t = V(this, xe.extend({}, e), a);
- (i || Re.get(this, "finish")) && t.stop(!0)
- };
- return r.finish = r, i || !1 === a.queue ? this.each(r) : this.queue(a.queue, r)
- },
- stop: function(e, t, n) {
- var o = function(e) {
- var t = e.stop;
- delete e.stop, t(n)
- };
- return "string" != typeof e && (n = t, t = e, e = void 0), t && !1 !== e && this.queue(e || "fx", []), this.each(function() {
- var t = !0,
- i = null != e && e + "queueHooks",
- a = xe.timers,
- r = Re.get(this);
- if (i) r[i] && r[i].stop && o(r[i]);
- else
- for (i in r) r[i] && r[i].stop && wt.test(i) && o(r[i]);
- for (i = a.length; i--;) a[i].elem !== this || null != e && a[i].queue !== e || (a[i].anim.stop(n), t = !1, a.splice(i, 1));
- !t && n || xe.dequeue(this, e)
- })
- },
- finish: function(e) {
- return !1 !== e && (e = e || "fx"), this.each(function() {
- var t, n = Re.get(this),
- o = n[e + "queue"],
- i = n[e + "queueHooks"],
- a = xe.timers,
- r = o ? o.length : 0;
- for (n.finish = !0, xe.queue(this, e, []), i && i.stop && i.stop.call(this, !0), t = a.length; t--;) a[t].elem === this && a[t].queue === e && (a[t].anim.stop(!0), a.splice(t, 1));
- for (t = 0; t < r; t++) o[t] && o[t].finish && o[t].finish.call(this);
- delete n.finish
- })
- }
- }), xe.each(["toggle", "show", "hide"], function(e, t) {
- var n = xe.fn[t];
- xe.fn[t] = function(e, o, i) {
- return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(X(t, !0), e, o, i)
- }
- }), xe.each({
- slideDown: X("show"),
- slideUp: X("hide"),
- slideToggle: X("toggle"),
- fadeIn: {
- opacity: "show"
- },
- fadeOut: {
- opacity: "hide"
- },
- fadeToggle: {
- opacity: "toggle"
- }
- }, function(e, t) {
- xe.fn[e] = function(e, n, o) {
- return this.animate(t, e, n, o)
- }
- }), xe.timers = [], xe.fx.tick = function() {
- var e, t = 0,
- n = xe.timers;
- for (gt = Date.now(); t < n.length; t++)(e = n[t])() || n[t] !== e || n.splice(t--, 1);
- n.length || xe.fx.stop(), gt = void 0
- }, xe.fx.timer = function(e) {
- xe.timers.push(e), xe.fx.start()
- }, xe.fx.interval = 13, xe.fx.start = function() {
- vt || (vt = !0, F())
- }, xe.fx.stop = function() {
- vt = null
- }, xe.fx.speeds = {
- slow: 600,
- fast: 200,
- _default: 400
- }, xe.fn.delay = function(t, n) {
- return t = xe.fx ? xe.fx.speeds[t] || t : t, n = n || "fx", this.queue(n, function(n, o) {
- var i = e.setTimeout(n, t);
- o.stop = function() {
- e.clearTimeout(i)
- }
- })
- },
- function() {
- var e = re.createElement("input"),
- t = re.createElement("select").appendChild(re.createElement("option"));
- e.type = "checkbox", ge.checkOn = "" !== e.value, ge.optSelected = t.selected, (e = re.createElement("input")).value = "t", e.type = "radio", ge.radioValue = "t" === e.value
- }();
- var xt, _t = xe.expr.attrHandle;
- xe.fn.extend({
- attr: function(e, t) {
- return Ie(this, xe.attr, e, t, arguments.length > 1)
- },
- removeAttr: function(e) {
- return this.each(function() {
- xe.removeAttr(this, e)
- })
- }
- }), xe.extend({
- attr: function(e, t, n) {
- var o, i, a = e.nodeType;
- if (3 !== a && 8 !== a && 2 !== a) return void 0 === e.getAttribute ? xe.prop(e, t, n) : (1 === a && xe.isXMLDoc(e) || (i = xe.attrHooks[t.toLowerCase()] || (xe.expr.match.bool.test(t) ? xt : void 0)), void 0 !== n ? null === n ? void xe.removeAttr(e, t) : i && "set" in i && void 0 !== (o = i.set(e, n, t)) ? o : (e.setAttribute(t, n + ""), n) : i && "get" in i && null !== (o = i.get(e, t)) ? o : null == (o = xe.find.attr(e, t)) ? void 0 : o)
- },
- attrHooks: {
- type: {
- set: function(e, t) {
- if (!ge.radioValue && "radio" === t && a(e, "input")) {
- var n = e.value;
- return e.setAttribute("type", t), n && (e.value = n), t
- }
- }
- }
- },
- removeAttr: function(e, t) {
- var n, o = 0,
- i = t && t.match(Se);
- if (i && 1 === e.nodeType)
- for (; n = i[o++];) e.removeAttribute(n)
- }
- }), xt = {
- set: function(e, t, n) {
- return !1 === t ? xe.removeAttr(e, n) : e.setAttribute(n, n), n
- }
- }, xe.each(xe.expr.match.bool.source.match(/\w+/g), function(e, t) {
- var n = _t[t] || xe.find.attr;
- _t[t] = function(e, t, o) {
- var i, a, r = t.toLowerCase();
- return o || (a = _t[r], _t[r] = i, i = null != n(e, t, o) ? r : null, _t[r] = a), i
- }
- });
- var jt = /^(?:input|select|textarea|button)$/i,
- Tt = /^(?:a|area)$/i;
- xe.fn.extend({
- prop: function(e, t) {
- return Ie(this, xe.prop, e, t, arguments.length > 1)
- },
- removeProp: function(e) {
- return this.each(function() {
- delete this[xe.propFix[e] || e]
- })
- }
- }), xe.extend({
- prop: function(e, t, n) {
- var o, i, a = e.nodeType;
- if (3 !== a && 8 !== a && 2 !== a) return 1 === a && xe.isXMLDoc(e) || (t = xe.propFix[t] || t, i = xe.propHooks[t]), void 0 !== n ? i && "set" in i && void 0 !== (o = i.set(e, n, t)) ? o : e[t] = n : i && "get" in i && null !== (o = i.get(e, t)) ? o : e[t]
- },
- propHooks: {
- tabIndex: {
- get: function(e) {
- var t = xe.find.attr(e, "tabindex");
- return t ? parseInt(t, 10) : jt.test(e.nodeName) || Tt.test(e.nodeName) && e.href ? 0 : -1
- }
- }
- },
- propFix: {
- for: "htmlFor",
- class: "className"
- }
- }), ge.optSelected || (xe.propHooks.selected = {
- get: function(e) {
- var t = e.parentNode;
- return t && t.parentNode && t.parentNode.selectedIndex, null
- },
- set: function(e) {
- var t = e.parentNode;
- t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex)
- }
- }), xe.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
- xe.propFix[this.toLowerCase()] = this
- }), xe.fn.extend({
- addClass: function(e) {
- var t, n, o, i, a, r, l, s = 0;
- if (ve(e)) return this.each(function(t) {
- xe(this).addClass(e.call(this, t, Q(this)))
- });
- if ((t = Z(e)).length)
- for (; n = this[s++];)
- if (i = Q(n), o = 1 === n.nodeType && " " + G(i) + " ") {
- for (r = 0; a = t[r++];) o.indexOf(" " + a + " ") < 0 && (o += a + " ");
- i !== (l = G(o)) && n.setAttribute("class", l)
- }
- return this
- },
- removeClass: function(e) {
- var t, n, o, i, a, r, l, s = 0;
- if (ve(e)) return this.each(function(t) {
- xe(this).removeClass(e.call(this, t, Q(this)))
- });
- if (!arguments.length) return this.attr("class", "");
- if ((t = Z(e)).length)
- for (; n = this[s++];)
- if (i = Q(n), o = 1 === n.nodeType && " " + G(i) + " ") {
- for (r = 0; a = t[r++];)
- for (; o.indexOf(" " + a + " ") > -1;) o = o.replace(" " + a + " ", " ");
- i !== (l = G(o)) && n.setAttribute("class", l)
- }
- return this
- },
- toggleClass: function(e, t) {
- var n = typeof e,
- o = "string" === n || Array.isArray(e);
- return "boolean" == typeof t && o ? t ? this.addClass(e) : this.removeClass(e) : ve(e) ? this.each(function(n) {
- xe(this).toggleClass(e.call(this, n, Q(this), t), t)
- }) : this.each(function() {
- var t, i, a, r;
- if (o)
- for (i = 0, a = xe(this), r = Z(e); t = r[i++];) a.hasClass(t) ? a.removeClass(t) : a.addClass(t);
- else void 0 !== e && "boolean" !== n || ((t = Q(this)) && Re.set(this, "__className__", t), this.setAttribute && this.setAttribute("class", t || !1 === e ? "" : Re.get(this, "__className__") || ""))
- })
- },
- hasClass: function(e) {
- var t, n, o = 0;
- for (t = " " + e + " "; n = this[o++];)
- if (1 === n.nodeType && (" " + G(Q(n)) + " ").indexOf(t) > -1) return !0;
- return !1
- }
- });
- var Mt = /\r/g;
- xe.fn.extend({
- val: function(e) {
- var t, n, o, i = this[0];
- return arguments.length ? (o = ve(e), this.each(function(n) {
- var i;
- 1 === this.nodeType && (null == (i = o ? e.call(this, n, xe(this).val()) : e) ? i = "" : "number" == typeof i ? i += "" : Array.isArray(i) && (i = xe.map(i, function(e) {
- return null == e ? "" : e + ""
- })), (t = xe.valHooks[this.type] || xe.valHooks[this.nodeName.toLowerCase()]) && "set" in t && void 0 !== t.set(this, i, "value") || (this.value = i))
- })) : i ? (t = xe.valHooks[i.type] || xe.valHooks[i.nodeName.toLowerCase()]) && "get" in t && void 0 !== (n = t.get(i, "value")) ? n : "string" == typeof(n = i.value) ? n.replace(Mt, "") : null == n ? "" : n : void 0
- }
- }), xe.extend({
- valHooks: {
- option: {
- get: function(e) {
- var t = xe.find.attr(e, "value");
- return null != t ? t : G(xe.text(e))
- }
- },
- select: {
- get: function(e) {
- var t, n, o, i = e.options,
- r = e.selectedIndex,
- l = "select-one" === e.type,
- s = l ? null : [],
- c = l ? r + 1 : i.length;
- for (o = r < 0 ? c : l ? r : 0; o < c; o++)
- if (((n = i[o]).selected || o === r) && !n.disabled && (!n.parentNode.disabled || !a(n.parentNode, "optgroup"))) {
- if (t = xe(n).val(), l) return t;
- s.push(t)
- }
- return s
- },
- set: function(e, t) {
- for (var n, o, i = e.options, a = xe.makeArray(t), r = i.length; r--;)((o = i[r]).selected = xe.inArray(xe.valHooks.option.get(o), a) > -1) && (n = !0);
- return n || (e.selectedIndex = -1), a
- }
- }
- }
- }), xe.each(["radio", "checkbox"], function() {
- xe.valHooks[this] = {
- set: function(e, t) {
- if (Array.isArray(t)) return e.checked = xe.inArray(xe(e).val(), t) > -1
- }
- }, ge.checkOn || (xe.valHooks[this].get = function(e) {
- return null === e.getAttribute("value") ? "on" : e.value
- })
- }), ge.focusin = "onfocusin" in e;
- var kt = /^(?:focusinfocus|focusoutblur)$/,
- Ct = function(e) {
- e.stopPropagation()
- };
- xe.extend(xe.event, {
- trigger: function(t, n, o, i) {
- var a, r, l, s, c, u, d, p, h = [o || re],
- f = fe.call(t, "type") ? t.type : t,
- b = fe.call(t, "namespace") ? t.namespace.split(".") : [];
- if (r = p = l = o = o || re, 3 !== o.nodeType && 8 !== o.nodeType && !kt.test(f + xe.event.triggered) && (f.indexOf(".") > -1 && (f = (b = f.split(".")).shift(), b.sort()), c = f.indexOf(":") < 0 && "on" + f, t = t[xe.expando] ? t : new xe.Event(f, "object" == typeof t && t), t.isTrigger = i ? 2 : 3, t.namespace = b.join("."), t.rnamespace = t.namespace ? new RegExp("(^|\\.)" + b.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = o), n = null == n ? [t] : xe.makeArray(n, [t]), d = xe.event.special[f] || {}, i || !d.trigger || !1 !== d.trigger.apply(o, n))) {
- if (!i && !d.noBubble && !ye(o)) {
- for (s = d.delegateType || f, kt.test(s + f) || (r = r.parentNode); r; r = r.parentNode) h.push(r), l = r;
- l === (o.ownerDocument || re) && h.push(l.defaultView || l.parentWindow || e)
- }
- for (a = 0;
- (r = h[a++]) && !t.isPropagationStopped();) p = r, t.type = a > 1 ? s : d.bindType || f, (u = (Re.get(r, "events") || {})[t.type] && Re.get(r, "handle")) && u.apply(r, n), (u = c && r[c]) && u.apply && qe(r) && (t.result = u.apply(r, n), !1 === t.result && t.preventDefault());
- return t.type = f, i || t.isDefaultPrevented() || d._default && !1 !== d._default.apply(h.pop(), n) || !qe(o) || c && ve(o[f]) && !ye(o) && ((l = o[c]) && (o[c] = null), xe.event.triggered = f, t.isPropagationStopped() && p.addEventListener(f, Ct), o[f](), t.isPropagationStopped() && p.removeEventListener(f, Ct), xe.event.triggered = void 0, l && (o[c] = l)), t.result
- }
- },
- simulate: function(e, t, n) {
- var o = xe.extend(new xe.Event, n, {
- type: e,
- isSimulated: !0
- });
- xe.event.trigger(o, null, t)
- }
- }), xe.fn.extend({
- trigger: function(e, t) {
- return this.each(function() {
- xe.event.trigger(e, t, this)
- })
- },
- triggerHandler: function(e, t) {
- var n = this[0];
- if (n) return xe.event.trigger(e, t, n, !0)
- }
- }), ge.focusin || xe.each({
- focus: "focusin",
- blur: "focusout"
- }, function(e, t) {
- var n = function(e) {
- xe.event.simulate(t, e.target, xe.event.fix(e))
- };
- xe.event.special[t] = {
- setup: function() {
- var o = this.ownerDocument || this,
- i = Re.access(o, t);
- i || o.addEventListener(e, n, !0), Re.access(o, t, (i || 0) + 1)
- },
- teardown: function() {
- var o = this.ownerDocument || this,
- i = Re.access(o, t) - 1;
- i ? Re.access(o, t, i) : (o.removeEventListener(e, n, !0), Re.remove(o, t))
- }
- }
- });
- var Dt = e.location,
- $t = Date.now(),
- At = /\?/;
- xe.parseXML = function(t) {
- var n;
- if (!t || "string" != typeof t) return null;
- try {
- n = (new e.DOMParser).parseFromString(t, "text/xml")
- } catch (e) {
- n = void 0
- }
- return n && !n.getElementsByTagName("parsererror").length || xe.error("Invalid XML: " + t), n
- };
- var Et = /\[\]$/,
- St = /\r?\n/g,
- Lt = /^(?:submit|button|image|reset|file)$/i,
- Pt = /^(?:input|select|textarea|keygen)/i;
- xe.param = function(e, t) {
- var n, o = [],
- i = function(e, t) {
- var n = ve(t) ? t() : t;
- o[o.length] = encodeURIComponent(e) + "=" + encodeURIComponent(null == n ? "" : n)
- };
- if (Array.isArray(e) || e.jquery && !xe.isPlainObject(e)) xe.each(e, function() {
- i(this.name, this.value)
- });
- else
- for (n in e) J(n, e[n], t, i);
- return o.join("&")
- }, xe.fn.extend({
- serialize: function() {
- return xe.param(this.serializeArray())
- },
- serializeArray: function() {
- return this.map(function() {
- var e = xe.prop(this, "elements");
- return e ? xe.makeArray(e) : this
- }).filter(function() {
- var e = this.type;
- return this.name && !xe(this).is(":disabled") && Pt.test(this.nodeName) && !Lt.test(e) && (this.checked || !Ve.test(e))
- }).map(function(e, t) {
- var n = xe(this).val();
- return null == n ? null : Array.isArray(n) ? xe.map(n, function(e) {
- return {
- name: t.name,
- value: e.replace(St, "\r\n")
- }
- }) : {
- name: t.name,
- value: n.replace(St, "\r\n")
- }
- }).get()
- }
- });
- var It = /%20/g,
- Ot = /#.*$/,
- Nt = /([?&])_=[^&]*/,
- qt = /^(.*?):[ \t]*([^\r\n]*)$/gm,
- Rt = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
- Ht = /^(?:GET|HEAD)$/,
- Ut = /^\/\//,
- Bt = {},
- Ft = {},
- Wt = "*/".concat("*"),
- Xt = re.createElement("a");
- Xt.href = Dt.href, xe.extend({
- active: 0,
- lastModified: {},
- etag: {},
- ajaxSettings: {
- url: Dt.href,
- type: "GET",
- isLocal: Rt.test(Dt.protocol),
- global: !0,
- processData: !0,
- async: !0,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- accepts: {
- "*": Wt,
- 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": JSON.parse,
- "text xml": xe.parseXML
- },
- flatOptions: {
- url: !0,
- context: !0
- }
- },
- ajaxSetup: function(e, t) {
- return t ? ne(ne(e, xe.ajaxSettings), t) : ne(xe.ajaxSettings, e)
- },
- ajaxPrefilter: ee(Bt),
- ajaxTransport: ee(Ft),
- ajax: function(t, n) {
- function o(t, n, o, l) {
- var c, p, h, w, x, _ = n;
- u || (u = !0, s && e.clearTimeout(s), i = void 0, r = l || "", j.readyState = t > 0 ? 4 : 0, c = t >= 200 && t < 300 || 304 === t, o && (w = oe(f, j, o)), w = ie(f, w, j, c), c ? (f.ifModified && ((x = j.getResponseHeader("Last-Modified")) && (xe.lastModified[a] = x), (x = j.getResponseHeader("etag")) && (xe.etag[a] = x)), 204 === t || "HEAD" === f.type ? _ = "nocontent" : 304 === t ? _ = "notmodified" : (_ = w.state, p = w.data, c = !(h = w.error))) : (h = _, !t && _ || (_ = "error", t < 0 && (t = 0))), j.status = t, j.statusText = (n || _) + "", c ? g.resolveWith(b, [p, _, j]) : g.rejectWith(b, [j, _, h]), j.statusCode(y), y = void 0, d && m.trigger(c ? "ajaxSuccess" : "ajaxError", [j, f, c ? p : h]), v.fireWith(b, [j, _]), d && (m.trigger("ajaxComplete", [j, f]), --xe.active || xe.event.trigger("ajaxStop")))
- }
- "object" == typeof t && (n = t, t = void 0), n = n || {};
- var i, a, r, l, s, c, u, d, p, h, f = xe.ajaxSetup({}, n),
- b = f.context || f,
- m = f.context && (b.nodeType || b.jquery) ? xe(b) : xe.event,
- g = xe.Deferred(),
- v = xe.Callbacks("once memory"),
- y = f.statusCode || {},
- w = {},
- x = {},
- _ = "canceled",
- j = {
- readyState: 0,
- getResponseHeader: function(e) {
- var t;
- if (u) {
- if (!l)
- for (l = {}; t = qt.exec(r);) l[t[1].toLowerCase()] = t[2];
- t = l[e.toLowerCase()]
- }
- return null == t ? null : t
- },
- getAllResponseHeaders: function() {
- return u ? r : null
- },
- setRequestHeader: function(e, t) {
- return null == u && (e = x[e.toLowerCase()] = x[e.toLowerCase()] || e, w[e] = t), this
- },
- overrideMimeType: function(e) {
- return null == u && (f.mimeType = e), this
- },
- statusCode: function(e) {
- var t;
- if (e)
- if (u) j.always(e[j.status]);
- else
- for (t in e) y[t] = [y[t], e[t]];
- return this
- },
- abort: function(e) {
- var t = e || _;
- return i && i.abort(t), o(0, t), this
- }
- };
- if (g.promise(j), f.url = ((t || f.url || Dt.href) + "").replace(Ut, Dt.protocol + "//"), f.type = n.method || n.type || f.method || f.type, f.dataTypes = (f.dataType || "*").toLowerCase().match(Se) || [""], null == f.crossDomain) {
- c = re.createElement("a");
- try {
- c.href = f.url, c.href = c.href, f.crossDomain = Xt.protocol + "//" + Xt.host != c.protocol + "//" + c.host
- } catch (e) {
- f.crossDomain = !0
- }
- }
- if (f.data && f.processData && "string" != typeof f.data && (f.data = xe.param(f.data, f.traditional)), te(Bt, f, n, j), u) return j;
- (d = xe.event && f.global) && 0 == xe.active++ && xe.event.trigger("ajaxStart"), f.type = f.type.toUpperCase(), f.hasContent = !Ht.test(f.type), a = f.url.replace(Ot, ""), f.hasContent ? f.data && f.processData && 0 === (f.contentType || "").indexOf("application/x-www-form-urlencoded") && (f.data = f.data.replace(It, "+")) : (h = f.url.slice(a.length), f.data && (f.processData || "string" == typeof f.data) && (a += (At.test(a) ? "&" : "?") + f.data, delete f.data), !1 === f.cache && (a = a.replace(Nt, "$1"), h = (At.test(a) ? "&" : "?") + "_=" + $t++ + h), f.url = a + h), f.ifModified && (xe.lastModified[a] && j.setRequestHeader("If-Modified-Since", xe.lastModified[a]), xe.etag[a] && j.setRequestHeader("If-None-Match", xe.etag[a])), (f.data && f.hasContent && !1 !== f.contentType || n.contentType) && j.setRequestHeader("Content-Type", f.contentType), j.setRequestHeader("Accept", f.dataTypes[0] && f.accepts[f.dataTypes[0]] ? f.accepts[f.dataTypes[0]] + ("*" !== f.dataTypes[0] ? ", " + Wt + "; q=0.01" : "") : f.accepts["*"]);
- for (p in f.headers) j.setRequestHeader(p, f.headers[p]);
- if (f.beforeSend && (!1 === f.beforeSend.call(b, j, f) || u)) return j.abort();
- if (_ = "abort", v.add(f.complete), j.done(f.success), j.fail(f.error), i = te(Ft, f, n, j)) {
- if (j.readyState = 1, d && m.trigger("ajaxSend", [j, f]), u) return j;
- f.async && f.timeout > 0 && (s = e.setTimeout(function() {
- j.abort("timeout")
- }, f.timeout));
- try {
- u = !1, i.send(w, o)
- } catch (e) {
- if (u) throw e;
- o(-1, e)
- }
- } else o(-1, "No Transport");
- return j
- },
- getJSON: function(e, t, n) {
- return xe.get(e, t, n, "json")
- },
- getScript: function(e, t) {
- return xe.get(e, void 0, t, "script")
- }
- }), xe.each(["get", "post"], function(e, t) {
- xe[t] = function(e, n, o, i) {
- return ve(n) && (i = i || o, o = n, n = void 0), xe.ajax(xe.extend({
- url: e,
- type: t,
- dataType: i,
- data: n,
- success: o
- }, xe.isPlainObject(e) && e))
- }
- }), xe._evalUrl = function(e) {
- return xe.ajax({
- url: e,
- type: "GET",
- dataType: "script",
- cache: !0,
- async: !1,
- global: !1,
- throws: !0
- })
- }, xe.fn.extend({
- wrapAll: function(e) {
- var t;
- return this[0] && (ve(e) && (e = e.call(this[0])), t = xe(e, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function() {
- for (var e = this; e.firstElementChild;) e = e.firstElementChild;
- return e
- }).append(this)), this
- },
- wrapInner: function(e) {
- return ve(e) ? this.each(function(t) {
- xe(this).wrapInner(e.call(this, t))
- }) : this.each(function() {
- var t = xe(this),
- n = t.contents();
- n.length ? n.wrapAll(e) : t.append(e)
- })
- },
- wrap: function(e) {
- var t = ve(e);
- return this.each(function(n) {
- xe(this).wrapAll(t ? e.call(this, n) : e)
- })
- },
- unwrap: function(e) {
- return this.parent(e).not("body").each(function() {
- xe(this).replaceWith(this.childNodes)
- }), this
- }
- }), xe.expr.pseudos.hidden = function(e) {
- return !xe.expr.pseudos.visible(e)
- }, xe.expr.pseudos.visible = function(e) {
- return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length)
- }, xe.ajaxSettings.xhr = function() {
- try {
- return new e.XMLHttpRequest
- } catch (e) {}
- };
- var zt = {
- 0: 200,
- 1223: 204
- },
- Yt = xe.ajaxSettings.xhr();
- ge.cors = !!Yt && "withCredentials" in Yt, ge.ajax = Yt = !!Yt, xe.ajaxTransport(function(t) {
- var n, o;
- if (ge.cors || Yt && !t.crossDomain) return {
- send: function(i, a) {
- var r, l = t.xhr();
- if (l.open(t.type, t.url, t.async, t.username, t.password), t.xhrFields)
- for (r in t.xhrFields) l[r] = t.xhrFields[r];
- t.mimeType && l.overrideMimeType && l.overrideMimeType(t.mimeType), t.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");
- for (r in i) l.setRequestHeader(r, i[r]);
- n = function(e) {
- return function() {
- n && (n = o = l.onload = l.onerror = l.onabort = l.ontimeout = l.onreadystatechange = null, "abort" === e ? l.abort() : "error" === e ? "number" != typeof l.status ? a(0, "error") : a(l.status, l.statusText) : a(zt[l.status] || l.status, l.statusText, "text" !== (l.responseType || "text") || "string" != typeof l.responseText ? {
- binary: l.response
- } : {
- text: l.responseText
- }, l.getAllResponseHeaders()))
- }
- }, l.onload = n(), o = l.onerror = l.ontimeout = n("error"), void 0 !== l.onabort ? l.onabort = o : l.onreadystatechange = function() {
- 4 === l.readyState && e.setTimeout(function() {
- n && o()
- })
- }, n = n("abort");
- try {
- l.send(t.hasContent && t.data || null)
- } catch (e) {
- if (n) throw e
- }
- },
- abort: function() {
- n && n()
- }
- }
- }), xe.ajaxPrefilter(function(e) {
- e.crossDomain && (e.contents.script = !1)
- }), xe.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 xe.globalEval(e), e
- }
- }
- }), xe.ajaxPrefilter("script", function(e) {
- void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET")
- }), xe.ajaxTransport("script", function(e) {
- if (e.crossDomain) {
- var t, n;
- return {
- send: function(o, i) {
- t = xe("<script>").prop({
- charset: e.scriptCharset,
- src: e.url
- }).on("load error", n = function(e) {
- t.remove(), n = null, e && i("error" === e.type ? 404 : 200, e.type)
- }), re.head.appendChild(t[0])
- },
- abort: function() {
- n && n()
- }
- }
- }
- });
- var Kt = [],
- Vt = /(=)\?(?=&|$)|\?\?/;
- xe.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var e = Kt.pop() || xe.expando + "_" + $t++;
- return this[e] = !0, e
- }
- }), xe.ajaxPrefilter("json jsonp", function(t, n, o) {
- var i, a, r, l = !1 !== t.jsonp && (Vt.test(t.url) ? "url" : "string" == typeof t.data && 0 === (t.contentType || "").indexOf("application/x-www-form-urlencoded") && Vt.test(t.data) && "data");
- if (l || "jsonp" === t.dataTypes[0]) return i = t.jsonpCallback = ve(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, l ? t[l] = t[l].replace(Vt, "$1" + i) : !1 !== t.jsonp && (t.url += (At.test(t.url) ? "&" : "?") + t.jsonp + "=" + i), t.converters["script json"] = function() {
- return r || xe.error(i + " was not called"), r[0]
- }, t.dataTypes[0] = "json", a = e[i], e[i] = function() {
- r = arguments
- }, o.always(function() {
- void 0 === a ? xe(e).removeProp(i) : e[i] = a, t[i] && (t.jsonpCallback = n.jsonpCallback, Kt.push(i)), r && ve(a) && a(r[0]), r = a = void 0
- }), "script"
- }), ge.createHTMLDocument = function() {
- var e = re.implementation.createHTMLDocument("").body;
- return e.innerHTML = "<form></form><form></form>", 2 === e.childNodes.length
- }(), xe.parseHTML = function(e, t, n) {
- if ("string" != typeof e) return [];
- "boolean" == typeof t && (n = t, t = !1);
- var o, i, a;
- return t || (ge.createHTMLDocument ? ((o = (t = re.implementation.createHTMLDocument("")).createElement("base")).href = re.location.href, t.head.appendChild(o)) : t = re), i = Ce.exec(e), a = !n && [], i ? [t.createElement(i[1])] : (i = j([e], t, a), a && a.length && xe(a).remove(), xe.merge([], i.childNodes))
- }, xe.fn.load = function(e, t, n) {
- var o, i, a, r = this,
- l = e.indexOf(" ");
- return l > -1 && (o = G(e.slice(l)), e = e.slice(0, l)), ve(t) ? (n = t, t = void 0) : t && "object" == typeof t && (i = "POST"), r.length > 0 && xe.ajax({
- url: e,
- type: i || "GET",
- dataType: "html",
- data: t
- }).done(function(e) {
- a = arguments, r.html(o ? xe("<div>").append(xe.parseHTML(e)).find(o) : e)
- }).always(n && function(e, t) {
- r.each(function() {
- n.apply(this, a || [e.responseText, t, e])
- })
- }), this
- }, xe.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(e, t) {
- xe.fn[t] = function(e) {
- return this.on(t, e)
- }
- }), xe.expr.pseudos.animated = function(e) {
- return xe.grep(xe.timers, function(t) {
- return e === t.elem
- }).length
- }, xe.offset = {
- setOffset: function(e, t, n) {
- var o, i, a, r, l, s, c = xe.css(e, "position"),
- u = xe(e),
- d = {};
- "static" === c && (e.style.position = "relative"), l = u.offset(), a = xe.css(e, "top"), s = xe.css(e, "left"), ("absolute" === c || "fixed" === c) && (a + s).indexOf("auto") > -1 ? (r = (o = u.position()).top, i = o.left) : (r = parseFloat(a) || 0, i = parseFloat(s) || 0), ve(t) && (t = t.call(e, n, xe.extend({}, l))), null != t.top && (d.top = t.top - l.top + r), null != t.left && (d.left = t.left - l.left + i), "using" in t ? t.using.call(e, d) : u.css(d)
- }
- }, xe.fn.extend({
- offset: function(e) {
- if (arguments.length) return void 0 === e ? this : this.each(function(t) {
- xe.offset.setOffset(this, e, t)
- });
- var t, n, o = this[0];
- return o ? o.getClientRects().length ? (t = o.getBoundingClientRect(), n = o.ownerDocument.defaultView, {
- top: t.top + n.pageYOffset,
- left: t.left + n.pageXOffset
- }) : {
- top: 0,
- left: 0
- } : void 0
- },
- position: function() {
- if (this[0]) {
- var e, t, n, o = this[0],
- i = {
- top: 0,
- left: 0
- };
- if ("fixed" === xe.css(o, "position")) t = o.getBoundingClientRect();
- else {
- for (t = this.offset(), n = o.ownerDocument, e = o.offsetParent || n.documentElement; e && (e === n.body || e === n.documentElement) && "static" === xe.css(e, "position");) e = e.parentNode;
- e && e !== o && 1 === e.nodeType && ((i = xe(e).offset()).top += xe.css(e, "borderTopWidth", !0), i.left += xe.css(e, "borderLeftWidth", !0))
- }
- return {
- top: t.top - i.top - xe.css(o, "marginTop", !0),
- left: t.left - i.left - xe.css(o, "marginLeft", !0)
- }
- }
- },
- offsetParent: function() {
- return this.map(function() {
- for (var e = this.offsetParent; e && "static" === xe.css(e, "position");) e = e.offsetParent;
- return e || et
- })
- }
- }), xe.each({
- scrollLeft: "pageXOffset",
- scrollTop: "pageYOffset"
- }, function(e, t) {
- var n = "pageYOffset" === t;
- xe.fn[e] = function(o) {
- return Ie(this, function(e, o, i) {
- var a;
- if (ye(e) ? a = e : 9 === e.nodeType && (a = e.defaultView), void 0 === i) return a ? a[t] : e[o];
- a ? a.scrollTo(n ? a.pageXOffset : i, n ? i : a.pageYOffset) : e[o] = i
- }, e, o, arguments.length)
- }
- }), xe.each(["top", "left"], function(e, t) {
- xe.cssHooks[t] = O(ge.pixelPosition, function(e, n) {
- if (n) return n = I(e, t), st.test(n) ? xe(e).position()[t] + "px" : n
- })
- }), xe.each({
- Height: "height",
- Width: "width"
- }, function(e, t) {
- xe.each({
- padding: "inner" + e,
- content: t,
- "": "outer" + e
- }, function(n, o) {
- xe.fn[o] = function(i, a) {
- var r = arguments.length && (n || "boolean" != typeof i),
- l = n || (!0 === i || !0 === a ? "margin" : "border");
- return Ie(this, function(t, n, i) {
- var a;
- return ye(t) ? 0 === o.indexOf("outer") ? t["inner" + e] : t.document.documentElement["client" + e] : 9 === t.nodeType ? (a = t.documentElement, Math.max(t.body["scroll" + e], a["scroll" + e], t.body["offset" + e], a["offset" + e], a["client" + e])) : void 0 === i ? xe.css(t, n, l) : xe.style(t, n, i, l)
- }, t, r ? i : void 0, r)
- }
- })
- }), xe.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function(e, t) {
- xe.fn[t] = function(e, n) {
- return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
- }
- }), xe.fn.extend({
- hover: function(e, t) {
- return this.mouseenter(e).mouseleave(t || e)
- }
- }), xe.fn.extend({
- bind: function(e, t, n) {
- return this.on(e, null, t, n)
- },
- unbind: function(e, t) {
- return this.off(e, null, t)
- },
- delegate: function(e, t, n, o) {
- return this.on(t, e, n, o)
- },
- undelegate: function(e, t, n) {
- return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n)
- }
- }), xe.proxy = function(e, t) {
- var n, o, i;
- if ("string" == typeof t && (n = e[t], t = e, e = n), ve(e)) return o = se.call(arguments, 2), i = function() {
- return e.apply(t || this, o.concat(se.call(arguments)))
- }, i.guid = e.guid = e.guid || xe.guid++, i
- }, xe.holdReady = function(e) {
- e ? xe.readyWait++ : xe.ready(!0)
- }, xe.isArray = Array.isArray, xe.parseJSON = JSON.parse, xe.nodeName = a, xe.isFunction = ve, xe.isWindow = ye, xe.camelCase = f, xe.type = o, xe.now = Date.now, xe.isNumeric = function(e) {
- var t = xe.type(e);
- return ("number" === t || "string" === t) && !isNaN(e - parseFloat(e))
- }, "function" == typeof define && define.amd && define("jquery", [], function() {
- return xe
- });
- var Gt = e.jQuery,
- Qt = e.$;
- return xe.noConflict = function(t) {
- return e.$ === xe && (e.$ = Qt), t && e.jQuery === xe && (e.jQuery = Gt), xe
- }, t || (e.jQuery = e.$ = xe), xe
- }),
- function(e, t, n) {
- function o(e, t, n) {
- e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent("on" + t, n)
- }
- function i(e) {
- if ("keypress" == e.type) {
- var t = String.fromCharCode(e.which);
- return e.shiftKey || (t = t.toLowerCase()), t
- }
- return d[e.which] ? d[e.which] : p[e.which] ? p[e.which] : String.fromCharCode(e.which).toLowerCase()
- }
- function a(e) {
- var t = [];
- return e.shiftKey && t.push("shift"), e.altKey && t.push("alt"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), t
- }
- function r(e) {
- return "shift" == e || "ctrl" == e || "alt" == e || "meta" == e
- }
- function l(e, t) {
- var n, o = [],
- i = e;
- for ("+" === i ? i = ["+"] : (i = i.replace(/\+{2}/g, "+plus"), i = i.split("+")), n = 0; n < i.length; ++n) {
- var a = i[n];
- f[a] && (a = f[a]), t && "keypress" != t && h[a] && (a = h[a], o.push("shift")), r(a) && o.push(a)
- }
- if (i = a, !(n = t)) {
- if (!u) {
- u = {};
- for (var l in d) 95 < l && 112 > l || d.hasOwnProperty(l) && (u[d[l]] = l)
- }
- n = u[i] ? "keydown" : "keypress"
- }
- return "keypress" == n && o.length && (n = "keydown"), {
- key: a,
- modifiers: o,
- action: n
- }
- }
- function s(e, n) {
- return null !== e && e !== t && (e === n || s(e.parentNode, n))
- }
- function c(e) {
- function n(e) {
- e = e || {};
- var t, n = !1;
- for (t in m) e[t] ? n = !0 : m[t] = 0;
- n || (y = !1)
- }
- function s(e, t, n, o, i, a) {
- var l, s = [],
- c = n.type;
- if (!f._callbacks[e]) return [];
- for ("keyup" == c && r(e) && (t = [e]), l = 0; l < f._callbacks[e].length; ++l) {
- var u = f._callbacks[e][l];
- if ((o || !u.seq || m[u.seq] == u.level) && c == u.action) {
- var d;
- (d = "keypress" == c && !n.metaKey && !n.ctrlKey) || (d = u.modifiers, d = t.sort().join(",") === d.sort().join(",")), d && (d = o && u.seq == o && u.level == a, (!o && u.combo == i || d) && f._callbacks[e].splice(l, 1), s.push(u))
- }
- }
- return s
- }
- function u(e, t, n, o) {
- f.stopCallback(t, t.target || t.srcElement, n, o) || !1 !== e(t, n) || (t.preventDefault ? t.preventDefault() : t.returnValue = !1, t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0)
- }
- function d(e) {
- "number" != typeof e.which && (e.which = e.keyCode);
- var t = i(e);
- t && ("keyup" == e.type && g === t ? g = !1 : f.handleKey(t, a(e), e))
- }
- function p(e, t, o, a) {
- function r(t) {
- u(o, t, e), "keyup" !== a && (g = i(t)), setTimeout(n, 10)
- }
- for (var s = m[e] = 0; s < t.length; ++s) {
- var c = s + 1 === t.length ? r : function(t) {
- return function() {
- y = t, ++m[e], clearTimeout(b), b = setTimeout(n, 1e3)
- }
- }(a || l(t[s + 1]).action);
- h(t[s], c, a, e, s)
- }
- }
- function h(e, t, n, o, i) {
- f._directMap[e + ":" + n] = t, e = e.replace(/\s+/g, " ");
- var a = e.split(" ");
- 1 < a.length ? p(e, a, t, n) : (n = l(e, n), f._callbacks[n.key] = f._callbacks[n.key] || [], s(n.key, n.modifiers, {
- type: n.action
- }, o, e, i), f._callbacks[n.key][o ? "unshift" : "push"]({
- callback: t,
- modifiers: n.modifiers,
- action: n.action,
- seq: o,
- level: i,
- combo: e
- }))
- }
- var f = this;
- if (e = e || t, !(f instanceof c)) return new c(e);
- f.target = e, f._callbacks = {}, f._directMap = {};
- var b, m = {},
- g = !1,
- v = !1,
- y = !1;
- f._handleKey = function(e, t, o) {
- var i, a = s(e, t, o);
- t = {};
- var l = 0,
- c = !1;
- for (i = 0; i < a.length; ++i) a[i].seq && (l = Math.max(l, a[i].level));
- for (i = 0; i < a.length; ++i) a[i].seq ? a[i].level == l && (c = !0, t[a[i].seq] = 1, u(a[i].callback, o, a[i].combo, a[i].seq)) : c || u(a[i].callback, o, a[i].combo);
- a = "keypress" == o.type && v, o.type != y || r(e) || a || n(t), v = c && "keydown" == o.type
- }, f._bindMultiple = function(e, t, n) {
- for (var o = 0; o < e.length; ++o) h(e[o], t, n)
- }, o(e, "keypress", d), o(e, "keydown", d), o(e, "keyup", d)
- }
- if (e) {
- var u, d = {
- 8: "backspace",
- 9: "tab",
- 13: "enter",
- 16: "shift",
- 17: "ctrl",
- 18: "alt",
- 20: "capslock",
- 27: "esc",
- 32: "space",
- 33: "pageup",
- 34: "pagedown",
- 35: "end",
- 36: "home",
- 37: "left",
- 38: "up",
- 39: "right",
- 40: "down",
- 45: "ins",
- 46: "del",
- 91: "meta",
- 93: "meta",
- 224: "meta"
- },
- p = {
- 106: "*",
- 107: "+",
- 109: "-",
- 110: ".",
- 111: "/",
- 186: ";",
- 187: "=",
- 188: ",",
- 189: "-",
- 190: ".",
- 191: "/",
- 192: "`",
- 219: "[",
- 220: "\\",
- 221: "]",
- 222: "'"
- },
- h = {
- "~": "`",
- "!": "1",
- "@": "2",
- "#": "3",
- $: "4",
- "%": "5",
- "^": "6",
- "&": "7",
- "*": "8",
- "(": "9",
- ")": "0",
- _: "-",
- "+": "=",
- ":": ";",
- '"': "'",
- "<": ",",
- ">": ".",
- "?": "/",
- "|": "\\"
- },
- f = {
- option: "alt",
- command: "meta",
- return: "enter",
- escape: "esc",
- plus: "+",
- mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
- };
- for (n = 1; 20 > n; ++n) d[111 + n] = "f" + n;
- for (n = 0; 9 >= n; ++n) d[n + 96] = n.toString();
- c.prototype.bind = function(e, t, n) {
- return e = e instanceof Array ? e : [e], this._bindMultiple.call(this, e, t, n), this
- }, c.prototype.unbind = function(e, t) {
- return this.bind.call(this, e, function() {}, t)
- }, c.prototype.trigger = function(e, t) {
- return this._directMap[e + ":" + t] && this._directMap[e + ":" + t]({}, e), this
- }, c.prototype.reset = function() {
- return this._callbacks = {}, this._directMap = {}, this
- }, c.prototype.stopCallback = function(e, t) {
- return !(-1 < (" " + t.className + " ").indexOf(" mousetrap ") || s(t, this.target)) && ("INPUT" == t.tagName || "SELECT" == t.tagName || "TEXTAREA" == t.tagName || t.isContentEditable)
- }, c.prototype.handleKey = function() {
- return this._handleKey.apply(this, arguments)
- }, c.addKeycodes = function(e) {
- for (var t in e) e.hasOwnProperty(t) && (d[t] = e[t]);
- u = null
- }, c.init = function() {
- var e, n = c(t);
- for (e in n) "_" !== e.charAt(0) && (c[e] = function(e) {
- return function() {
- return n[e].apply(n, arguments)
- }
- }(e))
- }, c.init(), e.Mousetrap = c, "undefined" != typeof module && module.exports && (module.exports = c), "function" == typeof define && define.amd && define(function() {
- return c
- })
- }
- }("undefined" != typeof window ? window : null, "undefined" != typeof window ? document : null),
- function(e) {
- var t = {},
- n = e.prototype.stopCallback;
- e.prototype.stopCallback = function(e, o, i, a) {
- return !!this.paused || !t[i] && !t[a] && n.call(this, e, o, i)
- }, e.prototype.bindGlobal = function(e, n, o) {
- if (this.bind(e, n, o), e instanceof Array)
- for (n = 0; n < e.length; n++) t[e[n]] = !0;
- else t[e] = !0
- }, e.init()
- }(Mousetrap),
- function(e, t) {
- "undefined" != typeof module && module.exports ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : window.basicContext = t()
- }(0, function() {
- var e = null,
- t = "item",
- n = "separator",
- o = function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? "" : arguments[0];
- return document.querySelector(".basicContext " + e)
- },
- i = function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0];
- return !0 == (0 === Object.keys(e).length) && (e.type = n), null == e.type && (e.type = t), null == e.class && (e.class = ""), !1 !== e.visible && (e.visible = !0), null == e.icon && (e.icon = null), null == e.title && (e.title = "Undefined"), !0 !== e.disabled && (e.disabled = !1), !0 === e.disabled && (e.class += " basicContext__item--disabled"), null != e.fn || e.type === n || !1 !== e.disabled || (console.warn("Missing fn for item '" + e.title + "'"), !1)
- },
- a = function(e, o) {
- var a = "",
- r = "";
- return !1 === i(e) ? "" : !1 === e.visible ? "" : (e.num = o, null !== e.icon && (r = "<span class='basicContext__icon " + e.icon + "'></span>"), e.type === t ? a = "\n\t\t <tr class='basicContext__item " + e.class + "'>\n\t\t <td class='basicContext__data' data-num='" + e.num + "'>" + r + e.title + "</td>\n\t\t </tr>\n\t\t " : e.type === n && (a = "\n\t\t <tr class='basicContext__item basicContext__item--separator'></tr>\n\t\t "), a)
- },
- r = function(e) {
- var t = "";
- return t += "\n\t <div class='basicContextContainer'>\n\t <div class='basicContext'>\n\t <table>\n\t <tbody>\n\t ", e.forEach(function(e, n) {
- return t += a(e, n)
- }), t += "\n\t </tbody>\n\t </table>\n\t </div>\n\t </div>\n\t "
- },
- l = function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0],
- t = {
- x: e.clientX,
- y: e.clientY
- };
- if ("touchend" === e.type && (null == t.x || null == t.y)) {
- var n = e.changedTouches;
- null != n && n.length > 0 && (t.x = n[0].clientX, t.y = n[0].clientY)
- }
- return (null == t.x || t.x < 0) && (t.x = 0), (null == t.y || t.y < 0) && (t.y = 0), t
- },
- s = function(e, t) {
- var n = l(e),
- o = n.x,
- i = n.y,
- a = {
- width: window.innerWidth,
- height: window.innerHeight
- },
- r = {
- width: t.offsetWidth,
- height: t.offsetHeight
- };
- return o + r.width > a.width && (o -= o + r.width - a.width), i + r.height > a.height && (i -= i + r.height - a.height), r.height > a.height && (i = 0, t.classList.add("basicContext--scrollable")), {
- x: o,
- y: i,
- rx: n.x - o,
- ry: n.y - i
- }
- },
- c = function() {
- var e = arguments.length <= 0 || void 0 === arguments[0] ? {} : arguments[0];
- return null != e.fn && (!1 !== e.visible && (!0 !== e.disabled && (o("td[data-num='" + e.num + "']").onclick = e.fn, o("td[data-num='" + e.num + "']").oncontextmenu = e.fn, !0)))
- },
- u = function(t, n, i, a) {
- var l = r(t);
- document.body.insertAdjacentHTML("beforeend", l), null == e && (e = document.body.style.overflow, document.body.style.overflow = "hidden");
- var u = o(),
- d = s(n, u);
- return u.style.left = d.x + "px", u.style.top = d.y + "px", u.style.transformOrigin = d.rx + "px " + d.ry + "px", u.style.opacity = 1, null == i && (i = p), u.parentElement.onclick = i, u.parentElement.oncontextmenu = i, t.forEach(c), "function" == typeof n.preventDefault && n.preventDefault(), "function" == typeof n.stopPropagation && n.stopPropagation(), "function" == typeof a && a(), !0
- },
- d = function() {
- var e = o();
- return null != e && 0 !== e.length
- },
- p = function() {
- if (!1 === d()) return !1;
- var t = document.querySelector(".basicContextContainer");
- return t.parentElement.removeChild(t), null != e && (document.body.style.overflow = e, e = null), !0
- };
- return {
- ITEM: t,
- SEPARATOR: n,
- show: u,
- visible: d,
- close: p
- }
- }),
- function(e) {
- if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
- else if ("function" == typeof define && define.amd) define([], e);
- else {
- var t;
- t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.basicModal = e()
- }
- }(function() {
- return function e(t, n, o) {
- function i(r, l) {
- if (!n[r]) {
- if (!t[r]) {
- var s = "function" == typeof require && require;
- if (!l && s) return s(r, !0);
- if (a) return a(r, !0);
- var c = new Error("Cannot find module '" + r + "'");
- throw c.code = "MODULE_NOT_FOUND", c
- }
- var u = n[r] = {
- exports: {}
- };
- t[r][0].call(u.exports, function(e) {
- return i(t[r][1][e] || e)
- }, u, u.exports, e, t, n, o)
- }
- return n[r].exports
- }
- for (var a = "function" == typeof require && require, r = 0; r < o.length; r++) i(o[r]);
- return i
- }({
- 1: [function(e, t, n) {
- "use strict";
- Object.defineProperty(n, "__esModule", {
- value: !0
- });
- var o = null,
- i = (n.THEME = {
- small: "basicModal__small",
- xclose: "basicModal__xclose"
- }, function() {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
- return !0 === (arguments.length > 1 && void 0 !== arguments[1] && arguments[1]) ? document.querySelectorAll(".basicModal " + e) : document.querySelector(".basicModal " + e)
- }),
- a = function(e, t) {
- return null != e && (e.constructor === Object ? Array.prototype.forEach.call(Object.keys(e), function(n) {
- return t(e[n], n, e)
- }) : Array.prototype.forEach.call(e, function(n, o) {
- return t(n, o, e)
- }))
- },
- r = function(e) {
- return null == e || 0 === Object.keys(e).length ? (console.error("Missing or empty modal configuration object"), !1) : (null == e.body && (e.body = ""), null == e.class && (e.class = ""), !1 !== e.closable && (e.closable = !0), null == e.buttons ? (console.error("basicModal requires at least one button"), !1) : null != e.buttons.action && (null == e.buttons.action.class && (e.buttons.action.class = ""), null == e.buttons.action.title && (e.buttons.action.title = "OK"), null == e.buttons.action.fn) ? (console.error("Missing fn for action-button"), !1) : null == e.buttons.cancel || (null == e.buttons.cancel.class && (e.buttons.cancel.class = ""), null == e.buttons.cancel.title && (e.buttons.cancel.title = "Cancel"), null != e.buttons.cancel.fn) || (console.error("Missing fn for cancel-button"), !1))
- },
- l = function(e) {
- var t = "";
- return t += "\n\t <div class='basicModalContainer basicModalContainer--fadeIn' data-closable='" + e.closable + "'>\n\t <div class='basicModal basicModal--fadeIn " + e.class + "' role=\"dialog\">\n\t <div class='basicModal__content'>\n\t " + e.body + "\n\t </div>\n\t <div class='basicModal__buttons'>\n\t ", null != e.buttons.cancel && (-1 === e.buttons.cancel.class.indexOf("basicModal__xclose") ? t += "<a id='basicModal__cancel' class='basicModal__button " + e.buttons.cancel.class + "'>" + e.buttons.cancel.title + "</a>" : t += "<div id='basicModal__cancel' class='basicModal__button " + e.buttons.cancel.class + '\' aria-label=\'close\'><svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M405 136.798l-29.798-29.798-119.202 119.202-119.202-119.202-29.798 29.798 119.202 119.202-119.202 119.202 29.798 29.798 119.202-119.202 119.202 119.202 29.798-29.798-119.202-119.202z"/></svg></div>'), null != e.buttons.action && (t += "<a id='basicModal__action' class='basicModal__button " + e.buttons.action.class + "'>" + e.buttons.action.title + "</a>"), t += "\n\t </div>\n\t </div>\n\t </div>\n\t "
- },
- s = n.getValues = function() {
- var e = {},
- t = i("input[name]", !0),
- n = i("select[name]", !0);
- return a(t, function(t) {
- var n = t.getAttribute("name"),
- o = t.value;
- e[n] = o
- }), a(n, function(t) {
- var n = t.getAttribute("name"),
- o = t.options[t.selectedIndex].value;
- e[n] = o
- }), 0 === Object.keys(e).length ? null : e
- },
- c = function(e) {
- return null != e.buttons.cancel && (i("#basicModal__cancel").onclick = function() {
- if (!0 === this.classList.contains("basicModal__button--active")) return !1;
- this.classList.add("basicModal__button--active"), e.buttons.cancel.fn()
- }), null != e.buttons.action && (i("#basicModal__action").onclick = function() {
- if (!0 === this.classList.contains("basicModal__button--active")) return !1;
- this.classList.add("basicModal__button--active"), e.buttons.action.fn(s())
- }), a(i("input", !0), function(e) {
- e.oninput = e.onblur = function() {
- this.classList.remove("error")
- }
- }), a(i("select", !0), function(e) {
- e.onchange = e.onblur = function() {
- this.classList.remove("error")
- }
- }), !0
- },
- u = (n.show = function e(t) {
- if (!1 === r(t)) return !1;
- if (null != i()) return p(!0), setTimeout(function() {
- return e(t)
- }, 301), !1;
- o = document.activeElement;
- var n = l(t);
- document.body.insertAdjacentHTML("beforeend", n), c(t);
- var a = i("input");
- null != a && a.select();
- var s = i("select");
- return null == a && null != s && s.focus(), null != t.callback && t.callback(t), !0
- }, n.error = function(e) {
- d();
- var t = i("input[name='" + e + "']") || i("select[name='" + e + "']");
- if (null == t) return !1;
- t.classList.add("error"), "function" == typeof t.select ? t.select() : t.focus(), i().classList.remove("basicModal--fadeIn", "basicModal--shake"), setTimeout(function() {
- return i().classList.add("basicModal--shake")
- }, 1)
- }, n.visible = function() {
- return null != i()
- }),
- d = (n.action = function() {
- var e = i("#basicModal__action");
- return null != e && (e.click(), !0)
- }, n.cancel = function() {
- var e = i("#basicModal__cancel");
- return null != e && (e.click(), !0)
- }, n.reset = function() {
- var e = i(".basicModal__button", !0);
- a(e, function(e) {
- return e.classList.remove("basicModal__button--active")
- });
- var t = i("input", !0);
- a(t, function(e) {
- return e.classList.remove("error")
- });
- var n = i("select", !0);
- return a(n, function(e) {
- return e.classList.remove("error")
- }), !0
- }),
- p = n.close = function() {
- var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
- if (!1 === u()) return !1;
- var t = i().parentElement;
- return ("false" !== t.getAttribute("data-closable") || !1 !== e) && (t.classList.remove("basicModalContainer--fadeIn"), t.classList.add("basicModalContainer--fadeOut"), setTimeout(function() {
- return null != t && null != t.parentElement && void t.parentElement.removeChild(t)
- }, 300), null != o && (o.focus(), o = null), !0)
- }
- }, {}]
- }, {}, [1])(1)
- });
- var _templateObject = _taggedTemplateLiteral(["<p>Are you sure you want to delete the album '$", "' and all of the photos it contains? This action can't be undone!</p>"], ["<p>Are you sure you want to delete the album '$", "' and all of the photos it contains? This action can't be undone!</p>"]),
- _templateObject2 = _taggedTemplateLiteral(["<p>Are you sure you want to delete all $", " selected albums and all of the photos they contain? This action can't be undone!</p>"], ["<p>Are you sure you want to delete all $", " selected albums and all of the photos they contain? This action can't be undone!</p>"]),
- _templateObject3 = _taggedTemplateLiteral(["<input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='$", "'>"], ["<input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='$", "'>"]),
- _templateObject4 = _taggedTemplateLiteral(["<p>Enter a new title for this album: ", "</p>"], ["<p>Enter a new title for this album: ", "</p>"]),
- _templateObject5 = _taggedTemplateLiteral(["<p>Enter a title for all $", " selected albums: ", "</p>"], ["<p>Enter a title for all $", " selected albums: ", "</p>"]),
- _templateObject6 = _taggedTemplateLiteral(["<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$", "'></p>"], ["<p>Please enter a description for this album: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$", "'></p>"]),
- _templateObject7 = _taggedTemplateLiteral(["<p>Are you sure you want to merge the album '$", "' into the album '$", "'?</p>"], ["<p>Are you sure you want to merge the album '$", "' into the album '$", "'?</p>"]),
- _templateObject8 = _taggedTemplateLiteral(["<p>Are you sure you want to merge all selected albums into the album '$", "'?</p>"], ["<p>Are you sure you want to merge all selected albums into the album '$", "'?</p>"]),
- _templateObject9 = _taggedTemplateLiteral(["<svg class='iconic $", "'><use xlink:href='#$", "' /></svg>"], ["<svg class='iconic $", "'><use xlink:href='#$", "' /></svg>"]),
- _templateObject10 = _taggedTemplateLiteral(["<div class='divider'><h1>$", "</h1></div>"], ["<div class='divider'><h1>$", "</h1></div>"]),
- _templateObject11 = _taggedTemplateLiteral(["<div id='$", "' class='edit'>", "</div>"], ["<div id='$", "' class='edit'>", "</div>"]),
- _templateObject12 = _taggedTemplateLiteral(["<div id='multiselect' style='top: $", "px; left: $", "px;'></div>"], ["<div id='multiselect' style='top: $", "px; left: $", "px;'></div>"]),
- _templateObject13 = _taggedTemplateLiteral(["\n\t <div class='album' data-id='$", "'>\n\t <img src='$", "' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n\t <img src='$", "' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n\t <img src='$", "' srcset='$", " 1.5x' width='200' height='200' alt='Photo thumbnail' data-overlay='$", "' draggable='false'>\n\t <div class='overlay'>\n\t <h1 title='$", "'>$", "</h1>\n\t <a>$", "</a>\n\t </div>\n\t "], ["\n\t <div class='album' data-id='$", "'>\n\t <img src='$", "' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n\t <img src='$", "' width='200' height='200' alt='Photo thumbnail' data-overlay='false' draggable='false'>\n\t <img src='$", "' srcset='$", " 1.5x' width='200' height='200' alt='Photo thumbnail' data-overlay='$", "' draggable='false'>\n\t <div class='overlay'>\n\t <h1 title='$", "'>$", "</h1>\n\t <a>$", "</a>\n\t </div>\n\t "]),
- _templateObject14 = _taggedTemplateLiteral(["\n\t\t <div class='badges'>\n\t\t <a class='badge $", " icn-star'>", "</a>\n\t\t <a class='badge $", " icn-share'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t </div>\n\t\t "], ["\n\t\t <div class='badges'>\n\t\t <a class='badge $", " icn-star'>", "</a>\n\t\t <a class='badge $", " icn-share'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t <a class='badge $", "'>", "</a>\n\t\t </div>\n\t\t "]),
- _templateObject15 = _taggedTemplateLiteral(["\n\t <div class='photo' data-album-id='$", "' data-id='$", "'>\n\t <img src='$", "' srcset='$", " 1.5x' width='200' height='200' alt='Photo thumbnail' draggable='false'>\n\t <div class='overlay'>\n\t <h1 title='$", "'>$", "</h1>\n\t "], ["\n\t <div class='photo' data-album-id='$", "' data-id='$", "'>\n\t <img src='$", "' srcset='$", " 1.5x' width='200' height='200' alt='Photo thumbnail' draggable='false'>\n\t <div class='overlay'>\n\t <h1 title='$", "'>$", "</h1>\n\t "]),
- _templateObject16 = _taggedTemplateLiteral(["<a><span title='Camera Date'>", "</span>$", "</a>"], ["<a><span title='Camera Date'>", "</span>$", "</a>"]),
- _templateObject17 = _taggedTemplateLiteral(["<a>$", "</a>"], ["<a>$", "</a>"]),
- _templateObject18 = _taggedTemplateLiteral(["\n\t\t <div class='badges'>\n\t\t <a class='badge $", " icn-star'>", "</a>\n\t\t <a class='badge $", " icn-share'>", "</a>\n\t\t </div>\n\t\t "], ["\n\t\t <div class='badges'>\n\t\t <a class='badge $", " icn-star'>", "</a>\n\t\t <a class='badge $", " icn-share'>", "</a>\n\t\t </div>\n\t\t "]),
- _templateObject19 = _taggedTemplateLiteral(["<img id='image' class='$", "' src='$", "' draggable='false'>"], ["<img id='image' class='$", "' src='$", "' draggable='false'>"]),
- _templateObject20 = _taggedTemplateLiteral(["<img id='image' class='$", "' src='$", "' srcset='$", " 1920w, $", " $", "w' draggable='false'>"], ["<img id='image' class='$", "' src='$", "' srcset='$", " 1920w, $", " $", "w' draggable='false'>"]),
- _templateObject21 = _taggedTemplateLiteral(["\n\t <h1>$", "</h1>\n\t <div class='rows'>\n\t "], ["\n\t <h1>$", "</h1>\n\t <div class='rows'>\n\t "]),
- _templateObject22 = _taggedTemplateLiteral(["\n\t\t <div class='row'>\n\t\t <a class='name'>$", "</a>\n\t\t <a class='status'></a>\n\t\t <p class='notice'></p>\n\t\t </div>\n\t\t "], ["\n\t\t <div class='row'>\n\t\t <a class='name'>$", "</a>\n\t\t <a class='status'></a>\n\t\t <p class='notice'></p>\n\t\t </div>\n\t\t "]),
- _templateObject23 = _taggedTemplateLiteral(["<a class='tag'>$", "<span data-index='$", "'>", "</span></a>"], ["<a class='tag'>$", "<span data-index='$", "'>", "</span></a>"]),
- _templateObject24 = _taggedTemplateLiteral(["<img class='cover' width='16' height='16' src='$", "'><div class='title'>$", "</div>"], ["<img class='cover' width='16' height='16' src='$", "'><div class='title'>$", "</div>"]),
- _templateObject25 = _taggedTemplateLiteral(["$", "", ""], ["$", "", ""]),
- _templateObject26 = _taggedTemplateLiteral(["\n\t <p class='signIn'>\n\t <input class='text' name='username' autocomplete='username' type='text' placeholder='username' autocapitalize='off' autocorrect='off'>\n\t <input class='text' name='password' autocomplete='current-password' type='password' placeholder='password'>\n\t </p>\n\t <p class='version'>Lychee $", "<span> – <a target='_blank' href='$", "'>Update available!</a><span></p>\n\t "], ["\n\t <p class='signIn'>\n\t <input class='text' name='username' autocomplete='username' type='text' placeholder='username' autocapitalize='off' autocorrect='off'>\n\t <input class='text' name='password' autocomplete='current-password' type='password' placeholder='password'>\n\t </p>\n\t <p class='version'>Lychee $", "<span> – <a target='_blank' href='$", "'>Update available!</a><span></p>\n\t "]),
- _templateObject27 = _taggedTemplateLiteral(["<p>Are you sure you want to delete the photo '$", "'? This action can't be undone!</p>"], ["<p>Are you sure you want to delete the photo '$", "'? This action can't be undone!</p>"]),
- _templateObject28 = _taggedTemplateLiteral(["<p>Are you sure you want to delete all $", " selected photo? This action can't be undone!</p>"], ["<p>Are you sure you want to delete all $", " selected photo? This action can't be undone!</p>"]),
- _templateObject29 = _taggedTemplateLiteral(["<p>Enter a new title for this photo: ", "</p>"], ["<p>Enter a new title for this photo: ", "</p>"]),
- _templateObject30 = _taggedTemplateLiteral(["<p>Enter a title for all $", " selected photos: ", "</p>"], ["<p>Enter a title for all $", " selected photos: ", "</p>"]),
- _templateObject31 = _taggedTemplateLiteral(["<p>Enter a description for this photo: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$", "'></p>"], ["<p>Enter a description for this photo: <input class='text' name='description' type='text' maxlength='800' placeholder='Description' value='$", "'></p>"]),
- _templateObject32 = _taggedTemplateLiteral(["<input class='text' name='tags' type='text' maxlength='800' placeholder='Tags' value='$", "'>"], ["<input class='text' name='tags' type='text' maxlength='800' placeholder='Tags' value='$", "'>"]),
- _templateObject33 = _taggedTemplateLiteral(["<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: ", "</p>"], ["<p>Enter your tags for this photo. You can add multiple tags by separating them with a comma: ", "</p>"]),
- _templateObject34 = _taggedTemplateLiteral(["<p>Enter your tags for all $", " selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: ", "</p>"], ["<p>Enter your tags for all $", " selected photos. Existing tags will be overwritten. You can add multiple tags by separating them with a comma: ", "</p>"]),
- _templateObject35 = _taggedTemplateLiteral(["\n\t <p>\n\t In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below:\n\t <input class='text' name='key' type='text' placeholder='Dropbox API Key' value='$", "'>\n\t </p>\n\t "], ["\n\t <p>\n\t In order to import photos from your Dropbox, you need a valid drop-ins app key from <a href='https://www.dropbox.com/developers/apps/create'>their website</a>. Generate yourself a personal key and enter it below:\n\t <input class='text' name='key' type='text' placeholder='Dropbox API Key' value='$", "'>\n\t </p>\n\t "]),
- _templateObject36 = _taggedTemplateLiteral(["<span class='attr_$", "'>$", "</span>"], ["<span class='attr_$", "'>$", "</span>"]),
- _templateObject37 = _taggedTemplateLiteral(["\n\t\t\t <tr>\n\t\t\t <td>$", "</td>\n\t\t\t <td>", "</td>\n\t\t\t </tr>\n\t\t\t "], ["\n\t\t\t <tr>\n\t\t\t <td>$", "</td>\n\t\t\t <td>", "</td>\n\t\t\t </tr>\n\t\t\t "]),
- _templateObject38 = _taggedTemplateLiteral(["\n\t\t <div class='sidebar__divider'>\n\t\t <h1>$", "</h1>\n\t\t </div>\n\t\t <div id='tags'>\n\t\t <div class='attr_$", "'>", "</div>\n\t\t ", "\n\t\t </div>\n\t\t "], ["\n\t\t <div class='sidebar__divider'>\n\t\t <h1>$", "</h1>\n\t\t </div>\n\t\t <div id='tags'>\n\t\t <div class='attr_$", "'>", "</div>\n\t\t ", "\n\t\t </div>\n\t\t "]),
- _templateObject39 = _taggedTemplateLiteral(["<p>Please enter the direct link to a photo to import it: <input class='text' name='link' type='text' placeholder='http://' value='$", "'></p>"], ["<p>Please enter the direct link to a photo to import it: <input class='text' name='link' type='text' placeholder='http://' value='$", "'></p>"]),
- _templateObject40 = _taggedTemplateLiteral(["<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='$", "uploads/import/'></p>"], ["<p>This action will import all photos, folders and sub-folders which are located in the following directory. The <b>original files will be deleted</b> after the import when possible. <input class='text' name='path' type='text' maxlength='100' placeholder='Absolute path to directory' value='$", "uploads/import/'></p>"]),
- _templateObject41 = _taggedTemplateLiteral(['linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$', '")'], ['linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, .4)), url("$', '")']);
- ! function(e) {
- var t = function(t) {
- var n = this;
- this.el = e(t), this.pos = {
- start: {
- x: 0,
- y: 0
- },
- end: {
- x: 0,
- y: 0
- }
- }, this.startTime, t.on("touchstart", function(e) {
- n.touchStart(e)
- }), t.on("touchmove", function(e) {
- n.touchMove(e)
- }), t.on("touchend", function(e) {
- n.swipeEnd()
- }), t.on("mousedown", function(e) {
- n.mouseDown(e)
- })
- };
- t.prototype = {
- touchStart: function(e) {
- var t = e.originalEvent.touches[0];
- this.swipeStart(e, t.pageX, t.pageY)
- },
- touchMove: function(e) {
- var t = e.originalEvent.touches[0];
- this.swipeMove(e, t.pageX, t.pageY)
- },
- mouseDown: function(e) {
- var t = this;
- this.swipeStart(e, e.pageX, e.pageY), this.el.on("mousemove", function(e) {
- t.mouseMove(e)
- }), this.el.on("mouseup", function() {
- t.mouseUp()
- })
- },
- mouseMove: function(e) {
- this.swipeMove(e, e.pageX, e.pageY)
- },
- mouseUp: function(e) {
- this.swipeEnd(e), this.el.off("mousemove"), this.el.off("mouseup")
- },
- swipeStart: function(e, t, n) {
- this.pos.start.x = t, this.pos.start.y = n, this.pos.end.x = t, this.pos.end.y = n, this.startTime = (new Date).getTime(), this.trigger("swipeStart", e)
- },
- swipeMove: function(e, t, n) {
- this.pos.end.x = t, this.pos.end.y = n, this.trigger("swipeMove", e)
- },
- swipeEnd: function(e) {
- this.trigger("swipeEnd", e)
- },
- trigger: function(t, n) {
- var o = this,
- i = e.Event(t),
- a = o.pos.start.x - o.pos.end.x,
- r = o.pos.end.y - o.pos.start.y,
- l = Math.atan2(r, a),
- s = "up",
- c = Math.round(Math.sqrt(Math.pow(a, 2) + Math.pow(r, 2))),
- u = Math.round(180 * l / Math.PI),
- d = Math.round(c / ((new Date).getTime() - o.startTime) * 1e3);
- u < 0 && (u = 360 - Math.abs(u)), u <= 45 && u >= 0 || u <= 360 && u >= 315 ? s = "left" : u >= 135 && u <= 225 ? s = "right" : u > 45 && u < 135 && (s = "down"), i.originalEvent = n, i.swipe = {
- x: a,
- y: r,
- direction: s,
- distance: c,
- angle: u,
- speed: d
- }, e(o.el).trigger(i)
- }
- }, e.fn.swipe = function() {
- new t(this);
- return this
- }
- }(jQuery), album = {
- json: null
- }, album.getID = function() {
- var e = null,
- t = function(e) {
- return "0" === e || "f" === e || "s" === e || "r" === e || $.isNumeric(e)
- };
- return photo.json ? e = photo.json.album : album.json && (e = album.json.id), !1 === t(e) && (e = $(".album:hover, .album.active").attr("data-id")), !1 === t(e) && (e = $(".photo:hover, .photo.active").attr("data-album-id")), !0 === t(e) && e
- }, album.load = function(e) {
- var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
- password.get(e, function() {
- !1 === t && lychee.animate(".content", "contentZoomOut");
- var n = (new Date).getTime(),
- o = {
- albumID: e,
- password: password.value
- };
- api.post("Album::get", o, function(o) {
- var i = 0;
- if ("Warning: Album private!" === o) return void 0 != document.location.hash.replace("#", "").split("/")[1] ? lychee.setMode("view") : (lychee.content.show(), lychee.goto()), !1;
- if ("Warning: Wrong password!" === o) return album.load(e, t), !1;
- album.json = o;
- var a = (new Date).getTime() - n;
- i = a > 300 ? 0 : 300 - a, !0 === t && (i = 0), visible.albums() || visible.photo() || visible.album() || (i = 0), setTimeout(function() {
- view.album.init(), !1 === t && (lychee.animate(lychee.content, "contentZoomIn"), header.setMode("album"))
- }, i)
- })
- })
- }, album.parse = function() {
- album.json.title || (album.json.title = "Untitled")
- }, album.add = function() {
- var e = function(e) {
- var t = e.title,
- n = function(e) {
- return !isNaN(parseFloat(e)) && isFinite(e)
- };
- basicModal.close();
- var o = {
- title: t
- };
- api.post("Album::add", o, function(e) {
- !1 !== e && n(e) ? (albums.refresh(), lychee.goto(e)) : lychee.error(null, o, e)
- })
- };
- basicModal.show({
- body: "<p>Enter a title for the new album: <input class='text' name='title' type='text' maxlength='50' placeholder='Title' value='Untitled'></p>",
- buttons: {
- action: {
- title: "Create Album",
- fn: e
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- }, album.delete = function(e) {
- var t = {},
- n = {},
- o = "";
- if (!e) return !1;
- if (e instanceof Array == !1 && (e = [e]), t.fn = function() {
- basicModal.close();
- var t = {
- albumIDs: e.join()
- };
- api.post("Album::delete", t, function(n) {
- visible.albums() ? e.forEach(function(e) {
- albums.json.num--, view.albums.content.delete(e), albums.deleteByID(e)
- }) : (albums.refresh(), lychee.goto()), !0 !== n && lychee.error(null, t, n)
- })
- }, "0" === e.toString()) t.title = "Clear Unsorted", n.title = "Keep Unsorted", o = "<p>Are you sure you want to delete all photos from 'Unsorted'?<br>This action can't be undone!</p>";
- else if (1 === e.length) {
- var i = "";
- t.title = "Delete Album and Photos", n.title = "Keep Album", album.json ? i = album.json.title : albums.json && (i = albums.getByID(e).title), "" === i && (i = "Untitled"), o = lychee.html(_templateObject, i)
- } else t.title = "Delete Albums and Photos", n.title = "Keep Albums", o = lychee.html(_templateObject2, e.length);
- basicModal.show({
- body: o,
- buttons: {
- action: {
- title: t.title,
- fn: t.fn,
- class: "red"
- },
- cancel: {
- title: n.title,
- fn: basicModal.close
- }
- }
- })
- }, album.setTitle = function(e) {
- var t = "",
- n = "";
- if (!e) return !1;
- e instanceof Array == !1 && (e = [e]), 1 === e.length && (album.json ? t = album.json.title : albums.json && (t = albums.getByID(e).title));
- var o = function(t) {
- basicModal.close();
- var n = t.title;
- visible.album() ? (album.json.title = n, view.album.title(), albums.json && (albums.getByID(e[0]).title = n)) : visible.albums() && e.forEach(function(e) {
- albums.getByID(e).title = n, view.albums.content.title(e)
- });
- var o = {
- albumIDs: e.join(),
- title: n
- };
- api.post("Album::setTitle", o, function(e) {
- !0 !== e && lychee.error(null, o, e)
- })
- },
- i = lychee.html(_templateObject3, t);
- n = 1 === e.length ? lychee.html(_templateObject4, i) : lychee.html(_templateObject5, e.length, i), basicModal.show({
- body: n,
- buttons: {
- action: {
- title: "Set Title",
- fn: o
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- }, album.setDescription = function(e) {
- var t = album.json.description,
- n = function(t) {
- var n = t.description;
- basicModal.close(), visible.album() && (album.json.description = n, view.album.description());
- var o = {
- albumID: e,
- description: n
- };
- api.post("Album::setDescription", o, function(e) {
- !0 !== e && lychee.error(null, o, e)
- })
- };
- basicModal.show({
- body: lychee.html(_templateObject6, t),
- buttons: {
- action: {
- title: "Set Description",
- fn: n
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- }, album.setPublic = function(e, t, n) {
- var o = "";
- if (albums.refresh(), !0 === t) {
- var i = "",
- a = {};
- a.fn = function() {
- album.setPublic(album.getID(), !1, n)
- }, "1" === album.json.public ? (a.title = "Edit Sharing", i = "The sharing-properties of this album will be changed to the following:") : (a.title = "Share Album", i = "This album will be shared with the following properties:");
- var r = "\n\t\t <p class='less'>" + i + "</p>\n\t\t <form>\n\t\t <div class='choice'>\n\t\t <label>\n\t\t <input type='checkbox' name='hidden'>\n\t\t <span class='checkbox'>" + build.iconic("check") + "</span>\n\t\t <span class='label'>Hidden</span>\n\t\t </label>\n\t\t <p>Only people with the direct link can view this album.</p>\n\t\t </div>\n\t\t <div class='choice'>\n\t\t <label>\n\t\t <input type='checkbox' name='downloadable'>\n\t\t <span class='checkbox'>" + build.iconic("check") + "</span>\n\t\t <span class='label'>Downloadable</span>\n\t\t </label>\n\t\t <p>Visitors of your Lychee can download this album.</p>\n\t\t </div>\n\t\t <div class='choice'>\n\t\t <label>\n\t\t <input type='checkbox' name='password'>\n\t\t <span class='checkbox'>" + build.iconic("check") + "</span>\n\t\t <span class='label'>Password protected</span>\n\t\t </label>\n\t\t <p>Album only accessible with a valid password.</p>\n\t\t <input class='text' name='passwordtext' type='password' placeholder='password' value=''>\n\t\t </div>\n\t\t </form>\n\t\t ";
- return basicModal.show({
- body: r,
- buttons: {
- action: {
- title: a.title,
- fn: a.fn
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- }), "1" === album.json.public && "0" === album.json.visible && $('.basicModal .choice input[name="hidden"]').click(), "1" === album.json.downloadable && $('.basicModal .choice input[name="downloadable"]').click(), $('.basicModal .choice input[name="password"]').on("change", function() {
- !0 === $(this).prop("checked") ? $('.basicModal .choice input[name="passwordtext"]').show().focus() : $('.basicModal .choice input[name="passwordtext"]').hide()
- }), !0
- }
- basicModal.visible() ? (album.json.public = "1", 1 === $('.basicModal .choice input[name="hidden"]:checked').length ? album.json.visible = "0" : album.json.visible = "1", 1 === $('.basicModal .choice input[name="downloadable"]:checked').length ? album.json.downloadable = "1" : album.json.downloadable = "0", 1 === $('.basicModal .choice input[name="password"]:checked').length ? (o = $('.basicModal .choice input[name="passwordtext"]').val(), album.json.password = "1") : (o = "", album.json.password = "0"), basicModal.close()) : album.json.public = "0", visible.album() && (album.json.visible = "0" === album.json.public ? "1" : album.json.visible, album.json.downloadable = "0" === album.json.public ? "0" : album.json.downloadable, album.json.password = "0" === album.json.public ? "0" : album.json.password, view.album.public(), view.album.hidden(), view.album.downloadable(), view.album.password(), "1" === album.json.public && contextMenu.shareAlbum(e, n));
- var l = {
- albumID: e,
- public: album.json.public,
- password: o,
- visible: album.json.visible,
- downloadable: album.json.downloadable
- };
- api.post("Album::setPublic", l, function(e) {
- !0 !== e && lychee.error(null, l, e)
- })
- }, album.share = function(e) {
- var t = location.href;
- switch (e) {
- case "twitter":
- window.open("https://twitter.com/share?url=" + encodeURI(t));
- break;
- case "facebook":
- window.open("http://www.facebook.com/sharer.php?u=" + encodeURI(t) + "&t=" + encodeURI(album.json.title));
- break;
- case "mail":
- location.href = "mailto:?subject=" + encodeURI(album.json.title) + "&body=" + encodeURI(t)
- }
- }, album.getArchive = function(e) {
- var t = "",
- n = api.path + "?function=Album::getArchive&albumID=" + e;
- t = location.href.indexOf("index.html") > 0 ? location.href.replace(location.hash, "").replace("index.html", n) : location.href.replace(location.hash, "") + n, !0 === lychee.publicMode && (t += "&password=" + encodeURIComponent(password.value)), location.href = t
- }, album.merge = function(e) {
- var t = "",
- n = "",
- o = "";
- if (!e) return !1;
- e instanceof Array == !1 && (e = [e]), albums.json && (t = albums.getByID(e[0]).title), "" === t && (t = "Untitled"), 2 === e.length ? (albums.json && (n = albums.getByID(e[1]).title), "" === n && (n = "Untitled"), o = lychee.html(_templateObject7, n, t)) : o = lychee.html(_templateObject8, t);
- var i = function() {
- basicModal.close();
- var t = {
- albumIDs: e.join()
- };
- api.post("Album::merge", t, function(e) {
- !0 !== e ? lychee.error(null, t, e) : (albums.refresh(), lychee.goto())
- })
- };
- basicModal.show({
- body: o,
- buttons: {
- action: {
- title: "Merge Albums",
- fn: i,
- class: "red"
- },
- cancel: {
- title: "Don't Merge",
- fn: basicModal.close
- }
- }
- })
- }, albums = {
- json: null
- }, albums.load = function() {
- var e = (new Date).getTime();
- lychee.animate(".content", "contentZoomOut"), null === albums.json ? api.post("Albums::get", {}, function(t) {
- var n = 0;
- !1 === lychee.publicMode && albums._createSmartAlbums(t.smartalbums), albums.json = t;
- var o = (new Date).getTime() - e;
- n = o > 300 ? 0 : 300 - o, visible.albums() || visible.photo() || visible.album() || (n = 0), visible.album() && "" === lychee.content.html() && (n = 0), setTimeout(function() {
- header.setMode("albums"), view.albums.init(), lychee.animate(lychee.content, "contentZoomIn")
- }, n)
- }) : setTimeout(function() {
- header.setMode("albums"), view.albums.init(), lychee.animate(lychee.content, "contentZoomIn")
- }, 300)
- }, albums.parse = function(e) {
- "1" === e.password && !0 === lychee.publicMode ? (e.thumbs[0] = "src/images/password.svg", e.thumbs[1] = "src/images/password.svg", e.thumbs[2] = "src/images/password.svg") : (e.thumbs[0] || (e.thumbs[0] = "src/images/no_images.svg"), e.thumbs[1] || (e.thumbs[1] = "src/images/no_images.svg"), e.thumbs[2] || (e.thumbs[2] = "src/images/no_images.svg"))
- }, albums._createSmartAlbums = function(e) {
- e.unsorted = {
- id: 0,
- title: "Unsorted",
- sysdate: e.unsorted.num + " photos",
- unsorted: "1",
- thumbs: e.unsorted.thumbs
- }, e.starred = {
- id: "f",
- title: "Starred",
- sysdate: e.starred.num + " photos",
- star: "1",
- thumbs: e.starred.thumbs
- }, e.public = {
- id: "s",
- title: "Public",
- sysdate: e.public.num + " photos",
- public: "1",
- thumbs: e.public.thumbs
- }, e.recent = {
- id: "r",
- title: "Recent",
- sysdate: e.recent.num + " photos",
- recent: "1",
- thumbs: e.recent.thumbs
- }
- }, albums.getByID = function(e) {
- if (null != e && albums.json && albums.json.albums) {
- var t = void 0;
- return $.each(albums.json.albums, function(n) {
- var o = albums.json.albums[n];
- o.id == e && (t = o)
- }), t
- }
- }, albums.deleteByID = function(e) {
- if (null == e) return !1;
- if (!albums.json) return !1;
- if (!albums.json.albums) return !1;
- var t = !1;
- return $.each(albums.json.albums, function(n) {
- if (albums.json.albums[n].id == e) return albums.json.albums.splice(n, 1), t = !0, !1
- }), t
- }, albums.refresh = function() {
- albums.json = null
- }, api = {
- path: "php/index.php",
- onError: null
- }, api.post = function(e, t, n) {
- loadingBar.show(), t = $.extend({
- function: e
- }, t);
- var o = function(e) {
- if (setTimeout(loadingBar.hide, 100), "string" == typeof e && "Error: " === e.substring(0, 7)) return api.onError(e.substring(7, e.length), t, e), !1;
- n(e)
- },
- i = function(e, n, o) {
- api.onError("Server error or API not found.", t, o)
- };
- $.ajax({
- type: "POST",
- url: api.path,
- data: t,
- dataType: "json",
- success: o,
- error: i
- })
- }, build = {}, build.iconic = function(e) {
- var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
- n = "";
- return n += lychee.html(_templateObject9, t, e)
- }, build.divider = function(e) {
- var t = "";
- return t += lychee.html(_templateObject10, e)
- }, build.editIcon = function(e) {
- var t = "";
- return t += lychee.html(_templateObject11, e, build.iconic("pencil"))
- }, build.multiselect = function(e, t) {
- return lychee.html(_templateObject12, e, t)
- }, build.album = function(e) {
- var t = "",
- n = e.sysdate,
- o = lychee.retinize(e.thumbs[0]),
- i = o.path,
- a = o.isPhoto;
- return "" !== lychee.sortingAlbums && (sortingAlbums = lychee.sortingAlbums.replace("ORDER BY ", "").split(" "),
- "max_takestamp" !== sortingAlbums[0] && "min_takestamp" !== sortingAlbums[0] || (n = e.min_takestamp === e.max_takestamp ? e.max_takestamp : e.min_takestamp + " - " + e.max_takestamp)), t += lychee.html(_templateObject13, e.id, e.thumbs[2], e.thumbs[1], e.thumbs[0], i, a, e.title, e.title, n), !1 === lychee.publicMode && (t += lychee.html(_templateObject14, "1" === e.star ? "badge--visible" : "", build.iconic("star"), "1" === e.public ? "badge--visible" : "", build.iconic("eye"), "1" === e.unsorted ? "badge--visible" : "", build.iconic("list"), "1" === e.recent ? "badge--visible" : "", build.iconic("clock"), "1" === e.password ? "badge--visible" : "", build.iconic("lock-locked"))), t += "</div>"
- }, build.photo = function(e) {
- var t = "",
- n = lychee.retinize(e.thumbUrl),
- o = n.path;
- return t += lychee.html(_templateObject15, e.album, e.id, e.thumbUrl, o, e.title, e.title), "1" === e.cameraDate ? t += lychee.html(_templateObject16, build.iconic("camera-slr"), e.sysdate) : t += lychee.html(_templateObject17, e.sysdate), t += "</div>", !1 === lychee.publicMode && (t += lychee.html(_templateObject18, "1" === e.star ? "badge--visible" : "", build.iconic("star"), "1" === e.public && "1" !== album.json.public ? "badge--visible" : "", build.iconic("eye"))), t += "</div>"
- }, build.imageview = function(e, t) {
- var n = "";
- return n += !1 == ("" !== e.medium) ? lychee.html(_templateObject19, !0 === t ? "" : "full", e.url) : lychee.html(_templateObject20, !0 === t ? "" : "full", e.url, e.medium, e.url, e.width), n += "\n\t <div class='arrow_wrapper arrow_wrapper--previous'><a id='previous'>" + build.iconic("caret-left") + "</a></div>\n\t <div class='arrow_wrapper arrow_wrapper--next'><a id='next'>" + build.iconic("caret-right") + "</a></div>\n\t "
- }, build.no_content = function(e) {
- var t = "";
- switch (t += "\n\t <div class='no_content fadeIn'>\n\t " + build.iconic(e) + "\n\t ", e) {
- case "magnifying-glass":
- t += "<p>No results</p>";
- break;
- case "eye":
- t += "<p>No public albums</p>";
- break;
- case "cog":
- t += "<p>No configuration</p>";
- break;
- case "question-mark":
- t += "<p>Photo not found</p>"
- }
- return t += "</div>"
- }, build.uploadModal = function(e, t) {
- var n = "";
- n += lychee.html(_templateObject21, e);
- for (var o = 0; o < t.length;) {
- var i = t[o];
- i.name.length > 40 && (i.name = i.name.substr(0, 17) + "..." + i.name.substr(i.name.length - 20, 20)), n += lychee.html(_templateObject22, i.name), o++
- }
- return n += "</div>"
- }, build.tags = function(e) {
- var t = "";
- return "" !== e ? (e = e.split(","), e.forEach(function(e, n, o) {
- t += lychee.html(_templateObject23, e, n, build.iconic("x"))
- })) : t = "<div class='empty'>No Tags</div>", t
- }, contextMenu = {}, contextMenu.add = function(e) {
- var t = [{
- title: build.iconic("image") + "Upload Photo",
- fn: function() {
- return $("#upload_files").click()
- }
- }, {}, {
- title: build.iconic("link-intact") + "Import from Link",
- fn: upload.start.url
- }, {
- title: build.iconic("dropbox", "ionicons") + "Import from Dropbox",
- fn: upload.start.dropbox
- }, {
- title: build.iconic("terminal") + "Import from Server",
- fn: upload.start.server
- }, {}, {
- title: build.iconic("folder") + "New Album",
- fn: album.add
- }];
- basicContext.show(t, e.originalEvent), upload.notify()
- }, contextMenu.settings = function(e) {
- var t = [{
- title: build.iconic("person") + "Change Login",
- fn: settings.setLogin
- }, {
- title: build.iconic("sort-ascending") + "Change Sorting",
- fn: settings.setSorting
- }, {
- title: build.iconic("dropbox", "ionicons") + "Set Dropbox",
- fn: settings.setDropboxKey
- }, {}, {
- title: build.iconic("info") + "About Lychee",
- fn: function() {
- return window.open(lychee.website)
- }
- }, {
- title: build.iconic("wrench") + "Diagnostics",
- fn: function() {
- return window.open("plugins/Diagnostics/")
- }
- }, {
- title: build.iconic("align-left") + "Show Log",
- fn: function() {
- return window.open("plugins/Log/")
- }
- }, {}, {
- title: build.iconic("account-logout") + "Sign Out",
- fn: lychee.logout
- }];
- basicContext.show(t, e.originalEvent)
- }, contextMenu.album = function(e, t) {
- if ("0" === e || "f" === e || "s" === e || "r" === e) return !1;
- var n = albums.json && albums.json.albums && Object.keys(albums.json.albums).length > 1,
- o = [{
- title: build.iconic("pencil") + "Rename",
- fn: function() {
- return album.setTitle([e])
- }
- }, {
- title: build.iconic("collapse-left") + "Merge",
- visible: n,
- fn: function() {
- basicContext.close(), contextMenu.mergeAlbum(e, t)
- }
- }, {
- title: build.iconic("trash") + "Delete",
- fn: function() {
- return album.delete([e])
- }
- }];
- $('.album[data-id="' + e + '"]').addClass("active"), basicContext.show(o, t.originalEvent, contextMenu.close)
- }, contextMenu.albumMulti = function(e, t) {
- multiselect.stopResize();
- var n = e.length > 1,
- o = albums.json && albums.json.albums && Object.keys(albums.json.albums).length > 1,
- i = [{
- title: build.iconic("pencil") + "Rename All",
- fn: function() {
- return album.setTitle(e)
- }
- }, {
- title: build.iconic("collapse-left") + "Merge All",
- visible: o && n,
- fn: function() {
- return album.merge(e)
- }
- }, {
- title: build.iconic("collapse-left") + "Merge",
- visible: o && !n,
- fn: function() {
- basicContext.close(), contextMenu.mergeAlbum(e[0], t)
- }
- }, {
- title: build.iconic("trash") + "Delete All",
- fn: function() {
- return album.delete(e)
- }
- }];
- i.push(), basicContext.show(i, t.originalEvent, contextMenu.close)
- }, contextMenu.albumTitle = function(e, t) {
- api.post("Albums::get", {}, function(n) {
- var o = [];
- n.albums && n.num > 1 && ($.each(n.albums, function() {
- var t = this;
- this.thumbs[0] || (this.thumbs[0] = "src/images/no_cover.svg"), "" === this.title && (this.title = "Untitled");
- var n = lychee.html(_templateObject24, this.thumbs[0], this.title);
- this.id != e && o.push({
- title: n,
- fn: function() {
- return lychee.goto(t.id)
- }
- })
- }), o.unshift({})), o.unshift({
- title: build.iconic("pencil") + "Rename",
- fn: function() {
- return album.setTitle([e])
- }
- }), basicContext.show(o, t.originalEvent, contextMenu.close)
- })
- }, contextMenu.mergeAlbum = function(e, t) {
- api.post("Albums::get", {}, function(n) {
- var o = [];
- if (n.albums && n.num > 1 && $.each(n.albums, function() {
- var t = this;
- this.thumbs[0] || (this.thumbs[0] = "src/images/no_cover.svg"), "" === this.title && (this.title = "Untitled");
- var n = lychee.html(_templateObject24, this.thumbs[0], this.title);
- this.id != e && o.push({
- title: n,
- fn: function() {
- return album.merge([e, t.id])
- }
- })
- }), 0 === o.length) return !1;
- basicContext.show(o, t.originalEvent, contextMenu.close)
- })
- }, contextMenu.photo = function(e, t) {
- var n = [{
- title: build.iconic("star") + "Star",
- fn: function() {
- return photo.setStar([e])
- }
- }, {
- title: build.iconic("tag") + "Tags",
- fn: function() {
- return photo.editTags([e])
- }
- }, {}, {
- title: build.iconic("pencil") + "Rename",
- fn: function() {
- return photo.setTitle([e])
- }
- }, {
- title: build.iconic("layers") + "Duplicate",
- fn: function() {
- return photo.duplicate([e])
- }
- }, {
- title: build.iconic("folder") + "Move",
- fn: function() {
- basicContext.close(), contextMenu.move([e], t)
- }
- }, {
- title: build.iconic("trash") + "Delete",
- fn: function() {
- return photo.delete([e])
- }
- }];
- $('.photo[data-id="' + e + '"]').addClass("active"), basicContext.show(n, t.originalEvent, contextMenu.close)
- }, contextMenu.photoMulti = function(e, t) {
- multiselect.stopResize();
- var n = [{
- title: build.iconic("star") + "Star All",
- fn: function() {
- return photo.setStar(e)
- }
- }, {
- title: build.iconic("tag") + "Tag All",
- fn: function() {
- return photo.editTags(e)
- }
- }, {}, {
- title: build.iconic("pencil") + "Rename All",
- fn: function() {
- return photo.setTitle(e)
- }
- }, {
- title: build.iconic("layers") + "Duplicate All",
- fn: function() {
- return photo.duplicate(e)
- }
- }, {
- title: build.iconic("folder") + "Move All",
- fn: function() {
- basicContext.close(), contextMenu.move(e, t)
- }
- }, {
- title: build.iconic("trash") + "Delete All",
- fn: function() {
- return photo.delete(e)
- }
- }];
- basicContext.show(n, t.originalEvent, contextMenu.close)
- }, contextMenu.photoTitle = function(e, t, n) {
- var o = [{
- title: build.iconic("pencil") + "Rename",
- fn: function() {
- return photo.setTitle([t])
- }
- }],
- i = album.json;
- !1 !== i.content && i.num > 1 && (o.push({}), $.each(i.content, function(n) {
- var i = this;
- "" === this.title && (this.title = "Untitled");
- var a = lychee.html(_templateObject24, this.thumbUrl, this.title);
- this.id != t && o.push({
- title: a,
- fn: function() {
- return lychee.goto(e + "/" + i.id)
- }
- })
- })), basicContext.show(o, n.originalEvent, contextMenu.close)
- }, contextMenu.photoMore = function(e, t) {
- var n = !1 === lychee.publicMode || album.json && album.json.downloadable && "1" === album.json.downloadable && !0 === lychee.publicMode,
- o = [{
- title: build.iconic("fullscreen-enter") + "Full Photo",
- fn: function() {
- return window.open(photo.getDirectLink())
- }
- }, {
- title: build.iconic("cloud-download") + "Download",
- visible: n,
- fn: function() {
- return photo.getArchive(e)
- }
- }];
- basicContext.show(o, t.originalEvent)
- }, contextMenu.move = function(e, t) {
- var n = [];
- api.post("Albums::get", {}, function(o) {
- 0 === o.num ? n = [{
- title: "New Album",
- fn: album.add
- }] : ($.each(o.albums, function() {
- var t = this;
- this.thumbs[0] || (this.thumbs[0] = "src/images/no_cover.svg"), "" === this.title && (this.title = "Untitled");
- var o = lychee.html(_templateObject24, this.thumbs[0], this.title);
- this.id != album.getID() && n.push({
- title: o,
- fn: function() {
- return photo.setAlbum(e, t.id)
- }
- })
- }), "0" !== album.getID() && (n.unshift({}), n.unshift({
- title: "Unsorted",
- fn: function() {
- return photo.setAlbum(e, 0)
- }
- }))), basicContext.show(n, t.originalEvent, contextMenu.close)
- })
- }, contextMenu.sharePhoto = function(e, t) {
- var n = photo.getViewLink(e),
- o = [{
- title: '<input readonly id="link" value="' + n + '">',
- fn: function() {},
- class: "basicContext__item--noHover"
- }, {}, {
- title: build.iconic("twitter", "ionicons") + "Twitter",
- fn: function() {
- return photo.share(e, "twitter")
- }
- }, {
- title: build.iconic("facebook", "ionicons") + "Facebook",
- fn: function() {
- return photo.share(e, "facebook")
- }
- }, {
- title: build.iconic("envelope-closed") + "Mail",
- fn: function() {
- return photo.share(e, "mail")
- }
- }, {
- title: build.iconic("dropbox", "ionicons") + "Dropbox",
- visible: !1 === lychee.publicMode,
- fn: function() {
- return photo.share(e, "dropbox")
- }
- }, {
- title: build.iconic("link-intact") + "Direct Link",
- fn: function() {
- return window.open(photo.getDirectLink())
- }
- }, {}, {
- title: build.iconic("ban") + "Make Private",
- visible: !1 === lychee.publicMode,
- fn: function() {
- return photo.setPublic(e)
- }
- }];
- !0 === lychee.publicMode && o.splice(7, 1), basicContext.show(o, t.originalEvent), $(".basicContext input#link").focus().select()
- }, contextMenu.shareAlbum = function(e, t) {
- var n = [{
- title: '<input readonly id="link" value="' + location.href + '">',
- fn: function() {},
- class: "basicContext__item--noHover"
- }, {}, {
- title: build.iconic("twitter", "ionicons") + "Twitter",
- fn: function() {
- return album.share("twitter")
- }
- }, {
- title: build.iconic("facebook", "ionicons") + "Facebook",
- fn: function() {
- return album.share("facebook")
- }
- }, {
- title: build.iconic("envelope-closed") + "Mail",
- fn: function() {
- return album.share("mail")
- }
- }, {}, {
- title: build.iconic("pencil") + "Edit Sharing",
- visible: !1 === lychee.publicMode,
- fn: function() {
- return album.setPublic(e, !0, t)
- }
- }, {
- title: build.iconic("ban") + "Make Private",
- visible: !1 === lychee.publicMode,
- fn: function() {
- return album.setPublic(e, !1)
- }
- }];
- !0 === lychee.publicMode && n.splice(5, 1), basicContext.show(n, t.originalEvent), $(".basicContext input#link").focus().select()
- }, contextMenu.close = function() {
- if (!visible.contextMenu()) return !1;
- basicContext.close(), $(".photo.active, .album.active").removeClass("active"), visible.multiselect() && multiselect.close()
- }, header = {
- _dom: $(".header")
- }, header.dom = function(e) {
- return null == e || "" === e ? header._dom : header._dom.find(e)
- }, header.bind = function() {
- var e = lychee.getEventName();
- return header.dom(".header__title").on(e, function(e) {
- if (!1 === $(this).hasClass("header__title--editable")) return !1;
- visible.photo() ? contextMenu.photoTitle(album.getID(), photo.getID(), e) : contextMenu.albumTitle(album.getID(), e)
- }), header.dom("#button_share").on(e, function(e) {
- "1" === photo.json.public || "2" === photo.json.public ? contextMenu.sharePhoto(photo.getID(), e) : photo.setPublic(photo.getID(), e)
- }), header.dom("#button_share_album").on(e, function(e) {
- "1" === album.json.public ? contextMenu.shareAlbum(album.getID(), e) : album.setPublic(album.getID(), !0, e)
- }), header.dom("#button_signin").on(e, lychee.loginDialog), header.dom("#button_settings").on(e, contextMenu.settings), header.dom("#button_info_album").on(e, sidebar.toggle), header.dom("#button_info").on(e, sidebar.toggle), header.dom(".button_add").on(e, contextMenu.add), header.dom("#button_more").on(e, function(e) {
- contextMenu.photoMore(photo.getID(), e)
- }), header.dom("#button_move").on(e, function(e) {
- contextMenu.move([photo.getID()], e)
- }), header.dom(".header__hostedwith").on(e, function() {
- window.open(lychee.website)
- }), header.dom("#button_trash_album").on(e, function() {
- album.delete([album.getID()])
- }), header.dom("#button_trash").on(e, function() {
- photo.delete([photo.getID()])
- }), header.dom("#button_archive").on(e, function() {
- album.getArchive(album.getID())
- }), header.dom("#button_star").on(e, function() {
- photo.setStar([photo.getID()])
- }), header.dom("#button_back_home").on(e, function() {
- lychee.goto()
- }), header.dom("#button_back").on(e, function() {
- lychee.goto(album.getID())
- }), header.dom(".header__search").on("keyup click", function() {
- search.find($(this).val())
- }), header.dom(".header__clear").on(e, function() {
- header.dom(".header__search").focus(), search.reset()
- }), !0
- }, header.show = function() {
- return lychee.imageview.removeClass("full"), header.dom().removeClass("header--hidden"), !0
- }, header.hide = function(e) {
- return !(!visible.photo() || visible.sidebar() || visible.contextMenu() || !1 !== basicModal.visible()) && (lychee.imageview.addClass("full"), header.dom().addClass("header--hidden"), !0)
- }, header.setTitle = function() {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "Untitled",
- t = header.dom(".header__title"),
- n = lychee.html(_templateObject25, e, build.iconic("caret-bottom"));
- return t.html(n), !0
- }, header.setMode = function(e) {
- switch ("albums" === e && !0 === lychee.publicMode && (e = "public"), e) {
- case "public":
- return header.dom().removeClass("header--view"), header.dom(".header__toolbar--albums, .header__toolbar--album, .header__toolbar--photo").removeClass("header__toolbar--visible"), header.dom(".header__toolbar--public").addClass("header__toolbar--visible"), !0;
- case "albums":
- return header.dom().removeClass("header--view"), header.dom(".header__toolbar--public, .header__toolbar--album, .header__toolbar--photo").removeClass("header__toolbar--visible"), header.dom(".header__toolbar--albums").addClass("header__toolbar--visible"), !0;
- case "album":
- var t = album.getID();
- return header.dom().removeClass("header--view"), header.dom(".header__toolbar--public, .header__toolbar--albums, .header__toolbar--photo").removeClass("header__toolbar--visible"), header.dom(".header__toolbar--album").addClass("header__toolbar--visible"), !1 === album.json.content ? $("#button_archive").hide() : $("#button_archive").show(), !0 === lychee.publicMode && "0" === album.json.downloadable && $("#button_archive").hide(), "s" === t || "f" === t || "r" === t ? $("#button_info_album, #button_trash_album, #button_share_album").hide() : "0" === t ? ($("#button_info_album, #button_share_album").hide(), $("#button_trash_album").show()) : $("#button_info_album, #button_trash_album, #button_share_album").show(), !0;
- case "photo":
- return header.dom().addClass("header--view"), header.dom(".header__toolbar--public, .header__toolbar--albums, .header__toolbar--album").removeClass("header__toolbar--visible"), header.dom(".header__toolbar--photo").addClass("header__toolbar--visible"), !0
- }
- return !1
- }, header.setEditable = function(e) {
- var t = header.dom(".header__title");
- return !0 === lychee.publicMode && (e = !1), e ? t.addClass("header__title--editable") : t.removeClass("header__title--editable"), !0
- }, $(document).ready(function() {
- var e = lychee.getEventName();
- api.onError = lychee.error, multiselect.bind(), header.bind(), lychee.imageview.on(e, ".arrow_wrapper--previous", photo.previous).on(e, ".arrow_wrapper--next", photo.next), Mousetrap.bind(["left"], function() {
- if (visible.photo()) return $("#imageview a#previous").click(), !1
- }).bind(["right"], function() {
- if (visible.photo()) return $("#imageview a#next").click(), !1
- }).bind(["u"], function() {
- if (!visible.photo()) return $("#upload_files").click(), !1
- }).bind(["s", "f"], function() {
- return visible.photo() ? (header.dom("#button_star").click(), !1) : visible.albums() ? (header.dom(".header__search").focus(), !1) : void 0
- }).bind(["r"], function() {
- return visible.album() ? (album.setTitle(album.getID()), !1) : visible.photo() ? (photo.setTitle([photo.getID()]), !1) : void 0
- }).bind(["d"], function() {
- return visible.photo() ? (photo.setDescription(photo.getID()), !1) : visible.album() ? (album.setDescription(album.getID()), !1) : void 0
- }).bind(["t"], function() {
- if (visible.photo()) return photo.editTags([photo.getID()]), !1
- }).bind(["i"], function() {
- if (!visible.multiselect()) return sidebar.toggle(), !1
- }).bind(["command+backspace", "ctrl+backspace"], function() {
- return visible.photo() && !1 === basicModal.visible() ? (photo.delete([photo.getID()]), !1) : visible.album() && !1 === basicModal.visible() ? (album.delete([album.getID()]), !1) : void 0
- }).bind(["command+a", "ctrl+a"], function() {
- return visible.album() && !1 === basicModal.visible() ? (multiselect.selectAll(), !1) : visible.albums() && !1 === basicModal.visible() ? (multiselect.selectAll(), !1) : void 0
- }), Mousetrap.bindGlobal("enter", function() {
- !0 === basicModal.visible() && basicModal.action()
- }), Mousetrap.bindGlobal(["esc", "command+up"], function() {
- return !0 === basicModal.visible() ? basicModal.cancel() : visible.contextMenu() ? contextMenu.close() : visible.photo() ? lychee.goto(album.getID()) : visible.album() ? lychee.goto() : visible.albums() && 0 !== header.dom(".header__search").val().length && search.reset(), !1
- }), "touchend" === e && $(document).on("touchend", "#imageview #image", function(e) {
- (null == swipe.obj || swipe.offset >= -5 && swipe.offset <= 5) && (visible.header() ? header.hide(e) : header.show())
- }).swipe().on("swipeStart", function() {
- visible.photo() && swipe.start($("#imageview #image"))
- }).swipe().on("swipeMove", function(e) {
- visible.photo() && swipe.move(e.swipe)
- }).swipe().on("swipeEnd", function(e) {
- visible.photo() && swipe.stop(e.swipe, photo.previous, photo.next)
- }), $(document).on("click", ".album", function() {
- lychee.goto($(this).attr("data-id"))
- }).on("click", ".photo", function() {
- lychee.goto(album.getID() + "/" + $(this).attr("data-id"))
- }).on("contextmenu", ".photo", function(e) {
- contextMenu.photo(photo.getID(), e)
- }).on("contextmenu", ".album", function(e) {
- contextMenu.album(album.getID(), e)
- }).on("change", "#upload_files", function() {
- basicModal.close(), upload.start.local(this.files)
- }).on("dragover", function() {
- return !1
- }, !1).on("drop", function(e) {
- return visible.photo() && lychee.goto(album.getID()), visible.contextMenu() && contextMenu.close(), e.originalEvent.dataTransfer.files.length > 0 ? upload.start.local(e.originalEvent.dataTransfer.files) : e.originalEvent.dataTransfer.getData("Text").length > 3 && upload.start.url(e.originalEvent.dataTransfer.getData("Text")), !1
- }), lychee.init()
- }), loadingBar = {
- status: null,
- _dom: $("#loading")
- }, loadingBar.dom = function(e) {
- return null == e || "" === e ? loadingBar._dom : loadingBar._dom.find(e)
- }, loadingBar.show = function(e, t) {
- return "error" === e ? (loadingBar.status = "error", t && (t = t.replace("<br>", "")), t || (t = "Whoops, it looks like something went wrong. Please reload the site and try again!"), visible.header() && header.dom().addClass("header--error"), loadingBar.dom().removeClass("loading uploading error").html("<h1>Error: <span>" + t + "</span></h1>").addClass(e).show(), clearTimeout(loadingBar._timeout), loadingBar._timeout = setTimeout(function() {
- return loadingBar.hide(!0)
- }, 3e3), !0) : null === loadingBar.status ? (loadingBar.status = "loading", clearTimeout(loadingBar._timeout), loadingBar._timeout = setTimeout(function() {
- visible.header() && header.dom().addClass("header--loading"), loadingBar.dom().removeClass("loading uploading error").html("").addClass("loading").show()
- }, 1e3), !0) : void 0
- }, loadingBar.hide = function(e) {
- ("error" !== loadingBar.status && null != loadingBar.status || e) && (loadingBar.status = null, header.dom().removeClass("header--error header--loading"), clearTimeout(loadingBar._timeout), setTimeout(function() {
- return loadingBar.dom().hide()
- }, 300))
- }, lychee = {
- title: document.title,
- version: "3.1.6",
- versionCode: "030106",
- updatePath: "//update.electerious.com/index.json",
- updateURL: "https://github.com/electerious/Lychee",
- website: "http://lychee.electerious.com",
- publicMode: !1,
- viewMode: !1,
- checkForUpdates: "1",
- sortingPhotos: "",
- sortingAlbums: "",
- location: "",
- dropbox: !1,
- dropboxKey: "",
- content: $(".content"),
- imageview: $("#imageview")
- }, lychee.init = function() {
- api.post("Session::init", {}, function(e) {
- if (2 === e.status) lychee.sortingPhotos = e.config.sortingPhotos || "", lychee.sortingAlbums = e.config.sortingAlbums || "", lychee.dropboxKey = e.config.dropboxKey || "", lychee.location = e.config.location || "", lychee.checkForUpdates = e.config.checkForUpdates || "1", !1 === e.config.login && settings.createLogin();
- else if (1 === e.status) lychee.checkForUpdates = e.config.checkForUpdates || "1", lychee.setMode("public");
- else if (0 === e.status) return lychee.setMode("public"), header.dom().hide(), lychee.content.hide(), $("body").append(build.no_content("cog")), settings.createConfig(), !0;
- $(window).bind("popstate", lychee.load), lychee.load()
- })
- }, lychee.login = function(e) {
- var t = e.username,
- n = e.password,
- o = {
- user: t,
- password: n
- };
- api.post("Session::login", o, function(e) {
- !0 === e ? window.location.reload() : basicModal.error("password")
- })
- }, lychee.loginDialog = function() {
- var e = lychee.html(_templateObject26, lychee.version, lychee.updateURL);
- basicModal.show({
- body: e,
- buttons: {
- action: {
- title: "Sign In",
- fn: lychee.login
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- }), "1" === lychee.checkForUpdates && lychee.getUpdate()
- }, lychee.logout = function() {
- api.post("Session::logout", {}, function() {
- window.location.reload()
- })
- }, lychee.goto = function() {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
- e = "#" + e, history.pushState(null, null, e), lychee.load()
- }, lychee.load = function() {
- var e = "",
- t = "",
- n = document.location.hash.replace("#", "").split("/");
- $(".no_content").remove(), contextMenu.close(), multiselect.close(), null != n[0] && (e = n[0]), null != n[1] && (t = n[1]), e && t ? (photo.json = null, ("" === lychee.content.html() || header.dom(".header__search").length && 0 !== header.dom(".header__search").val().length) && (lychee.content.hide(), album.load(e, !0)), photo.load(t, e)) : e ? (photo.json = null, visible.photo() && view.photo.hide(), !visible.sidebar() || "0" !== e && "f" !== e && "s" !== e && "r" !== e || sidebar.toggle(), album.json && e == album.json.id ? view.album.title() : album.load(e)) : (null != search.hash && (albums.json = null, search.hash = null), album.json = null, photo.json = null, visible.sidebar() && sidebar.toggle(), visible.photo() && view.photo.hide(), lychee.content.show(), albums.load())
- }, lychee.getUpdate = function() {
- var e = function(e) {
- e.lychee.version > parseInt(lychee.versionCode) && $(".version span").show()
- };
- $.ajax({
- url: lychee.updatePath,
- success: e
- })
- }, lychee.setTitle = function(e, t) {
- document.title = lychee.title + " - " + e, header.setEditable(t), header.setTitle(e)
- }, lychee.setMode = function(e) {
- $("#button_settings, #button_trash_album, .button_add, .header__divider").remove(), $("#button_trash, #button_move, #button_star").remove(), $("#button_share, #button_share_album").removeClass("button--eye").addClass("button--share").find("use").attr("xlink:href", "#share"), $(document).off("click", ".header__title--editable").off("touchend", ".header__title--editable").off("contextmenu", ".photo").off("contextmenu", ".album").off("drop"), Mousetrap.unbind(["u"]).unbind(["s"]).unbind(["f"]).unbind(["r"]).unbind(["d"]).unbind(["t"]).unbind(["command+backspace", "ctrl+backspace"]).unbind(["command+a", "ctrl+a"]), "public" === e ? lychee.publicMode = !0 : "view" === e && (Mousetrap.unbind(["esc", "command+up"]), $("#button_back, a#next, a#previous").remove(), $(".no_content").remove(), lychee.publicMode = !0, lychee.viewMode = !0)
- }, lychee.animate = function(e, t) {
- var n = [
- ["fadeIn", "fadeOut"],
- ["contentZoomIn", "contentZoomOut"]
- ];
- e.jQuery || (e = $(e));
- for (var o = 0; o < n.length; o++)
- for (var i = 0; i < n[o].length; i++)
- if (n[o][i] == t) return e.removeClass(n[o][0] + " " + n[o][1]).addClass(t), !0;
- return !1
- }, lychee.retinize = function() {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
- t = e.split(".").pop(),
- n = "svg" !== t;
- return !0 === n && (e = e.replace(/\.[^\/.]+$/, ""), e = e + "@2x." + t), {
- path: e,
- isPhoto: n
- }
- }, lychee.loadDropbox = function(e) {
- if (!1 === lychee.dropbox && null != lychee.dropboxKey && "" !== lychee.dropboxKey) {
- loadingBar.show();
- var t = document.createElement("script"),
- n = document.getElementsByTagName("script")[0];
- t.src = "https://www.dropbox.com/static/api/1/dropins.js", t.id = "dropboxjs", t.type = "text/javascript", t.async = "true", t.setAttribute("data-app-key", lychee.dropboxKey), t.onload = t.onreadystatechange = function() {
- var t = this.readyState;
- t && "complete" !== t && "loaded" !== t || (lychee.dropbox = !0, loadingBar.hide(), e())
- }, n.parentNode.insertBefore(t, n)
- } else !0 === lychee.dropbox && null != lychee.dropboxKey && "" !== lychee.dropboxKey ? e() : settings.setDropboxKey(e)
- }, lychee.getEventName = function() {
- return !0 === (/Android|iPhone|iPad|iPod/i.test(navigator.userAgent || navigator.vendor || window.opera) && "ontouchend" in document.documentElement) ? "touchend" : "click"
- }, lychee.escapeHTML = function() {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";
- return e += "", e = e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, "`")
- }, lychee.html = function(e) {
- for (var t = e.raw, n = "", o = arguments.length, i = Array(o > 1 ? o - 1 : 0), a = 1; a < o; a++) i[a - 1] = arguments[a];
- return i.forEach(function(e, o) {
- var i = t[o];
- "$" === i.slice(-1) && (e = lychee.escapeHTML(e), i = i.slice(0, -1)), n += i, n += e
- }), n += t[t.length - 1]
- }, lychee.error = function(e, t, n) {
- console.error({
- description: e,
- params: t,
- response: n
- }), loadingBar.show("error", e)
- }, multiselect = {}, multiselect.position = {
- top: null,
- right: null,
- bottom: null,
- left: null
- }, multiselect.bind = function() {
- return $(".content").on("mousedown", function(e) {
- 1 === e.which && multiselect.show(e)
- }), !0
- }, multiselect.show = function(e) {
- return !lychee.publicMode && (!(!visible.albums() && !visible.album()) && (0 === $(".album:hover, .photo:hover").length && (!visible.search() && (visible.multiselect() && $("#multiselect").remove(), sidebar.setSelectable(!1), multiselect.position.top = e.pageY, multiselect.position.right = -1 * (e.pageX - $(document).width()), multiselect.position.bottom = -1 * (multiselect.position.top - $(window).height()), multiselect.position.left = e.pageX, $("body").append(build.multiselect(multiselect.position.top, multiselect.position.left)), void $(document).on("mousemove", multiselect.resize).on("mouseup", function(e) {
- 1 === e.which && multiselect.getSelection(e)
- })))))
- }, multiselect.selectAll = function() {
- if (lychee.publicMode) return !1;
- if (visible.search()) return !1;
- if (!visible.albums() && !visible.album) return !1;
- visible.multiselect() && $("#multiselect").remove(), sidebar.setSelectable(!1), multiselect.position.top = 70, multiselect.position.right = 40, multiselect.position.bottom = 90, multiselect.position.left = 20, $("body").append(build.multiselect(multiselect.position.top, multiselect.position.left));
- var e = {
- width: $(document).width(),
- height: $(document).height()
- },
- t = {
- width: e.width - multiselect.position.right + 2,
- height: e.height - multiselect.position.bottom
- },
- n = {
- pageX: e.width - multiselect.position.right / 2,
- pageY: e.height - multiselect.position.bottom
- };
- $("#multiselect").css(t), multiselect.getSelection(n)
- }, multiselect.resize = function(e) {
- if (null === multiselect.position.top || null === multiselect.position.right || null === multiselect.position.bottom || null === multiselect.position.left) return !1;
- var t = {},
- n = {},
- o = {
- x: e.pageX,
- y: e.pageY
- },
- i = {
- top: null,
- bottom: null,
- height: null,
- left: null,
- right: null,
- width: null
- };
- o.y >= multiselect.position.top ? (n.height = $(document).height(), t.height = o.y - multiselect.position.top, multiselect.position.top + t.height >= n.height && (t.height -= multiselect.position.top + t.height - n.height + 2), i.top = multiselect.position.top, i.bottom = "inherit", i.height = t.height) : (i.top = "inherit", i.bottom = multiselect.position.bottom, i.height = multiselect.position.top - e.pageY), o.x >= multiselect.position.left ? (n.width = $(document).width(), t.width = o.x - multiselect.position.left, multiselect.position.left + t.width >= n.width && (t.width -= multiselect.position.left + t.width - n.width + 2), i.right = "inherit", i.left = multiselect.position.left, i.width = t.width) : (i.right = multiselect.position.right, i.left = "inherit", i.width = multiselect.position.left - e.pageX), $("#multiselect").css(i)
- }, multiselect.stopResize = function() {
- null !== multiselect.position.top && $(document).off("mousemove mouseup")
- }, multiselect.getSize = function() {
- if (!visible.multiselect()) return !1;
- var e = $("#multiselect"),
- t = e.offset();
- return {
- top: t.top,
- left: t.left,
- width: parseInt(e.css("width").replace("px", "")),
- height: parseInt(e.css("height").replace("px", ""))
- }
- }, multiselect.getSelection = function(e) {
- var t = [],
- n = multiselect.getSize();
- return !visible.contextMenu() && (!!visible.multiselect() && ($(".photo, .album").each(function() {
- var e = $(this).offset();
- if (e.top >= n.top - 150 && e.left >= n.left - 150 && e.top + 206 <= n.top + n.height + 150 && e.left + 206 <= n.left + n.width + 150) {
- var o = $(this).data("id");
- "0" !== o && 0 !== o && "f" !== o && "s" !== o && "r" !== o && null != o && (t.push(o), $(this).addClass("active"))
- }
- }), void(0 !== t.length && visible.album() ? contextMenu.photoMulti(t, e) : 0 !== t.length && visible.albums() ? contextMenu.albumMulti(t, e) : multiselect.close())))
- }, multiselect.close = function() {
- sidebar.setSelectable(!0), multiselect.stopResize(), multiselect.position.top = null, multiselect.position.right = null, multiselect.position.bottom = null, multiselect.position.left = null, lychee.animate("#multiselect", "fadeOut"), setTimeout(function() {
- return $("#multiselect").remove()
- }, 300)
- }, password = {
- value: ""
- }, password.get = function(e, t) {
- !1 === lychee.publicMode ? t() : album.json && "0" === album.json.password ? t() : albums.json && "0" === albums.getByID(e).password ? t() : albums.json || album.json ? password.getDialog(e, t) : (album.json = {
- password: !0
- }, t(""))
- }, password.getDialog = function(e, t) {
- var n = function(n) {
- var o = n.password,
- i = {
- albumID: e,
- password: o
- };
- api.post("Album::getPublic", i, function(e) {
- !0 === e ? (basicModal.close(), password.value = o, t()) : basicModal.error("password")
- })
- },
- o = function() {
- basicModal.close(), visible.albums() || lychee.goto()
- };
- basicModal.show({
- body: "\n\t <p>\n\t This album is protected by a password. Enter the password below to view the photos of this album:\n\t <input name='password' class='text' type='password' placeholder='password' value=''>\n\t </p>\n\t ",
- buttons: {
- action: {
- title: "Enter",
- fn: n
- },
- cancel: {
- title: "Cancel",
- fn: o
- }
- }
- })
- }, photo = {
- json: null,
- cache: null
- }, photo.getID = function() {
- var e = null;
- return e = photo.json ? photo.json.id : $(".photo:hover, .photo.active").attr("data-id"), !0 === $.isNumeric(e) && e
- }, photo.load = function(e, t) {
- var n = function n() {
- "" !== password.value ? photo.load(e, t) : setTimeout(n, 200)
- };
- if (null == album.json) return function n() {
- null != album.json ? photo.load(e, t) : setTimeout(n, 100)
- }(), !1;
- var o = {
- photoID: e,
- albumID: t,
- password: password.value
- };
- api.post("Photo::get", o, function(t) {
- return "Warning: Photo private!" === t ? (lychee.content.show(), lychee.goto(), !1) : "Warning: Wrong password!" === t ? (n(), !1) : (photo.json = t, visible.photo() || view.photo.show(), view.photo.init(), lychee.imageview.show(), void setTimeout(function() {
- lychee.content.show(), photo.preloadNext(e)
- }, 300))
- })
- }, photo.preloadNext = function(e) {
- if (album.json && album.json.content && album.json.content[e] && "" != album.json.content[e].nextPhoto) {
- var t = album.json.content[e].nextPhoto,
- n = album.json.content[t].url,
- o = album.json.content[t].medium,
- i = null != o && "" !== o ? o : n;
- $("head [data-prefetch]").remove(), $("head").append('<link data-prefetch rel="prefetch" href="' + i + '">')
- }
- }, photo.parse = function() {
- photo.json.title || (photo.json.title = "Untitled")
- }, photo.previous = function(e) {
- if (!1 !== photo.getID() && album.json && album.json.content[photo.getID()] && "" !== album.json.content[photo.getID()].previousPhoto) {
- var t = 0;
- !0 === e && (t = 200, $("#imageview #image").css({
- WebkitTransform: "translateX(100%)",
- MozTransform: "translateX(100%)",
- transform: "translateX(100%)",
- opacity: 0
- })), setTimeout(function() {
- if (!1 === photo.getID()) return !1;
- lychee.goto(album.getID() + "/" + album.json.content[photo.getID()].previousPhoto)
- }, t)
- }
- }, photo.next = function(e) {
- if (!1 !== photo.getID() && album.json && album.json.content[photo.getID()] && "" !== album.json.content[photo.getID()].nextPhoto) {
- var t = 0;
- !0 === e && (t = 200, $("#imageview #image").css({
- WebkitTransform: "translateX(-100%)",
- MozTransform: "translateX(-100%)",
- transform: "translateX(-100%)",
- opacity: 0
- })), setTimeout(function() {
- if (!1 === photo.getID()) return !1;
- lychee.goto(album.getID() + "/" + album.json.content[photo.getID()].nextPhoto)
- }, t)
- }
- }, photo.duplicate = function(e) {
- if (!e) return !1;
- e instanceof Array == !1 && (e = [e]), albums.refresh();
- var t = {
- photoIDs: e.join()
- };
- api.post("Photo::duplicate", t, function(e) {
- !0 !== e ? lychee.error(null, t, e) : album.load(album.getID())
- })
- }, photo.delete = function(e) {
- var t = {},
- n = {},
- o = "",
- i = "";
- if (!e) return !1;
- e instanceof Array == !1 && (e = [e]), 1 === e.length && "" === (i = visible.photo() ? photo.json.title : album.json.content[e].title) && (i = "Untitled"), t.fn = function() {
- var t = null,
- n = null;
- basicModal.close(), e.forEach(function(e, o, i) {
- "" === album.json.content[e].nextPhoto && "" === album.json.content[e].previousPhoto || (t = album.json.content[e].nextPhoto, n = album.json.content[e].previousPhoto, album.json.content[n].nextPhoto = t, album.json.content[t].previousPhoto = n), delete album.json.content[e], view.album.content.delete(e)
- }),
- albums.refresh(), visible.photo() && null != t && t !== photo.getID() ? lychee.goto(album.getID() + "/" + t) : visible.albums() || lychee.goto(album.getID());
- var o = {
- photoIDs: e.join()
- };
- api.post("Photo::delete", o, function(e) {
- !0 !== e && lychee.error(null, o, e)
- })
- }, 1 === e.length ? (t.title = "Delete Photo", n.title = "Keep Photo", o = lychee.html(_templateObject27, i)) : (t.title = "Delete Photo", n.title = "Keep Photo", o = lychee.html(_templateObject28, e.length)), basicModal.show({
- body: o,
- buttons: {
- action: {
- title: t.title,
- fn: t.fn,
- class: "red"
- },
- cancel: {
- title: n.title,
- fn: basicModal.close
- }
- }
- })
- }, photo.setTitle = function(e) {
- var t = "",
- n = "";
- if (!e) return !1;
- e instanceof Array == !1 && (e = [e]), 1 === e.length && (photo.json ? t = photo.json.title : album.json && (t = album.json.content[e].title));
- var o = function(t) {
- basicModal.close();
- var n = t.title;
- visible.photo() && (photo.json.title = "" === n ? "Untitled" : n, view.photo.title()), e.forEach(function(e, t, o) {
- album.json.content[e].title = n, view.album.content.title(e)
- });
- var o = {
- photoIDs: e.join(),
- title: n
- };
- api.post("Photo::setTitle", o, function(e) {
- !0 !== e && lychee.error(null, o, e)
- })
- },
- i = lychee.html(_templateObject3, t);
- n = 1 === e.length ? lychee.html(_templateObject29, i) : lychee.html(_templateObject30, e.length, i), basicModal.show({
- body: n,
- buttons: {
- action: {
- title: "Set title",
- fn: o
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- }, photo.setAlbum = function(e, t) {
- var n = null,
- o = null;
- if (!e) return !1;
- e instanceof Array == !1 && (e = [e]), e.forEach(function(e, t, i) {
- "" === album.json.content[e].nextPhoto && "" === album.json.content[e].previousPhoto || (n = album.json.content[e].nextPhoto, o = album.json.content[e].previousPhoto, album.json.content[o].nextPhoto = n, album.json.content[n].previousPhoto = o), delete album.json.content[e], view.album.content.delete(e)
- }), albums.refresh(), visible.photo() && null != n && n !== photo.getID() ? lychee.goto(album.getID() + "/" + n) : visible.albums() || lychee.goto(album.getID());
- var i = {
- photoIDs: e.join(),
- albumID: t
- };
- api.post("Photo::setAlbum", i, function(e) {
- !0 !== e && lychee.error(null, i, e)
- })
- }, photo.setStar = function(e) {
- if (!e) return !1;
- visible.photo() && (photo.json.star = "0" === photo.json.star ? "1" : "0", view.photo.star()), e.forEach(function(e, t, n) {
- album.json.content[e].star = "0" === album.json.content[e].star ? "1" : "0", view.album.content.star(e)
- }), albums.refresh();
- var t = {
- photoIDs: e.join()
- };
- api.post("Photo::setStar", t, function(e) {
- !0 !== e && lychee.error(null, t, e)
- })
- }, photo.setPublic = function(e, t) {
- if ("2" === photo.json.public) {
- var n = function() {
- basicModal.close(), lychee.goto(photo.json.original_album)
- };
- return basicModal.show({
- body: "<p>This photo is located in a public album. To make this photo private or public, edit the visibility of the associated album.</p>",
- buttons: {
- action: {
- title: "Show Album",
- fn: n
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- }), !1
- }
- visible.photo() && (photo.json.public = "0" === photo.json.public ? "1" : "0", view.photo.public(), "1" === photo.json.public && contextMenu.sharePhoto(e, t)), album.json.content[e].public = "0" === album.json.content[e].public ? "1" : "0", view.album.content.public(e), albums.refresh(), api.post("Photo::setPublic", {
- photoID: e
- }, function(e) {
- !0 !== e && lychee.error(null, params, e)
- })
- }, photo.setDescription = function(e) {
- var t = photo.json.description,
- n = function(t) {
- basicModal.close();
- var n = t.description;
- visible.photo() && (photo.json.description = n, view.photo.description());
- var o = {
- photoID: e,
- description: n
- };
- api.post("Photo::setDescription", o, function(e) {
- !0 !== e && lychee.error(null, o, e)
- })
- };
- basicModal.show({
- body: lychee.html(_templateObject31, t),
- buttons: {
- action: {
- title: "Set Description",
- fn: n
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- }, photo.editTags = function(e) {
- var t = "",
- n = "";
- if (!e) return !1;
- if (e instanceof Array == !1 && (e = [e]), visible.photo()) t = photo.json.tags;
- else if (visible.album() && 1 === e.length) t = album.json.content[e].tags;
- else if (visible.search() && 1 === e.length) t = album.json.content[e].tags;
- else if (visible.album() && e.length > 1) {
- var o = !0;
- e.forEach(function(t, n, i) {
- o = album.json.content[t].tags === album.json.content[e[0]].tags && !0 === o
- }), !0 === o && (t = album.json.content[e[0]].tags)
- }
- t = t.replace(/,/g, ", ");
- var i = function(t) {
- basicModal.close(), photo.setTags(e, t.tags)
- },
- a = lychee.html(_templateObject32, t);
- n = 1 === e.length ? lychee.html(_templateObject33, a) : lychee.html(_templateObject34, e.length, a), basicModal.show({
- body: n,
- buttons: {
- action: {
- title: "Set Tags",
- fn: i
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- }, photo.setTags = function(e, t) {
- if (!e) return !1;
- e instanceof Array == !1 && (e = [e]), t = t.replace(/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/g, ","), t = t.replace(/,$|^,|(\ ){0,}$/g, ""), visible.photo() && (photo.json.tags = t, view.photo.tags()), e.forEach(function(e, n, o) {
- album.json.content[e].tags = t
- });
- var n = {
- photoIDs: e.join(),
- tags: t
- };
- api.post("Photo::setTags", n, function(e) {
- !0 !== e && lychee.error(null, n, e)
- })
- }, photo.deleteTag = function(e, t) {
- var n = void 0;
- n = photo.json.tags.split(","), n.splice(t, 1), photo.json.tags = n.toString(), photo.setTags([e], photo.json.tags)
- }, photo.share = function(e, t) {
- var n = photo.getViewLink(e);
- switch (t) {
- case "twitter":
- window.open("https://twitter.com/share?url=" + encodeURI(n));
- break;
- case "facebook":
- window.open("http://www.facebook.com/sharer.php?u=" + encodeURI(n) + "&t=" + encodeURI(photo.json.title));
- break;
- case "mail":
- location.href = "mailto:?subject=" + encodeURI(photo.json.title) + "&body=" + encodeURI(n);
- break;
- case "dropbox":
- lychee.loadDropbox(function() {
- var e = photo.json.title + "." + photo.getDirectLink().split(".").pop();
- Dropbox.save(photo.getDirectLink(), e)
- })
- }
- }, photo.getArchive = function(e) {
- var t = void 0,
- n = api.path + "?function=Photo::getArchive&photoID=" + e;
- t = location.href.indexOf("index.html") > 0 ? location.href.replace(location.hash, "").replace("index.html", n) : location.href.replace(location.hash, "") + n, !0 === lychee.publicMode && (t += "&password=" + encodeURIComponent(password.value)), location.href = t
- }, photo.getDirectLink = function() {
- var e = "";
- return photo.json && photo.json.url && "" !== photo.json.url && (e = photo.json.url), e
- }, photo.getViewLink = function(e) {
- var t = "view.php?p=" + e;
- return location.href.indexOf("index.html") > 0 ? location.href.replace("index.html" + location.hash, t) : location.href.replace(location.hash, t)
- }, search = {
- hash: null
- }, search.find = function(e) {
- clearTimeout($(window).data("timeout")), $(window).data("timeout", setTimeout(function() {
- 0 !== header.dom(".header__search").val().length ? api.post("search", {
- term: e
- }, function(e) {
- var t = "",
- n = "",
- o = "";
- e && e.albums && (albums.json = {
- albums: e.albums
- }, $.each(albums.json.albums, function() {
- albums.parse(this), n += build.album(this)
- })), e && e.photos && (album.json = {
- content: e.photos
- }, $.each(album.json.content, function() {
- o += build.photo(this)
- })), t = "" === n && "" === o ? "error" : "" === n ? build.divider("Photos") + o : "" === o ? build.divider("Albums") + n : build.divider("Albums") + n + build.divider("Photos") + o, search.hash !== e.hash && ($(".no_content").remove(), lychee.animate(".content", "contentZoomOut"), search.hash = e.hash, setTimeout(function() {
- "error" === t ? (lychee.content.html(""), $("body").append(build.no_content("magnifying-glass"))) : (lychee.content.html(t), lychee.animate(lychee.content, "contentZoomIn"))
- }, 300))
- }) : search.reset()
- }, 250))
- }, search.reset = function() {
- header.dom(".header__search").val(""), $(".no_content").remove(), null != search.hash && (albums.json = null, album.json = null, photo.json = null, search.hash = null, lychee.animate(".divider", "fadeOut"), lychee.goto())
- }, settings = {}, settings.createConfig = function() {
- var e = function(e) {
- var t = e.dbName || "",
- n = e.dbUser || "",
- o = e.dbPassword || "",
- i = e.dbHost || "",
- a = e.dbTablePrefix || "";
- if (n.length < 1) return basicModal.error("dbUser"), !1;
- i.length < 1 && (i = "localhost"), t.length < 1 && (t = "lychee");
- var r = {
- dbName: t,
- dbUser: n,
- dbPassword: o,
- dbHost: i,
- dbTablePrefix: a
- };
- api.post("Config::create", r, function(e) {
- if (!0 !== e) return "Warning: Connection failed!" === e ? (basicModal.show({
- body: "<p>Unable to connect to host database because access was denied. Double-check your host, username and password and ensure that access from your current location is permitted.</p>",
- buttons: {
- action: {
- title: "Retry",
- fn: settings.createConfig
- }
- }
- }), !1) : "Warning: Creation failed!" === e ? (basicModal.show({
- body: "<p>Unable to create the database. Double-check your host, username and password and ensure that the specified user has the rights to modify and add content to the database.</p>",
- buttons: {
- action: {
- title: "Retry",
- fn: settings.createConfig
- }
- }
- }), !1) : "Warning: Could not create file!" === e ? (basicModal.show({
- body: "<p>Unable to save this configuration. Permission denied in <b>'data/'</b>. Please set the read, write and execute rights for others in <b>'data/'</b> and <b>'uploads/'</b>. Take a look at the readme for more information.</p>",
- buttons: {
- action: {
- title: "Retry",
- fn: settings.createConfig
- }
- }
- }), !1) : (basicModal.show({
- body: "<p>Something unexpected happened. Please try again and check your installation and server. Take a look at the readme for more information.</p>",
- buttons: {
- action: {
- title: "Retry",
- fn: settings.createConfig
- }
- }
- }), !1);
- window.location.reload()
- })
- };
- basicModal.show({
- body: "\n\t <p>\n\t Enter your database connection details below:\n\t <input name='dbHost' class='text' type='text' placeholder='Database Host (optional)' value=''>\n\t <input name='dbUser' class='text' type='text' placeholder='Database Username' value=''>\n\t <input name='dbPassword' class='text' type='password' placeholder='Database Password' value=''>\n\t </p>\n\t <p>\n\t Lychee will create its own database. If required, you can enter the name of an existing database instead:\n\t <input name='dbName' class='text' type='text' placeholder='Database Name (optional)' value=''>\n\t <input name='dbTablePrefix' class='text' type='text' placeholder='Table prefix (optional)' value=''>\n\t </p>\n\t ",
- buttons: {
- action: {
- title: "Connect",
- fn: e
- }
- }
- })
- }, settings.createLogin = function() {
- var e = function(e) {
- var t = e.username,
- n = e.password;
- if (t.length < 1) return basicModal.error("username"), !1;
- if (n.length < 1) return basicModal.error("password"), !1;
- basicModal.close();
- var o = {
- username: t,
- password: n
- };
- api.post("Settings::setLogin", o, function(e) {
- !0 !== e && basicModal.show({
- body: "<p>Unable to save login. Please try again with another username and password!</p>",
- buttons: {
- action: {
- title: "Retry",
- fn: settings.createLogin
- }
- }
- })
- })
- };
- basicModal.show({
- body: "\n\t <p>\n\t Enter a username and password for your installation:\n\t <input name='username' class='text' type='text' placeholder='New Username' value=''>\n\t <input name='password' class='text' type='password' placeholder='New Password' value=''>\n\t </p>\n\t ",
- buttons: {
- action: {
- title: "Create Login",
- fn: e
- }
- }
- })
- }, settings.setLogin = function() {
- var e = function(e) {
- var t = e.oldPassword || "",
- n = e.username || "",
- o = e.password || "";
- if (t.length < 1) return basicModal.error("oldPassword"), !1;
- if (n.length < 1) return basicModal.error("username"), !1;
- if (o.length < 1) return basicModal.error("password"), !1;
- basicModal.close();
- var i = {
- oldPassword: t,
- username: n,
- password: o
- };
- api.post("Settings::setLogin", i, function(e) {
- !0 !== e && lychee.error(null, i, e)
- })
- };
- basicModal.show({
- body: "\n\t <p>\n\t Enter your current password:\n\t <input name='oldPassword' class='text' type='password' placeholder='Current Password' value=''>\n\t </p>\n\t <p>\n\t Your username and password will be changed to the following:\n\t <input name='username' class='text' type='text' placeholder='New Username' value=''>\n\t <input name='password' class='text' type='password' placeholder='New Password' value=''>\n\t </p>\n\t ",
- buttons: {
- action: {
- title: "Change Login",
- fn: e
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- }, settings.setSorting = function() {
- var e = [],
- t = [],
- n = function() {
- t[0] = $(".basicModal select#settings_albums_type").val(), t[1] = $(".basicModal select#settings_albums_order").val(), e[0] = $(".basicModal select#settings_photos_type").val(), e[1] = $(".basicModal select#settings_photos_order").val(), basicModal.close(), albums.refresh();
- var n = {
- typeAlbums: t[0],
- orderAlbums: t[1],
- typePhotos: e[0],
- orderPhotos: e[1]
- };
- api.post("Settings::setSorting", n, function(o) {
- !0 === o ? (lychee.sortingAlbums = "ORDER BY " + t[0] + " " + t[1], lychee.sortingPhotos = "ORDER BY " + e[0] + " " + e[1], lychee.load()) : lychee.error(null, n, o)
- })
- };
- basicModal.show({
- body: "\n\t <p>\n\t Sort albums by\n\t <span class=\"select\">\n\t <select id='settings_albums_type'>\n\t <option value='id'>Creation Time</option>\n\t <option value='title'>Title</option>\n\t <option value='description'>Description</option>\n\t <option value='public'>Public</option>\n\t <option value='max_takestamp'>Latest Take Date</option>\n\t <option value='min_takestamp'>Oldest Take Date</option>\n\t </select>\n\t </span>\n\t in an\n\t <span class=\"select\">\n\t <select id='settings_albums_order'>\n\t <option value='ASC'>Ascending</option>\n\t <option value='DESC'>Descending</option>\n\t </select>\n\t </span>\n\t order.\n\t </p>\n\t <p>\n\t Sort photos by\n\t <span class=\"select\">\n\t <select id='settings_photos_type'>\n\t <option value='id'>Upload Time</option>\n\t <option value='takestamp'>Take Date</option>\n\t <option value='title'>Title</option>\n\t <option value='description'>Description</option>\n\t <option value='public'>Public</option>\n\t <option value='star'>Star</option>\n\t <option value='type'>Photo Format</option>\n\t </select>\n\t </span>\n\t in an\n\t <span class=\"select\">\n\t <select id='settings_photos_order'>\n\t <option value='ASC'>Ascending</option>\n\t <option value='DESC'>Descending</option>\n\t </select>\n\t </span>\n\t order.\n\t </p>\n\t ",
- buttons: {
- action: {
- title: "Change Sorting",
- fn: n
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- }), "" !== lychee.sortingAlbums && (t = lychee.sortingAlbums.replace("ORDER BY ", "").split(" "), $(".basicModal select#settings_albums_type").val(t[0]), $(".basicModal select#settings_albums_order").val(t[1])), "" !== lychee.sortingPhotos && (e = lychee.sortingPhotos.replace("ORDER BY ", "").split(" "), $(".basicModal select#settings_photos_type").val(e[0]), $(".basicModal select#settings_photos_order").val(e[1]))
- }, settings.setDropboxKey = function(e) {
- var t = function(t) {
- var n = t.key;
- if (t.key.length < 1) return basicModal.error("key"), !1;
- basicModal.close(), api.post("Settings::setDropboxKey", {
- key: n
- }, function(t) {
- !0 === t ? (lychee.dropboxKey = n, e && lychee.loadDropbox(e)) : lychee.error(null, params, t)
- })
- },
- n = lychee.html(_templateObject35, lychee.dropboxKey);
- basicModal.show({
- body: n,
- buttons: {
- action: {
- title: "Set Dropbox Key",
- fn: t
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- }, sidebar = {
- _dom: $(".sidebar"),
- types: {
- DEFAULT: 0,
- TAGS: 1
- },
- createStructure: {}
- }, sidebar.dom = function(e) {
- return null == e || "" === e ? sidebar._dom : sidebar._dom.find(e)
- }, sidebar.bind = function() {
- var e = lychee.getEventName();
- return sidebar.dom("#edit_title").off(e).on(e, function() {
- visible.photo() ? photo.setTitle([photo.getID()]) : visible.album() && album.setTitle([album.getID()])
- }), sidebar.dom("#edit_description").off(e).on(e, function() {
- visible.photo() ? photo.setDescription(photo.getID()) : visible.album() && album.setDescription(album.getID())
- }), sidebar.dom("#edit_tags").off(e).on(e, function() {
- photo.editTags([photo.getID()])
- }), sidebar.dom("#tags .tag span").off(e).on(e, function() {
- photo.deleteTag(photo.getID(), $(this).data("index"))
- }), !0
- }, sidebar.toggle = function() {
- return !(!visible.sidebar() && !visible.sidebarbutton()) && (header.dom(".button--info").toggleClass("active"), lychee.content.toggleClass("content--sidebar"), sidebar.dom().toggleClass("active"), !0)
- }, sidebar.setSelectable = function() {
- !0 === (!(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]) ? sidebar.dom().removeClass("notSelectable") : sidebar.dom().addClass("notSelectable")
- }, sidebar.changeAttr = function(e) {
- var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "-",
- n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
- return null != e && "" !== e && (null != t && "" !== t || (t = "-"), !1 === n && (t = lychee.escapeHTML(t)), sidebar.dom(".attr_" + e).html(t), !0)
- }, sidebar.createStructure.photo = function(e) {
- if (null == e || "" === e) return !1;
- var t = !1,
- n = e.takestamp + e.make + e.model + e.shutter + e.aperture + e.focal + e.iso,
- o = {},
- i = "";
- switch (!1 === lychee.publicMode && (t = !0), e.public) {
- case "0":
- i = "No";
- break;
- case "1":
- i = "Yes";
- break;
- case "2":
- i = "Yes (Album)";
- break;
- default:
- i = "-"
- }
- return o.basics = {
- title: "Basics",
- type: sidebar.types.DEFAULT,
- rows: [{
- title: "Title",
- value: e.title,
- editable: t
- }, {
- title: "Uploaded",
- value: e.sysdate
- }, {
- title: "Description",
- value: e.description,
- editable: t
- }]
- }, o.image = {
- title: "Image",
- type: sidebar.types.DEFAULT,
- rows: [{
- title: "Size",
- value: e.size
- }, {
- title: "Format",
- value: e.type
- }, {
- title: "Resolution",
- value: e.width + " x " + e.height
- }]
- }, !1 === lychee.publicMode ? o.tags = {
- title: "Tags",
- type: sidebar.types.TAGS,
- value: build.tags(e.tags),
- editable: t
- } : o.tags = {}, o.exif = "0" !== n ? {
- title: "Camera",
- type: sidebar.types.DEFAULT,
- rows: [{
- title: "Captured",
- value: e.takedate
- }, {
- title: "Make",
- value: e.make
- }, {
- title: "Type/Model",
- value: e.model
- }, {
- title: "Shutter Speed",
- value: e.shutter
- }, {
- title: "Aperture",
- value: e.aperture
- }, {
- title: "Focal Length",
- value: e.focal
- }, {
- title: "ISO",
- value: e.iso
- }]
- } : {}, o.sharing = {
- title: "Sharing",
- type: sidebar.types.DEFAULT,
- rows: [{
- title: "Public",
- value: i
- }]
- }, o = [o.basics, o.image, o.tags, o.exif, o.sharing]
- }, sidebar.createStructure.album = function(e) {
- if (null == e || "" === e) return !1;
- var t = !1,
- n = {},
- o = "",
- i = "",
- a = "",
- r = "";
- switch (!1 === lychee.publicMode && (t = !0), e.public) {
- case "0":
- o = "No";
- break;
- case "1":
- o = "Yes";
- break;
- default:
- o = "-"
- }
- switch (e.visible) {
- case "0":
- i = "Yes";
- break;
- case "1":
- i = "No";
- break;
- default:
- i = "-"
- }
- switch (e.downloadable) {
- case "0":
- a = "No";
- break;
- case "1":
- a = "Yes";
- break;
- default:
- a = "-"
- }
- switch (e.password) {
- case "0":
- r = "No";
- break;
- case "1":
- r = "Yes";
- break;
- default:
- r = "-"
- }
- return n.basics = {
- title: "Basics",
- type: sidebar.types.DEFAULT,
- rows: [{
- title: "Title",
- value: e.title,
- editable: t
- }, {
- title: "Description",
- value: e.description,
- editable: t
- }]
- }, n.album = {
- title: "Album",
- type: sidebar.types.DEFAULT,
- rows: [{
- title: "Created",
- value: e.sysdate
- }, {
- title: "Images",
- value: e.num
- }]
- }, n.share = {
- title: "Share",
- type: sidebar.types.DEFAULT,
- rows: [{
- title: "Public",
- value: o
- }, {
- title: "Hidden",
- value: i
- }, {
- title: "Downloadable",
- value: a
- }, {
- title: "Password",
- value: r
- }]
- }, n = [n.basics, n.album, n.share]
- }, sidebar.render = function(e) {
- if (null == e || "" === e || !1 === e) return !1;
- var t = "",
- n = function(e) {
- var t = "";
- return t += "\n\t\t <div class='sidebar__divider'>\n\t\t <h1>" + e.title + "</h1>\n\t\t </div>\n\t\t <table>\n\t\t ", e.rows.forEach(function(e) {
- var n = e.value;
- "" !== n && null != n || (n = "-"), n = lychee.html(_templateObject36, e.title.toLowerCase(), n), !0 === e.editable && (n += " " + build.editIcon("edit_" + e.title.toLowerCase())), t += lychee.html(_templateObject37, e.title, n)
- }), t += "\n\t\t </table>\n\t\t "
- },
- o = function(e) {
- var t = "",
- n = "";
- return !0 === e.editable && (n = build.editIcon("edit_tags")), t += lychee.html(_templateObject38, e.title, e.title.toLowerCase(), e.value, n)
- };
- return e.forEach(function(e) {
- e.type === sidebar.types.DEFAULT ? t += n(e) : e.type === sidebar.types.TAGS && (t += o(e))
- }), t
- }, swipe = {
- obj: null,
- tolerance: 150,
- offset: 0
- }, swipe.start = function(e, t) {
- return e && (swipe.obj = e), t && (swipe.tolerance = t), !0
- }, swipe.move = function(e) {
- if (null === swipe.obj) return !1;
- swipe.offset = -1 * e.x, swipe.obj.css({
- WebkitTransform: "translateX(" + swipe.offset + "px)",
- MozTransform: "translateX(" + swipe.offset + "px)",
- transform: "translateX(" + swipe.offset + "px)"
- })
- }, swipe.stop = function(e, t, n) {
- if (null == swipe.obj) return !1;
- e.x <= -swipe.tolerance ? t(!0) : e.x >= swipe.tolerance ? n(!0) : swipe.obj.css({
- WebkitTransform: "translateX(0px)",
- MozTransform: "translateX(0px)",
- transform: "translateX(0px)"
- }), swipe.obj = null, swipe.offset = 0
- }, upload = {}, upload.show = function(e, t, n) {
- basicModal.show({
- body: build.uploadModal(e, t),
- buttons: {
- action: {
- title: "Close",
- class: "hidden",
- fn: basicModal.close
- }
- },
- callback: n
- })
- }, upload.notify = function(e, t) {
- if (null != t && "" !== t || (t = "You can now manage your new photo(s)."), !window.webkitNotifications) return !1;
- if (0 !== window.webkitNotifications.checkPermission() && window.webkitNotifications.requestPermission(), 0 === window.webkitNotifications.checkPermission() && e) {
- window.webkitNotifications.createNotification("", e, t).show()
- }
- }, upload.start = {
- local: function(e) {
- var t = album.getID(),
- n = !1,
- o = !1,
- i = function e(i, a) {
- var r = new FormData,
- l = new XMLHttpRequest,
- s = 0,
- c = 0,
- u = !1,
- d = function() {
- window.onbeforeunload = null, $("#upload_files").val(""), !1 === n && !1 === o ? (basicModal.close(), upload.notify("Upload complete")) : !1 === n && !0 === o ? ($(".basicModal #basicModal__action.hidden").show(), upload.notify("Upload complete")) : ($(".basicModal #basicModal__action.hidden").show(), upload.notify("Upload complete", "Failed to upload one or more photos.")), albums.refresh(), !1 === album.getID() ? lychee.goto("0") : album.load(t)
- };
- r.append("function", "Photo::add"), r.append("albumID", t), r.append(0, a), l.open("POST", api.path), l.onload = function() {
- var e = null,
- t = !1,
- r = "";
- try {
- e = JSON.parse(l.responseText)
- } catch (t) {
- e = ""
- }
- a.ready = !0, 200 === l.status && function(e) {
- return !isNaN(parseFloat(e)) && isFinite(e)
- }(e) ? $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Finished").addClass("success") : ("Error:" === e.substr(0, 6) ? (r = e.substr(6) + " Please take a look at the console of your browser for further details.", n = !0, $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Failed").addClass("error"), !0 === n && lychee.error("Upload failed. Server returned an error!", l, e)) : "Warning:" === e.substr(0, 8) ? (r = e.substr(8), o = !0, $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Skipped").addClass("warning"), !0 === n && lychee.error("Upload failed. Server returned a warning!", l, e)) : (r = "Server returned an unknown response. Please take a look at the console of your browser for further details.", n = !0, $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Failed").addClass("error"), !0 === n && lychee.error("Upload failed. Server returned an unkown error!", l, e)), $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") p.notice").html(r).show());
- for (var s = 0; s < i.length; s++)
- if (!1 === i[s].ready) {
- t = !0;
- break
- }!1 === t && d()
- }, l.upload.onprogress = function(t) {
- if (!0 !== t.lengthComputable) return !1;
- if (c = t.loaded / t.total * 100 | 0, c > s && ($(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html(c + "%"), s = c), c >= 100 && !1 === u) {
- var n = 0;
- a.num + 1 > 4 && (n = 40 * (a.num + 1 - 4)), $(".basicModal .rows").scrollTop(n), $(".basicModal .rows .row:nth-child(" + (a.num + 1) + ") .status").html("Processing"), null != a.next && (e(i, a.next), u = !0)
- }
- }, l.send(r)
- };
- if (e.length <= 0) return !1;
- !1 !== t && !0 !== visible.albums() || (t = 0);
- for (var a = 0; a < e.length; a++) e[a].num = a, e[a].ready = !1, a < e.length - 1 ? e[a].next = e[a + 1] : e[a].next = null;
- window.onbeforeunload = function() {
- return "Lychee is currently uploading!"
- }, upload.show("Uploading", e, function() {
- i(e, e[0])
- })
- },
- url: function() {
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "",
- t = album.getID();
- e = "string" == typeof e ? e : "", !1 === t && (t = 0);
- var n = function(e) {
- var n = [];
- e.link && e.link.length > 3 ? (basicModal.close(), n[0] = {
- name: e.link
- }, upload.show("Importing URL", n, function() {
- $(".basicModal .rows .row .status").html("Importing");
- var n = {
- url: e.link,
- albumID: t
- };
- api.post("Import::url", n, function(e) {
- !0 !== e ? ($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(), $(".basicModal .rows .row .status").html("Finished").addClass("warning"), $(".basicModal #basicModal__action.hidden").show(), lychee.error(null, n, e)) : basicModal.close(), upload.notify("Import complete"), albums.refresh(), !1 === album.getID() ? lychee.goto("0") : album.load(t)
- })
- })) : basicModal.error("link")
- };
- basicModal.show({
- body: lychee.html(_templateObject39, e),
- buttons: {
- action: {
- title: "Import",
- fn: n
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- },
- server: function() {
- var e = album.getID();
- !1 === e && (e = 0);
- var t = function(t) {
- var n = [];
- n[0] = {
- name: t.path
- }, upload.show("Importing from server", n, function() {
- $(".basicModal .rows .row .status").html("Importing");
- var n = {
- albumID: e,
- path: t.path
- };
- api.post("Import::server", n, function(t) {
- if (albums.refresh(), upload.notify("Import complete"), "Notice: Import only contained albums!" === t) return visible.albums() ? lychee.load() : lychee.goto(), basicModal.close(), !0;
- "Warning: Folder empty or no readable files to process!" === t ? ($(".basicModal .rows .row p.notice").html("Folder empty or no readable files to process. Please take a look at the log (Settings -> Show Log) for further details.").show(), $(".basicModal .rows .row .status").html("Failed").addClass("error"), lychee.error("Could not start import because the folder was empty!", n, t)) : !0 !== t ? ($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(), $(".basicModal .rows .row .status").html("Finished").addClass("warning"), lychee.error(null, n, t)) : basicModal.close(), !1 === album.getID() ? lychee.goto("0") : album.load(e), $(".basicModal #basicModal__action.hidden").show()
- })
- })
- };
- basicModal.show({
- body: lychee.html(_templateObject40, lychee.location),
- buttons: {
- action: {
- title: "Import",
- fn: t
- },
- cancel: {
- title: "Cancel",
- fn: basicModal.close
- }
- }
- })
- },
- dropbox: function() {
- var e = album.getID();
- !1 === e && (e = 0);
- var t = function(t) {
- for (var n = "", o = 0; o < t.length; o++) n += t[o].link + ",", t[o] = {
- name: t[o].link
- };
- n = n.substr(0, n.length - 1), upload.show("Importing from Dropbox", t, function() {
- $(".basicModal .rows .row .status").html("Importing");
- var t = {
- url: n,
- albumID: e
- };
- api.post("Import::url", t, function(n) {
- !0 !== n ? ($(".basicModal .rows .row p.notice").html("The import has been finished, but returned warnings or errors. Please take a look at the log (Settings -> Show Log) for further details.").show(), $(".basicModal .rows .row .status").html("Finished").addClass("warning"), $(".basicModal #basicModal__action.hidden").show(), lychee.error(null, t, n)) : basicModal.close(), upload.notify("Import complete"), albums.refresh(), !1 === album.getID() ? lychee.goto("0") : album.load(e)
- })
- })
- };
- lychee.loadDropbox(function() {
- Dropbox.choose({
- linkType: "direct",
- multiselect: !0,
- success: t
- })
- })
- }
- }, view = {}, view.albums = {
- init: function() {
- view.albums.title(), view.albums.content.init()
- },
- title: function() {
- lychee.setTitle("Albums", !1)
- },
- content: {
- scrollPosition: 0,
- init: function() {
- var e = "",
- t = "";
- !1 === lychee.publicMode && (albums.parse(albums.json.smartalbums.unsorted), albums.parse(albums.json.smartalbums.public), albums.parse(albums.json.smartalbums.starred), albums.parse(albums.json.smartalbums.recent), e = build.divider("Smart Albums") + build.album(albums.json.smartalbums.unsorted) + build.album(albums.json.smartalbums.public) + build.album(albums.json.smartalbums.starred) + build.album(albums.json.smartalbums.recent)), albums.json.albums && 0 !== albums.json.num && ($.each(albums.json.albums, function() {
- albums.parse(this), t += build.album(this)
- }), !1 === lychee.publicMode && (t = build.divider("Albums") + t)), "" === e && "" === t ? (lychee.content.html(""), $("body").append(build.no_content("eye"))) : lychee.content.html(e + t), null != view.albums.content.scrollPosition && 0 !== view.albums.content.scrollPosition && $(document).scrollTop(view.albums.content.scrollPosition)
- },
- title: function(e) {
- var t = albums.getByID(e).title;
- t = lychee.escapeHTML(t), $('.album[data-id="' + e + '"] .overlay h1').html(t).attr("title", t)
- },
- delete: function(e) {
- $('.album[data-id="' + e + '"]').css("opacity", 0).animate({
- width: 0,
- marginLeft: 0
- }, 300, function() {
- $(this).remove(), albums.json.num <= 0 && lychee.content.find(".divider:last-child").remove()
- })
- }
- }
- }, view.album = {
- init: function() {
- album.parse(), view.album.sidebar(), view.album.title(), view.album.public(), view.album.content.init(), album.json.init = 1
- },
- title: function() {
- if ((visible.album() || !album.json.init) && !visible.photo()) switch (album.getID()) {
- case "f":
- lychee.setTitle("Starred", !1);
- break;
- case "s":
- lychee.setTitle("Public", !1);
- break;
- case "r":
- lychee.setTitle("Recent", !1);
- break;
- case "0":
- lychee.setTitle("Unsorted", !1);
- break;
- default:
- album.json.init && sidebar.changeAttr("title", album.json.title), lychee.setTitle(album.json.title, !0)
- }
- },
- content: {
- init: function() {
- var e = "";
- album.json.content && !1 !== album.json.content && $.each(album.json.photos, function() {
- e += build.photo(this)
- }), view.albums.content.scrollPosition = $(document).scrollTop(), requestAnimationFrame(function() {
- return $(document).scrollTop(0)
- }), lychee.content.html(e)
- },
- title: function(e) {
- var t = album.json.content[e].title;
- t = lychee.escapeHTML(t), $('.photo[data-id="' + e + '"] .overlay h1').html(t).attr("title", t)
- },
- star: function(e) {
- var t = $('.photo[data-id="' + e + '"] .icn-star');
- "1" === album.json.content[e].star ? t.addClass("badge--visible") : t.removeClass("badge--visible")
- },
- public: function(e) {
- var t = $('.photo[data-id="' + e + '"] .icn-share');
- "1" === album.json.content[e].public ? t.addClass("badge--visible") : t.removeClass("badge--visible")
- },
- delete: function(e) {
- $('.photo[data-id="' + e + '"]').css("opacity", 0).animate({
- width: 0,
- marginLeft: 0
- }, 300, function() {
- $(this).remove(), visible.albums() || (album.json.num--, view.album.num())
- })
- }
- },
- description: function() {
- sidebar.changeAttr("description", album.json.description)
- },
- num: function() {
- sidebar.changeAttr("images", album.json.num)
- },
- public: function() {
- "1" === album.json.public ? ($("#button_share_album").addClass("active").attr("title", "Share Album"), $(".photo .iconic-share").remove(), album.json.init && sidebar.changeAttr("public", "Yes")) : ($("#button_share_album").removeClass("active").attr("title", "Make Public"), album.json.init && sidebar.changeAttr("public", "No"))
- },
- hidden: function() {
- "1" === album.json.visible ? sidebar.changeAttr("hidden", "No") : sidebar.changeAttr("hidden", "Yes")
- },
- downloadable: function() {
- "1" === album.json.downloadable ? sidebar.changeAttr("downloadable", "Yes") : sidebar.changeAttr("downloadable", "No")
- },
- password: function() {
- "1" === album.json.password ? sidebar.changeAttr("password", "Yes") : sidebar.changeAttr("password", "No")
- },
- sidebar: function(e) {
- function t() {
- return e.apply(this, arguments)
- }
- return t.toString = function() {
- return e.toString()
- }, t
- }(function() {
- if ((visible.album() || !album.json.init) && !visible.photo()) {
- var e = sidebar.createStructure.album(album.json),
- t = sidebar.render(e);
- sidebar.dom(".sidebar__wrapper").html(t), sidebar.bind()
- }
- })
- }, view.photo = {
- init: function() {
- photo.parse(), view.photo.sidebar(), view.photo.title(), view.photo.star(), view.photo.public(), view.photo.photo(), photo.json.init = 1
- },
- show: function() {
- lychee.content.addClass("view"), header.setMode("photo"), $("body").css("overflow", "hidden");
- var e = null;
- $(document).bind("mousemove", function() {
- clearTimeout(e), header.show(), e = setTimeout(header.hide, 2500)
- }), lychee.animate(lychee.imageview, "fadeIn")
- },
- hide: function() {
- header.show(), lychee.content.removeClass("view"), header.setMode("album"), $("body").css("overflow", "auto"), $(document).unbind("mousemove"), lychee.animate(lychee.imageview, "fadeOut"), setTimeout(function() {
- lychee.imageview.hide(), view.album.sidebar()
- }, 300)
- },
- title: function() {
- photo.json.init && sidebar.changeAttr("title", photo.json.title), lychee.setTitle(photo.json.title, !0)
- },
- description: function() {
- photo.json.init && sidebar.changeAttr("description", photo.json.description)
- },
- star: function() {
- "1" === photo.json.star ? $("#button_star").addClass("active").attr("title", "Unstar Photo") : ($("#button_star").removeClass("active"), $("#button_star").attr("title", "Star Photo"))
- },
- public: function() {
- "1" === photo.json.public || "2" === photo.json.public ? ($("#button_share").addClass("active").attr("title", "Share Photo"), photo.json.init && sidebar.changeAttr("public", "Yes")) : ($("#button_share").removeClass("active").attr("title", "Make Public"), photo.json.init && sidebar.changeAttr("public", "No"))
- },
- tags: function() {
- sidebar.changeAttr("tags", build.tags(photo.json.tags), !0), sidebar.bind()
- },
- photo: function(e) {
- function t() {
- return e.apply(this, arguments)
- }
- return t.toString = function() {
- return e.toString()
- }, t
- }(function() {
- lychee.imageview.html(build.imageview(photo.json, visible.header()));
- var e = lychee.imageview.find("a#next"),
- t = lychee.imageview.find("a#previous"),
- n = photo.getID(),
- o = album.json && album.json.content && album.json.content[n] && null != album.json.content[n].nextPhoto && "" !== album.json.content[n].nextPhoto,
- i = album.json && album.json.content && album.json.content[n] && null != album.json.content[n].previousPhoto && "" !== album.json.content[n].previousPhoto;
- if (!1 === o || !0 === lychee.viewMode) e.hide();
- else {
- var a = album.json.content[n].nextPhoto,
- r = album.json.content[a];
- e.css("background-image", lychee.html(_templateObject41, r.thumbUrl))
- }
- if (!1 === i || !0 === lychee.viewMode) t.hide();
- else {
- var l = album.json.content[n].previousPhoto,
- s = album.json.content[l];
- t.css("background-image", lychee.html(_templateObject41, s.thumbUrl))
- }
- }),
- sidebar: function(e) {
- function t() {
- return e.apply(this, arguments)
- }
- return t.toString = function() {
- return e.toString()
- }, t
- }(function() {
- var e = sidebar.createStructure.photo(photo.json),
- t = sidebar.render(e);
- sidebar.dom(".sidebar__wrapper").html(t), sidebar.bind()
- })
- }, visible = {}, visible.albums = function() {
- return !!header.dom(".header__toolbar--public").hasClass("header__toolbar--visible") || !!header.dom(".header__toolbar--albums").hasClass("header__toolbar--visible")
- }, visible.album = function() {
- return !!header.dom(".header__toolbar--album").hasClass("header__toolbar--visible")
- }, visible.photo = function() {
- return $("#imageview.fadeIn").length > 0
- }, visible.search = function() {
- return null != search.hash
- }, visible.sidebar = function() {
- return !0 === sidebar.dom().hasClass("active")
- }, visible.sidebarbutton = function() {
- return !!visible.photo() || !!(visible.album() && $("#button_info_album:visible").length > 0)
- }, visible.header = function() {
- return !0 !== header.dom().hasClass("header--hidden")
- }, visible.contextMenu = function() {
- return basicContext.visible()
- }, visible.multiselect = function() {
- return $("#multiselect").length > 0
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement