Created
December 3, 2016 05:40
-
-
Save severi/4f9dc5048010fb65afdaa5931f87e0c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| "use strict"; | |
| var a = function(a) { | |
| var b, c; | |
| for (var d = 1, e = arguments.length; d < e; d++) { | |
| b = arguments[d]; | |
| for (c in b) { | |
| if (Object.prototype.hasOwnProperty.call(b, c)) { | |
| a[c] = b[c] | |
| } | |
| } | |
| } | |
| return a | |
| }; | |
| function b(b) { | |
| var i = { | |
| identity: "non detected", | |
| version: "all", | |
| minorVersion: undefined, | |
| type: ["mobile", "tablet", "desktop"], | |
| browser: undefined | |
| }; | |
| var j; | |
| var k = [{ | |
| testString: "Chrome", | |
| identity: "test", | |
| type: ["mobile", "tablet", "desktop"] | |
| }, { | |
| testString: "CrOS", | |
| identity: "ChromeOS", | |
| type: ["desktop"] | |
| }, { | |
| testString: "Windows", | |
| identity: "windows", | |
| type: ["desktop"] | |
| }, { | |
| testString: "Firefox", | |
| browser: "firefox", | |
| desktopVersion: g(b) | |
| }, { | |
| testString: "WebKit", | |
| webkitVersion: h(b) | |
| }, { | |
| testString: "OS X", | |
| type: ["desktop"] | |
| }, { | |
| testString: "Linux", | |
| type: ["desktop"] | |
| }, { | |
| testString: new RegExp("mobile", "i"), | |
| type: ["mobile", "tablet"] | |
| }, { | |
| testString: new RegExp("tablet", "i"), | |
| type: ["tablet"] | |
| }, { | |
| testString: new RegExp("desktop", "i"), | |
| type: ["desktop"] | |
| }, { | |
| testString: "MSIE", | |
| browser: "ie", | |
| type: ["desktop"], | |
| desktopVersion: f(b) | |
| }, { | |
| testString: "iPhone", | |
| identity: "iphone", | |
| type: ["mobile"] | |
| }, { | |
| testString: "iPod", | |
| identity: "ipod", | |
| type: ["mobile"] | |
| }, { | |
| testString: "iPad", | |
| identity: "ipad", | |
| type: ["tablet"] | |
| }, { | |
| testString: "CriOS", | |
| browser: "chrome" | |
| }, { | |
| testString: "Symbian", | |
| identity: "symbian", | |
| type: ["mobile"] | |
| }, { | |
| testString: "Series60/5", | |
| identity: "symbian", | |
| version: "S60_5th", | |
| type: ["mobile"] | |
| }, { | |
| testString: "Series60/3", | |
| identity: "symbian", | |
| version: "S60_3rd", | |
| type: ["mobile"] | |
| }, { | |
| testString: "Symbian/3", | |
| identity: "symbian", | |
| version: "3", | |
| type: ["mobile"] | |
| }, { | |
| testString: "BrowserNG/7.2", | |
| identity: "symbian", | |
| version: "pre-anna", | |
| type: ["mobile"] | |
| }, { | |
| testString: "Android", | |
| identity: "android", | |
| type: ["tablet"] | |
| }, { | |
| testString: /Android.*Mobile|Mobile.*Android/gi, | |
| type: ["mobile"] | |
| }, { | |
| testString: /Android.*Chrome/gi, | |
| browser: "chrome" | |
| }, { | |
| testString: "Windows Phone", | |
| identity: "windowsPhone", | |
| type: ["mobile"] | |
| }, { | |
| testString: /WPDesktop/gi, | |
| identity: "windowsPhone", | |
| version: "8", | |
| type: ["mobile"] | |
| }, { | |
| testString: "MeeGo", | |
| identity: "meego", | |
| type: ["mobile"] | |
| }, { | |
| testString: "Maemo", | |
| identity: "Maemo", | |
| type: ["mobile"] | |
| }, { | |
| testString: /sailfish/i, | |
| identity: "sailfish", | |
| type: ["mobile"] | |
| }, { | |
| testString: /Mobile.*Firefox/, | |
| browser: "mobileFirefox", | |
| version: g(b) | |
| }, { | |
| testString: "Opera Mini", | |
| identity: "operamini", | |
| type: ["mobile"] | |
| }, { | |
| testString: /(?=.*Linux x86_64)(?=.*osre)|S40OviBrowser/gi, | |
| identity: "asha", | |
| type: ["mobile"] | |
| }]; | |
| function l(a, b) { | |
| if (typeof b === "string") { | |
| return a.indexOf(b) !== -1 | |
| } else { | |
| return a.search(b) !== -1 | |
| } | |
| } | |
| for (var m = 0; m < k.length; m++) { | |
| if (l(b, k[m].testString)) { | |
| i = a(i, k[m]) | |
| } | |
| } | |
| if (["iphone", "ipad", "ipod"].indexOf(i.identity) > -1 && i.version === "all") { | |
| i.version = c(b) | |
| } | |
| if (i.identity === "android" && i.browser !== "mobileFirefox") { | |
| j = d(b); | |
| i.version = j.major; | |
| i.minorVersion = j.minor | |
| } | |
| if (i.identity === "windowsPhone") { | |
| j = e(b); | |
| i.version = j.major; | |
| i.minorVersion = j.minor | |
| } | |
| return i | |
| } | |
| function c(a) { | |
| try { | |
| var b = new RegExp(".*OS (\\d+)_.* like Mac OS X.*", "i"); | |
| var c = b.exec(a)[1]; | |
| return c | |
| } catch (a) {} | |
| } | |
| function d(a) { | |
| var b, c; | |
| var d = new RegExp("Android (\\d+).(\\d+)?", "i"); | |
| var e = d.exec(a); | |
| if (e !== null && e.length && e.length === 3) { | |
| if (typeof e[1] === "string") { | |
| b = parseInt(e[1], 10) | |
| } | |
| if (typeof e[2] === "string") { | |
| c = parseInt(e[2], 10) | |
| } | |
| } | |
| return { | |
| major: b, | |
| minor: c | |
| } | |
| } | |
| function e(a) { | |
| if (a.match(/WPDesktop/)) { | |
| return { | |
| major: 8, | |
| minor: 0 | |
| } | |
| } | |
| var b, c; | |
| var d = new RegExp("Windows Phone (OS )?(\\d+).(\\d+)?", "i"); | |
| var e = d.exec(a); | |
| if (e !== null && e.length && e.length === 4) { | |
| if (typeof e[2] === "string") { | |
| b = parseInt(e[2], 10) | |
| } | |
| if (typeof e[3] === "string") { | |
| c = parseInt(e[3], 10) | |
| } | |
| } | |
| return { | |
| major: b, | |
| minor: c | |
| } | |
| } | |
| function f(a) { | |
| var b = /MSIE\s+(\d+)/i.exec(a); | |
| return b ? parseInt(b[1], 10) : -1 | |
| } | |
| function g(a) { | |
| var b = /Firefox\/(\d+)/i.exec(a); | |
| return b ? parseInt(b[1], 10) : -1 | |
| } | |
| function h(a) { | |
| var b = /WebKit\/([\d\.]+)/i.exec(a); | |
| return b ? parseInt(b[1], 10) : -1 | |
| } | |
| function i(a, b, c) { | |
| var d = 350; | |
| if (a.length > 1 || a[0] !== "desktop") { | |
| return false | |
| } | |
| if (b >= d && c >= d) { | |
| return true | |
| } | |
| return false | |
| } | |
| window.Detect = { | |
| detectDevice: b, | |
| isDesktop: i | |
| } | |
| })(); | |
| (function(a, b) { | |
| if (typeof module === "object" && typeof module.exports === "object") { | |
| module.exports = a.document ? b(a, true) : function(a) { | |
| if (!a.document) { | |
| throw new Error("jQuery requires a window with a document") | |
| } | |
| return b(a) | |
| } | |
| } else { | |
| b(a) | |
| } | |
| })(typeof window !== "undefined" ? window : this, function(a, b) { | |
| var c = []; | |
| var d = c.slice; | |
| var e = c.concat; | |
| var f = c.push; | |
| var g = c.indexOf; | |
| var h = {}; | |
| var i = h.toString; | |
| var j = h.hasOwnProperty; | |
| var k = {}; | |
| var l = a.document, | |
| m = "2.1.1", | |
| n = function(a, b) { | |
| return new n.fn.init(a, b) | |
| }, | |
| o = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, | |
| p = /^-ms-/, | |
| q = /-([\da-z])/gi, | |
| r = function(a, b) { | |
| return b.toUpperCase() | |
| }; | |
| n.fn = n.prototype = { | |
| jquery: m, | |
| constructor: n, | |
| selector: "", | |
| length: 0, | |
| toArray: function() { | |
| return d.call(this) | |
| }, | |
| get: function(a) { | |
| return a != null ? a < 0 ? this[a + this.length] : this[a] : d.call(this) | |
| }, | |
| pushStack: function(a) { | |
| var b = n.merge(this.constructor(), a); | |
| b.prevObject = this; | |
| b.context = this.context; | |
| return b | |
| }, | |
| each: function(a, b) { | |
| return n.each(this, a, b) | |
| }, | |
| map: function(a) { | |
| return this.pushStack(n.map(this, function(b, c) { | |
| return a.call(b, c, b) | |
| })) | |
| }, | |
| slice: function() { | |
| return this.pushStack(d.apply(this, arguments)) | |
| }, | |
| first: function() { | |
| return this.eq(0) | |
| }, | |
| last: function() { | |
| return this.eq(-1) | |
| }, | |
| eq: function(a) { | |
| var b = this.length, | |
| c = +a + (a < 0 ? b : 0); | |
| return this.pushStack(c >= 0 && c < b ? [this[c]] : []) | |
| }, | |
| end: function() { | |
| return this.prevObject || this.constructor(null) | |
| }, | |
| push: f, | |
| sort: c.sort, | |
| splice: c.splice | |
| }; | |
| n.extend = n.fn.extend = function() { | |
| var a, b, c, d, e, f, g = arguments[0] || {}, | |
| h = 1, | |
| i = arguments.length, | |
| j = false; | |
| if (typeof g === "boolean") { | |
| j = g; | |
| g = arguments[h] || {}; | |
| h++ | |
| } | |
| if (typeof g !== "object" && !n.isFunction(g)) { | |
| g = {} | |
| } | |
| if (h === i) { | |
| g = this; | |
| h-- | |
| } | |
| for (; h < i; h++) { | |
| if ((a = arguments[h]) != null) { | |
| for (b in a) { | |
| c = g[b]; | |
| d = a[b]; | |
| if (g === d) { | |
| continue | |
| } | |
| if (j && d && (n.isPlainObject(d) || (e = n.isArray(d)))) { | |
| if (e) { | |
| e = false; | |
| f = c && n.isArray(c) ? c : [] | |
| } else { | |
| f = c && n.isPlainObject(c) ? c : {} | |
| } | |
| g[b] = n.extend(j, f, d) | |
| } else if (d !== undefined) { | |
| g[b] = d | |
| } | |
| } | |
| } | |
| } | |
| return g | |
| }; | |
| n.extend({ | |
| expando: "jQuery" + (m + Math.random()).replace(/\D/g, ""), | |
| isReady: true, | |
| error: function(a) { | |
| throw new Error(a) | |
| }, | |
| noop: function() {}, | |
| isFunction: function(a) { | |
| return n.type(a) === "function" | |
| }, | |
| isArray: Array.isArray, | |
| isWindow: function(a) { | |
| return a != null && a === a.window | |
| }, | |
| isNumeric: function(a) { | |
| return !n.isArray(a) && a - parseFloat(a) >= 0 | |
| }, | |
| isPlainObject: function(a) { | |
| if (n.type(a) !== "object" || a.nodeType || n.isWindow(a)) { | |
| return false | |
| } | |
| if (a.constructor && !j.call(a.constructor.prototype, "isPrototypeOf")) { | |
| return false | |
| } | |
| return true | |
| }, | |
| isEmptyObject: function(a) { | |
| var b; | |
| for (b in a) { | |
| return false | |
| } | |
| return true | |
| }, | |
| type: function(a) { | |
| if (a == null) { | |
| return a + "" | |
| } | |
| return typeof a === "object" || typeof a === "function" ? h[i.call(a)] || "object" : typeof a | |
| }, | |
| globalEval: function(a) { | |
| var b, c = eval; | |
| a = n.trim(a); | |
| if (a) { | |
| if (a.indexOf("use strict") === 1) { | |
| b = l.createElement("script"); | |
| b.text = a; | |
| l.head.appendChild(b).parentNode.removeChild(b) | |
| } else { | |
| c(a) | |
| } | |
| } | |
| }, | |
| camelCase: function(a) { | |
| return a.replace(p, "ms-").replace(q, r) | |
| }, | |
| nodeName: function(a, b) { | |
| return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() | |
| }, | |
| each: function(a, b, c) { | |
| var d, e = 0, | |
| f = a.length, | |
| g = s(a); | |
| if (c) { | |
| if (g) { | |
| for (; e < f; e++) { | |
| d = b.apply(a[e], c); | |
| if (d === false) { | |
| break | |
| } | |
| } | |
| } else { | |
| for (e in a) { | |
| d = b.apply(a[e], c); | |
| if (d === false) { | |
| break | |
| } | |
| } | |
| } | |
| } else { | |
| if (g) { | |
| for (; e < f; e++) { | |
| d = b.call(a[e], e, a[e]); | |
| if (d === false) { | |
| break | |
| } | |
| } | |
| } else { | |
| for (e in a) { | |
| d = b.call(a[e], e, a[e]); | |
| if (d === false) { | |
| break | |
| } | |
| } | |
| } | |
| } | |
| return a | |
| }, | |
| trim: function(a) { | |
| return a == null ? "" : (a + "").replace(o, "") | |
| }, | |
| makeArray: function(a, b) { | |
| var c = b || []; | |
| if (a != null) { | |
| if (s(Object(a))) { | |
| n.merge(c, typeof a === "string" ? [a] : a) | |
| } else { | |
| f.call(c, a) | |
| } | |
| } | |
| return c | |
| }, | |
| inArray: function(a, b, c) { | |
| return b == null ? -1 : g.call(b, a, c) | |
| }, | |
| merge: function(a, b) { | |
| var c = +b.length, | |
| d = 0, | |
| e = a.length; | |
| for (; d < c; d++) { | |
| a[e++] = b[d] | |
| } | |
| a.length = e; | |
| return a | |
| }, | |
| grep: function(a, b, c) { | |
| var d, e = [], | |
| f = 0, | |
| g = a.length, | |
| h = !c; | |
| for (; f < g; f++) { | |
| d = !b(a[f], f); | |
| if (d !== h) { | |
| e.push(a[f]) | |
| } | |
| } | |
| return e | |
| }, | |
| map: function(a, b, c) { | |
| var d, f = 0, | |
| g = a.length, | |
| h = s(a), | |
| i = []; | |
| if (h) { | |
| for (; f < g; f++) { | |
| d = b(a[f], f, c); | |
| if (d != null) { | |
| i.push(d) | |
| } | |
| } | |
| } else { | |
| for (f in a) { | |
| d = b(a[f], f, c); | |
| if (d != null) { | |
| i.push(d) | |
| } | |
| } | |
| } | |
| return e.apply([], i) | |
| }, | |
| guid: 1, | |
| proxy: function(a, b) { | |
| var c, e, f; | |
| if (typeof b === "string") { | |
| c = a[b]; | |
| b = a; | |
| a = c | |
| } | |
| if (!n.isFunction(a)) { | |
| return undefined | |
| } | |
| e = d.call(arguments, 2); | |
| f = function() { | |
| return a.apply(b || this, e.concat(d.call(arguments))) | |
| }; | |
| f.guid = a.guid = a.guid || n.guid++; | |
| return f | |
| }, | |
| now: Date.now, | |
| support: k | |
| }); | |
| n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(a, b) { | |
| h["[object " + b + "]"] = b.toLowerCase() | |
| }); | |
| function s(a) { | |
| var b = a.length, | |
| c = n.type(a); | |
| if (c === "function" || n.isWindow(a)) { | |
| return false | |
| } | |
| if (a.nodeType === 1 && b) { | |
| return true | |
| } | |
| return c === "array" || b === 0 || typeof b === "number" && b > 0 && b - 1 in a | |
| } | |
| var t = function(a) { | |
| var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + -new Date, | |
| v = a.document, | |
| w = 0, | |
| x = 0, | |
| y = fa(), | |
| z = fa(), | |
| A = fa(), | |
| B = function(a, b) { | |
| if (a === b) { | |
| l = true | |
| } | |
| return 0 | |
| }, | |
| C = typeof undefined, | |
| D = 1 << 31, | |
| E = {}.hasOwnProperty, | |
| F = [], | |
| G = F.pop, | |
| H = F.push, | |
| I = F.push, | |
| J = F.slice, | |
| K = F.indexOf || function(a) { | |
| var b = 0, | |
| c = this.length; | |
| for (; b < c; b++) { | |
| if (this[b] === a) { | |
| return b | |
| } | |
| } | |
| return -1 | |
| }, | |
| L = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", | |
| M = "[\\x20\\t\\r\\n\\f]", | |
| N = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", | |
| O = N.replace("w", "w#"), | |
| P = "\\[" + M + "*(" + N + ")(?:" + M + "*([*^$|!~]?=)" + M + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + O + "))|)" + M + "*\\]", | |
| Q = ":(" + N + ")(?:\\((" + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + "((?:\\\\.|[^\\\\()[\\]]|" + P + ")*)|" + ".*" + ")\\)|)", | |
| R = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"), | |
| S = new RegExp("^" + M + "*," + M + "*"), | |
| T = new RegExp("^" + M + "*([>+~]|" + M + ")" + M + "*"), | |
| U = new RegExp("=" + M + "*([^\\]'\"]*?)" + M + "*\\]", "g"), | |
| V = new RegExp(Q), | |
| W = new RegExp("^" + O + "$"), | |
| X = { | |
| ID: new RegExp("^#(" + N + ")"), | |
| CLASS: new RegExp("^\\.(" + N + ")"), | |
| TAG: new RegExp("^(" + N.replace("w", "w*") + ")"), | |
| ATTR: new RegExp("^" + P), | |
| PSEUDO: new RegExp("^" + Q), | |
| CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"), | |
| bool: new RegExp("^(?:" + L + ")$", "i"), | |
| needsContext: new RegExp("^" + M + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + M + "*((?:-\\d)?\\d*)" + M + "*\\)|)(?=[^-]|$)", "i") | |
| }, | |
| Y = /^(?:input|select|textarea|button)$/i, | |
| Z = /^h\d$/i, | |
| $ = /^[^{]+\{\s*\[native \w/, | |
| _ = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, | |
| aa = /[+~]/, | |
| ba = /'|\\/g, | |
| ca = new RegExp("\\\\([\\da-f]{1,6}" + M + "?|(" + M + ")|.)", "ig"), | |
| da = function(a, b, c) { | |
| var d = "0x" + b - 65536; | |
| return d !== d || c ? b : d < 0 ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, d & 1023 | 56320) | |
| }; | |
| try { | |
| I.apply(F = J.call(v.childNodes), v.childNodes); | |
| F[v.childNodes.length].nodeType | |
| } catch (a) { | |
| I = { | |
| apply: F.length ? function(a, b) { | |
| H.apply(a, J.call(b)) | |
| } : function(a, b) { | |
| var c = a.length, | |
| d = 0; | |
| while (a[c++] = b[d++]) {} | |
| a.length = c - 1 | |
| } | |
| } | |
| } | |
| function ea(a, b, d, e) { | |
| var f, h, j, k, l, o, r, s, w, x; | |
| if ((b ? b.ownerDocument || b : v) !== n) { | |
| m(b) | |
| } | |
| b = b || n; | |
| d = d || []; | |
| if (!a || typeof a !== "string") { | |
| return d | |
| } | |
| if ((k = b.nodeType) !== 1 && k !== 9) { | |
| return [] | |
| } | |
| if (p && !e) { | |
| if (f = _.exec(a)) { | |
| if (j = f[1]) { | |
| if (k === 9) { | |
| h = b.getElementById(j); | |
| if (h && h.parentNode) { | |
| if (h.id === j) { | |
| d.push(h); | |
| return d | |
| } | |
| } else { | |
| return d | |
| } | |
| } else { | |
| if (b.ownerDocument && (h = b.ownerDocument.getElementById(j)) && t(b, h) && h.id === j) { | |
| d.push(h); | |
| return d | |
| } | |
| } | |
| } else if (f[2]) { | |
| I.apply(d, b.getElementsByTagName(a)); | |
| return d | |
| } else if ((j = f[3]) && c.getElementsByClassName && b.getElementsByClassName) { | |
| I.apply(d, b.getElementsByClassName(j)); | |
| return d | |
| } | |
| } | |
| if (c.qsa && (!q || !q.test(a))) { | |
| s = r = u; | |
| w = b; | |
| x = k === 9 && a; | |
| if (k === 1 && b.nodeName.toLowerCase() !== "object") { | |
| o = g(a); | |
| if (r = b.getAttribute("id")) { | |
| s = r.replace(ba, "\\$&") | |
| } else { | |
| b.setAttribute("id", s) | |
| } | |
| s = "[id='" + s + "'] "; | |
| l = o.length; | |
| while (l--) { | |
| o[l] = s + pa(o[l]) | |
| } | |
| w = aa.test(a) && na(b.parentNode) || b; | |
| x = o.join(",") | |
| } | |
| if (x) { | |
| try { | |
| I.apply(d, w.querySelectorAll(x)); | |
| return d | |
| } catch (a) {} finally { | |
| if (!r) { | |
| b.removeAttribute("id") | |
| } | |
| } | |
| } | |
| } | |
| } | |
| return i(a.replace(R, "$1"), b, d, e) | |
| } | |
| function fa() { | |
| var a = []; | |
| function b(c, e) { | |
| if (a.push(c + " ") > d.cacheLength) { | |
| delete b[a.shift()] | |
| } | |
| return b[c + " "] = e | |
| } | |
| return b | |
| } | |
| function ga(a) { | |
| a[u] = true; | |
| return a | |
| } | |
| function ha(a) { | |
| var b = n.createElement("div"); | |
| try { | |
| return !!a(b) | |
| } catch (a) { | |
| return false | |
| } finally { | |
| if (b.parentNode) { | |
| b.parentNode.removeChild(b) | |
| } | |
| b = null | |
| } | |
| } | |
| function ia(a, b) { | |
| var c = a.split("|"), | |
| e = a.length; | |
| while (e--) { | |
| d.attrHandle[c[e]] = b | |
| } | |
| } | |
| function ja(a, b) { | |
| var c = b && a, | |
| d = c && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || D) - (~a.sourceIndex || D); | |
| if (d) { | |
| return d | |
| } | |
| if (c) { | |
| while (c = c.nextSibling) { | |
| if (c === b) { | |
| return -1 | |
| } | |
| } | |
| } | |
| return a ? 1 : -1 | |
| } | |
| function ka(a) { | |
| return function(b) { | |
| var c = b.nodeName.toLowerCase(); | |
| return c === "input" && b.type === a | |
| } | |
| } | |
| function la(a) { | |
| return function(b) { | |
| var c = b.nodeName.toLowerCase(); | |
| return (c === "input" || c === "button") && b.type === a | |
| } | |
| } | |
| function ma(a) { | |
| return ga(function(b) { | |
| b = +b; | |
| return ga(function(c, d) { | |
| var e, f = a([], c.length, b), | |
| g = f.length; | |
| while (g--) { | |
| if (c[e = f[g]]) { | |
| c[e] = !(d[e] = c[e]) | |
| } | |
| } | |
| }) | |
| }) | |
| } | |
| function na(a) { | |
| return a && typeof a.getElementsByTagName !== C && a | |
| } | |
| c = ea.support = {}; | |
| f = ea.isXML = function(a) { | |
| var b = a && (a.ownerDocument || a).documentElement; | |
| return b ? b.nodeName !== "HTML" : false | |
| }; | |
| m = ea.setDocument = function(a) { | |
| var b, e = a ? a.ownerDocument || a : v, | |
| g = e.defaultView; | |
| if (e === n || e.nodeType !== 9 || !e.documentElement) { | |
| return n | |
| } | |
| n = e; | |
| o = e.documentElement; | |
| p = !f(e); | |
| if (g && g !== g.top) { | |
| if (g.addEventListener) { | |
| g.addEventListener("unload", function() { | |
| m() | |
| }, false) | |
| } else if (g.attachEvent) { | |
| g.attachEvent("onunload", function() { | |
| m() | |
| }) | |
| } | |
| } | |
| c.attributes = ha(function(a) { | |
| a.className = "i"; | |
| return !a.getAttribute("className") | |
| }); | |
| c.getElementsByTagName = ha(function(a) { | |
| a.appendChild(e.createComment("")); | |
| return !a.getElementsByTagName("*").length | |
| }); | |
| c.getElementsByClassName = $.test(e.getElementsByClassName) && ha(function(a) { | |
| a.innerHTML = "<div class='a'></div><div class='a i'></div>"; | |
| a.firstChild.className = "i"; | |
| return a.getElementsByClassName("i").length === 2 | |
| }); | |
| c.getById = ha(function(a) { | |
| o.appendChild(a).id = u; | |
| return !e.getElementsByName || !e.getElementsByName(u).length | |
| }); | |
| if (c.getById) { | |
| d.find["ID"] = function(a, b) { | |
| if (typeof b.getElementById !== C && p) { | |
| var c = b.getElementById(a); | |
| return c && c.parentNode ? [c] : [] | |
| } | |
| }; | |
| d.filter["ID"] = function(a) { | |
| var b = a.replace(ca, da); | |
| return function(a) { | |
| return a.getAttribute("id") === b | |
| } | |
| } | |
| } else { | |
| delete d.find["ID"]; | |
| d.filter["ID"] = function(a) { | |
| var b = a.replace(ca, da); | |
| return function(a) { | |
| var c = typeof a.getAttributeNode !== C && a.getAttributeNode("id"); | |
| return c && c.value === b | |
| } | |
| } | |
| } | |
| d.find["TAG"] = c.getElementsByTagName ? function(a, b) { | |
| if (typeof b.getElementsByTagName !== C) { | |
| return b.getElementsByTagName(a) | |
| } | |
| } : function(a, b) { | |
| var c, d = [], | |
| e = 0, | |
| f = b.getElementsByTagName(a); | |
| if (a === "*") { | |
| while (c = f[e++]) { | |
| if (c.nodeType === 1) { | |
| d.push(c) | |
| } | |
| } | |
| return d | |
| } | |
| return f | |
| }; | |
| d.find["CLASS"] = c.getElementsByClassName && function(a, b) { | |
| if (typeof b.getElementsByClassName !== C && p) { | |
| return b.getElementsByClassName(a) | |
| } | |
| }; | |
| r = []; | |
| q = []; | |
| if (c.qsa = $.test(e.querySelectorAll)) { | |
| ha(function(a) { | |
| a.innerHTML = "<select msallowclip=''><option selected=''></option></select>"; | |
| if (a.querySelectorAll("[msallowclip^='']").length) { | |
| q.push("[*^$]=" + M + "*(?:''|\"\")") | |
| } | |
| if (!a.querySelectorAll("[selected]").length) { | |
| q.push("\\[" + M + "*(?:value|" + L + ")") | |
| } | |
| if (!a.querySelectorAll(":checked").length) { | |
| q.push(":checked") | |
| } | |
| }); | |
| ha(function(a) { | |
| var b = e.createElement("input"); | |
| b.setAttribute("type", "hidden"); | |
| a.appendChild(b).setAttribute("name", "D"); | |
| if (a.querySelectorAll("[name=d]").length) { | |
| q.push("name" + M + "*[*^$|!~]?=") | |
| } | |
| if (!a.querySelectorAll(":enabled").length) { | |
| q.push(":enabled", ":disabled") | |
| } | |
| a.querySelectorAll("*,:x"); | |
| q.push(",.*:") | |
| }) | |
| } | |
| if (c.matchesSelector = $.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) { | |
| ha(function(a) { | |
| c.disconnectedMatch = s.call(a, "div"); | |
| s.call(a, "[s!='']:x"); | |
| r.push("!=", Q) | |
| }) | |
| } | |
| q = q.length && new RegExp(q.join("|")); | |
| r = r.length && new RegExp(r.join("|")); | |
| b = $.test(o.compareDocumentPosition); | |
| t = b || $.test(o.contains) ? function(a, b) { | |
| var c = a.nodeType === 9 ? a.documentElement : a, | |
| d = b && b.parentNode; | |
| return a === d || !!(d && d.nodeType === 1 && (c.contains ? c.contains(d) : a.compareDocumentPosition && a.compareDocumentPosition(d) & 16)) | |
| } : function(a, b) { | |
| if (b) { | |
| while (b = b.parentNode) { | |
| if (b === a) { | |
| return true | |
| } | |
| } | |
| } | |
| return false | |
| }; | |
| B = b ? function(a, b) { | |
| if (a === b) { | |
| l = true; | |
| return 0 | |
| } | |
| var d = !a.compareDocumentPosition - !b.compareDocumentPosition; | |
| if (d) { | |
| return d | |
| } | |
| d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1; | |
| if (d & 1 || !c.sortDetached && b.compareDocumentPosition(a) === d) { | |
| if (a === e || a.ownerDocument === v && t(v, a)) { | |
| return -1 | |
| } | |
| if (b === e || b.ownerDocument === v && t(v, b)) { | |
| return 1 | |
| } | |
| return k ? K.call(k, a) - K.call(k, b) : 0 | |
| } | |
| return d & 4 ? -1 : 1 | |
| } : function(a, b) { | |
| if (a === b) { | |
| l = true; | |
| return 0 | |
| } | |
| var c, d = 0, | |
| f = a.parentNode, | |
| g = b.parentNode, | |
| h = [a], | |
| i = [b]; | |
| if (!f || !g) { | |
| return a === e ? -1 : b === e ? 1 : f ? -1 : g ? 1 : k ? K.call(k, a) - K.call(k, b) : 0 | |
| } else if (f === g) { | |
| return ja(a, b) | |
| } | |
| c = a; | |
| while (c = c.parentNode) { | |
| h.unshift(c) | |
| } | |
| c = b; | |
| while (c = c.parentNode) { | |
| i.unshift(c) | |
| } | |
| while (h[d] === i[d]) { | |
| d++ | |
| } | |
| return d ? ja(h[d], i[d]) : h[d] === v ? -1 : i[d] === v ? 1 : 0 | |
| }; | |
| return e | |
| }; | |
| ea.matches = function(a, b) { | |
| return ea(a, null, null, b) | |
| }; | |
| ea.matchesSelector = function(a, b) { | |
| if ((a.ownerDocument || a) !== n) { | |
| m(a) | |
| } | |
| b = b.replace(U, "='$1']"); | |
| if (c.matchesSelector && p && (!r || !r.test(b)) && (!q || !q.test(b))) { | |
| try { | |
| var d = s.call(a, b); | |
| if (d || c.disconnectedMatch || a.document && a.document.nodeType !== 11) { | |
| return d | |
| } | |
| } catch (a) {} | |
| } | |
| return ea(b, n, null, [a]).length > 0 | |
| }; | |
| ea.contains = function(a, b) { | |
| if ((a.ownerDocument || a) !== n) { | |
| m(a) | |
| } | |
| return t(a, b) | |
| }; | |
| ea.attr = function(a, b) { | |
| if ((a.ownerDocument || a) !== n) { | |
| m(a) | |
| } | |
| var e = d.attrHandle[b.toLowerCase()], | |
| f = e && E.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : undefined; | |
| return f !== undefined ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null | |
| }; | |
| ea.error = function(a) { | |
| throw new Error("Syntax error, unrecognized expression: " + a) | |
| }; | |
| ea.uniqueSort = function(a) { | |
| var b, d = [], | |
| e = 0, | |
| f = 0; | |
| l = !c.detectDuplicates; | |
| k = !c.sortStable && a.slice(0); | |
| a.sort(B); | |
| if (l) { | |
| while (b = a[f++]) { | |
| if (b === a[f]) { | |
| e = d.push(f) | |
| } | |
| } | |
| while (e--) { | |
| a.splice(d[e], 1) | |
| } | |
| } | |
| k = null; | |
| return a | |
| }; | |
| e = ea.getText = function(a) { | |
| var b, c = "", | |
| d = 0, | |
| f = a.nodeType; | |
| if (!f) { | |
| while (b = a[d++]) { | |
| c += e(b) | |
| } | |
| } else if (f === 1 || f === 9 || f === 11) { | |
| if (typeof a.textContent === "string") { | |
| return a.textContent | |
| } else { | |
| for (a = a.firstChild; a; a = a.nextSibling) { | |
| c += e(a) | |
| } | |
| } | |
| } else if (f === 3 || f === 4) { | |
| return a.nodeValue | |
| } | |
| return c | |
| }; | |
| d = ea.selectors = { | |
| cacheLength: 50, | |
| createPseudo: ga, | |
| match: X, | |
| attrHandle: {}, | |
| find: {}, | |
| relative: { | |
| ">": { | |
| dir: "parentNode", | |
| first: true | |
| }, | |
| " ": { | |
| dir: "parentNode" | |
| }, | |
| "+": { | |
| dir: "previousSibling", | |
| first: true | |
| }, | |
| "~": { | |
| dir: "previousSibling" | |
| } | |
| }, | |
| preFilter: { | |
| ATTR: function(a) { | |
| a[1] = a[1].replace(ca, da); | |
| a[3] = (a[3] || a[4] || a[5] || "").replace(ca, da); | |
| if (a[2] === "~=") { | |
| a[3] = " " + a[3] + " " | |
| } | |
| return a.slice(0, 4) | |
| }, | |
| CHILD: function(a) { | |
| a[1] = a[1].toLowerCase(); | |
| if (a[1].slice(0, 3) === "nth") { | |
| if (!a[3]) { | |
| ea.error(a[0]) | |
| } | |
| a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * (a[3] === "even" || a[3] === "odd")); | |
| a[5] = +(a[7] + a[8] || a[3] === "odd") | |
| } else if (a[3]) { | |
| ea.error(a[0]) | |
| } | |
| return a | |
| }, | |
| PSEUDO: function(a) { | |
| var b, c = !a[6] && a[2]; | |
| if (X["CHILD"].test(a[0])) { | |
| return null | |
| } | |
| if (a[3]) { | |
| a[2] = a[4] || a[5] || "" | |
| } else if (c && V.test(c) && (b = g(c, true)) && (b = c.indexOf(")", c.length - b) - c.length)) { | |
| a[0] = a[0].slice(0, b); | |
| a[2] = c.slice(0, b) | |
| } | |
| return a.slice(0, 3) | |
| } | |
| }, | |
| filter: { | |
| TAG: function(a) { | |
| var b = a.replace(ca, da).toLowerCase(); | |
| return a === "*" ? function() { | |
| return true | |
| } : function(a) { | |
| return a.nodeName && a.nodeName.toLowerCase() === b | |
| } | |
| }, | |
| CLASS: function(a) { | |
| var b = y[a + " "]; | |
| return b || (b = new RegExp("(^|" + M + ")" + a + "(" + M + "|$)")) && y(a, function(a) { | |
| return b.test(typeof a.className === "string" && a.className || typeof a.getAttribute !== C && a.getAttribute("class") || "") | |
| }) | |
| }, | |
| ATTR: function(a, b, c) { | |
| return function(d) { | |
| var e = ea.attr(d, a); | |
| if (e == null) { | |
| return b === "!=" | |
| } | |
| if (!b) { | |
| return true | |
| } | |
| e += ""; | |
| return b === "=" ? e === c : b === "!=" ? e !== c : b === "^=" ? c && e.indexOf(c) === 0 : b === "*=" ? c && e.indexOf(c) > -1 : b === "$=" ? c && e.slice(-c.length) === c : b === "~=" ? (" " + e + " ").indexOf(c) > -1 : b === "|=" ? e === c || e.slice(0, c.length + 1) === c + "-" : false | |
| } | |
| }, | |
| CHILD: function(a, b, c, d, e) { | |
| var f = a.slice(0, 3) !== "nth", | |
| g = a.slice(-4) !== "last", | |
| h = b === "of-type"; | |
| return d === 1 && e === 0 ? function(a) { | |
| return !!a.parentNode | |
| } : function(b, c, i) { | |
| var j, k, l, m, n, o, p = f !== g ? "nextSibling" : "previousSibling", | |
| q = b.parentNode, | |
| r = h && b.nodeName.toLowerCase(), | |
| s = !i && !h; | |
| if (q) { | |
| if (f) { | |
| while (p) { | |
| l = b; | |
| while (l = l[p]) { | |
| if (h ? l.nodeName.toLowerCase() === r : l.nodeType === 1) { | |
| return false | |
| } | |
| } | |
| o = p = a === "only" && !o && "nextSibling" | |
| } | |
| return true | |
| } | |
| o = [g ? q.firstChild : q.lastChild]; | |
| if (g && s) { | |
| k = q[u] || (q[u] = {}); | |
| j = k[a] || []; | |
| n = j[0] === w && j[1]; | |
| m = j[0] === w && j[2]; | |
| l = n && q.childNodes[n]; | |
| while (l = ++n && l && l[p] || (m = n = 0) || o.pop()) { | |
| if (l.nodeType === 1 && ++m && l === b) { | |
| k[a] = [w, n, m]; | |
| break | |
| } | |
| } | |
| } else if (s && (j = (b[u] || (b[u] = {}))[a]) && j[0] === w) { | |
| m = j[1] | |
| } else { | |
| while (l = ++n && l && l[p] || (m = n = 0) || o.pop()) { | |
| if ((h ? l.nodeName.toLowerCase() === r : l.nodeType === 1) && ++m) { | |
| if (s) { | |
| (l[u] || (l[u] = {}))[a] = [w, m] | |
| } | |
| if (l === b) { | |
| break | |
| } | |
| } | |
| } | |
| } | |
| m -= e; | |
| return m === d || m % d === 0 && m / d >= 0 | |
| } | |
| } | |
| }, | |
| PSEUDO: function(a, b) { | |
| var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || ea.error("unsupported pseudo: " + a); | |
| if (e[u]) { | |
| return e(b) | |
| } | |
| if (e.length > 1) { | |
| c = [a, a, "", b]; | |
| return d.setFilters.hasOwnProperty(a.toLowerCase()) ? ga(function(a, c) { | |
| var d, f = e(a, b), | |
| g = f.length; | |
| while (g--) { | |
| d = K.call(a, f[g]); | |
| a[d] = !(c[d] = f[g]) | |
| } | |
| }) : function(a) { | |
| return e(a, 0, c) | |
| } | |
| } | |
| return e | |
| } | |
| }, | |
| pseudos: { | |
| not: ga(function(a) { | |
| var b = [], | |
| c = [], | |
| d = h(a.replace(R, "$1")); | |
| return d[u] ? ga(function(a, b, c, e) { | |
| var f, g = d(a, null, e, []), | |
| h = a.length; | |
| while (h--) { | |
| if (f = g[h]) { | |
| a[h] = !(b[h] = f) | |
| } | |
| } | |
| }) : function(a, e, f) { | |
| b[0] = a; | |
| d(b, null, f, c); | |
| return !c.pop() | |
| } | |
| }), | |
| has: ga(function(a) { | |
| return function(b) { | |
| return ea(a, b).length > 0 | |
| } | |
| }), | |
| contains: ga(function(a) { | |
| return function(b) { | |
| return (b.textContent || b.innerText || e(b)).indexOf(a) > -1 | |
| } | |
| }), | |
| lang: ga(function(a) { | |
| if (!W.test(a || "")) { | |
| ea.error("unsupported lang: " + a) | |
| } | |
| a = a.replace(ca, da).toLowerCase(); | |
| return function(b) { | |
| var c; | |
| do { | |
| if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang")) { | |
| c = c.toLowerCase(); | |
| return c === a || c.indexOf(a + "-") === 0 | |
| } | |
| } while ((b = b.parentNode) && b.nodeType === 1); | |
| return false | |
| } | |
| }), | |
| target: function(b) { | |
| var c = a.location && a.location.hash; | |
| return c && c.slice(1) === b.id | |
| }, | |
| root: function(a) { | |
| return a === o | |
| }, | |
| focus: function(a) { | |
| return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex) | |
| }, | |
| enabled: function(a) { | |
| return a.disabled === false | |
| }, | |
| disabled: function(a) { | |
| return a.disabled === true | |
| }, | |
| checked: function(a) { | |
| var b = a.nodeName.toLowerCase(); | |
| return b === "input" && !!a.checked || b === "option" && !!a.selected | |
| }, | |
| selected: function(a) { | |
| if (a.parentNode) { | |
| a.parentNode.selectedIndex | |
| } | |
| return a.selected === true | |
| }, | |
| empty: function(a) { | |
| for (a = a.firstChild; a; a = a.nextSibling) { | |
| if (a.nodeType < 6) { | |
| return false | |
| } | |
| } | |
| return true | |
| }, | |
| parent: function(a) { | |
| return !d.pseudos["empty"](a) | |
| }, | |
| header: function(a) { | |
| return Z.test(a.nodeName) | |
| }, | |
| input: function(a) { | |
| return Y.test(a.nodeName) | |
| }, | |
| button: function(a) { | |
| var b = a.nodeName.toLowerCase(); | |
| return b === "input" && a.type === "button" || b === "button" | |
| }, | |
| text: function(a) { | |
| var b; | |
| return a.nodeName.toLowerCase() === "input" && a.type === "text" && ((b = a.getAttribute("type")) == null || b.toLowerCase() === "text") | |
| }, | |
| first: ma(function() { | |
| return [0] | |
| }), | |
| last: ma(function(a, b) { | |
| return [b - 1] | |
| }), | |
| eq: ma(function(a, b, c) { | |
| return [c < 0 ? c + b : c] | |
| }), | |
| even: ma(function(a, b) { | |
| var c = 0; | |
| for (; c < b; c += 2) { | |
| a.push(c) | |
| } | |
| return a | |
| }), | |
| odd: ma(function(a, b) { | |
| var c = 1; | |
| for (; c < b; c += 2) { | |
| a.push(c) | |
| } | |
| return a | |
| }), | |
| lt: ma(function(a, b, c) { | |
| var d = c < 0 ? c + b : c; | |
| for (; --d >= 0;) { | |
| a.push(d) | |
| } | |
| return a | |
| }), | |
| gt: ma(function(a, b, c) { | |
| var d = c < 0 ? c + b : c; | |
| for (; ++d < b;) { | |
| a.push(d) | |
| } | |
| return a | |
| }) | |
| } | |
| }; | |
| d.pseudos["nth"] = d.pseudos["eq"]; | |
| for (b in { | |
| radio: true, | |
| checkbox: true, | |
| file: true, | |
| password: true, | |
| image: true | |
| }) { | |
| d.pseudos[b] = ka(b) | |
| } | |
| for (b in { | |
| submit: true, | |
| reset: true | |
| }) { | |
| d.pseudos[b] = la(b) | |
| } | |
| function oa() {} | |
| oa.prototype = d.filters = d.pseudos; | |
| d.setFilters = new oa; | |
| g = ea.tokenize = function(a, b) { | |
| var c, e, f, g, h, i, j, k = z[a + " "]; | |
| if (k) { | |
| return b ? 0 : k.slice(0) | |
| } | |
| h = a; | |
| i = []; | |
| j = d.preFilter; | |
| while (h) { | |
| if (!c || (e = S.exec(h))) { | |
| if (e) { | |
| h = h.slice(e[0].length) || h | |
| } | |
| i.push(f = []) | |
| } | |
| c = false; | |
| if (e = T.exec(h)) { | |
| c = e.shift(); | |
| f.push({ | |
| value: c, | |
| type: e[0].replace(R, " ") | |
| }); | |
| h = h.slice(c.length) | |
| } | |
| for (g in d.filter) { | |
| if ((e = X[g].exec(h)) && (!j[g] || (e = j[g](e)))) { | |
| c = e.shift(); | |
| f.push({ | |
| value: c, | |
| type: g, | |
| matches: e | |
| }); | |
| h = h.slice(c.length) | |
| } | |
| } | |
| if (!c) { | |
| break | |
| } | |
| } | |
| return b ? h.length : h ? ea.error(a) : z(a, i).slice(0) | |
| }; | |
| function pa(a) { | |
| var b = 0, | |
| c = a.length, | |
| d = ""; | |
| for (; b < c; b++) { | |
| d += a[b].value | |
| } | |
| return d | |
| } | |
| function qa(a, b, c) { | |
| var d = b.dir, | |
| e = c && d === "parentNode", | |
| f = x++; | |
| return b.first ? function(b, c, f) { | |
| while (b = b[d]) { | |
| if (b.nodeType === 1 || e) { | |
| return a(b, c, f) | |
| } | |
| } | |
| } : function(b, c, g) { | |
| var h, i, j = [w, f]; | |
| if (g) { | |
| while (b = b[d]) { | |
| if (b.nodeType === 1 || e) { | |
| if (a(b, c, g)) { | |
| return true | |
| } | |
| } | |
| } | |
| } else { | |
| while (b = b[d]) { | |
| if (b.nodeType === 1 || e) { | |
| i = b[u] || (b[u] = {}); | |
| if ((h = i[d]) && h[0] === w && h[1] === f) { | |
| return j[2] = h[2] | |
| } else { | |
| i[d] = j; | |
| if (j[2] = a(b, c, g)) { | |
| return true | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| function ra(a) { | |
| return a.length > 1 ? function(b, c, d) { | |
| var e = a.length; | |
| while (e--) { | |
| if (!a[e](b, c, d)) { | |
| return false | |
| } | |
| } | |
| return true | |
| } : a[0] | |
| } | |
| function sa(a, b, c) { | |
| var d = 0, | |
| e = b.length; | |
| for (; d < e; d++) { | |
| ea(a, b[d], c) | |
| } | |
| return c | |
| } | |
| function ta(a, b, c, d, e) { | |
| var f, g = [], | |
| h = 0, | |
| i = a.length, | |
| j = b != null; | |
| for (; h < i; h++) { | |
| if (f = a[h]) { | |
| if (!c || c(f, d, e)) { | |
| g.push(f); | |
| if (j) { | |
| b.push(h) | |
| } | |
| } | |
| } | |
| } | |
| return g | |
| } | |
| function ua(a, b, c, d, e, f) { | |
| if (d && !d[u]) { | |
| d = ua(d) | |
| } | |
| if (e && !e[u]) { | |
| e = ua(e, f) | |
| } | |
| return ga(function(f, g, h, i) { | |
| var j, k, l, m = [], | |
| n = [], | |
| o = g.length, | |
| p = f || sa(b || "*", h.nodeType ? [h] : h, []), | |
| q = a && (f || !b) ? ta(p, m, a, h, i) : p, | |
| r = c ? e || (f ? a : o || d) ? [] : g : q; | |
| if (c) { | |
| c(q, r, h, i) | |
| } | |
| if (d) { | |
| j = ta(r, n); | |
| d(j, [], h, i); | |
| k = j.length; | |
| while (k--) { | |
| if (l = j[k]) { | |
| r[n[k]] = !(q[n[k]] = l) | |
| } | |
| } | |
| } | |
| if (f) { | |
| if (e || a) { | |
| if (e) { | |
| j = []; | |
| k = r.length; | |
| while (k--) { | |
| if (l = r[k]) { | |
| j.push(q[k] = l) | |
| } | |
| } | |
| e(null, r = [], j, i) | |
| } | |
| k = r.length; | |
| while (k--) { | |
| if ((l = r[k]) && (j = e ? K.call(f, l) : m[k]) > -1) { | |
| f[j] = !(g[j] = l) | |
| } | |
| } | |
| } | |
| } else { | |
| r = ta(r === g ? r.splice(o, r.length) : r); | |
| if (e) { | |
| e(null, g, r, i) | |
| } else { | |
| I.apply(g, r) | |
| } | |
| } | |
| }) | |
| } | |
| function va(a) { | |
| var b, c, e, f = a.length, | |
| g = d.relative[a[0].type], | |
| h = g || d.relative[" "], | |
| i = g ? 1 : 0, | |
| k = qa(function(a) { | |
| return a === b | |
| }, h, true), | |
| l = qa(function(a) { | |
| return K.call(b, a) > -1 | |
| }, h, true), | |
| m = [function(a, c, d) { | |
| return !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d)) | |
| }]; | |
| for (; i < f; i++) { | |
| if (c = d.relative[a[i].type]) { | |
| m = [qa(ra(m), c)] | |
| } else { | |
| c = d.filter[a[i].type].apply(null, a[i].matches); | |
| if (c[u]) { | |
| e = ++i; | |
| for (; e < f; e++) { | |
| if (d.relative[a[e].type]) { | |
| break | |
| } | |
| } | |
| return ua(i > 1 && ra(m), i > 1 && pa(a.slice(0, i - 1).concat({ | |
| value: a[i - 2].type === " " ? "*" : "" | |
| })).replace(R, "$1"), c, i < e && va(a.slice(i, e)), e < f && va(a = a.slice(e)), e < f && pa(a)) | |
| } | |
| m.push(c) | |
| } | |
| } | |
| return ra(m) | |
| } | |
| function wa(a, b) { | |
| var c = b.length > 0, | |
| e = a.length > 0, | |
| f = function(f, g, h, i, k) { | |
| var l, m, o, p = 0, | |
| q = "0", | |
| r = f && [], | |
| s = [], | |
| t = j, | |
| u = f || e && d.find["TAG"]("*", k), | |
| v = w += t == null ? 1 : Math.random() || .1, | |
| x = u.length; | |
| if (k) { | |
| j = g !== n && g | |
| } | |
| for (; q !== x && (l = u[q]) != null; q++) { | |
| if (e && l) { | |
| m = 0; | |
| while (o = a[m++]) { | |
| if (o(l, g, h)) { | |
| i.push(l); | |
| break | |
| } | |
| } | |
| if (k) { | |
| w = v | |
| } | |
| } | |
| if (c) { | |
| if (l = !o && l) { | |
| p-- | |
| } | |
| if (f) { | |
| r.push(l) | |
| } | |
| } | |
| } | |
| p += q; | |
| if (c && q !== p) { | |
| m = 0; | |
| while (o = b[m++]) { | |
| o(r, s, g, h) | |
| } | |
| if (f) { | |
| if (p > 0) { | |
| while (q--) { | |
| if (!(r[q] || s[q])) { | |
| s[q] = G.call(i) | |
| } | |
| } | |
| } | |
| s = ta(s) | |
| } | |
| I.apply(i, s); | |
| if (k && !f && s.length > 0 && p + b.length > 1) { | |
| ea.uniqueSort(i) | |
| } | |
| } | |
| if (k) { | |
| w = v; | |
| j = t | |
| } | |
| return r | |
| }; | |
| return c ? ga(f) : f | |
| } | |
| h = ea.compile = function(a, b) { | |
| var c, d = [], | |
| e = [], | |
| f = A[a + " "]; | |
| if (!f) { | |
| if (!b) { | |
| b = g(a) | |
| } | |
| c = b.length; | |
| while (c--) { | |
| f = va(b[c]); | |
| if (f[u]) { | |
| d.push(f) | |
| } else { | |
| e.push(f) | |
| } | |
| } | |
| f = A(a, wa(e, d)); | |
| f.selector = a | |
| } | |
| return f | |
| }; | |
| i = ea.select = function(a, b, e, f) { | |
| var i, j, k, l, m, n = typeof a === "function" && a, | |
| o = !f && g(a = n.selector || a); | |
| e = e || []; | |
| if (o.length === 1) { | |
| j = o[0] = o[0].slice(0); | |
| if (j.length > 2 && (k = j[0]).type === "ID" && c.getById && b.nodeType === 9 && p && d.relative[j[1].type]) { | |
| b = (d.find["ID"](k.matches[0].replace(ca, da), b) || [])[0]; | |
| if (!b) { | |
| return e | |
| } else if (n) { | |
| b = b.parentNode | |
| } | |
| a = a.slice(j.shift().value.length) | |
| } | |
| i = X["needsContext"].test(a) ? 0 : j.length; | |
| while (i--) { | |
| k = j[i]; | |
| if (d.relative[l = k.type]) { | |
| break | |
| } | |
| if (m = d.find[l]) { | |
| if (f = m(k.matches[0].replace(ca, da), aa.test(j[0].type) && na(b.parentNode) || b)) { | |
| j.splice(i, 1); | |
| a = f.length && pa(j); | |
| if (!a) { | |
| I.apply(e, f); | |
| return e | |
| } | |
| break | |
| } | |
| } | |
| } | |
| }(n || h(a, o))(f, b, !p, e, aa.test(a) && na(b.parentNode) || b); | |
| return e | |
| }; | |
| c.sortStable = u.split("").sort(B).join("") === u; | |
| c.detectDuplicates = !!l; | |
| m(); | |
| c.sortDetached = ha(function(a) { | |
| return a.compareDocumentPosition(n.createElement("div")) & 1 | |
| }); | |
| if (!ha(function(a) { | |
| a.innerHTML = "<a href='#'></a>"; | |
| return a.firstChild.getAttribute("href") === "#" | |
| })) { | |
| ia("type|href|height|width", function(a, b, c) { | |
| if (!c) { | |
| return a.getAttribute(b, b.toLowerCase() === "type" ? 1 : 2) | |
| } | |
| }) | |
| } | |
| if (!c.attributes || !ha(function(a) { | |
| a.innerHTML = "<input/>"; | |
| a.firstChild.setAttribute("value", ""); | |
| return a.firstChild.getAttribute("value") === "" | |
| })) { | |
| ia("value", function(a, b, c) { | |
| if (!c && a.nodeName.toLowerCase() === "input") { | |
| return a.defaultValue | |
| } | |
| }) | |
| } | |
| if (!ha(function(a) { | |
| return a.getAttribute("disabled") == null | |
| })) { | |
| ia(L, function(a, b, c) { | |
| var d; | |
| if (!c) { | |
| return a[b] === true ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null | |
| } | |
| }) | |
| } | |
| return ea | |
| }(a); | |
| n.find = t; | |
| n.expr = t.selectors; | |
| n.expr[":"] = n.expr.pseudos; | |
| n.unique = t.uniqueSort; | |
| n.text = t.getText; | |
| n.isXMLDoc = t.isXML; | |
| n.contains = t.contains; | |
| var u = n.expr.match.needsContext; | |
| var v = /^<(\w+)\s*\/?>(?:<\/\1>|)$/; | |
| var w = /^.[^:#\[\.,]*$/; | |
| function x(a, b, c) { | |
| if (n.isFunction(b)) { | |
| return n.grep(a, function(a, d) { | |
| return !!b.call(a, d, a) !== c | |
| }) | |
| } | |
| if (b.nodeType) { | |
| return n.grep(a, function(a) { | |
| return a === b !== c | |
| }) | |
| } | |
| if (typeof b === "string") { | |
| if (w.test(b)) { | |
| return n.filter(b, a, c) | |
| } | |
| b = n.filter(b, a) | |
| } | |
| return n.grep(a, function(a) { | |
| return g.call(b, a) >= 0 !== c | |
| }) | |
| } | |
| n.filter = function(a, b, c) { | |
| var d = b[0]; | |
| if (c) { | |
| a = ":not(" + a + ")" | |
| } | |
| return b.length === 1 && d.nodeType === 1 ? n.find.matchesSelector(d, a) ? [d] : [] : n.find.matches(a, n.grep(b, function(a) { | |
| return a.nodeType === 1 | |
| })) | |
| }; | |
| n.fn.extend({ | |
| find: function(a) { | |
| var b, c = this.length, | |
| d = [], | |
| e = this; | |
| if (typeof a !== "string") { | |
| return this.pushStack(n(a).filter(function() { | |
| for (b = 0; b < c; b++) { | |
| if (n.contains(e[b], this)) { | |
| return true | |
| } | |
| } | |
| })) | |
| } | |
| for (b = 0; b < c; b++) { | |
| n.find(a, e[b], d) | |
| } | |
| d = this.pushStack(c > 1 ? n.unique(d) : d); | |
| d.selector = this.selector ? this.selector + " " + a : a; | |
| return d | |
| }, | |
| filter: function(a) { | |
| return this.pushStack(x(this, a || [], false)) | |
| }, | |
| not: function(a) { | |
| return this.pushStack(x(this, a || [], true)) | |
| }, | |
| is: function(a) { | |
| return !!x(this, typeof a === "string" && u.test(a) ? n(a) : a || [], false).length | |
| } | |
| }); | |
| var y, z = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, | |
| A = n.fn.init = function(a, b) { | |
| var c, d; | |
| if (!a) { | |
| return this | |
| } | |
| if (typeof a === "string") { | |
| if (a[0] === "<" && a[a.length - 1] === ">" && a.length >= 3) { | |
| c = [null, a, null] | |
| } else { | |
| c = z.exec(a) | |
| } | |
| if (c && (c[1] || !b)) { | |
| if (c[1]) { | |
| b = b instanceof n ? b[0] : b; | |
| n.merge(this, n.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : l, true)); | |
| if (v.test(c[1]) && n.isPlainObject(b)) { | |
| for (c in b) { | |
| if (n.isFunction(this[c])) { | |
| this[c](b[c]) | |
| } else { | |
| this.attr(c, b[c]) | |
| } | |
| } | |
| } | |
| return this | |
| } else { | |
| d = l.getElementById(c[2]); | |
| if (d && d.parentNode) { | |
| this.length = 1; | |
| this[0] = d | |
| } | |
| this.context = l; | |
| this.selector = a; | |
| return this | |
| } | |
| } else if (!b || b.jquery) { | |
| return (b || y).find(a) | |
| } else { | |
| return this.constructor(b).find(a) | |
| } | |
| } else if (a.nodeType) { | |
| this.context = this[0] = a; | |
| this.length = 1; | |
| return this | |
| } else if (n.isFunction(a)) { | |
| return typeof y.ready !== "undefined" ? y.ready(a) : a(n) | |
| } | |
| if (a.selector !== undefined) { | |
| this.selector = a.selector; | |
| this.context = a.context | |
| } | |
| return n.makeArray(a, this) | |
| }; | |
| A.prototype = n.fn; | |
| y = n(l); | |
| var B = /^(?:parents|prev(?:Until|All))/, | |
| C = { | |
| children: true, | |
| contents: true, | |
| next: true, | |
| prev: true | |
| }; | |
| n.extend({ | |
| dir: function(a, b, c) { | |
| var d = [], | |
| e = c !== undefined; | |
| while ((a = a[b]) && a.nodeType !== 9) { | |
| if (a.nodeType === 1) { | |
| if (e && n(a).is(c)) { | |
| break | |
| } | |
| d.push(a) | |
| } | |
| } | |
| return d | |
| }, | |
| sibling: function(a, b) { | |
| var c = []; | |
| for (; a; a = a.nextSibling) { | |
| if (a.nodeType === 1 && a !== b) { | |
| c.push(a) | |
| } | |
| } | |
| return c | |
| } | |
| }); | |
| n.fn.extend({ | |
| has: function(a) { | |
| var b = n(a, this), | |
| c = b.length; | |
| return this.filter(function() { | |
| var a = 0; | |
| for (; a < c; a++) { | |
| if (n.contains(this, b[a])) { | |
| return true | |
| } | |
| } | |
| }) | |
| }, | |
| closest: function(a, b) { | |
| var c, d = 0, | |
| e = this.length, | |
| f = [], | |
| g = u.test(a) || typeof a !== "string" ? n(a, b || this.context) : 0; | |
| for (; d < e; d++) { | |
| for (c = this[d]; c && c !== b; c = c.parentNode) { | |
| if (c.nodeType < 11 && (g ? g.index(c) > -1 : c.nodeType === 1 && n.find.matchesSelector(c, a))) { | |
| f.push(c); | |
| break | |
| } | |
| } | |
| } | |
| return this.pushStack(f.length > 1 ? n.unique(f) : f) | |
| }, | |
| index: function(a) { | |
| if (!a) { | |
| return this[0] && this[0].parentNode ? this.first().prevAll().length : -1 | |
| } | |
| if (typeof a === "string") { | |
| return g.call(n(a), this[0]) | |
| } | |
| return g.call(this, a.jquery ? a[0] : a) | |
| }, | |
| add: function(a, b) { | |
| return this.pushStack(n.unique(n.merge(this.get(), n(a, b)))) | |
| }, | |
| addBack: function(a) { | |
| return this.add(a == null ? this.prevObject : this.prevObject.filter(a)) | |
| } | |
| }); | |
| function D(a, b) { | |
| while ((a = a[b]) && a.nodeType !== 1) {} | |
| return a | |
| } | |
| n.each({ | |
| parent: function(a) { | |
| var b = a.parentNode; | |
| return b && b.nodeType !== 11 ? b : null | |
| }, | |
| parents: function(a) { | |
| return n.dir(a, "parentNode") | |
| }, | |
| parentsUntil: function(a, b, c) { | |
| return n.dir(a, "parentNode", c) | |
| }, | |
| next: function(a) { | |
| return D(a, "nextSibling") | |
| }, | |
| prev: function(a) { | |
| return D(a, "previousSibling") | |
| }, | |
| nextAll: function(a) { | |
| return n.dir(a, "nextSibling") | |
| }, | |
| prevAll: function(a) { | |
| return n.dir(a, "previousSibling") | |
| }, | |
| nextUntil: function(a, b, c) { | |
| return n.dir(a, "nextSibling", c) | |
| }, | |
| prevUntil: function(a, b, c) { | |
| return n.dir(a, "previousSibling", c) | |
| }, | |
| siblings: function(a) { | |
| return n.sibling((a.parentNode || {}).firstChild, a) | |
| }, | |
| children: function(a) { | |
| return n.sibling(a.firstChild) | |
| }, | |
| contents: function(a) { | |
| return a.contentDocument || n.merge([], a.childNodes) | |
| } | |
| }, function(a, b) { | |
| n.fn[a] = function(c, d) { | |
| var e = n.map(this, b, c); | |
| if (a.slice(-5) !== "Until") { | |
| d = c | |
| } | |
| if (d && typeof d === "string") { | |
| e = n.filter(d, e) | |
| } | |
| if (this.length > 1) { | |
| if (!C[a]) { | |
| n.unique(e) | |
| } | |
| if (B.test(a)) { | |
| e.reverse() | |
| } | |
| } | |
| return this.pushStack(e) | |
| } | |
| }); | |
| var E = /\S+/g; | |
| var F = {}; | |
| function G(a) { | |
| var b = F[a] = {}; | |
| n.each(a.match(E) || [], function(a, c) { | |
| b[c] = true | |
| }); | |
| return b | |
| } | |
| n.Callbacks = function(a) { | |
| a = typeof a === "string" ? F[a] || G(a) : n.extend({}, a); | |
| var b, c, d, e, f, g, h = [], | |
| i = !a.once && [], | |
| j = function(l) { | |
| b = a.memory && l; | |
| c = true; | |
| g = e || 0; | |
| e = 0; | |
| f = h.length; | |
| d = true; | |
| for (; h && g < f; g++) { | |
| if (h[g].apply(l[0], l[1]) === false && a.stopOnFalse) { | |
| b = false; | |
| break | |
| } | |
| } | |
| d = false; | |
| if (h) { | |
| if (i) { | |
| if (i.length) { | |
| j(i.shift()) | |
| } | |
| } else if (b) { | |
| h = [] | |
| } else { | |
| k.disable() | |
| } | |
| } | |
| }, | |
| k = { | |
| add: function() { | |
| if (h) { | |
| var c = h.length; | |
| (function b(c) { | |
| n.each(c, function(c, d) { | |
| var e = n.type(d); | |
| if (e === "function") { | |
| if (!a.unique || !k.has(d)) { | |
| h.push(d) | |
| } | |
| } else if (d && d.length && e !== "string") { | |
| b(d) | |
| } | |
| }) | |
| })(arguments); | |
| if (d) { | |
| f = h.length | |
| } else if (b) { | |
| e = c; | |
| j(b) | |
| } | |
| } | |
| return this | |
| }, | |
| remove: function() { | |
| if (h) { | |
| n.each(arguments, function(a, b) { | |
| var c; | |
| while ((c = n.inArray(b, h, c)) > -1) { | |
| h.splice(c, 1); | |
| if (d) { | |
| if (c <= f) { | |
| f-- | |
| } | |
| if (c <= g) { | |
| g-- | |
| } | |
| } | |
| } | |
| }) | |
| } | |
| return this | |
| }, | |
| has: function(a) { | |
| return a ? n.inArray(a, h) > -1 : !!(h && h.length) | |
| }, | |
| empty: function() { | |
| h = []; | |
| f = 0; | |
| return this | |
| }, | |
| disable: function() { | |
| h = i = b = undefined; | |
| return this | |
| }, | |
| disabled: function() { | |
| return !h | |
| }, | |
| lock: function() { | |
| i = undefined; | |
| if (!b) { | |
| k.disable() | |
| } | |
| return this | |
| }, | |
| locked: function() { | |
| return !i | |
| }, | |
| fireWith: function(a, b) { | |
| if (h && (!c || i)) { | |
| b = b || []; | |
| b = [a, b.slice ? b.slice() : b]; | |
| if (d) { | |
| i.push(b) | |
| } else { | |
| j(b) | |
| } | |
| } | |
| return this | |
| }, | |
| fire: function() { | |
| k.fireWith(this, arguments); | |
| return this | |
| }, | |
| fired: function() { | |
| return !!c | |
| } | |
| }; | |
| return k | |
| }; | |
| n.extend({ | |
| Deferred: function(a) { | |
| var b = [ | |
| ["resolve", "done", n.Callbacks("once memory"), "resolved"], | |
| ["reject", "fail", n.Callbacks("once memory"), "rejected"], | |
| ["notify", "progress", n.Callbacks("memory")] | |
| ], | |
| c = "pending", | |
| d = { | |
| state: function() { | |
| return c | |
| }, | |
| always: function() { | |
| e.done(arguments).fail(arguments); | |
| return this | |
| }, | |
| then: function() { | |
| var a = arguments; | |
| return n.Deferred(function(c) { | |
| n.each(b, function(b, f) { | |
| var g = n.isFunction(a[b]) && a[b]; | |
| e[f[1]](function() { | |
| var a = g && g.apply(this, arguments); | |
| if (a && n.isFunction(a.promise)) { | |
| a.promise().done(c.resolve).fail(c.reject).progress(c.notify) | |
| } else { | |
| c[f[0] + "With"](this === d ? c.promise() : this, g ? [a] : arguments) | |
| } | |
| }) | |
| }); | |
| a = null | |
| }).promise() | |
| }, | |
| promise: function(a) { | |
| return a != null ? n.extend(a, d) : d | |
| } | |
| }, | |
| e = {}; | |
| d.pipe = d.then; | |
| n.each(b, function(a, f) { | |
| var g = f[2], | |
| h = f[3]; | |
| d[f[1]] = g.add; | |
| if (h) { | |
| g.add(function() { | |
| c = h | |
| }, b[a ^ 1][2].disable, b[2][2].lock) | |
| } | |
| e[f[0]] = function() { | |
| e[f[0] + "With"](this === e ? d : this, arguments); | |
| return this | |
| }; | |
| e[f[0] + "With"] = g.fireWith | |
| }); | |
| d.promise(e); | |
| if (a) { | |
| a.call(e, e) | |
| } | |
| return e | |
| }, | |
| when: function(a) { | |
| var b = 0, | |
| c = d.call(arguments), | |
| e = c.length, | |
| f = e !== 1 || a && n.isFunction(a.promise) ? e : 0, | |
| g = f === 1 ? a : n.Deferred(), | |
| h = function(a, b, c) { | |
| return function(e) { | |
| b[a] = this; | |
| c[a] = arguments.length > 1 ? d.call(arguments) : e; | |
| if (c === i) { | |
| g.notifyWith(b, c) | |
| } else if (!--f) { | |
| g.resolveWith(b, c) | |
| } | |
| } | |
| }, | |
| i, j, k; | |
| if (e > 1) { | |
| i = new Array(e); | |
| j = new Array(e); | |
| k = new Array(e); | |
| for (; b < e; b++) { | |
| if (c[b] && n.isFunction(c[b].promise)) { | |
| c[b].promise().done(h(b, k, c)).fail(g.reject).progress(h(b, j, i)) | |
| } else { | |
| --f | |
| } | |
| } | |
| } | |
| if (!f) { | |
| g.resolveWith(k, c) | |
| } | |
| return g.promise() | |
| } | |
| }); | |
| var H; | |
| n.fn.ready = function(a) { | |
| n.ready.promise().done(a); | |
| return this | |
| }; | |
| n.extend({ | |
| isReady: false, | |
| readyWait: 1, | |
| holdReady: function(a) { | |
| if (a) { | |
| n.readyWait++ | |
| } else { | |
| n.ready(true) | |
| } | |
| }, | |
| ready: function(a) { | |
| if (a === true ? --n.readyWait : n.isReady) { | |
| return | |
| } | |
| n.isReady = true; | |
| if (a !== true && --n.readyWait > 0) { | |
| return | |
| } | |
| H.resolveWith(l, [n]); | |
| if (n.fn.triggerHandler) { | |
| n(l).triggerHandler("ready"); | |
| n(l).off("ready") | |
| } | |
| } | |
| }); | |
| function I() { | |
| l.removeEventListener("DOMContentLoaded", I, false); | |
| a.removeEventListener("load", I, false); | |
| n.ready() | |
| } | |
| n.ready.promise = function(b) { | |
| if (!H) { | |
| H = n.Deferred(); | |
| if (l.readyState === "complete") { | |
| setTimeout(n.ready) | |
| } else { | |
| l.addEventListener("DOMContentLoaded", I, false); | |
| a.addEventListener("load", I, false) | |
| } | |
| } | |
| return H.promise(b) | |
| }; | |
| n.ready.promise(); | |
| var J = n.access = function(a, b, c, d, e, f, g) { | |
| var h = 0, | |
| i = a.length, | |
| j = c == null; | |
| if (n.type(c) === "object") { | |
| e = true; | |
| for (h in c) { | |
| n.access(a, b, h, c[h], true, f, g) | |
| } | |
| } else if (d !== undefined) { | |
| e = true; | |
| if (!n.isFunction(d)) { | |
| g = true | |
| } | |
| if (j) { | |
| if (g) { | |
| b.call(a, d); | |
| b = null | |
| } else { | |
| j = b; | |
| b = function(a, b, c) { | |
| return j.call(n(a), c) | |
| } | |
| } | |
| } | |
| if (b) { | |
| for (; h < i; h++) { | |
| b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c))) | |
| } | |
| } | |
| } | |
| return e ? a : j ? b.call(a) : i ? b(a[0], c) : f | |
| }; | |
| n.acceptData = function(a) { | |
| return a.nodeType === 1 || a.nodeType === 9 || !+a.nodeType | |
| }; | |
| function K() { | |
| Object.defineProperty(this.cache = {}, 0, { | |
| get: function() { | |
| return {} | |
| } | |
| }); | |
| this.expando = n.expando + Math.random() | |
| } | |
| K.uid = 1; | |
| K.accepts = n.acceptData; | |
| K.prototype = { | |
| key: function(a) { | |
| if (!K.accepts(a)) { | |
| return 0 | |
| } | |
| var b = {}, | |
| c = a[this.expando]; | |
| if (!c) { | |
| c = K.uid++; | |
| try { | |
| b[this.expando] = { | |
| value: c | |
| }; | |
| Object.defineProperties(a, b) | |
| } catch (d) { | |
| b[this.expando] = c; | |
| n.extend(a, b) | |
| } | |
| } | |
| if (!this.cache[c]) { | |
| this.cache[c] = {} | |
| } | |
| return c | |
| }, | |
| set: function(a, b, c) { | |
| var d, e = this.key(a), | |
| f = this.cache[e]; | |
| if (typeof b === "string") { | |
| f[b] = c | |
| } else { | |
| if (n.isEmptyObject(f)) { | |
| n.extend(this.cache[e], b) | |
| } else { | |
| for (d in b) { | |
| f[d] = b[d] | |
| } | |
| } | |
| } | |
| return f | |
| }, | |
| get: function(a, b) { | |
| var c = this.cache[this.key(a)]; | |
| return b === undefined ? c : c[b] | |
| }, | |
| access: function(a, b, c) { | |
| var d; | |
| if (b === undefined || b && typeof b === "string" && c === undefined) { | |
| d = this.get(a, b); | |
| return d !== undefined ? d : this.get(a, n.camelCase(b)) | |
| } | |
| this.set(a, b, c); | |
| return c !== undefined ? c : b | |
| }, | |
| remove: function(a, b) { | |
| var c, d, e, f = this.key(a), | |
| g = this.cache[f]; | |
| if (b === undefined) { | |
| this.cache[f] = {} | |
| } else { | |
| if (n.isArray(b)) { | |
| d = b.concat(b.map(n.camelCase)) | |
| } else { | |
| e = n.camelCase(b); | |
| if (b in g) { | |
| d = [b, e] | |
| } else { | |
| d = e; | |
| d = d in g ? [d] : d.match(E) || [] | |
| } | |
| } | |
| c = d.length; | |
| while (c--) { | |
| delete g[d[c]] | |
| } | |
| } | |
| }, | |
| hasData: function(a) { | |
| return !n.isEmptyObject(this.cache[a[this.expando]] || {}) | |
| }, | |
| discard: function(a) { | |
| if (a[this.expando]) { | |
| delete this.cache[a[this.expando]] | |
| } | |
| } | |
| }; | |
| var L = new K; | |
| var M = new K; | |
| var N = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, | |
| O = /([A-Z])/g; | |
| function P(a, b, c) { | |
| var d; | |
| if (c === undefined && a.nodeType === 1) { | |
| d = "data-" + b.replace(O, "-$1").toLowerCase(); | |
| c = a.getAttribute(d); | |
| if (typeof c === "string") { | |
| try { | |
| c = c === "true" ? true : c === "false" ? false : c === "null" ? null : +c + "" === c ? +c : N.test(c) ? n.parseJSON(c) : c | |
| } catch (a) {} | |
| M.set(a, b, c) | |
| } else { | |
| c = undefined | |
| } | |
| } | |
| return c | |
| } | |
| n.extend({ | |
| hasData: function(a) { | |
| return M.hasData(a) || L.hasData(a) | |
| }, | |
| data: function(a, b, c) { | |
| return M.access(a, b, c) | |
| }, | |
| removeData: function(a, b) { | |
| M.remove(a, b) | |
| }, | |
| _data: function(a, b, c) { | |
| return L.access(a, b, c) | |
| }, | |
| _removeData: function(a, b) { | |
| L.remove(a, b) | |
| } | |
| }); | |
| n.fn.extend({ | |
| data: function(a, b) { | |
| var c, d, e, f = this[0], | |
| g = f && f.attributes; | |
| if (a === undefined) { | |
| if (this.length) { | |
| e = M.get(f); | |
| if (f.nodeType === 1 && !L.get(f, "hasDataAttrs")) { | |
| c = g.length; | |
| while (c--) { | |
| if (g[c]) { | |
| d = g[c].name; | |
| if (d.indexOf("data-") === 0) { | |
| d = n.camelCase(d.slice(5)); | |
| P(f, d, e[d]) | |
| } | |
| } | |
| } | |
| L.set(f, "hasDataAttrs", true) | |
| } | |
| } | |
| return e | |
| } | |
| if (typeof a === "object") { | |
| return this.each(function() { | |
| M.set(this, a) | |
| }) | |
| } | |
| return J(this, function(b) { | |
| var c, d = n.camelCase(a); | |
| if (f && b === undefined) { | |
| c = M.get(f, a); | |
| if (c !== undefined) { | |
| return c | |
| } | |
| c = M.get(f, d); | |
| if (c !== undefined) { | |
| return c | |
| } | |
| c = P(f, d, undefined); | |
| if (c !== undefined) { | |
| return c | |
| } | |
| return | |
| } | |
| this.each(function() { | |
| var c = M.get(this, d); | |
| M.set(this, d, b); | |
| if (a.indexOf("-") !== -1 && c !== undefined) { | |
| M.set(this, a, b) | |
| } | |
| }) | |
| }, null, b, arguments.length > 1, null, true) | |
| }, | |
| removeData: function(a) { | |
| return this.each(function() { | |
| M.remove(this, a) | |
| }) | |
| } | |
| }); | |
| n.extend({ | |
| queue: function(a, b, c) { | |
| var d; | |
| if (a) { | |
| b = (b || "fx") + "queue"; | |
| d = L.get(a, b); | |
| if (c) { | |
| if (!d || n.isArray(c)) { | |
| d = L.access(a, b, n.makeArray(c)) | |
| } else { | |
| d.push(c) | |
| } | |
| } | |
| return d || [] | |
| } | |
| }, | |
| dequeue: function(a, b) { | |
| b = b || "fx"; | |
| var c = n.queue(a, b), | |
| d = c.length, | |
| e = c.shift(), | |
| f = n._queueHooks(a, b), | |
| g = function() { | |
| n.dequeue(a, b) | |
| }; | |
| if (e === "inprogress") { | |
| e = c.shift(); | |
| d-- | |
| } | |
| if (e) { | |
| if (b === "fx") { | |
| c.unshift("inprogress") | |
| } | |
| delete f.stop; | |
| e.call(a, g, f) | |
| } | |
| if (!d && f) { | |
| f.empty.fire() | |
| } | |
| }, | |
| _queueHooks: function(a, b) { | |
| var c = b + "queueHooks"; | |
| return L.get(a, c) || L.access(a, c, { | |
| empty: n.Callbacks("once memory").add(function() { | |
| L.remove(a, [b + "queue", c]) | |
| }) | |
| }) | |
| } | |
| }); | |
| n.fn.extend({ | |
| queue: function(a, b) { | |
| var c = 2; | |
| if (typeof a !== "string") { | |
| b = a; | |
| a = "fx"; | |
| c-- | |
| } | |
| if (arguments.length < c) { | |
| return n.queue(this[0], a) | |
| } | |
| return b === undefined ? this : this.each(function() { | |
| var c = n.queue(this, a, b); | |
| n._queueHooks(this, a); | |
| if (a === "fx" && c[0] !== "inprogress") { | |
| n.dequeue(this, a) | |
| } | |
| }) | |
| }, | |
| dequeue: function(a) { | |
| return this.each(function() { | |
| n.dequeue(this, a) | |
| }) | |
| }, | |
| clearQueue: function(a) { | |
| return this.queue(a || "fx", []) | |
| }, | |
| promise: function(a, b) { | |
| var c, d = 1, | |
| e = n.Deferred(), | |
| f = this, | |
| g = this.length, | |
| h = function() { | |
| if (!--d) { | |
| e.resolveWith(f, [f]) | |
| } | |
| }; | |
| if (typeof a !== "string") { | |
| b = a; | |
| a = undefined | |
| } | |
| a = a || "fx"; | |
| while (g--) { | |
| c = L.get(f[g], a + "queueHooks"); | |
| if (c && c.empty) { | |
| d++; | |
| c.empty.add(h) | |
| } | |
| } | |
| h(); | |
| return e.promise(b) | |
| } | |
| }); | |
| var Q = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; | |
| var R = ["Top", "Right", "Bottom", "Left"]; | |
| var S = function(a, b) { | |
| a = b || a; | |
| return n.css(a, "display") === "none" || !n.contains(a.ownerDocument, a) | |
| }; | |
| var T = /^(?:checkbox|radio)$/i; | |
| (function() { | |
| var a = l.createDocumentFragment(), | |
| b = a.appendChild(l.createElement("div")), | |
| c = l.createElement("input"); | |
| c.setAttribute("type", "radio"); | |
| c.setAttribute("checked", "checked"); | |
| c.setAttribute("name", "t"); | |
| b.appendChild(c); | |
| k.checkClone = b.cloneNode(true).cloneNode(true).lastChild.checked; | |
| b.innerHTML = "<textarea>x</textarea>"; | |
| k.noCloneChecked = !!b.cloneNode(true).lastChild.defaultValue | |
| })(); | |
| var U = typeof undefined; | |
| k.focusinBubbles = "onfocusin" in a; | |
| var V = /^key/, | |
| W = /^(?:mouse|pointer|contextmenu)|click/, | |
| X = /^(?:focusinfocus|focusoutblur)$/, | |
| Y = /^([^.]*)(?:\.(.+)|)$/; | |
| function Z() { | |
| return true | |
| } | |
| function $() { | |
| return false | |
| } | |
| function _() { | |
| try { | |
| return l.activeElement | |
| } catch (a) {} | |
| } | |
| n.event = { | |
| global: {}, | |
| add: function(a, b, c, d, e) { | |
| var f, g, h, i, j, k, l, m, o, p, q, r = L.get(a); | |
| if (!r) { | |
| return | |
| } | |
| if (c.handler) { | |
| f = c; | |
| c = f.handler; | |
| e = f.selector | |
| } | |
| if (!c.guid) { | |
| c.guid = n.guid++ | |
| } | |
| if (!(i = r.events)) { | |
| i = r.events = {} | |
| } | |
| if (!(g = r.handle)) { | |
| g = r.handle = function(b) { | |
| return typeof n !== U && n.event.triggered !== b.type ? n.event.dispatch.apply(a, arguments) : undefined | |
| } | |
| } | |
| b = (b || "").match(E) || [""]; | |
| j = b.length; | |
| while (j--) { | |
| h = Y.exec(b[j]) || []; | |
| o = q = h[1]; | |
| p = (h[2] || "").split(".").sort(); | |
| if (!o) { | |
| continue | |
| } | |
| l = n.event.special[o] || {}; | |
| o = (e ? l.delegateType : l.bindType) || o; | |
| l = n.event.special[o] || {}; | |
| k = n.extend({ | |
| type: o, | |
| origType: q, | |
| data: d, | |
| handler: c, | |
| guid: c.guid, | |
| selector: e, | |
| needsContext: e && n.expr.match.needsContext.test(e), | |
| namespace: p.join(".") | |
| }, f); | |
| if (!(m = i[o])) { | |
| m = i[o] = []; | |
| m.delegateCount = 0; | |
| if (!l.setup || l.setup.call(a, d, p, g) === false) { | |
| if (a.addEventListener) { | |
| a.addEventListener(o, g, false) | |
| } | |
| } | |
| } | |
| if (l.add) { | |
| l.add.call(a, k); | |
| if (!k.handler.guid) { | |
| k.handler.guid = c.guid | |
| } | |
| } | |
| if (e) { | |
| m.splice(m.delegateCount++, 0, k) | |
| } else { | |
| m.push(k) | |
| } | |
| n.event.global[o] = true | |
| } | |
| }, | |
| remove: function(a, b, c, d, e) { | |
| var f, g, h, i, j, k, l, m, o, p, q, r = L.hasData(a) && L.get(a); | |
| if (!r || !(i = r.events)) { | |
| return | |
| } | |
| b = (b || "").match(E) || [""]; | |
| j = b.length; | |
| while (j--) { | |
| h = Y.exec(b[j]) || []; | |
| o = q = h[1]; | |
| p = (h[2] || "").split(".").sort(); | |
| if (!o) { | |
| for (o in i) { | |
| n.event.remove(a, o + b[j], c, d, true) | |
| } | |
| continue | |
| } | |
| l = n.event.special[o] || {}; | |
| o = (d ? l.delegateType : l.bindType) || o; | |
| m = i[o] || []; | |
| h = h[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"); | |
| g = f = m.length; | |
| while (f--) { | |
| k = m[f]; | |
| if ((e || q === k.origType) && (!c || c.guid === k.guid) && (!h || h.test(k.namespace)) && (!d || d === k.selector || d === "**" && k.selector)) { | |
| m.splice(f, 1); | |
| if (k.selector) { | |
| m.delegateCount-- | |
| } | |
| if (l.remove) { | |
| l.remove.call(a, k) | |
| } | |
| } | |
| } | |
| if (g && !m.length) { | |
| if (!l.teardown || l.teardown.call(a, p, r.handle) === false) { | |
| n.removeEvent(a, o, r.handle) | |
| } | |
| delete i[o] | |
| } | |
| } | |
| if (n.isEmptyObject(i)) { | |
| delete r.handle; | |
| L.remove(a, "events") | |
| } | |
| }, | |
| trigger: function(b, c, d, e) { | |
| var f, g, h, i, k, m, o, p = [d || l], | |
| q = j.call(b, "type") ? b.type : b, | |
| r = j.call(b, "namespace") ? b.namespace.split(".") : []; | |
| g = h = d = d || l; | |
| if (d.nodeType === 3 || d.nodeType === 8) { | |
| return | |
| } | |
| if (X.test(q + n.event.triggered)) { | |
| return | |
| } | |
| if (q.indexOf(".") >= 0) { | |
| r = q.split("."); | |
| q = r.shift(); | |
| r.sort() | |
| } | |
| k = q.indexOf(":") < 0 && "on" + q; | |
| b = b[n.expando] ? b : new n.Event(q, typeof b === "object" && b); | |
| b.isTrigger = e ? 2 : 3; | |
| b.namespace = r.join("."); | |
| b.namespace_re = b.namespace ? new RegExp("(^|\\.)" + r.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; | |
| b.result = undefined; | |
| if (!b.target) { | |
| b.target = d | |
| } | |
| c = c == null ? [b] : n.makeArray(c, [b]); | |
| o = n.event.special[q] || {}; | |
| if (!e && o.trigger && o.trigger.apply(d, c) === false) { | |
| return | |
| } | |
| if (!e && !o.noBubble && !n.isWindow(d)) { | |
| i = o.delegateType || q; | |
| if (!X.test(i + q)) { | |
| g = g.parentNode | |
| } | |
| for (; g; g = g.parentNode) { | |
| p.push(g); | |
| h = g | |
| } | |
| if (h === (d.ownerDocument || l)) { | |
| p.push(h.defaultView || h.parentWindow || a) | |
| } | |
| } | |
| f = 0; | |
| while ((g = p[f++]) && !b.isPropagationStopped()) { | |
| b.type = f > 1 ? i : o.bindType || q; | |
| m = (L.get(g, "events") || {})[b.type] && L.get(g, "handle"); | |
| if (m) { | |
| m.apply(g, c) | |
| } | |
| m = k && g[k]; | |
| if (m && m.apply && n.acceptData(g)) { | |
| b.result = m.apply(g, c); | |
| if (b.result === false) { | |
| b.preventDefault() | |
| } | |
| } | |
| } | |
| b.type = q; | |
| if (!e && !b.isDefaultPrevented()) { | |
| if ((!o._default || o._default.apply(p.pop(), c) === false) && n.acceptData(d)) { | |
| if (k && n.isFunction(d[q]) && !n.isWindow(d)) { | |
| h = d[k]; | |
| if (h) { | |
| d[k] = null | |
| } | |
| n.event.triggered = q; | |
| d[q](); | |
| n.event.triggered = undefined; | |
| if (h) { | |
| d[k] = h | |
| } | |
| } | |
| } | |
| } | |
| return b.result | |
| }, | |
| dispatch: function(a) { | |
| a = n.event.fix(a); | |
| var b, c, e, f, g, h = [], | |
| i = d.call(arguments), | |
| j = (L.get(this, "events") || {})[a.type] || [], | |
| k = n.event.special[a.type] || {}; | |
| i[0] = a; | |
| a.delegateTarget = this; | |
| if (k.preDispatch && k.preDispatch.call(this, a) === false) { | |
| return | |
| } | |
| h = n.event.handlers.call(this, a, j); | |
| b = 0; | |
| while ((f = h[b++]) && !a.isPropagationStopped()) { | |
| a.currentTarget = f.elem; | |
| c = 0; | |
| while ((g = f.handlers[c++]) && !a.isImmediatePropagationStopped()) { | |
| if (!a.namespace_re || a.namespace_re.test(g.namespace)) { | |
| a.handleObj = g; | |
| a.data = g.data; | |
| e = ((n.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i); | |
| if (e !== undefined) { | |
| if ((a.result = e) === false) { | |
| a.preventDefault(); | |
| a.stopPropagation() | |
| } | |
| } | |
| } | |
| } | |
| } | |
| if (k.postDispatch) { | |
| k.postDispatch.call(this, a) | |
| } | |
| return a.result | |
| }, | |
| handlers: function(a, b) { | |
| var c, d, e, f, g = [], | |
| h = b.delegateCount, | |
| i = a.target; | |
| if (h && i.nodeType && (!a.button || a.type !== "click")) { | |
| for (; i !== this; i = i.parentNode || this) { | |
| if (i.disabled !== true || a.type !== "click") { | |
| d = []; | |
| for (c = 0; c < h; c++) { | |
| f = b[c]; | |
| e = f.selector + " "; | |
| if (d[e] === undefined) { | |
| d[e] = f.needsContext ? n(e, this).index(i) >= 0 : n.find(e, this, null, [i]).length | |
| } | |
| if (d[e]) { | |
| d.push(f) | |
| } | |
| } | |
| if (d.length) { | |
| g.push({ | |
| elem: i, | |
| handlers: d | |
| }) | |
| } | |
| } | |
| } | |
| } | |
| if (h < b.length) { | |
| g.push({ | |
| elem: this, | |
| handlers: b.slice(h) | |
| }) | |
| } | |
| return g | |
| }, | |
| props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), | |
| fixHooks: {}, | |
| keyHooks: { | |
| props: "char charCode key keyCode".split(" "), | |
| filter: function(a, b) { | |
| if (a.which == null) { | |
| a.which = b.charCode != null ? b.charCode : b.keyCode | |
| } | |
| return a | |
| } | |
| }, | |
| mouseHooks: { | |
| props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), | |
| filter: function(a, b) { | |
| var c, d, e, f = b.button; | |
| if (a.pageX == null && b.clientX != null) { | |
| c = a.target.ownerDocument || l; | |
| d = c.documentElement; | |
| e = c.body; | |
| a.pageX = b.clientX + (d && d.scrollLeft || e && e.scrollLeft || 0) - (d && d.clientLeft || e && e.clientLeft || 0); | |
| a.pageY = b.clientY + (d && d.scrollTop || e && e.scrollTop || 0) - (d && d.clientTop || e && e.clientTop || 0) | |
| } | |
| if (!a.which && f !== undefined) { | |
| a.which = f & 1 ? 1 : f & 2 ? 3 : f & 4 ? 2 : 0 | |
| } | |
| return a | |
| } | |
| }, | |
| fix: function(a) { | |
| if (a[n.expando]) { | |
| return a | |
| } | |
| var b, c, d, e = a.type, | |
| f = a, | |
| g = this.fixHooks[e]; | |
| if (!g) { | |
| this.fixHooks[e] = g = W.test(e) ? this.mouseHooks : V.test(e) ? this.keyHooks : {} | |
| } | |
| d = g.props ? this.props.concat(g.props) : this.props; | |
| a = new n.Event(f); | |
| b = d.length; | |
| while (b--) { | |
| c = d[b]; | |
| a[c] = f[c] | |
| } | |
| if (!a.target) { | |
| a.target = l | |
| } | |
| if (a.target.nodeType === 3) { | |
| a.target = a.target.parentNode | |
| } | |
| return g.filter ? g.filter(a, f) : a | |
| }, | |
| special: { | |
| load: { | |
| noBubble: true | |
| }, | |
| focus: { | |
| trigger: function() { | |
| if (this !== _() && this.focus) { | |
| this.focus(); | |
| return false | |
| } | |
| }, | |
| delegateType: "focusin" | |
| }, | |
| blur: { | |
| trigger: function() { | |
| if (this === _() && this.blur) { | |
| this.blur(); | |
| return false | |
| } | |
| }, | |
| delegateType: "focusout" | |
| }, | |
| click: { | |
| trigger: function() { | |
| if (this.type === "checkbox" && this.click && n.nodeName(this, "input")) { | |
| this.click(); | |
| return false | |
| } | |
| }, | |
| _default: function(a) { | |
| return n.nodeName(a.target, "a") | |
| } | |
| }, | |
| beforeunload: { | |
| postDispatch: function(a) { | |
| if (a.result !== undefined && a.originalEvent) { | |
| a.originalEvent.returnValue = a.result | |
| } | |
| } | |
| } | |
| }, | |
| simulate: function(a, b, c, d) { | |
| var e = n.extend(new n.Event, c, { | |
| type: a, | |
| isSimulated: true, | |
| originalEvent: {} | |
| }); | |
| if (d) { | |
| n.event.trigger(e, null, b) | |
| } else { | |
| n.event.dispatch.call(b, e) | |
| } | |
| if (e.isDefaultPrevented()) { | |
| c.preventDefault() | |
| } | |
| } | |
| }; | |
| n.removeEvent = function(a, b, c) { | |
| if (a.removeEventListener) { | |
| a.removeEventListener(b, c, false) | |
| } | |
| }; | |
| n.Event = function(a, b) { | |
| if (!(this instanceof n.Event)) { | |
| return new n.Event(a, b) | |
| } | |
| if (a && a.type) { | |
| this.originalEvent = a; | |
| this.type = a.type; | |
| this.isDefaultPrevented = a.defaultPrevented || a.defaultPrevented === undefined && a.returnValue === false ? Z : $ | |
| } else { | |
| this.type = a | |
| } | |
| if (b) { | |
| n.extend(this, b) | |
| } | |
| this.timeStamp = a && a.timeStamp || n.now(); | |
| this[n.expando] = true | |
| }; | |
| n.Event.prototype = { | |
| isDefaultPrevented: $, | |
| isPropagationStopped: $, | |
| isImmediatePropagationStopped: $, | |
| preventDefault: function() { | |
| var a = this.originalEvent; | |
| this.isDefaultPrevented = Z; | |
| if (a && a.preventDefault) { | |
| a.preventDefault() | |
| } | |
| }, | |
| stopPropagation: function() { | |
| var a = this.originalEvent; | |
| this.isPropagationStopped = Z; | |
| if (a && a.stopPropagation) { | |
| a.stopPropagation() | |
| } | |
| }, | |
| stopImmediatePropagation: function() { | |
| var a = this.originalEvent; | |
| this.isImmediatePropagationStopped = Z; | |
| if (a && a.stopImmediatePropagation) { | |
| a.stopImmediatePropagation() | |
| } | |
| this.stopPropagation() | |
| } | |
| }; | |
| n.each({ | |
| mouseenter: "mouseover", | |
| mouseleave: "mouseout", | |
| pointerenter: "pointerover", | |
| pointerleave: "pointerout" | |
| }, function(a, b) { | |
| n.event.special[a] = { | |
| delegateType: b, | |
| bindType: b, | |
| handle: function(a) { | |
| var c, d = this, | |
| e = a.relatedTarget, | |
| f = a.handleObj; | |
| if (!e || e !== d && !n.contains(d, e)) { | |
| a.type = f.origType; | |
| c = f.handler.apply(this, arguments); | |
| a.type = b | |
| } | |
| return c | |
| } | |
| } | |
| }); | |
| if (!k.focusinBubbles) { | |
| n.each({ | |
| focus: "focusin", | |
| blur: "focusout" | |
| }, function(a, b) { | |
| var c = function(a) { | |
| n.event.simulate(b, a.target, n.event.fix(a), true) | |
| }; | |
| n.event.special[b] = { | |
| setup: function() { | |
| var d = this.ownerDocument || this, | |
| e = L.access(d, b); | |
| if (!e) { | |
| d.addEventListener(a, c, true) | |
| } | |
| L.access(d, b, (e || 0) + 1) | |
| }, | |
| teardown: function() { | |
| var d = this.ownerDocument || this, | |
| e = L.access(d, b) - 1; | |
| if (!e) { | |
| d.removeEventListener(a, c, true); | |
| L.remove(d, b) | |
| } else { | |
| L.access(d, b, e) | |
| } | |
| } | |
| } | |
| }) | |
| } | |
| n.fn.extend({ | |
| on: function(a, b, c, d, e) { | |
| var f, g; | |
| if (typeof a === "object") { | |
| if (typeof b !== "string") { | |
| c = c || b; | |
| b = undefined | |
| } | |
| for (g in a) { | |
| this.on(g, b, c, a[g], e) | |
| } | |
| return this | |
| } | |
| if (c == null && d == null) { | |
| d = b; | |
| c = b = undefined | |
| } else if (d == null) { | |
| if (typeof b === "string") { | |
| d = c; | |
| c = undefined | |
| } else { | |
| d = c; | |
| c = b; | |
| b = undefined | |
| } | |
| } | |
| if (d === false) { | |
| d = $ | |
| } else if (!d) { | |
| return this | |
| } | |
| if (e === 1) { | |
| f = d; | |
| d = function(a) { | |
| n().off(a); | |
| return f.apply(this, arguments) | |
| }; | |
| d.guid = f.guid || (f.guid = n.guid++) | |
| } | |
| return this.each(function() { | |
| n.event.add(this, a, d, c, b) | |
| }) | |
| }, | |
| one: function(a, b, c, d) { | |
| return this.on(a, b, c, d, 1) | |
| }, | |
| off: function(a, b, c) { | |
| var d, e; | |
| if (a && a.preventDefault && a.handleObj) { | |
| d = a.handleObj; | |
| n(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler); | |
| return this | |
| } | |
| if (typeof a === "object") { | |
| for (e in a) { | |
| this.off(e, b, a[e]) | |
| } | |
| return this | |
| } | |
| if (b === false || typeof b === "function") { | |
| c = b; | |
| b = undefined | |
| } | |
| if (c === false) { | |
| c = $ | |
| } | |
| return this.each(function() { | |
| n.event.remove(this, a, c, b) | |
| }) | |
| }, | |
| trigger: function(a, b) { | |
| return this.each(function() { | |
| n.event.trigger(a, b, this) | |
| }) | |
| }, | |
| triggerHandler: function(a, b) { | |
| var c = this[0]; | |
| if (c) { | |
| return n.event.trigger(a, b, c, true) | |
| } | |
| } | |
| }); | |
| var aa = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, | |
| ba = /<([\w:]+)/, | |
| ca = /<|&#?\w+;/, | |
| da = /<(?:script|style|link)/i, | |
| ea = /checked\s*(?:[^=]|=\s*.checked.)/i, | |
| fa = /^$|\/(?:java|ecma)script/i, | |
| ga = /^true\/(.*)/, | |
| ha = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, | |
| ia = { | |
| 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, "", ""] | |
| }; | |
| ia.optgroup = ia.option; | |
| ia.tbody = ia.tfoot = ia.colgroup = ia.caption = ia.thead; | |
| ia.th = ia.td; | |
| function ja(a, b) { | |
| return n.nodeName(a, "table") && n.nodeName(b.nodeType !== 11 ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a | |
| } | |
| function ka(a) { | |
| a.type = (a.getAttribute("type") !== null) + "/" + a.type; | |
| return a | |
| } | |
| function la(a) { | |
| var b = ga.exec(a.type); | |
| if (b) { | |
| a.type = b[1] | |
| } else { | |
| a.removeAttribute("type") | |
| } | |
| return a | |
| } | |
| function ma(a, b) { | |
| var c = 0, | |
| d = a.length; | |
| for (; c < d; c++) { | |
| L.set(a[c], "globalEval", !b || L.get(b[c], "globalEval")) | |
| } | |
| } | |
| function na(a, b) { | |
| var c, d, e, f, g, h, i, j; | |
| if (b.nodeType !== 1) { | |
| return | |
| } | |
| if (L.hasData(a)) { | |
| f = L.access(a); | |
| g = L.set(b, f); | |
| j = f.events; | |
| if (j) { | |
| delete g.handle; | |
| g.events = {}; | |
| for (e in j) { | |
| for (c = 0, d = j[e].length; c < d; c++) { | |
| n.event.add(b, e, j[e][c]) | |
| } | |
| } | |
| } | |
| } | |
| if (M.hasData(a)) { | |
| h = M.access(a); | |
| i = n.extend({}, h); | |
| M.set(b, i) | |
| } | |
| } | |
| function oa(a, b) { | |
| var c = a.getElementsByTagName ? a.getElementsByTagName(b || "*") : a.querySelectorAll ? a.querySelectorAll(b || "*") : []; | |
| return b === undefined || b && n.nodeName(a, b) ? n.merge([a], c) : c | |
| } | |
| function pa(a, b) { | |
| var c = b.nodeName.toLowerCase(); | |
| if (c === "input" && T.test(a.type)) { | |
| b.checked = a.checked | |
| } else if (c === "input" || c === "textarea") { | |
| b.defaultValue = a.defaultValue | |
| } | |
| } | |
| n.extend({ | |
| clone: function(a, b, c) { | |
| var d, e, f, g, h = a.cloneNode(true), | |
| i = n.contains(a.ownerDocument, a); | |
| if (!k.noCloneChecked && (a.nodeType === 1 || a.nodeType === 11) && !n.isXMLDoc(a)) { | |
| g = oa(h); | |
| f = oa(a); | |
| for (d = 0, e = f.length; d < e; d++) { | |
| pa(f[d], g[d]) | |
| } | |
| } | |
| if (b) { | |
| if (c) { | |
| f = f || oa(a); | |
| g = g || oa(h); | |
| for (d = 0, e = f.length; d < e; d++) { | |
| na(f[d], g[d]) | |
| } | |
| } else { | |
| na(a, h) | |
| } | |
| } | |
| g = oa(h, "script"); | |
| if (g.length > 0) { | |
| ma(g, !i && oa(a, "script")) | |
| } | |
| return h | |
| }, | |
| buildFragment: function(a, b, c, d) { | |
| var e, f, g, h, i, j, k = b.createDocumentFragment(), | |
| l = [], | |
| m = 0, | |
| o = a.length; | |
| for (; m < o; m++) { | |
| e = a[m]; | |
| if (e || e === 0) { | |
| if (n.type(e) === "object") { | |
| n.merge(l, e.nodeType ? [e] : e) | |
| } else if (!ca.test(e)) { | |
| l.push(b.createTextNode(e)) | |
| } else { | |
| f = f || k.appendChild(b.createElement("div")); | |
| g = (ba.exec(e) || ["", ""])[1].toLowerCase(); | |
| h = ia[g] || ia._default; | |
| f.innerHTML = h[1] + e.replace(aa, "<$1></$2>") + h[2]; | |
| j = h[0]; | |
| while (j--) { | |
| f = f.lastChild | |
| } | |
| n.merge(l, f.childNodes); | |
| f = k.firstChild; | |
| f.textContent = "" | |
| } | |
| } | |
| } | |
| k.textContent = ""; | |
| m = 0; | |
| while (e = l[m++]) { | |
| if (d && n.inArray(e, d) !== -1) { | |
| continue | |
| } | |
| i = n.contains(e.ownerDocument, e); | |
| f = oa(k.appendChild(e), "script"); | |
| if (i) { | |
| ma(f) | |
| } | |
| if (c) { | |
| j = 0; | |
| while (e = f[j++]) { | |
| if (fa.test(e.type || "")) { | |
| c.push(e) | |
| } | |
| } | |
| } | |
| } | |
| return k | |
| }, | |
| cleanData: function(a) { | |
| var b, c, d, e, f = n.event.special, | |
| g = 0; | |
| for (; | |
| (c = a[g]) !== undefined; g++) { | |
| if (n.acceptData(c)) { | |
| e = c[L.expando]; | |
| if (e && (b = L.cache[e])) { | |
| if (b.events) { | |
| for (d in b.events) { | |
| if (f[d]) { | |
| n.event.remove(c, d) | |
| } else { | |
| n.removeEvent(c, d, b.handle) | |
| } | |
| } | |
| } | |
| if (L.cache[e]) { | |
| delete L.cache[e] | |
| } | |
| } | |
| } | |
| delete M.cache[c[M.expando]] | |
| } | |
| } | |
| }); | |
| n.fn.extend({ | |
| text: function(a) { | |
| return J(this, function(a) { | |
| return a === undefined ? n.text(this) : this.empty().each(function() { | |
| if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { | |
| this.textContent = a | |
| } | |
| }) | |
| }, null, a, arguments.length) | |
| }, | |
| append: function() { | |
| return this.domManip(arguments, function(a) { | |
| if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { | |
| var b = ja(this, a); | |
| b.appendChild(a) | |
| } | |
| }) | |
| }, | |
| prepend: function() { | |
| return this.domManip(arguments, function(a) { | |
| if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { | |
| var b = ja(this, a); | |
| b.insertBefore(a, b.firstChild) | |
| } | |
| }) | |
| }, | |
| before: function() { | |
| return this.domManip(arguments, function(a) { | |
| if (this.parentNode) { | |
| this.parentNode.insertBefore(a, this) | |
| } | |
| }) | |
| }, | |
| after: function() { | |
| return this.domManip(arguments, function(a) { | |
| if (this.parentNode) { | |
| this.parentNode.insertBefore(a, this.nextSibling) | |
| } | |
| }) | |
| }, | |
| remove: function(a, b) { | |
| var c, d = a ? n.filter(a, this) : this, | |
| e = 0; | |
| for (; | |
| (c = d[e]) != null; e++) { | |
| if (!b && c.nodeType === 1) { | |
| n.cleanData(oa(c)) | |
| } | |
| if (c.parentNode) { | |
| if (b && n.contains(c.ownerDocument, c)) { | |
| ma(oa(c, "script")) | |
| } | |
| c.parentNode.removeChild(c) | |
| } | |
| } | |
| return this | |
| }, | |
| empty: function() { | |
| var a, b = 0; | |
| for (; | |
| (a = this[b]) != null; b++) { | |
| if (a.nodeType === 1) { | |
| n.cleanData(oa(a, false)); | |
| a.textContent = "" | |
| } | |
| } | |
| return this | |
| }, | |
| clone: function(a, b) { | |
| a = a == null ? false : a; | |
| b = b == null ? a : b; | |
| return this.map(function() { | |
| return n.clone(this, a, b) | |
| }) | |
| }, | |
| html: function(a) { | |
| return J(this, function(a) { | |
| var b = this[0] || {}, | |
| c = 0, | |
| d = this.length; | |
| if (a === undefined && b.nodeType === 1) { | |
| return b.innerHTML | |
| } | |
| if (typeof a === "string" && !da.test(a) && !ia[(ba.exec(a) || ["", ""])[1].toLowerCase()]) { | |
| a = a.replace(aa, "<$1></$2>"); | |
| try { | |
| for (; c < d; c++) { | |
| b = this[c] || {}; | |
| if (b.nodeType === 1) { | |
| n.cleanData(oa(b, false)); | |
| b.innerHTML = a | |
| } | |
| } | |
| b = 0 | |
| } catch (a) {} | |
| } | |
| if (b) { | |
| this.empty().append(a) | |
| } | |
| }, null, a, arguments.length) | |
| }, | |
| replaceWith: function() { | |
| var a = arguments[0]; | |
| this.domManip(arguments, function(b) { | |
| a = this.parentNode; | |
| n.cleanData(oa(this)); | |
| if (a) { | |
| a.replaceChild(b, this) | |
| } | |
| }); | |
| return a && (a.length || a.nodeType) ? this : this.remove() | |
| }, | |
| detach: function(a) { | |
| return this.remove(a, true) | |
| }, | |
| domManip: function(a, b) { | |
| a = e.apply([], a); | |
| var c, d, f, g, h, i, j = 0, | |
| l = this.length, | |
| m = this, | |
| o = l - 1, | |
| p = a[0], | |
| q = n.isFunction(p); | |
| if (q || l > 1 && typeof p === "string" && !k.checkClone && ea.test(p)) { | |
| return this.each(function(c) { | |
| var d = m.eq(c); | |
| if (q) { | |
| a[0] = p.call(this, c, d.html()) | |
| } | |
| d.domManip(a, b) | |
| }) | |
| } | |
| if (l) { | |
| c = n.buildFragment(a, this[0].ownerDocument, false, this); | |
| d = c.firstChild; | |
| if (c.childNodes.length === 1) { | |
| c = d | |
| } | |
| if (d) { | |
| f = n.map(oa(c, "script"), ka); | |
| g = f.length; | |
| for (; j < l; j++) { | |
| h = c; | |
| if (j !== o) { | |
| h = n.clone(h, true, true); | |
| if (g) { | |
| n.merge(f, oa(h, "script")) | |
| } | |
| } | |
| b.call(this[j], h, j) | |
| } | |
| if (g) { | |
| i = f[f.length - 1].ownerDocument; | |
| n.map(f, la); | |
| for (j = 0; j < g; j++) { | |
| h = f[j]; | |
| if (fa.test(h.type || "") && !L.access(h, "globalEval") && n.contains(i, h)) { | |
| if (h.src) { | |
| if (n._evalUrl) { | |
| n._evalUrl(h.src) | |
| } | |
| } else { | |
| n.globalEval(h.textContent.replace(ha, "")) | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| return this | |
| } | |
| }); | |
| n.each({ | |
| appendTo: "append", | |
| prependTo: "prepend", | |
| insertBefore: "before", | |
| insertAfter: "after", | |
| replaceAll: "replaceWith" | |
| }, function(a, b) { | |
| n.fn[a] = function(a) { | |
| var c, d = [], | |
| e = n(a), | |
| g = e.length - 1, | |
| h = 0; | |
| for (; h <= g; h++) { | |
| c = h === g ? this : this.clone(true); | |
| n(e[h])[b](c); | |
| f.apply(d, c.get()) | |
| } | |
| return this.pushStack(d) | |
| } | |
| }); | |
| var qa, ra = {}; | |
| function sa(b, c) { | |
| var d, e = n(c.createElement(b)).appendTo(c.body), | |
| f = a.getDefaultComputedStyle && (d = a.getDefaultComputedStyle(e[0])) ? d.display : n.css(e[0], "display"); | |
| e.detach(); | |
| return f | |
| } | |
| function ta(a) { | |
| var b = l, | |
| c = ra[a]; | |
| if (!c) { | |
| c = sa(a, b); | |
| if (c === "none" || !c) { | |
| qa = (qa || n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement); | |
| b = qa[0].contentDocument; | |
| b.write(); | |
| b.close(); | |
| c = sa(a, b); | |
| qa.detach() | |
| } | |
| ra[a] = c | |
| } | |
| return c | |
| } | |
| var ua = /^margin/; | |
| var va = new RegExp("^(" + Q + ")(?!px)[a-z%]+$", "i"); | |
| var wa = function(a) { | |
| return a.ownerDocument.defaultView.getComputedStyle(a, null) | |
| }; | |
| function xa(a, b, c) { | |
| var d, e, f, g, h = a.style; | |
| c = c || wa(a); | |
| if (c) { | |
| g = c.getPropertyValue(b) || c[b] | |
| } | |
| if (c) { | |
| if (g === "" && !n.contains(a.ownerDocument, a)) { | |
| g = n.style(a, b) | |
| } | |
| if (va.test(g) && ua.test(b)) { | |
| d = h.width; | |
| e = h.minWidth; | |
| f = h.maxWidth; | |
| h.minWidth = h.maxWidth = h.width = g; | |
| g = c.width; | |
| h.width = d; | |
| h.minWidth = e; | |
| h.maxWidth = f | |
| } | |
| } | |
| return g !== undefined ? g + "" : g | |
| } | |
| function ya(a, b) { | |
| return { | |
| get: function() { | |
| if (a()) { | |
| delete this.get; | |
| return | |
| } | |
| return (this.get = b).apply(this, arguments) | |
| } | |
| } | |
| }(function() { | |
| var b, c, d = l.documentElement, | |
| e = l.createElement("div"), | |
| f = l.createElement("div"); | |
| if (!f.style) { | |
| return | |
| } | |
| f.style.backgroundClip = "content-box"; | |
| f.cloneNode(true).style.backgroundClip = ""; | |
| k.clearCloneStyle = f.style.backgroundClip === "content-box"; | |
| e.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" + "position:absolute"; | |
| e.appendChild(f); | |
| function g() { | |
| f.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + "border:1px;padding:1px;width:4px;position:absolute"; | |
| f.innerHTML = ""; | |
| d.appendChild(e); | |
| var g = a.getComputedStyle(f, null); | |
| b = g.top !== "1%"; | |
| c = g.width === "4px"; | |
| d.removeChild(e) | |
| } | |
| if (a.getComputedStyle) { | |
| n.extend(k, { | |
| pixelPosition: function() { | |
| g(); | |
| return b | |
| }, | |
| boxSizingReliable: function() { | |
| if (c == null) { | |
| g() | |
| } | |
| return c | |
| }, | |
| reliableMarginRight: function() { | |
| var b, c = f.appendChild(l.createElement("div")); | |
| c.style.cssText = f.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; | |
| c.style.marginRight = c.style.width = "0"; | |
| f.style.width = "1px"; | |
| d.appendChild(e); | |
| b = !parseFloat(a.getComputedStyle(c, null).marginRight); | |
| d.removeChild(e); | |
| return b | |
| } | |
| }) | |
| } | |
| })(); | |
| n.swap = function(a, b, c, d) { | |
| var e, f, g = {}; | |
| for (f in b) { | |
| g[f] = a.style[f]; | |
| a.style[f] = b[f] | |
| } | |
| e = c.apply(a, d || []); | |
| for (f in b) { | |
| a.style[f] = g[f] | |
| } | |
| return e | |
| }; | |
| var za = /^(none|table(?!-c[ea]).+)/, | |
| Aa = new RegExp("^(" + Q + ")(.*)$", "i"), | |
| Ba = new RegExp("^([+-])=(" + Q + ")", "i"), | |
| Ca = { | |
| position: "absolute", | |
| visibility: "hidden", | |
| display: "block" | |
| }, | |
| Da = { | |
| letterSpacing: "0", | |
| fontWeight: "400" | |
| }, | |
| Ea = ["Webkit", "O", "Moz", "ms"]; | |
| function Fa(a, b) { | |
| if (b in a) { | |
| return b | |
| } | |
| var c = b[0].toUpperCase() + b.slice(1), | |
| d = b, | |
| e = Ea.length; | |
| while (e--) { | |
| b = Ea[e] + c; | |
| if (b in a) { | |
| return b | |
| } | |
| } | |
| return d | |
| } | |
| function Ga(a, b, c) { | |
| var d = Aa.exec(b); | |
| return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b | |
| } | |
| function Ha(a, b, c, d, e) { | |
| var f = c === (d ? "border" : "content") ? 4 : b === "width" ? 1 : 0, | |
| g = 0; | |
| for (; f < 4; f += 2) { | |
| if (c === "margin") { | |
| g += n.css(a, c + R[f], true, e) | |
| } | |
| if (d) { | |
| if (c === "content") { | |
| g -= n.css(a, "padding" + R[f], true, e) | |
| } | |
| if (c !== "margin") { | |
| g -= n.css(a, "border" + R[f] + "Width", true, e) | |
| } | |
| } else { | |
| g += n.css(a, "padding" + R[f], true, e); | |
| if (c !== "padding") { | |
| g += n.css(a, "border" + R[f] + "Width", true, e) | |
| } | |
| } | |
| } | |
| return g | |
| } | |
| function Ia(a, b, c) { | |
| var d = true, | |
| e = b === "width" ? a.offsetWidth : a.offsetHeight, | |
| f = wa(a), | |
| g = n.css(a, "boxSizing", false, f) === "border-box"; | |
| if (e <= 0 || e == null) { | |
| e = xa(a, b, f); | |
| if (e < 0 || e == null) { | |
| e = a.style[b] | |
| } | |
| if (va.test(e)) { | |
| return e | |
| } | |
| d = g && (k.boxSizingReliable() || e === a.style[b]); | |
| e = parseFloat(e) || 0 | |
| } | |
| return e + Ha(a, b, c || (g ? "border" : "content"), d, f) + "px" | |
| } | |
| function Ja(a, b) { | |
| var c, d, e, f = [], | |
| g = 0, | |
| h = a.length; | |
| for (; g < h; g++) { | |
| d = a[g]; | |
| if (!d.style) { | |
| continue | |
| } | |
| f[g] = L.get(d, "olddisplay"); | |
| c = d.style.display; | |
| if (b) { | |
| if (!f[g] && c === "none") { | |
| d.style.display = "" | |
| } | |
| if (d.style.display === "" && S(d)) { | |
| f[g] = L.access(d, "olddisplay", ta(d.nodeName)) | |
| } | |
| } else { | |
| e = S(d); | |
| if (c !== "none" || !e) { | |
| L.set(d, "olddisplay", e ? c : n.css(d, "display")) | |
| } | |
| } | |
| } | |
| for (g = 0; g < h; g++) { | |
| d = a[g]; | |
| if (!d.style) { | |
| continue | |
| } | |
| if (!b || d.style.display === "none" || d.style.display === "") { | |
| d.style.display = b ? f[g] || "" : "none" | |
| } | |
| } | |
| return a | |
| } | |
| n.extend({ | |
| cssHooks: { | |
| opacity: { | |
| get: function(a, b) { | |
| if (b) { | |
| var c = xa(a, "opacity"); | |
| return c === "" ? "1" : c | |
| } | |
| } | |
| } | |
| }, | |
| cssNumber: { | |
| columnCount: true, | |
| fillOpacity: true, | |
| flexGrow: true, | |
| flexShrink: true, | |
| fontWeight: true, | |
| lineHeight: true, | |
| opacity: true, | |
| order: true, | |
| orphans: true, | |
| widows: true, | |
| zIndex: true, | |
| zoom: true | |
| }, | |
| cssProps: { | |
| float: "cssFloat" | |
| }, | |
| style: function(a, b, c, d) { | |
| if (!a || a.nodeType === 3 || a.nodeType === 8 || !a.style) { | |
| return | |
| } | |
| var e, f, g, h = n.camelCase(b), | |
| i = a.style; | |
| b = n.cssProps[h] || (n.cssProps[h] = Fa(i, h)); | |
| g = n.cssHooks[b] || n.cssHooks[h]; | |
| if (c !== undefined) { | |
| f = typeof c; | |
| if (f === "string" && (e = Ba.exec(c))) { | |
| c = (e[1] + 1) * e[2] + parseFloat(n.css(a, b)); | |
| f = "number" | |
| } | |
| if (c == null || c !== c) { | |
| return | |
| } | |
| if (f === "number" && !n.cssNumber[h]) { | |
| c += "px" | |
| } | |
| if (!k.clearCloneStyle && c === "" && b.indexOf("background") === 0) { | |
| i[b] = "inherit" | |
| } | |
| if (!g || !("set" in g) || (c = g.set(a, c, d)) !== undefined) { | |
| i[b] = c | |
| } | |
| } else { | |
| if (g && "get" in g && (e = g.get(a, false, d)) !== undefined) { | |
| return e | |
| } | |
| return i[b] | |
| } | |
| }, | |
| css: function(a, b, c, d) { | |
| var e, f, g, h = n.camelCase(b); | |
| b = n.cssProps[h] || (n.cssProps[h] = Fa(a.style, h)); | |
| g = n.cssHooks[b] || n.cssHooks[h]; | |
| if (g && "get" in g) { | |
| e = g.get(a, true, c) | |
| } | |
| if (e === undefined) { | |
| e = xa(a, b, d) | |
| } | |
| if (e === "normal" && b in Da) { | |
| e = Da[b] | |
| } | |
| if (c === "" || c) { | |
| f = parseFloat(e); | |
| return c === true || n.isNumeric(f) ? f || 0 : e | |
| } | |
| return e | |
| } | |
| }); | |
| n.each(["height", "width"], function(a, b) { | |
| n.cssHooks[b] = { | |
| get: function(a, c, d) { | |
| if (c) { | |
| return za.test(n.css(a, "display")) && a.offsetWidth === 0 ? n.swap(a, Ca, function() { | |
| return Ia(a, b, d) | |
| }) : Ia(a, b, d) | |
| } | |
| }, | |
| set: function(a, c, d) { | |
| var e = d && wa(a); | |
| return Ga(a, c, d ? Ha(a, b, d, n.css(a, "boxSizing", false, e) === "border-box", e) : 0) | |
| } | |
| } | |
| }); | |
| n.cssHooks.marginRight = ya(k.reliableMarginRight, function(a, b) { | |
| if (b) { | |
| return n.swap(a, { | |
| display: "inline-block" | |
| }, xa, [a, "marginRight"]) | |
| } | |
| }); | |
| n.each({ | |
| margin: "", | |
| padding: "", | |
| border: "Width" | |
| }, function(a, b) { | |
| n.cssHooks[a + b] = { | |
| expand: function(c) { | |
| var d = 0, | |
| e = {}, | |
| f = typeof c === "string" ? c.split(" ") : [c]; | |
| for (; d < 4; d++) { | |
| e[a + R[d] + b] = f[d] || f[d - 2] || f[0] | |
| } | |
| return e | |
| } | |
| }; | |
| if (!ua.test(a)) { | |
| n.cssHooks[a + b].set = Ga | |
| } | |
| }); | |
| n.fn.extend({ | |
| css: function(a, b) { | |
| return J(this, function(a, b, c) { | |
| var d, e, f = {}, | |
| g = 0; | |
| if (n.isArray(b)) { | |
| d = wa(a); | |
| e = b.length; | |
| for (; g < e; g++) { | |
| f[b[g]] = n.css(a, b[g], false, d) | |
| } | |
| return f | |
| } | |
| return c !== undefined ? n.style(a, b, c) : n.css(a, b) | |
| }, a, b, arguments.length > 1) | |
| }, | |
| show: function() { | |
| return Ja(this, true) | |
| }, | |
| hide: function() { | |
| return Ja(this) | |
| }, | |
| toggle: function(a) { | |
| if (typeof a === "boolean") { | |
| return a ? this.show() : this.hide() | |
| } | |
| return this.each(function() { | |
| if (S(this)) { | |
| n(this).show() | |
| } else { | |
| n(this).hide() | |
| } | |
| }) | |
| } | |
| }); | |
| function Ka(a, b, c, d, e) { | |
| return new Ka.prototype.init(a, b, c, d, e) | |
| } | |
| n.Tween = Ka; | |
| Ka.prototype = { | |
| constructor: Ka, | |
| init: function(a, b, c, d, e, f) { | |
| this.elem = a; | |
| this.prop = c; | |
| this.easing = e || "swing"; | |
| this.options = b; | |
| this.start = this.now = this.cur(); | |
| this.end = d; | |
| this.unit = f || (n.cssNumber[c] ? "" : "px") | |
| }, | |
| cur: function() { | |
| var a = Ka.propHooks[this.prop]; | |
| return a && a.get ? a.get(this) : Ka.propHooks._default.get(this) | |
| }, | |
| run: function(a) { | |
| var b, c = Ka.propHooks[this.prop]; | |
| if (this.options.duration) { | |
| this.pos = b = n.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) | |
| } else { | |
| this.pos = b = a | |
| } | |
| this.now = (this.end - this.start) * b + this.start; | |
| if (this.options.step) { | |
| this.options.step.call(this.elem, this.now, this) | |
| } | |
| if (c && c.set) { | |
| c.set(this) | |
| } else { | |
| Ka.propHooks._default.set(this) | |
| } | |
| return this | |
| } | |
| }; | |
| Ka.prototype.init.prototype = Ka.prototype; | |
| Ka.propHooks = { | |
| _default: { | |
| get: function(a) { | |
| var b; | |
| if (a.elem[a.prop] != null && (!a.elem.style || a.elem.style[a.prop] == null)) { | |
| return a.elem[a.prop] | |
| } | |
| b = n.css(a.elem, a.prop, ""); | |
| return !b || b === "auto" ? 0 : b | |
| }, | |
| set: function(a) { | |
| if (n.fx.step[a.prop]) { | |
| n.fx.step[a.prop](a) | |
| } else if (a.elem.style && (a.elem.style[n.cssProps[a.prop]] != null || n.cssHooks[a.prop])) { | |
| n.style(a.elem, a.prop, a.now + a.unit) | |
| } else { | |
| a.elem[a.prop] = a.now | |
| } | |
| } | |
| } | |
| }; | |
| Ka.propHooks.scrollTop = Ka.propHooks.scrollLeft = { | |
| set: function(a) { | |
| if (a.elem.nodeType && a.elem.parentNode) { | |
| a.elem[a.prop] = a.now | |
| } | |
| } | |
| }; | |
| n.easing = { | |
| linear: function(a) { | |
| return a | |
| }, | |
| swing: function(a) { | |
| return .5 - Math.cos(a * Math.PI) / 2 | |
| } | |
| }; | |
| n.fx = Ka.prototype.init; | |
| n.fx.step = {}; | |
| var La, Ma, Na = /^(?:toggle|show|hide)$/, | |
| Oa = new RegExp("^(?:([+-])=|)(" + Q + ")([a-z%]*)$", "i"), | |
| Pa = /queueHooks$/, | |
| Qa = [Va], | |
| Ra = { | |
| "*": [function(a, b) { | |
| var c = this.createTween(a, b), | |
| d = c.cur(), | |
| e = Oa.exec(b), | |
| f = e && e[3] || (n.cssNumber[a] ? "" : "px"), | |
| g = (n.cssNumber[a] || f !== "px" && +d) && Oa.exec(n.css(c.elem, a)), | |
| h = 1, | |
| i = 20; | |
| if (g && g[3] !== f) { | |
| f = f || g[3]; | |
| e = e || []; | |
| g = +d || 1; | |
| do { | |
| h = h || ".5"; | |
| g = g / h; | |
| n.style(c.elem, a, g + f) | |
| } while (h !== (h = c.cur() / d) && h !== 1 && --i) | |
| } | |
| if (e) { | |
| g = c.start = +g || +d || 0; | |
| c.unit = f; | |
| c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2] | |
| } | |
| return c | |
| }] | |
| }; | |
| function Sa() { | |
| setTimeout(function() { | |
| La = undefined | |
| }); | |
| return La = n.now() | |
| } | |
| function Ta(a, b) { | |
| var c, d = 0, | |
| e = { | |
| height: a | |
| }; | |
| b = b ? 1 : 0; | |
| for (; d < 4; d += 2 - b) { | |
| c = R[d]; | |
| e["margin" + c] = e["padding" + c] = a | |
| } | |
| if (b) { | |
| e.opacity = e.width = a | |
| } | |
| return e | |
| } | |
| function Ua(a, b, c) { | |
| var d, e = (Ra[b] || []).concat(Ra["*"]), | |
| f = 0, | |
| g = e.length; | |
| for (; f < g; f++) { | |
| if (d = e[f].call(c, b, a)) { | |
| return d | |
| } | |
| } | |
| } | |
| function Va(a, b, c) { | |
| var d, e, f, g, h, i, j, k, l = this, | |
| m = {}, | |
| o = a.style, | |
| p = a.nodeType && S(a), | |
| q = L.get(a, "fxshow"); | |
| if (!c.queue) { | |
| h = n._queueHooks(a, "fx"); | |
| if (h.unqueued == null) { | |
| h.unqueued = 0; | |
| i = h.empty.fire; | |
| h.empty.fire = function() { | |
| if (!h.unqueued) { | |
| i() | |
| } | |
| } | |
| } | |
| h.unqueued++; | |
| l.always(function() { | |
| l.always(function() { | |
| h.unqueued--; | |
| if (!n.queue(a, "fx").length) { | |
| h.empty.fire() | |
| } | |
| }) | |
| }) | |
| } | |
| if (a.nodeType === 1 && ("height" in b || "width" in b)) { | |
| c.overflow = [o.overflow, o.overflowX, o.overflowY]; | |
| j = n.css(a, "display"); | |
| k = j === "none" ? L.get(a, "olddisplay") || ta(a.nodeName) : j; | |
| if (k === "inline" && n.css(a, "float") === "none") { | |
| o.display = "inline-block" | |
| } | |
| } | |
| if (c.overflow) { | |
| o.overflow = "hidden"; | |
| l.always(function() { | |
| o.overflow = c.overflow[0]; | |
| o.overflowX = c.overflow[1]; | |
| o.overflowY = c.overflow[2] | |
| }) | |
| } | |
| for (d in b) { | |
| e = b[d]; | |
| if (Na.exec(e)) { | |
| delete b[d]; | |
| f = f || e === "toggle"; | |
| if (e === (p ? "hide" : "show")) { | |
| if (e === "show" && q && q[d] !== undefined) { | |
| p = true | |
| } else { | |
| continue | |
| } | |
| } | |
| m[d] = q && q[d] || n.style(a, d) | |
| } else { | |
| j = undefined | |
| } | |
| } | |
| if (!n.isEmptyObject(m)) { | |
| if (q) { | |
| if ("hidden" in q) { | |
| p = q.hidden | |
| } | |
| } else { | |
| q = L.access(a, "fxshow", {}) | |
| } | |
| if (f) { | |
| q.hidden = !p | |
| } | |
| if (p) { | |
| n(a).show() | |
| } else { | |
| l.done(function() { | |
| n(a).hide() | |
| }) | |
| } | |
| l.done(function() { | |
| var b; | |
| L.remove(a, "fxshow"); | |
| for (b in m) { | |
| n.style(a, b, m[b]) | |
| } | |
| }); | |
| for (d in m) { | |
| g = Ua(p ? q[d] : 0, d, l); | |
| if (!(d in q)) { | |
| q[d] = g.start; | |
| if (p) { | |
| g.end = g.start; | |
| g.start = d === "width" || d === "height" ? 1 : 0 | |
| } | |
| } | |
| } | |
| } else if ((j === "none" ? ta(a.nodeName) : j) === "inline") { | |
| o.display = j | |
| } | |
| } | |
| function Wa(a, b) { | |
| var c, d, e, f, g; | |
| for (c in a) { | |
| d = n.camelCase(c); | |
| e = b[d]; | |
| f = a[c]; | |
| if (n.isArray(f)) { | |
| e = f[1]; | |
| f = a[c] = f[0] | |
| } | |
| if (c !== d) { | |
| a[d] = f; | |
| delete a[c] | |
| } | |
| g = n.cssHooks[d]; | |
| if (g && "expand" in g) { | |
| f = g.expand(f); | |
| delete a[d]; | |
| for (c in f) { | |
| if (!(c in a)) { | |
| a[c] = f[c]; | |
| b[c] = e | |
| } | |
| } | |
| } else { | |
| b[d] = e | |
| } | |
| } | |
| } | |
| function Xa(a, b, c) { | |
| var d, e, f = 0, | |
| g = Qa.length, | |
| h = n.Deferred().always(function() { | |
| delete i.elem | |
| }), | |
| i = function() { | |
| if (e) { | |
| return false | |
| } | |
| var b = La || Sa(), | |
| c = Math.max(0, j.startTime + j.duration - b), | |
| d = c / j.duration || 0, | |
| f = 1 - d, | |
| g = 0, | |
| i = j.tweens.length; | |
| for (; g < i; g++) { | |
| j.tweens[g].run(f) | |
| } | |
| h.notifyWith(a, [j, f, c]); | |
| if (f < 1 && i) { | |
| return c | |
| } else { | |
| h.resolveWith(a, [j]); | |
| return false | |
| } | |
| }, | |
| j = h.promise({ | |
| elem: a, | |
| props: n.extend({}, b), | |
| opts: n.extend(true, { | |
| specialEasing: {} | |
| }, c), | |
| originalProperties: b, | |
| originalOptions: c, | |
| startTime: La || Sa(), | |
| duration: c.duration, | |
| tweens: [], | |
| createTween: function(b, c) { | |
| var d = n.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); | |
| j.tweens.push(d); | |
| return d | |
| }, | |
| stop: function(b) { | |
| var c = 0, | |
| d = b ? j.tweens.length : 0; | |
| if (e) { | |
| return this | |
| } | |
| e = true; | |
| for (; c < d; c++) { | |
| j.tweens[c].run(1) | |
| } | |
| if (b) { | |
| h.resolveWith(a, [j, b]) | |
| } else { | |
| h.rejectWith(a, [j, b]) | |
| } | |
| return this | |
| } | |
| }), | |
| k = j.props; | |
| Wa(k, j.opts.specialEasing); | |
| for (; f < g; f++) { | |
| d = Qa[f].call(j, a, k, j.opts); | |
| if (d) { | |
| return d | |
| } | |
| } | |
| n.map(k, Ua, j); | |
| if (n.isFunction(j.opts.start)) { | |
| j.opts.start.call(a, j) | |
| } | |
| n.fx.timer(n.extend(i, { | |
| elem: a, | |
| anim: j, | |
| queue: j.opts.queue | |
| })); | |
| return j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) | |
| } | |
| n.Animation = n.extend(Xa, { | |
| tweener: function(a, b) { | |
| if (n.isFunction(a)) { | |
| b = a; | |
| a = ["*"] | |
| } else { | |
| a = a.split(" ") | |
| } | |
| var c, d = 0, | |
| e = a.length; | |
| for (; d < e; d++) { | |
| c = a[d]; | |
| Ra[c] = Ra[c] || []; | |
| Ra[c].unshift(b) | |
| } | |
| }, | |
| prefilter: function(a, b) { | |
| if (b) { | |
| Qa.unshift(a) | |
| } else { | |
| Qa.push(a) | |
| } | |
| } | |
| }); | |
| n.speed = function(a, b, c) { | |
| var d = a && typeof a === "object" ? n.extend({}, a) : { | |
| complete: c || !c && b || n.isFunction(a) && a, | |
| duration: a, | |
| easing: c && b || b && !n.isFunction(b) && b | |
| }; | |
| d.duration = n.fx.off ? 0 : typeof d.duration === "number" ? d.duration : d.duration in n.fx.speeds ? n.fx.speeds[d.duration] : n.fx.speeds._default; | |
| if (d.queue == null || d.queue === true) { | |
| d.queue = "fx" | |
| } | |
| d.old = d.complete; | |
| d.complete = function() { | |
| if (n.isFunction(d.old)) { | |
| d.old.call(this) | |
| } | |
| if (d.queue) { | |
| n.dequeue(this, d.queue) | |
| } | |
| }; | |
| return d | |
| }; | |
| n.fn.extend({ | |
| fadeTo: function(a, b, c, d) { | |
| return this.filter(S).css("opacity", 0).show().end().animate({ | |
| opacity: b | |
| }, a, c, d) | |
| }, | |
| animate: function(a, b, c, d) { | |
| var e = n.isEmptyObject(a), | |
| f = n.speed(b, c, d), | |
| g = function() { | |
| var b = Xa(this, n.extend({}, a), f); | |
| if (e || L.get(this, "finish")) { | |
| b.stop(true) | |
| } | |
| }; | |
| g.finish = g; | |
| return e || f.queue === false ? this.each(g) : this.queue(f.queue, g) | |
| }, | |
| stop: function(a, b, c) { | |
| var d = function(a) { | |
| var b = a.stop; | |
| delete a.stop; | |
| b(c) | |
| }; | |
| if (typeof a !== "string") { | |
| c = b; | |
| b = a; | |
| a = undefined | |
| } | |
| if (b && a !== false) { | |
| this.queue(a || "fx", []) | |
| } | |
| return this.each(function() { | |
| var b = true, | |
| e = a != null && a + "queueHooks", | |
| f = n.timers, | |
| g = L.get(this); | |
| if (e) { | |
| if (g[e] && g[e].stop) { | |
| d(g[e]) | |
| } | |
| } else { | |
| for (e in g) { | |
| if (g[e] && g[e].stop && Pa.test(e)) { | |
| d(g[e]) | |
| } | |
| } | |
| } | |
| for (e = f.length; e--;) { | |
| if (f[e].elem === this && (a == null || f[e].queue === a)) { | |
| f[e].anim.stop(c); | |
| b = false; | |
| f.splice(e, 1) | |
| } | |
| } | |
| if (b || !c) { | |
| n.dequeue(this, a) | |
| } | |
| }) | |
| }, | |
| finish: function(a) { | |
| if (a !== false) { | |
| a = a || "fx" | |
| } | |
| return this.each(function() { | |
| var b, c = L.get(this), | |
| d = c[a + "queue"], | |
| e = c[a + "queueHooks"], | |
| f = n.timers, | |
| g = d ? d.length : 0; | |
| c.finish = true; | |
| n.queue(this, a, []); | |
| if (e && e.stop) { | |
| e.stop.call(this, true) | |
| } | |
| for (b = f.length; b--;) { | |
| if (f[b].elem === this && f[b].queue === a) { | |
| f[b].anim.stop(true); | |
| f.splice(b, 1) | |
| } | |
| } | |
| for (b = 0; b < g; b++) { | |
| if (d[b] && d[b].finish) { | |
| d[b].finish.call(this) | |
| } | |
| } | |
| delete c.finish | |
| }) | |
| } | |
| }); | |
| n.each(["toggle", "show", "hide"], function(a, b) { | |
| var c = n.fn[b]; | |
| n.fn[b] = function(a, d, e) { | |
| return a == null || typeof a === "boolean" ? c.apply(this, arguments) : this.animate(Ta(b, true), a, d, e) | |
| } | |
| }); | |
| n.each({ | |
| slideDown: Ta("show"), | |
| slideUp: Ta("hide"), | |
| slideToggle: Ta("toggle"), | |
| fadeIn: { | |
| opacity: "show" | |
| }, | |
| fadeOut: { | |
| opacity: "hide" | |
| }, | |
| fadeToggle: { | |
| opacity: "toggle" | |
| } | |
| }, function(a, b) { | |
| n.fn[a] = function(a, c, d) { | |
| return this.animate(b, a, c, d) | |
| } | |
| }); | |
| n.timers = []; | |
| n.fx.tick = function() { | |
| var a, b = 0, | |
| c = n.timers; | |
| La = n.now(); | |
| for (; b < c.length; b++) { | |
| a = c[b]; | |
| if (!a() && c[b] === a) { | |
| c.splice(b--, 1) | |
| } | |
| } | |
| if (!c.length) { | |
| n.fx.stop() | |
| } | |
| La = undefined | |
| }; | |
| n.fx.timer = function(a) { | |
| n.timers.push(a); | |
| if (a()) { | |
| n.fx.start() | |
| } else { | |
| n.timers.pop() | |
| } | |
| }; | |
| n.fx.interval = 13; | |
| n.fx.start = function() { | |
| if (!Ma) { | |
| Ma = setInterval(n.fx.tick, n.fx.interval) | |
| } | |
| }; | |
| n.fx.stop = function() { | |
| clearInterval(Ma); | |
| Ma = null | |
| }; | |
| n.fx.speeds = { | |
| slow: 600, | |
| fast: 200, | |
| _default: 400 | |
| }; | |
| n.fn.delay = function(a, b) { | |
| a = n.fx ? n.fx.speeds[a] || a : a; | |
| b = b || "fx"; | |
| return this.queue(b, function(b, c) { | |
| var d = setTimeout(b, a); | |
| c.stop = function() { | |
| clearTimeout(d) | |
| } | |
| }) | |
| }; | |
| (function() { | |
| var a = l.createElement("input"), | |
| b = l.createElement("select"), | |
| c = b.appendChild(l.createElement("option")); | |
| a.type = "checkbox"; | |
| k.checkOn = a.value !== ""; | |
| k.optSelected = c.selected; | |
| b.disabled = true; | |
| k.optDisabled = !c.disabled; | |
| a = l.createElement("input"); | |
| a.value = "t"; | |
| a.type = "radio"; | |
| k.radioValue = a.value === "t" | |
| })(); | |
| var Ya, Za, $a = n.expr.attrHandle; | |
| n.fn.extend({ | |
| attr: function(a, b) { | |
| return J(this, n.attr, a, b, arguments.length > 1) | |
| }, | |
| removeAttr: function(a) { | |
| return this.each(function() { | |
| n.removeAttr(this, a) | |
| }) | |
| } | |
| }); | |
| n.extend({ | |
| attr: function(a, b, c) { | |
| var d, e, f = a.nodeType; | |
| if (!a || f === 3 || f === 8 || f === 2) { | |
| return | |
| } | |
| if (typeof a.getAttribute === U) { | |
| return n.prop(a, b, c) | |
| } | |
| if (f !== 1 || !n.isXMLDoc(a)) { | |
| b = b.toLowerCase(); | |
| d = n.attrHooks[b] || (n.expr.match.bool.test(b) ? Za : Ya) | |
| } | |
| if (c !== undefined) { | |
| if (c === null) { | |
| n.removeAttr(a, b) | |
| } else if (d && "set" in d && (e = d.set(a, c, b)) !== undefined) { | |
| return e | |
| } else { | |
| a.setAttribute(b, c + ""); | |
| return c | |
| } | |
| } else if (d && "get" in d && (e = d.get(a, b)) !== null) { | |
| return e | |
| } else { | |
| e = n.find.attr(a, b); | |
| return e == null ? undefined : e | |
| } | |
| }, | |
| removeAttr: function(a, b) { | |
| var c, d, e = 0, | |
| f = b && b.match(E); | |
| if (f && a.nodeType === 1) { | |
| while (c = f[e++]) { | |
| d = n.propFix[c] || c; | |
| if (n.expr.match.bool.test(c)) { | |
| a[d] = false | |
| } | |
| a.removeAttribute(c) | |
| } | |
| } | |
| }, | |
| attrHooks: { | |
| type: { | |
| set: function(a, b) { | |
| if (!k.radioValue && b === "radio" && n.nodeName(a, "input")) { | |
| var c = a.value; | |
| a.setAttribute("type", b); | |
| if (c) { | |
| a.value = c | |
| } | |
| return b | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| Za = { | |
| set: function(a, b, c) { | |
| if (b === false) { | |
| n.removeAttr(a, c) | |
| } else { | |
| a.setAttribute(c, c) | |
| } | |
| return c | |
| } | |
| }; | |
| n.each(n.expr.match.bool.source.match(/\w+/g), function(a, b) { | |
| var c = $a[b] || n.find.attr; | |
| $a[b] = function(a, b, d) { | |
| var e, f; | |
| if (!d) { | |
| f = $a[b]; | |
| $a[b] = e; | |
| e = c(a, b, d) != null ? b.toLowerCase() : null; | |
| $a[b] = f | |
| } | |
| return e | |
| } | |
| }); | |
| var _a = /^(?:input|select|textarea|button)$/i; | |
| n.fn.extend({ | |
| prop: function(a, b) { | |
| return J(this, n.prop, a, b, arguments.length > 1) | |
| }, | |
| removeProp: function(a) { | |
| return this.each(function() { | |
| delete this[n.propFix[a] || a] | |
| }) | |
| } | |
| }); | |
| n.extend({ | |
| propFix: { | |
| for: "htmlFor", | |
| class: "className" | |
| }, | |
| prop: function(a, b, c) { | |
| var d, e, f, g = a.nodeType; | |
| if (!a || g === 3 || g === 8 || g === 2) { | |
| return | |
| } | |
| f = g !== 1 || !n.isXMLDoc(a); | |
| if (f) { | |
| b = n.propFix[b] || b; | |
| e = n.propHooks[b] | |
| } | |
| if (c !== undefined) { | |
| return e && "set" in e && (d = e.set(a, c, b)) !== undefined ? d : a[b] = c | |
| } else { | |
| return e && "get" in e && (d = e.get(a, b)) !== null ? d : a[b] | |
| } | |
| }, | |
| propHooks: { | |
| tabIndex: { | |
| get: function(a) { | |
| return a.hasAttribute("tabindex") || _a.test(a.nodeName) || a.href ? a.tabIndex : -1 | |
| } | |
| } | |
| } | |
| }); | |
| if (!k.optSelected) { | |
| n.propHooks.selected = { | |
| get: function(a) { | |
| var b = a.parentNode; | |
| if (b && b.parentNode) { | |
| b.parentNode.selectedIndex | |
| } | |
| return null | |
| } | |
| } | |
| } | |
| n.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() { | |
| n.propFix[this.toLowerCase()] = this | |
| }); | |
| var ab = /[\t\r\n\f]/g; | |
| n.fn.extend({ | |
| addClass: function(a) { | |
| var b, c, d, e, f, g, h = typeof a === "string" && a, | |
| i = 0, | |
| j = this.length; | |
| if (n.isFunction(a)) { | |
| return this.each(function(b) { | |
| n(this).addClass(a.call(this, b, this.className)) | |
| }) | |
| } | |
| if (h) { | |
| b = (a || "").match(E) || []; | |
| for (; i < j; i++) { | |
| c = this[i]; | |
| d = c.nodeType === 1 && (c.className ? (" " + c.className + " ").replace(ab, " ") : " "); | |
| if (d) { | |
| f = 0; | |
| while (e = b[f++]) { | |
| if (d.indexOf(" " + e + " ") < 0) { | |
| d += e + " " | |
| } | |
| } | |
| g = n.trim(d); | |
| if (c.className !== g) { | |
| c.className = g | |
| } | |
| } | |
| } | |
| } | |
| return this | |
| }, | |
| removeClass: function(a) { | |
| var b, c, d, e, f, g, h = arguments.length === 0 || typeof a === "string" && a, | |
| i = 0, | |
| j = this.length; | |
| if (n.isFunction(a)) { | |
| return this.each(function(b) { | |
| n(this).removeClass(a.call(this, b, this.className)) | |
| }) | |
| } | |
| if (h) { | |
| b = (a || "").match(E) || []; | |
| for (; i < j; i++) { | |
| c = this[i]; | |
| d = c.nodeType === 1 && (c.className ? (" " + c.className + " ").replace(ab, " ") : ""); | |
| if (d) { | |
| f = 0; | |
| while (e = b[f++]) { | |
| while (d.indexOf(" " + e + " ") >= 0) { | |
| d = d.replace(" " + e + " ", " ") | |
| } | |
| } | |
| g = a ? n.trim(d) : ""; | |
| if (c.className !== g) { | |
| c.className = g | |
| } | |
| } | |
| } | |
| } | |
| return this | |
| }, | |
| toggleClass: function(a, b) { | |
| var c = typeof a; | |
| if (typeof b === "boolean" && c === "string") { | |
| return b ? this.addClass(a) : this.removeClass(a) | |
| } | |
| if (n.isFunction(a)) { | |
| return this.each(function(c) { | |
| n(this).toggleClass(a.call(this, c, this.className, b), b) | |
| }) | |
| } | |
| return this.each(function() { | |
| if (c === "string") { | |
| var b, d = 0, | |
| e = n(this), | |
| f = a.match(E) || []; | |
| while (b = f[d++]) { | |
| if (e.hasClass(b)) { | |
| e.removeClass(b) | |
| } else { | |
| e.addClass(b) | |
| } | |
| } | |
| } else if (c === U || c === "boolean") { | |
| if (this.className) { | |
| L.set(this, "__className__", this.className) | |
| } | |
| this.className = this.className || a === false ? "" : L.get(this, "__className__") || "" | |
| } | |
| }) | |
| }, | |
| hasClass: function(a) { | |
| var b = " " + a + " ", | |
| c = 0, | |
| d = this.length; | |
| for (; c < d; c++) { | |
| if (this[c].nodeType === 1 && (" " + this[c].className + " ").replace(ab, " ").indexOf(b) >= 0) { | |
| return true | |
| } | |
| } | |
| return false | |
| } | |
| }); | |
| var bb = /\r/g; | |
| n.fn.extend({ | |
| val: function(a) { | |
| var b, c, d, e = this[0]; | |
| if (!arguments.length) { | |
| if (e) { | |
| b = n.valHooks[e.type] || n.valHooks[e.nodeName.toLowerCase()]; | |
| if (b && "get" in b && (c = b.get(e, "value")) !== undefined) { | |
| return c | |
| } | |
| c = e.value; | |
| return typeof c === "string" ? c.replace(bb, "") : c == null ? "" : c | |
| } | |
| return | |
| } | |
| d = n.isFunction(a); | |
| return this.each(function(c) { | |
| var e; | |
| if (this.nodeType !== 1) { | |
| return | |
| } | |
| if (d) { | |
| e = a.call(this, c, n(this).val()) | |
| } else { | |
| e = a | |
| } | |
| if (e == null) { | |
| e = "" | |
| } else if (typeof e === "number") { | |
| e += "" | |
| } else if (n.isArray(e)) { | |
| e = n.map(e, function(a) { | |
| return a == null ? "" : a + "" | |
| }) | |
| } | |
| b = n.valHooks[this.type] || n.valHooks[this.nodeName.toLowerCase()]; | |
| if (!b || !("set" in b) || b.set(this, e, "value") === undefined) { | |
| this.value = e | |
| } | |
| }) | |
| } | |
| }); | |
| n.extend({ | |
| valHooks: { | |
| option: { | |
| get: function(a) { | |
| var b = n.find.attr(a, "value"); | |
| return b != null ? b : n.trim(n.text(a)) | |
| } | |
| }, | |
| select: { | |
| get: function(a) { | |
| var b, c, d = a.options, | |
| e = a.selectedIndex, | |
| f = a.type === "select-one" || e < 0, | |
| g = f ? null : [], | |
| h = f ? e + 1 : d.length, | |
| i = e < 0 ? h : f ? e : 0; | |
| for (; i < h; i++) { | |
| c = d[i]; | |
| if ((c.selected || i === e) && (k.optDisabled ? !c.disabled : c.getAttribute("disabled") === null) && (!c.parentNode.disabled || !n.nodeName(c.parentNode, "optgroup"))) { | |
| b = n(c).val(); | |
| if (f) { | |
| return b | |
| } | |
| g.push(b) | |
| } | |
| } | |
| return g | |
| }, | |
| set: function(a, b) { | |
| var c, d, e = a.options, | |
| f = n.makeArray(b), | |
| g = e.length; | |
| while (g--) { | |
| d = e[g]; | |
| if (d.selected = n.inArray(d.value, f) >= 0) { | |
| c = true | |
| } | |
| } | |
| if (!c) { | |
| a.selectedIndex = -1 | |
| } | |
| return f | |
| } | |
| } | |
| } | |
| }); | |
| n.each(["radio", "checkbox"], function() { | |
| n.valHooks[this] = { | |
| set: function(a, b) { | |
| if (n.isArray(b)) { | |
| return a.checked = n.inArray(n(a).val(), b) >= 0 | |
| } | |
| } | |
| }; | |
| if (!k.checkOn) { | |
| n.valHooks[this].get = function(a) { | |
| return a.getAttribute("value") === null ? "on" : a.value | |
| } | |
| } | |
| }); | |
| n.each(("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function(a, b) { | |
| n.fn[b] = function(a, c) { | |
| return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) | |
| } | |
| }); | |
| n.fn.extend({ | |
| hover: function(a, b) { | |
| return this.mouseenter(a).mouseleave(b || a) | |
| }, | |
| bind: function(a, b, c) { | |
| return this.on(a, null, b, c) | |
| }, | |
| unbind: function(a, b) { | |
| return this.off(a, null, b) | |
| }, | |
| delegate: function(a, b, c, d) { | |
| return this.on(b, a, c, d) | |
| }, | |
| undelegate: function(a, b, c) { | |
| return arguments.length === 1 ? this.off(a, "**") : this.off(b, a || "**", c) | |
| } | |
| }); | |
| var cb = n.now(); | |
| var db = /\?/; | |
| n.parseJSON = function(a) { | |
| return JSON.parse(a + "") | |
| }; | |
| n.parseXML = function(a) { | |
| var b, c; | |
| if (!a || typeof a !== "string") { | |
| return null | |
| } | |
| try { | |
| c = new DOMParser; | |
| b = c.parseFromString(a, "text/xml") | |
| } catch (a) { | |
| b = undefined | |
| } | |
| if (!b || b.getElementsByTagName("parsererror").length) { | |
| n.error("Invalid XML: " + a) | |
| } | |
| return b | |
| }; | |
| var eb, fb, gb = /#.*$/, | |
| hb = /([?&])_=[^&]*/, | |
| ib = /^(.*?):[ \t]*([^\r\n]*)$/gm, | |
| jb = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, | |
| kb = /^(?:GET|HEAD)$/, | |
| lb = /^\/\//, | |
| mb = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, | |
| nb = {}, | |
| ob = {}, | |
| pb = "*/".concat("*"); | |
| try { | |
| fb = location.href | |
| } catch (a) { | |
| fb = l.createElement("a"); | |
| fb.href = ""; | |
| fb = fb.href | |
| } | |
| eb = mb.exec(fb.toLowerCase()) || []; | |
| function qb(a) { | |
| return function(b, c) { | |
| if (typeof b !== "string") { | |
| c = b; | |
| b = "*" | |
| } | |
| var d, e = 0, | |
| f = b.toLowerCase().match(E) || []; | |
| if (n.isFunction(c)) { | |
| while (d = f[e++]) { | |
| if (d[0] === "+") { | |
| d = d.slice(1) || "*"; | |
| (a[d] = a[d] || []).unshift(c) | |
| } else { | |
| (a[d] = a[d] || []).push(c) | |
| } | |
| } | |
| } | |
| } | |
| } | |
| function rb(a, b, c, d) { | |
| var e = {}, | |
| f = a === ob; | |
| function g(h) { | |
| var i; | |
| e[h] = true; | |
| n.each(a[h] || [], function(a, h) { | |
| var j = h(b, c, d); | |
| if (typeof j === "string" && !f && !e[j]) { | |
| b.dataTypes.unshift(j); | |
| g(j); | |
| return false | |
| } else if (f) { | |
| return !(i = j) | |
| } | |
| }); | |
| return i | |
| } | |
| return g(b.dataTypes[0]) || !e["*"] && g("*") | |
| } | |
| function sb(a, b) { | |
| var c, d, e = n.ajaxSettings.flatOptions || {}; | |
| for (c in b) { | |
| if (b[c] !== undefined) { | |
| (e[c] ? a : d || (d = {}))[c] = b[c] | |
| } | |
| } | |
| if (d) { | |
| n.extend(true, a, d) | |
| } | |
| return a | |
| } | |
| function tb(a, b, c) { | |
| var d, e, f, g, h = a.contents, | |
| i = a.dataTypes; | |
| while (i[0] === "*") { | |
| i.shift(); | |
| if (d === undefined) { | |
| d = a.mimeType || b.getResponseHeader("Content-Type") | |
| } | |
| } | |
| if (d) { | |
| for (e in h) { | |
| if (h[e] && h[e].test(d)) { | |
| i.unshift(e); | |
| break | |
| } | |
| } | |
| } | |
| if (i[0] in c) { | |
| f = i[0] | |
| } else { | |
| for (e in c) { | |
| if (!i[0] || a.converters[e + " " + i[0]]) { | |
| f = e; | |
| break | |
| } | |
| if (!g) { | |
| g = e | |
| } | |
| } | |
| f = f || g | |
| } | |
| if (f) { | |
| if (f !== i[0]) { | |
| i.unshift(f) | |
| } | |
| return c[f] | |
| } | |
| } | |
| function ub(a, b, c, d) { | |
| var e, f, g, h, i, j = {}, | |
| k = a.dataTypes.slice(); | |
| if (k[1]) { | |
| for (g in a.converters) { | |
| j[g.toLowerCase()] = a.converters[g] | |
| } | |
| } | |
| f = k.shift(); | |
| while (f) { | |
| if (a.responseFields[f]) { | |
| c[a.responseFields[f]] = b | |
| } | |
| if (!i && d && a.dataFilter) { | |
| b = a.dataFilter(b, a.dataType) | |
| } | |
| i = f; | |
| f = k.shift(); | |
| if (f) { | |
| if (f === "*") { | |
| f = i | |
| } else if (i !== "*" && i !== f) { | |
| g = j[i + " " + f] || j["* " + f]; | |
| if (!g) { | |
| for (e in j) { | |
| h = e.split(" "); | |
| if (h[1] === f) { | |
| g = j[i + " " + h[0]] || j["* " + h[0]]; | |
| if (g) { | |
| if (g === true) { | |
| g = j[e] | |
| } else if (j[e] !== true) { | |
| f = h[0]; | |
| k.unshift(h[1]) | |
| } | |
| break | |
| } | |
| } | |
| } | |
| } | |
| if (g !== true) { | |
| if (g && a["throws"]) { | |
| b = g(b) | |
| } else { | |
| try { | |
| b = g(b) | |
| } catch (a) { | |
| return { | |
| state: "parsererror", | |
| error: g ? a : "No conversion from " + i + " to " + f | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| return { | |
| state: "success", | |
| data: b | |
| } | |
| } | |
| n.extend({ | |
| active: 0, | |
| lastModified: {}, | |
| etag: {}, | |
| ajaxSettings: { | |
| url: fb, | |
| type: "GET", | |
| isLocal: jb.test(eb[1]), | |
| global: true, | |
| processData: true, | |
| async: true, | |
| contentType: "application/x-www-form-urlencoded; charset=UTF-8", | |
| accepts: { | |
| "*": pb, | |
| text: "text/plain", | |
| html: "text/html", | |
| xml: "application/xml, text/xml", | |
| json: "application/json, text/javascript" | |
| }, | |
| contents: { | |
| xml: /xml/, | |
| html: /html/, | |
| json: /json/ | |
| }, | |
| responseFields: { | |
| xml: "responseXML", | |
| text: "responseText", | |
| json: "responseJSON" | |
| }, | |
| converters: { | |
| "* text": String, | |
| "text html": true, | |
| "text json": n.parseJSON, | |
| "text xml": n.parseXML | |
| }, | |
| flatOptions: { | |
| url: true, | |
| context: true | |
| } | |
| }, | |
| ajaxSetup: function(a, b) { | |
| return b ? sb(sb(a, n.ajaxSettings), b) : sb(n.ajaxSettings, a) | |
| }, | |
| ajaxPrefilter: qb(nb), | |
| ajaxTransport: qb(ob), | |
| ajax: function(a, b) { | |
| if (typeof a === "object") { | |
| b = a; | |
| a = undefined | |
| } | |
| b = b || {}; | |
| var c, d, e, f, g, h, i, j, k = n.ajaxSetup({}, b), | |
| l = k.context || k, | |
| m = k.context && (l.nodeType || l.jquery) ? n(l) : n.event, | |
| o = n.Deferred(), | |
| p = n.Callbacks("once memory"), | |
| q = k.statusCode || {}, | |
| r = {}, | |
| s = {}, | |
| t = 0, | |
| u = "canceled", | |
| v = { | |
| readyState: 0, | |
| getResponseHeader: function(a) { | |
| var b; | |
| if (t === 2) { | |
| if (!f) { | |
| f = {}; | |
| while (b = ib.exec(e)) { | |
| f[b[1].toLowerCase()] = b[2] | |
| } | |
| } | |
| b = f[a.toLowerCase()] | |
| } | |
| return b == null ? null : b | |
| }, | |
| getAllResponseHeaders: function() { | |
| return t === 2 ? e : null | |
| }, | |
| setRequestHeader: function(a, b) { | |
| var c = a.toLowerCase(); | |
| if (!t) { | |
| a = s[c] = s[c] || a; | |
| r[a] = b | |
| } | |
| return this | |
| }, | |
| overrideMimeType: function(a) { | |
| if (!t) { | |
| k.mimeType = a | |
| } | |
| return this | |
| }, | |
| statusCode: function(a) { | |
| var b; | |
| if (a) { | |
| if (t < 2) { | |
| for (b in a) { | |
| q[b] = [q[b], a[b]] | |
| } | |
| } else { | |
| v.always(a[v.status]) | |
| } | |
| } | |
| return this | |
| }, | |
| abort: function(a) { | |
| var b = a || u; | |
| if (c) { | |
| c.abort(b) | |
| } | |
| w(0, b); | |
| return this | |
| } | |
| }; | |
| o.promise(v).complete = p.add; | |
| v.success = v.done; | |
| v.error = v.fail; | |
| k.url = ((a || k.url || fb) + "").replace(gb, "").replace(lb, eb[1] + "//"); | |
| k.type = b.method || b.type || k.method || k.type; | |
| k.dataTypes = n.trim(k.dataType || "*").toLowerCase().match(E) || [""]; | |
| if (k.crossDomain == null) { | |
| h = mb.exec(k.url.toLowerCase()); | |
| k.crossDomain = !!(h && (h[1] !== eb[1] || h[2] !== eb[2] || (h[3] || (h[1] === "http:" ? "80" : "443")) !== (eb[3] || (eb[1] === "http:" ? "80" : "443")))) | |
| } | |
| if (k.data && k.processData && typeof k.data !== "string") { | |
| k.data = n.param(k.data, k.traditional) | |
| } | |
| rb(nb, k, b, v); | |
| if (t === 2) { | |
| return v | |
| } | |
| i = k.global; | |
| if (i && n.active++ === 0) { | |
| n.event.trigger("ajaxStart") | |
| } | |
| k.type = k.type.toUpperCase(); | |
| k.hasContent = !kb.test(k.type); | |
| d = k.url; | |
| if (!k.hasContent) { | |
| if (k.data) { | |
| d = k.url += (db.test(d) ? "&" : "?") + k.data; | |
| delete k.data | |
| } | |
| if (k.cache === false) { | |
| k.url = hb.test(d) ? d.replace(hb, "$1_=" + cb++) : d + (db.test(d) ? "&" : "?") + "_=" + cb++ | |
| } | |
| } | |
| if (k.ifModified) { | |
| if (n.lastModified[d]) { | |
| v.setRequestHeader("If-Modified-Since", n.lastModified[d]) | |
| } | |
| if (n.etag[d]) { | |
| v.setRequestHeader("If-None-Match", n.etag[d]) | |
| } | |
| } | |
| if (k.data && k.hasContent && k.contentType !== false || b.contentType) { | |
| v.setRequestHeader("Content-Type", k.contentType) | |
| } | |
| v.setRequestHeader("Accept", k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + (k.dataTypes[0] !== "*" ? ", " + pb + "; q=0.01" : "") : k.accepts["*"]); | |
| for (j in k.headers) { | |
| v.setRequestHeader(j, k.headers[j]) | |
| } | |
| if (k.beforeSend && (k.beforeSend.call(l, v, k) === false || t === 2)) { | |
| return v.abort() | |
| } | |
| u = "abort"; | |
| for (j in { | |
| success: 1, | |
| error: 1, | |
| complete: 1 | |
| }) { | |
| v[j](k[j]) | |
| } | |
| c = rb(ob, k, b, v); | |
| if (!c) { | |
| w(-1, "No Transport") | |
| } else { | |
| v.readyState = 1; | |
| if (i) { | |
| m.trigger("ajaxSend", [v, k]) | |
| } | |
| if (k.async && k.timeout > 0) { | |
| g = setTimeout(function() { | |
| v.abort("timeout") | |
| }, k.timeout) | |
| } | |
| try { | |
| t = 1; | |
| c.send(r, w) | |
| } catch (a) { | |
| if (t < 2) { | |
| w(-1, a) | |
| } else { | |
| throw a | |
| } | |
| } | |
| } | |
| function w(a, b, f, h) { | |
| var j, r, s, u, w, x = b; | |
| if (t === 2) { | |
| return | |
| } | |
| t = 2; | |
| if (g) { | |
| clearTimeout(g) | |
| } | |
| c = undefined; | |
| e = h || ""; | |
| v.readyState = a > 0 ? 4 : 0; | |
| j = a >= 200 && a < 300 || a === 304; | |
| if (f) { | |
| u = tb(k, v, f) | |
| } | |
| u = ub(k, u, v, j); | |
| if (j) { | |
| if (k.ifModified) { | |
| w = v.getResponseHeader("Last-Modified"); | |
| if (w) { | |
| n.lastModified[d] = w | |
| } | |
| w = v.getResponseHeader("etag"); | |
| if (w) { | |
| n.etag[d] = w | |
| } | |
| } | |
| if (a === 204 || k.type === "HEAD") { | |
| x = "nocontent" | |
| } else if (a === 304) { | |
| x = "notmodified" | |
| } else { | |
| x = u.state; | |
| r = u.data; | |
| s = u.error; | |
| j = !s | |
| } | |
| } else { | |
| s = x; | |
| if (a || !x) { | |
| x = "error"; | |
| if (a < 0) { | |
| a = 0 | |
| } | |
| } | |
| } | |
| v.status = a; | |
| v.statusText = (b || x) + ""; | |
| if (j) { | |
| o.resolveWith(l, [r, x, v]) | |
| } else { | |
| o.rejectWith(l, [v, x, s]) | |
| } | |
| v.statusCode(q); | |
| q = undefined; | |
| if (i) { | |
| m.trigger(j ? "ajaxSuccess" : "ajaxError", [v, k, j ? r : s]) | |
| } | |
| p.fireWith(l, [v, x]); | |
| if (i) { | |
| m.trigger("ajaxComplete", [v, k]); | |
| if (!--n.active) { | |
| n.event.trigger("ajaxStop") | |
| } | |
| } | |
| } | |
| return v | |
| }, | |
| getJSON: function(a, b, c) { | |
| return n.get(a, b, c, "json") | |
| }, | |
| getScript: function(a, b) { | |
| return n.get(a, undefined, b, "script") | |
| } | |
| }); | |
| n.each(["get", "post"], function(a, b) { | |
| n[b] = function(a, c, d, e) { | |
| if (n.isFunction(c)) { | |
| e = e || d; | |
| d = c; | |
| c = undefined | |
| } | |
| return n.ajax({ | |
| url: a, | |
| type: b, | |
| dataType: e, | |
| data: c, | |
| success: d | |
| }) | |
| } | |
| }); | |
| n.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(a, b) { | |
| n.fn[b] = function(a) { | |
| return this.on(b, a) | |
| } | |
| }); | |
| n._evalUrl = function(a) { | |
| return n.ajax({ | |
| url: a, | |
| type: "GET", | |
| dataType: "script", | |
| async: false, | |
| global: false, | |
| throws: true | |
| }) | |
| }; | |
| n.fn.extend({ | |
| wrapAll: function(a) { | |
| var b; | |
| if (n.isFunction(a)) { | |
| return this.each(function(b) { | |
| n(this).wrapAll(a.call(this, b)) | |
| }) | |
| } | |
| if (this[0]) { | |
| b = n(a, this[0].ownerDocument).eq(0).clone(true); | |
| if (this[0].parentNode) { | |
| b.insertBefore(this[0]) | |
| } | |
| b.map(function() { | |
| var a = this; | |
| while (a.firstElementChild) { | |
| a = a.firstElementChild | |
| } | |
| return a | |
| }).append(this) | |
| } | |
| return this | |
| }, | |
| wrapInner: function(a) { | |
| if (n.isFunction(a)) { | |
| return this.each(function(b) { | |
| n(this).wrapInner(a.call(this, b)) | |
| }) | |
| } | |
| return this.each(function() { | |
| var b = n(this), | |
| c = b.contents(); | |
| if (c.length) { | |
| c.wrapAll(a) | |
| } else { | |
| b.append(a) | |
| } | |
| }) | |
| }, | |
| wrap: function(a) { | |
| var b = n.isFunction(a); | |
| return this.each(function(c) { | |
| n(this).wrapAll(b ? a.call(this, c) : a) | |
| }) | |
| }, | |
| unwrap: function() { | |
| return this.parent().each(function() { | |
| if (!n.nodeName(this, "body")) { | |
| n(this).replaceWith(this.childNodes) | |
| } | |
| }).end() | |
| } | |
| }); | |
| n.expr.filters.hidden = function(a) { | |
| return a.offsetWidth <= 0 && a.offsetHeight <= 0 | |
| }; | |
| n.expr.filters.visible = function(a) { | |
| return !n.expr.filters.hidden(a) | |
| }; | |
| var vb = /%20/g, | |
| wb = /\[\]$/, | |
| xb = /\r?\n/g, | |
| yb = /^(?:submit|button|image|reset|file)$/i, | |
| zb = /^(?:input|select|textarea|keygen)/i; | |
| function Ab(a, b, c, d) { | |
| var e; | |
| if (n.isArray(b)) { | |
| n.each(b, function(b, e) { | |
| if (c || wb.test(a)) { | |
| d(a, e) | |
| } else { | |
| Ab(a + "[" + (typeof e === "object" ? b : "") + "]", e, c, d) | |
| } | |
| }) | |
| } else if (!c && n.type(b) === "object") { | |
| for (e in b) { | |
| Ab(a + "[" + e + "]", b[e], c, d) | |
| } | |
| } else { | |
| d(a, b) | |
| } | |
| } | |
| n.param = function(a, b) { | |
| var c, d = [], | |
| e = function(a, b) { | |
| b = n.isFunction(b) ? b() : b == null ? "" : b; | |
| d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) | |
| }; | |
| if (b === undefined) { | |
| b = n.ajaxSettings && n.ajaxSettings.traditional | |
| } | |
| if (n.isArray(a) || a.jquery && !n.isPlainObject(a)) { | |
| n.each(a, function() { | |
| e(this.name, this.value) | |
| }) | |
| } else { | |
| for (c in a) { | |
| Ab(c, a[c], b, e) | |
| } | |
| } | |
| return d.join("&").replace(vb, "+") | |
| }; | |
| n.fn.extend({ | |
| serialize: function() { | |
| return n.param(this.serializeArray()) | |
| }, | |
| serializeArray: function() { | |
| return this.map(function() { | |
| var a = n.prop(this, "elements"); | |
| return a ? n.makeArray(a) : this | |
| }).filter(function() { | |
| var a = this.type; | |
| return this.name && !n(this).is(":disabled") && zb.test(this.nodeName) && !yb.test(a) && (this.checked || !T.test(a)) | |
| }).map(function(a, b) { | |
| var c = n(this).val(); | |
| return c == null ? null : n.isArray(c) ? n.map(c, function(a) { | |
| return { | |
| name: b.name, | |
| value: a.replace(xb, "\r\n") | |
| } | |
| }) : { | |
| name: b.name, | |
| value: c.replace(xb, "\r\n") | |
| } | |
| }).get() | |
| } | |
| }); | |
| n.ajaxSettings.xhr = function() { | |
| try { | |
| return new XMLHttpRequest | |
| } catch (a) {} | |
| }; | |
| var Bb = 0, | |
| Cb = {}, | |
| Db = { | |
| 0: 200, | |
| 1223: 204 | |
| }, | |
| Eb = n.ajaxSettings.xhr(); | |
| if (a.ActiveXObject) { | |
| n(a).on("unload", function() { | |
| for (var a in Cb) { | |
| Cb[a]() | |
| } | |
| }) | |
| } | |
| k.cors = !!Eb && "withCredentials" in Eb; | |
| k.ajax = Eb = !!Eb; | |
| n.ajaxTransport(function(a) { | |
| var b; | |
| if (k.cors || Eb && !a.crossDomain) { | |
| return { | |
| send: function(c, d) { | |
| var e, f = a.xhr(), | |
| g = ++Bb; | |
| f.open(a.type, a.url, a.async, a.username, a.password); | |
| if (a.xhrFields) { | |
| for (e in a.xhrFields) { | |
| f[e] = a.xhrFields[e] | |
| } | |
| } | |
| if (a.mimeType && f.overrideMimeType) { | |
| f.overrideMimeType(a.mimeType) | |
| } | |
| if (!a.crossDomain && !c["X-Requested-With"]) { | |
| c["X-Requested-With"] = "XMLHttpRequest" | |
| } | |
| for (e in c) { | |
| f.setRequestHeader(e, c[e]) | |
| } | |
| b = function(a) { | |
| return function() { | |
| if (b) { | |
| delete Cb[g]; | |
| b = f.onload = f.onerror = null; | |
| if (a === "abort") { | |
| f.abort() | |
| } else if (a === "error") { | |
| d(f.status, f.statusText) | |
| } else { | |
| d(Db[f.status] || f.status, f.statusText, typeof f.responseText === "string" ? { | |
| text: f.responseText | |
| } : undefined, f.getAllResponseHeaders()) | |
| } | |
| } | |
| } | |
| }; | |
| f.onload = b(); | |
| f.onerror = b("error"); | |
| b = Cb[g] = b("abort"); | |
| try { | |
| f.send(a.hasContent && a.data || null) | |
| } catch (a) { | |
| if (b) { | |
| throw a | |
| } | |
| } | |
| }, | |
| abort: function() { | |
| if (b) { | |
| b() | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| n.ajaxSetup({ | |
| accepts: { | |
| script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" | |
| }, | |
| contents: { | |
| script: /(?:java|ecma)script/ | |
| }, | |
| converters: { | |
| "text script": function(a) { | |
| n.globalEval(a); | |
| return a | |
| } | |
| } | |
| }); | |
| n.ajaxPrefilter("script", function(a) { | |
| if (a.cache === undefined) { | |
| a.cache = false | |
| } | |
| if (a.crossDomain) { | |
| a.type = "GET" | |
| } | |
| }); | |
| n.ajaxTransport("script", function(a) { | |
| if (a.crossDomain) { | |
| var b, c; | |
| return { | |
| send: function(d, e) { | |
| b = n("<script>").prop({ | |
| async: true, | |
| charset: a.scriptCharset, | |
| src: a.url | |
| }).on("load error", c = function(a) { | |
| b.remove(); | |
| c = null; | |
| if (a) { | |
| e(a.type === "error" ? 404 : 200, a.type) | |
| } | |
| }); | |
| l.head.appendChild(b[0]) | |
| }, | |
| abort: function() { | |
| if (c) { | |
| c() | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| var Fb = [], | |
| Gb = /(=)\?(?=&|$)|\?\?/; | |
| n.ajaxSetup({ | |
| jsonp: "callback", | |
| jsonpCallback: function() { | |
| var a = Fb.pop() || n.expando + "_" + cb++; | |
| this[a] = true; | |
| return a | |
| } | |
| }); | |
| n.ajaxPrefilter("json jsonp", function(b, c, d) { | |
| var e, f, g, h = b.jsonp !== false && (Gb.test(b.url) ? "url" : typeof b.data === "string" && !(b.contentType || "").indexOf("application/x-www-form-urlencoded") && Gb.test(b.data) && "data"); | |
| if (h || b.dataTypes[0] === "jsonp") { | |
| e = b.jsonpCallback = n.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback; | |
| if (h) { | |
| b[h] = b[h].replace(Gb, "$1" + e) | |
| } else if (b.jsonp !== false) { | |
| b.url += (db.test(b.url) ? "&" : "?") + b.jsonp + "=" + e | |
| } | |
| b.converters["script json"] = function() { | |
| if (!g) { | |
| n.error(e + " was not called") | |
| } | |
| return g[0] | |
| }; | |
| b.dataTypes[0] = "json"; | |
| f = a[e]; | |
| a[e] = function() { | |
| g = arguments | |
| }; | |
| d.always(function() { | |
| a[e] = f; | |
| if (b[e]) { | |
| b.jsonpCallback = c.jsonpCallback; | |
| Fb.push(e) | |
| } | |
| if (g && n.isFunction(f)) { | |
| f(g[0]) | |
| } | |
| g = f = undefined | |
| }); | |
| return "script" | |
| } | |
| }); | |
| n.parseHTML = function(a, b, c) { | |
| if (!a || typeof a !== "string") { | |
| return null | |
| } | |
| if (typeof b === "boolean") { | |
| c = b; | |
| b = false | |
| } | |
| b = b || l; | |
| var d = v.exec(a), | |
| e = !c && []; | |
| if (d) { | |
| return [b.createElement(d[1])] | |
| } | |
| d = n.buildFragment([a], b, e); | |
| if (e && e.length) { | |
| n(e).remove() | |
| } | |
| return n.merge([], d.childNodes) | |
| }; | |
| var Hb = n.fn.load; | |
| n.fn.load = function(a, b, c) { | |
| if (typeof a !== "string" && Hb) { | |
| return Hb.apply(this, arguments) | |
| } | |
| var d, e, f, g = this, | |
| h = a.indexOf(" "); | |
| if (h >= 0) { | |
| d = n.trim(a.slice(h)); | |
| a = a.slice(0, h) | |
| } | |
| if (n.isFunction(b)) { | |
| c = b; | |
| b = undefined | |
| } else if (b && typeof b === "object") { | |
| e = "POST" | |
| } | |
| if (g.length > 0) { | |
| n.ajax({ | |
| url: a, | |
| type: e, | |
| dataType: "html", | |
| data: b | |
| }).done(function(a) { | |
| f = arguments; | |
| g.html(d ? n("<div>").append(n.parseHTML(a)).find(d) : a) | |
| }).complete(c && function(a, b) { | |
| g.each(c, f || [a.responseText, b, a]) | |
| }) | |
| } | |
| return this | |
| }; | |
| n.expr.filters.animated = function(a) { | |
| return n.grep(n.timers, function(b) { | |
| return a === b.elem | |
| }).length | |
| }; | |
| var Ib = a.document.documentElement; | |
| function Jb(a) { | |
| return n.isWindow(a) ? a : a.nodeType === 9 && a.defaultView | |
| } | |
| n.offset = { | |
| setOffset: function(a, b, c) { | |
| var d, e, f, g, h, i, j, k = n.css(a, "position"), | |
| l = n(a), | |
| m = {}; | |
| if (k === "static") { | |
| a.style.position = "relative" | |
| } | |
| h = l.offset(); | |
| f = n.css(a, "top"); | |
| i = n.css(a, "left"); | |
| j = (k === "absolute" || k === "fixed") && (f + i).indexOf("auto") > -1; | |
| if (j) { | |
| d = l.position(); | |
| g = d.top; | |
| e = d.left | |
| } else { | |
| g = parseFloat(f) || 0; | |
| e = parseFloat(i) || 0 | |
| } | |
| if (n.isFunction(b)) { | |
| b = b.call(a, c, h) | |
| } | |
| if (b.top != null) { | |
| m.top = b.top - h.top + g | |
| } | |
| if (b.left != null) { | |
| m.left = b.left - h.left + e | |
| } | |
| if ("using" in b) { | |
| b.using.call(a, m) | |
| } else { | |
| l.css(m) | |
| } | |
| } | |
| }; | |
| n.fn.extend({ | |
| offset: function(a) { | |
| if (arguments.length) { | |
| return a === undefined ? this : this.each(function(b) { | |
| n.offset.setOffset(this, a, b) | |
| }) | |
| } | |
| var b, c, d = this[0], | |
| e = { | |
| top: 0, | |
| left: 0 | |
| }, | |
| f = d && d.ownerDocument; | |
| if (!f) { | |
| return | |
| } | |
| b = f.documentElement; | |
| if (!n.contains(b, d)) { | |
| return e | |
| } | |
| if (typeof d.getBoundingClientRect !== U) { | |
| e = d.getBoundingClientRect() | |
| } | |
| c = Jb(f); | |
| return { | |
| top: e.top + c.pageYOffset - b.clientTop, | |
| left: e.left + c.pageXOffset - b.clientLeft | |
| } | |
| }, | |
| position: function() { | |
| if (!this[0]) { | |
| return | |
| } | |
| var a, b, c = this[0], | |
| d = { | |
| top: 0, | |
| left: 0 | |
| }; | |
| if (n.css(c, "position") === "fixed") { | |
| b = c.getBoundingClientRect() | |
| } else { | |
| a = this.offsetParent(); | |
| b = this.offset(); | |
| if (!n.nodeName(a[0], "html")) { | |
| d = a.offset() | |
| } | |
| d.top += n.css(a[0], "borderTopWidth", true); | |
| d.left += n.css(a[0], "borderLeftWidth", true) | |
| } | |
| return { | |
| top: b.top - d.top - n.css(c, "marginTop", true), | |
| left: b.left - d.left - n.css(c, "marginLeft", true) | |
| } | |
| }, | |
| offsetParent: function() { | |
| return this.map(function() { | |
| var a = this.offsetParent || Ib; | |
| while (a && (!n.nodeName(a, "html") && n.css(a, "position") === "static")) { | |
| a = a.offsetParent | |
| } | |
| return a || Ib | |
| }) | |
| } | |
| }); | |
| n.each({ | |
| scrollLeft: "pageXOffset", | |
| scrollTop: "pageYOffset" | |
| }, function(b, c) { | |
| var d = "pageYOffset" === c; | |
| n.fn[b] = function(e) { | |
| return J(this, function(b, e, f) { | |
| var g = Jb(b); | |
| if (f === undefined) { | |
| return g ? g[c] : b[e] | |
| } | |
| if (g) { | |
| g.scrollTo(!d ? f : a.pageXOffset, d ? f : a.pageYOffset) | |
| } else { | |
| b[e] = f | |
| } | |
| }, b, e, arguments.length, null) | |
| } | |
| }); | |
| n.each(["top", "left"], function(a, b) { | |
| n.cssHooks[b] = ya(k.pixelPosition, function(a, c) { | |
| if (c) { | |
| c = xa(a, b); | |
| return va.test(c) ? n(a).position()[b] + "px" : c | |
| } | |
| }) | |
| }); | |
| n.each({ | |
| Height: "height", | |
| Width: "width" | |
| }, function(a, b) { | |
| n.each({ | |
| padding: "inner" + a, | |
| content: b, | |
| "": "outer" + a | |
| }, function(c, d) { | |
| n.fn[d] = function(d, e) { | |
| var f = arguments.length && (c || typeof d !== "boolean"), | |
| g = c || (d === true || e === true ? "margin" : "border"); | |
| return J(this, function(b, c, d) { | |
| var e; | |
| if (n.isWindow(b)) { | |
| return b.document.documentElement["client" + a] | |
| } | |
| if (b.nodeType === 9) { | |
| e = b.documentElement; | |
| return Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a]) | |
| } | |
| return d === undefined ? n.css(b, c, g) : n.style(b, c, d, g) | |
| }, b, f ? d : undefined, f, null) | |
| } | |
| }) | |
| }); | |
| n.fn.size = function() { | |
| return this.length | |
| }; | |
| n.fn.andSelf = n.fn.addBack; | |
| if (typeof define === "function" && define.amd) { | |
| define("jquery", [], function() { | |
| return n | |
| }) | |
| } | |
| var Kb = a.jQuery, | |
| Lb = a.$; | |
| n.noConflict = function(b) { | |
| if (a.$ === n) { | |
| a.$ = Lb | |
| } | |
| if (b && a.jQuery === n) { | |
| a.jQuery = Kb | |
| } | |
| return n | |
| }; | |
| if (typeof b === U) { | |
| a.jQuery = a.$ = n | |
| } | |
| return n | |
| }); | |
| (function() { | |
| var a = $(window); | |
| $.fn.lazyload = function(b) { | |
| var c = this; | |
| var d; | |
| var e = { | |
| threshold: 0, | |
| failure_limit: 0, | |
| event: "scroll", | |
| effect: "show", | |
| container: window, | |
| data_attribute: "original", | |
| skip_invisible: true, | |
| appear: null, | |
| load: null | |
| }; | |
| function f() { | |
| var a = 0; | |
| c.each(function() { | |
| var b = $(this); | |
| if (e.skip_invisible && !b.is(":visible")) { | |
| return | |
| } | |
| if ($.abovethetop(this, e) || $.leftofbegin(this, e)) {} else if (!$.belowthefold(this, e) && !$.rightoffold(this, e)) { | |
| b.trigger("appear"); | |
| a = 0 | |
| } else { | |
| if (++a > e.failure_limit) { | |
| return false | |
| } | |
| } | |
| }) | |
| } | |
| if (b) { | |
| if (undefined !== b.failurelimit) { | |
| b.failure_limit = b.failurelimit; | |
| delete b.failurelimit | |
| } | |
| if (undefined !== b.effectspeed) { | |
| b.effect_speed = b.effectspeed; | |
| delete b.effectspeed | |
| } | |
| $.extend(e, b) | |
| } | |
| d = e.container === undefined || e.container === window ? a : $(e.container); | |
| if (0 === e.event.indexOf("scroll")) { | |
| d.bind(e.event, function() { | |
| return f() | |
| }) | |
| } | |
| this.each(function() { | |
| var a = this; | |
| var d = $(a); | |
| a.loaded = false; | |
| d.one("appear", function() { | |
| if (!this.loaded) { | |
| if (e.appear) { | |
| var f = c.length; | |
| e.appear.call(a, f, e) | |
| } | |
| var g = d.clone(); | |
| g.attr("src", d.attr("data-" + e.data_attribute)); | |
| d.replaceWith(g); | |
| a.loaded = true; | |
| if (b && b.loadedCallback && typeof b.loadedCallback === "function") { | |
| b.loadedCallback(d) | |
| } | |
| } | |
| }); | |
| if (0 !== e.event.indexOf("scroll")) { | |
| d.bind(e.event, function() { | |
| if (!a.loaded) { | |
| d.trigger("appear") | |
| } | |
| }) | |
| } | |
| }); | |
| a.bind("resize", function() { | |
| f() | |
| }); | |
| if (/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)) { | |
| a.bind("pageshow", function(a) { | |
| if (a.originalEvent && a.originalEvent.persisted) { | |
| c.each(function() { | |
| $(this).trigger("appear") | |
| }) | |
| } | |
| }) | |
| } | |
| $(document).ready(function() { | |
| f() | |
| }); | |
| return this | |
| }; | |
| $.belowthefold = function(b, c) { | |
| var d; | |
| if (c.container === undefined || c.container === window) { | |
| d = (window.innerHeight ? window.innerHeight : a.height()) + a.scrollTop() | |
| } else { | |
| d = $(c.container).offset().top + $(c.container).height() | |
| } | |
| return d <= $(b).offset().top - c.threshold | |
| }; | |
| $.rightoffold = function(b, c) { | |
| var d; | |
| if (c.container === undefined || c.container === window) { | |
| d = a.width() + a.scrollLeft() | |
| } else { | |
| d = $(c.container).offset().left + $(c.container).width() | |
| } | |
| return d <= $(b).offset().left - c.threshold | |
| }; | |
| $.abovethetop = function(b, c) { | |
| var d; | |
| if (c.container === undefined || c.container === window) { | |
| d = a.scrollTop() | |
| } else { | |
| d = $(c.container).offset().top | |
| } | |
| return d >= $(b).offset().top + c.threshold + $(b).height() | |
| }; | |
| $.leftofbegin = function(b, c) { | |
| var d; | |
| if (c.container === undefined || c.container === window) { | |
| d = a.scrollLeft() | |
| } else { | |
| d = $(c.container).offset().left | |
| } | |
| return d >= $(b).offset().left + c.threshold + $(b).width() | |
| }; | |
| $.inviewport = function(a, b) { | |
| return !$.rightoffold(a, b) && !$.leftofbegin(a, b) && !$.belowthefold(a, b) && !$.abovethetop(a, b) | |
| }; | |
| $.extend($.expr[":"], { | |
| "below-the-fold": function(a) { | |
| return $.belowthefold(a, { | |
| threshold: 0 | |
| }) | |
| }, | |
| "above-the-top": function(a) { | |
| return !$.belowthefold(a, { | |
| threshold: 0 | |
| }) | |
| }, | |
| "right-of-screen": function(a) { | |
| return $.rightoffold(a, { | |
| threshold: 0 | |
| }) | |
| }, | |
| "left-of-screen": function(a) { | |
| return !$.rightoffold(a, { | |
| threshold: 0 | |
| }) | |
| }, | |
| "in-viewport": function(a) { | |
| return $.inviewport(a, { | |
| threshold: 0 | |
| }) | |
| }, | |
| "above-the-fold": function(a) { | |
| return !$.belowthefold(a, { | |
| threshold: 0 | |
| }) | |
| }, | |
| "right-of-fold": function(a) { | |
| return $.rightoffold(a, { | |
| threshold: 0 | |
| }) | |
| }, | |
| "left-of-fold": function(a) { | |
| return !$.rightoffold(a, { | |
| threshold: 0 | |
| }) | |
| } | |
| }) | |
| })(); | |
| (function(a) { | |
| if (typeof exports === "object") { | |
| a(require("jquery")) | |
| } else { | |
| a(jQuery) | |
| } | |
| })(function(a) { | |
| var b = /\+/g; | |
| function c(a) { | |
| return h.raw ? a : encodeURIComponent(a) | |
| } | |
| function d(a) { | |
| return h.raw ? a : decodeURIComponent(a) | |
| } | |
| function e(a) { | |
| return c(h.json ? JSON.stringify(a) : String(a)) | |
| } | |
| function f(a) { | |
| if (a.indexOf('"') === 0) { | |
| a = a.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\") | |
| } | |
| try { | |
| a = decodeURIComponent(a.replace(b, " ")); | |
| return h.json ? JSON.parse(a) : a | |
| } catch (a) {} | |
| } | |
| function g(b, c) { | |
| var d = h.raw ? b : f(b); | |
| return a.isFunction(c) ? c(d) : d | |
| } | |
| var h = a.cookie = function(b, f, i) { | |
| if (arguments.length > 1 && !a.isFunction(f)) { | |
| i = a.extend({}, h.defaults, i); | |
| if (typeof i.expires === "number") { | |
| var j = i.expires, | |
| k = i.expires = new Date; | |
| k.setTime(+k + j * 864e5) | |
| } | |
| return document.cookie = [c(b), "=", e(f), i.expires ? "; expires=" + i.expires.toUTCString() : "", i.path ? "; path=" + i.path : "", i.domain ? "; domain=" + i.domain : "", i.secure ? "; secure" : ""].join("") | |
| } | |
| var l = b ? undefined : {}; | |
| var m = document.cookie ? document.cookie.split("; ") : []; | |
| for (var n = 0, o = m.length; n < o; n++) { | |
| var p = m[n].split("="); | |
| var q = d(p.shift()); | |
| var r = p.join("="); | |
| if (b && b === q) { | |
| l = g(r, f); | |
| break | |
| } | |
| if (!b && (r = g(r)) !== undefined) { | |
| l[q] = r | |
| } | |
| } | |
| return l | |
| }; | |
| h.defaults = {}; | |
| a.removeCookie = function(b, c) { | |
| if (a.cookie(b) === undefined) { | |
| return false | |
| } | |
| a.cookie(b, "", a.extend({}, c, { | |
| expires: -1 | |
| })); | |
| return !a.cookie(b) | |
| } | |
| }); | |
| (function(a) { | |
| a.event.special.mousestop = { | |
| setup: function(f) { | |
| a(this).data("mousestop", e(f)).on("mouseenter.mousestop", b).on("mouseleave.mousestop", c).on("mousemove.mousestop", d) | |
| }, | |
| teardown: function() { | |
| a(this).removeData("mousestop").off(".mousestop"); | |
| } | |
| }; | |
| function b() { | |
| var b = this, | |
| c = a(this).data("mousestop"); | |
| this.movement = true; | |
| if (c.timeToStop) { | |
| this.timeToStopTimer = window.setTimeout(function() { | |
| b.movement = false; | |
| window.clearTimeout(b.timer) | |
| }, c.timeToStop) | |
| } | |
| } | |
| function c() { | |
| window.clearTimeout(this.timer); | |
| window.clearTimeout(this.timeToStopTimer); | |
| this.movement = false | |
| } | |
| function d(b) { | |
| var c = a(this), | |
| d = c.data("mousestop"); | |
| if (this.movement) { | |
| window.clearTimeout(this.timer); | |
| this.timer = window.setTimeout(function() { | |
| if (this.lastX !== b.pageX || this.lastY !== b.pageY) { | |
| this.lastX = b.pageX; | |
| this.lastY = b.pageY; | |
| c.trigger("mousestop", [b.pageX, b.pageY]) | |
| } | |
| }, d.delay) | |
| } | |
| } | |
| function e(b) { | |
| if (a.isNumeric(b)) { | |
| b = { | |
| delay: b | |
| } | |
| } else if (typeof b !== "object") { | |
| b = {} | |
| } | |
| return a.extend({}, a.fn.mousestop.defaults, b) | |
| } | |
| a.fn.mousestop = function(a, b) { | |
| if (typeof a === "function") { | |
| b = a | |
| } | |
| return arguments.length > 0 ? this.on("mousestop", a, b) : this.trigger("mousestop") | |
| }; | |
| a.fn.mousestop.defaults = { | |
| delay: 200, | |
| timeToStop: null | |
| } | |
| })(jQuery); | |
| jQuery.cachedScript = function(a, b) { | |
| b = $.extend(b || {}, { | |
| dataType: "script", | |
| cache: true, | |
| url: a | |
| }); | |
| return jQuery.ajax(b) | |
| }; | |
| (function(a) { | |
| "use strict"; | |
| var b = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function(a) { | |
| return window.setTimeout(a, 1e3 / 60) | |
| }; | |
| function c() { | |
| this.frames = []; | |
| this.lastId = 0; | |
| this.raf = b; | |
| this.batch = { | |
| hash: {}, | |
| read: [], | |
| write: [], | |
| mode: null | |
| } | |
| } | |
| c.prototype.read = function(a, b) { | |
| var c = this.add("read", a, b); | |
| var d = c.id; | |
| this.batch.read.push(c.id); | |
| var e = this.batch.mode === "reading" || this.batch.scheduled; | |
| if (e) return d; | |
| this.scheduleBatch(); | |
| return d | |
| }; | |
| c.prototype.write = function(a, b) { | |
| var c = this.add("write", a, b); | |
| var d = this.batch.mode; | |
| var e = c.id; | |
| this.batch.write.push(c.id); | |
| var f = d === "writing" || d === "reading" || this.batch.scheduled; | |
| if (f) return e; | |
| this.scheduleBatch(); | |
| return e | |
| }; | |
| c.prototype.defer = function(a, b, c) { | |
| if (typeof a === "function") { | |
| c = b; | |
| b = a; | |
| a = 1 | |
| } | |
| var d = this; | |
| var e = a - 1; | |
| return this.schedule(e, function() { | |
| d.run({ | |
| fn: b, | |
| ctx: c | |
| }) | |
| }) | |
| }; | |
| c.prototype.clear = function(a) { | |
| if (typeof a === "function") { | |
| return this.clearFrame(a) | |
| } | |
| a = Number(a); | |
| var b = this.batch.hash[a]; | |
| if (!b) return; | |
| var c = this.batch[b.type]; | |
| var d = c.indexOf(a); | |
| delete this.batch.hash[a]; | |
| if (~d) c.splice(d, 1) | |
| }; | |
| c.prototype.clearFrame = function(a) { | |
| var b = this.frames.indexOf(a); | |
| if (~b) this.frames.splice(b, 1) | |
| }; | |
| c.prototype.scheduleBatch = function() { | |
| var a = this; | |
| this.schedule(0, function() { | |
| a.batch.scheduled = false; | |
| a.runBatch() | |
| }); | |
| this.batch.scheduled = true | |
| }; | |
| c.prototype.uniqueId = function() { | |
| return ++this.lastId | |
| }; | |
| c.prototype.flush = function(a) { | |
| var b; | |
| while (b = a.shift()) { | |
| this.run(this.batch.hash[b]) | |
| } | |
| }; | |
| c.prototype.runBatch = function() { | |
| try { | |
| this.batch.mode = "reading"; | |
| this.flush(this.batch.read); | |
| this.batch.mode = "writing"; | |
| this.flush(this.batch.write); | |
| this.batch.mode = null | |
| } catch (a) { | |
| this.runBatch(); | |
| throw a | |
| } | |
| }; | |
| c.prototype.add = function(a, b, c) { | |
| var d = this.uniqueId(); | |
| return this.batch.hash[d] = { | |
| id: d, | |
| fn: b, | |
| ctx: c, | |
| type: a | |
| } | |
| }; | |
| c.prototype.run = function(a) { | |
| var b = a.ctx || this; | |
| var c = a.fn; | |
| delete this.batch.hash[a.id]; | |
| if (!this.onError) { | |
| return c.call(b) | |
| } | |
| try { | |
| c.call(b) | |
| } catch (a) { | |
| this.onError(a) | |
| } | |
| }; | |
| c.prototype.loop = function() { | |
| var a = this; | |
| var b = this.raf; | |
| if (this.looping) return; | |
| b(function c() { | |
| var d = a.frames.shift(); | |
| if (!a.frames.length) { | |
| a.looping = false | |
| } else { | |
| b(c) | |
| } | |
| if (d) d() | |
| }); | |
| this.looping = true | |
| }; | |
| c.prototype.schedule = function(a, b) { | |
| if (this.frames[a]) { | |
| return this.schedule(a + 1, b) | |
| } | |
| this.loop(); | |
| return this.frames[a] = b | |
| }; | |
| a = a || new c; | |
| if (typeof module !== "undefined" && module.exports) { | |
| module.exports = a | |
| } else if (typeof define === "function" && define.amd) { | |
| try { | |
| define(function() { | |
| return a | |
| }) | |
| } catch (b) { | |
| window["fastdom"] = a | |
| } | |
| } else { | |
| window["fastdom"] = a | |
| } | |
| })(window.fastdom); | |
| (function() { | |
| var a = this; | |
| var b = a._; | |
| var c = Array.prototype, | |
| d = Object.prototype, | |
| e = Function.prototype; | |
| var f = c.push, | |
| g = c.slice, | |
| h = c.concat, | |
| i = d.toString, | |
| j = d.hasOwnProperty; | |
| var k = Array.isArray, | |
| l = Object.keys, | |
| m = e.bind; | |
| var n = function(a) { | |
| if (a instanceof n) return a; | |
| if (!(this instanceof n)) return new n(a); | |
| this._wrapped = a | |
| }; | |
| if (typeof exports !== "undefined") { | |
| if (typeof module !== "undefined" && module.exports) { | |
| exports = module.exports = n | |
| } | |
| exports._ = n | |
| } else { | |
| a._ = n | |
| } | |
| n.VERSION = "1.7.0"; | |
| var o = function(a, b, c) { | |
| if (b === void 0) return a; | |
| switch (c == null ? 3 : c) { | |
| case 1: | |
| return function(c) { | |
| return a.call(b, c) | |
| }; | |
| case 2: | |
| return function(c, d) { | |
| return a.call(b, c, d) | |
| }; | |
| case 3: | |
| return function(c, d, e) { | |
| return a.call(b, c, d, e) | |
| }; | |
| case 4: | |
| return function(c, d, e, f) { | |
| return a.call(b, c, d, e, f) | |
| } | |
| } | |
| return function() { | |
| return a.apply(b, arguments) | |
| } | |
| }; | |
| n.iteratee = function(a, b, c) { | |
| if (a == null) return n.identity; | |
| if (n.isFunction(a)) return o(a, b, c); | |
| if (n.isObject(a)) return n.matches(a); | |
| return n.property(a) | |
| }; | |
| n.each = n.forEach = function(a, b, c) { | |
| if (a == null) return a; | |
| b = o(b, c); | |
| var d, e = a.length; | |
| if (e === +e) { | |
| for (d = 0; d < e; d++) { | |
| b(a[d], d, a) | |
| } | |
| } else { | |
| var f = n.keys(a); | |
| for (d = 0, e = f.length; d < e; d++) { | |
| b(a[f[d]], f[d], a) | |
| } | |
| } | |
| return a | |
| }; | |
| n.map = n.collect = function(a, b, c) { | |
| if (a == null) return []; | |
| b = n.iteratee(b, c); | |
| var d = a.length !== +a.length && n.keys(a), | |
| e = (d || a).length, | |
| f = Array(e), | |
| g; | |
| for (var h = 0; h < e; h++) { | |
| g = d ? d[h] : h; | |
| f[h] = b(a[g], g, a) | |
| } | |
| return f | |
| }; | |
| var p = "Reduce of empty array with no initial value"; | |
| n.reduce = n.foldl = n.inject = function(a, b, c, d) { | |
| if (a == null) a = []; | |
| b = o(b, d, 4); | |
| var e = a.length !== +a.length && n.keys(a), | |
| f = (e || a).length, | |
| g = 0, | |
| h; | |
| if (arguments.length < 3) { | |
| if (!f) throw new TypeError(p); | |
| c = a[e ? e[g++] : g++] | |
| } | |
| for (; g < f; g++) { | |
| h = e ? e[g] : g; | |
| c = b(c, a[h], h, a) | |
| } | |
| return c | |
| }; | |
| n.reduceRight = n.foldr = function(a, b, c, d) { | |
| if (a == null) a = []; | |
| b = o(b, d, 4); | |
| var e = a.length !== +a.length && n.keys(a), | |
| f = (e || a).length, | |
| g; | |
| if (arguments.length < 3) { | |
| if (!f) throw new TypeError(p); | |
| c = a[e ? e[--f] : --f] | |
| } | |
| while (f--) { | |
| g = e ? e[f] : f; | |
| c = b(c, a[g], g, a) | |
| } | |
| return c | |
| }; | |
| n.find = n.detect = function(a, b, c) { | |
| var d; | |
| b = n.iteratee(b, c); | |
| n.some(a, function(a, c, e) { | |
| if (b(a, c, e)) { | |
| d = a; | |
| return true | |
| } | |
| }); | |
| return d | |
| }; | |
| n.filter = n.select = function(a, b, c) { | |
| var d = []; | |
| if (a == null) return d; | |
| b = n.iteratee(b, c); | |
| n.each(a, function(a, c, e) { | |
| if (b(a, c, e)) d.push(a) | |
| }); | |
| return d | |
| }; | |
| n.reject = function(a, b, c) { | |
| return n.filter(a, n.negate(n.iteratee(b)), c) | |
| }; | |
| n.every = n.all = function(a, b, c) { | |
| if (a == null) return true; | |
| b = n.iteratee(b, c); | |
| var d = a.length !== +a.length && n.keys(a), | |
| e = (d || a).length, | |
| f, g; | |
| for (f = 0; f < e; f++) { | |
| g = d ? d[f] : f; | |
| if (!b(a[g], g, a)) return false | |
| } | |
| return true | |
| }; | |
| n.some = n.any = function(a, b, c) { | |
| if (a == null) return false; | |
| b = n.iteratee(b, c); | |
| var d = a.length !== +a.length && n.keys(a), | |
| e = (d || a).length, | |
| f, g; | |
| for (f = 0; f < e; f++) { | |
| g = d ? d[f] : f; | |
| if (b(a[g], g, a)) return true | |
| } | |
| return false | |
| }; | |
| n.contains = n.include = function(a, b) { | |
| if (a == null) return false; | |
| if (a.length !== +a.length) a = n.values(a); | |
| return n.indexOf(a, b) >= 0 | |
| }; | |
| n.invoke = function(a, b) { | |
| var c = g.call(arguments, 2); | |
| var d = n.isFunction(b); | |
| return n.map(a, function(a) { | |
| return (d ? b : a[b]).apply(a, c) | |
| }) | |
| }; | |
| n.pluck = function(a, b) { | |
| return n.map(a, n.property(b)) | |
| }; | |
| n.where = function(a, b) { | |
| return n.filter(a, n.matches(b)) | |
| }; | |
| n.findWhere = function(a, b) { | |
| return n.find(a, n.matches(b)) | |
| }; | |
| n.max = function(a, b, c) { | |
| var d = -Infinity, | |
| e = -Infinity, | |
| f, g; | |
| if (b == null && a != null) { | |
| a = a.length === +a.length ? a : n.values(a); | |
| for (var h = 0, i = a.length; h < i; h++) { | |
| f = a[h]; | |
| if (f > d) { | |
| d = f | |
| } | |
| } | |
| } else { | |
| b = n.iteratee(b, c); | |
| n.each(a, function(a, c, f) { | |
| g = b(a, c, f); | |
| if (g > e || g === -Infinity && d === -Infinity) { | |
| d = a; | |
| e = g | |
| } | |
| }) | |
| } | |
| return d | |
| }; | |
| n.min = function(a, b, c) { | |
| var d = Infinity, | |
| e = Infinity, | |
| f, g; | |
| if (b == null && a != null) { | |
| a = a.length === +a.length ? a : n.values(a); | |
| for (var h = 0, i = a.length; h < i; h++) { | |
| f = a[h]; | |
| if (f < d) { | |
| d = f | |
| } | |
| } | |
| } else { | |
| b = n.iteratee(b, c); | |
| n.each(a, function(a, c, f) { | |
| g = b(a, c, f); | |
| if (g < e || g === Infinity && d === Infinity) { | |
| d = a; | |
| e = g | |
| } | |
| }) | |
| } | |
| return d | |
| }; | |
| n.shuffle = function(a) { | |
| var b = a && a.length === +a.length ? a : n.values(a); | |
| var c = b.length; | |
| var d = Array(c); | |
| for (var e = 0, f; e < c; e++) { | |
| f = n.random(0, e); | |
| if (f !== e) d[e] = d[f]; | |
| d[f] = b[e] | |
| } | |
| return d | |
| }; | |
| n.sample = function(a, b, c) { | |
| if (b == null || c) { | |
| if (a.length !== +a.length) a = n.values(a); | |
| return a[n.random(a.length - 1)] | |
| } | |
| return n.shuffle(a).slice(0, Math.max(0, b)) | |
| }; | |
| n.sortBy = function(a, b, c) { | |
| b = n.iteratee(b, c); | |
| return n.pluck(n.map(a, function(a, c, d) { | |
| return { | |
| value: a, | |
| index: c, | |
| criteria: b(a, c, d) | |
| } | |
| }).sort(function(a, b) { | |
| var c = a.criteria; | |
| var d = b.criteria; | |
| if (c !== d) { | |
| if (c > d || c === void 0) return 1; | |
| if (c < d || d === void 0) return -1 | |
| } | |
| return a.index - b.index | |
| }), "value") | |
| }; | |
| var q = function(a) { | |
| return function(b, c, d) { | |
| var e = {}; | |
| c = n.iteratee(c, d); | |
| n.each(b, function(d, f) { | |
| var g = c(d, f, b); | |
| a(e, d, g) | |
| }); | |
| return e | |
| } | |
| }; | |
| n.groupBy = q(function(a, b, c) { | |
| if (n.has(a, c)) a[c].push(b); | |
| else a[c] = [b] | |
| }); | |
| n.indexBy = q(function(a, b, c) { | |
| a[c] = b | |
| }); | |
| n.countBy = q(function(a, b, c) { | |
| if (n.has(a, c)) a[c]++; | |
| else a[c] = 1 | |
| }); | |
| n.sortedIndex = function(a, b, c, d) { | |
| c = n.iteratee(c, d, 1); | |
| var e = c(b); | |
| var f = 0, | |
| g = a.length; | |
| while (f < g) { | |
| var h = f + g >>> 1; | |
| if (c(a[h]) < e) f = h + 1; | |
| else g = h | |
| } | |
| return f | |
| }; | |
| n.toArray = function(a) { | |
| if (!a) return []; | |
| if (n.isArray(a)) return g.call(a); | |
| if (a.length === +a.length) return n.map(a, n.identity); | |
| return n.values(a) | |
| }; | |
| n.size = function(a) { | |
| if (a == null) return 0; | |
| return a.length === +a.length ? a.length : n.keys(a).length | |
| }; | |
| n.partition = function(a, b, c) { | |
| b = n.iteratee(b, c); | |
| var d = [], | |
| e = []; | |
| n.each(a, function(a, c, f) { | |
| (b(a, c, f) ? d : e).push(a) | |
| }); | |
| return [d, e] | |
| }; | |
| n.first = n.head = n.take = function(a, b, c) { | |
| if (a == null) return void 0; | |
| if (b == null || c) return a[0]; | |
| if (b < 0) return []; | |
| return g.call(a, 0, b) | |
| }; | |
| n.initial = function(a, b, c) { | |
| return g.call(a, 0, Math.max(0, a.length - (b == null || c ? 1 : b))) | |
| }; | |
| n.last = function(a, b, c) { | |
| if (a == null) return void 0; | |
| if (b == null || c) return a[a.length - 1]; | |
| return g.call(a, Math.max(a.length - b, 0)) | |
| }; | |
| n.rest = n.tail = n.drop = function(a, b, c) { | |
| return g.call(a, b == null || c ? 1 : b) | |
| }; | |
| n.compact = function(a) { | |
| return n.filter(a, n.identity) | |
| }; | |
| var r = function(a, b, c, d) { | |
| if (b && n.every(a, n.isArray)) { | |
| return h.apply(d, a) | |
| } | |
| for (var e = 0, g = a.length; e < g; e++) { | |
| var i = a[e]; | |
| if (!n.isArray(i) && !n.isArguments(i)) { | |
| if (!c) d.push(i) | |
| } else if (b) { | |
| f.apply(d, i) | |
| } else { | |
| r(i, b, c, d) | |
| } | |
| } | |
| return d | |
| }; | |
| n.flatten = function(a, b) { | |
| return r(a, b, false, []) | |
| }; | |
| n.without = function(a) { | |
| return n.difference(a, g.call(arguments, 1)) | |
| }; | |
| n.uniq = n.unique = function(a, b, c, d) { | |
| if (a == null) return []; | |
| if (!n.isBoolean(b)) { | |
| d = c; | |
| c = b; | |
| b = false | |
| } | |
| if (c != null) c = n.iteratee(c, d); | |
| var e = []; | |
| var f = []; | |
| for (var g = 0, h = a.length; g < h; g++) { | |
| var i = a[g]; | |
| if (b) { | |
| if (!g || f !== i) e.push(i); | |
| f = i | |
| } else if (c) { | |
| var j = c(i, g, a); | |
| if (n.indexOf(f, j) < 0) { | |
| f.push(j); | |
| e.push(i) | |
| } | |
| } else if (n.indexOf(e, i) < 0) { | |
| e.push(i) | |
| } | |
| } | |
| return e | |
| }; | |
| n.union = function() { | |
| return n.uniq(r(arguments, true, true, [])) | |
| }; | |
| n.intersection = function(a) { | |
| if (a == null) return []; | |
| var b = []; | |
| var c = arguments.length; | |
| for (var d = 0, e = a.length; d < e; d++) { | |
| var f = a[d]; | |
| if (n.contains(b, f)) continue; | |
| for (var g = 1; g < c; g++) { | |
| if (!n.contains(arguments[g], f)) break | |
| } | |
| if (g === c) b.push(f) | |
| } | |
| return b | |
| }; | |
| n.difference = function(a) { | |
| var b = r(g.call(arguments, 1), true, true, []); | |
| return n.filter(a, function(a) { | |
| return !n.contains(b, a) | |
| }) | |
| }; | |
| n.zip = function(a) { | |
| if (a == null) return []; | |
| var b = n.max(arguments, "length").length; | |
| var c = Array(b); | |
| for (var d = 0; d < b; d++) { | |
| c[d] = n.pluck(arguments, d) | |
| } | |
| return c | |
| }; | |
| n.object = function(a, b) { | |
| if (a == null) return {}; | |
| var c = {}; | |
| for (var d = 0, e = a.length; d < e; d++) { | |
| if (b) { | |
| c[a[d]] = b[d] | |
| } else { | |
| c[a[d][0]] = a[d][1] | |
| } | |
| } | |
| return c | |
| }; | |
| n.indexOf = function(a, b, c) { | |
| if (a == null) return -1; | |
| var d = 0, | |
| e = a.length; | |
| if (c) { | |
| if (typeof c == "number") { | |
| d = c < 0 ? Math.max(0, e + c) : c | |
| } else { | |
| d = n.sortedIndex(a, b); | |
| return a[d] === b ? d : -1 | |
| } | |
| } | |
| for (; d < e; d++) | |
| if (a[d] === b) return d; | |
| return -1 | |
| }; | |
| n.lastIndexOf = function(a, b, c) { | |
| if (a == null) return -1; | |
| var d = a.length; | |
| if (typeof c == "number") { | |
| d = c < 0 ? d + c + 1 : Math.min(d, c + 1) | |
| } | |
| while (--d >= 0) | |
| if (a[d] === b) return d; | |
| return -1 | |
| }; | |
| n.range = function(a, b, c) { | |
| if (arguments.length <= 1) { | |
| b = a || 0; | |
| a = 0 | |
| } | |
| c = c || 1; | |
| var d = Math.max(Math.ceil((b - a) / c), 0); | |
| var e = Array(d); | |
| for (var f = 0; f < d; f++, a += c) { | |
| e[f] = a | |
| } | |
| return e | |
| }; | |
| var s = function() {}; | |
| n.bind = function(a, b) { | |
| var c, d; | |
| if (m && a.bind === m) return m.apply(a, g.call(arguments, 1)); | |
| if (!n.isFunction(a)) throw new TypeError("Bind must be called on a function"); | |
| c = g.call(arguments, 2); | |
| d = function() { | |
| if (!(this instanceof d)) return a.apply(b, c.concat(g.call(arguments))); | |
| s.prototype = a.prototype; | |
| var e = new s; | |
| s.prototype = null; | |
| var f = a.apply(e, c.concat(g.call(arguments))); | |
| if (n.isObject(f)) return f; | |
| return e | |
| }; | |
| return d | |
| }; | |
| n.partial = function(a) { | |
| var b = g.call(arguments, 1); | |
| return function() { | |
| var c = 0; | |
| var d = b.slice(); | |
| for (var e = 0, f = d.length; e < f; e++) { | |
| if (d[e] === n) d[e] = arguments[c++] | |
| } | |
| while (c < arguments.length) d.push(arguments[c++]); | |
| return a.apply(this, d) | |
| } | |
| }; | |
| n.bindAll = function(a) { | |
| var b, c = arguments.length, | |
| d; | |
| if (c <= 1) throw new Error("bindAll must be passed function names"); | |
| for (b = 1; b < c; b++) { | |
| d = arguments[b]; | |
| a[d] = n.bind(a[d], a) | |
| } | |
| return a | |
| }; | |
| n.memoize = function(a, b) { | |
| var c = function(d) { | |
| var e = c.cache; | |
| var f = b ? b.apply(this, arguments) : d; | |
| if (!n.has(e, f)) e[f] = a.apply(this, arguments); | |
| return e[f] | |
| }; | |
| c.cache = {}; | |
| return c | |
| }; | |
| n.delay = function(a, b) { | |
| var c = g.call(arguments, 2); | |
| return setTimeout(function() { | |
| return a.apply(null, c) | |
| }, b) | |
| }; | |
| n.defer = function(a) { | |
| return n.delay.apply(n, [a, 1].concat(g.call(arguments, 1))) | |
| }; | |
| n.throttle = function(a, b, c) { | |
| var d, e, f; | |
| var g = null; | |
| var h = 0; | |
| if (!c) c = {}; | |
| var i = function() { | |
| h = c.leading === false ? 0 : n.now(); | |
| g = null; | |
| f = a.apply(d, e); | |
| if (!g) d = e = null | |
| }; | |
| return function() { | |
| var j = n.now(); | |
| if (!h && c.leading === false) h = j; | |
| var k = b - (j - h); | |
| d = this; | |
| e = arguments; | |
| if (k <= 0 || k > b) { | |
| clearTimeout(g); | |
| g = null; | |
| h = j; | |
| f = a.apply(d, e); | |
| if (!g) d = e = null | |
| } else if (!g && c.trailing !== false) { | |
| g = setTimeout(i, k) | |
| } | |
| return f | |
| } | |
| }; | |
| n.debounce = function(a, b, c) { | |
| var d, e, f, g, h; | |
| var i = function() { | |
| var j = n.now() - g; | |
| if (j < b && j > 0) { | |
| d = setTimeout(i, b - j) | |
| } else { | |
| d = null; | |
| if (!c) { | |
| h = a.apply(f, e); | |
| if (!d) f = e = null | |
| } | |
| } | |
| }; | |
| return function() { | |
| f = this; | |
| e = arguments; | |
| g = n.now(); | |
| var j = c && !d; | |
| if (!d) d = setTimeout(i, b); | |
| if (j) { | |
| h = a.apply(f, e); | |
| f = e = null | |
| } | |
| return h | |
| } | |
| }; | |
| n.wrap = function(a, b) { | |
| return n.partial(b, a) | |
| }; | |
| n.negate = function(a) { | |
| return function() { | |
| return !a.apply(this, arguments) | |
| } | |
| }; | |
| n.compose = function() { | |
| var a = arguments; | |
| var b = a.length - 1; | |
| return function() { | |
| var c = b; | |
| var d = a[b].apply(this, arguments); | |
| while (c--) d = a[c].call(this, d); | |
| return d | |
| } | |
| }; | |
| n.after = function(a, b) { | |
| return function() { | |
| if (--a < 1) { | |
| return b.apply(this, arguments) | |
| } | |
| } | |
| }; | |
| n.before = function(a, b) { | |
| var c; | |
| return function() { | |
| if (--a > 0) { | |
| c = b.apply(this, arguments) | |
| } else { | |
| b = null | |
| } | |
| return c | |
| } | |
| }; | |
| n.once = n.partial(n.before, 2); | |
| n.keys = function(a) { | |
| if (!n.isObject(a)) return []; | |
| if (l) return l(a); | |
| var b = []; | |
| for (var c in a) | |
| if (n.has(a, c)) b.push(c); | |
| return b | |
| }; | |
| n.values = function(a) { | |
| var b = n.keys(a); | |
| var c = b.length; | |
| var d = Array(c); | |
| for (var e = 0; e < c; e++) { | |
| d[e] = a[b[e]] | |
| } | |
| return d | |
| }; | |
| n.pairs = function(a) { | |
| var b = n.keys(a); | |
| var c = b.length; | |
| var d = Array(c); | |
| for (var e = 0; e < c; e++) { | |
| d[e] = [b[e], a[b[e]]] | |
| } | |
| return d | |
| }; | |
| n.invert = function(a) { | |
| var b = {}; | |
| var c = n.keys(a); | |
| for (var d = 0, e = c.length; d < e; d++) { | |
| b[a[c[d]]] = c[d] | |
| } | |
| return b | |
| }; | |
| n.functions = n.methods = function(a) { | |
| var b = []; | |
| for (var c in a) { | |
| if (n.isFunction(a[c])) b.push(c) | |
| } | |
| return b.sort() | |
| }; | |
| n.extend = function(a) { | |
| if (!n.isObject(a)) return a; | |
| var b, c; | |
| for (var d = 1, e = arguments.length; d < e; d++) { | |
| b = arguments[d]; | |
| for (c in b) { | |
| if (j.call(b, c)) { | |
| a[c] = b[c] | |
| } | |
| } | |
| } | |
| return a | |
| }; | |
| n.pick = function(a, b, c) { | |
| var d = {}, | |
| e; | |
| if (a == null) return d; | |
| if (n.isFunction(b)) { | |
| b = o(b, c); | |
| for (e in a) { | |
| var f = a[e]; | |
| if (b(f, e, a)) d[e] = f | |
| } | |
| } else { | |
| var i = h.apply([], g.call(arguments, 1)); | |
| a = new Object(a); | |
| for (var j = 0, k = i.length; j < k; j++) { | |
| e = i[j]; | |
| if (e in a) d[e] = a[e] | |
| } | |
| } | |
| return d | |
| }; | |
| n.omit = function(a, b, c) { | |
| if (n.isFunction(b)) { | |
| b = n.negate(b) | |
| } else { | |
| var d = n.map(h.apply([], g.call(arguments, 1)), String); | |
| b = function(a, b) { | |
| return !n.contains(d, b) | |
| } | |
| } | |
| return n.pick(a, b, c) | |
| }; | |
| n.defaults = function(a) { | |
| if (!n.isObject(a)) return a; | |
| for (var b = 1, c = arguments.length; b < c; b++) { | |
| var d = arguments[b]; | |
| for (var e in d) { | |
| if (a[e] === void 0) a[e] = d[e] | |
| } | |
| } | |
| return a | |
| }; | |
| n.clone = function(a) { | |
| if (!n.isObject(a)) return a; | |
| return n.isArray(a) ? a.slice() : n.extend({}, a) | |
| }; | |
| n.tap = function(a, b) { | |
| b(a); | |
| return a | |
| }; | |
| var t = function(a, b, c, d) { | |
| if (a === b) return a !== 0 || 1 / a === 1 / b; | |
| if (a == null || b == null) return a === b; | |
| if (a instanceof n) a = a._wrapped; | |
| if (b instanceof n) b = b._wrapped; | |
| var e = i.call(a); | |
| if (e !== i.call(b)) return false; | |
| switch (e) { | |
| case "[object RegExp]": | |
| case "[object String]": | |
| return "" + a === "" + b; | |
| case "[object Number]": | |
| if (+a !== +a) return +b !== +b; | |
| return +a === 0 ? 1 / +a === 1 / b : +a === +b; | |
| case "[object Date]": | |
| case "[object Boolean]": | |
| return +a === +b | |
| } | |
| if (typeof a != "object" || typeof b != "object") return false; | |
| var f = c.length; | |
| while (f--) { | |
| if (c[f] === a) return d[f] === b | |
| } | |
| var g = a.constructor, | |
| h = b.constructor; | |
| if (g !== h && "constructor" in a && "constructor" in b && !(n.isFunction(g) && g instanceof g && n.isFunction(h) && h instanceof h)) { | |
| return false | |
| } | |
| c.push(a); | |
| d.push(b); | |
| var j, k; | |
| if (e === "[object Array]") { | |
| j = a.length; | |
| k = j === b.length; | |
| if (k) { | |
| while (j--) { | |
| if (!(k = t(a[j], b[j], c, d))) break | |
| } | |
| } | |
| } else { | |
| var l = n.keys(a), | |
| m; | |
| j = l.length; | |
| k = n.keys(b).length === j; | |
| if (k) { | |
| while (j--) { | |
| m = l[j]; | |
| if (!(k = n.has(b, m) && t(a[m], b[m], c, d))) break | |
| } | |
| } | |
| } | |
| c.pop(); | |
| d.pop(); | |
| return k | |
| }; | |
| n.isEqual = function(a, b) { | |
| return t(a, b, [], []) | |
| }; | |
| n.isEmpty = function(a) { | |
| if (a == null) return true; | |
| if (n.isArray(a) || n.isString(a) || n.isArguments(a)) return a.length === 0; | |
| for (var b in a) | |
| if (n.has(a, b)) return false; | |
| return true | |
| }; | |
| n.isElement = function(a) { | |
| return !!(a && a.nodeType === 1) | |
| }; | |
| n.isArray = k || function(a) { | |
| return i.call(a) === "[object Array]" | |
| }; | |
| n.isObject = function(a) { | |
| var b = typeof a; | |
| return b === "function" || b === "object" && !!a | |
| }; | |
| n.each(["Arguments", "Function", "String", "Number", "Date", "RegExp"], function(a) { | |
| n["is" + a] = function(b) { | |
| return i.call(b) === "[object " + a + "]" | |
| } | |
| }); | |
| if (!n.isArguments(arguments)) { | |
| n.isArguments = function(a) { | |
| return n.has(a, "callee") | |
| } | |
| } | |
| if (typeof /./ !== "function") { | |
| n.isFunction = function(a) { | |
| return typeof a == "function" || false | |
| } | |
| } | |
| n.isFinite = function(a) { | |
| return isFinite(a) && !isNaN(parseFloat(a)) | |
| }; | |
| n.isNaN = function(a) { | |
| return n.isNumber(a) && a !== +a | |
| }; | |
| n.isBoolean = function(a) { | |
| return a === true || a === false || i.call(a) === "[object Boolean]" | |
| }; | |
| n.isNull = function(a) { | |
| return a === null | |
| }; | |
| n.isUndefined = function(a) { | |
| return a === void 0 | |
| }; | |
| n.has = function(a, b) { | |
| return a != null && j.call(a, b) | |
| }; | |
| n.noConflict = function() { | |
| a._ = b; | |
| return this | |
| }; | |
| n.identity = function(a) { | |
| return a | |
| }; | |
| n.constant = function(a) { | |
| return function() { | |
| return a | |
| } | |
| }; | |
| n.noop = function() {}; | |
| n.property = function(a) { | |
| return function(b) { | |
| return b[a] | |
| } | |
| }; | |
| n.matches = function(a) { | |
| var b = n.pairs(a), | |
| c = b.length; | |
| return function(a) { | |
| if (a == null) return !c; | |
| a = new Object(a); | |
| for (var d = 0; d < c; d++) { | |
| var e = b[d], | |
| f = e[0]; | |
| if (e[1] !== a[f] || !(f in a)) return false | |
| } | |
| return true | |
| } | |
| }; | |
| n.times = function(a, b, c) { | |
| var d = Array(Math.max(0, a)); | |
| b = o(b, c, 1); | |
| for (var e = 0; e < a; e++) d[e] = b(e); | |
| return d | |
| }; | |
| n.random = function(a, b) { | |
| if (b == null) { | |
| b = a; | |
| a = 0 | |
| } | |
| return a + Math.floor(Math.random() * (b - a + 1)) | |
| }; | |
| n.now = Date.now || function() { | |
| return (new Date).getTime() | |
| }; | |
| var u = { | |
| "&": "&", | |
| "<": "<", | |
| ">": ">", | |
| '"': """, | |
| "'": "'", | |
| "`": "`" | |
| }; | |
| var v = n.invert(u); | |
| var w = function(a) { | |
| var b = function(b) { | |
| return a[b] | |
| }; | |
| var c = "(?:" + n.keys(a).join("|") + ")"; | |
| var d = RegExp(c); | |
| var e = RegExp(c, "g"); | |
| return function(a) { | |
| a = a == null ? "" : "" + a; | |
| return d.test(a) ? a.replace(e, b) : a | |
| } | |
| }; | |
| n.escape = w(u); | |
| n.unescape = w(v); | |
| n.result = function(a, b) { | |
| if (a == null) return void 0; | |
| var c = a[b]; | |
| return n.isFunction(c) ? a[b]() : c | |
| }; | |
| var x = 0; | |
| n.uniqueId = function(a) { | |
| var b = ++x + ""; | |
| return a ? a + b : b | |
| }; | |
| n.templateSettings = { | |
| evaluate: /<%([\s\S]+?)%>/g, | |
| interpolate: /<%=([\s\S]+?)%>/g, | |
| escape: /<%-([\s\S]+?)%>/g | |
| }; | |
| var y = /(.)^/; | |
| var z = { | |
| "'": "'", | |
| "\\": "\\", | |
| "\r": "r", | |
| "\n": "n", | |
| "\u2028": "u2028", | |
| "\u2029": "u2029" | |
| }; | |
| var A = /\\|'|\r|\n|\u2028|\u2029/g; | |
| var B = function(a) { | |
| return "\\" + z[a] | |
| }; | |
| n.template = function(a, b, c) { | |
| if (!b && c) b = c; | |
| b = n.defaults({}, b, n.templateSettings); | |
| var d = RegExp([(b.escape || y).source, (b.interpolate || y).source, (b.evaluate || y).source].join("|") + "|$", "g"); | |
| var e = 0; | |
| var f = "__p+='"; | |
| a.replace(d, function(b, c, d, g, h) { | |
| f += a.slice(e, h).replace(A, B); | |
| e = h + b.length; | |
| if (c) { | |
| f += "'+\n((__t=(" + c + "))==null?'':_.escape(__t))+\n'" | |
| } else if (d) { | |
| f += "'+\n((__t=(" + d + "))==null?'':__t)+\n'" | |
| } else if (g) { | |
| f += "';\n" + g + "\n__p+='" | |
| } | |
| return b | |
| }); | |
| f += "';\n"; | |
| if (!b.variable) f = "with(obj||{}){\n" + f + "}\n"; | |
| f = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + f + "return __p;\n"; | |
| try { | |
| var g = new Function(b.variable || "obj", "_", f) | |
| } catch (a) { | |
| a.source = f; | |
| throw a | |
| } | |
| var h = function(a) { | |
| return g.call(this, a, n) | |
| }; | |
| var i = b.variable || "obj"; | |
| h.source = "function(" + i + "){\n" + f + "}"; | |
| return h | |
| }; | |
| n.chain = function(a) { | |
| var b = n(a); | |
| b._chain = true; | |
| return b | |
| }; | |
| var C = function(a) { | |
| return this._chain ? n(a).chain() : a | |
| }; | |
| n.mixin = function(a) { | |
| n.each(n.functions(a), function(b) { | |
| var c = n[b] = a[b]; | |
| n.prototype[b] = function() { | |
| var a = [this._wrapped]; | |
| f.apply(a, arguments); | |
| return C.call(this, c.apply(n, a)) | |
| } | |
| }) | |
| }; | |
| n.mixin(n); | |
| n.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(a) { | |
| var b = c[a]; | |
| n.prototype[a] = function() { | |
| var c = this._wrapped; | |
| b.apply(c, arguments); | |
| if ((a === "shift" || a === "splice") && c.length === 0) delete c[0]; | |
| return C.call(this, c) | |
| } | |
| }); | |
| n.each(["concat", "join", "slice"], function(a) { | |
| var b = c[a]; | |
| n.prototype[a] = function() { | |
| return C.call(this, b.apply(this._wrapped, arguments)) | |
| } | |
| }); | |
| n.prototype.value = function() { | |
| return this._wrapped | |
| }; | |
| if (typeof define === "function" && define.amd) { | |
| define("underscore", [], function() { | |
| return n | |
| }) | |
| } | |
| }).call(this); | |
| (function(a, b) { | |
| "use strict"; | |
| var c = function() { | |
| if (b.addEventListener) { | |
| return function a(b, c, d) { | |
| return b.addEventListener(c, d, false) | |
| } | |
| } else { | |
| return function a(b, c, d) { | |
| return b.attachEvent("on" + c, d) | |
| } | |
| } | |
| }(); | |
| var d = [96, 130, 165, 200, 235, 270, 304, 340, 375, 410, 445, 485, 520, 555, 590, 625, 660, 695, 736]; | |
| var e = typeof Object.keys === "function" ? Object.keys : function(a) { | |
| var b = [], | |
| c; | |
| for (c in a) { | |
| b.push(c) | |
| } | |
| return b | |
| }; | |
| var f = function(a, b) { | |
| var c = 0, | |
| d = a.length, | |
| e = []; | |
| for (; c < d; c++) { | |
| e[c] = b(a[c], c) | |
| } | |
| return e | |
| }; | |
| var g = function(a) { | |
| return a | |
| }; | |
| var h = function() {}; | |
| var i = function() { | |
| return true | |
| }; | |
| var j = function(a, b) { | |
| var c; | |
| return function() { | |
| var d = this, | |
| e = arguments; | |
| var f = function() { | |
| c = null; | |
| a.apply(d, e) | |
| }; | |
| clearTimeout(c); | |
| c = setTimeout(f, b) | |
| } | |
| }; | |
| var k = function(a, c) { | |
| var f = this; | |
| var i = b; | |
| c = c || {}; | |
| if (a !== undefined) { | |
| if (typeof a === "string") { | |
| c.selector = a; | |
| a = undefined | |
| } else if (typeof a.length === "undefined") { | |
| c = a; | |
| a = undefined | |
| } | |
| } | |
| this.viewportHeight = i.documentElement.clientHeight; | |
| this.selector = !a ? c.selector || ".delayed-image-load" : null; | |
| this.className = c.className || "image-replace"; | |
| this.gif = i.createElement("img"); | |
| this.gif.src = "data:image/gif;base64,R0lGODlhEAAJAIAAAP///wAAACH5BAEAAAAALAAAAAAQAAkAAAIKhI+py+0Po5yUFQA7"; | |
| this.gif.className = this.className; | |
| this.gif.alt = ""; | |
| this.lazyloadOffset = c.lazyloadOffset || 0; | |
| this.scrollDelay = c.scrollDelay || 250; | |
| this.onResize = c.hasOwnProperty("onResize") ? c.onResize : true; | |
| this.lazyload = c.hasOwnProperty("lazyload") ? c.lazyload : false; | |
| this.scrolled = false; | |
| this.availablePixelRatios = c.availablePixelRatios || [1, 2]; | |
| this.availableWidths = c.availableWidths || d; | |
| this.onImagesReplaced = c.onImagesReplaced || h; | |
| this.widthsMap = {}; | |
| this.refreshPixelRatio(); | |
| this.widthInterpolator = c.widthInterpolator || g; | |
| this.gif.removeAttribute("height"); | |
| this.gif.removeAttribute("width"); | |
| if (typeof this.availableWidths !== "function") { | |
| if (typeof this.availableWidths.length === "number") { | |
| this.widthsMap = k.createWidthsMap(this.availableWidths, this.widthInterpolator, this.devicePixelRatio) | |
| } else { | |
| this.widthsMap = this.availableWidths; | |
| this.availableWidths = e(this.availableWidths) | |
| } | |
| this.availableWidths = this.availableWidths.sort(function(a, b) { | |
| return a - b | |
| }) | |
| } | |
| this.divs = []; | |
| this.add(a || this.selector); | |
| this.ready(c.onReady); | |
| setTimeout(function() { | |
| f.init() | |
| }, 0) | |
| }; | |
| k.prototype.add = function(a) { | |
| a = a || this.selector; | |
| var c = typeof a === "string" ? b.querySelectorAll(a) : a; | |
| if (c && c.length) { | |
| var d = f(c, g); | |
| this.changeDivsToEmptyImages(d); | |
| this.divs = this.divs.concat(d) | |
| } | |
| }; | |
| k.prototype.scrollCheck = function() { | |
| var b = this; | |
| var c = 0; | |
| var d = []; | |
| if (this.scrolled) { | |
| f(this.divs, function(a) { | |
| if (b.isPlaceholder(a)) { | |
| ++c; | |
| if (b.isThisElementOnScreen(a)) { | |
| d.push(a) | |
| } | |
| } | |
| }); | |
| if (c === 0) { | |
| a.clearInterval(b.interval) | |
| } | |
| this.changeDivsToEmptyImages(d); | |
| this.scrolled = false | |
| } | |
| }; | |
| k.prototype.init = function() { | |
| var a = this; | |
| this.initialized = true; | |
| var b = i; | |
| if (this.lazyload) { | |
| this.registerScrollEvent(); | |
| this.scrolled = true; | |
| a.scrollCheck(); | |
| b = function(b) { | |
| return a.isPlaceholder(b) === false | |
| } | |
| } else { | |
| this.checkImagesNeedReplacing(this.divs) | |
| } | |
| if (this.onResize) { | |
| this.registerResizeEvent(b) | |
| } | |
| this.onReady() | |
| }; | |
| k.prototype.ready = function(a) { | |
| this.onReady = a || h | |
| }; | |
| k.prototype.createGif = function(a) { | |
| if (!a.parentNode) return; | |
| if (a.className.match(new RegExp("(^| )" + this.className + "( |$)"))) { | |
| return a | |
| } | |
| var b = a.getAttribute("data-class"); | |
| var c = a.getAttribute("data-width"); | |
| var d = this.gif.cloneNode(false); | |
| if (c) { | |
| d.width = c; | |
| d.setAttribute("data-width", c) | |
| } | |
| d.className = (b ? b + " " : "") + this.className; | |
| d.setAttribute("data-src", a.getAttribute("data-src")); | |
| d.setAttribute("alt", a.getAttribute("data-alt") || this.gif.alt); | |
| a.parentNode.replaceChild(d, a); | |
| return d | |
| }; | |
| k.prototype.changeDivsToEmptyImages = function(a) { | |
| var b = this; | |
| f(a, function(c, d) { | |
| a[d] = b.createGif(c) | |
| }); | |
| if (this.initialized) { | |
| this.checkImagesNeedReplacing(a) | |
| } | |
| }; | |
| k.prototype.isPlaceholder = function(a) { | |
| return a.src === this.gif.src | |
| }; | |
| k.prototype.isThisElementOnScreen = function(a) { | |
| var b = 0; | |
| var c = k.getPageOffset() + this.lazyloadOffset; | |
| var d = a.getBoundingClientRect(); | |
| if (!d) { | |
| if (a.offsetParent) { | |
| do { | |
| b += a.offsetTop | |
| } while (a = a.offsetParent) | |
| } | |
| } else if (d.width === 0) { | |
| return false | |
| } else { | |
| b = d.top | |
| } | |
| return b < this.viewportHeight + c | |
| }; | |
| k.prototype.checkImagesNeedReplacing = function(a, b) { | |
| var c = this; | |
| b = b || i; | |
| if (!this.isResizing) { | |
| this.isResizing = true; | |
| this.refreshPixelRatio(); | |
| f(a, function(a) { | |
| if (!!a && b(a)) { | |
| c.replaceImagesBasedOnScreenDimensions(a) | |
| } | |
| }); | |
| this.isResizing = false; | |
| this.onImagesReplaced(a) | |
| } | |
| }; | |
| k.prototype.replaceImagesBasedOnScreenDimensions = function(a) { | |
| var b, c; | |
| c = k.getNaturalWidth(a); | |
| b = typeof this.availableWidths === "function" ? this.availableWidths(a) : this.determineAppropriateResolution(a); | |
| a.width = b; | |
| if (!this.isPlaceholder(a) && b <= c) { | |
| return | |
| } | |
| a.src = this.changeImageSrcToUseNewImageDimensions(a.getAttribute("data-src"), b); | |
| a.removeAttribute("width"); | |
| a.removeAttribute("height") | |
| }; | |
| k.prototype.determineAppropriateResolution = function(a) { | |
| var b = a.getAttribute("data-width") || a.parentNode.clientWidth; | |
| var c = a.parentNode.getAttribute("data-use-height-based-aspect-ratio"); | |
| if (typeof c === "string") { | |
| var d = a.parentNode.clientHeight * parseFloat(c); | |
| if (d > b) { | |
| b = d | |
| } | |
| } | |
| return k.getClosestValue(b, this.availableWidths) | |
| }; | |
| k.prototype.refreshPixelRatio = function a() { | |
| this.devicePixelRatio = k.getClosestValue(k.getPixelRatio(), this.availablePixelRatios) | |
| }; | |
| k.prototype.changeImageSrcToUseNewImageDimensions = function(a, b) { | |
| return a.replace(/{width}/g, k.transforms.width(b, this.widthsMap)).replace(/{pixel_ratio}/g, k.transforms.pixelRatio(this.devicePixelRatio)) | |
| }; | |
| k.getPixelRatio = function b(c) { | |
| return (c || a)["devicePixelRatio"] || 1 | |
| }; | |
| k.createWidthsMap = function a(b, c, d) { | |
| var e = {}, | |
| f = b.length; | |
| while (f--) { | |
| e[b[f]] = c(b[f], d) | |
| } | |
| return e | |
| }; | |
| k.transforms = { | |
| pixelRatio: function(a) { | |
| return a === 1 ? "" : "-" + a + "x" | |
| }, | |
| width: function(a, b) { | |
| return b[a] || a | |
| } | |
| }; | |
| k.getClosestValue = function a(b, c) { | |
| var d = c.length, | |
| e = c[d - 1]; | |
| b = parseFloat(b); | |
| while (d--) { | |
| if (b <= c[d]) { | |
| e = c[d] | |
| } | |
| } | |
| return e | |
| }; | |
| k.prototype.registerResizeEvent = function(b) { | |
| var d = this; | |
| c(a, "resize", j(function() { | |
| d.checkImagesNeedReplacing(d.divs, b) | |
| }, 100)) | |
| }; | |
| k.prototype.registerScrollEvent = function() { | |
| var d = this; | |
| this.scrolled = false; | |
| this.interval = a.setInterval(function() { | |
| d.scrollCheck() | |
| }, d.scrollDelay); | |
| c(a, "scroll", function() { | |
| d.scrolled = true | |
| }); | |
| c(a, "resize", function() { | |
| d.viewportHeight = b.documentElement.clientHeight; | |
| d.scrolled = true | |
| }) | |
| }; | |
| k.getPageOffsetGenerator = function c(d) { | |
| if (d) { | |
| return function() { | |
| return a.pageYOffset | |
| } | |
| } else { | |
| return function() { | |
| return b.documentElement.scrollTop | |
| } | |
| } | |
| }; | |
| k.getNaturalWidth = function() { | |
| if ("naturalWidth" in new Image) { | |
| return function(a) { | |
| return a.naturalWidth | |
| } | |
| } | |
| return function(a) { | |
| var c = b.createElement("img"); | |
| c.src = a.src; | |
| return c.width | |
| } | |
| }(); | |
| k.getPageOffset = k.getPageOffsetGenerator(Object.prototype.hasOwnProperty.call(a, "pageYOffset")); | |
| k.applyEach = f; | |
| k.addEvent = c; | |
| k.debounce = j; | |
| if (typeof module === "object" && typeof module.exports === "object") { | |
| module.exports = exports = k | |
| } else if (typeof define === "function" && define.amd) { | |
| define(function() { | |
| return k | |
| }) | |
| } else if (typeof a === "object") { | |
| a.Imager = k | |
| } | |
| })(window, document); | |
| window.Modernizr = function(a, b, c) { | |
| function d(a) { | |
| o.cssText = a | |
| } | |
| function e(a, b) { | |
| return d(r.join(a + ";") + (b || "")) | |
| } | |
| function f(a, b) { | |
| return typeof a === b | |
| } | |
| function g(a, b) { | |
| return !!~("" + a).indexOf(b) | |
| } | |
| function h(a, b, d) { | |
| for (var e in a) { | |
| var g = b[a[e]]; | |
| if (g !== c) return d === !1 ? a[e] : f(g, "function") ? g.bind(d || b) : g | |
| } | |
| return !1 | |
| } | |
| var i = "2.8.3", | |
| j = {}, | |
| k = !0, | |
| l = b.documentElement, | |
| m = "modernizr", | |
| n = b.createElement(m), | |
| o = n.style, | |
| p, q = {}.toString, | |
| r = " -webkit- -moz- -o- -ms- ".split(" "), | |
| s = {}, | |
| t = {}, | |
| u = {}, | |
| v = [], | |
| w = v.slice, | |
| x, y = function(a, c, d, e) { | |
| var f, g, h, i, j = b.createElement("div"), | |
| k = b.body, | |
| n = k || b.createElement("body"); | |
| if (parseInt(d, 10)) | |
| while (d--) h = b.createElement("div"), h.id = e ? e[d] : m + (d + 1), j.appendChild(h); | |
| return f = ["­", '<style id="s', m, '">', a, "</style>"].join(""), j.id = m, (k ? j : n).innerHTML += f, n.appendChild(j), k || (n.style.background = "", n.style.overflow = "hidden", i = l.style.overflow, l.style.overflow = "hidden", l.appendChild(n)), g = c(j, a), k ? j.parentNode.removeChild(j) : (n.parentNode.removeChild(n), l.style.overflow = i), !!g | |
| }, | |
| z = {}.hasOwnProperty, | |
| A; | |
| !f(z, "undefined") && !f(z.call, "undefined") ? A = function(a, b) { | |
| return z.call(a, b) | |
| } : A = function(a, b) { | |
| return b in a && f(a.constructor.prototype[b], "undefined") | |
| }, Function.prototype.bind || (Function.prototype.bind = function(a) { | |
| var b = this; | |
| if (typeof b != "function") throw new TypeError; | |
| var c = w.call(arguments, 1), | |
| d = function() { | |
| if (this instanceof d) { | |
| var e = function() {}; | |
| e.prototype = b.prototype; | |
| var f = new e, | |
| g = b.apply(f, c.concat(w.call(arguments))); | |
| return Object(g) === g ? g : f | |
| } | |
| return b.apply(a, c.concat(w.call(arguments))) | |
| }; | |
| return d | |
| }), s.touch = function() { | |
| var c; | |
| return "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 : y(["@media (", r.join("touch-enabled),("), m, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function(a) { | |
| c = a.offsetTop === 9 | |
| }), c | |
| }; | |
| for (var B in s) A(s, B) && (x = B.toLowerCase(), j[x] = s[B](), v.push((j[x] ? "" : "no-") + x)); | |
| return j.addTest = function(a, b) { | |
| if (typeof a == "object") | |
| for (var d in a) A(a, d) && j.addTest(d, a[d]); | |
| else { | |
| a = a.toLowerCase(); | |
| if (j[a] !== c) return j; | |
| b = typeof b == "function" ? b() : b, typeof k != "undefined" && k && (l.className += " " + (b ? "" : "no-") + a), j[a] = b | |
| } | |
| return j | |
| }, d(""), n = p = null, j._version = i, j._prefixes = r, j.testStyles = y, l.className = l.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (k ? " js " + v.join(" ") : ""), j | |
| }(this, this.document), | |
| function(a, b, c) { | |
| function d(a) { | |
| return "[object Function]" == o.call(a) | |
| } | |
| function e(a) { | |
| return "string" == typeof a | |
| } | |
| function f() {} | |
| function g(a) { | |
| return !a || "loaded" == a || "complete" == a || "uninitialized" == a | |
| } | |
| function h() { | |
| var a = p.shift(); | |
| q = 1, a ? a.t ? m(function() { | |
| ("c" == a.t ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1) | |
| }, 0) : (a(), h()) : q = 0 | |
| } | |
| function i(a, c, d, e, f, i, j) { | |
| function k(b) { | |
| if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) { | |
| "img" != a && m(function() { | |
| t.removeChild(l) | |
| }, 50); | |
| for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload() | |
| } | |
| } | |
| var j = j || B.errorTimeout, | |
| l = b.createElement(a), | |
| o = 0, | |
| r = 0, | |
| u = { | |
| t: d, | |
| s: c, | |
| e: f, | |
| a: i, | |
| x: j | |
| }; | |
| 1 === y[c] && (r = 1, y[c] = []), "object" == a ? l.data = c : (l.src = c, l.type = a), l.width = l.height = "0", l.onerror = l.onload = l.onreadystatechange = function() { | |
| k.call(this, r) | |
| }, p.splice(e, 0, u), "img" != a && (r || 2 === y[c] ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l)) | |
| } | |
| function j(a, b, c, d, f) { | |
| return q = 0, b = b || "j", e(a) ? i("c" == b ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a), 1 == p.length && h()), this | |
| } | |
| function k() { | |
| var a = B; | |
| return a.loader = { | |
| load: j, | |
| i: 0 | |
| }, a | |
| } | |
| var l = b.documentElement, | |
| m = a.setTimeout, | |
| n = b.getElementsByTagName("script")[0], | |
| o = {}.toString, | |
| p = [], | |
| q = 0, | |
| r = "MozAppearance" in l.style, | |
| s = r && !!b.createRange().compareNode, | |
| t = s ? l : n.parentNode, | |
| l = a.opera && "[object Opera]" == o.call(a.opera), | |
| l = !!b.attachEvent && !l, | |
| u = r ? "object" : l ? "script" : "img", | |
| v = l ? "script" : u, | |
| w = Array.isArray || function(a) { | |
| return "[object Array]" == o.call(a) | |
| }, | |
| x = [], | |
| y = {}, | |
| z = { | |
| timeout: function(a, b) { | |
| return b.length && (a.timeout = b[0]), a | |
| } | |
| }, | |
| A, B; | |
| B = function(a) { | |
| function b(a) { | |
| var a = a.split("!"), | |
| b = x.length, | |
| c = a.pop(), | |
| d = a.length, | |
| c = { | |
| url: c, | |
| origUrl: c, | |
| prefixes: a | |
| }, | |
| e, f, g; | |
| for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g)); | |
| for (f = 0; f < b; f++) c = x[f](c); | |
| return c | |
| } | |
| function g(a, e, f, g, h) { | |
| var i = b(a), | |
| j = i.autoCallback; | |
| i.url.split(".").pop().split("?").shift(), i.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]]), i.instead ? i.instead(a, e, f, g, h) : (y[i.url] ? i.noexec = !0 : y[i.url] = 1, f.load(i.url, i.forceCSS || !i.forceJS && "css" == i.url.split(".").pop().split("?").shift() ? "c" : c, i.noexec, i.attrs, i.timeout), (d(e) || d(j)) && f.load(function() { | |
| k(), e && e(i.origUrl, h, g), j && j(i.origUrl, h, g), y[i.url] = 2 | |
| }))) | |
| } | |
| function h(a, b) { | |
| function c(a, c) { | |
| if (a) { | |
| if (e(a)) c || (j = function() { | |
| var a = [].slice.call(arguments); | |
| k.apply(this, a), l() | |
| }), g(a, j, b, 0, h); | |
| else if (Object(a) === a) | |
| for (n in m = function() { | |
| var b = 0, | |
| c; | |
| for (c in a) a.hasOwnProperty(c) && b++; | |
| return b | |
| }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function() { | |
| var a = [].slice.call(arguments); | |
| k.apply(this, a), l() | |
| } : j[n] = function(a) { | |
| return function() { | |
| var b = [].slice.call(arguments); | |
| a && a.apply(this, b), l() | |
| } | |
| }(k[n])), g(a[n], j, b, n, h)) | |
| } else !c && l() | |
| } | |
| var h = !!a.test, | |
| i = a.load || a.both, | |
| j = a.callback || f, | |
| k = j, | |
| l = a.complete || f, | |
| m, n; | |
| c(h ? a.yep : a.nope, !!i), i && c(i) | |
| } | |
| var i, j, l = this.yepnope.loader; | |
| if (e(a)) g(a, 0, l, 0); | |
| else if (w(a)) | |
| for (i = 0; i < a.length; i++) j = a[i], e(j) ? g(j, 0, l, 0) : w(j) ? B(j) : Object(j) === j && h(j, l); | |
| else Object(a) === a && h(a, l) | |
| }, B.addPrefix = function(a, b) { | |
| z[a] = b | |
| }, B.addFilter = function(a) { | |
| x.push(a) | |
| }, B.errorTimeout = 1e4, null == b.readyState && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded", A = function() { | |
| b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete" | |
| }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function(a, c, d, e, i, j) { | |
| var k = b.createElement("script"), | |
| l, o, e = e || B.errorTimeout; | |
| k.src = a; | |
| for (o in d) k.setAttribute(o, d[o]); | |
| c = j ? h : c || f, k.onreadystatechange = k.onload = function() { | |
| !l && g(k.readyState) && (l = 1, | |
| c(), k.onload = k.onreadystatechange = null) | |
| }, m(function() { | |
| l || (l = 1, c(1)) | |
| }, e), i ? k.onload() : n.parentNode.insertBefore(k, n) | |
| }, a.yepnope.injectCss = function(a, c, d, e, g, i) { | |
| var e = b.createElement("link"), | |
| j, c = i ? h : c || f; | |
| e.href = a, e.rel = "stylesheet", e.type = "text/css"; | |
| for (j in d) e.setAttribute(j, d[j]); | |
| g || (n.parentNode.insertBefore(e, n), m(c, 0)) | |
| } | |
| }(this, document), Modernizr.load = function() { | |
| yepnope.apply(window, [].slice.call(arguments, 0)) | |
| }; | |
| (function(a) { | |
| if (typeof exports === "object" && typeof module !== "undefined") { | |
| module.exports = a() | |
| } else if (typeof define === "function" && define.amd) { | |
| define([], a) | |
| } else { | |
| var b; | |
| if (typeof window !== "undefined") { | |
| b = window | |
| } else if (typeof global !== "undefined") { | |
| b = global | |
| } else if (typeof self !== "undefined") { | |
| b = self | |
| } else { | |
| b = this | |
| }(b.index || (b.index = {})).js = a() | |
| } | |
| })(function() { | |
| var a, b, c; | |
| return function a(b, c, d) { | |
| function e(g, h) { | |
| if (!c[g]) { | |
| if (!b[g]) { | |
| var i = typeof require == "function" && require; | |
| if (!h && i) return i(g, !0); | |
| if (f) return f(g, !0); | |
| var j = new Error("Cannot find module '" + g + "'"); | |
| throw j.code = "MODULE_NOT_FOUND", j | |
| } | |
| var k = c[g] = { | |
| exports: {} | |
| }; | |
| b[g][0].call(k.exports, function(a) { | |
| var c = b[g][1][a]; | |
| return e(c ? c : a) | |
| }, k, k.exports, a, b, c, d) | |
| } | |
| return c[g].exports | |
| } | |
| var f = typeof require == "function" && require; | |
| for (var g = 0; g < d.length; g++) e(d[g]); | |
| return e | |
| }({ | |
| 1: [function(a, b, c) { | |
| var d = a("./src/permission-ui.js"); | |
| if (window) { | |
| window.geolocationPermissionUi = d | |
| } | |
| b.exports = d | |
| }, { | |
| "./src/permission-ui.js": 4 | |
| }], | |
| 2: [function(a, b, c) { | |
| var d = "Webkit Moz O ms Khtml".split(" "); | |
| var e = function(a, b) { | |
| var c = a.charAt(0).toUpperCase() + a.substr(1), | |
| e = (a + " " + d.join(c + " ") + c).split(" "); | |
| for (var f = 0, g = e.length; f < g; f++) { | |
| if (b.style[e[f]] === "") return true | |
| } | |
| return false | |
| }; | |
| var f = function(a) { | |
| var b = document.createElement("detect"), | |
| c = {}, | |
| d; | |
| for (var f = 0; f < a.length; f++) { | |
| d = a[f]; | |
| c[d] = e(d, b) | |
| } | |
| return c | |
| }; | |
| var g = function(a, b) { | |
| var c = !!b, | |
| d = typeof a === "string" ? [a] : a, | |
| e = c && "getComputedStyle" in window, | |
| f = e ? window.getComputedStyle(b) : {}, | |
| g = false; | |
| if (e && f) { | |
| for (var h = 0; h < d.length; h++) { | |
| var i = !!f[d[h]]; | |
| if (i && f[d[h]] !== "" && f[d[h]] !== "none") { | |
| g = true; | |
| break | |
| } | |
| } | |
| } | |
| return g | |
| }; | |
| b.exports = { | |
| detect: f, | |
| hasStyle: g | |
| } | |
| }, {}], | |
| 3: [function(a, b, c) { | |
| var d = function(a, b) { | |
| return (a.className || "").match(new RegExp("(\\s|^)" + b + "(\\s|$)")) | |
| }; | |
| var e = function(a) { | |
| return a && a.className ? a.className.split(/\s+/) : [] | |
| }; | |
| var f = function(a, b) { | |
| var c = d(b, a), | |
| f; | |
| if (!c) { | |
| f = e(b); | |
| f.push(a); | |
| b.className = f.join(" ") | |
| } | |
| return !c | |
| }; | |
| var g = function(a, b) { | |
| var c = d(b, a), | |
| f, g; | |
| if (c) { | |
| f = e(b); | |
| g = []; | |
| for (var h = 0; h < f.length; h++) { | |
| if (f[h] !== a) { | |
| g.push(f[h]) | |
| } | |
| } | |
| b.className = g.join(" ") | |
| } | |
| return !c | |
| }; | |
| var h = function(a, b) { | |
| var c = b || document; | |
| if (c.getElementsByClassName) { | |
| return c.getElementsByClassName(a) | |
| } else if (c.querySelectorAll) { | |
| return c.querySelectorAll("." + a) | |
| } else { | |
| var e = []; | |
| var f = c.getElementsByTagName("*"); | |
| for (var g = 0; g < f.length; g++) { | |
| if (d(f[g], a)) { | |
| e.push(f[g]) | |
| } | |
| } | |
| return e | |
| } | |
| }; | |
| var i = function(a, b, c) { | |
| if (a.addEventListener) { | |
| a.addEventListener(b, c, false) | |
| } else if (a.attachEvent) { | |
| a.attachEvent("on" + b, c) | |
| } | |
| }; | |
| var j = function(a) { | |
| if (a && a.parentElement) { | |
| a.parentElement.removeChild(a) | |
| } | |
| }; | |
| b.exports = { | |
| remove: j, | |
| on: i, | |
| getByClassName: h, | |
| hasClass: d, | |
| addClass: f, | |
| removeClass: g | |
| } | |
| }, {}], | |
| 4: [function(a, b, c) { | |
| "use strict"; | |
| var d = a("./detect"), | |
| e = d.detect(["transition"]), | |
| f = a("./permission.html"), | |
| g = /iPhone/i, | |
| h = "Sallimalla paikannustiedot saat siihen liittyvät ilmoitukset ja säätiedot. Sijaintitietoasi ei yhdistetä sinuun henkilökohtaisesti.", | |
| i = '<a class="link" href="https://www.sanoma.com/fi/tietosuoja/tietosuojalauseke">Lue lisää paikannuksesta</a>', | |
| j = a("./dom"), | |
| k = a("./transition"); | |
| var l = function() { | |
| return !!navigator.userAgent.match(g) | |
| }; | |
| var m = function(a) { | |
| var b = {}; | |
| for (var c = 0; c < a.length; c++) { | |
| var d = a[c].className.split(/\s+/)[0]; | |
| b[d] = a[c] | |
| } | |
| return b | |
| }; | |
| var n = function(a, b) { | |
| var c = d.hasStyle(["transform", "webkitTransform", "mozTransform", "oTransform", "MSTransform"], a), | |
| e = function() { | |
| j.remove(a) | |
| }; | |
| if (c) { | |
| k.transitionEnd(a, function() { | |
| b(a, e) | |
| }); | |
| j.removeClass("open", a) | |
| } else { | |
| b(a, e) | |
| } | |
| }; | |
| var o = function(a) { | |
| if ("getComputedStyle" in window) { | |
| var b = window.getComputedStyle(a).transform | |
| } | |
| }; | |
| var p = function(a) { | |
| var b = a.permissionCallback, | |
| c = j.getByClassName("geolocation-permission-ui"), | |
| d = c.length > 0, | |
| e = d ? c[0].parentElement : a.container, | |
| g = document.createElement("div"), | |
| k = a.template || f, | |
| l = a.afterElementCreated || function() {}, | |
| p = a.beforeElementRemoved || function(a, b) { | |
| b() | |
| }, | |
| q, r, s; | |
| if (!d) { | |
| g.innerHTML = k; | |
| q = g.firstChild; | |
| s = j.getByClassName("text", q)[0]; | |
| s.innerHTML = h + " <br>" + i; | |
| e.appendChild(q); | |
| l(q); | |
| o(q); | |
| j.addClass("open", q) | |
| } | |
| r = m(e.getElementsByTagName("button")); | |
| j.on(r.no, "click", function() { | |
| n(q, p); | |
| b(false) | |
| }); | |
| j.on(r.yes, "click", function() { | |
| n(q, p); | |
| b(true) | |
| }) | |
| }; | |
| var q = function(a) { | |
| var b = a.showNativeDialogFor || l; | |
| if (b()) { | |
| a.permissionCallback(window.confirm(h)) | |
| } else { | |
| p(a) | |
| } | |
| }; | |
| b.exports = { | |
| askPermission: q | |
| } | |
| }, { | |
| "./detect": 2, | |
| "./dom": 3, | |
| "./permission.html": 5, | |
| "./transition": 6 | |
| }], | |
| 5: [function(a, b, c) { | |
| b.exports = '<div class="geolocation-permission-ui">\n <h1>Paikannuslupakysely</h1>\n <p class="text"></p>\n <div class="buttons">\n <button class="no">Älä salli</button>\n <button class="yes">Salli paikannus</button>\n </div>\n</div>\n' | |
| }, {}], | |
| 6: [function(a, b, c) { | |
| var d = ["otransitionend", "oTransitionEnd", "webkitTransitionEnd", "MSTransitionEnd", "transitionend"]; | |
| var e = function(a, b) { | |
| var c = false, | |
| e = function() { | |
| if (!c) { | |
| c = true; | |
| b() | |
| } | |
| }; | |
| for (var f = 0; f < d.length; f++) { | |
| a.addEventListener(d[f], e) | |
| } | |
| }; | |
| b.exports = { | |
| transitionEnd: e | |
| } | |
| }, {}] | |
| }, {}, [1])(1) | |
| }); | |
| (function() { | |
| "use strict"; | |
| var a = 0, | |
| b = true, | |
| c = false, | |
| d = "message", | |
| e = d.length, | |
| f = "[iFrameSizer]", | |
| g = f.length, | |
| h = null, | |
| i = window.requestAnimationFrame, | |
| j = { | |
| max: 1, | |
| scroll: 1, | |
| bodyScroll: 1, | |
| documentElementScroll: 1 | |
| }, | |
| k = {}, | |
| l = null, | |
| m = { | |
| autoResize: true, | |
| bodyBackground: null, | |
| bodyMargin: null, | |
| bodyMarginV1: 8, | |
| bodyPadding: null, | |
| checkOrigin: true, | |
| enableInPageLinks: false, | |
| enablePublicMethods: false, | |
| heightCalculationMethod: "offset", | |
| interval: 32, | |
| log: false, | |
| maxHeight: Infinity, | |
| maxWidth: Infinity, | |
| minHeight: 0, | |
| minWidth: 0, | |
| resizeFrom: "parent", | |
| scrolling: false, | |
| sizeHeight: true, | |
| sizeWidth: false, | |
| tolerance: 0, | |
| closedCallback: function() {}, | |
| initCallback: function() {}, | |
| messageCallback: function() {}, | |
| resizedCallback: function() {}, | |
| scrollCallback: function() { | |
| return true | |
| } | |
| }; | |
| function n(a, b, c) { | |
| if ("addEventListener" in window) { | |
| a.addEventListener(b, c, false) | |
| } else if ("attachEvent" in window) { | |
| a.attachEvent("on" + b, c) | |
| } | |
| } | |
| function o() { | |
| var a = ["moz", "webkit", "o", "ms"], | |
| b; | |
| for (b = 0; b < a.length && !i; b += 1) { | |
| i = window[a[b] + "RequestAnimationFrame"] | |
| } | |
| if (!i) { | |
| r(" RequestAnimationFrame not supported") | |
| } | |
| } | |
| function p() { | |
| var a = "Host page"; | |
| if (window.top !== window.self) { | |
| if (window.parentIFrame) { | |
| a = window.parentIFrame.getId() | |
| } else { | |
| a = "Nested host page" | |
| } | |
| } | |
| return a | |
| } | |
| function q(a) { | |
| return f + "[" + p() + "]" + a | |
| } | |
| function r(a) { | |
| if (c && "object" === typeof window.console) { | |
| console.log(q(a)) | |
| } | |
| } | |
| function s(a) { | |
| if ("object" === typeof window.console) { | |
| console.warn(q(a)) | |
| } | |
| } | |
| function t(a) { | |
| function d() { | |
| function a() { | |
| x(F); | |
| v(); | |
| k[G].resizedCallback(F) | |
| } | |
| l("Height"); | |
| l("Width"); | |
| y(a, F, "resetPage") | |
| } | |
| function i(a) { | |
| var b = a.id; | |
| r(" Removing iFrame: " + b); | |
| a.parentNode.removeChild(a); | |
| k[b].closedCallback(b); | |
| delete k[b]; | |
| r(" --") | |
| } | |
| function j() { | |
| var a = E.substr(g).split(":"); | |
| return { | |
| iframe: document.getElementById(a[0]), | |
| id: a[0], | |
| height: a[1], | |
| width: a[2], | |
| type: a[3] | |
| } | |
| } | |
| function l(a) { | |
| var b = Number(k[G]["max" + a]), | |
| c = Number(k[G]["min" + a]), | |
| d = a.toLowerCase(), | |
| e = Number(F[d]); | |
| if (c > b) { | |
| throw new Error("Value for min" + a + " can not be greater than max" + a) | |
| } | |
| r(" Checking " + d + " is in range " + c + "-" + b); | |
| if (e < c) { | |
| e = c; | |
| r(" Set " + d + " to min value") | |
| } | |
| if (e > b) { | |
| e = b; | |
| r(" Set " + d + " to max value") | |
| } | |
| F[d] = "" + e | |
| } | |
| function m() { | |
| var b = a.origin, | |
| c = F.iframe.src.split("/").slice(0, 3).join("/"); | |
| if (k[G].checkOrigin) { | |
| r(" Checking connection is from: " + c); | |
| if ("" + b !== "null" && b !== c) { | |
| throw new Error("Unexpected message received from: " + b + " for " + F.iframe.id + ". Message was: " + a.data + ". This error can be disabled by adding the checkOrigin: false option.") | |
| } | |
| } | |
| return true | |
| } | |
| function n() { | |
| return f === ("" + E).substr(0, g) | |
| } | |
| function o() { | |
| var a = F.type in { | |
| true: 1, | |
| false: 1 | |
| }; | |
| if (a) { | |
| r(" Ignoring init message from meta parent page") | |
| } | |
| return a | |
| } | |
| function p(a) { | |
| return E.substr(E.indexOf(":") + e + a) | |
| } | |
| function q(a) { | |
| r(" MessageCallback passed: {iframe: " + F.iframe.id + ", message: " + a + "}"); | |
| k[G].messageCallback({ | |
| iframe: F.iframe, | |
| message: JSON.parse(a) | |
| }); | |
| r(" --") | |
| } | |
| function t() { | |
| if (null === F.iframe) { | |
| s(" IFrame (" + F.id + ") not found"); | |
| return false | |
| } | |
| return true | |
| } | |
| function z(a) { | |
| var b = a.getBoundingClientRect(); | |
| u(); | |
| return { | |
| x: parseInt(b.left, 10) + parseInt(h.x, 10), | |
| y: parseInt(b.top, 10) + parseInt(h.y, 10) | |
| } | |
| } | |
| function A(a) { | |
| function b() { | |
| h = e; | |
| B(); | |
| r(" --") | |
| } | |
| function c() { | |
| return { | |
| x: Number(F.width) + d.x, | |
| y: Number(F.height) + d.y | |
| } | |
| } | |
| var d = a ? z(F.iframe) : { | |
| x: 0, | |
| y: 0 | |
| }, | |
| e = c(); | |
| r(" Reposition requested from iFrame (offset x:" + d.x + " y:" + d.y + ")"); | |
| if (window.top !== window.self) { | |
| if (window.parentIFrame) { | |
| if (a) { | |
| parentIFrame.scrollToOffset(e.x, e.y) | |
| } else { | |
| parentIFrame.scrollTo(F.width, F.height) | |
| } | |
| } else { | |
| s(" Unable to scroll to requested position, window.parentIFrame not found") | |
| } | |
| } else { | |
| b() | |
| } | |
| } | |
| function B() { | |
| if (false !== k[G].scrollCallback(h)) { | |
| v() | |
| } | |
| } | |
| function C(a) { | |
| var b = a.split("#")[1] || ""; | |
| var c = decodeURIComponent(b); | |
| function d(a) { | |
| var c = z(a); | |
| r(" Moving to in page link (#" + b + ") at x: " + c.x + " y: " + c.y); | |
| h = { | |
| x: c.x, | |
| y: c.y | |
| }; | |
| B(); | |
| r(" --") | |
| } | |
| var e = document.getElementById(c) || document.getElementsByName(c)[0]; | |
| if (window.top !== window.self) { | |
| if (window.parentIFrame) { | |
| parentIFrame.moveToAnchor(b) | |
| } else { | |
| r(" In page link #" + b + " not found and window.parentIFrame not found") | |
| } | |
| } else if (e) { | |
| d(e) | |
| } else { | |
| r(" In page link #" + b + " not found") | |
| } | |
| } | |
| function D() { | |
| switch (F.type) { | |
| case "close": | |
| i(F.iframe); | |
| break; | |
| case "message": | |
| q(p(6)); | |
| break; | |
| case "scrollTo": | |
| A(false); | |
| break; | |
| case "scrollToOffset": | |
| A(true); | |
| break; | |
| case "inPageLink": | |
| C(p(9)); | |
| break; | |
| case "reset": | |
| w(F); | |
| break; | |
| case "init": | |
| d(); | |
| k[G].initCallback(F.iframe); | |
| break; | |
| default: | |
| d() | |
| } | |
| } | |
| var E = a.data, | |
| F = {}, | |
| G = null; | |
| if (n()) { | |
| F = j(); | |
| G = F.id; | |
| c = k[G].log; | |
| r(" Received: " + E); | |
| if (!o() && t() && m()) { | |
| D(); | |
| b = false | |
| } | |
| } | |
| } | |
| function u() { | |
| if (null === h) { | |
| h = { | |
| x: window.pageXOffset !== undefined ? window.pageXOffset : document.documentElement.scrollLeft, | |
| y: window.pageYOffset !== undefined ? window.pageYOffset : document.documentElement.scrollTop | |
| }; | |
| r(" Get page position: " + h.x + "," + h.y) | |
| } | |
| } | |
| function v() { | |
| if (null !== h) { | |
| window.scrollTo(h.x, h.y); | |
| r(" Set page position: " + h.x + "," + h.y); | |
| h = null | |
| } | |
| } | |
| function w(a) { | |
| function b() { | |
| x(a); | |
| z("reset", "reset", a.iframe, a.id) | |
| } | |
| r(" Size reset requested by " + ("init" === a.type ? "host page" : "iFrame")); | |
| u(); | |
| y(b, a, "init") | |
| } | |
| function x(a) { | |
| function b(b) { | |
| a.iframe.style[b] = a[b] + "px"; | |
| r(" IFrame (" + c + ") " + b + " set to " + a[b] + "px") | |
| } | |
| var c = a.iframe.id; | |
| if (k[c].sizeHeight) { | |
| b("height") | |
| } | |
| if (k[c].sizeWidth) { | |
| b("width") | |
| } | |
| } | |
| function y(a, b, c) { | |
| if (c !== b.type && i) { | |
| r(" Requesting animation frame"); | |
| i(a) | |
| } else { | |
| a() | |
| } | |
| } | |
| function z(a, b, c, d) { | |
| if (c && c.contentWindow) { | |
| r("[" + a + "] Sending msg to iframe (" + b + ")"); | |
| c.contentWindow.postMessage(f + b, "*") | |
| } else { | |
| s("[" + a + "] IFrame not found"); | |
| if (k[d]) delete k[d] | |
| } | |
| } | |
| function A(d) { | |
| function e() { | |
| function a(a) { | |
| if (Infinity !== k[s][a] && 0 !== k[s][a]) { | |
| q.style[a] = k[s][a] + "px"; | |
| r(" Set " + a + " = " + k[s][a] + "px") | |
| } | |
| } | |
| a("maxHeight"); | |
| a("minHeight"); | |
| a("maxWidth"); | |
| a("minWidth") | |
| } | |
| function f(b) { | |
| if ("" === b) { | |
| q.id = b = "iFrameResizer" + a++; | |
| c = (d || {}).log; | |
| r(" Added missing iframe ID: " + b + " (" + q.src + ")") | |
| } | |
| return b | |
| } | |
| function g() { | |
| r(" IFrame scrolling " + (k[s].scrolling ? "enabled" : "disabled") + " for " + s); | |
| q.style.overflow = false === k[s].scrolling ? "hidden" : "auto"; | |
| q.scrolling = false === k[s].scrolling ? "no" : "yes" | |
| } | |
| function h() { | |
| if ("number" === typeof k[s].bodyMargin || "0" === k[s].bodyMargin) { | |
| k[s].bodyMarginV1 = k[s].bodyMargin; | |
| k[s].bodyMargin = "" + k[s].bodyMargin + "px" | |
| } | |
| } | |
| function i() { | |
| return s + ":" + k[s].bodyMarginV1 + ":" + k[s].sizeWidth + ":" + k[s].log + ":" + k[s].interval + ":" + k[s].enablePublicMethods + ":" + k[s].autoResize + ":" + k[s].bodyMargin + ":" + k[s].heightCalculationMethod + ":" + k[s].bodyBackground + ":" + k[s].bodyPadding + ":" + k[s].tolerance + ":" + k[s].enableInPageLinks + ":" + k[s].resizeFrom | |
| } | |
| function l(a) { | |
| n(q, "load", function() { | |
| var c = b; | |
| z("iFrame.onload", a, q); | |
| if (!c && k[s].heightCalculationMethod in j) { | |
| w({ | |
| iframe: q, | |
| height: 0, | |
| width: 0, | |
| type: "init" | |
| }) | |
| } | |
| }); | |
| z("init", a, q) | |
| } | |
| function o(a) { | |
| if ("object" !== typeof a) { | |
| throw new TypeError("Options is not an object.") | |
| } | |
| } | |
| function p(a) { | |
| a = a || {}; | |
| k[s] = {}; | |
| o(a); | |
| for (var b in m) { | |
| if (m.hasOwnProperty(b)) { | |
| k[s][b] = a.hasOwnProperty(b) ? a[b] : m[b] | |
| } | |
| } | |
| c = k[s].log | |
| } | |
| var q = this, | |
| s = f(q.id); | |
| p(d); | |
| g(); | |
| e(); | |
| h(); | |
| l(i()) | |
| } | |
| function B(a, b) { | |
| if (null === l) { | |
| l = setTimeout(function() { | |
| l = null; | |
| a() | |
| }, b) | |
| } | |
| } | |
| function C() { | |
| B(function() { | |
| for (var a in k) { | |
| if ("parent" === k[a].resizeFrom) { | |
| z("Window resize", "resize", document.getElementById(a), a) | |
| } | |
| } | |
| }, 66) | |
| } | |
| function D() { | |
| function a(a, b) { | |
| if (!a.tagName) { | |
| throw new TypeError("Object is not a valid DOM element") | |
| } else if ("IFRAME" !== a.tagName.toUpperCase()) { | |
| throw new TypeError("Expected <IFRAME> tag, found <" + a.tagName + ">.") | |
| } else { | |
| A.call(a, b) | |
| } | |
| } | |
| return function b(c, d) { | |
| switch (typeof d) { | |
| case "undefined": | |
| case "string": | |
| Array.prototype.forEach.call(document.querySelectorAll(d || "iframe"), function(b) { | |
| a(b, c) | |
| }); | |
| break; | |
| case "object": | |
| a(d, c); | |
| break; | |
| default: | |
| throw new TypeError("Unexpected data type (" + typeof d + ").") | |
| } | |
| } | |
| } | |
| function E(a) { | |
| a.fn.iFrameResize = function a(b) { | |
| return this.filter("iframe").each(function(a, c) { | |
| A.call(c, b) | |
| }).end() | |
| } | |
| } | |
| o(); | |
| n(window, "message", t); | |
| n(window, "resize", C); | |
| if (window.jQuery) { | |
| E(jQuery) | |
| } | |
| if (typeof define === "function" && define.amd) { | |
| define([], D) | |
| } else if (typeof module === "object" && typeof module.exports === "object") { | |
| module.exports = D() | |
| } else { | |
| window.iFrameResize = D() | |
| } | |
| })(); | |
| (function(a) { | |
| if (typeof define === "function" && define.amd) { | |
| define(["jquery"], a) | |
| } else if (typeof exports === "object") { | |
| a(require("jquery")) | |
| } else { | |
| a(window.jQuery || window.Zepto) | |
| } | |
| })(function(a) { | |
| var b = "Close", | |
| c = "BeforeClose", | |
| d = "AfterClose", | |
| e = "BeforeAppend", | |
| f = "MarkupParse", | |
| g = "Open", | |
| h = "Change", | |
| i = "mfp", | |
| j = "." + i, | |
| k = "mfp-ready", | |
| l = "mfp-removing", | |
| m = "mfp-prevent-close"; | |
| var n, o = function() {}, | |
| p = !!window.jQuery, | |
| q, r = a(window), | |
| s, t, u, v; | |
| var w = function(a, b) { | |
| n.ev.on(i + a + j, b) | |
| }, | |
| x = function(b, c, d, e) { | |
| var f = document.createElement("div"); | |
| f.className = "mfp-" + b; | |
| if (d) { | |
| f.innerHTML = d | |
| } | |
| if (!e) { | |
| f = a(f); | |
| if (c) { | |
| f.appendTo(c) | |
| } | |
| } else if (c) { | |
| c.appendChild(f) | |
| } | |
| return f | |
| }, | |
| y = function(b, c) { | |
| n.ev.triggerHandler(i + b, c); | |
| if (n.st.callbacks) { | |
| b = b.charAt(0).toLowerCase() + b.slice(1); | |
| if (n.st.callbacks[b]) { | |
| n.st.callbacks[b].apply(n, a.isArray(c) ? c : [c]) | |
| } | |
| } | |
| }, | |
| z = function(b) { | |
| if (b !== v || !n.currTemplate.closeBtn) { | |
| n.currTemplate.closeBtn = a(n.st.closeMarkup.replace("%title%", n.st.tClose)); | |
| v = b | |
| } | |
| return n.currTemplate.closeBtn | |
| }, | |
| A = function() { | |
| if (!a.magnificPopup.instance) { | |
| n = new o; | |
| n.init(); | |
| a.magnificPopup.instance = n | |
| } | |
| }, | |
| B = function() { | |
| var a = document.createElement("p").style, | |
| b = ["ms", "O", "Moz", "Webkit"]; | |
| if (a["transition"] !== undefined) { | |
| return true | |
| } | |
| while (b.length) { | |
| if (b.pop() + "Transition" in a) { | |
| return true | |
| } | |
| } | |
| return false | |
| }; | |
| o.prototype = { | |
| constructor: o, | |
| init: function() { | |
| var b = navigator.appVersion; | |
| n.isLowIE = n.isIE8 = document.all && !document.addEventListener; | |
| n.isAndroid = /android/gi.test(b); | |
| n.isIOS = /iphone|ipad|ipod/gi.test(b); | |
| n.supportsTransition = B(); | |
| n.probablyMobile = n.isAndroid || n.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent); | |
| s = a(document); | |
| n.popupsCache = {} | |
| }, | |
| open: function(b) { | |
| var c; | |
| if (b.isObj === false) { | |
| n.items = b.items.toArray(); | |
| n.index = 0; | |
| var d = b.items, | |
| e; | |
| for (c = 0; c < d.length; c++) { | |
| e = d[c]; | |
| if (e.parsed) { | |
| e = e.el[0] | |
| } | |
| if (e === b.el[0]) { | |
| n.index = c; | |
| break | |
| } | |
| } | |
| } else { | |
| n.items = a.isArray(b.items) ? b.items : [b.items]; | |
| n.index = b.index || 0 | |
| } | |
| if (n.isOpen) { | |
| n.updateItemHTML(); | |
| return | |
| } | |
| n.types = []; | |
| u = ""; | |
| if (b.mainEl && b.mainEl.length) { | |
| n.ev = b.mainEl.eq(0) | |
| } else { | |
| n.ev = s | |
| } | |
| if (b.key) { | |
| if (!n.popupsCache[b.key]) { | |
| n.popupsCache[b.key] = {} | |
| } | |
| n.currTemplate = n.popupsCache[b.key] | |
| } else { | |
| n.currTemplate = {} | |
| } | |
| n.st = a.extend(true, {}, a.magnificPopup.defaults, b); | |
| n.fixedContentPos = n.st.fixedContentPos === "auto" ? !n.probablyMobile : n.st.fixedContentPos; | |
| if (n.st.modal) { | |
| n.st.closeOnContentClick = false; | |
| n.st.closeOnBgClick = false; | |
| n.st.showCloseBtn = false; | |
| n.st.enableEscapeKey = false | |
| } | |
| if (!n.bgOverlay) { | |
| n.bgOverlay = x("bg").on("click" + j, function() { | |
| n.close() | |
| }); | |
| n.wrap = x("wrap").attr("tabindex", -1).on("click" + j, function(a) { | |
| if (n._checkIfClose(a.target)) { | |
| n.close() | |
| } | |
| }); | |
| n.container = x("container", n.wrap) | |
| } | |
| n.contentContainer = x("content"); | |
| if (n.st.preloader) { | |
| n.preloader = x("preloader", n.container, n.st.tLoading) | |
| } | |
| var h = a.magnificPopup.modules; | |
| for (c = 0; c < h.length; c++) { | |
| var i = h[c]; | |
| i = i.charAt(0).toUpperCase() + i.slice(1); | |
| n["init" + i].call(n) | |
| } | |
| y("BeforeOpen"); | |
| if (n.st.showCloseBtn) { | |
| if (!n.st.closeBtnInside) { | |
| n.wrap.append(z()) | |
| } else { | |
| w(f, function(a, b, c, d) { | |
| c.close_replaceWith = z(d.type) | |
| }); | |
| u += " mfp-close-btn-in" | |
| } | |
| } | |
| if (n.st.alignTop) { | |
| u += " mfp-align-top" | |
| } | |
| if (n.fixedContentPos) { | |
| n.wrap.css({ | |
| overflow: n.st.overflowY, | |
| overflowX: "hidden", | |
| overflowY: n.st.overflowY | |
| }) | |
| } else { | |
| n.wrap.css({ | |
| top: r.scrollTop(), | |
| position: "absolute" | |
| }) | |
| } | |
| if (n.st.fixedBgPos === false || n.st.fixedBgPos === "auto" && !n.fixedContentPos) { | |
| n.bgOverlay.css({ | |
| height: s.height(), | |
| position: "absolute" | |
| }) | |
| } | |
| if (n.st.enableEscapeKey) { | |
| s.on("keyup" + j, function(a) { | |
| if (a.keyCode === 27) { | |
| n.close() | |
| } | |
| }) | |
| } | |
| r.on("resize" + j, function() { | |
| n.updateSize() | |
| }); | |
| if (!n.st.closeOnContentClick) { | |
| u += " mfp-auto-cursor" | |
| } | |
| if (u) n.wrap.addClass(u); | |
| var l = n.wH = r.height(); | |
| var m = {}; | |
| if (n.fixedContentPos) { | |
| if (n._hasScrollBar(l)) { | |
| var o = n._getScrollbarSize(); | |
| if (o) { | |
| m.marginRight = o | |
| } | |
| } | |
| } | |
| if (n.fixedContentPos) { | |
| if (!n.isIE7) { | |
| m.overflow = "hidden" | |
| } else { | |
| a("body, html").css("overflow", "hidden") | |
| } | |
| } | |
| var p = n.st.mainClass; | |
| if (n.isIE7) { | |
| p += " mfp-ie7" | |
| } | |
| if (p) { | |
| n._addClassToMFP(p) | |
| } | |
| n.updateItemHTML(); | |
| y("BuildControls"); | |
| a("html").css(m); | |
| n.bgOverlay.add(n.wrap).prependTo(n.st.prependTo || a(document.body)); | |
| n._lastFocusedEl = document.activeElement; | |
| setTimeout(function() { | |
| if (n.content) { | |
| n._addClassToMFP(k); | |
| n._setFocus() | |
| } else { | |
| n.bgOverlay.addClass(k) | |
| } | |
| s.on("focusin" + j, n._onFocusIn) | |
| }, 16); | |
| n.isOpen = true; | |
| n.updateSize(l); | |
| y(g); | |
| return b | |
| }, | |
| close: function() { | |
| if (!n.isOpen) return; | |
| y(c); | |
| n.isOpen = false; | |
| if (n.st.removalDelay && !n.isLowIE && n.supportsTransition) { | |
| n._addClassToMFP(l); | |
| setTimeout(function() { | |
| n._close() | |
| }, n.st.removalDelay) | |
| } else { | |
| n._close() | |
| } | |
| }, | |
| _close: function() { | |
| y(b); | |
| var c = l + " " + k + " "; | |
| n.bgOverlay.detach(); | |
| n.wrap.detach(); | |
| n.container.empty(); | |
| if (n.st.mainClass) { | |
| c += n.st.mainClass + " " | |
| } | |
| n._removeClassFromMFP(c); | |
| if (n.fixedContentPos) { | |
| var e = { | |
| marginRight: "" | |
| }; | |
| if (n.isIE7) { | |
| a("body, html").css("overflow", "") | |
| } else { | |
| e.overflow = "" | |
| } | |
| a("html").css(e) | |
| } | |
| s.off("keyup" + j + " focusin" + j); | |
| n.ev.off(j); | |
| n.wrap.attr("class", "mfp-wrap").removeAttr("style"); | |
| n.bgOverlay.attr("class", "mfp-bg"); | |
| n.container.attr("class", "mfp-container"); | |
| if (n.st.showCloseBtn && (!n.st.closeBtnInside || n.currTemplate[n.currItem.type] === true)) { | |
| if (n.currTemplate.closeBtn) n.currTemplate.closeBtn.detach() | |
| } | |
| if (n.st.autoFocusLast && n._lastFocusedEl) { | |
| a(n._lastFocusedEl).focus() | |
| } | |
| n.currItem = null; | |
| n.content = null; | |
| n.currTemplate = null; | |
| n.prevHeight = 0; | |
| y(d) | |
| }, | |
| updateSize: function(a) { | |
| if (n.isIOS) { | |
| var b = document.documentElement.clientWidth / window.innerWidth; | |
| var c = window.innerHeight * b; | |
| n.wrap.css("height", c); | |
| n.wH = c | |
| } else { | |
| n.wH = a || r.height() | |
| } | |
| if (!n.fixedContentPos) { | |
| n.wrap.css("height", n.wH) | |
| } | |
| y("Resize") | |
| }, | |
| updateItemHTML: function() { | |
| var b = n.items[n.index]; | |
| n.contentContainer.detach(); | |
| if (n.content) n.content.detach(); | |
| if (!b.parsed) { | |
| b = n.parseEl(n.index) | |
| } | |
| var c = b.type; | |
| y("BeforeChange", [n.currItem ? n.currItem.type : "", c]); | |
| n.currItem = b; | |
| if (!n.currTemplate[c]) { | |
| var d = n.st[c] ? n.st[c].markup : false; | |
| y("FirstMarkupParse", d); | |
| if (d) { | |
| n.currTemplate[c] = a(d) | |
| } else { | |
| n.currTemplate[c] = true | |
| } | |
| } | |
| if (t && t !== b.type) { | |
| n.container.removeClass("mfp-" + t + "-holder") | |
| } | |
| var e = n["get" + c.charAt(0).toUpperCase() + c.slice(1)](b, n.currTemplate[c]); | |
| n.appendContent(e, c); | |
| b.preloaded = true; | |
| y(h, b); | |
| t = b.type; | |
| n.container.prepend(n.contentContainer); | |
| y("AfterChange", b) | |
| }, | |
| appendContent: function(a, b) { | |
| n.content = a; | |
| if (a) { | |
| if (n.st.showCloseBtn && n.st.closeBtnInside && n.currTemplate[b] === true) { | |
| if (!n.content.find(".mfp-close").length) { | |
| n.content.append(z()) | |
| } | |
| } else { | |
| n.content = a | |
| } | |
| } else { | |
| n.content = "" | |
| } | |
| y(e); | |
| n.container.addClass("mfp-" + b + "-holder"); | |
| n.contentContainer.append(n.content) | |
| }, | |
| parseEl: function(b) { | |
| var c = n.items[b], | |
| d; | |
| if (c.tagName) { | |
| c = { | |
| el: a(c) | |
| } | |
| } else { | |
| d = c.type; | |
| c = { | |
| data: c, | |
| src: c.src | |
| } | |
| } | |
| if (c.el) { | |
| var e = n.types; | |
| for (var f = 0; f < e.length; f++) { | |
| if (c.el.hasClass("mfp-" + e[f])) { | |
| d = e[f]; | |
| break | |
| } | |
| } | |
| c.src = c.el.attr("data-mfp-src"); | |
| if (!c.src) { | |
| c.src = c.el.attr("href") | |
| } | |
| } | |
| c.type = d || n.st.type || "inline"; | |
| c.index = b; | |
| c.parsed = true; | |
| n.items[b] = c; | |
| y("ElementParse", c); | |
| return n.items[b] | |
| }, | |
| addGroup: function(a, b) { | |
| var c = function(c) { | |
| c.mfpEl = this; | |
| n._openClick(c, a, b) | |
| }; | |
| if (!b) { | |
| b = {} | |
| } | |
| var d = "click.magnificPopup"; | |
| b.mainEl = a; | |
| if (b.items) { | |
| b.isObj = true; | |
| a.off(d).on(d, c) | |
| } else { | |
| b.isObj = false; | |
| if (b.delegate) { | |
| a.off(d).on(d, b.delegate, c) | |
| } else { | |
| b.items = a; | |
| a.off(d).on(d, c) | |
| } | |
| } | |
| }, | |
| _openClick: function(b, c, d) { | |
| var e = d.midClick !== undefined ? d.midClick : a.magnificPopup.defaults.midClick; | |
| if (!e && (b.which === 2 || b.ctrlKey || b.metaKey || b.altKey || b.shiftKey)) { | |
| return | |
| } | |
| var f = d.disableOn !== undefined ? d.disableOn : a.magnificPopup.defaults.disableOn; | |
| if (f) { | |
| if (a.isFunction(f)) { | |
| if (!f.call(n)) { | |
| return true | |
| } | |
| } else { | |
| if (r.width() < f) { | |
| return true | |
| } | |
| } | |
| } | |
| if (b.type) { | |
| b.preventDefault(); | |
| if (n.isOpen) { | |
| b.stopPropagation() | |
| } | |
| } | |
| d.el = a(b.mfpEl); | |
| if (d.delegate) { | |
| d.items = c.find(d.delegate) | |
| } | |
| n.open(d) | |
| }, | |
| updateStatus: function(a, b) { | |
| if (n.preloader) { | |
| if (q !== a) { | |
| n.container.removeClass("mfp-s-" + q) | |
| } | |
| if (!b && a === "loading") { | |
| b = n.st.tLoading | |
| } | |
| var c = { | |
| status: a, | |
| text: b | |
| }; | |
| y("UpdateStatus", c); | |
| a = c.status; | |
| b = c.text; | |
| n.preloader.html(b); | |
| n.preloader.find("a").on("click", function(a) { | |
| a.stopImmediatePropagation() | |
| }); | |
| n.container.addClass("mfp-s-" + a); | |
| q = a | |
| } | |
| }, | |
| _checkIfClose: function(b) { | |
| if (a(b).hasClass(m)) { | |
| return | |
| } | |
| var c = n.st.closeOnContentClick; | |
| var d = n.st.closeOnBgClick; | |
| if (c && d) { | |
| return true | |
| } else { | |
| if (!n.content || a(b).hasClass("mfp-close") || n.preloader && b === n.preloader[0]) { | |
| return true | |
| } | |
| if (b !== n.content[0] && !a.contains(n.content[0], b)) { | |
| if (d) { | |
| if (a.contains(document, b)) { | |
| return true | |
| } | |
| } | |
| } else if (c) { | |
| return true | |
| } | |
| } | |
| return false | |
| }, | |
| _addClassToMFP: function(a) { | |
| n.bgOverlay.addClass(a); | |
| n.wrap.addClass(a) | |
| }, | |
| _removeClassFromMFP: function(a) { | |
| this.bgOverlay.removeClass(a); | |
| n.wrap.removeClass(a) | |
| }, | |
| _hasScrollBar: function(a) { | |
| return (n.isIE7 ? s.height() : document.body.scrollHeight) > (a || r.height()) | |
| }, | |
| _setFocus: function() { | |
| (n.st.focus ? n.content.find(n.st.focus).eq(0) : n.wrap).focus() | |
| }, | |
| _onFocusIn: function(b) { | |
| if (b.target !== n.wrap[0] && !a.contains(n.wrap[0], b.target)) { | |
| n._setFocus(); | |
| return false | |
| } | |
| }, | |
| _parseMarkup: function(b, c, d) { | |
| var e; | |
| if (d.data) { | |
| c = a.extend(d.data, c) | |
| } | |
| y(f, [b, c, d]); | |
| a.each(c, function(c, d) { | |
| if (d === undefined || d === false) { | |
| return true | |
| } | |
| e = c.split("_"); | |
| if (e.length > 1) { | |
| var f = b.find(j + "-" + e[0]); | |
| if (f.length > 0) { | |
| var g = e[1]; | |
| if (g === "replaceWith") { | |
| if (f[0] !== d[0]) { | |
| f.replaceWith(d) | |
| } | |
| } else if (g === "img") { | |
| if (f.is("img")) { | |
| f.attr("src", d) | |
| } else { | |
| f.replaceWith(a("<img>").attr("src", d).attr("class", f.attr("class"))) | |
| } | |
| } else { | |
| f.attr(e[1], d) | |
| } | |
| } | |
| } else { | |
| b.find(j + "-" + c).html(d) | |
| } | |
| }) | |
| }, | |
| _getScrollbarSize: function() { | |
| if (n.scrollbarSize === undefined) { | |
| var a = document.createElement("div"); | |
| a.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;"; | |
| document.body.appendChild(a); | |
| n.scrollbarSize = a.offsetWidth - a.clientWidth; | |
| document.body.removeChild(a) | |
| } | |
| return n.scrollbarSize | |
| } | |
| }; | |
| a.magnificPopup = { | |
| instance: null, | |
| proto: o.prototype, | |
| modules: [], | |
| open: function(b, c) { | |
| A(); | |
| if (!b) { | |
| b = {} | |
| } else { | |
| b = a.extend(true, {}, b) | |
| } | |
| b.isObj = true; | |
| b.index = c || 0; | |
| return this.instance.open(b) | |
| }, | |
| close: function() { | |
| return a.magnificPopup.instance && a.magnificPopup.instance.close() | |
| }, | |
| registerModule: function(b, c) { | |
| if (c.options) { | |
| a.magnificPopup.defaults[b] = c.options | |
| } | |
| a.extend(this.proto, c.proto); | |
| this.modules.push(b) | |
| }, | |
| defaults: { | |
| disableOn: 0, | |
| key: null, | |
| midClick: false, | |
| mainClass: "", | |
| preloader: true, | |
| focus: "", | |
| closeOnContentClick: false, | |
| closeOnBgClick: true, | |
| closeBtnInside: true, | |
| showCloseBtn: true, | |
| enableEscapeKey: true, | |
| modal: false, | |
| alignTop: false, | |
| removalDelay: 0, | |
| prependTo: null, | |
| fixedContentPos: "auto", | |
| fixedBgPos: "auto", | |
| overflowY: "auto", | |
| closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>', | |
| tClose: "Close (Esc)", | |
| tLoading: "Loading...", | |
| autoFocusLast: true | |
| } | |
| }; | |
| a.fn.magnificPopup = function(b) { | |
| A(); | |
| var c = a(this); | |
| if (typeof b === "string") { | |
| if (b === "open") { | |
| var d, e = p ? c.data("magnificPopup") : c[0].magnificPopup, | |
| f = parseInt(arguments[1], 10) || 0; | |
| if (e.items) { | |
| d = e.items[f] | |
| } else { | |
| d = c; | |
| if (e.delegate) { | |
| d = d.find(e.delegate) | |
| } | |
| d = d.eq(f) | |
| } | |
| n._openClick({ | |
| mfpEl: d | |
| }, c, e) | |
| } else { | |
| if (n.isOpen) n[b].apply(n, Array.prototype.slice.call(arguments, 1)) | |
| } | |
| } else { | |
| b = a.extend(true, {}, b); | |
| if (p) { | |
| c.data("magnificPopup", b) | |
| } else { | |
| c[0].magnificPopup = b | |
| } | |
| n.addGroup(c, b) | |
| } | |
| return c | |
| }; | |
| var C, D = function(b) { | |
| if (b.data && b.data.title !== undefined) return b.data.title; | |
| var c = n.st.image.titleSrc; | |
| if (c) { | |
| if (a.isFunction(c)) { | |
| return c.call(n, b) | |
| } else if (b.el) { | |
| return b.el.attr(c) || "" | |
| } | |
| } | |
| return "" | |
| }; | |
| a.magnificPopup.registerModule("image", { | |
| options: { | |
| markup: '<div class="mfp-figure">' + '<div class="mfp-close"></div>' + "<figure>" + '<div class="mfp-img"></div>' + "<figcaption>" + '<div class="mfp-bottom-bar">' + '<div class="mfp-title"></div>' + '<div class="mfp-counter"></div>' + "</div>" + "</figcaption>" + "</figure>" + "</div>", | |
| cursor: "mfp-zoom-out-cur", | |
| titleSrc: "title", | |
| verticalFit: true, | |
| tError: '<a href="%url%">The image</a> could not be loaded.' | |
| }, | |
| proto: { | |
| initImage: function() { | |
| var c = n.st.image, | |
| d = ".image"; | |
| n.types.push("image"); | |
| w(g + d, function() { | |
| if (n.currItem.type === "image" && c.cursor) { | |
| a(document.body).addClass(c.cursor) | |
| } | |
| }); | |
| w(b + d, function() { | |
| if (c.cursor) { | |
| a(document.body).removeClass(c.cursor) | |
| } | |
| r.off("resize" + j) | |
| }); | |
| w("Resize" + d, n.resizeImage); | |
| if (n.isLowIE) { | |
| w("AfterChange", n.resizeImage) | |
| } | |
| }, | |
| resizeImage: function() { | |
| var a = n.currItem; | |
| if (!a || !a.img) return; | |
| if (n.st.image.verticalFit) { | |
| var b = 0; | |
| if (n.isLowIE) { | |
| b = parseInt(a.img.css("padding-top"), 10) + parseInt(a.img.css("padding-bottom"), 10) | |
| } | |
| a.img.css("max-height", n.wH - b) | |
| } | |
| }, | |
| _onImageHasSize: function(a) { | |
| if (a.img) { | |
| a.hasSize = true; | |
| if (C) { | |
| clearInterval(C) | |
| } | |
| a.isCheckingImgSize = false; | |
| y("ImageHasSize", a); | |
| if (a.imgHidden) { | |
| if (n.content) n.content.removeClass("mfp-loading"); | |
| a.imgHidden = false | |
| } | |
| } | |
| }, | |
| findImageSize: function(a) { | |
| var b = 0, | |
| c = a.img[0], | |
| d = function(e) { | |
| if (C) { | |
| clearInterval(C) | |
| } | |
| C = setInterval(function() { | |
| if (c.naturalWidth > 0) { | |
| n._onImageHasSize(a); | |
| return | |
| } | |
| if (b > 200) { | |
| clearInterval(C) | |
| } | |
| b++; | |
| if (b === 3) { | |
| d(10) | |
| } else if (b === 40) { | |
| d(50) | |
| } else if (b === 100) { | |
| d(500) | |
| } | |
| }, e) | |
| }; | |
| d(1) | |
| }, | |
| getImage: function(b, c) { | |
| var d = 0, | |
| e = function() { | |
| if (b) { | |
| if (b.img[0].complete) { | |
| b.img.off(".mfploader"); | |
| if (b === n.currItem) { | |
| n._onImageHasSize(b); | |
| n.updateStatus("ready") | |
| } | |
| b.hasSize = true; | |
| b.loaded = true; | |
| y("ImageLoadComplete") | |
| } else { | |
| d++; | |
| if (d < 200) { | |
| setTimeout(e, 100) | |
| } else { | |
| f() | |
| } | |
| } | |
| } | |
| }, | |
| f = function() { | |
| if (b) { | |
| b.img.off(".mfploader"); | |
| if (b === n.currItem) { | |
| n._onImageHasSize(b); | |
| n.updateStatus("error", g.tError.replace("%url%", b.src)) | |
| } | |
| b.hasSize = true; | |
| b.loaded = true; | |
| b.loadError = true | |
| } | |
| }, | |
| g = n.st.image; | |
| var h = c.find(".mfp-img"); | |
| if (h.length) { | |
| var i = document.createElement("img"); | |
| i.className = "mfp-img"; | |
| if (b.el && b.el.find("img").length) { | |
| i.alt = b.el.find("img").attr("alt") | |
| } | |
| b.img = a(i).on("load.mfploader", e).on("error.mfploader", f); | |
| i.src = b.src; | |
| if (h.is("img")) { | |
| b.img = b.img.clone() | |
| } | |
| i = b.img[0]; | |
| if (i.naturalWidth > 0) { | |
| b.hasSize = true | |
| } else if (!i.width) { | |
| b.hasSize = false | |
| } | |
| } | |
| n._parseMarkup(c, { | |
| title: D(b), | |
| img_replaceWith: b.img | |
| }, b); | |
| n.resizeImage(); | |
| if (b.hasSize) { | |
| if (C) clearInterval(C); | |
| if (b.loadError) { | |
| c.addClass("mfp-loading"); | |
| n.updateStatus("error", g.tError.replace("%url%", b.src)) | |
| } else { | |
| c.removeClass("mfp-loading"); | |
| n.updateStatus("ready") | |
| } | |
| return c | |
| } | |
| n.updateStatus("loading"); | |
| b.loading = true; | |
| if (!b.hasSize) { | |
| b.imgHidden = true; | |
| c.addClass("mfp-loading"); | |
| n.findImageSize(b) | |
| } | |
| return c | |
| } | |
| } | |
| }); | |
| var E, F = function() { | |
| if (E === undefined) { | |
| E = document.createElement("p").style.MozTransform !== undefined | |
| } | |
| return E | |
| }; | |
| a.magnificPopup.registerModule("zoom", { | |
| options: { | |
| enabled: false, | |
| easing: "ease-in-out", | |
| duration: 300, | |
| opener: function(a) { | |
| return a.is("img") ? a : a.find("img") | |
| } | |
| }, | |
| proto: { | |
| initZoom: function() { | |
| var a = n.st.zoom, | |
| d = ".zoom", | |
| e; | |
| if (!a.enabled || !n.supportsTransition) { | |
| return | |
| } | |
| var f = a.duration, | |
| g = function(b) { | |
| var c = b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"), | |
| d = "all " + a.duration / 1e3 + "s " + a.easing, | |
| e = { | |
| position: "fixed", | |
| zIndex: 9999, | |
| left: 0, | |
| top: 0, | |
| "-webkit-backface-visibility": "hidden" | |
| }, | |
| f = "transition"; | |
| e["-webkit-" + f] = e["-moz-" + f] = e["-o-" + f] = e[f] = d; | |
| c.css(e); | |
| return c | |
| }, | |
| h = function() { | |
| n.content.css("visibility", "visible") | |
| }, | |
| i, j; | |
| w("BuildControls" + d, function() { | |
| if (n._allowZoom()) { | |
| clearTimeout(i); | |
| n.content.css("visibility", "hidden"); | |
| e = n._getItemToZoom(); | |
| if (!e) { | |
| h(); | |
| return | |
| } | |
| j = g(e); | |
| j.css(n._getOffset()); | |
| n.wrap.append(j); | |
| i = setTimeout(function() { | |
| j.css(n._getOffset(true)); | |
| i = setTimeout(function() { | |
| h(); | |
| setTimeout(function() { | |
| j.remove(); | |
| e = j = null; | |
| y("ZoomAnimationEnded") | |
| }, 16) | |
| }, f) | |
| }, 16) | |
| } | |
| }); | |
| w(c + d, function() { | |
| if (n._allowZoom()) { | |
| clearTimeout(i); | |
| n.st.removalDelay = f; | |
| if (!e) { | |
| e = n._getItemToZoom(); | |
| if (!e) { | |
| return | |
| } | |
| j = g(e) | |
| } | |
| j.css(n._getOffset(true)); | |
| n.wrap.append(j); | |
| n.content.css("visibility", "hidden"); | |
| setTimeout(function() { | |
| j.css(n._getOffset()) | |
| }, 16) | |
| } | |
| }); | |
| w(b + d, function() { | |
| if (n._allowZoom()) { | |
| h(); | |
| if (j) { | |
| j.remove() | |
| } | |
| e = null | |
| } | |
| }) | |
| }, | |
| _allowZoom: function() { | |
| return n.currItem.type === "image" | |
| }, | |
| _getItemToZoom: function() { | |
| if (n.currItem.hasSize) { | |
| return n.currItem.img | |
| } else { | |
| return false | |
| } | |
| }, | |
| _getOffset: function(b) { | |
| var c; | |
| if (b) { | |
| c = n.currItem.img | |
| } else { | |
| c = n.st.zoom.opener(n.currItem.el || n.currItem) | |
| } | |
| var d = c.offset(); | |
| var e = parseInt(c.css("padding-top"), 10); | |
| var f = parseInt(c.css("padding-bottom"), 10); | |
| d.top -= a(window).scrollTop() - e; | |
| var g = { | |
| width: c.width(), | |
| height: (p ? c.innerHeight() : c[0].offsetHeight) - f - e | |
| }; | |
| if (F()) { | |
| g["-moz-transform"] = g["transform"] = "translate(" + d.left + "px," + d.top + "px)" | |
| } else { | |
| g.left = d.left; | |
| g.top = d.top | |
| } | |
| return g | |
| } | |
| } | |
| }); | |
| var G = function(a) { | |
| var b = n.items.length; | |
| if (a > b - 1) { | |
| return a - b | |
| } else if (a < 0) { | |
| return b + a | |
| } | |
| return a | |
| }, | |
| H = function(a, b, c) { | |
| return a.replace(/%curr%/gi, b + 1).replace(/%total%/gi, c) | |
| }; | |
| a.magnificPopup.registerModule("gallery", { | |
| options: { | |
| enabled: false, | |
| arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', | |
| preload: [0, 2], | |
| navigateByImgClick: true, | |
| arrows: true, | |
| tPrev: "Previous (Left arrow key)", | |
| tNext: "Next (Right arrow key)", | |
| tCounter: "%curr% of %total%" | |
| }, | |
| proto: { | |
| initGallery: function() { | |
| var c = n.st.gallery, | |
| d = ".mfp-gallery"; | |
| n.direction = true; | |
| if (!c || !c.enabled) return false; | |
| u += " mfp-gallery"; | |
| w(g + d, function() { | |
| if (c.navigateByImgClick) { | |
| n.wrap.on("click" + d, ".mfp-img", function() { | |
| if (n.items.length > 1) { | |
| n.next(); | |
| return false | |
| } | |
| }) | |
| } | |
| s.on("keydown" + d, function(a) { | |
| if (a.keyCode === 37) { | |
| n.prev() | |
| } else if (a.keyCode === 39) { | |
| n.next() | |
| } | |
| }) | |
| }); | |
| w("UpdateStatus" + d, function(a, b) { | |
| if (b.text) { | |
| b.text = H(b.text, n.currItem.index, n.items.length) | |
| } | |
| }); | |
| w(f + d, function(a, b, d, e) { | |
| var f = n.items.length; | |
| d.counter = f > 1 ? H(c.tCounter, e.index, f) : "" | |
| }); | |
| w("BuildControls" + d, function() { | |
| if (n.items.length > 1 && c.arrows && !n.arrowLeft) { | |
| var b = c.arrowMarkup, | |
| d = n.arrowLeft = a(b.replace(/%title%/gi, c.tPrev).replace(/%dir%/gi, "left")).addClass(m), | |
| e = n.arrowRight = a(b.replace(/%title%/gi, c.tNext).replace(/%dir%/gi, "right")).addClass(m); | |
| d.click(function() { | |
| n.prev() | |
| }); | |
| e.click(function() { | |
| n.next() | |
| }); | |
| n.container.append(d.add(e)) | |
| } | |
| }); | |
| w(h + d, function() { | |
| if (n._preloadTimeout) clearTimeout(n._preloadTimeout); | |
| n._preloadTimeout = setTimeout(function() { | |
| n.preloadNearbyImages(); | |
| n._preloadTimeout = null | |
| }, 16) | |
| }); | |
| w(b + d, function() { | |
| s.off(d); | |
| n.wrap.off("click" + d); | |
| n.arrowRight = n.arrowLeft = null | |
| }) | |
| }, | |
| next: function() { | |
| n.direction = true; | |
| n.index = G(n.index + 1); | |
| n.updateItemHTML() | |
| }, | |
| prev: function() { | |
| n.direction = false; | |
| n.index = G(n.index - 1); | |
| n.updateItemHTML() | |
| }, | |
| goTo: function(a) { | |
| n.direction = a >= n.index; | |
| n.index = a; | |
| n.updateItemHTML() | |
| }, | |
| preloadNearbyImages: function() { | |
| var a = n.st.gallery.preload, | |
| b = Math.min(a[0], n.items.length), | |
| c = Math.min(a[1], n.items.length), | |
| d; | |
| for (d = 1; d <= (n.direction ? c : b); d++) { | |
| n._preloadItem(n.index + d) | |
| } | |
| for (d = 1; d <= (n.direction ? b : c); d++) { | |
| n._preloadItem(n.index - d) | |
| } | |
| }, | |
| _preloadItem: function(b) { | |
| b = G(b); | |
| if (n.items[b].preloaded) { | |
| return | |
| } | |
| var c = n.items[b]; | |
| if (!c.parsed) { | |
| c = n.parseEl(b) | |
| } | |
| y("LazyLoad", c); | |
| if (c.type === "image") { | |
| c.img = a('<img class="mfp-img" />').on("load.mfploader", function() { | |
| c.hasSize = true | |
| }).on("error.mfploader", function() { | |
| c.hasSize = true; | |
| c.loadError = true; | |
| y("LazyLoadError", c) | |
| }).attr("src", c.src) | |
| } | |
| c.preloaded = true | |
| } | |
| } | |
| }); | |
| var I = "retina"; | |
| a.magnificPopup.registerModule(I, { | |
| options: { | |
| replaceSrc: function(a) { | |
| return a.src.replace(/\.\w+$/, function(a) { | |
| return "@2x" + a | |
| }) | |
| }, | |
| ratio: 1 | |
| }, | |
| proto: { | |
| initRetina: function() { | |
| if (window.devicePixelRatio > 1) { | |
| var a = n.st.retina, | |
| b = a.ratio; | |
| b = !isNaN(b) ? b : b(); | |
| if (b > 1) { | |
| w("ImageHasSize" + "." + I, function(a, c) { | |
| c.img.css({ | |
| "max-width": c.img[0].naturalWidth / b, | |
| width: "100%" | |
| }) | |
| }); | |
| w("ElementParse" + "." + I, function(c, d) { | |
| d.src = a.replaceSrc(d, b) | |
| }) | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| A() | |
| }); | |
| (function(a) { | |
| a.fn.autogrow = function(b) { | |
| var c = a(this).css({ | |
| overflow: "hidden", | |
| resize: "none" | |
| }), | |
| d = c.selector, | |
| e = { | |
| context: a(document), | |
| animate: true, | |
| speed: 200, | |
| fixMinHeight: true, | |
| cloneClass: "autogrowclone", | |
| onInitialize: false | |
| }; | |
| b = a.isPlainObject(b) ? b : { | |
| context: b ? b : a(document) | |
| }; | |
| b = a.extend({}, e, b); | |
| c.each(function(c, d) { | |
| var e, g; | |
| d = a(d); | |
| if (d.is(":visible") || parseInt(d.css("height"), 10) > 0) { | |
| e = parseInt(d.css("height"), 10) || d.innerHeight() | |
| } else { | |
| g = d.clone().addClass(b.cloneClass).val(d.val()).css({ | |
| position: "absolute", | |
| visibility: "hidden", | |
| display: "block" | |
| }); | |
| a("body").append(g); | |
| e = g.innerHeight(); | |
| g.remove() | |
| } | |
| if (b.fixMinHeight) { | |
| d.data("autogrow-start-height", e) | |
| } | |
| d.css("height", e); | |
| if (b.onInitialize && d.length) { | |
| f.call(d[0]) | |
| } | |
| }); | |
| a(window).on("resize", function(a) { | |
| c.each(function(b, c) { | |
| f.call(c, a) | |
| }) | |
| }); | |
| b.context.on("keydown paste", d, f); | |
| function f(c) { | |
| var d = a(this), | |
| e = d.innerHeight(), | |
| f = this.scrollHeight, | |
| i = d.data("autogrow-start-height") || 0, | |
| j; | |
| if (e < f) { | |
| this.scrollTop = 0; | |
| if (b.animate) { | |
| d.stop().animate({ | |
| height: f | |
| }, { | |
| duration: b.speed, | |
| complete: g | |
| }) | |
| } else { | |
| d.innerHeight(f); | |
| g() | |
| } | |
| } else if (!c || c.which == 8 || c.which == 46 || c.ctrlKey && c.which == 88 || c.type == "resize") { | |
| if (e > i) { | |
| j = d.clone().addClass(b.cloneClass).css({ | |
| position: "absolute", | |
| zIndex: -10, | |
| height: "" | |
| }).val(d.val()); | |
| d.after(j); | |
| do { | |
| f = j[0].scrollHeight - 1; | |
| j.innerHeight(f) | |
| } while (f === j[0].scrollHeight); | |
| f++; | |
| j.remove(); | |
| if (!a("input").is(":focus")) { | |
| d.focus() | |
| } | |
| f < i && (f = i); | |
| if (e > f) { | |
| if (b.animate) { | |
| d.stop().animate({ | |
| height: f | |
| }, { | |
| duration: b.speed, | |
| complete: h | |
| }) | |
| } else { | |
| d.innerHeight(f); | |
| h() | |
| } | |
| } | |
| } else { | |
| d.innerHeight(i) | |
| } | |
| } | |
| } | |
| function g() { | |
| b.context.trigger("autogrow:grow") | |
| } | |
| function h() { | |
| b.context.trigger("autogrow:shrink") | |
| } | |
| return c | |
| } | |
| })(jQuery); | |
| (function() { | |
| var a = 0; | |
| var b = ["ms", "moz", "webkit", "o"]; | |
| for (var c = 0; c < b.length && !window.requestAnimationFrame; ++c) { | |
| window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"]; | |
| window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"] | |
| } | |
| if (!window.requestAnimationFrame) window.requestAnimationFrame = function(b, c) { | |
| var d = (new Date).getTime(); | |
| var e = Math.max(0, 16 - (d - a)); | |
| var f = window.setTimeout(function() { | |
| b(d + e) | |
| }, e); | |
| a = d + e; | |
| return f | |
| }; | |
| if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function(a) { | |
| clearTimeout(a) | |
| } | |
| })(); | |
| if (!String.prototype.format) { | |
| String.prototype.format = function() { | |
| "use strict"; | |
| var a; | |
| a = arguments; | |
| if (a.length === 1 && a[0] !== null && typeof a[0] === "object") { | |
| a = a[0] | |
| } | |
| return this.replace(/{([^}]*)}/g, function(b, c) { | |
| return typeof a[c] !== "undefined" ? a[c] : b | |
| }) | |
| } | |
| }(function() { | |
| "use strict"; | |
| var a = window._; | |
| function b(b, c) { | |
| var d = ["test", "android", "windowsPhone", "iphone", "ipad", "windows"]; | |
| return a.contains(d, b) || c | |
| } | |
| function c(a, b, c) { | |
| var d = parseInt(b, 10); | |
| return c || a === "windows" || a === "windowsPhone" && d >= 8 || a === "android" && d >= 4 || (a === "iphone" || a === "ipad") && d >= 5 || a === "sailfish" | |
| } | |
| function d(a, b, c) { | |
| var d = parseInt(b, 10); | |
| return c || a === "windows" || a === "windowsPhone" && d >= 8 || a === "android" && d >= 4 || (a === "iphone" || a === "ipad") && d >= 5 || a === "sailfish" | |
| } | |
| function e(b, c) { | |
| var d = ["iphone", "android"]; | |
| return a.contains(d, b) && !a.contains(c, "tablet") | |
| } | |
| function f(b) { | |
| var c = ["android", "windows"]; | |
| return a.contains(c, b) | |
| } | |
| function g(b, c) { | |
| var d = ["test", "android", "windowsPhone", "iphone", "ipad", "windows"]; | |
| return a.contains(d, b) || c | |
| } | |
| function h(a, b, c) { | |
| var d = parseInt(b, 10); | |
| return c || a === "windows" || a === "windowsPhone" && d >= 8 || a === "android" && d >= 4 || (a === "iphone" || a === "ipad") && d >= 5 || a === "sailfish" | |
| } | |
| function i(b) { | |
| var c = ["iphone", "ipad", "android", "windowsPhone"]; | |
| return a.contains(c, b) | |
| } | |
| function j(a, b) { | |
| return b || a !== "asha" | |
| } | |
| function k(a) { | |
| return a | |
| } | |
| function l(a) { | |
| return a.browser === "ie" && a.desktopVersion < 9 || a.browser === "firefox" && a.desktopVersion < 30 || a.identity === "android" && a.webkitVersion < 535 | |
| } | |
| function m(a) { | |
| return a.identity === "iphone" && a.browser === "chrome" | |
| } | |
| function n(a) { | |
| return a | |
| } | |
| function o(a) { | |
| return a.length === 1 && a[0] === "mobile" | |
| } | |
| function p(a) { | |
| var b = a.body || a.documentElement; | |
| var c = b.style; | |
| var d = "transition"; | |
| if (typeof c[d] === "string") { | |
| return true | |
| } | |
| var e = ["Moz", "webkit", "Webkit", "Khtml", "O", "ms"]; | |
| d = d.charAt(0).toUpperCase() + d.substr(1); | |
| for (var f = 0; f < e.length; f++) { | |
| if (typeof c[e[f] + d] === "string") { | |
| return true | |
| } | |
| } | |
| return false | |
| } | |
| function q(a) { | |
| return /Lumia/i.test(a) | |
| } | |
| function r(a) { | |
| var b = parseInt(a.version); | |
| return a.identity === "windowsPhone" && b === 8 | |
| } | |
| function s(a) { | |
| var b = parseInt(a.version, 10); | |
| var c = parseInt(a.minorVersion, 10); | |
| return a.identity === "android" && b <= 2 || a.identity === "android" && b === 4 && c === 0 || (a.identity === "iphone" || a.identity === "ipad") && b <= 7 || a.identity === "windowsPhone" && b < 8 || a.browser === "ie" && a.desktopVersion <= 9 | |
| } | |
| function t(a) { | |
| var b, c; | |
| if (typeof a.hidden !== "undefined") { | |
| b = "hidden"; | |
| c = "visibilitychange" | |
| } else if (typeof a.mozHidden !== "undefined") { | |
| b = "mozHidden"; | |
| c = "mozvisibilitychange" | |
| } else if (typeof a.msHidden !== "undefined") { | |
| b = "msHidden"; | |
| c = "msvisibilitychange" | |
| } else if (typeof a.webkitHidden !== "undefined") { | |
| b = "webkitHidden"; | |
| c = "webkitvisibilitychange" | |
| } | |
| return { | |
| hidden: b, | |
| visibilityChange: c | |
| } | |
| } | |
| window.FeatureTest = { | |
| supportsFbLike: b, | |
| supportsFbShare: c, | |
| supportsTwitter: d, | |
| supportsWhatsApp: e, | |
| supportsLinkedIn: g, | |
| supportsGooglePlus: f, | |
| supportsPinterest: h, | |
| supportsFbMessenger: i, | |
| supportsEmail: j, | |
| supportsPrint: k, | |
| supportsCssTransitions: p, | |
| isMobile: o, | |
| isVideoAutoplayEnabled: n, | |
| isOldBrowser: l, | |
| isIPhoneChrome: m, | |
| isLumiaPhone: q, | |
| isWP8: r, | |
| isLegacyRuutuVideoPlayer: s, | |
| supportsVisibilityAPI: t | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.Detect; | |
| var b = a.detectDevice(navigator.userAgent); | |
| window.IS = window.IS || {}; | |
| window.IS.userLocationCookieName = "user-location"; | |
| window.IS.userGpsLocationCookieName = "user-gps-location"; | |
| window.IS.userRadarZoneCookieName = "user-radar-zone"; | |
| window.IS.device = b; | |
| window.IS.device.width = window.innerWidth || document.documentElement.clientWidth; | |
| window.IS.device.height = window.innerHeight; | |
| window.IS.SCREEN_BREAKPOINT = 300; | |
| if (window.IS.device.identity === "linux" && window.IS.device.width < 260) { | |
| window.IS.device.identity = "nokiaproxy" | |
| } | |
| if (window.IS.device.identity === "symbian" && navigator.userAgent.indexOf("AppleWebKit/413") !== -1) { | |
| window.IS.device.identity = "symbianS60legacy" | |
| } | |
| window.IS.isSmallScreen = window.IS.device.width < window.IS.SCREEN_BREAKPOINT; | |
| window.IS.isNoAdsDevice = window.IS.device.version === "S60_3rd" | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.FeatureTest; | |
| var b = window.Detect; | |
| var c = b.detectDevice(navigator.userAgent); | |
| var d = b.isDesktop(window.IS.device.type, window.screen.width, window.screen.height); | |
| window.Features = { | |
| supportsFbLike: a.supportsFbLike(c.identity, d), | |
| supportsFbShare: a.supportsFbShare(c.identity, c.version, d), | |
| supportsTwitter: a.supportsTwitter(c.identity, c.version, d), | |
| supportsWhatsApp: a.supportsWhatsApp(c.identity, c.type), | |
| supportsGooglePlus: a.supportsGooglePlus(c.identity), | |
| supportsLinkedIn: a.supportsLinkedIn(c.identity, d), | |
| supportsPinterest: a.supportsPinterest(c.identity, c.version, d), | |
| supportsFbMessenger: a.supportsFbMessenger(c.identity), | |
| supportsEmail: a.supportsEmail(c.identity, d), | |
| supportsPrint: a.supportsPrint(d), | |
| supportsCssTransitions: a.supportsCssTransitions(document), | |
| supportsVisibilityAPI: a.supportsVisibilityAPI(document), | |
| isVideoAutoplayEnabled: a.isVideoAutoplayEnabled(d), | |
| isOldBrowser: a.isOldBrowser(c), | |
| isIPhoneChrome: a.isIPhoneChrome(c), | |
| device: c, | |
| isDesktop: d, | |
| isMobile: a.isMobile(c.type), | |
| ie8OrLess: /MSIE [876]/i.test(window.navigator.userAgent), | |
| isLumiaPhone: a.isLumiaPhone(window.navigator.userAgent), | |
| isWP8: a.isWP8(c), | |
| isLegacyRuutuVideoPlayer: a.isLegacyRuutuVideoPlayer(c) | |
| }; | |
| if (/iPad/i.test(navigator.userAgent)) { | |
| var e = document.getElementsByTagName("html")[0]; | |
| e.className += " ipad"; | |
| window.fastdom.read = function(a) { | |
| a() | |
| }; | |
| window.fastdom.write = function(a) { | |
| a() | |
| } | |
| } | |
| })(); | |
| $.isViewport = function(a) { | |
| "use strict"; | |
| var b = $("#js-mobile").css("borderTopWidth"); | |
| return a === "below-small" && b === "1px" || a === "below-medium" && b === "2px" || a === "medium" && b === "3px" || a === "above-medium" && b === "4px" | |
| }; | |
| (function(a, b, c) { | |
| "use strict"; | |
| var d = false; | |
| var e = "webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend"; | |
| var f = "fv"; | |
| var g = "fs"; | |
| var h = "popup-closed-"; | |
| var i = 30 * 60 * 1e3; | |
| var j = '<span class="close"><svg width="40px" height="40px" viewBox="0 0 40 40">' + "[Sulje]" + '<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">' + '<g id="oval" sketch:type="MSLayerGroup">' + '<circle id="Oval-5" fill="#777777" sketch:type="MSShapeGroup" cx="20" cy="20" r="20"></circle>' + '<path d="M25.7052632,23.8526316 C25.9894751,24.1368435 26.1315789,24.4763138 26.1315789,24.8710526 C26.1315789,25.2657914 25.9894751,25.6052617 25.7052632,25.8894737 C25.4210512,26.1421065 25.0815809,26.2684211 24.6868421,26.2684211 C24.2921033,26.2684211 23.952633,26.1421065 23.6684211,25.8894737 L20.5421053,22.2894737 L17.4157895,25.8894737 C17.1315775,26.1421065 16.7921072,26.2684211 16.3973684,26.2684211 C16.0026296,26.2684211 15.6631593,26.1421065 15.3789474,25.8894737 C15.1263145,25.6052617 15,25.2657914 15,24.8710526 C15,24.4763138 15.1263145,24.1368435 15.3789474,23.8526316 L18.6473684,20.1578947 L15.3789474,16.4157895 C15.1263145,16.1315775 15,15.7921072 15,15.3973684 C15,15.0026296 15.1263145,14.6631593 15.3789474,14.3789474 C15.6631593,14.1263145 16.0026296,14 16.3973684,14 C16.7921072,14 17.1315775,14.1263145 17.4157895,14.3789474 L20.5421053,17.9789474 L23.6684211,14.3789474 C23.952633,14.1263145 24.2921033,14 24.6868421,14 C25.0815809,14 25.4210512,14.1263145 25.7052632,14.3789474 C25.9894751,14.6631593 26.1315789,15.0026296 26.1315789,15.3973684 C26.1315789,15.7921072 25.9894751,16.1315775 25.7052632,16.4157895 L22.4368421,20.1578947 L25.7052632,23.8526316 Z" id="❌-copy-4" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>' + "</g>" + "</g>" + "</svg></span>"; | |
| function k(a) { | |
| return '<div id="' + a.id + '">' + j + a.html() + "</div>" | |
| } | |
| a.IsPopup = { | |
| show: function(f, g, i, j) { | |
| var k = b(f); | |
| var l = b(k[0]); | |
| var m = l.attr("id"); | |
| j = Math.max(j || 0, 1e3); | |
| g = g || function() {}; | |
| var n = d || i && !!m && b.booleanCookie(h + m); | |
| if (n) { | |
| return | |
| } | |
| d = true; | |
| c.write(function() { | |
| l.addClass("ad app-popup hidden-popup"); | |
| b(document.body).append(k) | |
| }); | |
| l.on("click", ".close", function() { | |
| a.IsPopup.hide(i) | |
| }); | |
| setTimeout(function() { | |
| l.removeClass("hidden-popup") | |
| }, j); | |
| if (a.Features.supportsCssTransitions) { | |
| l.one(e, function() { | |
| g(l) | |
| }) | |
| } else { | |
| setTimeout(function() { | |
| g(l) | |
| }, 0) | |
| } | |
| }, | |
| hide: function(f) { | |
| var g = b(".app-popup"), | |
| i = g.attr("id"); | |
| var j = function() { | |
| c.write(function() { | |
| g.remove() | |
| }); | |
| d = false | |
| }; | |
| if (a.Features.supportsCssTransitions) { | |
| g.one(e, function() { | |
| j() | |
| }) | |
| } else { | |
| j() | |
| } | |
| g.addClass("hidden-popup"); | |
| if (f && i) { | |
| b.booleanCookie(h + i, "true", { | |
| path: "/", | |
| expires: 36200 | |
| }) | |
| } | |
| }, | |
| run: function(c) { | |
| var d = !b.cookie(f); | |
| var e = b.cookie(g); | |
| var h = !d && !e || e && Date.now() - parseInt(e, 10) > i; | |
| if (h && c) { | |
| for (var j = 0; j < c.length; j++) { | |
| var l = c[j]; | |
| if (!l.precondition || l.precondition && l.precondition()) { | |
| a.IsPopup.show(k(l), l.openCallback, l.closeWithCookie, l.timeout) | |
| } | |
| } | |
| } else if (d) { | |
| b.cookie(g, Date.now() + "", { | |
| path: "/" | |
| }) | |
| } | |
| b.booleanCookie(f, "true", { | |
| path: "/", | |
| expires: 36200 | |
| }) | |
| } | |
| } | |
| })(window, window.$, window.fastdom); | |
| (function(a) { | |
| "use strict"; | |
| var b = document.defaultView && document.defaultView.getComputedStyle; | |
| var c = { | |
| getCssProperty: function(a, c) { | |
| if (b) { | |
| return document.defaultView.getComputedStyle(a, null)[c] | |
| } else { | |
| var d = c.replace(/-([a-z])/g, function(a) { | |
| return a[1].toUpperCase() | |
| }); | |
| if (a.currentStyle) { | |
| return a.currentStyle[d] | |
| } else { | |
| return a.style[d] | |
| } | |
| } | |
| }, | |
| getSupportedWebfontName: function(a, b) { | |
| var d = c.getCssProperty(a, "font-family").split(","); | |
| var e = d.length > 0 ? d[0].replace(/['"]/g, "") : null; | |
| if (e !== null && ~b.indexOf(e)) { | |
| return e | |
| } | |
| return null | |
| }, | |
| getClientWidth: function(a) { | |
| var b = a.getBoundingClientRect(); | |
| return b.right - b.left | |
| }, | |
| isElementVisible: function(a) { | |
| return a && !!c.getClientWidth(a) | |
| }, | |
| getSupportedPropertyName: function(a) { | |
| for (var b = 0; b < a.length; b++) { | |
| if (typeof document.body.style[a[b]] !== "undefined") { | |
| return a[b] | |
| } | |
| } | |
| return null | |
| }, | |
| domListArray: function(a) { | |
| if (!window.Features.ie8OrLess) { | |
| return Array.prototype.slice.call(a) | |
| } else { | |
| var b = []; | |
| for (var c = 0; c < a.length; c++) { | |
| b.push(a[c]) | |
| } | |
| return b | |
| } | |
| }, | |
| splitTextAtByWords: function(a, b) { | |
| var c = a.indexOf(" ", b); | |
| if (c === -1) { | |
| return a | |
| } | |
| return a.substring(0, c) | |
| }, | |
| scriptsTag: function(a) { | |
| var b = document.currentScript || function() { | |
| var a = document.getElementsByTagName("script"); | |
| var b = [], | |
| c = 0, | |
| d; | |
| for (; | |
| (d = a[c]) !== undefined; ++c) { | |
| if (!(d.hasAttribute("src") || d.hasAttribute("async"))) { | |
| b.push(d) | |
| } | |
| } | |
| return b[b.length - 1] | |
| }(); | |
| return a ? b.parentNode : b.previousElementSibling || $(b).prev()[0] | |
| }, | |
| scriptsParentTag: function() { | |
| return c.scriptsTag(true) | |
| }, | |
| scriptsPreviousTag: function() { | |
| return c.scriptsTag(false) | |
| }, | |
| getTemplate: function(b, c) { | |
| var d; | |
| if (typeof b === "string") { | |
| d = document.getElementById(b).innerHTML | |
| } else { | |
| d = b.innerHTML | |
| } | |
| if (!c) { | |
| return d | |
| } else { | |
| var e = a.template(d); | |
| return e(c) | |
| } | |
| }, | |
| getScript: function(a, b, c) { | |
| var d = c ? "#" + c : ""; | |
| var e = $('head script[src="' + a + '"]' + d)[0]; | |
| if (!e || typeof b === "function") { | |
| e = document.createElement("script"); | |
| e.async = true; | |
| e.type = "text/javascript"; | |
| e.src = a; | |
| if (c) { | |
| e.id = c | |
| } | |
| if (typeof b === "function") { | |
| if (e.addEventListener) { | |
| e.addEventListener("load", function() { | |
| b() | |
| }, false) | |
| } else { | |
| e.onreadystatechange = function() { | |
| if (e.readyState === "loaded" || e.readyState === "complete") { | |
| e.onreadystatechange = null; | |
| b() | |
| } | |
| } | |
| } | |
| } | |
| document.head.appendChild(e) | |
| } | |
| }, | |
| shortenUrl: function(a, b) { | |
| $.ajax({ | |
| type: "POST", | |
| url: "https://www.googleapis.com/urlshortener/v1/url", | |
| contentType: "application/json", | |
| dataType: "json", | |
| async: false, | |
| data: JSON.stringify({ | |
| longUrl: a | |
| }), | |
| success: function(a) { | |
| b(a.id) | |
| }, | |
| error: function() { | |
| b() | |
| } | |
| }) | |
| }, | |
| popupCenter: function(a, b, c, d) { | |
| var e = window.screenLeft !== undefined ? window.screenLeft : screen.left; | |
| var f = window.screenTop !== undefined ? window.screenTop : screen.top; | |
| var g = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; | |
| var h = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; | |
| var i = g / 2 - c / 2 + e; | |
| var j = h / 2 - d / 2 + f; | |
| var k = window.open(a, b, "scrollbars=yes, width=" + c + ", height=" + d + ", top=" + j + ", left=" + i); | |
| if (window.focus) { | |
| k.focus() | |
| } | |
| return k | |
| } | |
| }; | |
| window.Tools = c | |
| })(window._); | |
| (function(a, b, c) { | |
| "use strict"; | |
| var d = "IS-localstorage-test-key"; | |
| var e; | |
| function f(a) { | |
| var b = h(a); | |
| if (typeof b !== "string") { | |
| return null | |
| } | |
| return JSON.parse(b) | |
| } | |
| function g(a, b) { | |
| return i(a, JSON.stringify(b)) | |
| } | |
| function h(a) { | |
| if (k()) { | |
| return b.getItem(a) | |
| } else { | |
| return c.cookie(a) | |
| } | |
| } | |
| function i(a, d) { | |
| if (k()) { | |
| return b.setItem(a, d) | |
| } else { | |
| return c.cookie(a, d) | |
| } | |
| } | |
| function j(a) { | |
| return b.removeItem(a) | |
| } | |
| function k() { | |
| if (e !== undefined) { | |
| return e | |
| } | |
| if (typeof b === "undefined") { | |
| e = false | |
| } | |
| try { | |
| b.setItem(d, d); | |
| b.removeItem(d); | |
| e = true | |
| } catch (a) { | |
| e = false | |
| } | |
| return e | |
| } | |
| a.BrowserStorage = { | |
| getJSON: f, | |
| setJSON: g, | |
| setItem: i, | |
| getItem: h, | |
| removeItem: j | |
| } | |
| })(window, window.localStorage, window.$); | |
| (function() { | |
| "use strict"; | |
| var a = 1e3, | |
| b = window.Tools; | |
| var c = function() { | |
| this.spans = {}; | |
| this.intervals = {}; | |
| this.widths = {} | |
| }; | |
| c.prototype.init = function(a) { | |
| var c = this.spans, | |
| d = this.widths, | |
| e = "textContent" in document.body, | |
| f = "w w w w w w w w w w i i i i i i w w w w w w w w w w i i i i i i" + Math.random(); | |
| a.forEach(function(a) { | |
| var g = c[a] = document.createElement("span"); | |
| if (e) { | |
| g.textContent = f | |
| } else { | |
| g.innerText = f | |
| } | |
| g.setAttribute("style", "font-family: Arial, Helvetica, sans-serif; z-index: 50; display: inline-block; font-size: 31px; white-space: nowrap; position: absolute; top: -1000px; left: -10000px;"); | |
| document.body.appendChild(g); | |
| d[a] = b.getClientWidth(g) | |
| }); | |
| return this | |
| }; | |
| c.prototype.listen = function(a) { | |
| var b = this.spans; | |
| for (var c in b) { | |
| if (b.hasOwnProperty(c)) { | |
| this.fontCheck(a, c) | |
| } | |
| } | |
| }; | |
| c.prototype.fontCheck = function(a, c) { | |
| var d = this.spans[c], | |
| e = this.widths; | |
| d.style.fontFamily = c; | |
| var f = b.getClientWidth(d); | |
| if (f !== e[c]) { | |
| var g = this; | |
| setTimeout(function() { | |
| a(c, false, true); | |
| g.cleanUp(c) | |
| }, 20) | |
| } else { | |
| this.observe(c, a) | |
| } | |
| }; | |
| c.prototype.cleanUp = function(a) { | |
| clearInterval(this.intervals[a]); | |
| try { | |
| document.body.removeChild(this.spans[a]) | |
| } catch (a) {} | |
| }; | |
| c.prototype.observe = function(c, d) { | |
| var e = this.spans, | |
| f = this.widths, | |
| g = this; | |
| this.intervals[c] = setInterval(function() { | |
| if (b.getClientWidth(e[c]) !== f[c]) { | |
| d(c, false, false); | |
| g.cleanUp(c) | |
| } | |
| }, 40); | |
| setTimeout(function() { | |
| g.cleanUp(c); | |
| d(c, true, false) | |
| }, a) | |
| }; | |
| window.FontLoader = new c | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = ["BentonSansComp-Bold", "SourceSerifPro-Bold", "Source Sans Pro", "Abril Fatface"], | |
| b, c = window.Tools, | |
| d = c.getClientWidth, | |
| e = !!document.documentElement.dataset; | |
| if (window.Features.ie8OrLess) { | |
| d = function(a) { | |
| return a.offsetWidth | |
| } | |
| } | |
| var f = { | |
| transform: "transform: scale(*); line-height: *", | |
| msTransform: "-ms-transform: scale(*); line-height: *", | |
| webkitTransform: "-webkit-transform: scale(*); line-height: *", | |
| mozTransform: "-moz-transform: scale(*); line-height: *", | |
| oTransform: "-o-transform: scale(*); line-height: *" | |
| }, | |
| g = ["transform", "msTransform", "webkitTransform", "mozTransform", "oTransform"]; | |
| var h = function() { | |
| var h = [], | |
| i = [], | |
| j = this, | |
| k; | |
| this.fitHeading = function(a) { | |
| var e = d(a.widthElement), | |
| g, h, i, j, l = []; | |
| if (a.previousWidth === e) { | |
| return | |
| } | |
| a.activeLines.forEach(function(b, c) { | |
| if (!a.clientWidths[c]) { | |
| a.clientWidths[c] = d(b) | |
| } | |
| g = a.widths[c] * e; | |
| h = g / a.clientWidths[c]; | |
| l.push(h); | |
| if (a.grouped[c]) { | |
| if (!i || h < i) { | |
| i = h | |
| } | |
| } | |
| }); | |
| window.fastdom.write(function() { | |
| a.activeLines.forEach(function(d, e) { | |
| h = a.grouped[e] ? i : l[e]; | |
| k = a.colors[e]; | |
| k = k ? "; color: " + k : ""; | |
| if (b) { | |
| j = f[b].replace(/\*/g, h) + k | |
| } else { | |
| var g = Math.floor(parseInt(c.getCssProperty(d, "font-size")) * h) - 1; | |
| j = "font-size: " + g + "px" + k | |
| } | |
| d.setAttribute("style", j) | |
| }) | |
| }); | |
| a.previousWidth = e | |
| }; | |
| this.fit = function(b) { | |
| var c = document.getElementById(b), | |
| d = window.Tools.domListArray(c.children), | |
| f = d.filter(function(a) { | |
| return a.hasChildNodes() | |
| }); | |
| var g = { | |
| widthElement: c.firstElementChild || c.firstChild, | |
| colors: f.map(function(a) { | |
| return e ? a.dataset.color : a.getAttribute("data-color") | |
| }), | |
| widths: f.map(function(a) { | |
| var b = e ? a.dataset.width : a.getAttribute("data-width"); | |
| return b ? parseFloat(b) / 100 : 1 | |
| }), | |
| clientWidths: [], | |
| grouped: f.map(function(a) { | |
| return /equal-font-size/.test(a.className) | |
| }), | |
| activeLines: f, | |
| previousWidth: undefined | |
| }; | |
| var k = h.filter(function(b) { | |
| return a.indexOf(b) !== -1 | |
| }); | |
| if (k.length) { | |
| g.layouted = true; | |
| j.fitHeading(g) | |
| } | |
| i.push(g) | |
| }; | |
| var l = function() { | |
| return function(a) { | |
| return !a.layouted | |
| } | |
| }; | |
| this.fitHeadings = function() { | |
| var a = i.filter(l()); | |
| a.forEach(function(a) { | |
| j.fitHeading(a) | |
| }) | |
| }; | |
| this.init = function() { | |
| b = c.getSupportedPropertyName(g); | |
| window.FontLoader.init(a).listen(function(a) { | |
| h.push(a); | |
| j.fitHeadings() | |
| }) | |
| }; | |
| this.resize = function() { | |
| var a, b; | |
| for (a = i.length; a--;) { | |
| b = i[a]; | |
| b.layouted = false; | |
| j.fitHeading(b) | |
| } | |
| } | |
| }; | |
| window.ISFittedHeading = new h; | |
| if (!window.Features.ie8OrLess) { | |
| $(window).bind("resize.headings orientationchange.headings", window.ISFittedHeading.resize) | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.BrowserStorage; | |
| function b(a, b) { | |
| return $.ajax({ | |
| url: "/rest/quick-survey/vote", | |
| type: "POST", | |
| data: JSON.stringify({ | |
| surveyId: a, | |
| index: b | |
| }), | |
| processData: false, | |
| contentType: "application/json; charset=UTF-8" | |
| }) | |
| } | |
| function c(c) { | |
| var d = c.data("quicksurvey-id"), | |
| e = "IS-quicksurvey-" + d, | |
| f = c.find("button"); | |
| var g = a.getItem(e) || $.cookie(e) || false; | |
| if (g) { | |
| c.addClass("done") | |
| } else { | |
| c.addClass("vote"); | |
| c.on("click", "button", function(g) { | |
| g.preventDefault(); | |
| f.prop("disabled", true); | |
| var h = $(g.target).data("index"); | |
| b(d, h).then(function() { | |
| c.toggleClass("vote done"); | |
| a.setItem(e, h) | |
| }).fail(function() { | |
| a.removeItem(e) | |
| }).done(function() { | |
| f.removeProp("disabled") | |
| }) | |
| }) | |
| } | |
| } | |
| window.QuickSurvey = { | |
| init: function(a) { | |
| c($(a)) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = [1920, 978, 658, 628, 468, 320, 300, 230, 210, 170, 115], | |
| b = $(window).height(), | |
| c = 2 * b, | |
| d = b + c, | |
| e = "getBoundingClientRect" in document.createElement("div"), | |
| f; | |
| function g(a) { | |
| if (!e || a.nodeType !== 1) { | |
| return false | |
| } | |
| var b = a.getBoundingClientRect(), | |
| f; | |
| if (b.width === 0 || typeof b !== "object" || typeof b.top !== "number" || (f = b.top) === 0) { | |
| return false | |
| } | |
| return f >= -c && f <= d | |
| } | |
| function h(a) { | |
| var b = false; | |
| for (var c = a.length - 1; c >= 0; c--) { | |
| var d = $(a[c]); | |
| d.addClass("fade-in"); | |
| if (d.parent().data("object-fit-poly")) { | |
| d.attr("data-object-fit", "true"); | |
| b = true | |
| } | |
| } | |
| if (b && window.objectFitPolyfillInit) { | |
| window.objectFitPolyfillInit() | |
| } | |
| } | |
| var i = function() { | |
| if (!window.Features.ie8OrLess) { | |
| this.instantImager = new window.Imager([], { | |
| availableWidths: a, | |
| scrollDelay: 1e4, | |
| onResize: false, | |
| lazyload: false, | |
| onImagesReplaced: h | |
| }); | |
| this.instantImager.initialized = true | |
| } | |
| this.stack = [] | |
| }; | |
| i.prototype.init = function() { | |
| this.stack = []; | |
| this.imager = new window.Imager({ | |
| availableWidths: a, | |
| onResize: !window.Features.isOldBrowser, | |
| lazyload: true, | |
| scrollDelay: 150, | |
| lazyloadOffset: c, | |
| onImagesReplaced: h | |
| }); | |
| window.Events.trigger("imagestack:loaded") | |
| }; | |
| i.prototype.addImage = function(a) { | |
| this.stack.push(a) | |
| }; | |
| i.prototype.checkVisible = function(a) { | |
| var b = [], | |
| c = this; | |
| window.fastdom.read(function() { | |
| for (var d = c.stack.length - 1; d >= 0; d--) { | |
| var e = c.stack[d]; | |
| if (!!a || g(e)) { | |
| b.push(e); | |
| c.stack.splice(d, 1) | |
| } | |
| } | |
| }); | |
| window.fastdom.write(function() { | |
| c.instantImager.changeDivsToEmptyImages(b) | |
| }) | |
| }; | |
| i.prototype.refresh = function(a) { | |
| if (this.imager) { | |
| this.imager.checkImagesNeedReplacing(this.imager.divs) | |
| } else { | |
| this.checkVisible(a) | |
| } | |
| }; | |
| i.prototype.stopInstantLoader = function() { | |
| if (!window.Features.ie8OrLess) { | |
| clearInterval(f); | |
| clearInterval(this.instantImager.interval) | |
| } | |
| $(this.init.bind(this)) | |
| }; | |
| window.ImageStack = new i; | |
| if (!window.Features.ie8OrLess) { | |
| f = setInterval(function() { | |
| this.checkVisible() | |
| }.bind(window.ImageStack), 100) | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.initMobileUrl = function(a) { | |
| if (window.Features.isMobile) { | |
| if (a.data("mobile-href") && a.data("mobile-href").length > 0) { | |
| a.attr("href", a.data("mobile-href")) | |
| } | |
| } | |
| } | |
| })(); | |
| (function(a, b, c, d, e) { | |
| "use strict"; | |
| var f = /(iPad|iPhone|iPod)/, | |
| g = /facebook/; | |
| var h = function() { | |
| return g.test(document.referrer) | |
| }; | |
| var i = function() { | |
| return f.test(navigator.userAgent) | |
| }; | |
| var j = function() { | |
| var a = e.detectDevice(navigator.userAgent); | |
| return a.type.indexOf("mobile") > -1 | |
| }; | |
| var k = function() { | |
| var a = j(), | |
| b = !!navigator.geolocation; | |
| return a && b && !h() && !i() | |
| }; | |
| var l = function() { | |
| var a = b.cookie("geolocationPermission"), | |
| d = c.isString(a), | |
| e = d ? a === "true" : undefined; | |
| return e | |
| }; | |
| var m = function(a) { | |
| return b.cookie("geolocationPermission", a, { | |
| expires: 36200 | |
| }) | |
| }; | |
| var n = function(a) { | |
| var e = a || {}, | |
| f = a.askAgain, | |
| g = e.permissionCallback || function() {}, | |
| h = l(), | |
| i = !c.isBoolean(h), | |
| j = function(a) { | |
| m(a); | |
| g(a) | |
| }, | |
| k = { | |
| container: b(".geolocation-permission-ui-container").get(0), | |
| afterElementCreated: function(a) { | |
| b(a).slideDown() | |
| }, | |
| beforeElementRemoved: function(a, c) { | |
| b(a).slideUp(c) | |
| } | |
| }, | |
| n = c.extend({}, k, e), | |
| o = function() { | |
| d.askPermission(n) | |
| }; | |
| n.permissionCallback = j; | |
| if (i) { | |
| o() | |
| } else if (f && h === false) { | |
| o() | |
| } else { | |
| g(h) | |
| } | |
| }; | |
| a.LocationPermission = { | |
| hasPermission: l, | |
| setPermission: m, | |
| getOrAskPermission: n, | |
| shouldAskForLocationPermission: k | |
| } | |
| })(window, window.$, window._, window.geolocationPermissionUi, window.Detect); | |
| (function(a) { | |
| "use strict"; | |
| var b = false, | |
| c = 1e3, | |
| d = 20, | |
| e; | |
| var f = function() { | |
| return "ratas" in a && "refreshKVpairsUsingGeoLocationApi" in a.ratas | |
| }; | |
| var g = function(a) { | |
| return a && !b | |
| }; | |
| var h = function() { | |
| if (!b && f()) { | |
| b = true; | |
| a.ratas.refreshKVpairsUsingGeoLocationApi() | |
| } | |
| return b | |
| }; | |
| var i = function(a) { | |
| var c = d; | |
| var f = setInterval(function() { | |
| if (!b) { | |
| h() | |
| } | |
| if (b || c === 0) { | |
| clearInterval(f) | |
| } else { | |
| e = --c | |
| } | |
| }, a) | |
| }; | |
| var j = function(a) { | |
| if (g(a)) { | |
| var b = h(); | |
| if (!b) { | |
| i(c) | |
| } | |
| } | |
| }; | |
| a.RatasAPI = { | |
| callRatasIfPermissionGranted: j, | |
| specSupport: { | |
| resetCalledState: function() { | |
| b = false | |
| }, | |
| calledState: function() { | |
| return b | |
| }, | |
| callInterval: function() { | |
| return c | |
| }, | |
| setTries: function(a) { | |
| d = a; | |
| return d | |
| }, | |
| triesLeft: function() { | |
| return e | |
| } | |
| } | |
| } | |
| })(window); | |
| (function(a, b) { | |
| "use strict"; | |
| var c = function(a, b) { | |
| function c(c) { | |
| var d = c.coords.latitude.toFixed(2); | |
| var e = c.coords.longitude.toFixed(2); | |
| a({ | |
| latitude: d, | |
| longitude: e, | |
| permission: b | |
| }) | |
| } | |
| function d(c) { | |
| a({ | |
| permission: b | |
| }, c) | |
| } | |
| navigator.geolocation.getCurrentPosition(c, d) | |
| }; | |
| var d = function(b) { | |
| var d = b || {}, | |
| e = d.permissionCallback || function() {}, | |
| f = d.locationDone || function() {}, | |
| g = function(a) { | |
| var b = a || {}; | |
| e(b.permission); | |
| f(b) | |
| }; | |
| a.LocationPermission.getOrAskPermission({ | |
| permissionCallback: function(a) { | |
| if (a) { | |
| c(g, a) | |
| } else { | |
| g({ | |
| permission: a | |
| }, { | |
| message: "Lupa evätty." | |
| }) | |
| } | |
| }, | |
| showNativeDialogFor: function() { | |
| return false | |
| } | |
| }) | |
| }; | |
| var e = function(b) { | |
| a.RatasAPI.callRatasIfPermissionGranted(b) | |
| }; | |
| var f = function(c) { | |
| var f = c || {}, | |
| g = f.useLatest, | |
| h = f.askAgain, | |
| i = a.LocationPermission.hasPermission(), | |
| j = g ? b.cookie("located") : false, | |
| k = f.locationDone || function() {}, | |
| l = c.permissionCallback || function() {}, | |
| m = function(a) { | |
| e(a); | |
| l(a) | |
| }, | |
| n = !!navigator.geolocation; | |
| if (n) { | |
| if (!g || !j) { | |
| d({ | |
| locationDone: k, | |
| permissionCallback: m | |
| }) | |
| } | |
| if (h) { | |
| d({ | |
| permissionCallback: m, | |
| locationDone: k, | |
| askAgain: true | |
| }) | |
| } | |
| } else { | |
| m(i); | |
| k({ | |
| permission: i | |
| }, { | |
| message: "Ei voi paikantaa" | |
| }) | |
| } | |
| }; | |
| var g = function() { | |
| return a.LocationPermission.shouldAskForLocationPermission() | |
| }; | |
| a.Locate = { | |
| locate: f, | |
| shouldLocate: g, | |
| hasLocationPermission: a.LocationPermission.hasPermission | |
| } | |
| })(window, window.$); | |
| (function() { | |
| "use strict"; | |
| var a = function(a) { | |
| var b = "is-oldie-alert", | |
| c = "Oho, käytät tosi vanhaa selainta eikä Ilta-Sanomat välttämättä toimi sillä oikein. Jos pystyt, lataa uusi " + '<a href="https://www.google.fi/intl/fi/chrome/browser/desktop/">Chrome</a>, ' + '<a href="https://www.mozilla.org/fi/firefox/new/">Firefox,</a> tai ' + '<a href="http://windows.microsoft.com/fi-fi/internet-explorer/download-ie">Internet Explorer</a> ' + "– lukeminen on niillä mukavampaa.", | |
| d = "Oho, käytät tosi vanhaa selainta eikä Ilta-Sanomat välttämättä toimi sillä oikein. Jos pystyt, lataa uusi " + '<a href="https://play.google.com/store/apps/details?id=com.android.chrome&hl=fi">Chrome</a> tai ' + '<a href="https://play.google.com/store/apps/details?id=org.mozilla.firefox&hl=fi">Firefox</a> ' + "– lukeminen on niillä mukavampaa."; | |
| if (window.Features.isDesktop) { | |
| a.append(c) | |
| } else { | |
| a.append(d) | |
| } | |
| a.find("span.close").click(function() { | |
| $.cookie(b, true); | |
| a.remove() | |
| }); | |
| if (!$.cookie(b)) { | |
| a.show() | |
| } | |
| }; | |
| window.OldBrowser = { | |
| init: function(b) { | |
| if (window.Features.isOldBrowser) { | |
| a($(b)) | |
| } | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.InitLibrary = { | |
| iframeResizeCallback: function(a) { | |
| var b = $(a.iframe); | |
| if (b) { | |
| window.fastdom.write(function() { | |
| b.css("width", "100%"); | |
| b.parent(".iframe-wrap").removeClass("iframe-wrap").css("padding-top", "") | |
| }) | |
| } | |
| } | |
| } | |
| })(); | |
| (function(a) { | |
| "use strict"; | |
| a.compressedJsonCookie = function(b, c, d) { | |
| function e(a) { | |
| var b = {}, | |
| c = (a + "").split(""), | |
| d = [], | |
| e = c[0], | |
| f = 256, | |
| g, h, i; | |
| for (h = 1, i = c.length; h < i; h++) { | |
| g = c[h]; | |
| if (b[e + g] != null) { | |
| e += g | |
| } else { | |
| d.push(e.length > 1 ? b[e] : e.charCodeAt(0)); | |
| b[e + g] = f; | |
| f++; | |
| e = g | |
| } | |
| } | |
| d.push(e.length > 1 ? b[e] : e.charCodeAt(0)); | |
| for (h = 0, i = d.length; h < i; h++) { | |
| d[h] = String.fromCharCode(d[h]) | |
| } | |
| return d.join("") | |
| } | |
| function f(a) { | |
| var b = {}, | |
| c = (a + "").split(""), | |
| d = c[0], | |
| e = d, | |
| f = [d], | |
| g = 256, | |
| h; | |
| for (var i = 1, j = c.length; i < j; i++) { | |
| var k = c[i].charCodeAt(0); | |
| if (k < 256) { | |
| h = c[i] | |
| } else { | |
| h = b[k] ? b[k] : e + d | |
| } | |
| f.push(h); | |
| d = h.charAt(0); | |
| b[g] = e + d; | |
| g++; | |
| e = h | |
| } | |
| return f.join("") | |
| } | |
| if (c) { | |
| a.cookie(b, e(JSON.stringify(c)), d) | |
| } else { | |
| var g = a.cookie(b); | |
| return g ? JSON.parse(f(g)) : undefined | |
| } | |
| }; | |
| var b = 24 * 60 * 60, | |
| c = 1e3 * b; | |
| a.booleanCookie = function(b, d, e) { | |
| if (!d) { | |
| d = a.cookie(b); | |
| return d && d === "true" | |
| } else if (d) { | |
| a.cookie(b, d ? "true" : null, { | |
| path: e.path || "/", | |
| expires: e.expires || c | |
| }) | |
| } | |
| } | |
| })(window.$); | |
| (function() { | |
| "use strict"; | |
| window.Events = { | |
| trigger: function(a, b) { | |
| $("body").trigger(a, b) | |
| }, | |
| bind: function(a, b) { | |
| $("body").on(a, b) | |
| } | |
| }; | |
| if (window.Features.device.browser === "firefox") { | |
| $(document).on("dragstart", ".cartoon-content a", function() { | |
| return false | |
| }) | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window._; | |
| var b = { | |
| "error.minLength": "Tämä kenttä on pakollinen.", | |
| "error.email": "Syötä oikea sähköpostiosoite.", | |
| "error.maxLength": "Tarkista! Sisältö on liian pitkä!" | |
| }, | |
| c = { | |
| valueMissing: "Tämä kenttä on pakollinen.", | |
| typeMismatch: "Syötä oikea sähköpostiosoite." | |
| }, | |
| d = "input, textarea, select"; | |
| window.Forms = { | |
| collect: function(a) { | |
| var b = {}; | |
| a.find(d).each(function(a, c) { | |
| var d = $(c), | |
| e = d.attr("name"), | |
| f = d.val(); | |
| if (!e) { | |
| return | |
| } | |
| if (d.is("[type=radio], [type=checkbox]")) { | |
| if (d.is(":checked")) { | |
| b[e] = f | |
| } | |
| } else if (d.data("number")) { | |
| b[e] = parseFloat(f) | |
| } else { | |
| b[e] = f | |
| } | |
| }); | |
| return b | |
| }, | |
| errorList: function(a) { | |
| return "<ul>{0}</ul>".format(a.map(function(a) { | |
| return "<li>{0}</li>".format(a) | |
| }).join("")) | |
| }, | |
| clean: function(a) { | |
| a.find(d).val("").removeAttr("checked") | |
| }, | |
| mapErrorMessagesToString: function(a) { | |
| return b[a[0].msg] || "" | |
| }, | |
| mapEnglishToFinnishErrorMessage: function(b) { | |
| return a.find(c, function(a, c) { | |
| return b.validity[c] | |
| }) || b.validationMessage | |
| }, | |
| showErrors: function(b, c) { | |
| var d, e; | |
| a.each(c, function(a, c) { | |
| d = c.split(".").pop(); | |
| e = this.mapErrorMessagesToString(a); | |
| b.find("[name=" + d + "]").addClass("invalid").siblings(".error").html(e) | |
| }.bind(this)) | |
| }, | |
| cleanErrors: function(a) { | |
| a.find(".error").html(""); | |
| a.find(".errors").hide(); | |
| a.find(".invalid").removeClass("invalid") | |
| }, | |
| showError: function(a, b) { | |
| return function(c) { | |
| try { | |
| var d = JSON.parse(c.responseText); | |
| this.cleanErrors(a); | |
| this.showErrors(a, d) | |
| } catch (c) { | |
| this.cleanErrors(a); | |
| a.find(".errors").show().html(b) | |
| } | |
| a.find(".success").hide() | |
| }.bind(this) | |
| }, | |
| translatedHTML5ValidationsForForm: function(a) { | |
| var b = function(a) { | |
| return $(a).parent().find(".error") | |
| }; | |
| a.find(d).on("keyup", function(a) { | |
| var c = b(a.target); | |
| if (!a.target.validity || a.target.validity.valid) { | |
| c.html("") | |
| } else if (!c.is(":empty")) { | |
| c.html(this.mapEnglishToFinnishErrorMessage(a.target)) | |
| } | |
| return false | |
| }.bind(this)); | |
| a.find(d).on("invalid", function(a) { | |
| var c = b(a.target); | |
| c.html(this.mapEnglishToFinnishErrorMessage(a.target)); | |
| return false | |
| }.bind(this)) | |
| } | |
| } | |
| })(); | |
| function toggleHeaderTheme() { | |
| "use strict"; | |
| $(".is-standard-article .is-article-header").toggleClass("is-article-theme-black") | |
| } | |
| function toggleBodyTheme() { | |
| "use strict"; | |
| $(".is-standard-article .is-article-body").toggleClass("is-article-theme-black") | |
| } | |
| function toggleLayout() { | |
| "use strict"; | |
| var a = $(".is-standard-article"); | |
| if (a.hasClass("is-article-horizontal-left")) { | |
| a.removeClass("is-article-horizontal-left").addClass("is-article-horizontal-right") | |
| } else if (a.hasClass("is-article-horizontal-right")) { | |
| a.removeClass("is-article-horizontal-right") | |
| } else { | |
| a.addClass("is-article-horizontal-left") | |
| } | |
| } | |
| $(".DEV-toggle-body").click(toggleBodyTheme); | |
| $(".DEV-toggle-header").click(toggleHeaderTheme); | |
| $(".DEV-toggle-layout").click(toggleLayout); | |
| (function() { | |
| "use strict"; | |
| window.MoreItems = { | |
| loadMoreItems: function(a) { | |
| var b = a.data("id"), | |
| c = a.parents(".lane").hasClass("main-position") || a.closest(".giant-teasers-wrapper").length > 0 ? "main" : "right", | |
| d = parseInt(a.data("item-count"), 10) || 0, | |
| e = a.parents("ol"), | |
| f = e.data("fetch-type"), | |
| g = e.data("list-order"), | |
| h = e.data("period"), | |
| i = $("body").data("page-id"), | |
| j = a.data("override-url"), | |
| k = (j ? j : "/rest/laneitems/") + b + "/", | |
| l = a.data("even") === true, | |
| m = a.data("cssClass"), | |
| n = function(b) { | |
| var c = a.parents(".is-more-items"); | |
| if (a.hasClass("enriched")) { | |
| c.parent().before(b) | |
| } else { | |
| c.before(b) | |
| } | |
| }, | |
| o; | |
| if (f === "fullList") { | |
| k += "items"; | |
| o = function(a) { | |
| e.find("li:not(.is-more-items)").remove(); | |
| n(a) | |
| } | |
| } else { | |
| k += "moreItems"; | |
| o = n | |
| } | |
| a.addClass("loading"); | |
| $.get(k, { | |
| from: d, | |
| pageId: i, | |
| lanePosition: c, | |
| listOrder: g, | |
| period: h, | |
| even: l | |
| }, function(b) { | |
| var c = $.trim(b); | |
| if (c) { | |
| a.removeClass("loading"); | |
| o(b); | |
| window.ImageStack.checkVisible(e); | |
| window.SoMe.ajaxInit(d); | |
| e.find(".lazyload").lazyload({ | |
| failurelimit: 10 | |
| }); | |
| var g = $("<div>" + b + "</div>").find("." + m).length; | |
| if (f === "fullList") { | |
| d = g | |
| } else { | |
| d += g | |
| } | |
| a.data("item-count", d) | |
| } | |
| if (!c || a.parent().parent().find(".list-end").length > 0) { | |
| a.hide() | |
| } | |
| }) | |
| }, | |
| init: function(a) { | |
| var b = this; | |
| $(a).click(function(a) { | |
| a.preventDefault(); | |
| b.loadMoreItems($(this)) | |
| }) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| function a(a, b) { | |
| return $.ajax({ | |
| cache: false, | |
| type: "POST", | |
| url: a, | |
| contentType: "application/json; charset=utf-8", | |
| data: JSON.stringify(b || {}), | |
| headers: { | |
| "Cache-Control": "no-cache, no-store, must-revalidate", | |
| Pragma: "no-cache", | |
| Expires: 0 | |
| } | |
| }) | |
| } | |
| function b(a, b) { | |
| return this.get(a, b, "json") | |
| } | |
| function c(a, b, c) { | |
| return $.ajax({ | |
| cache: false, | |
| type: "GET", | |
| url: a, | |
| dataType: c, | |
| data: $.param(b), | |
| headers: { | |
| "Cache-Control": "no-cache, no-store, must-revalidate", | |
| Pragma: "no-cache", | |
| Expires: 0 | |
| } | |
| }) | |
| } | |
| var d = {}; | |
| function e(a) { | |
| var b = d[a]; | |
| if (!b) { | |
| b = $.getJSON(a); | |
| d[a] = b | |
| } | |
| return b | |
| } | |
| function f(a, b) { | |
| $.when(e(a)).then(function(a) { | |
| b(a) | |
| }) | |
| } | |
| window.Rest = { | |
| postJson: a, | |
| getJson: b, | |
| get: c, | |
| getJsonWithCache: f | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.Tabs = { | |
| init: function(a) { | |
| $("a", a).click(function(a) { | |
| a.preventDefault(); | |
| var b = $(this), | |
| c = b.parents(".tabs"), | |
| d = c.siblings(".tabs-content"), | |
| e = b.attr("data-tab"); | |
| c.find(".tab").removeClass("active"); | |
| b.parents(".tab").addClass("active"); | |
| d.find(".tab-content").removeClass("active"); | |
| d.find('.tab-content[data-tab-content="' + e + '"]').addClass("active") | |
| }) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = function(a) { | |
| var b = $("#global-search-query", a[0]); | |
| $(".global-search-show").on("click touchstart", function(c) { | |
| c.preventDefault(); | |
| a.addClass("open"); | |
| b.focus() | |
| }); | |
| $(".global-search-hide").on("click touchstart", function(c) { | |
| c.preventDefault(); | |
| a.removeClass("open"); | |
| b.blur() | |
| }) | |
| }; | |
| window.GlobalSearch = { | |
| init: function(b) { | |
| a($(b)) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = []; | |
| var b = function(b) { | |
| var c = b.nodeType ? $(b) : $(a); | |
| window.fastdom.write(function() { | |
| c.each(function(a, b) { | |
| $(b).height("auto") | |
| }); | |
| c.each(function(a, b) { | |
| var c = $(b).parent(), | |
| d = c.innerHeight(); | |
| if (!c.hasClass("full-height")) { | |
| c.children().not(b).each(function(a, b) { | |
| d -= $(b).outerHeight() | |
| }) | |
| } | |
| if (d > 0) { | |
| $(b).height(d) | |
| } | |
| }) | |
| }) | |
| }; | |
| window.Stretcher = { | |
| initialize: function(c) { | |
| $("[data-stretch]", c).each(function(c, d) { | |
| a.push(d); | |
| b(d) | |
| }) | |
| } | |
| }; | |
| if (!window.Features.ie8OrLess) { | |
| $(window).on("resize.stretch orientationchange.stretch", b) | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window._; | |
| function b(a, b) { | |
| a.append("<p>Videosoittimen lataus epäonnistui.<br/>" + "Kokeile ladata sivu uudelleen.<br />" + "(Ruutu player v" + b + ")</p>") | |
| } | |
| function c(a, c, d, e) { | |
| window.Tools.getScript(a.data("player-legacy-url"), function() { | |
| if (typeof window.r2Player !== "undefined" && typeof window.r2Player.embedPlayer === "function") { | |
| window.r2Player.embedPlayer({ | |
| containerId: a.attr("id"), | |
| width: c, | |
| height: d, | |
| gaid: a.data("gaid"), | |
| mxmlcUri: a.data("config-url"), | |
| autoplay: e, | |
| recommendations: false, | |
| adaptiveQuality: "lowest", | |
| appLink: false, | |
| sharing: false, | |
| vsite: a.data("vsite"), | |
| allowHttpLinkContent: true, | |
| responsive: true | |
| }) | |
| } else { | |
| b(a, 1) | |
| } | |
| }) | |
| } | |
| function d(a, c, d, e, f, g, h) { | |
| var i = function() { | |
| window.Tools.getScript(a.data("player-url"), function() { | |
| if (typeof window.RP !== "undefined" && typeof window.RP.embedPlayer === "function" && document.body.contains(a[0])) { | |
| var i = { | |
| containerId: a.attr("id"), | |
| gaid: a.data("gaid"), | |
| mxmlcUri: a.data("config-url"), | |
| staging: a.data("is-staging"), | |
| autoplay: e, | |
| vsite: a.data("vsite"), | |
| ns_site: a.data("nssite"), | |
| allowAndroidHtml5Video: true, | |
| recommendations: { | |
| video_live: false, | |
| video_clip: false, | |
| video_episode: false | |
| }, | |
| appLink: f, | |
| useHtml5Fallback: true, | |
| allowHttpLinkContent: g, | |
| loop: false, | |
| width: c, | |
| height: d, | |
| responsive: true, | |
| sharing: false, | |
| wmodeValue: "opaque", | |
| chromecastReceiverId: a.data("chromecast-receiver-id"), | |
| useHotkeys: false, | |
| onApi: h | |
| }; | |
| var j = a.data("disable-apps"); | |
| if (!j) { | |
| i.appName = "IS"; | |
| i.appUrls = { | |
| android: { | |
| storeUrl: "intent://view#Intent;scheme=iltasanomat;package=fi.iltasanomat;end", | |
| videoUrl: "iltasanomat://video/" + a.data("nid") | |
| }, | |
| ios: { | |
| storeUrl: "#", | |
| videoUrl: "#" | |
| } | |
| } | |
| } | |
| window.RP.embedPlayer(i) | |
| } else { | |
| b(a, 2) | |
| } | |
| }) | |
| }; | |
| if (a.data("init-after-pageload")) { | |
| window.setTimeout(i, 0) | |
| } else { | |
| i() | |
| } | |
| } | |
| function e() { | |
| var b = []; | |
| var c = this; | |
| this.onPlayerApi = function(d) { | |
| c.api = d; | |
| d.onEvent(function(c) { | |
| a(b).each(function(b) { | |
| if (a.isFunction(b)) { | |
| b.call(null, c, d) | |
| } | |
| }) | |
| }) | |
| }; | |
| this.addEventListener = function(a) { | |
| b.push(a) | |
| } | |
| } | |
| var f = function() { | |
| var b = a.find(["hidden", "webkitHidden", "mozHidden", "msHidden"], function(a) { | |
| return a in document | |
| }); | |
| return function() { | |
| return !document[b] | |
| } | |
| }(); | |
| function g(a) { | |
| var b = $(a).find(".rplayer-container"); | |
| if (b.length > 0) { | |
| var g = b.width(), | |
| j = 9 / 16 * g, | |
| k = b.data("first-video-on-page"), | |
| l = b.data("legacy-is-video"), | |
| m = window.Features.isVideoAutoplayEnabled && k ? b.data("autoplay-on") : false, | |
| n = f() ? m : false, | |
| o = window.Features.isWP8 || b.data("allow-http-link-content"); | |
| var p = { | |
| android: true, | |
| windowsphone: false, | |
| ios: false | |
| }; | |
| if (!!b.data("disable-apps")) { | |
| p = { | |
| android: false, | |
| windowsphone: false, | |
| ios: false | |
| } | |
| } | |
| if (l === true || window.Features.isLegacyRuutuVideoPlayer) { | |
| c(b, g, j, n) | |
| } else { | |
| var q = new e; | |
| d(b, g, j, n, p, o, q.onPlayerApi); | |
| i(q, m); | |
| if (m && !f()) { | |
| h(q) | |
| } | |
| } | |
| } | |
| } | |
| function h(a) { | |
| var b = window.Features.supportsVisibilityAPI; | |
| if (d()) { | |
| document.addEventListener(b.visibilityChange, c, false) | |
| } | |
| function c() { | |
| if (e()) { | |
| a.api.play(); | |
| document.removeEventListener(b.visibilityChange, c, false) | |
| } | |
| } | |
| function d() { | |
| return typeof document.addEventListener !== "undefined" && typeof document[b.hidden] !== "undefined" | |
| } | |
| function e() { | |
| return a && a.api | |
| } | |
| } | |
| function i(b, c) { | |
| var d = $(".article-main-image"), | |
| e = $(".theatre-video-container"); | |
| if (e.length) { | |
| d = e | |
| } | |
| var f = d.parents(".content-wrapper"), | |
| g = d.find(".video .video-container"), | |
| h = g.find(".small-video-caption"); | |
| if (!g.length || c === true) { | |
| return | |
| } | |
| var i = 320; | |
| var j = 250; | |
| var k = 300; | |
| var l = g.offset().top + g.outerHeight() / 2; | |
| var m = d.width(); | |
| var n = d.height(); | |
| var o; | |
| var p = "main"; | |
| window.addEventListener("scroll", a.throttle(r, 150)); | |
| window.addEventListener("resize", a.throttle(s, 150)); | |
| var q = "NOT_READY"; | |
| b.addEventListener(function(a) { | |
| var b = a.state !== q; | |
| if (a.state === "ENDED" && q !== "ENDED") { | |
| u() | |
| } | |
| q = a.state; | |
| if (b) { | |
| r() | |
| } | |
| }); | |
| function r() { | |
| var a = g.find("video")[0]; | |
| if ($.isViewport("above-medium")) { | |
| if (window.pageYOffset > l && p === "main" && (q === "PLAYING" || q === "LOADING" || q === "NOT_READY") && !(a && a.webkitPresentationMode === "picture-in-picture")) { | |
| t() | |
| } | |
| if (window.pageYOffset < l && p === "fixed") { | |
| u() | |
| } | |
| } | |
| } | |
| function s() { | |
| if (p === "fixed") { | |
| if ($.isViewport("above-medium")) { | |
| w() | |
| } else { | |
| u() | |
| } | |
| } | |
| m = d.width(); | |
| n = d.height() | |
| } | |
| function t() { | |
| p = "fixed"; | |
| v(a, b, c); | |
| function a() { | |
| var a = g.offset(); | |
| var b = a.top - window.pageYOffset; | |
| var c = a.left - window.pageXOffset; | |
| g.addClass("in-right-lane-position"); | |
| x(g, c, b); | |
| g.css("height", n); | |
| g.css("width", m) | |
| } | |
| function b() { | |
| w() | |
| } | |
| function c() { | |
| h.removeClass("hidden"); | |
| h.css("transform", "translate3d(0px,0px,0px)") | |
| } | |
| } | |
| function u() { | |
| p = "main"; | |
| v(a, b, c); | |
| function a() { | |
| var a = d.offset(); | |
| var b = g.offset(); | |
| var c = b.top - a.top; | |
| var e = b.left - a.left; | |
| x(g, e, c); | |
| g.removeClass("in-right-lane-position") | |
| } | |
| function b() { | |
| x(g, 0, 0); | |
| g.css("width", m); | |
| g.css("height", n); | |
| h.addClass("hidden") | |
| } | |
| function c() { | |
| g.css("width", ""); | |
| g.css("height", "") | |
| } | |
| } | |
| function v(a, b, c) { | |
| a(); | |
| setTimeout(function() { | |
| b(); | |
| g.addClass("during-animation"); | |
| g.addClass("transparent"); | |
| clearTimeout(o); | |
| o = setTimeout(function() { | |
| g.removeClass("during-animation"); | |
| g.removeClass("transparent"); | |
| c() | |
| }, j + k) | |
| }, 0) | |
| } | |
| function w() { | |
| var a = g.find("video")[0]; | |
| if (a && a.webkitPresentationMode === "picture-in-picture") { | |
| u(); | |
| return | |
| } | |
| var b = parseInt(f.css("paddingRight"), 10); | |
| var c = -1; | |
| var d = c + f.offset().left + f.width() + b - i; | |
| var e = Math.round(d); | |
| g.css("width", i); | |
| g.css("height", i * 9 / 16); | |
| x(g, e, 0) | |
| } | |
| function x(a, b, c) { | |
| a.css("left", b); | |
| a.css("top", c) | |
| } | |
| } | |
| window.VideoUtils = { | |
| init: function(a) { | |
| g(a) | |
| } | |
| } | |
| })(); | |
| window.Events.bind("comment:posted", function() { | |
| "use strict"; | |
| window.dataLayer.push({ | |
| event: "eventinfo", | |
| eventCategory: "comments", | |
| eventAction: "comment-sent" | |
| }) | |
| }); | |
| (function() { | |
| "use strict"; | |
| var a = true; | |
| var b = window._; | |
| var c = { | |
| categories: [], | |
| tags: [] | |
| }; | |
| var d; | |
| var e; | |
| var f; | |
| var g; | |
| var h; | |
| function i() { | |
| var a = $(".ruokala-tag-selection"); | |
| if (a.length !== 1) { | |
| throw new Error("There should be exactly one .ruokala-tag-selection element") | |
| } | |
| d = $(".ruokala-search-form form"); | |
| e = a.find(".ruokala-tag-selection-selected-tags"); | |
| f = a.find(".ruokala-tag-selection-clear"); | |
| g = a.find(".ruokala-tag-selection-tags > li"); | |
| h = a.find(".ruokala-tag-selection-categories") | |
| } | |
| function j(a) { | |
| c.categories = b.map(a, function(a, b) { | |
| return { | |
| title: a, | |
| index: b, | |
| selected: false | |
| } | |
| }); | |
| var d = document.createDocumentFragment(); | |
| b.each(c.categories, function(a) { | |
| $("<li>").text(a.title).data("index", a.index).addClass("ruokala-tag-selection-tag").appendTo(d) | |
| }); | |
| h.html(d) | |
| } | |
| function k(a) { | |
| var d = b.findWhere(c.categories, { | |
| index: a | |
| }); | |
| if (!d) { | |
| return | |
| } | |
| var e = d.selected; | |
| b.each(c.categories, function(a) { | |
| a.selected = false | |
| }); | |
| d.selected = !e; | |
| s() | |
| } | |
| function l() { | |
| var a = []; | |
| g.each(function() { | |
| var b = $(this); | |
| var d = b.children("h2").hide().text().trim(); | |
| a.push(d); | |
| b.children("ul").children().each(function() { | |
| var a = $(this).find(".ruokala-tag-selection-tag"); | |
| c.tags.push({ | |
| name: a.text().trim(), | |
| url: a.data("tagurl"), | |
| category: d, | |
| selected: false | |
| }) | |
| }) | |
| }); | |
| j(a) | |
| } | |
| function m(a) { | |
| return b.findWhere(c.tags, { | |
| url: a | |
| }) | |
| } | |
| function n() { | |
| var a = e.data("initial-tags").trim(); | |
| if (!a) { | |
| return | |
| } | |
| var c = a.split(","); | |
| b.each(c, o) | |
| } | |
| function o(a) { | |
| var d = m(a); | |
| if (!d) { | |
| return | |
| } | |
| b.chain(c.tags).where({ | |
| category: d.category | |
| }).each(function(a) { | |
| a.selected = false | |
| }); | |
| d.selected = true; | |
| b.each(c.categories, function(a) { | |
| a.selected = false | |
| }); | |
| s() | |
| } | |
| function p(a) { | |
| var b = m(a); | |
| if (!b) { | |
| return | |
| } | |
| b.selected = false; | |
| s() | |
| } | |
| function q() { | |
| d.find("input[type=search]").val("") | |
| } | |
| function r() { | |
| b.each(c.tags, function(a) { | |
| a.selected = false | |
| }); | |
| s() | |
| } | |
| function s() { | |
| var a = b.where(c.tags, { | |
| selected: true | |
| }); | |
| e.empty(); | |
| b.each(a, function(a) { | |
| var b = $("<li>").text(a.name).data("tagurl", a.url).data("name", a.name).addClass("ruokala-selected-tag").append($("<a>").attr("href", "#")); | |
| b.appendTo(e) | |
| }); | |
| if (a.length > 0) { | |
| e.parent().show() | |
| } else { | |
| e.parent().hide() | |
| } | |
| var d = g.find(".ruokala-tag-selection-tag"); | |
| d.parent().filter(".selected").removeClass("selected"); | |
| b.each(a, function(a) { | |
| d.filter('[data-tagurl="' + a.url + '"]').parent().addClass("selected") | |
| }); | |
| var f = "selected-category"; | |
| h.children().removeClass(f); | |
| g.removeClass(f); | |
| var i = b.findWhere(c.categories, { | |
| selected: true | |
| }); | |
| if (i) { | |
| var j = i.index; | |
| h.children().eq(j).addClass(f); | |
| g.eq(j).addClass(f); | |
| g.parent().show() | |
| } else { | |
| g.parent().hide() | |
| } | |
| } | |
| function t() { | |
| if (!a) { | |
| return | |
| } | |
| d.submit() | |
| } | |
| function u() { | |
| h.on("click", "li", function(a) { | |
| a.preventDefault(); | |
| k($(this).data("index")) | |
| }); | |
| g.on("click", ".ruokala-tag-selection-tag", function(a) { | |
| a.preventDefault(); | |
| o($(this).data("tagurl")); | |
| t() | |
| }); | |
| e.on("click", "a", function(a) { | |
| a.preventDefault(); | |
| p($(this).parent().data("tagurl")); | |
| t() | |
| }); | |
| f.on("click", function(a) { | |
| a.preventDefault(); | |
| q(); | |
| r(); | |
| t() | |
| }); | |
| d.on("submit", function() { | |
| b.chain(c.tags).where({ | |
| selected: true | |
| }).each(function(a) { | |
| $("<input>").attr({ | |
| name: "tag", | |
| type: "hidden", | |
| value: a.url | |
| }).appendTo(d) | |
| }) | |
| }) | |
| } | |
| function v() { | |
| i(); | |
| l(); | |
| n(); | |
| u(); | |
| s() | |
| } | |
| function w(a) { | |
| $(a).click(function(a) { | |
| a.preventDefault(); | |
| var c = $(".ruokala-tag-selection"); | |
| var d = $(this), | |
| e = d.parents("section.ruokala-recipes-search-results"), | |
| f = $('section.search-form select[name="period"]').val(), | |
| g = $('section.search-form select[name="category"]').val(), | |
| h = $('section.search-form select[name="order"]').val(), | |
| i = c.find(".ruokala-selected-tag"), | |
| j = e.find("li.ruokala-recipe-list-item").length; | |
| d.addClass("loading"); | |
| var k = b.map(i, function(a) { | |
| return $(a).data("tagurl") | |
| }); | |
| $.ajax({ | |
| type: "GET", | |
| url: "/rest/recipes/search", | |
| data: $.param({ | |
| query: $("#ruokala-search-form-input-field").val(), | |
| period: f, | |
| category: g, | |
| order: h, | |
| start: j, | |
| tags: k.join(",") | |
| }) | |
| }).done(function(a) { | |
| var b = e.find("ul"); | |
| b.append(a); | |
| window.ImageStack.checkVisible(b) | |
| }).always(function() { | |
| d.removeClass("loading"); | |
| if (e.find(".list-end").length > 0) { | |
| d.hide() | |
| } | |
| }) | |
| }) | |
| } | |
| function x(a) { | |
| $(a).children("form").on("submit", function(a) { | |
| var b = $(this).children('input[name="search-term"]').val().trim(); | |
| if (!b) { | |
| a.preventDefault() | |
| } | |
| }) | |
| } | |
| window.RuokalaRecipeSearch = { | |
| initTagSearch: v, | |
| initSearchResults: w, | |
| disableEmptySubmit: x | |
| } | |
| })(); | |
| window.EmailUtil = { | |
| initialize: function(a) { | |
| "use strict"; | |
| var b = $(".share-email", a); | |
| b.removeClass("share-not-available"); | |
| if (window.Features.isDesktop) { | |
| b.each(function(a, b) { | |
| this.initEmailForm($(b)) | |
| }.bind(this)) | |
| } | |
| }, | |
| countButtons: function() { | |
| "use strict"; | |
| $(".share-buttons-container").each(function(a, b) { | |
| var c = $(b); | |
| c.closest(".share-buttons").attr("data-buttons", c.find(".share-button,.print-button").length) | |
| }) | |
| }, | |
| removeButton: function(a) { | |
| "use strict"; | |
| $(".share-email", a).remove() | |
| }, | |
| initEmailForm: function(a) { | |
| "use strict"; | |
| var b = a.closest(".share-buttons"), | |
| c = b.attr("data-article-id"), | |
| d = $(window.Tools.getTemplate("email-share-form", { | |
| articleId: c | |
| })), | |
| e = $(window.Tools.getTemplate("email-share-success")), | |
| f = window.Forms; | |
| b.append(d); | |
| b.append(e); | |
| var g = b.find(".email-share-form"), | |
| h = b.find(".email-share-success"), | |
| i = g.find("button.send-form"), | |
| j = g.find(".buttons .error"); | |
| f.createForm(g, "/rest/sendmail", "Lähetys keskeytyi. Kokeile myöhemmin uudelleen.", function() { | |
| g.hide(); | |
| h.find(".email").text(this.recipient); | |
| h.show() | |
| }, undefined, function(a) { | |
| i.text("Lähetä").removeClass("sending"); | |
| f.cleanErrors(g); | |
| if (a.status === 500) { | |
| j.show() | |
| } else { | |
| j.hide() | |
| } | |
| }); | |
| g.find(".cancel").click(function(a) { | |
| a.preventDefault(); | |
| g.hide(); | |
| f.cleanErrors(g) | |
| }); | |
| g.find("button.send-form").click(function(a) { | |
| a.preventDefault(); | |
| i.addClass("sending").html('<i class="fa-circle-o-notch"></i>'); | |
| setTimeout(function() { | |
| g.submit() | |
| }, 200); | |
| return false | |
| }); | |
| h.find(".close").click(function(a) { | |
| a.preventDefault(); | |
| h.hide() | |
| }); | |
| a.click(function(a) { | |
| a.preventDefault(); | |
| window.EmailUtil.countButtons(); | |
| h.hide(); | |
| $(".email-share-form").not(g.get(0)).hide(); | |
| g.toggle() | |
| }); | |
| return g | |
| } | |
| }; | |
| (function() { | |
| "use strict"; | |
| var a = { | |
| "share-facebook": "supportsFbShare", | |
| "share-twitter": "supportsTwitter", | |
| "share-whatsapp": "supportsWhatsApp", | |
| "share-email": "supportsEmail", | |
| "share-fb-messenger": "supportsFbMessenger", | |
| "share-linkedin": "supportsLinkedIn", | |
| "share-print": "supportsPrint" | |
| }, | |
| b = { | |
| "share-facebook": "shareFacebook", | |
| "share-twitter": "shareTwitter", | |
| "share-whatsapp": "shareWhatsApp", | |
| "share-linkedin": "shareLinkedIn", | |
| "share-print": "sharePrint" | |
| }, | |
| c = "share-buttons", | |
| d = "print-button", | |
| e = "share-buttons-container", | |
| f = "fb-app-id", | |
| g = window._, | |
| h = window.Features; | |
| window.SoMe = { | |
| quickInit: function(a, b) { | |
| if (a.tagName !== "SPAN") { | |
| return | |
| } | |
| this.initFacebook(); | |
| $(a).click(function(c) { | |
| c.preventDefault(); | |
| window.SoMe[b](a) | |
| }) | |
| }, | |
| ajaxInit: function(a) { | |
| var b = $(".quick-share"), | |
| c = $(".share-buttons"); | |
| if (b.length > a) { | |
| g.each(g.last($(".quick-share .facebook span"), a), function(a) { | |
| this.quickInit(a, "shareFacebook") | |
| }, this); | |
| g.each(g.last($(".quick-share .twitter span"), a), function(a) { | |
| this.quickInit(a, "shareTwitter") | |
| }, this) | |
| } | |
| if (c.length > a) { | |
| this.initFacebook(g.last(c.parent(), a)); | |
| g.each(g.last(c, a), function(a) { | |
| this.init(a) | |
| }, this) | |
| } | |
| }, | |
| init: function(d) { | |
| if (d.tagName === "SCRIPT") { | |
| return | |
| } | |
| var f = d.getElementsByClassName(c)[0] || d, | |
| i = f.getElementsByClassName(e)[0], | |
| j = document.body.classList || { | |
| contains: function() { | |
| return false | |
| } | |
| }, | |
| k = this; | |
| var l = g.reduce(g.keys(a), function(c, d) { | |
| var e = f.getElementsByClassName(d)[0]; | |
| if (e) { | |
| var g = h[a[d]]; | |
| if (g && (d !== "share-print" || j.contains("ruokalan-reseptit")) && (d !== "share-linkedin" || j.contains("taloussanomat"))) { | |
| e.removeAttribute("hidden"); | |
| var i = k[b[d]], | |
| l = $("a", e).get(0); | |
| if (!window.isMAL && !!i) { | |
| $(e).click(function(a) { | |
| a.preventDefault(); | |
| i(l) | |
| }) | |
| } | |
| return c + 1 | |
| } else { | |
| e.parentNode.removeChild(e) | |
| } | |
| } | |
| return c | |
| }, 0); | |
| if (i) { | |
| i.setAttribute("data-button-count", l) | |
| } | |
| if (h.supportsFbShare) { | |
| this.initFacebook(); | |
| this.displayFacebookShareCount(d) | |
| } | |
| if (h.supportsEmail) { | |
| window.EmailUtil.initialize(d) | |
| } | |
| }, | |
| initDefaultButtons: function(a) { | |
| if (h.supportsFbLike && a.tagName === "DIV") { | |
| this.initFacebook() | |
| } | |
| if (h.supportsPrint && (document.body.classList && !document.body.classList.contains("ruokala"))) { | |
| var b = a.getElementsByClassName(d)[0]; | |
| if (b) { | |
| b.removeAttribute("hidden"); | |
| $(b).click(this.sharePrint) | |
| } | |
| } | |
| }, | |
| initFacebook: function() { | |
| if (!window.FB) { | |
| window.fbAsyncInit = function() { | |
| window.SoMe.runFBInit() | |
| }; | |
| window.Tools.getScript("https://connect.facebook.net/fi_FI/sdk.js", null, "facebook-jssdk") | |
| } | |
| }, | |
| runFBInit: function() { | |
| window.FB.init({ | |
| appId: window.SoMe.getFbAppId(), | |
| xfbml: true, | |
| version: "v2.5" | |
| }) | |
| }, | |
| displayFacebookShareCount: function(a) { | |
| var b = $(".share-facebook-count", a); | |
| b.each(function() { | |
| var a = $(this); | |
| var b = encodeURIComponent(this.getAttribute("data-url")); | |
| window.Rest.getJsonWithCache("https://graph.facebook.com/" + b, function(b) { | |
| if (b && !b.error && b.share && b.share.share_count) { | |
| a.html(b.share.share_count) | |
| } | |
| }) | |
| }) | |
| }, | |
| getFbAppId: function() { | |
| return document.getElementById(f).getAttribute("content") | |
| }, | |
| shareFacebook: function(a) { | |
| var b = a.getAttribute("href"), | |
| c = a.getAttribute("data-image") || null, | |
| d = window.SoMe.getFbAppId(); | |
| window.FB.ui({ | |
| appId: d, | |
| method: "share", | |
| href: b, | |
| picture: c | |
| }) | |
| }, | |
| shareTwitter: function(a) { | |
| var b = a.getAttribute("data-text") || "", | |
| c = a.getAttribute("data-url"), | |
| d = a.getAttribute("data-handle"), | |
| e = "https://twitter.com/intent/tweet?lang=fi&via=" + encodeURIComponent(d) + "&text=" + encodeURIComponent(b) + "&url=" + encodeURIComponent(c); | |
| if (!window.Tools.popupCenter(e, "twtDlg", 640, 400)) { | |
| window.location = e | |
| } | |
| }, | |
| shareLinkedIn: function(a) { | |
| var b = a.getAttribute("href"); | |
| var c = "http://www.linkedin.com/shareArticle?mini=true&url=" + encodeURIComponent(b); | |
| if (!window.Tools.popupCenter(c, "linkedin", 640, 400)) { | |
| window.location = c | |
| } | |
| }, | |
| sharePrint: function() { | |
| window.print() | |
| }, | |
| initBeforePrint: function(a) { | |
| var b = function() { | |
| if ($("#main-logo-print").length === 0) { | |
| $(".header-inner-wrapper").prepend('<img src="' + a + '" id="main-logo-print">') | |
| } | |
| }; | |
| if ("onbeforeprint" in window) { | |
| window.onbeforeprint = b | |
| } else if (window.Features.isDesktop) { | |
| b() | |
| } | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.ImageGallery = { | |
| init: function() { | |
| if (window.Features.isDesktop && $.isViewport("above-medium")) { | |
| $("article.single-article").magnificPopup({ | |
| delegate: ".mfp-lightbox-item", | |
| type: "image", | |
| image: { | |
| titleSrc: function(a) { | |
| return a.img.attr("alt") | |
| } | |
| }, | |
| gallery: { | |
| enabled: true, | |
| tCounter: "%curr% / %total%" | |
| }, | |
| callbacks: { | |
| afterChange: function(a) { | |
| setTimeout(function() { | |
| var b = $(".mfp-figure figure"); | |
| b.find(".quick-share").remove(); | |
| a.el.prev(".quick-share").clone(true).appendTo(b) | |
| }, 1) | |
| } | |
| } | |
| }) | |
| } | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| function a(a) { | |
| var b = a.find(".heading").first(); | |
| a.toggleClass("collapsed", true); | |
| b.on("click", function() { | |
| a.toggleClass("collapsed") | |
| }) | |
| } | |
| window.CollapseTables = { | |
| initialize: function(b) { | |
| $(".collapseTable", b).each(function(b, c) { | |
| a($(c)) | |
| }) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.StickyHeaderTable = function(a) { | |
| this.$wrapper = a; | |
| this.$table = null; | |
| this.table = null; | |
| this.height = this.$wrapper.height(); | |
| this.width = this.$wrapper.width(); | |
| this.$cloneHolder = null; | |
| this.$cloneTable = null; | |
| this.isHeaderAppended = false; | |
| this.addHeader = function() { | |
| if (!this.isHeaderAppended) { | |
| this.$cloneTable.appendTo(this.$cloneHolder); | |
| this.isHeaderAppended = true | |
| } | |
| }; | |
| this.removeHeader = function() { | |
| if (this.isHeaderAppended) { | |
| this.$cloneTable.remove(); | |
| this.isHeaderAppended = false | |
| } | |
| }; | |
| this.toggleHeader = function() { | |
| var a = window.pageYOffset - this.$wrapper.offset().top, | |
| b = a >= 0 && a <= this.height; | |
| if (b) { | |
| this.addHeader() | |
| } else { | |
| this.removeHeader() | |
| } | |
| }; | |
| this.bindSideScroll = function() { | |
| this.$cloneHolder.get()[0].onscroll = function() { | |
| this.table.style.transform = "translate(" + this.$cloneHolder.scrollLeft() * -1 + "px, 0)" | |
| }.bind(this) | |
| }; | |
| this.resizeHeader = function() { | |
| this.removeHeader(); | |
| this.$cloneHolder.width(this.$wrapper.width()) | |
| }; | |
| this.initialize = function() { | |
| this.$table = this.$wrapper.find("table").first(); | |
| this.table = this.$table.get(0); | |
| this.$cloneTable = $("<table>").addClass(this.table.className + "-clone"); | |
| this.$cloneHolder = $("<div>").addClass("clone-table-container").appendTo(this.$wrapper); | |
| $("<thead>").append(this.$table.find("tr:first").clone(false)).appendTo(this.$cloneTable); | |
| this.$cloneTable.append(this.$table.find("tbody").clone(false)); | |
| this.resizeHeader(); | |
| $(window).resize(this.resizeHeader.bind(this)); | |
| this.bindSideScroll(); | |
| $(window).scroll(this.toggleHeader.bind(this)); | |
| this.toggleHeader() | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.ArticleTable = { | |
| initialize: function(a) { | |
| new window.StickyHeaderTable($(a)).initialize() | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.Rest; | |
| var b = window.Forms; | |
| b.createForm = function(c, d, e, f, g, h) { | |
| f = f || function() { | |
| c.find(".success").show()[0].scrollIntoView(); | |
| c.find(".errors, .fields").hide() | |
| }; | |
| g = g || function(a) { | |
| a.preventDefault(); | |
| b.clean(c) | |
| }; | |
| h = h || function() {}; | |
| b.translatedHTML5ValidationsForForm(c); | |
| c.submit(function(g) { | |
| g.preventDefault(); | |
| b.cleanErrors(c); | |
| var i = b.collect(c); | |
| i.userAgent = navigator.userAgent; | |
| a.postJson(d, i).always(h).done(f.bind(i)).fail(b.showError(c, e)); | |
| return false | |
| }); | |
| c.find(".maxlength").each(function(a, b) { | |
| var d = $(b), | |
| e = parseInt(d.data("maxlength"), 10); | |
| d.on("keypress keyup input change paste cut focusin focusout", window.Forms.updateAvailableCharactersInfo(c.find(".input-info"), e)) | |
| }); | |
| c.find(".btn-cancel").click(g) | |
| }; | |
| b.updateAvailableCharactersInfo = function(a, b) { | |
| var c; | |
| return function(d) { | |
| var e = $(d.currentTarget).val(); | |
| if (c !== e) { | |
| c = e; | |
| var f = e.length; | |
| a.text(b - f + " merkkiä jäljellä").toggleClass("warning", f > b) | |
| } | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.Forms; | |
| window.FeedbackForm = { | |
| init: function() { | |
| var b = $("#frm-feedback"); | |
| a.translatedHTML5ValidationsForForm(b); | |
| a.createForm(b, "/rest/feedback", "Lähetys keskeytyi. Kokeile myöhemmin uudelleen.", function() { | |
| var a = $("#feedback-confirmation"); | |
| a.addClass("active").prev().removeClass("active"); | |
| a.find(".success").show() | |
| }, function(a) { | |
| a.preventDefault(); | |
| window.location.hash = ""; | |
| d() | |
| }); | |
| b.find("div.radio, select").on("click, change", function(a) { | |
| var d = b.find("fieldset.active"); | |
| var e = $(a.currentTarget).find(":checked").val(); | |
| b.find("span.info").text(e); | |
| c(d) | |
| }); | |
| function c(a) { | |
| a.removeClass("active").next().addClass("active"); | |
| window.location.hash = "palaute"; | |
| $(window).on("hashchange", d) | |
| } | |
| function d() { | |
| if (window.location.hash === "") { | |
| $(window).off("hashchange", d); | |
| var a = b.find("fieldset.active"); | |
| a.removeClass("active").prev().addClass("active") | |
| } | |
| } | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| function a() { | |
| var a = window.ProfileInfo.getUserProfile(); | |
| b(a.session); | |
| window.Events.bind("subscription", function(a, c, d) { | |
| b(d) | |
| }) | |
| } | |
| function b(a) { | |
| window.loginWidget.setOptions({ | |
| isLoggedIn: a.loggedIn | |
| }); | |
| if (a.loggedIn) { | |
| window.loginWidget.setAccount({ | |
| accountId: a.accountId, | |
| firstName: a.firstname, | |
| lastName: a.lastname | |
| }) | |
| } | |
| if (a.company) { | |
| window.loginWidget.setOptions({ | |
| menuLinks: [] | |
| }) | |
| } | |
| } | |
| window.LoginWidgetUpdater = { | |
| initialize: a | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = "_hist"; | |
| var b = window.BrowserStorage; | |
| function c(c) { | |
| b.setJSON(a, c) | |
| } | |
| function d(c) { | |
| var d = b.getJSON(a); | |
| if (!d) { | |
| return [] | |
| } | |
| for (var e = 0; e < d.length; e++) { | |
| var f = d[e]; | |
| if (f && f.time < c) { | |
| d.splice(e, 1) | |
| } | |
| } | |
| return d | |
| } | |
| function e(a) { | |
| a.setHours(0, 0, 0, 0); | |
| var b = a.getTime(); | |
| var c = a.getDay(); | |
| var d = c === 0 ? -6 : 1 - c; | |
| return b + d * 24 * 3600 * 1e3 | |
| } | |
| function f(a, b) { | |
| for (var c = 0; c < b.length; c++) { | |
| if (b[c] && b[c].id === a) { | |
| return true | |
| } | |
| } | |
| return false | |
| } | |
| function g() { | |
| var a = $('meta[property="og:url"]').attr("content"); | |
| var b = a.match("[?&]share=([^&]+)"); | |
| var c = document.location.href.match("[?&]share=([^&]+)"); | |
| if (b && c) { | |
| return b[1] === c[1] | |
| } | |
| return false | |
| } | |
| function h(a) { | |
| for (var b = 0; b < a.referrers.length; b++) { | |
| if (document.referrer.indexOf(a.referrers[b]) !== -1) { | |
| return true | |
| } | |
| } | |
| return false | |
| } | |
| function i(a, b) { //severi | |
| console.log("SEVERI"); | |
| return; //severi | |
| if ($("body").hasClass("subscription")) { | |
| return | |
| } else if ($("body").hasClass("nosubscription")) { | |
| j(a, b) | |
| } else { | |
| window.Events.bind("subscription", function(c, d) { | |
| if (!d) { | |
| j(a, b) | |
| } | |
| }) | |
| } | |
| } | |
| function j(a, b) { | |
| var i = new Date; | |
| var j = e(i); | |
| var l = d(j); | |
| if (f(a, l)) { | |
| return | |
| } | |
| if (g()) { | |
| return | |
| } | |
| if (h(b)) { | |
| return | |
| } | |
| if (l.length >= b.quota) { | |
| k() | |
| } else { | |
| l.push({ | |
| id: a, | |
| time: i.getTime() | |
| }); | |
| c(l) | |
| } | |
| } | |
| function k() { | |
| //$("body").addClass("show-paywall"); // severi | |
| var a = $(".body"); | |
| var b = a.html().substring(0, 300); | |
| var c = b.lastIndexOf("."); | |
| if (c !== -1) { | |
| a.html(b.substring(0, c + 1)) | |
| } else { | |
| a.html(b) | |
| } | |
| window.dataLayer.push({ | |
| event: "SNDP-event", | |
| eventCategory: "HS-Maksumuuri", | |
| eventAction: "muuri", | |
| eventLabel: "v1" | |
| }) | |
| } | |
| window.MeteredPaywall = { | |
| init: i | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.$; | |
| var b = window.Rest; | |
| var c = {}; | |
| function d() { | |
| a(".plus-article").each(function(b, c) { | |
| if (b === 0) { | |
| e(a(c)) | |
| } | |
| }) | |
| } | |
| function e(b) { | |
| c.config = a.extend({}, b.data()); | |
| c.$scope = b; | |
| c.$body = a("body"); | |
| c.$articleBody = a(".body", c.$scope); | |
| c.$articleFactboxContainer = a(".factbox-container", c.$scope); | |
| c.$articleSidebarContainer = a(".sidebar-container", c.$scope); | |
| c.$theatreVideo = a(".theatre-video-container"); | |
| c.$articleVideo = a(".article-main-image", c.$scope); | |
| window.ProfileInfo.removeHash(); | |
| f() | |
| } | |
| function f() { | |
| c.$body.addClass("content-loading"); | |
| g().always(function() { | |
| c.$body.removeClass("content-loading") | |
| }) | |
| } | |
| function g() { | |
| return b.getJson("/rest/paid" + "{articlePath}/art-{articleId}".format({ | |
| articlePath: c.config.articlePath, | |
| articleId: c.config.articleId | |
| }), {}).done(function(a) { | |
| i(a.content); | |
| window.ProfileInfo.updateUserProfile(a.profile) | |
| }).fail(function(a) { | |
| if (a && a.responseJSON && a.responseJSON.profile) { | |
| window.ProfileInfo.updateUserProfile(a.responseJSON.profile) | |
| } else { | |
| window.ProfileInfo.updateUserProfile() | |
| } | |
| h() | |
| }) | |
| } | |
| function h() { | |
| c.$body.addClass("show-paywall"); | |
| window.dataLayer.push({ | |
| event: "SNDP-event", | |
| eventCategory: "HS-Maksumuuri", | |
| eventAction: "kovamuuri", | |
| eventLabel: "v1" | |
| }) | |
| } | |
| function i(a) { | |
| if (a.video) { | |
| j(a.video, a.theatre) | |
| } | |
| if (a.body) { | |
| k(a.body) | |
| } | |
| if (a.factbox) { | |
| l(a.factbox) | |
| } | |
| if (a.sidebar) { | |
| m(a.sidebar) | |
| } | |
| } | |
| function j(a, b) { | |
| var d = b ? c.$theatreVideo : c.$articleVideo; | |
| d.html(a); | |
| window.VideoUtils.init(d[0]) | |
| } | |
| function k(a) { | |
| c.$articleBody.html(a); | |
| window.ImageStack.checkVisible(c.$articleBody); | |
| window.CollapseTables.initialize(c.$articleBody[0]) | |
| } | |
| function l(a) { | |
| c.$articleFactboxContainer.html(a) | |
| } | |
| function m(a) { | |
| c.$articleSidebarContainer.html(a) | |
| } | |
| window.PlusContent = { | |
| initialize: d | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.$; | |
| var b = { | |
| fromCookie: false, | |
| session: { | |
| loggedIn: false, | |
| username: "", | |
| firstname: "", | |
| lastname: "", | |
| accountId: "", | |
| companyId: "", | |
| company: false, | |
| subscription: false, | |
| entitlements: [], | |
| accountIdEncoded: "", | |
| nickname: "" | |
| } | |
| }; | |
| var c; | |
| function d() { | |
| return a.extend({ | |
| session: { | |
| loggedIn: false | |
| } | |
| }, b) | |
| } | |
| function e(a) { | |
| c = a; | |
| if (f()) { | |
| h() | |
| } else { | |
| if (g()) { | |
| j() | |
| } else { | |
| h() | |
| } | |
| } | |
| } | |
| function f() { | |
| if (window.location.hash.indexOf("kirjaudu") !== -1) { | |
| if ("pushState" in history) { | |
| history.pushState("", document.title, window.location.pathname + window.location.search) | |
| } else { | |
| window.location.hash = "" | |
| } | |
| return true | |
| } | |
| if (a.cookie("require-userprofile-refresh") !== undefined) { | |
| a.removeCookie("require-userprofile-refresh", { | |
| path: "/" | |
| }); | |
| return true | |
| } | |
| return false | |
| } | |
| function g() { | |
| try { | |
| var c = a.cookie("userprofile"); | |
| if (c !== undefined) { | |
| var d = JSON.parse(c); | |
| b.fromCookie = true; | |
| if (d.loggedIn === true) { | |
| b.session.loggedIn = true; | |
| if (d.username) { | |
| b.session.username = d.username | |
| } | |
| if (d.accountId) { | |
| b.session.accountId = d.accountId | |
| } | |
| if (d.firstname !== undefined) { | |
| b.session.firstname = d.firstname | |
| } | |
| if (d.lastname !== undefined) { | |
| b.session.lastname = d.lastname | |
| } | |
| if (d.subscription !== undefined) { | |
| b.session.subscription = d.subscription | |
| } | |
| if (d.entitlements !== undefined) { | |
| b.session.entitlements = d.entitlements | |
| } | |
| if (d.accountIdEncoded !== undefined) { | |
| b.session.accountIdEncoded = d.accountIdEncoded | |
| } | |
| if (d.nickname !== undefined) { | |
| b.session.nickname = d.nickname | |
| } | |
| if (d.company !== undefined) { | |
| b.session.company = d.company; | |
| b.session.companyId = d.companyId | |
| } | |
| } | |
| return true | |
| } | |
| } catch (a) {} | |
| return false | |
| } | |
| function h() { | |
| a(".js-login-name").addClass("loading"); | |
| window.Rest.getJson(c.userinfoUrl, []).done(function(a) { | |
| try { | |
| o(a) | |
| } catch (a) {} | |
| }).fail(function() { | |
| try { | |
| o() | |
| } catch (a) {} | |
| }).always(function() { | |
| a(".js-login-name").removeClass("loading") | |
| }) | |
| } | |
| function i() { | |
| if (c.isGatlingEnabled) { | |
| window.Rest.getJson(c.gattlingUrl, []).fail(function() {}) | |
| } | |
| } | |
| function j() { | |
| a(".sso-login").show(); | |
| if (b.session.loggedIn) { | |
| var c = b.session.firstname + " " + b.session.lastname; | |
| a(".js-login-name").html(c); | |
| a(".logged-in,.mobile-logout-link").show(); | |
| a(".not-logged-in,.mobile-login-link").hide(); | |
| l() | |
| } else { | |
| k() | |
| } | |
| if (b.session.subscription) { | |
| a("body").addClass("subscription").removeClass("nosubscription") | |
| } else { | |
| a("body").removeClass("nosubscription").addClass("nosubscription") | |
| } | |
| window.Events.trigger("subscription", [b.session.subscription || false, b.session]) | |
| } | |
| function k() { | |
| a(".js-login-name").html(""); | |
| a(".not-logged-in,.mobile-login-link").show(); | |
| a(".mobile-login").hide(); | |
| m() | |
| } | |
| function l() { | |
| var a = { | |
| event: "loginstatus", | |
| "user.segment.isloggedin": "Logged in" | |
| }; | |
| if (b.session.company) { | |
| a["user.profile.profileinfo.companyname"] = b.session.lastname; | |
| a["user.profile.profileinfo.companyid"] = b.session.companyId | |
| } else { | |
| a["user.profile.profileInfo.accountid"] = b.session.accountId; | |
| a["user.profile.profileInfo.subscription"] = b.session.subscription | |
| } | |
| window.dataLayer.push(a) | |
| } | |
| function m() { | |
| window.dataLayer.push({ | |
| event: "loginstatus", | |
| "user.segment.isloggedin": "Not logged in" | |
| }) | |
| } | |
| function n() { | |
| a.cookie("userprofile", JSON.stringify(b.session), { | |
| path: "/" | |
| }) | |
| } | |
| function o(c) { | |
| if (c !== undefined && c.username !== undefined) { | |
| b.fromCookie = false; | |
| b.session.loggedIn = true; | |
| b.session.username = c.username; | |
| b.session.firstname = c.firstname; | |
| b.session.lastname = c.lastname; | |
| b.session.accountId = c.accountId; | |
| if (c.company !== undefined) { | |
| b.session.company = c.company; | |
| b.session.companyId = c.companyId | |
| } else { | |
| b.session.company = false; | |
| b.session.companyId = undefined | |
| } | |
| b.session.subscription = c.subscription; | |
| b.session.entitlements = c.entitlements; | |
| b.session.accountIdEncoded = c.accountIdEncoded; | |
| b.session.nickname = c.nickname; | |
| if (c.subscription && !a.cookie("gatling_token")) { | |
| i() | |
| } | |
| } else { | |
| b.fromCookie = false; | |
| b.session.loggedIn = false; | |
| b.session.username = ""; | |
| b.session.firstname = ""; | |
| b.session.lastname = ""; | |
| b.session.accountId = ""; | |
| b.session.company = false; | |
| b.session.companyId = undefined; | |
| b.session.subscription = ""; | |
| b.session.entitlements = []; | |
| b.session.accountIdEncoded = ""; | |
| b.session.nickname = "" | |
| } | |
| n(); | |
| j() | |
| } | |
| function p() { | |
| if (b.session.loggedIn) { | |
| if (!b.session.subscription || b.session.entitlements.length === 0) { | |
| return 1 | |
| } else if (b.session.entitlements.indexOf("HSVERKKO") !== -1) { | |
| return 2 | |
| } else if (b.session.entitlements.indexOf("HSVERKKOPLUS") !== -1) { | |
| return 3 | |
| } | |
| } | |
| return 0 | |
| } | |
| window.ProfileInfo = { | |
| initialize: e, | |
| updateUserProfile: o, | |
| removeHash: f, | |
| kvInfo: p, | |
| getUserProfile: d | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.Ratings = { | |
| initResults: function(a, b) { | |
| $.ajax({ | |
| type: "GET", | |
| url: "/rest/reviewstars", | |
| data: $.param({ | |
| id: a | |
| }) | |
| }).done(function(a) { | |
| if (a.trim() !== "") { | |
| $(b).append(a); | |
| $(b).parent().show() | |
| } | |
| }) | |
| } | |
| }; | |
| window.AggregateRating = { | |
| add: function() { | |
| $(".recipe-info").attr("itemprop", "aggregateRating").attr("itemtype", "http://schema.org/AggregateRating") | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| function a() { | |
| var a = $(".ruokala-recipe-category-links .category"); | |
| a.each(function() { | |
| var b = $(this); | |
| b.children(".title").click(function() { | |
| b.toggleClass("open"); | |
| a.not(b).removeClass("open") | |
| }) | |
| }) | |
| } | |
| window.RuokalaRecipeCategories = { | |
| init: a | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.Search = { | |
| initForm: function(a) { | |
| $(".search-options select").on("change", function() { | |
| b(this.name, this.value) | |
| }); | |
| $(".select-order li", a).click(function() { | |
| var a = this.parentNode.getAttribute("data-target"); | |
| var c = this.getAttribute("data-value"); | |
| b(a, c) | |
| }); | |
| function b(a, b) { | |
| var c = $(".search-form form"); | |
| c.find("input[name=" + a + "]").val(b); | |
| c.submit() | |
| } | |
| }, | |
| initResults: function(a) { | |
| $(a).click(function(a) { | |
| a.preventDefault(); | |
| var b = $(this), | |
| c = b.parents("section.search-results"), | |
| d = $('section.search-form input[name="period"]').val(), | |
| e = $('section.search-form input[name="category"]').val(), | |
| f = $('section.search-form input[name="order"]').val(), | |
| g = c.find("li.search-result").length; | |
| b.addClass("loading"); | |
| $.ajax({ | |
| type: "GET", | |
| url: "/rest/articles/search", | |
| data: $.param({ | |
| query: $("#search-term").val(), | |
| period: d, | |
| category: e, | |
| order: f, | |
| start: g | |
| }) | |
| }).done(function(a) { | |
| c.find(".results-list").append(a); | |
| window.ImageStack.checkVisible(c) | |
| }).always(function() { | |
| b.removeClass("loading"); | |
| if (c.find(".list-end").length > 0) { | |
| b.hide() | |
| } | |
| }) | |
| }) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.StockServiceLauncher = { | |
| init: function(a) { | |
| if (document.querySelector(".talsa-widget")) { | |
| var b = document.createElement("script"); | |
| b.type = "text/javascript"; | |
| b.src = a || window.stockServiceConfig.fullUrl; | |
| b.id = "talsa-script"; | |
| b.errorpage = "/error/"; | |
| b.onload = function() { | |
| try { | |
| window.StockService.start() | |
| } catch (a) { | |
| window.stockErrors && window.stockErrors.push(a) | |
| } | |
| }; | |
| b.onerror = function(a) { | |
| window.stockErrors && window.stockErrors.push(a) | |
| }; | |
| document.head.appendChild(b) | |
| } | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = []; | |
| window.TulosPalvelu = { | |
| init: function(b) { | |
| $(b).each(function(b, c) { | |
| var d = $(c).data("type"); | |
| if (d && !~$.inArray(d, a)) { | |
| $.getScript(window.tulospalveluConfig.baseUrl + "widget/js-dist/" + d + ".js"); | |
| a.push(d) | |
| } | |
| }) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| if (window.Features.supportsTwitter && !window.isMAL) { | |
| var a = function(a, b, c) { | |
| var d, e = a.getElementsByTagName(b)[0]; | |
| if (a.getElementById(c)) { | |
| return | |
| } | |
| d = a.createElement(b); | |
| d.onload = function() { | |
| if (window.twttr && window.twttr.widgets) { | |
| window.twttr.widgets.load() | |
| } | |
| }; | |
| d.id = c; | |
| e.parentNode.insertBefore(d, e); | |
| d.src = "https://platform.twitter.com/widgets.js" | |
| }; | |
| window.twtrAsyncInit = a; | |
| a(document, "script", "twitter-wjs") | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.$; | |
| var b = window._; | |
| var c = "subscription"; | |
| var d = b.template('<li class="tag">' + "<div><%= title %></div>" + '<a data-id="<%= id %>" class="hs-follow-tag" href="#"><span class="follow-text">Seuraa</span><span class="sym"></span></a>' + "</il>"); | |
| window.UserDataModule = { | |
| loadingPromise: undefined, | |
| loadArticleList: function(b) { | |
| var d = a(b), | |
| e = this; | |
| var f = window.ProfileInfo.getUserProfile(); | |
| if (!f.session.loggedIn) { | |
| d.parent().addClass("hidden"); | |
| window.Events.bind(c, function() { | |
| e.loadArticleList(b) | |
| }) | |
| } else if (f.session.company) { | |
| return | |
| } else { | |
| var g = d.data("id"); | |
| var h = d.data("itemcount"); | |
| var i = "/rest/udm/articles?laneitem={laneItemId}&count={itemcount}".format({ | |
| laneItemId: g, | |
| itemcount: h | |
| }); | |
| var j = d.find("#theme-article-list-container"); | |
| window.Rest.get(i, {}, "html").then(function(a) { | |
| if (a.length > 0) { | |
| j.append(a); | |
| d.parent().removeClass("hidden"); | |
| d.removeClass("hidden"); | |
| window.ImageStack.checkVisible(j); | |
| d.find(".is-more-items-link").data("override-url", "/rest/udm/"); | |
| window.MoreItems.init(d.find(".is-more-items-link")) | |
| } | |
| }) | |
| } | |
| }, | |
| loadSubscriptions: function(a) { | |
| var b = this; | |
| var c = b.getUserId(); | |
| if (c) { | |
| if (!b.loadingPromise || a) { | |
| var d = "/rest/udm/subscriptions"; | |
| b.loadingPromise = window.Rest.getJson(d, {}).then(function(a) { | |
| return a.subscriptions | |
| }, b.errorHandler) | |
| } | |
| return b.loadingPromise | |
| } | |
| }, | |
| addSubscription: function(a) { | |
| var b = this; | |
| var c = "/rest/udm/subscriptions/add"; | |
| var d = { | |
| userId: this.getUserId(), | |
| themeId: a, | |
| timestamp: Date.now() | |
| }; | |
| if (d.userId) { | |
| return window.Rest.postJson(c, d).then(function() { | |
| return b.loadSubscriptions(true) | |
| }, b.errorHandler) | |
| } | |
| }, | |
| getUserId: function() { | |
| var a = window.ProfileInfo.getUserProfile(), | |
| b = undefined; | |
| if (a.session.accountIdEncoded) { | |
| b = a.session.accountIdEncoded | |
| } | |
| return b | |
| }, | |
| removeSubscription: function(a) { | |
| var b = this; | |
| var c = "/rest/udm/subscriptions/remove"; | |
| var d = { | |
| userId: b.getUserId(), | |
| themeId: a, | |
| timestamp: Date.now() | |
| }; | |
| if (d.userId) { | |
| return window.Rest.postJson(c, d).then(function() { | |
| return b.loadSubscriptions(true) | |
| }, b.errorHandler) | |
| } | |
| }, | |
| createSubscriptionEditor: function(e) { | |
| var f = a(e), | |
| g = f.find("ol"), | |
| h = this, | |
| i = h.getUserId(), | |
| j = window.ProfileInfo.getUserProfile(); | |
| if (!i) { | |
| f.find(".login-nag").removeClass("hidden"); | |
| window.Events.bind(c, function() { | |
| f.find(".login-nag").addClass("hidden"); | |
| h.createSubscriptionEditor(e) | |
| }) | |
| } else if (j.session.company) { | |
| f.find(".corporate-nag").removeClass("hidden") | |
| } else { | |
| h.loadSubscriptions().then(function(c) { | |
| if (c.length === 0) { | |
| f.find(".subscribe-nag").removeClass("hidden") | |
| } | |
| var e = b(c).map(function(b) { | |
| var c = a(d({ | |
| title: b.title, | |
| id: b.id | |
| })); | |
| h.initFollowLink(c, f); | |
| return c | |
| }); | |
| b(e).forEach(function(a) { | |
| g.append(a) | |
| }) | |
| }) | |
| } | |
| }, | |
| initFollowLink: function(d, e) { | |
| var f = this, | |
| g = a(d), | |
| h = g.find(".hs-follow-tag"), | |
| i = h.data("id"); | |
| var j = window.ProfileInfo.getUserProfile(); | |
| if (!j.session.loggedIn) { | |
| h.on("click", function(b) { | |
| b && b.preventDefault(); | |
| a(".SacuWidget-text ").trigger("click") | |
| }); | |
| window.Events.bind(c, function() { | |
| f.initFollowLink(d, e) | |
| }) | |
| } else { | |
| f.loadSubscriptions().then(function(a) { | |
| var c = b(a).find(function(a) { | |
| return a.id === i | |
| }); | |
| if (c) { | |
| h.on("click", function(a) { | |
| a.preventDefault(); | |
| h.off("click"); | |
| f.removeSubscription(i).then(function() { | |
| f.initFollowLink(d, e) | |
| }) | |
| }).addClass("subscribed") | |
| } else { | |
| h.on("click", function(a) { | |
| a.preventDefault(); | |
| h.off("click"); | |
| f.addSubscription(i).then(function() { | |
| f.initFollowLink(d, e) | |
| }) | |
| }).removeClass("subscribed") | |
| } | |
| }) | |
| } | |
| }, | |
| errorHandler: function(a) { | |
| if (a.statusText === "abort") { | |
| return | |
| } | |
| throw a | |
| }, | |
| disableForCorporateUsers: function(b) { | |
| var d = this; | |
| var e = window.ProfileInfo.getUserProfile(); | |
| if (!e.session.loggedIn) { | |
| window.Events.bind(c, function() { | |
| d.disableForCorporateUsers(b) | |
| }) | |
| } else if (e.session.company) { | |
| a(b).hide() | |
| } | |
| } | |
| } | |
| })(); | |
| $(function() { | |
| "use strict"; | |
| var a = function(a) { | |
| var b = $(a.iframe); | |
| if (b) { | |
| b.css("width", "100%"); | |
| b.parent(".iframe-wrap").removeClass("iframe-wrap").css("padding-top", "") | |
| } | |
| }; | |
| $(".lazyload").lazyload({ | |
| failurelimit: 10, | |
| threshold: 800, | |
| loadedCallback: function(b) { | |
| if (b.hasClass("autoresize")) { | |
| window.iFrameResize({ | |
| resizedCallback: a | |
| }, b.id) | |
| } | |
| } | |
| }); | |
| $("iframe.autoresize").iFrameResize({ | |
| resizedCallback: a | |
| }) | |
| }); | |
| (function() { | |
| "use strict"; | |
| var a = ".six-most-popular .most-popular"; | |
| var b = function() { | |
| $(a).slick({ | |
| dots: false, | |
| infinite: false, | |
| speed: 125, | |
| slidesToShow: 3, | |
| slidesToScroll: 3, | |
| arrows: false, | |
| variableWidth: true, | |
| responsive: [{ | |
| breakpoint: 960, | |
| settings: { | |
| slidesToShow: 4, | |
| slidesToScroll: 3 | |
| } | |
| }, { | |
| breakpoint: 768, | |
| settings: { | |
| slidesToShow: 3, | |
| slidesToScroll: 2 | |
| } | |
| }, { | |
| breakpoint: 560, | |
| settings: { | |
| slidesToShow: 1, | |
| slidesToScroll: 1 | |
| } | |
| }] | |
| }) | |
| }; | |
| window.alsoReadTheseCarousel = { | |
| initialize: function() { | |
| window.setTimeout(function() { | |
| if (window.innerWidth < 1025) { | |
| b() | |
| } | |
| }); | |
| $(window).resize(window._.debounce(function() { | |
| if (window.innerWidth > 1024) { | |
| $(a).slick("unslick") | |
| } else if (!$(a).hasClass("slick-initialized")) { | |
| b() | |
| } | |
| }, 100)) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = $(document); | |
| var b = function() { | |
| var b = $(".article-metasection"); | |
| var c = $(".secondary-header"); | |
| $(window).scroll(window._.debounce(function() { | |
| var d = a.scrollTop(); | |
| var e = b.offset().top; | |
| if (d > e) { | |
| c.addClass("show-header"); | |
| $(".video-container.in-right-lane-position").addClass("bump-down") | |
| } else { | |
| c.removeClass("show-header"); | |
| $(".video-container.in-right-lane-position").removeClass("bump-down") | |
| } | |
| }, 200)) | |
| }; | |
| window.stickyHeaderHS = { | |
| initialize: function() { | |
| if (window.Features.supportsCssTransitions) { | |
| a.ready(b) | |
| } else { | |
| $(".secondary-header").hide() | |
| } | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window.Features.device.identity === "android" || /iPad/i.test(navigator.userAgent), | |
| b = "click", | |
| c = "click touchstart"; | |
| function d(a, b) { | |
| e(a); | |
| if (b.hasClass("has-subs")) { | |
| b.addClass("on"); | |
| b.find(".dropdown").slideToggle("fast") | |
| } | |
| } | |
| function e(a) { | |
| var b = a.find("> li.on"); | |
| b.removeClass("on"); | |
| b.find(".dropdown").slideToggle("fast") | |
| } | |
| function f(a) { | |
| a.preventDefault(); | |
| a.stopImmediatePropagation() | |
| } | |
| function g(a) { | |
| if ($(this).hasClass("has-subs")) { | |
| f(a) | |
| } else { | |
| a.stopImmediatePropagation() | |
| } | |
| } | |
| function h(a, c) { | |
| var h = function(b) { | |
| f(b); | |
| if (a.hasClass("on")) { | |
| e(c, a) | |
| } else { | |
| d(c, a) | |
| } | |
| }; | |
| if (a.hasClass("has-subs")) { | |
| a.on(b, h); | |
| a.find(".dropdown li").on(b, g) | |
| } | |
| } | |
| function i() { | |
| this.init = function() { | |
| var d = $("#desktop-navigation"), | |
| e = d.find("> ul"), | |
| i = e.find("> li"); | |
| if (!a) { | |
| d.addClass("notouch") | |
| } | |
| i.each(function(a, b) { | |
| h($(b), e) | |
| }); | |
| $("#mobile-navigation").on(b, "li.has-subs", function() { | |
| var a = $(this); | |
| a.toggleClass("on"); | |
| a.find(".dropdown li").on(b, g) | |
| }); | |
| $("#main-nav-toggle").on(c, function(a) { | |
| f(a); | |
| $(this).toggleClass("on"); | |
| $("#mobile-navigation").slideToggle("fast"); | |
| if (window.Features.isOldBrowser || window.Features.isIPhoneChrome) { | |
| $("body").toggleClass("fake-repaint") | |
| } | |
| }) | |
| } | |
| } | |
| window.Navigation = new i | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.LaneShowMore = { | |
| init: function(a) { | |
| var b = $(a); | |
| var c = b.data("lane-id"); | |
| b.click(function(a) { | |
| a.preventDefault(); | |
| $(".showmore-lane-" + c + ".showmore-hidden").show(); | |
| b.hide(); | |
| window.ImageStack.refresh() | |
| }) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| window.mal = window.mal || {}; | |
| var a = window._, | |
| b = window.Forms, | |
| c = window.Rest, | |
| d = window.Events, | |
| e = window.BrowserStorage; | |
| var f = {}, | |
| g = "HS-comment-votes", | |
| h = "HS-comment-abuses", | |
| i = "HS-comment-order", | |
| j = "HS-comment-open-quotes", | |
| k = 140, | |
| l = 2e3; | |
| $.fn.nextInView = function(a) { | |
| var b = $(a).toArray(), | |
| c = $(b).index(this); | |
| return $(b.slice(c)) | |
| }; | |
| function m(a) { | |
| this.comments = []; | |
| this.config = $.extend({ | |
| commentsPerPage: 50, | |
| currentPerPage: 1, | |
| offset: 0 | |
| }, a.data()); | |
| this.abuse = { | |
| email: "", | |
| text: "" | |
| }; | |
| this.init(a) | |
| } | |
| m.prototype.init = function(a) { | |
| this.$scope = a; | |
| this.comment = this.cleanComment(); | |
| this.loadTemplates(); | |
| $(a).on("click", "button.add-comment", this.showForm.bind(this)).on("click", "a.quote", this.quoteComment.bind(this)).on("click", "span.votes-container:not(.voted)", this.voteComment.bind(this)).on("click", "a.report-abuse", this.showReportAbuse.bind(this)).on("click", "button.abort-report-abuse", this.abortReportAbuse.bind(this)).on("click", "button.report-abuse", this.sendReportAbuse.bind(this)).on("click", "button.abort-send-comment", this.abortSendComment.bind(this)).on("click", "a.show-more-comments", this.loadMoreComments.bind(this)).on("click", "span.quote-toggle", this.openQuotes.bind(this)).on("click", "span.quote-toggle-close", this.closeQuotes.bind(this)).on("click", "button.quote-toggle", this.openQuotes.bind(this)).on("click", "button[data-order]", this.changeOrder.bind(this)).on("submit", "form", this.postComment.bind(this)).on("keypress keyup input change paste cut focusin focusout", "textarea", function(a) { | |
| b.updateAvailableCharactersInfo($(this).parent().find(".input-info"), l)(a) | |
| }); | |
| this.setCurrentOrder(); | |
| this.loadComments() | |
| }; | |
| m.prototype.cleanComment = function() { | |
| var a = { | |
| text: "", | |
| creatorName: "", | |
| email: "", | |
| quotedComment: "", | |
| parentId: null, | |
| parent: null, | |
| disabled: "", | |
| companyUser: false, | |
| nickNameSet: true | |
| }; | |
| return this.populateCommentFromProfile(a) | |
| }; | |
| m.prototype.populateCommentFromProfile = function(a) { | |
| var b = window.ProfileInfo.getUserProfile(); | |
| if (b.session.loggedIn) { | |
| a = $.extend(a, { | |
| creatorName: b.session.nickname, | |
| email: b.session.username, | |
| encryptedUserId: b.session.accountIdEncoded, | |
| companyUser: b.session.company, | |
| nickNameSet: b.session.nickname && b.session.nickname.trim() | |
| }) | |
| } | |
| return a | |
| }; | |
| m.prototype.changeOrder = function(a) { | |
| a.preventDefault(); | |
| var b = $(a.currentTarget).data("order"); | |
| e.setItem(i, b); | |
| this.setCurrentOrder(); | |
| this.reloadComments() | |
| }; | |
| m.prototype.setCurrentOrder = function() { | |
| $("button[data-order]", this.$scope).removeClass("active"); | |
| $('button[data-order="{0}"]'.format(this.sortOrder()), this.$scope).addClass("active") | |
| }; | |
| m.prototype.sortOrder = function() { | |
| return e.getItem(i) || "newest" | |
| }; | |
| m.prototype.loadMoreComments = function(a) { | |
| a.preventDefault(); | |
| this.cleanMessages(); | |
| var b = $(a.currentTarget); | |
| b.addClass("loading"); | |
| this.loadComments().done(function() { | |
| b.removeClass("loading") | |
| }) | |
| }; | |
| m.prototype.reloadComments = function() { | |
| var a = this.config; | |
| a.offset = 0; | |
| this.loadComments(true) | |
| }; | |
| m.prototype.loadTemplates = function() { | |
| $("script[data-name]").each(function(a, b) { | |
| var c = $(b); | |
| f[c.data("name")] = $.trim(b.innerHTML); | |
| c.remove() | |
| }) | |
| }; | |
| m.prototype.showForm = function(a) { | |
| this.abortReportAbuse(a); | |
| var c = $("div.add-comment", this.$scope).hide(); | |
| this.cleanMessages(); | |
| if (this.$scope.find(".add-comment-form").length === 0) { | |
| this.comment = this.cleanComment(); | |
| var d = window.ProfileInfo.getUserProfile(); | |
| if (!d.session.loggedIn) { | |
| this.comment.disabled = "disabled" | |
| } else if (!this.comment.nickNameSet && !this.comment.company) { | |
| this.comment.disabled = "disabled" | |
| } | |
| var e = this.render(this.comment, "comment-form"); | |
| c.after(e); | |
| if (!d.session.loggedIn) { | |
| $("button.login-nag").on("click", function(a) { | |
| a.preventDefault(); | |
| $(".SacuWidget-text ").trigger("click") | |
| }).removeClass("hidden") | |
| } | |
| b.translatedHTML5ValidationsForForm($(".add-comment-form", this.$scope)); | |
| this.$scope.find("textarea").autogrow({ | |
| animate: false | |
| }) | |
| } | |
| }; | |
| m.prototype.quoteComment = function(a) { | |
| a.preventDefault(); | |
| this.cleanMessages(); | |
| var b = $(a.currentTarget).closest("li[data-comment-id]"); | |
| var c = b.find("div.comment-content").clone(); | |
| var d = b.find("span.creator").text(); | |
| var e = b.data("comment-id"); | |
| c.find("div.quote-preview, span.quote-toggle-close").remove(); | |
| c.find("blockquote").removeAttr("style"); | |
| var f = c.html(); | |
| var g = $('<span class="creator">' + d + ": </span>"); | |
| this.showForm(a); | |
| var h = $("div.quoted-comment", this.$scope); | |
| h.html(f); | |
| h.prepend(g); | |
| $("input.quoted-comment-id", this.$scope).val(e); | |
| $("input.quoted-comment", this.$scope).val(f); | |
| $("html,body").animate({ | |
| scrollTop: h.offset().top - 50 | |
| }, 500) | |
| }; | |
| m.prototype.loadComments = function(a) { | |
| var b = this.config, | |
| d = $("p.loading-error", this.$scope), | |
| e = $("ul.comments", this.$scope); | |
| this.$scope.addClass("loading"); | |
| return c.getJson("/rest/articles/{articleId}/comments".format({ | |
| articleId: this.config.articleId | |
| }), { | |
| offset: b.offset, | |
| perPage: b.currentPerPage, | |
| sort: this.sortOrder() | |
| }).done(function(c) { | |
| if (c.comments.length === 0) { | |
| if ($(".commenting-disabled", this.$scope).length > 0) { | |
| return this.$scope.remove() | |
| } else { | |
| $(".no-messages").show(); | |
| $("a.show-more-comments", this.$scope).hide(); | |
| $("header.view-options", this.$scope).remove(); | |
| return | |
| } | |
| } else if (c.size > 3) { | |
| $("a.show-more-comments", this.$scope).css("display", "") | |
| } | |
| d.html(""); | |
| b.offset += b.currentPerPage; | |
| b.currentPerPage = b.commentsPerPage; | |
| var f = this.render(c.comments, "comment"); | |
| if (a) { | |
| e.empty().removeClass("all") | |
| } | |
| $("span.comment-count", this.$scope).text("(" + c.size + ")"); | |
| if (b.offset >= c.size) { | |
| $("a.show-more-comments", this.$scope).hide(); | |
| e.addClass("all") | |
| } | |
| this.disableOneTimeActions(f); | |
| this.collapseQuotes(f); | |
| e.append(f) | |
| }.bind(this)).fail(function() { | |
| d.text("Kommenttien lataaminen keskeytyi. Kokeile myöhemmin uudelleen.") | |
| }).always(function() { | |
| this.$scope.removeClass("loading") | |
| }.bind(this)) | |
| }; | |
| m.prototype.openQuotes = function(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| var b = $(a.currentTarget).closest(".quote-preview"); | |
| b.nextInView(".quote-preview").add(b).hide().each(function(a, b) { | |
| $(b).next().show() | |
| }); | |
| e.setItem(j, true) | |
| }; | |
| m.prototype.closeQuotes = function(a) { | |
| a.preventDefault(); | |
| a.stopPropagation(); | |
| var b = $(a.currentTarget).closest("blockquote").prev(); | |
| b.nextInView(".quote-preview").add(b).show().each(function(a, b) { | |
| $(b).next().hide() | |
| }); | |
| e.setItem(j, false) | |
| }; | |
| m.prototype.collapseQuotes = function(a) { | |
| var b = e.getItem(j) === "true", | |
| c = window.Tools.domListArray(a.querySelectorAll(".comment-content > blockquote")); | |
| c.forEach(function(a) { | |
| var c = $(a), | |
| d = $("<div>" + c.html().replace(/<\/blockquote>/gim, " | </blockquote>") + "</div>").text(); | |
| if (d.length > k) { | |
| var e = window.Tools.splitTextAtByWords(d, k), | |
| f = $('<div class="quote-preview">' + e + '<span class="quote-toggle">Avaa lainaukset</span></div>'), | |
| g = '<span class="quote-toggle-close">Sulje lainaukset</span>'; | |
| c.append(g).before(f); | |
| if (b) { | |
| f.hide() | |
| } else { | |
| c.addClass("toggled").hide() | |
| } | |
| } | |
| }) | |
| }; | |
| m.prototype.disableOneTimeActions = function(a) { | |
| o(g); | |
| o(h); | |
| var b = e.getJSON(g) || [], | |
| c = e.getJSON(h) || []; | |
| var d = window.Tools.domListArray(a.querySelectorAll("li[data-comment-id]")); | |
| d.filter(n(b).bind(this)).forEach(function(a) { | |
| $("span.votes", a).addClass("voted") | |
| }); | |
| d.filter(n(c).bind(this)).forEach(function(a) { | |
| $("a.report-abuse", a).addClass("reported") | |
| }) | |
| }; | |
| function n(a) { | |
| return function(b) { | |
| var c = this.getCommentKey($(b).data("commentId")); | |
| return ~$.inArray(c, a) | |
| } | |
| } | |
| function o(a) { | |
| var b = $.compressedJsonCookie(a); | |
| if (b && e.getJSON(a) === null) { | |
| e.setJSON(a, b) | |
| } | |
| } | |
| m.prototype.postComment = function(e) { | |
| e.preventDefault(); | |
| this.cleanMessages(); | |
| var f = this.$scope.find(".add-comment-form"); | |
| if (f.prop("disabled")) { | |
| return false | |
| } else { | |
| f.prop("disabled", true) | |
| } | |
| this.comment = b.collect(f); | |
| var g = window.ProfileInfo.getUserProfile(); | |
| if (!g.session.loggedIn) { | |
| $(".success", this.$scope).hide(); | |
| b.showError(f, "Kirjaudu sisään ennen kommentin lähettämistä.") | |
| } else { | |
| this.comment.creatorName = g.session.nickname; | |
| this.comment.email = g.session.username; | |
| this.comment.encryptedUserId = g.session.accountIdEncoded; | |
| var h = parseInt(this.comment.parentId); | |
| this.comment.parentId = a.isNumber(h) && h !== 0 ? h : null | |
| } | |
| c.postJson("/rest/articles/{articleId}/comments".format({ | |
| articleId: this.config.articleId | |
| }), this.comment).done(function() { | |
| $(".success", this.$scope).removeClass("hidden").show(); | |
| $("div.add-comment", this.$scope).show(); | |
| f.remove(); | |
| this.comment = this.cleanComment(); | |
| var a = $(".add-comment", this.$scope); | |
| if (!a.is(":in-viewport")) { | |
| $("html,body").animate({ | |
| scrollTop: a.offset().top - 30 | |
| }, 200) | |
| } | |
| f.prop("disabled", false); | |
| d.trigger("comment:posted") | |
| }.bind(this)).fail(function(a) { | |
| f.prop("disabled", false); | |
| $(".success", this.$scope).hide(); | |
| b.showError(f, "Kommentin lähetys keskeytyi. Kokeile myöhemmin uudelleen.")(a) | |
| }.bind(this)) | |
| }; | |
| m.prototype.voteComment = function(a) { | |
| var b = $(a.currentTarget), | |
| d = b.find(".votes"), | |
| f = b.addClass("voted").closest("[data-comment-id]").data("commentId"), | |
| h = parseInt(d.text(), 10); | |
| d.text(h + 1); | |
| c.postJson("/rest/articles/{articleId}/comments/{commentId}/votes".format({ | |
| articleId: this.config.articleId, | |
| commentId: f | |
| })).done(function() { | |
| var a = e.getJSON(g) || []; | |
| a.push(this.getCommentKey(f)); | |
| e.setJSON(g, a) | |
| }.bind(this)).fail(function() { | |
| d.removeClass("voted") | |
| }) | |
| }; | |
| m.prototype.showReportAbuse = function(a) { | |
| a.preventDefault(); | |
| if ($(a.currentTarget).hasClass("reported")) { | |
| return | |
| } | |
| this.abortReportAbuse(a); | |
| var b = $(a.currentTarget).closest("li[data-comment-id]"); | |
| b.append(this.render({}, "report-abuse")) | |
| }; | |
| m.prototype.abortSendComment = function(a) { | |
| a.preventDefault(); | |
| this.$scope.find("div.add-comment").show(); | |
| this.$scope.find(".add-comment-form").remove(); | |
| this.comment = this.cleanComment(); | |
| this.cleanMessages() | |
| }; | |
| m.prototype.abortReportAbuse = function(a) { | |
| a.preventDefault(); | |
| $(".report-abuse-form", this.$scope).remove(); | |
| this.cleanMessages() | |
| }; | |
| m.prototype.getCommentKey = function(a) { | |
| return "{0}-{1}".format(a, this.config.articleId) | |
| }; | |
| m.prototype.sendReportAbuse = function(f) { | |
| f.preventDefault(); | |
| var g = $(f.currentTarget).closest(".report-abuse-form"), | |
| i = g.closest("[data-comment-id]"), | |
| j = i.data("commentId"); | |
| if (g.prop("disabled")) { | |
| return false | |
| } else { | |
| g.prop("disabled", true) | |
| } | |
| this.cleanMessages(); | |
| this.abuse = b.collect(g); | |
| c.postJson("/rest/articles/{articleId}/comments/{commentId}/abuses".format({ | |
| articleId: a.isEmpty(this.config.articleLegacyId) ? this.config.articleId : this.config.articleLegacyId, | |
| commentId: j | |
| }), this.abuse).done(function() { | |
| if (!window.isMAL) { | |
| var a = e.getJSON(h) || []; | |
| a.push(this.getCommentKey(j)); | |
| e.setJSON(h, a); | |
| g.replaceWith('<p class="report-abuse-success">{0}</p>'.format("Ilmoituksesi on vastaanotettu")); | |
| $("a.report-abuse", i[0]).addClass("reported") | |
| } | |
| g.prop("disabled", false); | |
| d.trigger("comment:reported") | |
| }.bind(this)).fail(function(a) { | |
| g.prop("disabled", false); | |
| b.showError(g, "Lähetys keskeytyi. Kokeile myöhemmin uudelleen.")(a) | |
| }) | |
| }; | |
| m.prototype.cleanMessages = function() { | |
| $(".error", this.$scope).text(""); | |
| $(".errors, .loading-error, .report-abuse-success, .success", this.$scope).hide() | |
| }; | |
| m.prototype.render = function(b, c) { | |
| var d = f[c], | |
| e = document.createDocumentFragment(), | |
| g = $.isArray(b) ? b : [b], | |
| h = ""; | |
| for (var i = 0; i < g.length; i++) { | |
| h += a.template(d)(g[i]) | |
| } | |
| $(h).each(function(a, b) { | |
| e.appendChild(b) | |
| }); | |
| return e | |
| }; | |
| m.initialize = function(a) { | |
| return new m($(a)) | |
| }; | |
| window.ArticleComments = m | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = 37; | |
| var b = 39; | |
| window.ArticleNavigation = { | |
| initKeyboardNavigation: function(c) { | |
| var d = $(c); | |
| function e(a, b, c) { | |
| var d = a.find(b).attr("href"); | |
| if (typeof d === "string") { | |
| $(window).keydown(function(a) { | |
| if (a.keyCode === c) { | |
| window.location = d | |
| } | |
| }) | |
| } | |
| } | |
| e(d, ".prev", a); | |
| e(d, ".next", b) | |
| } | |
| } | |
| })(); | |
| (function() { | |
| "use strict"; | |
| var a = window._; | |
| var b = a.template('<li class="list-item">' + '<a href="#<%= anchor %>">' + '<div class="content"><%= title %></div>' + "</a>" + "</li>"); | |
| window.EditionSectionList = { | |
| init: function(a) { | |
| var c = $(a); | |
| var d = c.find("ol"); | |
| var e = false; | |
| $(".lane-header-edition").each(function() { | |
| var a = $(b({ | |
| anchor: $(this).find(".lane-header-anchor").attr("name"), | |
| title: $(this).find(".lane-header-title").text() | |
| })); | |
| d.append(a); | |
| e = true | |
| }); | |
| if (!e) { | |
| c.hide() | |
| } | |
| var f = $("html, body"); | |
| d.find("a").click(function() { | |
| var a = $.attr(this, "href").substr(1); | |
| f.animate({ | |
| scrollTop: $("[name=" + a + "]").offset().top | |
| }, 500, function() { | |
| window.location.hash = a | |
| }); | |
| return false | |
| }); | |
| var g = c.parents(".lane.right-position"); | |
| var h = c.parents(".content-wrapper"); | |
| var i = h.find(".lane.main-position"); | |
| g.css("height", i.height()); | |
| $(window).resize(window._.debounce(function() { | |
| g.css("height", i.height()) | |
| }, 100)); | |
| c.stick_in_parent() | |
| } | |
| } | |
| })(); | |
| (function(a) { | |
| "use strict"; | |
| if (typeof define === "function" && define.amd) { | |
| define(["jquery"], a) | |
| } else if (typeof exports !== "undefined") { | |
| module.exports = a(require("jquery")) | |
| } else { | |
| a(jQuery) | |
| } | |
| })(function(a) { | |
| "use strict"; | |
| var b = window.Slick || {}; | |
| b = function() { | |
| var b = 0; | |
| function c(c, d) { | |
| var e = this, | |
| f; | |
| e.defaults = { | |
| accessibility: true, | |
| adaptiveHeight: false, | |
| appendArrows: a(c), | |
| appendDots: a(c), | |
| arrows: true, | |
| asNavFor: null, | |
| prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>', | |
| nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>', | |
| autoplay: false, | |
| autoplaySpeed: 3e3, | |
| centerMode: false, | |
| centerPadding: "50px", | |
| cssEase: "ease", | |
| customPaging: function(b, c) { | |
| return a('<button type="button" data-role="none" role="button" tabindex="0" />').text(c + 1) | |
| }, | |
| dots: false, | |
| dotsClass: "slick-dots", | |
| draggable: true, | |
| easing: "linear", | |
| edgeFriction: .35, | |
| fade: false, | |
| focusOnSelect: false, | |
| infinite: true, | |
| initialSlide: 0, | |
| lazyLoad: "ondemand", | |
| mobileFirst: false, | |
| pauseOnHover: true, | |
| pauseOnFocus: true, | |
| pauseOnDotsHover: false, | |
| respondTo: "window", | |
| responsive: null, | |
| rows: 1, | |
| rtl: false, | |
| slide: "", | |
| slidesPerRow: 1, | |
| slidesToShow: 1, | |
| slidesToScroll: 1, | |
| speed: 500, | |
| swipe: true, | |
| swipeToSlide: false, | |
| touchMove: true, | |
| touchThreshold: 5, | |
| useCSS: true, | |
| useTransform: true, | |
| variableWidth: false, | |
| vertical: false, | |
| verticalSwiping: false, | |
| waitForAnimate: true, | |
| zIndex: 1e3 | |
| }; | |
| e.initials = { | |
| animating: false, | |
| dragging: false, | |
| autoPlayTimer: null, | |
| currentDirection: 0, | |
| currentLeft: null, | |
| currentSlide: 0, | |
| direction: 1, | |
| $dots: null, | |
| listWidth: null, | |
| listHeight: null, | |
| loadIndex: 0, | |
| $nextArrow: null, | |
| $prevArrow: null, | |
| slideCount: null, | |
| slideWidth: null, | |
| $slideTrack: null, | |
| $slides: null, | |
| sliding: false, | |
| slideOffset: 0, | |
| swipeLeft: null, | |
| $list: null, | |
| touchObject: {}, | |
| transformsEnabled: false, | |
| unslicked: false | |
| }; | |
| a.extend(e, e.initials); | |
| e.activeBreakpoint = null; | |
| e.animType = null; | |
| e.animProp = null; | |
| e.breakpoints = []; | |
| e.breakpointSettings = []; | |
| e.cssTransitions = false; | |
| e.focussed = false; | |
| e.interrupted = false; | |
| e.hidden = "hidden"; | |
| e.paused = true; | |
| e.positionProp = null; | |
| e.respondTo = null; | |
| e.rowCount = 1; | |
| e.shouldClick = true; | |
| e.$slider = a(c); | |
| e.$slidesCache = null; | |
| e.transformType = null; | |
| e.transitionType = null; | |
| e.visibilityChange = "visibilitychange"; | |
| e.windowWidth = 0; | |
| e.windowTimer = null; | |
| f = a(c).data("slick") || {}; | |
| e.options = a.extend({}, e.defaults, d, f); | |
| e.currentSlide = e.options.initialSlide; | |
| e.originalSettings = e.options; | |
| if (typeof document.mozHidden !== "undefined") { | |
| e.hidden = "mozHidden"; | |
| e.visibilityChange = "mozvisibilitychange" | |
| } else if (typeof document.webkitHidden !== "undefined") { | |
| e.hidden = "webkitHidden"; | |
| e.visibilityChange = "webkitvisibilitychange" | |
| } | |
| e.autoPlay = a.proxy(e.autoPlay, e); | |
| e.autoPlayClear = a.proxy(e.autoPlayClear, e); | |
| e.autoPlayIterator = a.proxy(e.autoPlayIterator, e); | |
| e.changeSlide = a.proxy(e.changeSlide, e); | |
| e.clickHandler = a.proxy(e.clickHandler, e); | |
| e.selectHandler = a.proxy(e.selectHandler, e); | |
| e.setPosition = a.proxy(e.setPosition, e); | |
| e.swipeHandler = a.proxy(e.swipeHandler, e); | |
| e.dragHandler = a.proxy(e.dragHandler, e); | |
| e.keyHandler = a.proxy(e.keyHandler, e); | |
| e.instanceUid = b++; | |
| e.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; | |
| e.registerBreakpoints(); | |
| e.init(true) | |
| } | |
| return c | |
| }(); | |
| b.prototype.activateADA = function() { | |
| var a = this; | |
| a.$slideTrack.find(".slick-active").attr({ | |
| "aria-hidden": "false" | |
| }).find("a, input, button, select").attr({ | |
| tabindex: "0" | |
| }) | |
| }; | |
| b.prototype.addSlide = b.prototype.slickAdd = function(b, c, d) { | |
| var e = this; | |
| if (typeof c === "boolean") { | |
| d = c; | |
| c = null | |
| } else if (c < 0 || c >= e.slideCount) { | |
| return false | |
| } | |
| e.unload(); | |
| if (typeof c === "number") { | |
| if (c === 0 && e.$slides.length === 0) { | |
| a(b).appendTo(e.$slideTrack) | |
| } else if (d) { | |
| a(b).insertBefore(e.$slides.eq(c)) | |
| } else { | |
| a(b).insertAfter(e.$slides.eq(c)) | |
| } | |
| } else { | |
| if (d === true) { | |
| a(b).prependTo(e.$slideTrack) | |
| } else { | |
| a(b).appendTo(e.$slideTrack) | |
| } | |
| } | |
| e.$slides = e.$slideTrack.children(this.options.slide); | |
| e.$slideTrack.children(this.options.slide).detach(); | |
| e.$slideTrack.append(e.$slides); | |
| e.$slides.each(function(b, c) { | |
| a(c).attr("data-slick-index", b) | |
| }); | |
| e.$slidesCache = e.$slides; | |
| e.reinit() | |
| }; | |
| b.prototype.animateHeight = function() { | |
| var a = this; | |
| if (a.options.slidesToShow === 1 && a.options.adaptiveHeight === true && a.options.vertical === false) { | |
| var b = a.$slides.eq(a.currentSlide).outerHeight(true); | |
| a.$list.animate({ | |
| height: b | |
| }, a.options.speed) | |
| } | |
| }; | |
| b.prototype.animateSlide = function(b, c) { | |
| var d = {}, | |
| e = this; | |
| e.animateHeight(); | |
| if (e.options.rtl === true && e.options.vertical === false) { | |
| b = -b | |
| } | |
| if (e.transformsEnabled === false) { | |
| if (e.options.vertical === false) { | |
| e.$slideTrack.animate({ | |
| left: b | |
| }, e.options.speed, e.options.easing, c) | |
| } else { | |
| e.$slideTrack.animate({ | |
| top: b | |
| }, e.options.speed, e.options.easing, c) | |
| } | |
| } else { | |
| if (e.cssTransitions === false) { | |
| if (e.options.rtl === true) { | |
| e.currentLeft = -e.currentLeft | |
| } | |
| a({ | |
| animStart: e.currentLeft | |
| }).animate({ | |
| animStart: b | |
| }, { | |
| duration: e.options.speed, | |
| easing: e.options.easing, | |
| step: function(a) { | |
| a = Math.ceil(a); | |
| if (e.options.vertical === false) { | |
| d[e.animType] = "translate(" + a + "px, 0px)"; | |
| e.$slideTrack.css(d) | |
| } else { | |
| d[e.animType] = "translate(0px," + a + "px)"; | |
| e.$slideTrack.css(d) | |
| } | |
| }, | |
| complete: function() { | |
| if (c) { | |
| c.call() | |
| } | |
| } | |
| }) | |
| } else { | |
| e.applyTransition(); | |
| b = Math.ceil(b); | |
| if (e.options.vertical === false) { | |
| d[e.animType] = "translate3d(" + b + "px, 0px, 0px)" | |
| } else { | |
| d[e.animType] = "translate3d(0px," + b + "px, 0px)" | |
| } | |
| e.$slideTrack.css(d); | |
| if (c) { | |
| setTimeout(function() { | |
| e.disableTransition(); | |
| c.call() | |
| }, e.options.speed) | |
| } | |
| } | |
| } | |
| }; | |
| b.prototype.getNavTarget = function() { | |
| var b = this, | |
| c = b.options.asNavFor; | |
| if (c && c !== null) { | |
| c = a(c).not(b.$slider) | |
| } | |
| return c | |
| }; | |
| b.prototype.asNavFor = function(b) { | |
| var c = this, | |
| d = c.getNavTarget(); | |
| if (d !== null && typeof d === "object") { | |
| d.each(function() { | |
| var c = a(this).slick("getSlick"); | |
| if (!c.unslicked) { | |
| c.slideHandler(b, true) | |
| } | |
| }) | |
| } | |
| }; | |
| b.prototype.applyTransition = function(a) { | |
| var b = this, | |
| c = {}; | |
| if (b.options.fade === false) { | |
| c[b.transitionType] = b.transformType + " " + b.options.speed + "ms " + b.options.cssEase | |
| } else { | |
| c[b.transitionType] = "opacity " + b.options.speed + "ms " + b.options.cssEase | |
| } | |
| if (b.options.fade === false) { | |
| b.$slideTrack.css(c) | |
| } else { | |
| b.$slides.eq(a).css(c) | |
| } | |
| }; | |
| b.prototype.autoPlay = function() { | |
| var a = this; | |
| a.autoPlayClear(); | |
| if (a.slideCount > a.options.slidesToShow) { | |
| a.autoPlayTimer = setInterval(a.autoPlayIterator, a.options.autoplaySpeed) | |
| } | |
| }; | |
| b.prototype.autoPlayClear = function() { | |
| var a = this; | |
| if (a.autoPlayTimer) { | |
| clearInterval(a.autoPlayTimer) | |
| } | |
| }; | |
| b.prototype.autoPlayIterator = function() { | |
| var a = this, | |
| b = a.currentSlide + a.options.slidesToScroll; | |
| if (!a.paused && !a.interrupted && !a.focussed) { | |
| if (a.options.infinite === false) { | |
| if (a.direction === 1 && a.currentSlide + 1 === a.slideCount - 1) { | |
| a.direction = 0 | |
| } else if (a.direction === 0) { | |
| b = a.currentSlide - a.options.slidesToScroll; | |
| if (a.currentSlide - 1 === 0) { | |
| a.direction = 1 | |
| } | |
| } | |
| } | |
| a.slideHandler(b) | |
| } | |
| }; | |
| b.prototype.buildArrows = function() { | |
| var b = this; | |
| if (b.options.arrows === true) { | |
| b.$prevArrow = a(b.options.prevArrow).addClass("slick-arrow"); | |
| b.$nextArrow = a(b.options.nextArrow).addClass("slick-arrow"); | |
| if (b.slideCount > b.options.slidesToShow) { | |
| b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"); | |
| b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"); | |
| if (b.htmlExpr.test(b.options.prevArrow)) { | |
| b.$prevArrow.prependTo(b.options.appendArrows) | |
| } | |
| if (b.htmlExpr.test(b.options.nextArrow)) { | |
| b.$nextArrow.appendTo(b.options.appendArrows) | |
| } | |
| if (b.options.infinite !== true) { | |
| b.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true") | |
| } | |
| } else { | |
| b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({ | |
| "aria-disabled": "true", | |
| tabindex: "-1" | |
| }) | |
| } | |
| } | |
| }; | |
| b.prototype.buildDots = function() { | |
| var b = this, | |
| c, d; | |
| if (b.options.dots === true && b.slideCount > b.options.slidesToShow) { | |
| b.$slider.addClass("slick-dotted"); | |
| d = a("<ul />").addClass(b.options.dotsClass); | |
| for (c = 0; c <= b.getDotCount(); c += 1) { | |
| d.append(a("<li />").append(b.options.customPaging.call(this, b, c))) | |
| } | |
| b.$dots = d.appendTo(b.options.appendDots); | |
| b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden", "false") | |
| } | |
| }; | |
| b.prototype.buildOut = function() { | |
| var b = this; | |
| b.$slides = b.$slider.children(b.options.slide + ":not(.slick-cloned)").addClass("slick-slide"); | |
| b.slideCount = b.$slides.length; | |
| b.$slides.each(function(b, c) { | |
| a(c).attr("data-slick-index", b).data("originalStyling", a(c).attr("style") || "") | |
| }); | |
| b.$slider.addClass("slick-slider"); | |
| b.$slideTrack = b.slideCount === 0 ? a('<div class="slick-track"/>').appendTo(b.$slider) : b.$slides.wrapAll('<div class="slick-track"/>').parent(); | |
| b.$list = b.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(); | |
| b.$slideTrack.css("opacity", 0); | |
| if (b.options.centerMode === true || b.options.swipeToSlide === true) { | |
| b.options.slidesToScroll = 1 | |
| } | |
| a("img[data-lazy]", b.$slider).not("[src]").addClass("slick-loading"); | |
| b.setupInfinite(); | |
| b.buildArrows(); | |
| b.buildDots(); | |
| b.updateDots(); | |
| b.setSlideClasses(typeof b.currentSlide === "number" ? b.currentSlide : 0); | |
| if (b.options.draggable === true) { | |
| b.$list.addClass("draggable") | |
| } | |
| }; | |
| b.prototype.buildRows = function() { | |
| var a = this, | |
| b, c, d, e, f, g, h; | |
| e = document.createDocumentFragment(); | |
| g = a.$slider.children(); | |
| if (a.options.rows > 1) { | |
| h = a.options.slidesPerRow * a.options.rows; | |
| f = Math.ceil(g.length / h); | |
| for (b = 0; b < f; b++) { | |
| var i = document.createElement("div"); | |
| for (c = 0; c < a.options.rows; c++) { | |
| var j = document.createElement("div"); | |
| for (d = 0; d < a.options.slidesPerRow; d++) { | |
| var k = b * h + (c * a.options.slidesPerRow + d); | |
| if (g.get(k)) { | |
| j.appendChild(g.get(k)) | |
| } | |
| } | |
| i.appendChild(j) | |
| } | |
| e.appendChild(i) | |
| } | |
| a.$slider.empty().append(e); | |
| a.$slider.children().children().children().css({ | |
| width: 100 / a.options.slidesPerRow + "%", | |
| display: "inline-block" | |
| }) | |
| } | |
| }; | |
| b.prototype.checkResponsive = function(b, c) { | |
| var d = this, | |
| e, f, g, h = false; | |
| var i = d.$slider.width(); | |
| var j = window.innerWidth || a(window).width(); | |
| if (d.respondTo === "window") { | |
| g = j | |
| } else if (d.respondTo === "slider") { | |
| g = i | |
| } else if (d.respondTo === "min") { | |
| g = Math.min(j, i) | |
| } | |
| if (d.options.responsive && d.options.responsive.length && d.options.responsive !== null) { | |
| f = null; | |
| for (e in d.breakpoints) { | |
| if (d.breakpoints.hasOwnProperty(e)) { | |
| if (d.originalSettings.mobileFirst === false) { | |
| if (g < d.breakpoints[e]) { | |
| f = d.breakpoints[e] | |
| } | |
| } else { | |
| if (g > d.breakpoints[e]) { | |
| f = d.breakpoints[e] | |
| } | |
| } | |
| } | |
| } | |
| if (f !== null) { | |
| if (d.activeBreakpoint !== null) { | |
| if (f !== d.activeBreakpoint || c) { | |
| d.activeBreakpoint = f; | |
| if (d.breakpointSettings[f] === "unslick") { | |
| d.unslick(f) | |
| } else { | |
| d.options = a.extend({}, d.originalSettings, d.breakpointSettings[f]); | |
| if (b === true) { | |
| d.currentSlide = d.options.initialSlide | |
| } | |
| d.refresh(b) | |
| } | |
| h = f | |
| } | |
| } else { | |
| d.activeBreakpoint = f; | |
| if (d.breakpointSettings[f] === "unslick") { | |
| d.unslick(f) | |
| } else { | |
| d.options = a.extend({}, d.originalSettings, d.breakpointSettings[f]); | |
| if (b === true) { | |
| d.currentSlide = d.options.initialSlide | |
| } | |
| d.refresh(b) | |
| } | |
| h = f | |
| } | |
| } else { | |
| if (d.activeBreakpoint !== null) { | |
| d.activeBreakpoint = null; | |
| d.options = d.originalSettings; | |
| if (b === true) { | |
| d.currentSlide = d.options.initialSlide | |
| } | |
| d.refresh(b); | |
| h = f | |
| } | |
| } | |
| if (!b && h !== false) { | |
| d.$slider.trigger("breakpoint", [d, h]) | |
| } | |
| } | |
| }; | |
| b.prototype.changeSlide = function(b, c) { | |
| var d = this, | |
| e = a(b.currentTarget), | |
| f, g, h; | |
| if (e.is("a")) { | |
| b.preventDefault() | |
| } | |
| if (!e.is("li")) { | |
| e = e.closest("li") | |
| } | |
| h = d.slideCount % d.options.slidesToScroll !== 0; | |
| f = h ? 0 : (d.slideCount - d.currentSlide) % d.options.slidesToScroll; | |
| switch (b.data.message) { | |
| case "previous": | |
| g = f === 0 ? d.options.slidesToScroll : d.options.slidesToShow - f; | |
| if (d.slideCount > d.options.slidesToShow) { | |
| d.slideHandler(d.currentSlide - g, false, c) | |
| } | |
| break; | |
| case "next": | |
| g = f === 0 ? d.options.slidesToScroll : f; | |
| if (d.slideCount > d.options.slidesToShow) { | |
| d.slideHandler(d.currentSlide + g, false, c) | |
| } | |
| break; | |
| case "index": | |
| var i = b.data.index === 0 ? 0 : b.data.index || e.index() * d.options.slidesToScroll; | |
| d.slideHandler(d.checkNavigable(i), false, c); | |
| e.children().trigger("focus"); | |
| break; | |
| default: | |
| return | |
| } | |
| }; | |
| b.prototype.checkNavigable = function(a) { | |
| var b = this, | |
| c, d; | |
| c = b.getNavigableIndexes(); | |
| d = 0; | |
| if (a > c[c.length - 1]) { | |
| a = c[c.length - 1] | |
| } else { | |
| for (var e in c) { | |
| if (a < c[e]) { | |
| a = d; | |
| break | |
| } | |
| d = c[e] | |
| } | |
| } | |
| return a | |
| }; | |
| b.prototype.cleanUpEvents = function() { | |
| var b = this; | |
| if (b.options.dots && b.$dots !== null) { | |
| a("li", b.$dots).off("click.slick", b.changeSlide).off("mouseenter.slick", a.proxy(b.interrupt, b, true)).off("mouseleave.slick", a.proxy(b.interrupt, b, false)) | |
| } | |
| b.$slider.off("focus.slick blur.slick"); | |
| if (b.options.arrows === true && b.slideCount > b.options.slidesToShow) { | |
| b.$prevArrow && b.$prevArrow.off("click.slick", b.changeSlide); | |
| b.$nextArrow && b.$nextArrow.off("click.slick", b.changeSlide) | |
| } | |
| b.$list.off("touchstart.slick mousedown.slick", b.swipeHandler); | |
| b.$list.off("touchmove.slick mousemove.slick", b.swipeHandler); | |
| b.$list.off("touchend.slick mouseup.slick", b.swipeHandler); | |
| b.$list.off("touchcancel.slick mouseleave.slick", b.swipeHandler); | |
| b.$list.off("click.slick", b.clickHandler); | |
| a(document).off(b.visibilityChange, b.visibility); | |
| b.cleanUpSlideEvents(); | |
| if (b.options.accessibility === true) { | |
| b.$list.off("keydown.slick", b.keyHandler) | |
| } | |
| if (b.options.focusOnSelect === true) { | |
| a(b.$slideTrack).children().off("click.slick", b.selectHandler) | |
| } | |
| a(window).off("orientationchange.slick.slick-" + b.instanceUid, b.orientationChange); | |
| a(window).off("resize.slick.slick-" + b.instanceUid, b.resize); | |
| a("[draggable!=true]", b.$slideTrack).off("dragstart", b.preventDefault); | |
| a(window).off("load.slick.slick-" + b.instanceUid, b.setPosition); | |
| a(document).off("ready.slick.slick-" + b.instanceUid, b.setPosition) | |
| }; | |
| b.prototype.cleanUpSlideEvents = function() { | |
| var b = this; | |
| b.$list.off("mouseenter.slick", a.proxy(b.interrupt, b, true)); | |
| b.$list.off("mouseleave.slick", a.proxy(b.interrupt, b, false)) | |
| }; | |
| b.prototype.cleanUpRows = function() { | |
| var a = this, | |
| b; | |
| if (a.options.rows > 1) { | |
| b = a.$slides.children().children(); | |
| b.removeAttr("style"); | |
| a.$slider.empty().append(b) | |
| } | |
| }; | |
| b.prototype.clickHandler = function(a) { | |
| var b = this; | |
| if (b.shouldClick === false) { | |
| a.stopImmediatePropagation(); | |
| a.stopPropagation(); | |
| a.preventDefault() | |
| } | |
| }; | |
| b.prototype.destroy = function(b) { | |
| var c = this; | |
| c.autoPlayClear(); | |
| c.touchObject = {}; | |
| c.cleanUpEvents(); | |
| a(".slick-cloned", c.$slider).detach(); | |
| if (c.$dots) { | |
| c.$dots.remove() | |
| } | |
| if (c.$prevArrow && c.$prevArrow.length) { | |
| c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""); | |
| if (c.htmlExpr.test(c.options.prevArrow)) { | |
| c.$prevArrow.remove() | |
| } | |
| } | |
| if (c.$nextArrow && c.$nextArrow.length) { | |
| c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""); | |
| if (c.htmlExpr.test(c.options.nextArrow)) { | |
| c.$nextArrow.remove() | |
| } | |
| } | |
| if (c.$slides) { | |
| c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function() { | |
| a(this).attr("style", a(this).data("originalStyling")) | |
| }); | |
| c.$slideTrack.children(this.options.slide).detach(); | |
| c.$slideTrack.detach(); | |
| c.$list.detach(); | |
| c.$slider.append(c.$slides) | |
| } | |
| c.cleanUpRows(); | |
| c.$slider.removeClass("slick-slider"); | |
| c.$slider.removeClass("slick-initialized"); | |
| c.$slider.removeClass("slick-dotted"); | |
| c.unslicked = true; | |
| if (!b) { | |
| c.$slider.trigger("destroy", [c]) | |
| } | |
| }; | |
| b.prototype.disableTransition = function(a) { | |
| var b = this, | |
| c = {}; | |
| c[b.transitionType] = ""; | |
| if (b.options.fade === false) { | |
| b.$slideTrack.css(c) | |
| } else { | |
| b.$slides.eq(a).css(c) | |
| } | |
| }; | |
| b.prototype.fadeSlide = function(a, b) { | |
| var c = this; | |
| if (c.cssTransitions === false) { | |
| c.$slides.eq(a).css({ | |
| zIndex: c.options.zIndex | |
| }); | |
| c.$slides.eq(a).animate({ | |
| opacity: 1 | |
| }, c.options.speed, c.options.easing, b) | |
| } else { | |
| c.applyTransition(a); | |
| c.$slides.eq(a).css({ | |
| opacity: 1, | |
| zIndex: c.options.zIndex | |
| }); | |
| if (b) { | |
| setTimeout(function() { | |
| c.disableTransition(a); | |
| b.call() | |
| }, c.options.speed) | |
| } | |
| } | |
| }; | |
| b.prototype.fadeSlideOut = function(a) { | |
| var b = this; | |
| if (b.cssTransitions === false) { | |
| b.$slides.eq(a).animate({ | |
| opacity: 0, | |
| zIndex: b.options.zIndex - 2 | |
| }, b.options.speed, b.options.easing) | |
| } else { | |
| b.applyTransition(a); | |
| b.$slides.eq(a).css({ | |
| opacity: 0, | |
| zIndex: b.options.zIndex - 2 | |
| }) | |
| } | |
| }; | |
| b.prototype.filterSlides = b.prototype.slickFilter = function(a) { | |
| var b = this; | |
| if (a !== null) { | |
| b.$slidesCache = b.$slides; | |
| b.unload(); | |
| b.$slideTrack.children(this.options.slide).detach(); | |
| b.$slidesCache.filter(a).appendTo(b.$slideTrack); | |
| b.reinit() | |
| } | |
| }; | |
| b.prototype.focusHandler = function() { | |
| var b = this; | |
| b.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick", "*:not(.slick-arrow)", function(c) { | |
| c.stopImmediatePropagation(); | |
| var d = a(this); | |
| setTimeout(function() { | |
| if (b.options.pauseOnFocus) { | |
| b.focussed = d.is(":focus"); | |
| b.autoPlay() | |
| } | |
| }, 0) | |
| }) | |
| }; | |
| b.prototype.getCurrent = b.prototype.slickCurrentSlide = function() { | |
| var a = this; | |
| return a.currentSlide | |
| }; | |
| b.prototype.getDotCount = function() { | |
| var a = this; | |
| var b = 0; | |
| var c = 0; | |
| var d = 0; | |
| if (a.options.infinite === true) { | |
| while (b < a.slideCount) { | |
| ++d; | |
| b = c + a.options.slidesToScroll; | |
| c += a.options.slidesToScroll <= a.options.slidesToShow ? a.options.slidesToScroll : a.options.slidesToShow | |
| } | |
| } else if (a.options.centerMode === true) { | |
| d = a.slideCount | |
| } else if (!a.options.asNavFor) { | |
| d = 1 + Math.ceil((a.slideCount - a.options.slidesToShow) / a.options.slidesToScroll) | |
| } else { | |
| while (b < a.slideCount) { | |
| ++d; | |
| b = c + a.options.slidesToScroll; | |
| c += a.options.slidesToScroll <= a.options.slidesToShow ? a.options.slidesToScroll : a.options.slidesToShow | |
| } | |
| } | |
| return d - 1 | |
| }; | |
| b.prototype.getLeft = function(a) { | |
| var b = this, | |
| c, d, e = 0, | |
| f; | |
| b.slideOffset = 0; | |
| d = b.$slides.first().outerHeight(true); | |
| if (b.options.infinite === true) { | |
| if (b.slideCount > b.options.slidesToShow) { | |
| b.slideOffset = b.slideWidth * b.options.slidesToShow * -1; | |
| e = d * b.options.slidesToShow * -1 | |
| } | |
| if (b.slideCount % b.options.slidesToScroll !== 0) { | |
| if (a + b.options.slidesToScroll > b.slideCount && b.slideCount > b.options.slidesToShow) { | |
| if (a > b.slideCount) { | |
| b.slideOffset = (b.options.slidesToShow - (a - b.slideCount)) * b.slideWidth * -1; | |
| e = (b.options.slidesToShow - (a - b.slideCount)) * d * -1 | |
| } else { | |
| b.slideOffset = b.slideCount % b.options.slidesToScroll * b.slideWidth * -1; | |
| e = b.slideCount % b.options.slidesToScroll * d * -1 | |
| } | |
| } | |
| } | |
| } else { | |
| if (a + b.options.slidesToShow > b.slideCount) { | |
| b.slideOffset = (a + b.options.slidesToShow - b.slideCount) * b.slideWidth; | |
| e = (a + b.options.slidesToShow - b.slideCount) * d | |
| } | |
| } | |
| if (b.slideCount <= b.options.slidesToShow) { | |
| b.slideOffset = 0; | |
| e = 0 | |
| } | |
| if (b.options.centerMode === true && b.slideCount <= b.options.slidesToShow) { | |
| b.slideOffset = b.slideWidth * Math.floor(b.options.slidesToShow) / 2 - b.slideWidth * b.slideCount / 2 | |
| } else if (b.options.centerMode === true && b.options.infinite === true) { | |
| b.slideOffset += b.slideWidth * Math.floor(b.options.slidesToShow / 2) - b.slideWidth | |
| } else if (b.options.centerMode === true) { | |
| b.slideOffset = 0; | |
| b.slideOffset += b.slideWidth * Math.floor(b.options.slidesToShow / 2) | |
| } | |
| if (b.options.vertical === false) { | |
| c = a * b.slideWidth * -1 + b.slideOffset | |
| } else { | |
| c = a * d * -1 + e | |
| } | |
| if (b.options.variableWidth === true) { | |
| if (b.slideCount <= b.options.slidesToShow || b.options.infinite === false) { | |
| f = b.$slideTrack.children(".slick-slide").eq(a) | |
| } else { | |
| f = b.$slideTrack.children(".slick-slide").eq(a + b.options.slidesToShow) | |
| } | |
| if (b.options.rtl === true) { | |
| if (f[0]) { | |
| c = (b.$slideTrack.width() - f[0].offsetLeft - f.width()) * -1 | |
| } else { | |
| c = 0 | |
| } | |
| } else { | |
| c = f[0] ? f[0].offsetLeft * -1 : 0 | |
| } | |
| if (b.options.centerMode === true) { | |
| if (b.slideCount <= b.options.slidesToShow || b.options.infinite === false) { | |
| f = b.$slideTrack.children(".slick-slide").eq(a) | |
| } else { | |
| f = b.$slideTrack.children(".slick-slide").eq(a + b.options.slidesToShow + 1) | |
| } | |
| if (b.options.rtl === true) { | |
| if (f[0]) { | |
| c = (b.$slideTrack.width() - f[0].offsetLeft - f.width()) * -1 | |
| } else { | |
| c = 0 | |
| } | |
| } else { | |
| c = f[0] ? f[0].offsetLeft * -1 : 0 | |
| } | |
| c += (b.$list.width() - f.outerWidth()) / 2 | |
| } | |
| } | |
| return c | |
| }; | |
| b.prototype.getOption = b.prototype.slickGetOption = function(a) { | |
| var b = this; | |
| return b.options[a] | |
| }; | |
| b.prototype.getNavigableIndexes = function() { | |
| var a = this, | |
| b = 0, | |
| c = 0, | |
| d = [], | |
| e; | |
| if (a.options.infinite === false) { | |
| e = a.slideCount | |
| } else { | |
| b = a.options.slidesToScroll * -1; | |
| c = a.options.slidesToScroll * -1; | |
| e = a.slideCount * 2 | |
| } | |
| while (b < e) { | |
| d.push(b); | |
| b = c + a.options.slidesToScroll; | |
| c += a.options.slidesToScroll <= a.options.slidesToShow ? a.options.slidesToScroll : a.options.slidesToShow | |
| } | |
| return d | |
| }; | |
| b.prototype.getSlick = function() { | |
| return this | |
| }; | |
| b.prototype.getSlideCount = function() { | |
| var b = this, | |
| c, d, e; | |
| e = b.options.centerMode === true ? b.slideWidth * Math.floor(b.options.slidesToShow / 2) : 0; | |
| if (b.options.swipeToSlide === true) { | |
| b.$slideTrack.find(".slick-slide").each(function(c, f) { | |
| if (f.offsetLeft - e + a(f).outerWidth() / 2 > b.swipeLeft * -1) { | |
| d = f; | |
| return false | |
| } | |
| }); | |
| c = Math.abs(a(d).attr("data-slick-index") - b.currentSlide) || 1; | |
| return c | |
| } else { | |
| return b.options.slidesToScroll | |
| } | |
| }; | |
| b.prototype.goTo = b.prototype.slickGoTo = function(a, b) { | |
| var c = this; | |
| c.changeSlide({ | |
| data: { | |
| message: "index", | |
| index: parseInt(a) | |
| } | |
| }, b) | |
| }; | |
| b.prototype.init = function(b) { | |
| var c = this; | |
| if (!a(c.$slider).hasClass("slick-initialized")) { | |
| a(c.$slider).addClass("slick-initialized"); | |
| c.buildRows(); | |
| c.buildOut(); | |
| c.setProps(); | |
| c.startLoad(); | |
| c.loadSlider(); | |
| c.initializeEvents(); | |
| c.updateArrows(); | |
| c.updateDots(); | |
| c.checkResponsive(true); | |
| c.focusHandler() | |
| } | |
| if (b) { | |
| c.$slider.trigger("init", [c]) | |
| } | |
| if (c.options.accessibility === true) { | |
| c.initADA() | |
| } | |
| if (c.options.autoplay) { | |
| c.paused = false; | |
| c.autoPlay() | |
| } | |
| }; | |
| b.prototype.initADA = function() { | |
| var b = this; | |
| b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({ | |
| "aria-hidden": "true", | |
| tabindex: "-1" | |
| }).find("a, input, button, select").attr({ | |
| tabindex: "-1" | |
| }); | |
| b.$slideTrack.attr("role", "listbox"); | |
| b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c) { | |
| a(this).attr("role", "option"); | |
| var d = b.options.centerMode ? c : Math.floor(c / b.options.slidesToShow); | |
| if (b.options.dots === true) { | |
| a(this).attr("aria-describedby", "slick-slide" + b.instanceUid + d + "") | |
| } | |
| }); | |
| if (b.$dots !== null) { | |
| b.$dots.attr("role", "tablist").find("li").each(function(c) { | |
| a(this).attr({ | |
| role: "presentation", | |
| "aria-selected": "false", | |
| "aria-controls": "navigation" + b.instanceUid + c + "", | |
| id: "slick-slide" + b.instanceUid + c + "" | |
| }) | |
| }).first().attr("aria-selected", "true").end().find("button").attr("role", "button").end().closest("div").attr("role", "toolbar") | |
| } | |
| b.activateADA() | |
| }; | |
| b.prototype.initArrowEvents = function() { | |
| var a = this; | |
| if (a.options.arrows === true && a.slideCount > a.options.slidesToShow) { | |
| a.$prevArrow.off("click.slick").on("click.slick", { | |
| message: "previous" | |
| }, a.changeSlide); | |
| a.$nextArrow.off("click.slick").on("click.slick", { | |
| message: "next" | |
| }, a.changeSlide) | |
| } | |
| }; | |
| b.prototype.initDotEvents = function() { | |
| var b = this; | |
| if (b.options.dots === true && b.slideCount > b.options.slidesToShow) { | |
| a("li", b.$dots).on("click.slick", { | |
| message: "index" | |
| }, b.changeSlide) | |
| } | |
| if (b.options.dots === true && b.options.pauseOnDotsHover === true) { | |
| a("li", b.$dots).on("mouseenter.slick", a.proxy(b.interrupt, b, true)).on("mouseleave.slick", a.proxy(b.interrupt, b, false)) | |
| } | |
| }; | |
| b.prototype.initSlideEvents = function() { | |
| var b = this; | |
| if (b.options.pauseOnHover) { | |
| b.$list.on("mouseenter.slick", a.proxy(b.interrupt, b, true)); | |
| b.$list.on("mouseleave.slick", a.proxy(b.interrupt, b, false)) | |
| } | |
| }; | |
| b.prototype.initializeEvents = function() { | |
| var b = this; | |
| b.initArrowEvents(); | |
| b.initDotEvents(); | |
| b.initSlideEvents(); | |
| b.$list.on("touchstart.slick mousedown.slick", { | |
| action: "start" | |
| }, b.swipeHandler); | |
| b.$list.on("touchmove.slick mousemove.slick", { | |
| action: "move" | |
| }, b.swipeHandler); | |
| b.$list.on("touchend.slick mouseup.slick", { | |
| action: "end" | |
| }, b.swipeHandler); | |
| b.$list.on("touchcancel.slick mouseleave.slick", { | |
| action: "end" | |
| }, b.swipeHandler); | |
| b.$list.on("click.slick", b.clickHandler); | |
| a(document).on(b.visibilityChange, a.proxy(b.visibility, b)); | |
| if (b.options.accessibility === true) { | |
| b.$list.on("keydown.slick", b.keyHandler) | |
| } | |
| if (b.options.focusOnSelect === true) { | |
| a(b.$slideTrack).children().on("click.slick", b.selectHandler) | |
| } | |
| a(window).on("orientationchange.slick.slick-" + b.instanceUid, a.proxy(b.orientationChange, b)); | |
| a(window).on("resize.slick.slick-" + b.instanceUid, a.proxy(b.resize, b)); | |
| a("[draggable!=true]", b.$slideTrack).on("dragstart", b.preventDefault); | |
| a(window).on("load.slick.slick-" + b.instanceUid, b.setPosition); | |
| a(document).on("ready.slick.slick-" + b.instanceUid, b.setPosition) | |
| }; | |
| b.prototype.initUI = function() { | |
| var a = this; | |
| if (a.options.arrows === true && a.slideCount > a.options.slidesToShow) { | |
| a.$prevArrow.show(); | |
| a.$nextArrow.show() | |
| } | |
| if (a.options.dots === true && a.slideCount > a.options.slidesToShow) { | |
| a.$dots.show() | |
| } | |
| }; | |
| b.prototype.keyHandler = function(a) { | |
| var b = this; | |
| if (!a.target.tagName.match("TEXTAREA|INPUT|SELECT")) { | |
| if (a.keyCode === 37 && b.options.accessibility === true) { | |
| b.changeSlide({ | |
| data: { | |
| message: b.options.rtl === true ? "next" : "previous" | |
| } | |
| }) | |
| } else if (a.keyCode === 39 && b.options.accessibility === true) { | |
| b.changeSlide({ | |
| data: { | |
| message: b.options.rtl === true ? "previous" : "next" | |
| } | |
| }) | |
| } | |
| } | |
| }; | |
| b.prototype.lazyLoad = function() { | |
| var b = this, | |
| c, d, e, f; | |
| function g(c) { | |
| a("img[data-lazy]", c).each(function() { | |
| var c = a(this), | |
| d = a(this).attr("data-lazy"), | |
| e = document.createElement("img"); | |
| e.onload = function() { | |
| c.animate({ | |
| opacity: 0 | |
| }, 100, function() { | |
| c.attr("src", d).animate({ | |
| opacity: 1 | |
| }, 200, function() { | |
| c.removeAttr("data-lazy").removeClass("slick-loading") | |
| }); | |
| b.$slider.trigger("lazyLoaded", [b, c, d]) | |
| }) | |
| }; | |
| e.onerror = function() { | |
| c.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"); | |
| b.$slider.trigger("lazyLoadError", [b, c, d]) | |
| }; | |
| e.src = d | |
| }) | |
| } | |
| if (b.options.centerMode === true) { | |
| if (b.options.infinite === true) { | |
| e = b.currentSlide + (b.options.slidesToShow / 2 + 1); | |
| f = e + b.options.slidesToShow + 2 | |
| } else { | |
| e = Math.max(0, b.currentSlide - (b.options.slidesToShow / 2 + 1)); | |
| f = 2 + (b.options.slidesToShow / 2 + 1) + b.currentSlide | |
| } | |
| } else { | |
| e = b.options.infinite ? b.options.slidesToShow + b.currentSlide : b.currentSlide; | |
| f = Math.ceil(e + b.options.slidesToShow); | |
| if (b.options.fade === true) { | |
| if (e > 0) e--; | |
| if (f <= b.slideCount) f++ | |
| } | |
| } | |
| c = b.$slider.find(".slick-slide").slice(e, f); | |
| g(c); | |
| if (b.slideCount <= b.options.slidesToShow) { | |
| d = b.$slider.find(".slick-slide"); | |
| g(d) | |
| } else if (b.currentSlide >= b.slideCount - b.options.slidesToShow) { | |
| d = b.$slider.find(".slick-cloned").slice(0, b.options.slidesToShow); | |
| g(d) | |
| } else if (b.currentSlide === 0) { | |
| d = b.$slider.find(".slick-cloned").slice(b.options.slidesToShow * -1); | |
| g(d) | |
| } | |
| }; | |
| b.prototype.loadSlider = function() { | |
| var a = this; | |
| a.setPosition(); | |
| a.$slideTrack.css({ | |
| opacity: 1 | |
| }); | |
| a.$slider.removeClass("slick-loading"); | |
| a.initUI(); | |
| if (a.options.lazyLoad === "progressive") { | |
| a.progressiveLazyLoad() | |
| } | |
| }; | |
| b.prototype.next = b.prototype.slickNext = function() { | |
| var a = this; | |
| a.changeSlide({ | |
| data: { | |
| message: "next" | |
| } | |
| }) | |
| }; | |
| b.prototype.orientationChange = function() { | |
| var a = this; | |
| a.checkResponsive(); | |
| a.setPosition() | |
| }; | |
| b.prototype.pause = b.prototype.slickPause = function() { | |
| var a = this; | |
| a.autoPlayClear(); | |
| a.paused = true | |
| }; | |
| b.prototype.play = b.prototype.slickPlay = function() { | |
| var a = this; | |
| a.autoPlay(); | |
| a.options.autoplay = true; | |
| a.paused = false; | |
| a.focussed = false; | |
| a.interrupted = false | |
| }; | |
| b.prototype.postSlide = function(a) { | |
| var b = this; | |
| if (!b.unslicked) { | |
| b.$slider.trigger("afterChange", [b, a]); | |
| b.animating = false; | |
| b.setPosition(); | |
| b.swipeLeft = null; | |
| if (b.options.autoplay) { | |
| b.autoPlay() | |
| } | |
| if (b.options.accessibility === true) { | |
| b.initADA() | |
| } | |
| } | |
| }; | |
| b.prototype.prev = b.prototype.slickPrev = function() { | |
| var a = this; | |
| a.changeSlide({ | |
| data: { | |
| message: "previous" | |
| } | |
| }) | |
| }; | |
| b.prototype.preventDefault = function(a) { | |
| a.preventDefault() | |
| }; | |
| b.prototype.progressiveLazyLoad = function(b) { | |
| b = b || 1; | |
| var c = this, | |
| d = a("img[data-lazy]", c.$slider), | |
| e, f, g; | |
| if (d.length) { | |
| e = d.first(); | |
| f = e.attr("data-lazy"); | |
| g = document.createElement("img"); | |
| g.onload = function() { | |
| e.attr("src", f).removeAttr("data-lazy").removeClass("slick-loading"); | |
| if (c.options.adaptiveHeight === true) { | |
| c.setPosition() | |
| } | |
| c.$slider.trigger("lazyLoaded", [c, e, f]); | |
| c.progressiveLazyLoad() | |
| }; | |
| g.onerror = function() { | |
| if (b < 3) { | |
| setTimeout(function() { | |
| c.progressiveLazyLoad(b + 1) | |
| }, 500) | |
| } else { | |
| e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"); | |
| c.$slider.trigger("lazyLoadError", [c, e, f]); | |
| c.progressiveLazyLoad() | |
| } | |
| }; | |
| g.src = f | |
| } else { | |
| c.$slider.trigger("allImagesLoaded", [c]) | |
| } | |
| }; | |
| b.prototype.refresh = function(b) { | |
| var c = this, | |
| d, e; | |
| e = c.slideCount - c.options.slidesToShow; | |
| if (!c.options.infinite && c.currentSlide > e) { | |
| c.currentSlide = e | |
| } | |
| if (c.slideCount <= c.options.slidesToShow) { | |
| c.currentSlide = 0 | |
| } | |
| d = c.currentSlide; | |
| c.destroy(true); | |
| a.extend(c, c.initials, { | |
| currentSlide: d | |
| }); | |
| c.init(); | |
| if (!b) { | |
| c.changeSlide({ | |
| data: { | |
| message: "index", | |
| index: d | |
| } | |
| }, false) | |
| } | |
| }; | |
| b.prototype.registerBreakpoints = function() { | |
| var b = this, | |
| c, d, e, f = b.options.responsive || null; | |
| if (a.type(f) === "array" && f.length) { | |
| b.respondTo = b.options.respondTo || "window"; | |
| for (c in f) { | |
| e = b.breakpoints.length - 1; | |
| d = f[c].breakpoint; | |
| if (f.hasOwnProperty(c)) { | |
| while (e >= 0) { | |
| if (b.breakpoints[e] && b.breakpoints[e] === d) { | |
| b.breakpoints.splice(e, 1) | |
| } | |
| e-- | |
| } | |
| b.breakpoints.push(d); | |
| b.breakpointSettings[d] = f[c].settings | |
| } | |
| } | |
| b.breakpoints.sort(function(a, c) { | |
| return b.options.mobileFirst ? a - c : c - a | |
| }) | |
| } | |
| }; | |
| b.prototype.reinit = function() { | |
| var b = this; | |
| b.$slides = b.$slideTrack.children(b.options.slide).addClass("slick-slide"); | |
| b.slideCount = b.$slides.length; | |
| if (b.currentSlide >= b.slideCount && b.currentSlide !== 0) { | |
| b.currentSlide = b.currentSlide - b.options.slidesToScroll | |
| } | |
| if (b.slideCount <= b.options.slidesToShow) { | |
| b.currentSlide = 0 | |
| } | |
| b.registerBreakpoints(); | |
| b.setProps(); | |
| b.setupInfinite(); | |
| b.buildArrows(); | |
| b.updateArrows(); | |
| b.initArrowEvents(); | |
| b.buildDots(); | |
| b.updateDots(); | |
| b.initDotEvents(); | |
| b.cleanUpSlideEvents(); | |
| b.initSlideEvents(); | |
| b.checkResponsive(false, true); | |
| if (b.options.focusOnSelect === true) { | |
| a(b.$slideTrack).children().on("click.slick", b.selectHandler) | |
| } | |
| b.setSlideClasses(typeof b.currentSlide === "number" ? b.currentSlide : 0); | |
| b.setPosition(); | |
| b.focusHandler(); | |
| b.paused = !b.options.autoplay; | |
| b.autoPlay(); | |
| b.$slider.trigger("reInit", [b]) | |
| }; | |
| b.prototype.resize = function() { | |
| var b = this; | |
| if (a(window).width() !== b.windowWidth) { | |
| clearTimeout(b.windowDelay); | |
| b.windowDelay = window.setTimeout(function() { | |
| b.windowWidth = a(window).width(); | |
| b.checkResponsive(); | |
| if (!b.unslicked) { | |
| b.setPosition() | |
| } | |
| }, 50) | |
| } | |
| }; | |
| b.prototype.removeSlide = b.prototype.slickRemove = function(a, b, c) { | |
| var d = this; | |
| if (typeof a === "boolean") { | |
| b = a; | |
| a = b === true ? 0 : d.slideCount - 1 | |
| } else { | |
| a = b === true ? --a : a | |
| } | |
| if (d.slideCount < 1 || a < 0 || a > d.slideCount - 1) { | |
| return false | |
| } | |
| d.unload(); | |
| if (c === true) { | |
| d.$slideTrack.children().remove() | |
| } else { | |
| d.$slideTrack.children(this.options.slide).eq(a).remove() | |
| } | |
| d.$slides = d.$slideTrack.children(this.options.slide); | |
| d.$slideTrack.children(this.options.slide).detach(); | |
| d.$slideTrack.append(d.$slides); | |
| d.$slidesCache = d.$slides; | |
| d.reinit() | |
| }; | |
| b.prototype.setCSS = function(a) { | |
| var b = this, | |
| c = {}, | |
| d, e; | |
| if (b.options.rtl === true) { | |
| a = -a | |
| } | |
| d = b.positionProp == "left" ? Math.ceil(a) + "px" : "0px"; | |
| e = b.positionProp == "top" ? Math.ceil(a) + "px" : "0px"; | |
| c[b.positionProp] = a; | |
| if (b.transformsEnabled === false) { | |
| b.$slideTrack.css(c) | |
| } else { | |
| c = {}; | |
| if (b.cssTransitions === false) { | |
| c[b.animType] = "translate(" + d + ", " + e + ")"; | |
| b.$slideTrack.css(c) | |
| } else { | |
| c[b.animType] = "translate3d(" + d + ", " + e + ", 0px)"; | |
| b.$slideTrack.css(c) | |
| } | |
| } | |
| }; | |
| b.prototype.setDimensions = function() { | |
| var a = this; | |
| if (a.options.vertical === false) { | |
| if (a.options.centerMode === true) { | |
| a.$list.css({ | |
| padding: "0px " + a.options.centerPadding | |
| }) | |
| } | |
| } else { | |
| a.$list.height(a.$slides.first().outerHeight(true) * a.options.slidesToShow); | |
| if (a.options.centerMode === true) { | |
| a.$list.css({ | |
| padding: a.options.centerPadding + " 0px" | |
| }) | |
| } | |
| } | |
| a.listWidth = a.$list.width(); | |
| a.listHeight = a.$list.height(); | |
| if (a.options.vertical === false && a.options.variableWidth === false) { | |
| a.slideWidth = Math.ceil(a.listWidth / a.options.slidesToShow); | |
| a.$slideTrack.width(Math.ceil(a.slideWidth * a.$slideTrack.children(".slick-slide").length)) | |
| } else if (a.options.variableWidth === true) { | |
| a.$slideTrack.width(5e3 * a.slideCount) | |
| } else { | |
| a.slideWidth = Math.ceil(a.listWidth); | |
| a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(true) * a.$slideTrack.children(".slick-slide").length)) | |
| } | |
| var b = a.$slides.first().outerWidth(true) - a.$slides.first().width(); | |
| if (a.options.variableWidth === false) a.$slideTrack.children(".slick-slide").width(a.slideWidth - b) | |
| }; | |
| b.prototype.setFade = function() { | |
| var b = this, | |
| c; | |
| b.$slides.each(function(d, e) { | |
| c = b.slideWidth * d * -1; | |
| if (b.options.rtl === true) { | |
| a(e).css({ | |
| position: "relative", | |
| right: c, | |
| top: 0, | |
| zIndex: b.options.zIndex - 2, | |
| opacity: 0 | |
| }) | |
| } else { | |
| a(e).css({ | |
| position: "relative", | |
| left: c, | |
| top: 0, | |
| zIndex: b.options.zIndex - 2, | |
| opacity: 0 | |
| }) | |
| } | |
| }); | |
| b.$slides.eq(b.currentSlide).css({ | |
| zIndex: b.options.zIndex - 1, | |
| opacity: 1 | |
| }) | |
| }; | |
| b.prototype.setHeight = function() { | |
| var a = this; | |
| if (a.options.slidesToShow === 1 && a.options.adaptiveHeight === true && a.options.vertical === false) { | |
| var b = a.$slides.eq(a.currentSlide).outerHeight(true); | |
| a.$list.css("height", b) | |
| } | |
| }; | |
| b.prototype.setOption = b.prototype.slickSetOption = function() { | |
| var b = this, | |
| c, d, e, f, g = false, | |
| h; | |
| if (a.type(arguments[0]) === "object") { | |
| e = arguments[0]; | |
| g = arguments[1]; | |
| h = "multiple" | |
| } else if (a.type(arguments[0]) === "string") { | |
| e = arguments[0]; | |
| f = arguments[1]; | |
| g = arguments[2]; | |
| if (arguments[0] === "responsive" && a.type(arguments[1]) === "array") { | |
| h = "responsive" | |
| } else if (typeof arguments[1] !== "undefined") { | |
| h = "single" | |
| } | |
| } | |
| if (h === "single") { | |
| b.options[e] = f | |
| } else if (h === "multiple") { | |
| a.each(e, function(a, c) { | |
| b.options[a] = c | |
| }) | |
| } else if (h === "responsive") { | |
| for (d in f) { | |
| if (a.type(b.options.responsive) !== "array") { | |
| b.options.responsive = [f[d]] | |
| } else { | |
| c = b.options.responsive.length - 1; | |
| while (c >= 0) { | |
| if (b.options.responsive[c].breakpoint === f[d].breakpoint) { | |
| b.options.responsive.splice(c, 1) | |
| } | |
| c-- | |
| } | |
| b.options.responsive.push(f[d]) | |
| } | |
| } | |
| } | |
| if (g) { | |
| b.unload(); | |
| b.reinit() | |
| } | |
| }; | |
| b.prototype.setPosition = function() { | |
| var a = this; | |
| a.setDimensions(); | |
| a.setHeight(); | |
| if (a.options.fade === false) { | |
| a.setCSS(a.getLeft(a.currentSlide)) | |
| } else { | |
| a.setFade() | |
| } | |
| a.$slider.trigger("setPosition", [a]) | |
| }; | |
| b.prototype.setProps = function() { | |
| var a = this, | |
| b = document.body.style; | |
| a.positionProp = a.options.vertical === true ? "top" : "left"; | |
| if (a.positionProp === "top") { | |
| a.$slider.addClass("slick-vertical") | |
| } else { | |
| a.$slider.removeClass("slick-vertical") | |
| } | |
| if (b.WebkitTransition !== undefined || b.MozTransition !== undefined || b.msTransition !== undefined) { | |
| if (a.options.useCSS === true) { | |
| a.cssTransitions = true | |
| } | |
| } | |
| if (a.options.fade) { | |
| if (typeof a.options.zIndex === "number") { | |
| if (a.options.zIndex < 3) { | |
| a.options.zIndex = 3 | |
| } | |
| } else { | |
| a.options.zIndex = a.defaults.zIndex | |
| } | |
| } | |
| if (b.OTransform !== undefined) { | |
| a.animType = "OTransform"; | |
| a.transformType = "-o-transform"; | |
| a.transitionType = "OTransition"; | |
| if (b.perspectiveProperty === undefined && b.webkitPerspective === undefined) a.animType = false | |
| } | |
| if (b.MozTransform !== undefined) { | |
| a.animType = "MozTransform"; | |
| a.transformType = "-moz-transform"; | |
| a.transitionType = "MozTransition"; | |
| if (b.perspectiveProperty === undefined && b.MozPerspective === undefined) a.animType = false | |
| } | |
| if (b.webkitTransform !== undefined) { | |
| a.animType = "webkitTransform"; | |
| a.transformType = "-webkit-transform"; | |
| a.transitionType = "webkitTransition"; | |
| if (b.perspectiveProperty === undefined && b.webkitPerspective === undefined) a.animType = false | |
| } | |
| if (b.msTransform !== undefined) { | |
| a.animType = "msTransform"; | |
| a.transformType = "-ms-transform"; | |
| a.transitionType = "msTransition"; | |
| if (b.msTransform === undefined) a.animType = false | |
| } | |
| if (b.transform !== undefined && a.animType !== false) { | |
| a.animType = "transform"; | |
| a.transformType = "transform"; | |
| a.transitionType = "transition" | |
| } | |
| a.transformsEnabled = a.options.useTransform && (a.animType !== null && a.animType !== false) | |
| }; | |
| b.prototype.setSlideClasses = function(a) { | |
| var b = this, | |
| c, d, e, f; | |
| d = b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"); | |
| b.$slides.eq(a).addClass("slick-current"); | |
| if (b.options.centerMode === true) { | |
| c = Math.floor(b.options.slidesToShow / 2); | |
| if (b.options.infinite === true) { | |
| if (a >= c && a <= b.slideCount - 1 - c) { | |
| b.$slides.slice(a - c, a + c + 1).addClass("slick-active").attr("aria-hidden", "false") | |
| } else { | |
| e = b.options.slidesToShow + a; | |
| d.slice(e - c + 1, e + c + 2).addClass("slick-active").attr("aria-hidden", "false") | |
| } | |
| if (a === 0) { | |
| d.eq(d.length - 1 - b.options.slidesToShow).addClass("slick-center") | |
| } else if (a === b.slideCount - 1) { | |
| d.eq(b.options.slidesToShow).addClass("slick-center") | |
| } | |
| } | |
| b.$slides.eq(a).addClass("slick-center") | |
| } else { | |
| if (a >= 0 && a <= b.slideCount - b.options.slidesToShow) { | |
| b.$slides.slice(a, a + b.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") | |
| } else if (d.length <= b.options.slidesToShow) { | |
| d.addClass("slick-active").attr("aria-hidden", "false") | |
| } else { | |
| f = b.slideCount % b.options.slidesToShow; | |
| e = b.options.infinite === true ? b.options.slidesToShow + a : a; | |
| if (b.options.slidesToShow == b.options.slidesToScroll && b.slideCount - a < b.options.slidesToShow) { | |
| d.slice(e - (b.options.slidesToShow - f), e + f).addClass("slick-active").attr("aria-hidden", "false") | |
| } else { | |
| d.slice(e, e + b.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") | |
| } | |
| } | |
| } | |
| if (b.options.lazyLoad === "ondemand") { | |
| b.lazyLoad() | |
| } | |
| }; | |
| b.prototype.setupInfinite = function() { | |
| var b = this, | |
| c, d, e; | |
| if (b.options.fade === true) { | |
| b.options.centerMode = false | |
| } | |
| if (b.options.infinite === true && b.options.fade === false) { | |
| d = null; | |
| if (b.slideCount > b.options.slidesToShow) { | |
| if (b.options.centerMode === true) { | |
| e = b.options.slidesToShow + 1 | |
| } else { | |
| e = b.options.slidesToShow | |
| } | |
| for (c = b.slideCount; c > b.slideCount - e; c -= 1) { | |
| d = c - 1; | |
| a(b.$slides[d]).clone(true).attr("id", "").attr("data-slick-index", d - b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned") | |
| } | |
| for (c = 0; c < e; c += 1) { | |
| d = c; | |
| a(b.$slides[d]).clone(true).attr("id", "").attr("data-slick-index", d + b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned") | |
| } | |
| b.$slideTrack.find(".slick-cloned").find("[id]").each(function() { | |
| a(this).attr("id", "") | |
| }) | |
| } | |
| } | |
| }; | |
| b.prototype.interrupt = function(a) { | |
| var b = this; | |
| if (!a) { | |
| b.autoPlay() | |
| } | |
| b.interrupted = a | |
| }; | |
| b.prototype.selectHandler = function(b) { | |
| var c = this; | |
| var d = a(b.target).is(".slick-slide") ? a(b.target) : a(b.target).parents(".slick-slide"); | |
| var e = parseInt(d.attr("data-slick-index")); | |
| if (!e) e = 0; | |
| if (c.slideCount <= c.options.slidesToShow) { | |
| c.setSlideClasses(e); | |
| c.asNavFor(e); | |
| return | |
| } | |
| c.slideHandler(e) | |
| }; | |
| b.prototype.slideHandler = function(a, b, c) { | |
| var d, e, f, g, h = null, | |
| i = this, | |
| j; | |
| b = b || false; | |
| if (i.animating === true && i.options.waitForAnimate === true) { | |
| return | |
| } | |
| if (i.options.fade === true && i.currentSlide === a) { | |
| return | |
| } | |
| if (i.slideCount <= i.options.slidesToShow) { | |
| return | |
| } | |
| if (b === false) { | |
| i.asNavFor(a) | |
| } | |
| d = a; | |
| h = i.getLeft(d); | |
| g = i.getLeft(i.currentSlide); | |
| i.currentLeft = i.swipeLeft === null ? g : i.swipeLeft; | |
| if (i.options.infinite === false && i.options.centerMode === false && (a < 0 || a > i.getDotCount() * i.options.slidesToScroll)) { | |
| if (i.options.fade === false) { | |
| d = i.currentSlide; | |
| if (c !== true) { | |
| i.animateSlide(g, function() { | |
| i.postSlide(d) | |
| }) | |
| } else { | |
| i.postSlide(d) | |
| } | |
| } | |
| return | |
| } else if (i.options.infinite === false && i.options.centerMode === true && (a < 0 || a > i.slideCount - i.options.slidesToScroll)) { | |
| if (i.options.fade === false) { | |
| d = i.currentSlide; | |
| if (c !== true) { | |
| i.animateSlide(g, function() { | |
| i.postSlide(d) | |
| }) | |
| } else { | |
| i.postSlide(d) | |
| } | |
| } | |
| return | |
| } | |
| if (i.options.autoplay) { | |
| clearInterval(i.autoPlayTimer) | |
| } | |
| if (d < 0) { | |
| if (i.slideCount % i.options.slidesToScroll !== 0) { | |
| e = i.slideCount - i.slideCount % i.options.slidesToScroll | |
| } else { | |
| e = i.slideCount + d | |
| } | |
| } else if (d >= i.slideCount) { | |
| if (i.slideCount % i.options.slidesToScroll !== 0) { | |
| e = 0 | |
| } else { | |
| e = d - i.slideCount | |
| } | |
| } else { | |
| e = d | |
| } | |
| i.animating = true; | |
| i.$slider.trigger("beforeChange", [i, i.currentSlide, e]); | |
| f = i.currentSlide; | |
| i.currentSlide = e; | |
| i.setSlideClasses(i.currentSlide); | |
| if (i.options.asNavFor) { | |
| j = i.getNavTarget(); | |
| j = j.slick("getSlick"); | |
| if (j.slideCount <= j.options.slidesToShow) { | |
| j.setSlideClasses(i.currentSlide) | |
| } | |
| } | |
| i.updateDots(); | |
| i.updateArrows(); | |
| if (i.options.fade === true) { | |
| if (c !== true) { | |
| i.fadeSlideOut(f); | |
| i.fadeSlide(e, function() { | |
| i.postSlide(e) | |
| }) | |
| } else { | |
| i.postSlide(e) | |
| } | |
| i.animateHeight(); | |
| return | |
| } | |
| if (c !== true) { | |
| i.animateSlide(h, function() { | |
| i.postSlide(e) | |
| }) | |
| } else { | |
| i.postSlide(e) | |
| } | |
| }; | |
| b.prototype.startLoad = function() { | |
| var a = this; | |
| if (a.options.arrows === true && a.slideCount > a.options.slidesToShow) { | |
| a.$prevArrow.hide(); | |
| a.$nextArrow.hide() | |
| } | |
| if (a.options.dots === true && a.slideCount > a.options.slidesToShow) { | |
| a.$dots.hide() | |
| } | |
| a.$slider.addClass("slick-loading") | |
| }; | |
| b.prototype.swipeDirection = function() { | |
| var a, b, c, d, e = this; | |
| a = e.touchObject.startX - e.touchObject.curX; | |
| b = e.touchObject.startY - e.touchObject.curY; | |
| c = Math.atan2(b, a); | |
| d = Math.round(c * 180 / Math.PI); | |
| if (d < 0) { | |
| d = 360 - Math.abs(d) | |
| } | |
| if (d <= 45 && d >= 0) { | |
| return e.options.rtl === false ? "left" : "right" | |
| } | |
| if (d <= 360 && d >= 315) { | |
| return e.options.rtl === false ? "left" : "right" | |
| } | |
| if (d >= 135 && d <= 225) { | |
| return e.options.rtl === false ? "right" : "left" | |
| } | |
| if (e.options.verticalSwiping === true) { | |
| if (d >= 35 && d <= 135) { | |
| return "down" | |
| } else { | |
| return "up" | |
| } | |
| } | |
| return "vertical" | |
| }; | |
| b.prototype.swipeEnd = function(a) { | |
| var b = this, | |
| c, d; | |
| b.dragging = false; | |
| b.interrupted = false; | |
| b.shouldClick = b.touchObject.swipeLength > 10 ? false : true; | |
| if (b.touchObject.curX === undefined) { | |
| return false | |
| } | |
| if (b.touchObject.edgeHit === true) { | |
| b.$slider.trigger("edge", [b, b.swipeDirection()]) | |
| } | |
| if (b.touchObject.swipeLength >= b.touchObject.minSwipe) { | |
| d = b.swipeDirection(); | |
| switch (d) { | |
| case "left": | |
| case "down": | |
| c = b.options.swipeToSlide ? b.checkNavigable(b.currentSlide + b.getSlideCount()) : b.currentSlide + b.getSlideCount(); | |
| b.currentDirection = 0; | |
| break; | |
| case "right": | |
| case "up": | |
| c = b.options.swipeToSlide ? b.checkNavigable(b.currentSlide - b.getSlideCount()) : b.currentSlide - b.getSlideCount(); | |
| b.currentDirection = 1; | |
| break; | |
| default: | |
| } | |
| if (d != "vertical") { | |
| b.slideHandler(c); | |
| b.touchObject = {}; | |
| b.$slider.trigger("swipe", [b, d]) | |
| } | |
| } else { | |
| if (b.touchObject.startX !== b.touchObject.curX) { | |
| b.slideHandler(b.currentSlide); | |
| b.touchObject = {} | |
| } | |
| } | |
| }; | |
| b.prototype.swipeHandler = function(a) { | |
| var b = this; | |
| if (b.options.swipe === false || "ontouchend" in document && b.options.swipe === false) { | |
| return | |
| } else if (b.options.draggable === false && a.type.indexOf("mouse") !== -1) { | |
| return | |
| } | |
| b.touchObject.fingerCount = a.originalEvent && a.originalEvent.touches !== undefined ? a.originalEvent.touches.length : 1; | |
| b.touchObject.minSwipe = b.listWidth / b.options.touchThreshold; | |
| if (b.options.verticalSwiping === true) { | |
| b.touchObject.minSwipe = b.listHeight / b.options.touchThreshold | |
| } | |
| switch (a.data.action) { | |
| case "start": | |
| b.swipeStart(a); | |
| break; | |
| case "move": | |
| b.swipeMove(a); | |
| break; | |
| case "end": | |
| b.swipeEnd(a); | |
| break | |
| } | |
| }; | |
| b.prototype.swipeMove = function(a) { | |
| var b = this, | |
| c = false, | |
| d, e, f, g, h; | |
| h = a.originalEvent !== undefined ? a.originalEvent.touches : null; | |
| if (!b.dragging || h && h.length !== 1) { | |
| return false | |
| } | |
| d = b.getLeft(b.currentSlide); | |
| b.touchObject.curX = h !== undefined ? h[0].pageX : a.clientX; | |
| b.touchObject.curY = h !== undefined ? h[0].pageY : a.clientY; | |
| b.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(b.touchObject.curX - b.touchObject.startX, 2))); | |
| if (b.options.verticalSwiping === true) { | |
| b.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(b.touchObject.curY - b.touchObject.startY, 2))) | |
| } | |
| e = b.swipeDirection(); | |
| if (e === "vertical") { | |
| return | |
| } | |
| if (a.originalEvent !== undefined && b.touchObject.swipeLength > 4) { | |
| a.preventDefault() | |
| } | |
| g = (b.options.rtl === false ? 1 : -1) * (b.touchObject.curX > b.touchObject.startX ? 1 : -1); | |
| if (b.options.verticalSwiping === true) { | |
| g = b.touchObject.curY > b.touchObject.startY ? 1 : -1 | |
| } | |
| f = b.touchObject.swipeLength; | |
| b.touchObject.edgeHit = false; | |
| if (b.options.infinite === false) { | |
| if (b.currentSlide === 0 && e === "right" || b.currentSlide >= b.getDotCount() && e === "left") { | |
| f = b.touchObject.swipeLength * b.options.edgeFriction; | |
| b.touchObject.edgeHit = true | |
| } | |
| } | |
| if (b.options.vertical === false) { | |
| b.swipeLeft = d + f * g | |
| } else { | |
| b.swipeLeft = d + f * (b.$list.height() / b.listWidth) * g | |
| } | |
| if (b.options.verticalSwiping === true) { | |
| b.swipeLeft = d + f * g | |
| } | |
| if (b.options.fade === true || b.options.touchMove === false) { | |
| return false | |
| } | |
| if (b.animating === true) { | |
| b.swipeLeft = null; | |
| return false | |
| } | |
| b.setCSS(b.swipeLeft) | |
| }; | |
| b.prototype.swipeStart = function(a) { | |
| var b = this, | |
| c; | |
| b.interrupted = true; | |
| if (b.touchObject.fingerCount !== 1 || b.slideCount <= b.options.slidesToShow) { | |
| b.touchObject = {}; | |
| return false | |
| } | |
| if (a.originalEvent !== undefined && a.originalEvent.touches !== undefined) { | |
| c = a.originalEvent.touches[0] | |
| } | |
| b.touchObject.startX = b.touchObject.curX = c !== undefined ? c.pageX : a.clientX; | |
| b.touchObject.startY = b.touchObject.curY = c !== undefined ? c.pageY : a.clientY; | |
| b.dragging = true | |
| }; | |
| b.prototype.unfilterSlides = b.prototype.slickUnfilter = function() { | |
| var a = this; | |
| if (a.$slidesCache !== null) { | |
| a.unload(); | |
| a.$slideTrack.children(this.options.slide).detach(); | |
| a.$slidesCache.appendTo(a.$slideTrack); | |
| a.reinit() | |
| } | |
| }; | |
| b.prototype.unload = function() { | |
| var b = this; | |
| a(".slick-cloned", b.$slider).remove(); | |
| if (b.$dots) { | |
| b.$dots.remove() | |
| } | |
| if (b.$prevArrow && b.htmlExpr.test(b.options.prevArrow)) { | |
| b.$prevArrow.remove() | |
| } | |
| if (b.$nextArrow && b.htmlExpr.test(b.options.nextArrow)) { | |
| b.$nextArrow.remove() | |
| } | |
| b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", "") | |
| }; | |
| b.prototype.unslick = function(a) { | |
| var b = this; | |
| b.$slider.trigger("unslick", [b, a]); | |
| b.destroy() | |
| }; | |
| b.prototype.updateArrows = function() { | |
| var a = this, | |
| b; | |
| b = Math.floor(a.options.slidesToShow / 2); | |
| if (a.options.arrows === true && a.slideCount > a.options.slidesToShow && !a.options.infinite) { | |
| a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"); | |
| a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false"); | |
| if (a.currentSlide === 0) { | |
| a.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true"); | |
| a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false") | |
| } else if (a.currentSlide >= a.slideCount - a.options.slidesToShow && a.options.centerMode === false) { | |
| a.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"); | |
| a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false") | |
| } else if (a.currentSlide >= a.slideCount - 1 && a.options.centerMode === true) { | |
| a.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"); | |
| a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false") | |
| } | |
| } | |
| }; | |
| b.prototype.updateDots = function() { | |
| var a = this; | |
| if (a.$dots !== null) { | |
| a.$dots.find("li").removeClass("slick-active").attr("aria-hidden", "true"); | |
| a.$dots.find("li").eq(Math.floor(a.currentSlide / a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden", "false") | |
| } | |
| }; | |
| b.prototype.visibility = function() { | |
| var a = this; | |
| if (a.options.autoplay) { | |
| if (document[a.hidden]) { | |
| a.interrupted = true | |
| } else { | |
| a.interrupted = false | |
| } | |
| } | |
| }; | |
| a.fn.slick = function() { | |
| var a = this, | |
| c = arguments[0], | |
| d = Array.prototype.slice.call(arguments, 1), | |
| e = a.length, | |
| f, g; | |
| for (f = 0; f < e; f++) { | |
| if (typeof c == "object" || typeof c == "undefined") a[f].slick = new b(a[f], c); | |
| else g = a[f].slick[c].apply(a[f].slick, d); | |
| if (typeof g != "undefined") return g | |
| } | |
| return a | |
| } | |
| }); | |
| (function(a, b) { | |
| if (typeof define === "function" && define.amd) { | |
| define(b) | |
| } else if (typeof exports === "object") { | |
| module.exports = b() | |
| } else { | |
| a.objectFitPolyfill = b() | |
| } | |
| })(this, function() { | |
| "use strict"; | |
| if ("objectFit" in document.documentElement.style !== false) { | |
| return | |
| } | |
| var a = function(a) { | |
| var b = window.getComputedStyle(a, null); | |
| var c = b.getPropertyValue("position"); | |
| var d = b.getPropertyValue("overflow"); | |
| var e = b.getPropertyValue("display"); | |
| if (!c || c === "static") { | |
| a.style.position = "relative" | |
| } | |
| if (d !== "hidden") { | |
| a.style.overflow = "hidden" | |
| } | |
| if (!e || e === "inline") { | |
| a.style.display = "block" | |
| } | |
| if (a.clientHeight === 0) { | |
| a.style.height = "100%" | |
| } | |
| a.className = a.className + " object-fit-polyfill" | |
| }; | |
| var b = function(a) { | |
| var b = window.getComputedStyle(a, null); | |
| var c = { | |
| "max-width": "none", | |
| "max-height": "none", | |
| "min-width": "0px", | |
| "min-height": "0px" | |
| }; | |
| for (var d in c) { | |
| var e = b.getPropertyValue(d); | |
| if (e !== c[d]) { | |
| a.style[d] = c[d] | |
| } | |
| } | |
| }; | |
| var c = function(c) { | |
| var d = c.parentNode; | |
| a(d); | |
| b(c); | |
| c.style.position = "absolute"; | |
| c.style.height = "100%"; | |
| c.style.width = "auto"; | |
| if (c.clientWidth > d.clientWidth) { | |
| c.style.top = "0"; | |
| c.style.marginTop = "0"; | |
| c.style.left = "50%"; | |
| c.style.marginLeft = c.clientWidth / -2 + "px" | |
| } else { | |
| c.style.width = "100%"; | |
| c.style.height = "auto"; | |
| c.style.left = "0"; | |
| c.style.marginLeft = "0"; | |
| c.style.top = "50%"; | |
| c.style.marginTop = c.clientHeight / -2 + "px" | |
| } | |
| }; | |
| var d = function() { | |
| var a = document.querySelectorAll("[data-object-fit]"); | |
| for (var b = 0; b < a.length; b++) { | |
| var d = a[b].nodeName.toLowerCase(); | |
| if (d === "img") { | |
| if (a[b].complete) { | |
| c(a[b]) | |
| } else { | |
| a[b].addEventListener("load", function() { | |
| c(this) | |
| }) | |
| } | |
| } else if (d === "video") { | |
| if (a[b].readyState > 0) { | |
| c(a[b]) | |
| } else { | |
| a[b].addEventListener("loadedmetadata", function() { | |
| c(this) | |
| }) | |
| } | |
| } | |
| } | |
| }; | |
| document.addEventListener("DOMContentLoaded", function() { | |
| d() | |
| }); | |
| window.addEventListener("resize", window._.debounce(function() { | |
| d() | |
| }, 200)); | |
| window.objectFitPolyfillInit = d | |
| }); | |
| (function() { | |
| var a, b; | |
| a = this.jQuery || window.jQuery; | |
| b = a(window); | |
| a.fn.stick_in_parent = function(c) { | |
| var d, e, f, g, h, i, j, k, l, m, n, o; | |
| if (c == null) { | |
| c = {} | |
| } | |
| o = c.sticky_class, i = c.inner_scrolling, n = c.recalc_every, m = c.parent, l = c.offset_top, k = c.spacer, f = c.bottoming; | |
| if (l == null) { | |
| l = 0 | |
| } | |
| if (m == null) { | |
| m = void 0 | |
| } | |
| if (i == null) { | |
| i = true | |
| } | |
| if (o == null) { | |
| o = "is_stuck" | |
| } | |
| d = a(document); | |
| if (f == null) { | |
| f = true | |
| } | |
| g = function(c, e, g, h, j, p, q, r) { | |
| var s, t, u, v, w, x, y, z, A, B, C, D; | |
| if (c.data("sticky_kit")) { | |
| return | |
| } | |
| c.data("sticky_kit", true); | |
| w = d.height(); | |
| y = c.parent(); | |
| if (m != null) { | |
| y = y.closest(m) | |
| } | |
| if (!y.length) { | |
| throw "failed to find stick parent" | |
| } | |
| u = false; | |
| s = false; | |
| C = k != null ? k && c.closest(k) : a("<div />"); | |
| if (C) { | |
| C.css("position", c.css("position")) | |
| } | |
| z = function() { | |
| var a, b, f; | |
| if (r) { | |
| return | |
| } | |
| w = d.height(); | |
| a = parseInt(y.css("border-top-width"), 10); | |
| b = parseInt(y.css("padding-top"), 10); | |
| e = parseInt(y.css("padding-bottom"), 10); | |
| g = y.offset().top + a + b; | |
| h = y.height(); | |
| if (u) { | |
| u = false; | |
| s = false; | |
| if (k == null) { | |
| c.insertAfter(C); | |
| C.detach() | |
| } | |
| c.css({ | |
| position: "", | |
| top: "", | |
| width: "", | |
| bottom: "" | |
| }).removeClass(o); | |
| f = true | |
| } | |
| j = c.offset().top - (parseInt(c.css("margin-top"), 10) || 0) - l; | |
| p = c.outerHeight(true); | |
| q = c.css("float"); | |
| if (C) { | |
| C.css({ | |
| width: c.outerWidth(true), | |
| height: p, | |
| display: c.css("display"), | |
| "vertical-align": c.css("vertical-align"), | |
| float: q | |
| }) | |
| } | |
| if (f) { | |
| return D() | |
| } | |
| }; | |
| z(); | |
| if (p === h) { | |
| return | |
| } | |
| v = void 0; | |
| x = l; | |
| B = n; | |
| D = function() { | |
| var a, m, t, A, D, E; | |
| if (r) { | |
| return | |
| } | |
| t = false; | |
| if (B != null) { | |
| B -= 1; | |
| if (B <= 0) { | |
| B = n; | |
| z(); | |
| t = true | |
| } | |
| } | |
| if (!t && d.height() !== w) { | |
| z(); | |
| t = true | |
| } | |
| A = b.scrollTop(); | |
| if (v != null) { | |
| m = A - v | |
| } | |
| v = A; | |
| if (u) { | |
| if (f) { | |
| D = A + p + x > h + g; | |
| if (s && !D) { | |
| s = false; | |
| c.css({ | |
| position: "fixed", | |
| bottom: "", | |
| top: x | |
| }).trigger("sticky_kit:unbottom") | |
| } | |
| } | |
| if (A < j) { | |
| u = false; | |
| x = l; | |
| if (k == null) { | |
| if (q === "left" || q === "right") { | |
| c.insertAfter(C) | |
| } | |
| C.detach() | |
| } | |
| a = { | |
| position: "", | |
| width: "", | |
| top: "" | |
| }; | |
| c.css(a).removeClass(o).trigger("sticky_kit:unstick") | |
| } | |
| if (i) { | |
| E = b.height(); | |
| if (p + l > E) { | |
| if (!s) { | |
| x -= m; | |
| x = Math.max(E - p, x); | |
| x = Math.min(l, x); | |
| if (u) { | |
| c.css({ | |
| top: x + "px" | |
| }) | |
| } | |
| } | |
| } | |
| } | |
| } else { | |
| if (A > j) { | |
| u = true; | |
| a = { | |
| position: "fixed", | |
| top: x | |
| }; | |
| a.width = c.css("box-sizing") === "border-box" ? c.outerWidth() + "px" : c.width() + "px"; | |
| c.css(a).addClass(o); | |
| if (k == null) { | |
| c.after(C); | |
| if (q === "left" || q === "right") { | |
| C.append(c) | |
| } | |
| } | |
| c.trigger("sticky_kit:stick") | |
| } | |
| } | |
| if (u && f) { | |
| if (D == null) { | |
| D = A + p + x > h + g | |
| } | |
| if (!s && D) { | |
| s = true; | |
| if (y.css("position") === "static") { | |
| y.css({ | |
| position: "relative" | |
| }) | |
| } | |
| return c.css({ | |
| position: "absolute", | |
| bottom: e, | |
| top: "auto" | |
| }).trigger("sticky_kit:bottom") | |
| } | |
| } | |
| }; | |
| A = function() { | |
| z(); | |
| return D() | |
| }; | |
| t = function() { | |
| r = true; | |
| b.off("touchmove", D); | |
| b.off("scroll", D); | |
| b.off("resize", A); | |
| a(document.body).off("sticky_kit:recalc", A); | |
| c.off("sticky_kit:detach", t); | |
| c.removeData("sticky_kit"); | |
| c.css({ | |
| position: "", | |
| bottom: "", | |
| top: "", | |
| width: "" | |
| }); | |
| y.position("position", ""); | |
| if (u) { | |
| if (k == null) { | |
| if (q === "left" || q === "right") { | |
| c.insertAfter(C) | |
| } | |
| C.remove() | |
| } | |
| return c.removeClass(o) | |
| } | |
| }; | |
| b.on("touchmove", D); | |
| b.on("scroll", D); | |
| b.on("resize", A); | |
| a(document.body).on("sticky_kit:recalc", A); | |
| c.on("sticky_kit:detach", t); | |
| return setTimeout(D, 0) | |
| }; | |
| for (h = 0, j = this.length; h < j; h++) { | |
| e = this[h]; | |
| g(a(e)) | |
| } | |
| return this | |
| } | |
| }).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment