vendor: 7,550 bytes, lines 1-223
1(function(global, factory) { 2 "use strict"; 3 if (typeof module === "object" && typeof module.exports === "object") { 4 module.exports = global.document ? factory(global, true) : function(w) { 5 if (!w.document) { 6 throw new Error("jQuery requires a window with a document") 7 } 8 return factory(w) 9 } 10 } else { 11 factory(global) 12 } 13} 14)(typeof window !== "undefined" ? window : this, function(window, noGlobal) { 15 "use strict"; 16 var arr = []; 17 var document = window.document; 18 var getProto = Object.getPrototypeOf; 19 var slice = arr.slice; 20 var concat = arr.concat; 21 var push = arr.push; 22 var indexOf = arr.indexOf; 23 var class2type = {}; 24 var toString = class2type.toString; 25 var hasOwn = class2type.hasOwnProperty; 26 var fnToString = hasOwn.toString; 27 var ObjectFunctionString = fnToString.call(Object); 28 var support = {}; 29 function DOMEval(code, doc) { 30 doc = doc || document; 31 var script = doc.createElement("script"); 32 script.text = code; 33 doc.head.appendChild(script).parentNode.removeChild(script) 34 } 35 var version = "3.2.1" 36 , jQuery = function(selector, context) { 37 return new jQuery.fn.init(selector,context) 38 } 39 , rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g 40 , rmsPrefix = /^-ms-/ 41 , rdashAlpha = /-([a-z])/g 42 , fcamelCase = function(all, letter) { 43 return letter.toUpperCase() 44 }; 45 jQuery.fn = jQuery.prototype = { 46 jquery: version, 47 constructor: jQuery, 48 length: 0, 49 toArray: function() { 50 return slice.call(this) 51 }, 52 get: function(num) { 53 if (num == null) { 54 return slice.call(this) 55 } 56 return num < 0 ? this[num + this.length] : this[num] 57 }, 58 pushStack: function(elems) { 59 var ret = jQuery.merge(this.constructor(), elems); 60 ret.prevObject = this; 61 return ret 62 }, 63 each: function(callback) { 64 return jQuery.each(this, callback) 65 }, 66 map: function(callback) { 67 return this.pushStack(jQuery.map(this, function(elem, i) { 68 return callback.call(elem, i, elem) 69 })) 70 }, 71 slice: function() { 72 return this.pushStack(slice.apply(this, arguments)) 73 }, 74 first: function() { 75 return this.eq(0) 76 }, 77 last: function() { 78 return this.eq(-1) 79 }, 80 eq: function(i) { 81 var len = this.length 82 , j = +i + (i < 0 ? len : 0); 83 return this.pushStack(j >= 0 && j < len ? [this[j]] : []) 84 }, 85 end: function() { 86 return this.prevObject || this.constructor() 87 }, 88 push: push, 89 sort: arr.sort, 90 splice: arr.splice 91 }; 92 jQuery.extend = jQuery.fn.extend = function() { 93 var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; 94 if (typeof target === "boolean") { 95 deep = target; 96 target = arguments[i] || {}; 97 i++ 98 } 99 if (typeof target !== "object" && !jQuery.isFunction(target)) { 100 target = {} 101 } 102 if (i === length) { 103 target = this; 104 i-- 105 } 106 for (; i < length; i++) { 107 if ((options = arguments[i]) != null) { 108 for (name in options) { 109 src = target[name]; 110 copy = options[name]; 111 if (target === copy) { 112 continue 113 } 114 if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) { 115 if (copyIsArray) { 116 copyIsArray = false; 117 clone = src && Array.isArray(src) ? src : [] 118 } else { 119 clone = src && jQuery.isPlainObject(src) ? src : {} 120 } 121 target[name] = jQuery.extend(deep, clone, copy) 122 } else if (copy !== undefined) { 123 target[name] = copy 124 } 125 } 126 } 127 } 128 return target 129 } 130 ; 131 jQuery.extend({ 132 expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""), 133 isReady: true, 134 error: function(msg) { 135 throw new Error(msg) 136 }, 137 noop: function() {}, 138 isFunction: function(obj) { 139 return jQuery.type(obj) === "function" 140 }, 141 isWindow: function(obj) { 142 return obj != null && obj === obj.window 143 }, 144 isNumeric: function(obj) { 145 var type = jQuery.type(obj); 146 return (type === "number" || type === "string") && !isNaN(obj - parseFloat(obj)) 147 }, 148 isPlainObject: function(obj) { 149 var proto, Ctor; 150 if (!obj || toString.call(obj) !== "[object Object]") { 151 return false 152 } 153 proto = getProto(obj); 154 if (!proto) { 155 return true 156 } 157 Ctor = hasOwn.call(proto, "constructor") && proto.constructor; 158 return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString 159 }, 160 isEmptyObject: function(obj) { 161 var name; 162 for (name in obj) { 163 return false 164 } 165 return true 166 }, 167 type: function(obj) { 168 if (obj == null) { 169 return obj + "" 170 } 171 return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj 172 }, 173 globalEval: function(code) { 174 DOMEval(code) 175 }, 176 camelCase: function(string) { 177 return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase) 178 }, 179 each: function(obj, callback) { 180 var length, i = 0; 181 if (isArrayLike(obj)) { 182 length = obj.length; 183 for (; i < length; i++) { 184 if (callback.call(obj[i], i, obj[i]) === false) { 185 break 186 } 187 } 188 } else { 189 for (i in obj) { 190 if (callback.call(obj[i], i, obj[i]) === false) { 191 break 192 } 193 } 194 } 195 return obj 196 }, 197 trim: function(text) { 198 return text == null ? "" : (text + "").replace(rtrim, "") 199 }, 200 makeArray: function(arr, results) { 201 var ret = results || []; 202 if (arr != null) { 203 if (isArrayLike(Object(arr))) { 204 jQuery.merge(ret, typeof arr === "string" ? [arr] : arr) 205 } else { 206 push.call(ret, arr) 207 } 208 } 209 return ret 210 }, 211 inArray: function(elem, arr, i) { 212 return arr == null ? -1 : indexOf.call(arr, elem, i) 213 }, 214 merge: function(first, second) { 215 var len = +second.length 216 , j = 0 217 , i = first.length; 218 for (; j < len; j++) { 219 first[i++] = second[j] 220 } 221 first.length = i; 222 return first 223 },
224 grep: function(elems, callback, invert) { 225 var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; 226 for (; i < length; i++) { 227 callbackInverse = !callback(elems[i], i); 228 if (callbackInverse !== callbackExpect) { 229 matches.push(elems[i]) 230 } 231 } 232 return matches 233 }, 234 map: function(elems, callback, arg) { 235 var length, value, i = 0, ret = []; 236 if (isArrayLike(elems)) { 237 length = elems.length; 238 for (; i < length; i++) { 239 value = callback(elems[i], i, arg); 240 if (value != null) { 241 ret.push(value) 242 } 243 } 244 } else { 245 for (i in elems) { 246 value = callback(elems[i], i, arg); 247 if (value != null) { 248 ret.push(value) 249 } 250 } 251 } 252 return concat.apply([], ret) 253 }, 254 guid: 1, 255 proxy: function(fn, context) { 256 var tmp, args, proxy; 257 if (typeof context === "string") { 258 tmp = fn[context]; 259 context = fn; 260 fn = tmp 261 } 262 if (!jQuery.isFunction(fn)) { 263 return undefined 264 } 265 args = slice.call(arguments, 2); 266 proxy = function() { 267 return fn.apply(context || this, args.concat(slice.call(arguments))) 268 } 269 ; 270 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 271 return proxy 272 }, 273 now: Date.now, 274 support: support 275 }); 276 if (typeof Symbol === "function") { 277 jQuery.fn[Symbol.iterator] = arr[Symbol.iterator] 278 } 279 jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(i, name) { 280 class2type["[object " + name + "]"] = name.toLowerCase() 281 }); 282 function isArrayLike(obj) { 283 var length = !!obj && "length"in obj && obj.length 284 , type = jQuery.type(obj); 285 if (type === "function" || jQuery.isWindow(obj)) { 286 return false 287 } 288 return type === "array" || length === 0 || typeof length === "number" && length > 0 && (length - 1)in obj 289 } 290 var Sizzle = (function(window) { 291 var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function(a, b) { 292 if (a === b) { 293 hasDuplicate = true 294 } 295 return 0 296 }, hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, indexOf = function(list, elem) { 297 var i = 0 298 , len = list.length; 299 for (; i < len; i++) { 300 if (list[i] === elem) { 301 return i 302 } 303 } 304 return -1 305 }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", whitespace = "[\\x20\\t\\r\\n\\f]", identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + ".*" + ")\\)|)", rwhitespace = new RegExp(whitespace + "+","g"), rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$","g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]","g"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = { 306 "ID": new RegExp("^#(" + identifier + ")"), 307 "CLASS": new RegExp("^\\.(" + identifier + ")"), 308 "TAG": new RegExp("^(" + identifier + "|[*])"), 309 "ATTR": new RegExp("^" + attributes), 310 "PSEUDO": new RegExp("^" + pseudos), 311 "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)","i"), 312 "bool": new RegExp("^(?:" + booleans + ")$","i"), 313 "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)","i") 314 }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)","ig"), funescape = function(_, escaped, escapedWhitespace) { 315 var high = "0x" + escaped - 0x10000; 316 return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 0x10000) : String.fromCharCode(high >>
316 10 | 0xD800, high & 0x3FF | 0xDC00) 317 }, rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, fcssescape = function(ch, asCodePoint) { 318 if (asCodePoint) { 319 if (ch === "\0") { 320 return "\uFFFD" 321 } 322 return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " " 323 } 324 return "\\" + ch 325 }, unloadHandler = function() { 326 setDocument() 327 }, disabledAncestor = addCombinator(function(elem) { 328 return elem.disabled === true && ("form"in elem || "label"in elem) 329 }, { 330 dir: "parentNode", 331 next: "legend" 332 }); 333 try { 334 push.apply((arr = slice.call(preferredDoc.childNodes)), preferredDoc.childNodes); 335 arr[preferredDoc.childNodes.length].nodeType 336 } catch (e) { 337 push = { 338 apply: arr.length ? function(target, els) { 339 push_native.apply(target, slice.call(els)) 340 } 341 : function(target, els) { 342 var j = target.length 343 , i = 0; 344 while ((target[j++] = els[i++])) {} 345 target.length = j - 1 346 } 347 } 348 } 349 function Sizzle(selector, context, results, seed) { 350 var m, i, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9; 351 results = results || []; 352 if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) { 353 return results 354 } 355 if (!seed) { 356 if ((context ? context.ownerDocument || context : preferredDoc) !== document) { 357 setDocument(context) 358 } 359 context = context || document; 360 if (documentIsHTML) { 361 if (nodeType !== 11 && (match = rquickExpr.exec(selector))) { 362 if ((m = match[1])) { 363 if (nodeType === 9) { 364 if ((elem = context.getElementById(m))) { 365 if (elem.id === m) { 366 results.push(elem); 367 return results 368 } 369 } else { 370 return results 371 } 372 } else { 373 if (newContext && (elem = newContext.getElementById(m)) && contains(context, elem) && elem.id === m) { 374 results.push(elem); 375 return results 376 } 377 } 378 } else if (match[2]) { 379 push.apply(results, context.getElementsByTagName(selector)); 380 return results 381 } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) { 382 push.apply(results, context.getElementsByClassName(m)); 383 return results 384 } 385 } 386 if (support.qsa && !compilerCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) { 387 if (nodeType !== 1) { 388 newContext = context; 389 newSelector = selector 390 } else if (context.nodeName.toLowerCase() !== "object") { 391 if ((nid = context.getAttribute("id"))) { 392 nid = nid.replace(rcssescape, fcssescape) 393 } else { 394 context.setAttribute("id", (nid = expando)) 395 } 396 groups = tokenize(selector); 397 i = groups.length; 398 while (i--) { 399 groups[i] = "#" + nid + " " + toSelector(groups[i]) 400 } 401 newSelector = groups.join(","); 402 newContext = rsibling.test(selector) && testC
402ontext(context.parentNode) || context 403 } 404 if (newSelector) { 405 try { 406 push.apply(results, newContext.querySelectorAll(newSelector)); 407 return results 408 } catch (qsaError) {} finally { 409 if (nid === expando) { 410 context.removeAttribute("id") 411 } 412 } 413 } 414 } 415 } 416 } 417 return select(selector.replace(rtrim, "$1"), context, results, seed) 418 } 419 function createCache() { 420 var keys = []; 421 function cache(key, value) { 422 if (keys.push(key + " ") > Expr.cacheLength) { 423 delete cache[keys.shift()] 424 } 425 return (cache[key + " "] = value) 426 } 427 return cache 428 } 429 function markFunction(fn) { 430 fn[expando] = true; 431 return fn 432 } 433 function assert(fn) { 434 var el = document.createElement("fieldset"); 435 try { 436 return !!fn(el) 437 } catch (e) { 438 return false 439 } finally { 440 if (el.parentNode) { 441 el.parentNode.removeChild(el) 442 } 443 el = null 444 } 445 } 446 function addHandle(attrs, handler) { 447 var arr = attrs.split("|") 448 , i = arr.length; 449 while (i--) { 450 Expr.attrHandle[arr[i]] = handler 451 } 452 } 453 function siblingCheck(a, b) { 454 var cur = b && a 455 , diff = cur && a.nodeType === 1 && b.nodeType === 1 && a.sourceIndex - b.sourceIndex; 456 if (diff) { 457 return diff 458 } 459 if (cur) { 460 while ((cur = cur.nextSibling)) { 461 if (cur === b) { 462 return -1 463 } 464 } 465 } 466 return a ? 1 : -1 467 } 468 function createInputPseudo(type) { 469 return function(elem) { 470 var name = elem.nodeName.toLowerCase(); 471 return name === "input" && elem.type === type 472 } 473 } 474 function createButtonPseudo(type) { 475 return function(elem) { 476 var name = elem.nodeName.toLowerCase(); 477 return (name === "input" || name === "button") && elem.type === type 478 } 479 } 480 function createDisabledPseudo(disabled) { 481 return function(elem) { 482 if ("form"in elem) { 483 if (elem.parentNode && elem.disabled === false) { 484 if ("label"in elem) { 485 if ("label"in elem.parentNode) { 486 return elem.parentNode.disabled === disabled 487 } else { 488 return elem.disabled === disabled 489 } 490 } 491 return elem.isDisabled === disabled || elem.isDisabled !== !disabled && disabledAncestor(elem) === disabled 492 } 493 return elem.disabled === disabled 494 } else if ("label"in elem) { 495 return elem.disabled === disabled 496 } 497 return false 498 } 499 } 500 function createPositionalPseudo(fn) { 501 return markFunction(function(argument) { 502 argument = +argument; 503 return markFunction(function(seed, matches) { 504 var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length; 505 while (i--) { 506 if (seed[(j = matchIndexes[i])]) { 507 seed[j] = !(matches[j] = seed[j]) 508 } 509 } 510 }) 511 }) 512 } 513 function testContext(context) { 514 return context && typeof context.getElementsByTagName !== "undefined" && context 515 } 516 support = Sizzle.support = {}; 517 isXML = Sizzle.isXML = function(elem) { 518 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 519 return documentElement ? documentElement.nodeName !== "HTML" : false 520 } 521 ; 522 setDocument = Sizzle.setDocument = function(node) { 523 var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc; 524 if (doc === document || doc.nodeType !== 9 || !doc.documentElement) { 525 return document 526 } 527 document = doc; 528 docElem = document.documentElement; 529 documentIsHTML = !isXML(document); 530 if (preferredDoc !== document && (subWindow = document.defaultView) && subWindow.top !== subWindow) { 531 if (subWindow.addEventListener) { 532 subWindow.addEventListener("unload", unloadHandler, false) 533 } else if (subWindow.attachEvent) { 534 subWindow.attachEvent("onunload", unloadHandler) 535 } 536 } 537 support.attributes = assert(function(el) { 538 el.className = "i"; 539 return !el.getAttribute("className") 540 }); 541 support.getElementsByTagName = assert(function(el) { 542 el.appendChild(document.createComment("")); 543 return !el.getElementsByTagName("*").length 544 }); 545 support.getElementsByClassName = rnative.test(document.getElementsByClassName); 546 support.getById = assert(function(el) { 547 docElem.appendChild(el).id = expando; 548 return !document.getElementsByName || !document.getElementsByName(expando).length 549 }); 550 if (support.getById) { 551 Expr.filter["ID"] = function(id) { 552 var attrId = id.replace(runescape, funescape); 553 return function(elem) { 554 return elem.getAttribute("id") === attrId 555 } 556 } 557 ; 558 Expr.find["ID"] = function(id, context) { 559 if (typeof context.getElementById !== "undefined" && documentIsHTML) { 560 var elem = context.getElementById(id); 561 return elem ? [elem] : [] 562 } 563 } 564 } else { 565 Expr.filter["ID"] = function(id) { 566 var attrId = id.replace(runescape, funescape); 567 return function(elem) { 568 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); 569 return node && node.value === attrId 570 } 571 } 572 ; 573 Expr.find["ID"] = function(id, context) { 574 if (typeof context.getElementById !== "undefined" && documentIsHTML) { 575 var node, i, elems, elem = context.getElementById(id); 576 if (elem) { 577 node = elem.getAttributeNode("id"); 578 if (node && node.value === id) { 579 return [elem] 580 } 581 elems = context.getElementsByName(id); 582 i = 0; 583 while ((elem = elems[i++])) { 584 node = elem.getAttributeNode("id"); 585 if (node && node.value === id) { 586 return [elem] 587 } 588 } 589 } 590 return [] 591 } 592 } 593 } 594 Expr.find["TAG"] = support.getElementsByTagName ? function(tag, context) { 595 if (typeof context.getElementsByTagName !== "undefined") { 596 return context.getElementsByTagName(tag) 597 } else if (support.qsa) { 598 return context.querySelectorAll(tag) 599 } 600 } 601 : function(tag, context) { 602 var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag); 603 if (tag === "*") { 604 while ((elem = results[i++])) { 605 if (elem.nodeType === 1) { 606 tmp.push(elem) 607 } 608 } 609 return tmp 610 } 611 return results 612 } 613 ; 614 Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) { 615 if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) { 616 return context.getElementsByClassName(className) 617 } 618 } 619 ; 620 rbuggyMatches = []; 621 rbuggyQSA = []; 622 if ((support.qsa = rnative.test(document.querySelectorAll))) { 623 assert(function(el) { 624 docElem.appendChild(el).innerHTML = "<a id='" + expando + "'></a>" + "<select id='" + expando + "-\r\\' msallowcapture=''>" + "<option selected=''></option></select>"; 625 if (el.querySelectorAll("[msallowcapture^='']").length) { 626 rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")") 627 } 628 if (!el.querySelectorAll("[selected]").length) { 629 rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")") 630 } 631 if (!el.querySelectorAll("[id~=" + expando + "-]").length) { 632 rbuggyQSA.push("~=") 633 } 634 if (!el.querySelectorAll(":checked").length) { 635 rbuggyQSA.push(":checked") 636 } 637 if (!el.querySelectorAll("a#" + expando + "+*").length) { 638 rbuggyQSA.push(".#.+[+~]") 639 } 640 }); 641 assert(function(el) { 642 el.innerHTML = "<a href='' disabled='disabled'></a>" + "<select disabled='disabled'><option/></select>"; 643 var input = document.createElement("input"); 644 input.setAttribute("type", "hidden"); 645 el.appendChild(input).setAttribute("name", "D"); 646 if (el.querySelectorAll("[name=d]").length) { 647 rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=") 648 } 649 if (el.querySelectorAll(":enabled").length !== 2) { 650 rbuggyQSA.push(":enabled", ":disabled") 651 } 652 docElem.appendChild(el).disabled = true; 653 if (el.querySelectorAll(":disabled").length !== 2) { 654 rbuggyQSA.push(":enabled", ":disabled") 655 } 656 el.querySelectorAll("*,:x"); 657 rbuggyQSA.push(",.*:") 658 }) 659 } 660 if ((support.matchesSelector = rnative.test((matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)))) { 661 assert(function(el) { 662 support.disconnectedMatch = matches.call(el, "*"); 663 matches.call(el, "[s!='']:x"); 664 rbuggyMatches.push("!=", pseudos) 665 }) 666 } 667 rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.j
667oin("|")); 668 rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")); 669 hasCompare = rnative.test(docElem.compareDocumentPosition); 670 contains = hasCompare || rnative.test(docElem.contains) ? function(a, b) { 671 var adown = a.nodeType === 9 ? a.documentElement : a 672 , bup = b && b.parentNode; 673 return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16)) 674 } 675 : function(a, b) { 676 if (b) { 677 while ((b = b.parentNode)) { 678 if (b === a) { 679 return true 680 } 681 } 682 } 683 return false 684 } 685 ; 686 sortOrder = hasCompare ? function(a, b) { 687 if (a === b) { 688 hasDuplicate = true; 689 return 0 690 } 691 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 692 if (compare) { 693 return compare 694 } 695 compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1; 696 if (compare & 1 || (!support.sortDetached && b.compareDocumentPosition(a) === compare)) { 697 if (a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) { 698 return -1 699 } 700 if (b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) { 701 return 1 702 } 703 return sortInput ? (indexOf(sortInput, a) - indexOf(sortInput, b)) : 0 704 } 705 return compare & 4 ? -1 : 1 706 } 707 : function(a, b) { 708 if (a === b) { 709 hasDuplicate = true; 710 return 0 711 } 712 var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b]; 713 if (!aup || !bup) { 714 return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? (indexOf(sortInput, a) - indexOf(sortInput, b)) : 0 715 } else if (aup === bup) { 716 return siblingCheck(a, b) 717 } 718 cur = a; 719 while ((cur = cur.parentNode)) { 720 ap.unshift(cur) 721 } 722 cur = b; 723 while ((cur = cur.parentNode)) { 724 bp.unshift(cur) 725 } 726 while (ap[i] === bp[i]) { 727 i++ 728 } 729 return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0 730 } 731 ; 732 return document 733 } 734 ; 735 Sizzle.matches = function(expr, elements) { 736 return Sizzle(expr, null, null, elements) 737 } 738 ; 739 Sizzle.matchesSelector = function(elem, expr) { 740 if ((elem.ownerDocument || elem) !== document) { 741 setDocument(elem) 742 } 743 expr = expr.replace(rattributeQuotes, "='$1']"); 744 if (support.matchesSelector && documentIsHTML && !compilerCache[expr + " "] && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) { 745 try { 746 var ret = matches.call(elem, expr); 747 if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) { 748 return ret 749 } 750 } catch (e) {} 751 } 752 return Sizzle(expr, document, null, [elem]).length > 0 753 } 754 ; 755 Sizzle.contains = function(context, elem) { 756 if ((context.ownerDocument || context) !== document) { 757 setDocument(context) 758 } 759 return contains(context, elem) 760 } 761 ; 762 Sizzle.attr = function(elem, name) { 763 if ((elem.ownerDocument || elem) !== document) { 764 setDocument(elem) 765 } 766 var fn = Expr.attrHandle[name.toLowerCase()] 767 , val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined; 768 return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null 769 } 770 ; 771 Sizzle.escape = function(sel) { 772 return (sel + "").replace(rcssescape, fcssescape) 773 } 774 ; 775 Sizzle.error = function(msg) { 776 throw new Error("Syntax error, unrecognized expression: " + msg) 777 } 778 ; 779 Sizzle.uniqueSort = function(results) { 780 var elem, duplicates = [], j = 0, i = 0; 781 hasDuplicate = !support.detectDuplicates; 782 sortInput = !support.sortStable && results.slice(0); 783 results.sort(sortOrder);
784 if (hasDuplicate) { 785 while ((elem = results[i++])) { 786 if (elem === results[i]) { 787 j = duplicates.push(i) 788 } 789 } 790 while (j--) { 791 results.splice(duplicates[j], 1) 792 } 793 } 794 sortInput = null; 795 return results 796 } 797 ; 798 getText = Sizzle.getText = function(elem) { 799 var node, ret = "", i = 0, nodeType = elem.nodeType; 800 if (!nodeType) { 801 while ((node = elem[i++])) { 802 ret += getText(node) 803 } 804 } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) { 805 if (typeof elem.textContent === "string") { 806 return elem.textContent 807 } else { 808 for (elem = elem.firstChild; elem; elem = elem.nextSibling) { 809 ret += getText(elem) 810 } 811 } 812 } else if (nodeType === 3 || nodeType === 4) { 813 return elem.nodeValue 814 } 815 return ret 816 } 817 ; 818 Expr = Sizzle.selectors = { 819 cacheLength: 50, 820 createPseudo: markFunction, 821 match: matchExpr, 822 attrHandle: {}, 823 find: {}, 824 relative: { 825 ">": { 826 dir: "parentNode", 827 first: true 828 }, 829 " ": { 830 dir: "parentNode" 831 }, 832 "+": { 833 dir: "previousSibling", 834 first: true 835 }, 836 "~": { 837 dir: "previousSibling" 838 } 839 }, 840 preFilter: { 841 "ATTR": function(match) { 842 match[1] = match[1].replace(runescape, funescape); 843 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape); 844 if (match[2] === "~=") { 845 match[3] = " " + match[3] + " " 846 } 847 return match.slice(0, 4) 848 }, 849 "CHILD": function(match) { 850 match[1] = match[1].toLowerCase(); 851 if (match[1].slice(0, 3) === "nth") { 852 if (!match[3]) { 853 Sizzle.error(match[0]) 854 } 855 match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd")); 856 match[5] = +((match[7] + match[8]) || match[3] === "odd") 857 } else if (match[3]) { 858 Sizzle.error(match[0]) 859 } 860 return match 861 }, 862 "PSEUDO": function(match) { 863 var excess, unquoted = !match[6] && match[2]; 864 if (matchExpr["CHILD"].test(match[0])) { 865 return null 866 } 867 if (match[3]) { 868 match[2] = match[4] || match[5] || "" 869 } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) { 870 match[0] = match[0].slice(0, excess); 871 match[2] = unquoted.slice(0, excess) 872 } 873 return match.slice(0, 3) 874 } 875 }, 876 filter: { 877 "TAG": function(nodeNameSelector) { 878 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); 879 return nodeNameSelector === "*" ? function() { 880 return true 881 } 882 : function(elem) { 883 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName 884 } 885 }, 886 "CLASS": function(className) { 887 var pattern = classCache[className + " "]; 888 return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) { 889 return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "") 890 }) 891 }, 892 "ATTR": function(name, operator, check) { 893 return function(elem) { 894 var result = Sizzle.attr(elem, name); 895 if (result == null) { 896 return operator === "!=" 897 } 898 if (!operator) { 899 return true 900 } 901 result += ""; 902 return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.slice(-check.length) === check : operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" : false 903 } 904 }, 905 "CHILD": function(type, what, argument, first, last) { 906 var simple = type.slice(0, 3) !== "nth" 907 , forward = type.slice(-4) !== "last" 908 , ofType = what === "of-type"; 909 return first === 1 && last === 0 ? function(elem) { 910 return !!elem.parentNode 911 } 912 : function(elem, context, xml) { 913 var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
914 if (parent) { 915 if (simple) { 916 while (dir) { 917 node = elem; 918 while ((node = node[dir])) { 919 if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) { 920 return false 921 } 922 } 923 start = dir = type === "only" && !start && "nextSibling" 924 } 925 return true 926 } 927 start = [forward ? parent.firstChild : parent.lastChild]; 928 if (forward && useCache) { 929 node = parent; 930 outerCache = node[expando] || (node[expando] = {}); 931 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); 932 cache = uniqueCache[type] || []; 933 nodeIndex = cache[0] === dirruns && cache[1]; 934 diff = nodeIndex && cache[2]; 935 node = nodeIndex && parent.childNodes[nodeIndex]; 936 while ((node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop())) { 937 if (node.nodeType === 1 && ++diff && node === elem) { 938 uniqueCache[type] = [dirruns, nodeIndex, diff]; 939 break 940 } 941 } 942 } else { 943 if (useCache) { 944 node = elem; 945 outerCache = node[expando] || (node[expando] = {}); 946 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); 947 cache = uniqueCache[type] || []; 948 nodeIndex = cache[0] === dirruns && cache[1]; 949 diff = nodeIndex 950 } 951 if (diff === false) { 952 while ((node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop())) { 953 if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) { 954 if (useCache) { 955 outerCache = node[expando] || (node[expando] = {}); 956 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); 957 uniqueCache[type] = [dirruns, diff] 958 } 959 if (node === elem) { 960 break 961 } 962 } 963 } 964 } 965 } 966 diff -= last; 967 return diff === first || (diff % first === 0 && diff / first >= 0) 968 } 969 } 970 }, 971 "PSEUDO": function(pseudo, argument) { 972 var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo); 973 if (fn[expando]) { 974 return fn(argument) 975 } 976 if (fn.length > 1) { 977 args = [pseudo, pseudo, "", argument]; 978 return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches) { 979 var idx, matched = fn(seed, argument), i = matched.length; 980 while (i--) { 981 idx = indexOf(seed, matched[i]); 982 seed[idx] = !(matches[idx] = matched[i]) 983 } 984 }) : function(elem) { 985 return fn(elem, 0, args) 986 } 987 } 988 return fn 989 } 990 }, 991 pseudos: { 992 "not": markFunction(function(selector) { 993 var input = [] 994 , results = [] 995 , matcher = compile(selector.replace(rtrim, "$1")); 996 return matcher[expando] ? markFunction(function(seed, matches, context, xml) { 997 var elem, unmatched = matcher(seed, null, xml, []), i = seed.length; 998 while (i--) { 999 if ((elem = unmatched[i])) { 1000 seed[i] = !(matches[i] = elem) 1001 } 1002 } 1003 }) : function(elem, context, xml) { 1004 input[0] = elem; 1005 matcher(input, null, xml, results); 1006 input[0] = null; 1007 return !results.pop() 1008 } 1009 }), 1010 "has": markFunction(function(selector) { 1011 return function(elem) { 1012 return Sizzle(selector, elem).length > 0 1013 } 1014 }), 1015 "contains": markFunction(function(text) { 1016 text = text.replace(runescape, funescape); 1017 return function(elem) { 1018 return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1 1019 } 1020 }), 1021 "lang": markFunction(function(lang) { 1022 if (!ridentifier.test(lang || "")) { 1023 Sizzle.error("unsupported lang: " + lang) 1024 } 1025 lang = lang.replace(runescape, funescape).toLowerCase(); 1026 return function(elem) { 1027 var elemLang; 1028 do { 1029 if ((elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang"))) { 1030 elemLang = elemLang.toLowerCase(); 1031 return elemLang === lang || elemLang.indexOf(lang + "-") === 0 1032 } 1033 } while ((elem = elem.parentNode) && elem.nodeType === 1); 1034 return false 1035 } 1036 }), 1037 "target": function(elem) { 1038 var hash = window.location && window.location.hash; 1039 return hash && hash.slice(1) === elem.id 1040 }, 1041 "root": function(elem) { 1042 return elem === docElem 1043 }, 1044 "focus": function(elem) { 1045 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex) 1046 }, 1047 "enabled": createDisabledPseudo(false), 1048 "disabled": createDisabledPseudo(true),
1049 "checked": function(elem) { 1050 var nodeName = elem.nodeName.toLowerCase(); 1051 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected) 1052 }, 1053 "selected": function(elem) { 1054 if (elem.parentNode) { 1055 elem.parentNode.selectedIndex 1056 } 1057 return elem.selected === true 1058 }, 1059 "empty": function(elem) { 1060 for (elem = elem.firstChild; elem; elem = elem.nextSibling) { 1061 if (elem.nodeType < 6) { 1062 return false 1063 } 1064 } 1065 return true 1066 }, 1067 "parent": function(elem) { 1068 return !Expr.pseudos["empty"](elem) 1069 }, 1070 "header": function(elem) { 1071 return rheader.test(elem.nodeName) 1072 }, 1073 "input": function(elem) { 1074 return rinputs.test(elem.nodeName) 1075 }, 1076 "button": function(elem) { 1077 var name = elem.nodeName.toLowerCase(); 1078 return name === "input" && elem.type === "button" || name === "button" 1079 }, 1080 "text": function(elem) { 1081 var attr; 1082 return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text") 1083 }, 1084 "first": createPositionalPseudo(function() { 1085 return [0] 1086 }), 1087 "last": createPositionalPseudo(function(matchIndexes, length) { 1088 return [length - 1] 1089 }), 1090 "eq": createPositionalPseudo(function(matchIndexes, length, argument) { 1091 return [argument < 0 ? argument + length : argument] 1092 }), 1093 "even": createPositionalPseudo(function(matchIndexes, length) { 1094 var i = 0; 1095 for (; i < length; i += 2) { 1096 matchIndexes.push(i) 1097 } 1098 return matchIndexes 1099 }), 1100 "odd": createPositionalPseudo(function(matchIndexes, length) { 1101 var i = 1; 1102 for (; i < length; i += 2) { 1103 matchIndexes.push(i) 1104 } 1105 return matchIndexes 1106 }), 1107 "lt": createPositionalPseudo(function(matchIndexes, length, argument) { 1108 var i = argument < 0 ? argument + length : argument; 1109 for (; --i >= 0; ) { 1110 matchIndexes.push(i) 1111 } 1112 return matchIndexes 1113 }), 1114 "gt": createPositionalPseudo(function(matchIndexes, length, argument) { 1115 var i = argument < 0 ? argument + length : argument; 1116 for (; ++i < length; ) { 1117 matchIndexes.push(i) 1118 } 1119 return matchIndexes 1120 }) 1121 } 1122 }; 1123 Expr.pseudos["nth"] = Expr.pseudos["eq"]; 1124 for (i in { 1125 radio: true, 1126 checkbox: true, 1127 file: true, 1128 password: true, 1129 image: true 1130 }) { 1131 Expr.pseudos[i] = createInputPseudo(i) 1132 } 1133 for (i in { 1134 submit: true, 1135 reset: true 1136 }) { 1137 Expr.pseudos[i] = createButtonPseudo(i) 1138 } 1139 function setFilters() {} 1140 setFilters.prototype = Expr.filters = Expr.pseudos; 1141 Expr.setFilters = new setFilters(); 1142 tokenize = Sizzle.tokenize = function(selector, parseOnly) { 1143 var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "]; 1144 if (cached) { 1145 return parseOnly ? 0 : cached.slice(0) 1146 } 1147 soFar = selector; 1148 groups = []; 1149 preFilters = Expr.preFilter; 1150 while (soFar) { 1151 if (!matched || (match = rcomma.exec(soFar))) { 1152 if (match) { 1153 soFar = soFar.slice(match[0].length) || soFar 1154 } 1155 groups.push((tokens = [])) 1156 } 1157 matched = false;
1158 if ((match = rcombinators.exec(soFar))) { 1159 matched = match.shift(); 1160 tokens.push({ 1161 value: matched, 1162 type: match[0].replace(rtrim, " ") 1163 }); 1164 soFar = soFar.slice(matched.length) 1165 } 1166 for (type in Expr.filter) { 1167 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) { 1168 matched = match.shift(); 1169 tokens.push({ 1170 value: matched, 1171 type: type, 1172 matches: match 1173 }); 1174 soFar = soFar.slice(matched.length) 1175 } 1176 } 1177 if (!matched) { 1178 break 1179 } 1180 } 1181 return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0) 1182 } 1183 ; 1184 function toSelector(tokens) { 1185 var i = 0 1186 , len = tokens.length 1187 , selector = ""; 1188 for (; i < len; i++) { 1189 selector += tokens[i].value 1190 } 1191 return selector 1192 } 1193 function addCombinator(matcher, combinator, base) { 1194 var dir = combinator.dir 1195 , skip = combinator.next 1196 , key = skip || dir 1197 , checkNonElements = base && key === "parentNode" 1198 , doneName = done++; 1199 return combinator.first ? function(elem, context, xml) { 1200 while ((elem = elem[dir])) { 1201 if (elem.nodeType === 1 || checkNonElements) { 1202 return matcher(elem, context, xml) 1203 } 1204 } 1205 return false 1206 } 1207 : function(elem, context, xml) { 1208 var oldCache, uniqueCache, outerCache, newCache = [dirruns, doneName]; 1209 if (xml) { 1210 while ((elem = elem[dir])) { 1211 if (elem.nodeType === 1 || checkNonElements) { 1212 if (matcher(elem, context, xml)) { 1213 return true 1214 } 1215 } 1216 } 1217 } else { 1218 while ((elem = elem[dir])) { 1219 if (elem.nodeType === 1 || checkNonElements) { 1220 outerCache = elem[expando] || (elem[expando] = {}); 1221 uniqueCache = outerCache[elem.uniqueID] || (outerCache[elem.uniqueID] = {}); 1222 if (skip && skip === elem.nodeName.toLowerCase()) { 1223 elem = elem[dir] || elem 1224 } else if ((oldCache = uniqueCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) { 1225 return (newCache[2] = oldCache[2]) 1226 } else { 1227 uniqueCache[key] = newCache; 1228 if ((newCache[2] = matcher(elem, context, xml))) { 1229 return true 1230 } 1231 } 1232 } 1233 } 1234 } 1235 return false 1236 } 1237 } 1238 function elementMatcher(matchers) { 1239 return matchers.length > 1 ? function(elem, context, xml) { 1240 var i = matchers.length; 1241 while (i--) { 1242 if (!matchers[i](elem, context, xml)) { 1243 return false 1244 } 1245 } 1246 return true 1247 } 1248 : matchers[0] 1249 } 1250 function multipleContexts(selector, contexts, results) { 1251 var i = 0 1252 , len = contexts.length; 1253 for (; i < len; i++) { 1254 Sizzle(selector, contexts[i], results) 1255 } 1256 return results 1257 } 1258 function condense(unmatched, map, filter, context, xml) { 1259 var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; 1260 for (; i < len; i++) { 1261 if ((elem = unmatched[i])) { 1262 if (!filter || filter(elem, context, xml)) { 1263 newUnmatched.push(elem); 1264 if (mapped) { 1265 map.push(i) 1266 } 1267 } 1268 } 1269 } 1270 return newUnmatched 1271 } 1272 function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { 1273 if (postFilter && !postFilter[expando]) { 1274 postFilter = setMatcher(postFilter) 1275 } 1276 if (postFinder && !postFinder[expando]) { 1277 postFinder = setMatcher(postFinder, postSelector) 1278 } 1279 return markFunction(function(seed, results, context, xml) { 1280 var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn; 1281 if (matcher) { 1282 matcher(matcherIn, matcherOut, context, xml) 1283 } 1284 if (postFilter) { 1285 temp = condense(matcherOut, postMap); 1286 postFilter(temp, [], context, xml); 1287 i = temp.length; 1288 while (i--) { 1289 if ((elem = temp[i])) { 1290 matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem) 1291 } 1292 } 1293 } 1294 if (seed) { 1295 if (postFinder || preFilter) { 1296 if (postFinder) { 1297 temp = []; 1298 i = matcherOut.length; 1299 while (i--) { 1300 if ((elem = matcherOut[i])) { 1301 temp.push((matcherIn[i] = elem)) 1302 } 1303 } 1304 postFinder(null, (matcherOut = []), temp, xml) 1305 } 1306 i = matcherOut.length; 1307 while (i--) { 1308 if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) { 1309 seed[temp] = !(results[temp] = elem) 1310 } 1311 } 1312 } 1313 } else { 1314 matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut); 1315 if (postFinder) { 1316 postFinder(null, results, matcherOut, xml) 1317 } else { 1318 push.apply(results, matcherOut) 1319 } 1320 } 1321 }) 1322 } 1323 function matcherFromTokens(tokens) { 1324 var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) { 1325 return elem === checkContext 1326 }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) { 1327 return indexOf(checkContext, elem) > -1 1328 }, implicitRelative, true), matchers = [function(elem, context, xml) { 1329 var ret = (!leadingRelative && (xml || context !== outermostContext)) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); 1330 checkContext = null; 1331 return ret 1332 } 1333 ]; 1334 for (; i < len; i++) { 1335 if ((matcher = Expr.relative[tokens[i].type])) { 1336 matchers = [addCombinator(elementMatcher(matchers), matcher)] 1337 } else { 1338 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); 1339 if (matcher[expando]) { 1340 j = ++i; 1341 for (; j < len; j++) { 1342 if (Expr.relative[tokens[j].type]) { 1343 break 1344 } 1345 } 1346 return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({ 1347 value: tokens[i - 2].type === " " ? "*" : "" 1348 })).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens((tokens = tokens.slice(j))), j < len && toSelector(tokens)) 1349 } 1350 matchers.push(matcher) 1351 } 1352 } 1353 return elementMatcher(matchers) 1354 } 1355 function matcherFromGroupMatchers(elementMatchers, setMatchers) { 1356 var bySet = setMatchers.length > 0 1357 , byElement = elementMatchers.length > 0 1358 , superMatcher = function(seed, context, xml, results, outermost) { 1359 var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find["TAG"]("*", outermost), dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length; 1360 if (outermost) { 1361 outermostContext = context === document || context || outermost 1362 } 1363 for (; i !== len && (elem = elems[i]) != null; i++) { 1364 if (byElement && elem) { 1365 j = 0; 1366 if (!context && elem.ownerDocument !== document) { 1367 setDocument(elem); 1368 xml = !documentIsHTML 1369 } 1370 while ((matcher = elementMatchers[j++])) { 1371 if (matcher(elem, context || document, xml)) { 1372 results.push(elem); 1373 break 1374 } 1375 } 1376 if (outermost) { 1377 dirruns = dirrunsUnique 1378 } 1379 } 1380 if (bySet) { 1381 if ((elem = !matcher && elem)) { 1382 matchedCount-- 1383 } 1384 if (seed) { 1385 unmatched.push(elem) 1386 } 1387 } 1388 } 1389 matchedCount += i; 1390 if (bySet && i !== matchedCount) { 1391 j = 0; 1392 while ((matcher = setMatchers[j++])) { 1393 matcher(unmatched, setMatched, context, xml) 1394 } 1395 if (seed) { 1396 if (matchedCount > 0) { 1397 while (i--) { 1398 if (!(unmatched[i] || setMatched[i])) { 1399 setMatched[i] = pop.call(results) 1400 } 1401 } 1402 } 1403 setMatched = condense(setMatched) 1404 } 1405 push.apply(results, setMatched); 1406 if (outermost && !seed && setMatched.length > 0 && (matchedCount + setMatchers.length) > 1) { 1407 Sizzle.uniqueSort(results) 1408 } 1409 } 1410 if (outermost) { 1411 dirruns = dirrunsUnique; 1412 outermostContext = contextBackup 1413 } 1414 return unmatched 1415 }; 1416 return bySet ? markFunction(superMatcher) : superMatcher 1417 } 1418 compile = Sizzle.compile = function(selector, match) { 1419 var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "]; 1420 if (!cached) { 1421 if (!match) { 1422 match = tokenize(selector) 1423 } 1424 i = match.length; 1425 while (i--) { 1426 cached = matcherFromTokens(match[i]); 1427 if (cached[expando]) { 1428 setMatchers.push(cached) 1429 } else { 1430 elementMatchers.push(cached) 1431 } 1432 } 1433 cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); 1434 cached.selector = selector 1435 } 1436 return cached 1437 } 1438 ; 1439 select = Sizzle.select = function(selector, context, results, seed) { 1440 var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize((selector = compiled.selector || selector)); 1441 results = results || []; 1442 if (match.length === 1) { 1443 tokens = match[0] = match[0].slice(0); 1444 if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) { 1445 context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0]; 1446 if (!context) { 1447 return results 1448 } else if (compiled) { 1449 context = context.parentNode 1450 } 1451 selector = selector.slice(tokens.shift().value.length) 1452 } 1453 i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length; 1454 while (i--) { 1455 token = tokens[i]; 1456 if (Expr.relative[(type = token.type)]) { 1457 break 1458 } 1459 if ((find = Expr.find[type])) { 1460 if ((seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testC
vendor: 36,209 bytes, lines 1460-2403
1460ontext(context.parentNode) || context))) { 1461 tokens.splice(i, 1); 1462 selector = seed.length && toSelector(tokens); 1463 if (!selector) { 1464 push.apply(results, seed); 1465 return results 1466 } 1467 break 1468 } 1469 } 1470 } 1471 } 1472 (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context); 1473 return results 1474 } 1475 ; 1476 support.sortStable = expando.split("").sort(sortOrder).join("") === expando; 1477 support.detectDuplicates = !!hasDuplicate; 1478 setDocument(); 1479 support.sortDetached = assert(function(el) { 1480 return el.compareDocumentPosition(document.createElement("fieldset")) & 1 1481 }); 1482 if (!assert(function(el) { 1483 el.innerHTML = "<a href='#'></a>"; 1484 return el.firstChild.getAttribute("href") === "#" 1485 })) { 1486 addHandle("type|href|height|width", function(elem, name, isXML) { 1487 if (!isXML) { 1488 return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2) 1489 } 1490 }) 1491 } 1492 if (!support.attributes || !assert(function(el) { 1493 el.innerHTML = "<input/>"; 1494 el.firstChild.setAttribute("value", ""); 1495 return el.firstChild.getAttribute("value") === "" 1496 })) { 1497 addHandle("value", function(elem, name, isXML) { 1498 if (!isXML && elem.nodeName.toLowerCase() === "input") { 1499 return elem.defaultValue 1500 } 1501 }) 1502 } 1503 if (!assert(function(el) { 1504 return el.getAttribute("disabled") == null 1505 })) { 1506 addHandle(booleans, function(elem, name, isXML) { 1507 var val; 1508 if (!isXML) { 1509 return elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null 1510 } 1511 }) 1512 } 1513 return Sizzle 1514 } 1515 )(window); 1516 jQuery.find = Sizzle; 1517 jQuery.expr = Sizzle.selectors; 1518 jQuery.expr[":"] = jQuery.expr.pseudos; 1519 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 1520 jQuery.text = Sizzle.getText; 1521 jQuery.isXMLDoc = Sizzle.isXML; 1522 jQuery.contains = Sizzle.contains; 1523 jQuery.escapeSelector = Sizzle.escape; 1524 var dir = function(elem, dir, until) { 1525 var matched = [] 1526 , truncate = until !== undefined; 1527 while ((elem = elem[dir]) && elem.nodeType !== 9) { 1528 if (elem.nodeType === 1) { 1529 if (truncate && jQuery(elem).is(until)) { 1530 break 1531 } 1532 matched.push(elem) 1533 } 1534 } 1535 return matched 1536 }; 1537 var siblings = function(n, elem) { 1538 var matched = []; 1539 for (; n; n = n.nextSibling) { 1540 if (n.nodeType === 1 && n !== elem) { 1541 matched.push(n) 1542 } 1543 } 1544 return matched 1545 }; 1546 var rneedsContext = jQuery.expr.match.needsContext; 1547 function nodeName(elem, name) { 1548 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase() 1549 } 1550 ;var rsingleTag = (/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i); 1551 var risSimple = /^.[^:#\[\.,]*$/; 1552 function winnow(elements, qualifier, not) { 1553 if (jQuery.isFunction(qualifier)) { 1554 return jQuery.grep(elements, function(elem, i) { 1555 return !!qualifier.call(elem, i, elem) !== not 1556 }) 1557 } 1558 if (qualifier.nodeType) { 1559 return jQuery.grep(elements, function(elem) { 1560 return (elem === qualifier) !== not 1561 }) 1562 } 1563 if (typeof qualifier !== "string") { 1564 return jQuery.grep(elements, function(elem) { 1565 return (indexOf.call(qualifier, elem) > -1) !== not 1566 }) 1567 } 1568 if (risSimple.test(qualifier)) { 1569 return jQuery.filter(qualifier, elements, not) 1570 } 1571 qualifier = jQuery.filter(qualifier, elements); 1572 return jQuery.grep(elements, function(elem) { 1573 return (indexOf.call(qualifier, elem) > -1) !== not && elem.nodeType === 1 1574 }) 1575 } 1576 jQuery.filter = function(expr, elems, not) { 1577 var elem = elems[0]; 1578 if (not) { 1579 expr = ":not(" + expr + ")" 1580 } 1581 if (elems.length === 1 && elem.nodeType === 1) { 1582 return jQuery.find.matchesSelector(elem, expr) ? [elem] : [] 1583 } 1584 return jQuery.find.matches(expr, jQuery.grep(elems, function(elem) { 1585 return elem.nodeType === 1 1586 })) 1587 } 1588 ; 1589 jQuery.fn.extend({ 1590 find: function(selector) { 1591 var i, ret, len = this.length, self = this; 1592 if (typeof selector !== "string") { 1593 return this.pushStack(jQuery(selector).filter(function() { 1594 for (i = 0; i < len; i++) { 1595 if (jQuery.contains(self[i], this)) { 1596 return true 1597 } 1598 } 1599 })) 1600 } 1601 ret = this.pushStack([]); 1602 for (i = 0; i < len; i++) { 1603 jQuery.find(selector, self[i], ret) 1604 } 1605 return len > 1 ? jQuery.uniqueSort(ret) : ret 1606 }, 1607 filter: function(selector) { 1608 return this.pushStack(winnow(this, selector || [], false)) 1609 }, 1610 not: function(selector) { 1611 return this.pushStack(winnow(this, selector || [], true)) 1612 }, 1613 is: function(selector) { 1614 return !!winnow(this, typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length 1615 } 1616 }); 1617 var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function(selector, context, root) { 1618 var match, elem; 1619 if (!selector) { 1620 return this 1621 } 1622 root = root || rootjQuery; 1623 if (typeof selector === "string") { 1624 if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) { 1625 match = [null, selector, null] 1626 } else { 1627 match = rquickExpr.exec(selector) 1628 } 1629 if (match && (match[1] || !context)) { 1630 if (match[1]) { 1631 context = context instanceof jQuery ? context[0] : context; 1632 jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true)); 1633 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) { 1634 for (match in context) { 1635 if (jQuery.isFunction(this[match])) { 1636 this[match](context[match]) 1637 } else { 1638 this.attr(match, context[match]) 1639 } 1640 } 1641 } 1642 return this 1643 } else { 1644 elem = document.getElementById(match[2]); 1645 if (elem) { 1646 this[0] = elem; 1647 this.length = 1 1648 } 1649 return this 1650 } 1651 } else if (!context || context.jquery) { 1652 return (context || root).find(selector) 1653 } else { 1654 return this.constructor(context).find(selector) 1655 } 1656 } else if (selector.nodeType) { 1657 this[0] = selector; 1658 this.length = 1; 1659 return this 1660 } else if (jQuery.isFunction(selector)) { 1661 return root.ready !== undefined ? root.ready(selector) : selector(jQuery) 1662 } 1663 return jQuery.makeArray(selector, this) 1664 } 1665 ; 1666 init.prototype = jQuery.fn; 1667 rootjQuery = jQuery(document); 1668 var rparentsprev = /^(?:parents|prev(?:Until|All))/ 1669 , guaranteedUnique = { 1670 children: true, 1671 contents: true, 1672 next: true, 1673 prev: true 1674 }; 1675 jQuery.fn.extend({ 1676 has: function(target) { 1677 var targets = jQuery(target, this) 1678 , l = targets.length; 1679 return this.filter(function() { 1680 var i = 0; 1681 for (; i < l; i++) { 1682 if (jQuery.contains(this, targets[i])) { 1683 return true 1684 } 1685 } 1686 }) 1687 }, 1688 closest: function(selectors, context) { 1689 var cur, i = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery(selectors); 1690 if (!rneedsContext.test(selectors)) { 1691 for (; i < l; i++) { 1692 for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) { 1693 if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) { 1694 matched.push(cur); 1695 break 1696 } 1697 } 1698 } 1699 } 1700 return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched) 1701 }, 1702 index: function(elem) { 1703 if (!elem) { 1704 return (this[0] && this[0].parentNode) ? this.first().prevAll().length : -1 1705 } 1706 if (typeof elem === "string") { 1707 return indexOf.call(jQuery(elem), this[0]) 1708 } 1709 return indexOf.call(this, elem.jquery ? elem[0] : elem) 1710 }, 1711 add: function(selector, context) { 1712 return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context)))) 1713 }, 1714 addBack: function(selector) { 1715 return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector)) 1716 } 1717 }); 1718 function sibling(cur, dir) { 1719 while ((cur = cur[dir]) && cur.nodeType !== 1) {} 1720 return cur 1721 } 1722 jQuery.each({ 1723 parent: function(elem) { 1724 var parent = elem.parentNode; 1725 return parent && parent.nodeType !== 11 ? parent : null 1726 }, 1727 parents: function(elem) { 1728 return dir(elem, "parentNode") 1729 }, 1730 parentsUntil: function(elem, i, until) { 1731 return dir(elem, "parentNode", until) 1732 }, 1733 next: function(elem) { 1734 return sibling(elem, "nextSibling") 1735 }, 1736 prev: function(elem) { 1737 return sibling(elem, "previousSibling") 1738 }, 1739 nextAll: function(elem) { 1740 return dir(elem, "nextSibling") 1741 }, 1742 prevAll: function(elem) { 1743 return dir(elem, "previousSibling") 1744 }, 1745 nextUntil: function(elem, i, until) { 1746 return dir(elem, "nextSibling", until) 1747 }, 1748 prevUntil: function(elem, i, until) { 1749 return dir(elem, "previousSibling", until) 1750 }, 1751 siblings: function(elem) { 1752 return siblings((elem.parentNode || {}).firstChild, elem) 1753 }, 1754 children: function(elem) { 1755 return siblings(elem.firstChild) 1756 }, 1757 contents: function(elem) { 1758 if (nodeName(elem, "iframe")) { 1759 return elem.contentDocument 1760 } 1761 if (nodeName(elem, "template")) { 1762 elem = elem.content || elem 1763 } 1764 return jQuery.merge([], elem.childNodes) 1765 } 1766 }, function(name, fn) { 1767 jQuery.fn[name] = function(until, selector) { 1768 var matched = jQuery.map(this, fn, until); 1769 if (name.slice(-5) !== "Until") { 1770 selector = until 1771 } 1772 if (selector && typeof selector === "string") { 1773 matched = jQuery.filter(selector, matched) 1774 } 1775 if (this.length > 1) { 1776 if (!guaranteedUnique[name]) { 1777 jQuery.uniqueSort(matched) 1778 } 1779 if (rparentsprev.test(name)) { 1780 matched.reverse() 1781 } 1782 } 1783 return this.pushStack(matched) 1784 } 1785 }); 1786 var rnothtmlwhite = (/[^\x20\t\r\n\f]+/g); 1787 function createOptions(options) { 1788 var object = {}; 1789 jQuery.each(options.match(rnothtmlwhite) || [], function(_, flag) { 1790 object[flag] = true 1791 }); 1792 return object 1793 } 1794 jQuery.Callbacks = function(options) { 1795 options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options); 1796 var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() { 1797 locked = locked || options.once; 1798 fired = firing = true; 1799 for (; queue.length; firingIndex = -1) { 1800 memory = queue.shift(); 1801 while (++firingIndex < list.length) { 1802 if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) { 1803 firingIndex = list.length; 1804 memory = false 1805 } 1806 } 1807 } 1808 if (!options.memory) { 1809 memory = false 1810 } 1811 firing = false; 1812 if (locked) { 1813 if (memory) { 1814 list = [] 1815 } else { 1816 list = "" 1817 } 1818 } 1819 }, self = { 1820 add: function() { 1821 if (list) { 1822 if (memory && !firing) { 1823 firingIndex = list.length - 1; 1824 queue.push(memory) 1825 } 1826 (function add(args) { 1827 jQuery.each(args, function(_, arg) { 1828 if (jQuery.isFunction(arg)) { 1829 if (!options.unique || !self.has(arg)) { 1830 list.push(arg) 1831 } 1832 } else if (arg && arg.length && jQuery.type(arg) !== "string") { 1833 add(arg) 1834 } 1835 }) 1836 } 1837 )(arguments); 1838 if (memory && !firing) { 1839 fire() 1840 } 1841 } 1842 return this 1843 }, 1844 remove: function() { 1845 jQuery.each(arguments, function(_, arg) { 1846 var index; 1847 while ((index = jQuery.inArray(arg, list, index)) > -1) { 1848 list.splice(index, 1); 1849 if (index <= firingIndex) { 1850 firingIndex-- 1851 } 1852 } 1853 }); 1854 return this 1855 }, 1856 has: function(fn) { 1857 return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0 1858 }, 1859 empty: function() { 1860 if (list) { 1861 list = [] 1862 } 1863 return this 1864 }, 1865 disable: function() { 1866 locked = queue = []; 1867 list = memory = ""; 1868 return this 1869 }, 1870 disabled: function() { 1871 return !list 1872 }, 1873 lock: function() { 1874 locked = queue = []; 1875 if (!memory && !firing) { 1876 list = memory = "" 1877 } 1878 return this 1879 }, 1880 locked: function() { 1881 return !!locked 1882 }, 1883 fireWith: function(context, args) { 1884 if (!locked) { 1885 args = args || []; 1886 args = [context, args.slice ? args.slice() : args]; 1887 queue.push(args); 1888 if (!firing) { 1889 fire() 1890 } 1891 } 1892 return this 1893 }, 1894 fire: function() { 1895 self.fireWith(this, arguments); 1896 return this 1897 }, 1898 fired: function() { 1899 return !!fired 1900 } 1901 }; 1902 return self 1903 } 1904 ; 1905 function Identity(v) { 1906 return v 1907 } 1908 function Thrower(ex) { 1909 throw ex 1910 } 1911 function adoptValue(value, resolve, reject, noValue) { 1912 var method; 1913 try { 1914 if (value && jQuery.isFunction((method = value.promise))) { 1915 method.call(value).done(resolve).fail(reject) 1916 } else if (value && jQuery.isFunction((method = value.then))) { 1917 method.call(value, resolve, reject) 1918 } else { 1919 resolve.apply(undefined, [value].slice(noValue)) 1920 } 1921 } catch (value) { 1922 reject.apply(undefined, [value]) 1923 } 1924 } 1925 jQuery.extend({ 1926 Deferred: function(func) { 1927 var tuples = [["notify", "progress", jQuery.Callbacks("memory"), jQuery.Callbacks("memory"), 2], ["resolve", "done", jQuery.Callbacks("once memory"), jQuery.Callbacks("once memory"), 0, "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), jQuery.Callbacks("once memory"), 1, "rejected"]] 1928 , state = "pending" 1929 , promise = { 1930 state: function() { 1931 return state 1932 }, 1933 always: function() { 1934 deferred.done(arguments).fail(arguments); 1935 return this 1936 }, 1937 "catch": function(fn) { 1938 return promise.then(null, fn) 1939 }, 1940 pipe: function() { 1941 var fns = arguments; 1942 return jQuery.Deferred(function(newDefer) { 1943 jQuery.each(tuples, function(i, tuple) { 1944 var fn = jQuery.isFunction(fns[tuple[4]]) && fns[tuple[4]]; 1945 deferred[tuple[1]](function() { 1946 var returned = fn && fn.apply(this, arguments); 1947 if (returned && jQuery.isFunction(returned.promise)) { 1948 returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject) 1949 } else { 1950 newDefer[tuple[0] + "With"](this, fn ? [returned] : arguments) 1951 } 1952 }) 1953 }); 1954 fns = null 1955 }).promise() 1956 }, 1957 then: function(onFulfilled, onRejected, onProgress) { 1958 var maxDepth = 0; 1959 function resolve(depth, deferred, handler, special) { 1960 return function() { 1961 var that = this 1962 , args = arguments 1963 , mightThrow = function() { 1964 var returned, then; 1965 if (depth < maxDepth) { 1966 return 1967 } 1968 returned = handler.apply(that, args); 1969 if (returned === deferred.promise()) { 1970 throw new TypeError("Thenable self-resolution") 1971 } 1972 then = returned && (typeof returned === "object" || typeof returned === "function") && returned.then; 1973 if (jQuery.isFunction(then)) { 1974 if (special) { 1975 then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special)) 1976 } else { 1977 maxDepth++; 1978 then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special), resolve(maxDepth, deferred, Identity, deferred.notifyWith)) 1979 } 1980 } else { 1981 if (handler !== Identity) { 1982 that = undefined; 1983 args = [returned] 1984 } 1985 (special || deferred.resolveWith)(that, args) 1986 } 1987 } 1988 , process = special ? mightThrow : function() { 1989 try { 1990 mightThrow() 1991 } catch (e) { 1992 if (jQuery.Deferred.exceptionHook) { 1993 jQuery.Deferred.exceptionHook(e, process.stackTrace) 1994 } 1995 if (depth + 1 >= maxDepth) { 1996 if (handler !== Thrower) { 1997 that = undefined; 1998 args = [e] 1999 } 2000 deferred.rejectWith(that, args) 2001 } 2002 } 2003 } 2004 ; 2005 if (depth) { 2006 process() 2007 } else { 2008 if (jQuery.Deferred.getStackHook) { 2009 process.stackTrace = jQuery.Deferred.getStackHook() 2010 } 2011 window.setTimeout(process) 2012 } 2013 } 2014 } 2015 return jQuery.Deferred(function(newDefer) { 2016 tuples[0][3].add(resolve(0, newDefer, jQuery.isFunction(onProgress) ? onProgress : Identity, newDefer.notifyWith)); 2017 tuples[1][3].add(resolve(0, newDefer, jQuery.isFunction(onFulfilled) ? onFulfilled : Identity)); 2018 tuples[2][3].add(resolve(0, newDefer, jQuery.isFunction(onRejected) ? onRejected : Thrower)) 2019 }).promise() 2020 }, 2021 promise: function(obj) { 2022 return obj != null ? jQuery.extend(obj, promise) : promise 2023 } 2024 } 2025 , deferred = {}; 2026 jQuery.each(tuples, function(i, tuple) { 2027 var list = tuple[2] 2028 , stateString = tuple[5]; 2029 promise[tuple[1]] = list.add; 2030 if (stateString) { 2031 list.add(function() { 2032 state = stateString 2033 }, tuples[3 - i][2].disable, tuples[0][2].lock) 2034 } 2035 list.add(tuple[3].fire); 2036 deferred[tuple[0]] = function() { 2037 deferred[tuple[0] + "With"](this === deferred ? undefined : this, arguments); 2038 return this 2039 } 2040 ; 2041 deferred[tuple[0] + "With"] = list.fireWith 2042 }); 2043 promise.promise(deferred); 2044 if (func) { 2045 func.call(deferred, deferred) 2046 } 2047 return deferred 2048 }, 2049 when: function(singleValue) { 2050 var remaining = arguments.length 2051 , i = remaining 2052 , resolveContexts = Array(i) 2053 , resolveValues = slice.call(arguments) 2054 , master = jQuery.Deferred() 2055 , updateFunc = function(i) { 2056 return function(value) { 2057 resolveContexts[i] = this; 2058 resolveValues[i] = arguments.length > 1 ? slice.call(arguments) : value; 2059 if (!(--remaining)) { 2060 master.resolveWith(resolveContexts, resolveValues) 2061 } 2062 } 2063 }; 2064 if (remaining <= 1) { 2065 adoptValue(singleValue, master.done(updateFunc(i)).resolve, master.reject, !remaining); 2066 if (master.state() === "pending" || jQuery.isFunction(resolveValues[i] && resolveValues[i].then)) { 2067 return master.then() 2068 } 2069 } 2070 while (i--) { 2071 adoptValue(resolveValues[i], updateFunc(i), master.reject) 2072 } 2073 return master.promise() 2074 } 2075 }); 2076 var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 2077 jQuery.Deferred.exceptionHook = function(error, stack) { 2078 if (window.console && window.console.warn && error && rerrorNames.test(error.name)) { 2079 window.console.warn("jQuery.Deferred exception: " + error.message, error.stack, stack) 2080 } 2081 } 2082 ; 2083 jQuery.readyException = function(error) { 2084 window.setTimeout(function() { 2085 throw error 2086 }) 2087 } 2088 ; 2089 var readyList = jQuery.Deferred(); 2090 jQuery.fn.ready = function(fn) { 2091 readyList.then(fn).catch(function(error) { 2092 jQuery.readyException(error) 2093 }); 2094 return this 2095 } 2096 ; 2097 jQuery.extend({ 2098 isReady: false, 2099 readyWait: 1, 2100 ready: function(wait) { 2101 if (wait === true ? --jQuery.readyWait : jQuery.isReady) { 2102 return 2103 } 2104 jQuery.isReady = true; 2105 if (wait !== true && --jQuery.readyWait > 0) { 2106 return 2107 } 2108 readyList.resolveWith(document, [jQuery]) 2109 } 2110 }); 2111 jQuery.ready.then = readyList.then; 2112 function completed() { 2113 document.removeEventListener("DOMContentLoaded", completed); 2114 window.removeEventListener("load", completed); 2115 jQuery.ready() 2116 } 2117 if (document.readyState === "complete" || (document.readyState !== "loading" && !document.documentElement.doScroll)) { 2118 window.setTimeout(jQuery.ready) 2119 } else { 2120 document.addEventListener("DOMContentLoaded", completed); 2121 window.addEventListener("load", completed) 2122 } 2123 var access = function(elems, fn, key, value, chainable, emptyGet, raw) { 2124 var i = 0 2125 , len = elems.length 2126 , bulk = key == null; 2127 if (jQuery.type(key) === "object") { 2128 chainable = true; 2129 for (i in key) { 2130 access(elems, fn, i, key[i], true, emptyGet, raw) 2131 } 2132 } else if (value !== undefined) { 2133 chainable = true; 2134 if (!jQuery.isFunction(value)) { 2135 raw = true 2136 } 2137 if (bulk) { 2138 if (raw) { 2139 fn.call(elems, value); 2140 fn = null 2141 } else { 2142 bulk = fn; 2143 fn = function(elem, key, value) { 2144 return bulk.call(jQuery(elem), value) 2145 } 2146 } 2147 } 2148 if (fn) { 2149 for (; i < len; i++) { 2150 fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key))) 2151 } 2152 } 2153 } 2154 if (chainable) { 2155 return elems 2156 } 2157 if (bulk) { 2158 return fn.call(elems) 2159 } 2160 return len ? fn(elems[0], key) : emptyGet 2161 }; 2162 var acceptData = function(owner) { 2163 return owner.nodeType === 1 || owner.nodeType === 9 || !(+owner.nodeType) 2164 }; 2165 function Data() { 2166 this.expando = jQuery.expando + Data.uid++ 2167 } 2168 Data.uid = 1; 2169 Data.prototype = { 2170 cache: function(owner) { 2171 var value = owner[this.expando]; 2172 if (!value) { 2173 value = {}; 2174 if (acceptData(owner)) { 2175 if (owner.nodeType) { 2176 owner[this.expando] = value 2177 } else { 2178 Object.defineProperty(owner, this.expando, { 2179 value: value, 2180 configurable: true 2181 }) 2182 } 2183 } 2184 } 2185 return value 2186 }, 2187 set: function(owner, data, value) { 2188 var prop, cache = this.cache(owner); 2189 if (typeof data === "string") { 2190 cache[jQuery.camelCase(data)] = value 2191 } else { 2192 for (prop in data) { 2193 cache[jQuery.camelCase(prop)] = data[prop] 2194 } 2195 } 2196 return cache 2197 }, 2198 get: function(owner, key) { 2199 return key === undefined ? this.cache(owner) : owner[this.expando] && owner[this.expando][jQuery.camelCase(key)] 2200 }, 2201 access: function(owner, key, value) { 2202 if (key === undefined || ((key && typeof key === "string") && value === undefined)) { 2203 return this.get(owner, key) 2204 } 2205 this.set(owner, key, value); 2206 return value !== undefined ? value : key 2207 }, 2208 remove: function(owner, key) { 2209 var i, cache = owner[this.expando]; 2210 if (cache === undefined) { 2211 return 2212 } 2213 if (key !== undefined) { 2214 if (Array.isArray(key)) { 2215 key = key.map(jQuery.camelCase) 2216 } else { 2217 key = jQuery.camelCase(key); 2218 key = key in cache ? [key] : (key.match(rnothtmlwhite) || []) 2219 } 2220 i = key.length; 2221 while (i--) { 2222 delete cache[key[i]] 2223 } 2224 } 2225 if (key === undefined || jQuery.isEmptyObject(cache)) { 2226 if (owner.nodeType) { 2227 owner[this.expando] = undefined 2228 } else { 2229 delete owner[this.expando] 2230 } 2231 } 2232 }, 2233 hasData: function(owner) { 2234 var cache = owner[this.expando]; 2235 return cache !== undefined && !jQuery.isEmptyObject(cache) 2236 } 2237 }; 2238 var dataPriv = new Data(); 2239 var dataUser = new Data(); 2240 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/ 2241 , rmultiDash = /[A-Z]/g; 2242 function getData(data) { 2243 if (data === "true") { 2244 return true 2245 } 2246 if (data === "false") { 2247 return false 2248 } 2249 if (data === "null") { 2250 return null 2251 } 2252 if (data === +data + "") { 2253 return +data 2254 } 2255 if (rbrace.test(data)) { 2256 return JSON.parse(data) 2257 } 2258 return data 2259 } 2260 function dataAttr(elem, key, data) { 2261 var name; 2262 if (data === undefined && elem.nodeType === 1) { 2263 name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase(); 2264 data = elem.getAttribute(name); 2265 if (typeof data === "string") { 2266 try { 2267 data = getData(data) 2268 } catch (e) {} 2269 dataUser.set(elem, key, data) 2270 } else { 2271 data = undefined 2272 } 2273 } 2274 return data 2275 } 2276 jQuery.extend({ 2277 hasData: function(elem) { 2278 return dataUser.hasData(elem) || dataPriv.hasData(elem) 2279 }, 2280 data: function(elem, name, data) { 2281 return dataUser.access(elem, name, data) 2282 }, 2283 removeData: function(elem, name) { 2284 dataUser.remove(elem, name) 2285 }, 2286 _data: function(elem, name, data) { 2287 return dataPriv.access(elem, name, data) 2288 }, 2289 _removeData: function(elem, name) { 2290 dataPriv.remove(elem, name) 2291 } 2292 }); 2293 jQuery.fn.extend({ 2294 data: function(key, value) { 2295 var i, name, data, elem = this[0], attrs = elem && elem.attributes; 2296 if (key === undefined) { 2297 if (this.length) { 2298 data = dataUser.get(elem); 2299 if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) { 2300 i = attrs.length; 2301 while (i--) { 2302 if (attrs[i]) { 2303 name = attrs[i].name; 2304 if (name.indexOf("data-") === 0) { 2305 name = jQuery.camelCase(name.slice(5)); 2306 dataAttr(elem, name, data[name]) 2307 } 2308 } 2309 } 2310 dataPriv.set(elem, "hasDataAttrs", true) 2311 } 2312 } 2313 return data 2314 } 2315 if (typeof key === "object") { 2316 return this.each(function() { 2317 dataUser.set(this, key) 2318 }) 2319 } 2320 return access(this, function(value) { 2321 var data; 2322 if (elem && value === undefined) { 2323 data = dataUser.get(elem, key); 2324 if (data !== undefined) { 2325 return data 2326 } 2327 data = dataAttr(elem, key); 2328 if (data !== undefined) { 2329 return data 2330 } 2331 return 2332 } 2333 this.each(function() { 2334 dataUser.set(this, key, value) 2335 }) 2336 }, null, value, arguments.length > 1, null, true) 2337 }, 2338 removeData: function(key) { 2339 return this.each(function() { 2340 dataUser.remove(this, key) 2341 }) 2342 } 2343 }); 2344 jQuery.extend({ 2345 queue: function(elem, type, data) { 2346 var queue; 2347 if (elem) { 2348 type = (type || "fx") + "queue"; 2349 queue = dataPriv.get(elem, type); 2350 if (data) { 2351 if (!queue || Array.isArray(data)) { 2352 queue = dataPriv.access(elem, type, jQuery.makeArray(data)) 2353 } else { 2354 queue.push(data) 2355 } 2356 } 2357 return queue || [] 2358 } 2359 }, 2360 dequeue: function(elem, type) { 2361 type = type || "fx"; 2362 var queue = jQuery.queue(elem, type) 2363 , startLength = queue.length 2364 , fn = queue.shift() 2365 , hooks = jQuery._queueHooks(elem, type) 2366 , next = function() { 2367 jQuery.dequeue(elem, type) 2368 }; 2369 if (fn === "inprogress") { 2370 fn = queue.shift(); 2371 startLength-- 2372 } 2373 if (fn) { 2374 if (type === "fx") { 2375 queue.unshift("inprogress") 2376 } 2377 delete hooks.stop; 2378 fn.call(elem, next, hooks) 2379 } 2380 if (!startLength && hooks) { 2381 hooks.empty.fire() 2382 } 2383 }, 2384 _queueHooks: function(elem, type) { 2385 var key = type + "queueHooks"; 2386 return dataPriv.get(elem, key) || dataPriv.access(elem, key, { 2387 empty: jQuery.Callbacks("once memory").add(function() { 2388 dataPriv.remove(elem, [type + "queue", key]) 2389 }) 2390 }) 2391 } 2392 }); 2393 jQuery.fn.extend({ 2394 queue: function(type, data) { 2395 var setter = 2; 2396 if (typeof type !== "string") { 2397 data = type; 2398 type = "fx"; 2399 setter-- 2400 } 2401 if (arguments.length < setter) { 2402 return jQuery.queue(this[0], type) 2403 }
2404 return data === undefined ? this : this.each(function() { 2405 var queue = jQuery.queue(this, type, data); 2406 jQuery._queueHooks(this, type); 2407 if (type === "fx" && queue[0] !== "inprogress") { 2408 jQuery.dequeue(this, type) 2409 } 2410 }) 2411 }, 2412 dequeue: function(type) { 2413 return this.each(function() { 2414 jQuery.dequeue(this, type) 2415 }) 2416 }, 2417 clearQueue: function(type) { 2418 return this.queue(type || "fx", []) 2419 }, 2420 promise: function(type, obj) { 2421 var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { 2422 if (!(--count)) { 2423 defer.resolveWith(elements, [elements]) 2424 } 2425 }; 2426 if (typeof type !== "string") { 2427 obj = type; 2428 type = undefined 2429 } 2430 type = type || "fx"; 2431 while (i--) { 2432 tmp = dataPriv.get(elements[i], type + "queueHooks"); 2433 if (tmp && tmp.empty) { 2434 count++; 2435 tmp.empty.add(resolve) 2436 } 2437 } 2438 resolve(); 2439 return defer.promise(obj) 2440 } 2441 }); 2442 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; 2443 var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$","i"); 2444 var cssExpand = ["Top", "Right", "Bottom", "Left"]; 2445 var isHiddenWithinTree = function(elem, el) { 2446 elem = el || elem; 2447 return elem.style.display === "none" || elem.style.display === "" && jQuery.contains(elem.ownerDocument, elem) && jQuery.css(elem, "display") === "none" 2448 }; 2449 var swap = function(elem, options, callback, args) { 2450 var ret, name, old = {}; 2451 for (name in options) { 2452 old[name] = elem.style[name]; 2453 elem.style[name] = options[name] 2454 } 2455 ret = callback.apply(elem, args || []); 2456 for (name in options) { 2457 elem.style[name] = old[name] 2458 } 2459 return ret 2460 }; 2461 function adjustCSS(elem, prop, valueParts, tween) { 2462 var adjusted, scale = 1, maxIterations = 20, currentValue = tween ? function() { 2463 return tween.cur() 2464 } 2465 : function() { 2466 return jQuery.css(elem, prop, "") 2467 } 2468 , initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop)); 2469 if (initialInUnit && initialInUnit[3] !== unit) { 2470 unit = unit || initialInUnit[3]; 2471 valueParts = valueParts || []; 2472 initialInUnit = +initial || 1; 2473 do { 2474 scale = scale || ".5"; 2475 initialInUnit = initialInUnit / scale; 2476 jQuery.style(elem, prop, initialInUnit + unit) 2477 } while (scale !== (scale = currentValue() / initial) && scale !== 1 && --maxIterations) 2478 } 2479 if (valueParts) { 2480 initialInUnit = +initialInUnit || +initial || 0; 2481 adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2]; 2482 if (tween) { 2483 tween.unit = unit; 2484 tween.start = initialInUnit; 2485 tween.end = adjusted 2486 } 2487 } 2488 return adjusted 2489 } 2490 var defaultDisplayMap = {}; 2491 function getDefaultDisplay(elem) { 2492 var temp, doc = elem.ownerDocument, nodeName = elem.nodeName, display = defaultDisplayMap[nodeName]; 2493 if (display) { 2494 return display 2495 } 2496 temp = doc.body.appendChild(doc.createElement(nodeName)); 2497 display = jQuery.css(temp, "display"); 2498 temp.parentNode.removeChild(temp); 2499 if (display === "none") { 2500 display = "block" 2501 } 2502 defaultDisplayMap[nodeName] = display; 2503 return display 2504 } 2505 function showHide(elements, show) { 2506 var display, elem, values = [], index = 0, length = elements.length; 2507 for (; index < length; index++) { 2508 elem = elements[index]; 2509 if (!elem.style) { 2510 continue 2511 } 2512 display = elem.style.display; 2513 if (show) { 2514 if (display === "none") {
vendor: 17,861 bytes, lines 2515-2950
2515 values[index] = dataPriv.get(elem, "display") || null; 2516 if (!values[index]) { 2517 elem.style.display = "" 2518 } 2519 } 2520 if (elem.style.display === "" && isHiddenWithinTree(elem)) { 2521 values[index] = getDefaultDisplay(elem) 2522 } 2523 } else { 2524 if (display !== "none") { 2525 values[index] = "none"; 2526 dataPriv.set(elem, "display", display) 2527 } 2528 } 2529 } 2530 for (index = 0; index < length; index++) { 2531 if (values[index] != null) { 2532 elements[index].style.display = values[index] 2533 } 2534 } 2535 return elements 2536 } 2537 jQuery.fn.extend({ 2538 show: function() { 2539 return showHide(this, true) 2540 }, 2541 hide: function() { 2542 return showHide(this) 2543 }, 2544 toggle: function(state) { 2545 if (typeof state === "boolean") { 2546 return state ? this.show() : this.hide() 2547 } 2548 return this.each(function() { 2549 if (isHiddenWithinTree(this)) { 2550 jQuery(this).show() 2551 } else { 2552 jQuery(this).hide() 2553 } 2554 }) 2555 } 2556 }); 2557 var rcheckableType = (/^(?:checkbox|radio)$/i); 2558 var rtagName = (/<([a-z][^\/\0>\x20\t\r\n\f]+)/i); 2559 var rscriptType = (/^$|\/(?:java|ecma)script/i); 2560 var wrapMap = { 2561 option: [1, "<select multiple='multiple'>", "</select>"], 2562 thead: [1, "<table>", "</table>"], 2563 col: [2, "<table><colgroup>", "</colgroup></table>"], 2564 tr: [2, "<table><tbody>", "</tbody></table>"], 2565 td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], 2566 _default: [0, "", ""] 2567 }; 2568 wrapMap.optgroup = wrapMap.option; 2569 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 2570 wrapMap.th = wrapMap.td; 2571 function getAll(context, tag) { 2572 var ret; 2573 if (typeof context.getElementsByTagName !== "undefined") { 2574 ret = context.getElementsByTagName(tag || "*") 2575 } else if (typeof context.querySelectorAll !== "undefined") { 2576 ret = context.querySelectorAll(tag || "*") 2577 } else { 2578 ret = [] 2579 } 2580 if (tag === undefined || tag && nodeName(context, tag)) { 2581 return jQuery.merge([context], ret) 2582 } 2583 return ret 2584 } 2585 function setGlobalEval(elems, refElements) { 2586 var i = 0 2587 , l = elems.length; 2588 for (; i < l; i++) { 2589 dataPriv.set(elems[i], "globalEval", !refElements || dataPriv.get(refElements[i], "globalEval")) 2590 } 2591 } 2592 var rhtml = /<|&#?\w+;/; 2593 function buildFragment(elems, context, scripts, selection, ignored) { 2594 var elem, tmp, tag, wrap, contains, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; 2595 for (; i < l; i++) { 2596 elem = elems[i]; 2597 if (elem || elem === 0) { 2598 if (jQuery.type(elem) === "object") { 2599 jQuery.merge(nodes, elem.nodeType ? [elem] : elem) 2600 } else if (!rhtml.test(elem)) { 2601 nodes.push(context.createTextNode(elem)) 2602 } else { 2603 tmp = tmp || fragment.appendChild(context.createElement("div")); 2604 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(); 2605 wrap = wrapMap[tag] || wrapMap._default; 2606 tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2]; 2607 j = wrap[0]; 2608 while (j--) { 2609 tmp = tmp.lastChild 2610 } 2611 jQuery.merge(nodes, tmp.childNodes); 2612 tmp = fragment.firstChild; 2613 tmp.textContent = "" 2614 } 2615 } 2616 } 2617 fragment.textContent = ""; 2618 i = 0; 2619 while ((elem = nodes[i++])) { 2620 if (selection && jQuery.inArray(elem, selection) > -1) { 2621 if (ignored) { 2622 ignored.push(elem) 2623 } 2624 continue 2625 } 2626 contains = jQuery.contains(elem.ownerDocument, elem); 2627 tmp = getAll(fragment.appendChild(elem), "script"); 2628 if (contains) { 2629 setGlobalEval(tmp) 2630 } 2631 if (scripts) { 2632 j = 0; 2633 while ((elem = tmp[j++])) { 2634 if (rscriptType.test(elem.type || "")) { 2635 scripts.push(elem) 2636 } 2637 } 2638 } 2639 } 2640 return fragment 2641 } 2642 (function() { 2643 var fragment = document.createDocumentFragment() 2644 , div = fragment.appendChild(document.createElement("div")) 2645 , input = document.createElement("input"); 2646 input.setAttribute("type", "radio"); 2647 input.setAttribute("checked", "checked"); 2648 input.setAttribute("name", "t"); 2649 div.appendChild(input); 2650 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked; 2651 div.innerHTML = "<textarea>x</textarea>"; 2652 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue 2653 } 2654 )(); 2655 var documentElement = document.documentElement; 2656 var rkeyEvent = /^key/ 2657 , rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/ 2658 , rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 2659 function returnTrue() { 2660 return true 2661 } 2662 function returnFalse() { 2663 return false 2664 } 2665 function safeActiveElement() { 2666 try { 2667 return document.activeElement 2668 } catch (err) {} 2669 } 2670 function on(elem, types, selector, data, fn, one) { 2671 var origFn, type; 2672 if (typeof types === "object") { 2673 if (typeof selector !== "string") { 2674 data = data || selector; 2675 selector = undefined 2676 } 2677 for (type in types) { 2678 on(elem, type, selector, data, types[type], one) 2679 } 2680 return elem 2681 } 2682 if (data == null && fn == null) { 2683 fn = selector; 2684 data = selector = undefined 2685 } else if (fn == null) { 2686 if (typeof selector === "string") { 2687 fn = data; 2688 data = undefined 2689 } else { 2690 fn = data; 2691 data = selector; 2692 selector = undefined 2693 } 2694 } 2695 if (fn === false) { 2696 fn = returnFalse 2697 } else if (!fn) { 2698 return elem 2699 } 2700 if (one === 1) { 2701 origFn = fn; 2702 fn = function(event) { 2703 jQuery().off(event); 2704 return origFn.apply(this, arguments) 2705 } 2706 ; 2707 fn.guid = origFn.guid || (origFn.guid = jQuery.guid++) 2708 } 2709 return elem.each(function() { 2710 jQuery.event.add(this, types, fn, data, selector) 2711 }) 2712 } 2713 jQuery.event = { 2714 global: {}, 2715 add: function(elem, types, handler, data, selector) { 2716 var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem); 2717 if (!elemData) { 2718 return 2719 } 2720 if (handler.handler) { 2721 handleObjIn = handler; 2722 handler = handleObjIn.handler; 2723 selector = handleObjIn.selector 2724 } 2725 if (selector) { 2726 jQuery.find.matchesSelector(documentElement, selector) 2727 } 2728 if (!handler.guid) { 2729 handler.guid = jQuery.guid++ 2730 } 2731 if (!(events = elemData.events)) { 2732 events = elemData.events = {} 2733 } 2734 if (!(eventHandle = elemData.handle)) { 2735 eventHandle = elemData.handle = function(e) { 2736 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : undefined 2737 } 2738 } 2739 types = (types || "").match(rnothtmlwhite) || [""]; 2740 t = types.length; 2741 while (t--) { 2742 tmp = rtypenamespace.exec(types[t]) || []; 2743 type = origType = tmp[1]; 2744 namespaces = (tmp[2] || "").split(".").sort(); 2745 if (!type) { 2746 continue 2747 } 2748 special = jQuery.event.special[type] || {}; 2749 type = (selector ? special.delegateType : special.bindType) || type; 2750 special = jQuery.event.special[type] || {}; 2751 handleObj = jQuery.extend({ 2752 type: type, 2753 origType: origType, 2754 data: data, 2755 handler: handler, 2756 guid: handler.guid, 2757 selector: selector, 2758 needsContext: selector && jQuery.expr.match.needsContext.test(selector), 2759 namespace: namespaces.join(".") 2760 }, handleObjIn); 2761 if (!(handlers = events[type])) { 2762 handlers = events[type] = []; 2763 handlers.delegateCount = 0; 2764 if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) { 2765 if (elem.addEventListener) { 2766 elem.addEventListener(type, eventHandle) 2767 } 2768 } 2769 } 2770 if (special.add) { 2771 special.add.call(elem, handleObj); 2772 if (!handleObj.handler.guid) { 2773 handleObj.handler.guid = handler.guid 2774 } 2775 } 2776 if (selector) { 2777 handlers.splice(handlers.delegateCount++, 0, handleObj) 2778 } else { 2779 handlers.push(handleObj) 2780 } 2781 jQuery.event.global[type] = true 2782 } 2783 }, 2784 remove: function(elem, types, handler, selector, mappedTypes) { 2785 var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem); 2786 if (!elemData || !(events = elemData.events)) { 2787 return 2788 } 2789 types = (types || "").match(rnothtmlwhite) || [""]; 2790 t = types.length; 2791 while (t--) { 2792 tmp = rtypenamespace.exec(types[t]) || []; 2793 type = origType = tmp[1]; 2794 namespaces = (tmp[2] || "").split(".").sort(); 2795 if (!type) { 2796 for (type in events) { 2797 jQuery.event.remove(elem, type + types[t], handler, selector, true) 2798 } 2799 continue 2800 } 2801 special = jQuery.event.special[type] || {}; 2802 type = (selector ? special.delegateType : special.bindType) || type; 2803 handlers = events[type] || []; 2804 tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"); 2805 origCount = j = handlers.length; 2806 while (j--) { 2807 handleObj = handlers[j]; 2808 if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) { 2809 handlers.splice(j, 1); 2810 if (handleObj.selector) { 2811 handlers.delegateCount-- 2812 } 2813 if (special.remove) { 2814 special.remove.call(elem, handleObj) 2815 } 2816 } 2817 } 2818 if (origCount && !handlers.length) { 2819 if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) { 2820 jQuery.removeEvent(elem, type, elemData.handle) 2821 } 2822 delete events[type] 2823 } 2824 } 2825 if (jQuery.isEmptyObject(events)) { 2826 dataPriv.remove(elem, "handle events") 2827 } 2828 }, 2829 dispatch: function(nativeEvent) { 2830 var event = jQuery.event.fix(nativeEvent); 2831 var i, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), handlers = (dataPriv.get(this, "events") || {})[event.type] || [], special = jQuery.event.special[event.type] || {}; 2832 args[0] = event; 2833 for (i = 1; i < arguments.length; i++) { 2834 args[i] = arguments[i] 2835 } 2836 event.delegateTarget = this; 2837 if (special.preDispatch && special.preDispatch.call(this, event) === false) { 2838 return 2839 } 2840 handlerQueue = jQuery.event.handlers.call(this, event, handlers); 2841 i = 0; 2842 while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) { 2843 event.currentTarget = matched.elem; 2844 j = 0; 2845 while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) { 2846 if (!event.rnamespace || event.rnamespace.test(handleObj.namespace)) { 2847 event.handleObj = handleObj; 2848 event.data = handleObj.data; 2849 ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args); 2850 if (ret !== undefined) { 2851 if ((event.result = ret) === false) { 2852 event.preventDefault(); 2853 event.stopPropagation() 2854 } 2855 } 2856 } 2857 } 2858 } 2859 if (special.postDispatch) { 2860 special.postDispatch.call(this, event) 2861 } 2862 return event.result 2863 }, 2864 handlers: function(event, handlers) { 2865 var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; 2866 if (delegateCount && cur.nodeType && !(event.type === "click" && event.button >= 1)) { 2867 for (; cur !== this; cur = cur.parentNode || this) { 2868 if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) { 2869 matchedHandlers = []; 2870 matchedSelectors = {}; 2871 for (i = 0; i < delegateCount; i++) { 2872 handleObj = handlers[i]; 2873 sel = handleObj.selector + " "; 2874 if (matchedSelectors[sel] === undefined) { 2875 matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length 2876 } 2877 if (matchedSelectors[sel]) { 2878 matchedHandlers.push(handleObj) 2879 } 2880 } 2881 if (matchedHandlers.length) { 2882 handlerQueue.push({ 2883 elem: cur, 2884 handlers: matchedHandlers 2885 }) 2886 } 2887 } 2888 } 2889 } 2890 cur = this; 2891 if (delegateCount < handlers.length) { 2892 handlerQueue.push({ 2893 elem: cur, 2894 handlers: handlers.slice(delegateCount) 2895 }) 2896 } 2897 return handlerQueue 2898 }, 2899 addProp: function(name, hook) { 2900 Object.defineProperty(jQuery.Event.prototype, name, { 2901 enumerable: true, 2902 configurable: true, 2903 get: jQuery.isFunction(hook) ? function() { 2904 if (this.originalEvent) { 2905 return hook(this.originalEvent) 2906 } 2907 } 2908 : function() { 2909 if (this.originalEvent) { 2910 return this.originalEvent[name] 2911 } 2912 } 2913 , 2914 set: function(value) { 2915 Object.defineProperty(this, name, { 2916 enumerable: true, 2917 configurable: true, 2918 writable: true, 2919 value: value 2920 }) 2921 } 2922 }) 2923 }, 2924 fix: function(originalEvent) { 2925 return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent) 2926 }, 2927 special: { 2928 load: { 2929 noBubble: true 2930 }, 2931 focus: { 2932 trigger: function() { 2933 if (this !== safeActiveElement() && this.focus) { 2934 this.focus(); 2935 return false 2936 } 2937 }, 2938 delegateType: "focusin" 2939 }, 2940 blur: { 2941 trigger: function() { 2942 if (this === safeActiveElement() && this.blur) { 2943 this.blur(); 2944 return false 2945 } 2946 }, 2947 delegateType: "focusout" 2948 }, 2949 click: { 2950 trigger: function() {
2951 if (this.type === "checkbox" && this.click && nodeName(this, "input")) { 2952 this.click(); 2953 return false 2954 } 2955 }, 2956 _default: function(event) { 2957 return nodeName(event.target, "a") 2958 } 2959 }, 2960 beforeunload: { 2961 postDispatch: function(event) { 2962 if (event.result !== undefined && event.originalEvent) { 2963 event.originalEvent.returnValue = event.result 2964 } 2965 } 2966 } 2967 } 2968 }; 2969 jQuery.removeEvent = function(elem, type, handle) { 2970 if (elem.removeEventListener) { 2971 elem.removeEventListener(type, handle) 2972 } 2973 } 2974 ; 2975 jQuery.Event = function(src, props) { 2976 if (!(this instanceof jQuery.Event)) { 2977 return new jQuery.Event(src,props) 2978 } 2979 if (src && src.type) { 2980 this.originalEvent = src; 2981 this.type = src.type; 2982 this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && src.returnValue === false ? returnTrue : returnFalse; 2983 this.target = (src.target && src.target.nodeType === 3) ? src.target.parentNode : src.target; 2984 this.currentTarget = src.currentTarget; 2985 this.relatedTarget = src.relatedTarget 2986 } else { 2987 this.type = src 2988 } 2989 if (props) { 2990 jQuery.extend(this, props) 2991 } 2992 this.timeStamp = src && src.timeStamp || jQuery.now(); 2993 this[jQuery.expando] = true 2994 } 2995 ; 2996 jQuery.Event.prototype = { 2997 constructor: jQuery.Event, 2998 isDefaultPrevented: returnFalse, 2999 isPropagationStopped: returnFalse, 3000 isImmediatePropagationStopped: returnFalse, 3001 isSimulated: false, 3002 preventDefault: function() { 3003 var e = this.originalEvent; 3004 this.isDefaultPrevented = returnTrue; 3005 if (e && !this.isSimulated) { 3006 e.preventDefault() 3007 } 3008 }, 3009 stopPropagation: function() { 3010 var e = this.originalEvent; 3011 this.isPropagationStopped = returnTrue; 3012 if (e && !this.isSimulated) { 3013 e.stopPropagation() 3014 } 3015 }, 3016 stopImmediatePropagation: function() { 3017 var e = this.originalEvent; 3018 this.isImmediatePropagationStopped = returnTrue; 3019 if (e && !this.isSimulated) { 3020 e.stopImmediatePropagation() 3021 } 3022 this.stopPropagation() 3023 } 3024 }; 3025 jQuery.each({ 3026 altKey: true, 3027 bubbles: true, 3028 cancelable: true, 3029 changedTouches: true, 3030 ctrlKey: true, 3031 detail: true, 3032 eventPhase: true, 3033 metaKey: true, 3034 pageX: true, 3035 pageY: true, 3036 shiftKey: true, 3037 view: true, 3038 "char": true, 3039 charCode: true, 3040 key: true, 3041 keyCode: true, 3042 button: true, 3043 buttons: true, 3044 clientX: true, 3045 clientY: true, 3046 offsetX: true, 3047 offsetY: true, 3048 pointerId: true, 3049 pointerType: true, 3050 screenX: true, 3051 screenY: true, 3052 targetTouches: true, 3053 toElement: true, 3054 touches: true, 3055 which: function(event) { 3056 var button = event.button; 3057 if (event.which == null && rkeyEvent.test(event.type)) { 3058 return event.charCode != null ? event.charCode : event.keyCode 3059 } 3060 if (!event.which && button !== undefined && rmouseEvent.test(event.type)) { 3061 if (button & 1) { 3062 return 1 3063 } 3064 if (button & 2) { 3065 return 3 3066 } 3067 if (button & 4) { 3068 return 2 3069 } 3070 return 0 3071 } 3072 return event.which 3073 } 3074 }, jQuery.event.addProp); 3075 jQuery.each({ 3076 mouseenter: "mouseover", 3077 mouseleave: "mouseout", 3078 pointerenter: "pointerover", 3079 pointerleave: "pointerout" 3080 }, function(orig, fix) { 3081 jQuery.event.special[orig] = { 3082 delegateType: fix, 3083 bindType: fix, 3084 handle: function(event) { 3085 var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; 3086 if (!related || (related !== target && !jQuery.contains(target, related))) { 3087 event.type = handleObj.origType; 3088 ret = handleObj.handler.apply(this, arguments); 3089 event.type = fix 3090 } 3091 return ret 3092 } 3093 } 3094 }); 3095 jQuery.fn.extend({ 3096 on: function(types, selector, data, fn) { 3097 return on(this, types, selector, data, fn) 3098 }, 3099 one: function(types, selector, data, fn) { 3100 return on(this, types, selector, data, fn, 1) 3101 }, 3102 off: function(types, selector, fn) { 3103 var handleObj, type; 3104 if (types && types.preventDefault && types.handleObj) { 3105 handleObj = types.handleObj; 3106 jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler); 3107 return this 3108 } 3109 if (typeof types === "object") { 3110 for (type in types) { 3111 this.off(type, selector, types[type]) 3112 } 3113 return this 3114 } 3115 if (selector === false || typeof selector === "function") { 3116 fn = selector; 3117 selector = undefined 3118 } 3119 if (fn === false) { 3120 fn = returnFalse 3121 } 3122 return this.each(function() { 3123 jQuery.event.remove(this, types, fn, selector) 3124 }) 3125 } 3126 }); 3127 var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi 3128 , rnoInnerhtml = /<script|<style|<link/i 3129 , rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i 3130 , rscriptTypeMasked = /^true\/(.*)/ 3131 , rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 3132 function manipulationTarget(elem, content) { 3133 if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) { 3134 return jQuery(">tbody", elem)[0] || elem 3135 } 3136 return elem 3137 } 3138 function disableScript(elem) { 3139 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; 3140 return elem 3141 } 3142 function restoreScript(elem) { 3143 var match = rscriptTypeMasked.exec(elem.type); 3144 if (match) { 3145 elem.type = match[1] 3146 } else { 3147 elem.removeAttribute("type") 3148 } 3149 return elem 3150 } 3151 function cloneCopyEvent(src, dest) { 3152 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; 3153 if (dest.nodeType !== 1) { 3154 return 3155 } 3156 if (dataPriv.hasData(src)) { 3157 pdataOld = dataPriv.access(src); 3158 pdataCur = dataPriv.set(dest, pdataOld); 3159 events = pdataOld.events; 3160 if (events) { 3161 delete pdataCur.handle; 3162 pdataCur.events = {}; 3163 for (type in events) { 3164 for (i = 0, 3165 l = events[type].length; i < l; i++) { 3166 jQuery.event.add(dest, type, events[type][i]) 3167 } 3168 } 3169 } 3170 } 3171 if (dataUser.hasData(src)) { 3172 udataOld = dataUser.access(src); 3173 udataCur = jQuery.extend({}, udataOld); 3174 dataUser.set(dest, udataCur) 3175 } 3176 }
vendor: 8,571 bytes, lines 3177-3377
3177 function fixInput(src, dest) { 3178 var nodeName = dest.nodeName.toLowerCase(); 3179 if (nodeName === "input" && rcheckableType.test(src.type)) { 3180 dest.checked = src.checked 3181 } else if (nodeName === "input" || nodeName === "textarea") { 3182 dest.defaultValue = src.defaultValue 3183 } 3184 } 3185 function domManip(collection, args, callback, ignored) { 3186 args = concat.apply([], args); 3187 var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction(value); 3188 if (isFunction || (l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value))) { 3189 return collection.each(function(index) { 3190 var self = collection.eq(index); 3191 if (isFunction) { 3192 args[0] = value.call(this, index, self.html()) 3193 } 3194 domManip(self, args, callback, ignored) 3195 }) 3196 } 3197 if (l) { 3198 fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored); 3199 first = fragment.firstChild; 3200 if (fragment.childNodes.length === 1) { 3201 fragment = first 3202 } 3203 if (first || ignored) { 3204 scripts = jQuery.map(getAll(fragment, "script"), disableScript); 3205 hasScripts = scripts.length; 3206 for (; i < l; i++) { 3207 node = fragment; 3208 if (i !== iNoClone) { 3209 node = jQuery.clone(node, true, true); 3210 if (hasScripts) { 3211 jQuery.merge(scripts, getAll(node, "script")) 3212 } 3213 } 3214 callback.call(collection[i], node, i) 3215 } 3216 if (hasScripts) { 3217 doc = scripts[scripts.length - 1].ownerDocument; 3218 jQuery.map(scripts, restoreScript); 3219 for (i = 0; i < hasScripts; i++) { 3220 node = scripts[i]; 3221 if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) { 3222 if (node.src) { 3223 if (jQuery._evalUrl) { 3224 jQuery._evalUrl(node.src) 3225 } 3226 } else { 3227 DOMEval(node.textContent.replace(rcleanScript, ""), doc) 3228 } 3229 } 3230 } 3231 } 3232 } 3233 } 3234 return collection 3235 } 3236 function remove(elem, selector, keepData) { 3237 var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i = 0; 3238 for (; (node = nodes[i]) != null; i++) { 3239 if (!keepData && node.nodeType === 1) { 3240 jQuery.cleanData(getAll(node)) 3241 } 3242 if (node.parentNode) { 3243 if (keepData && jQuery.contains(node.ownerDocument, node)) { 3244 setGlobalEval(getAll(node, "script")) 3245 } 3246 node.parentNode.removeChild(node) 3247 } 3248 } 3249 return elem 3250 } 3251 jQuery.extend({ 3252 htmlPrefilter: function(html) { 3253 return html.replace(rxhtmlTag, "<$1></$2>") 3254 }, 3255 clone: function(elem, dataAndEvents, deepDataAndEvents) { 3256 var i, l, srcElements, destElements, clone = elem.cloneNode(true), inPage = jQuery.contains(elem.ownerDocument, elem); 3257 if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) { 3258 destElements = getAll(clone); 3259 srcElements = getAll(elem); 3260 for (i = 0, 3261 l = srcElements.length; i < l; i++) { 3262 fixInput(srcElements[i], destElements[i]) 3263 } 3264 } 3265 if (dataAndEvents) { 3266 if (deepDataAndEvents) { 3267 srcElements = srcElements || getAll(elem); 3268 destElements = destElements || getAll(clone); 3269 for (i = 0, 3270 l = srcElements.length; i < l; i++) { 3271 cloneCopyEvent(srcElements[i], destElements[i]) 3272 } 3273 } else { 3274 cloneCopyEvent(elem, clone) 3275 } 3276 } 3277 destElements = getAll(clone, "script"); 3278 if (destElements.length > 0) { 3279 setGlobalEval(destElements, !inPage && getAll(elem, "script")) 3280 } 3281 return clone 3282 }, 3283 cleanData: function(elems) { 3284 var data, elem, type, special = jQuery.event.special, i = 0; 3285 for (; (elem = elems[i]) !== undefined; i++) { 3286 if (acceptData(elem)) { 3287 if ((data = elem[dataPriv.expando])) { 3288 if (data.events) { 3289 for (type in data.events) { 3290 if (special[type]) { 3291 jQuery.event.remove(elem, type) 3292 } else { 3293 jQuery.removeEvent(elem, type, data.handle) 3294 } 3295 } 3296 } 3297 elem[dataPriv.expando] = undefined 3298 } 3299 if (elem[dataUser.expando]) { 3300 elem[dataUser.expando] = undefined 3301 } 3302 } 3303 } 3304 } 3305 }); 3306 jQuery.fn.extend({ 3307 detach: function(selector) { 3308 return remove(this, selector, true) 3309 }, 3310 remove: function(selector) { 3311 return remove(this, selector) 3312 }, 3313 text: function(value) { 3314 return access(this, function(value) { 3315 return value === undefined ? jQuery.text(this) : this.empty().each(function() { 3316 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 3317 this.textContent = value 3318 } 3319 }) 3320 }, null, value, arguments.length) 3321 }, 3322 append: function() { 3323 return domManip(this, arguments, function(elem) { 3324 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 3325 var target = manipulationTarget(this, elem); 3326 target.appendChild(elem) 3327 } 3328 }) 3329 }, 3330 prepend: function() { 3331 return domManip(this, arguments, function(elem) { 3332 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 3333 var target = manipulationTarget(this, elem); 3334 target.insertBefore(elem, target.firstChild) 3335 } 3336 }) 3337 }, 3338 before: function() { 3339 return domManip(this, arguments, function(elem) { 3340 if (this.parentNode) { 3341 this.parentNode.insertBefore(elem, this) 3342 } 3343 }) 3344 }, 3345 after: function() { 3346 return domManip(this, arguments, function(elem) { 3347 if (this.parentNode) { 3348 this.parentNode.insertBefore(elem, this.nextSibling) 3349 } 3350 }) 3351 }, 3352 empty: function() { 3353 var elem, i = 0; 3354 for (; (elem = this[i]) != null; i++) { 3355 if (elem.nodeType === 1) { 3356 jQuery.cleanData(getAll(elem, false)); 3357 elem.textContent = "" 3358 } 3359 } 3360 return this 3361 }, 3362 clone: function(dataAndEvents, deepDataAndEvents) { 3363 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 3364 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 3365 return this.map(function() { 3366 return jQuery.clone(this, dataAndEvents, deepDataAndEvents) 3367 }) 3368 }, 3369 html: function(value) { 3370 return access(this, function(value) { 3371 var elem = this[0] || {} 3372 , i = 0 3373 , l = this.length; 3374 if (value === undefined && elem.nodeType === 1) { 3375 return elem.innerHTML 3376 } 3377 if (typeof value === "string" && !rnoInnerhtml.test(value) && !wrapMap[
3377(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) { 3378 value = jQuery.htmlPrefilter(value); 3379 try { 3380 for (; i < l; i++) { 3381 elem = this[i] || {}; 3382 if (elem.nodeType === 1) { 3383 jQuery.cleanData(getAll(elem, false)); 3384 elem.innerHTML = value 3385 } 3386 } 3387 elem = 0 3388 } catch (e) {} 3389 } 3390 if (elem) { 3391 this.empty().append(value) 3392 } 3393 }, null, value, arguments.length) 3394 }, 3395 replaceWith: function() { 3396 var ignored = []; 3397 return domManip(this, arguments, function(elem) { 3398 var parent = this.parentNode; 3399 if (jQuery.inArray(this, ignored) < 0) { 3400 jQuery.cleanData(getAll(this)); 3401 if (parent) { 3402 parent.replaceChild(elem, this) 3403 } 3404 } 3405 }, ignored) 3406 } 3407 }); 3408 jQuery.each({ 3409 appendTo: "append", 3410 prependTo: "prepend", 3411 insertBefore: "before", 3412 insertAfter: "after", 3413 replaceAll: "replaceWith" 3414 }, function(name, original) { 3415 jQuery.fn[name] = function(selector) { 3416 var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i = 0; 3417 for (; i <= last; i++) { 3418 elems = i === last ? this : this.clone(true); 3419 jQuery(insert[i])[original](elems); 3420 push.apply(ret, elems.get()) 3421 } 3422 return this.pushStack(ret) 3423 } 3424 }); 3425 var rmargin = (/^margin/); 3426 var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$","i"); 3427 var getStyles = function(elem) { 3428 var view = elem.ownerDocument.defaultView; 3429 if (!view || !view.opener) { 3430 view = window 3431 } 3432 return view.getComputedStyle(elem) 3433 }; 3434 (function() { 3435 function computeStyleTests() { 3436 if (!div) { 3437 return 3438 } 3439 div.style.cssText = "box-sizing:border-box;" + "position:relative;display:block;" + "margin:auto;border:1px;padding:1px;" + "top:1%;width:50%"; 3440 div.innerHTML = ""; 3441 documentElement.appendChild(container); 3442 var divStyle = window.getComputedStyle(div); 3443 pixelPositionVal = divStyle.top !== "1%"; 3444 reliableMarginLeftVal = divStyle.marginLeft === "2px"; 3445 boxSizingReliableVal = divStyle.width === "4px"; 3446 div.style.marginRight = "50%"; 3447 pixelMarginRightVal = divStyle.marginRight === "4px"; 3448 documentElement.removeChild(container); 3449 div = null 3450 } 3451 var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, container = document.createElement("div"), div = document.createElement("div"); 3452 if (!div.style) { 3453 return 3454 } 3455 div.style.backgroundClip = "content-box"; 3456 div.cloneNode(true).style.backgroundClip = ""; 3457 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 3458 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + "padding:0;margin-top:1px;position:absolute"; 3459 container.appendChild(div); 3460 jQuery.extend(support, { 3461 pixelPosition: function() { 3462 computeStyleTests(); 3463 return pixelPositionVal 3464 }, 3465 boxSizingReliable: function() { 3466 computeStyleTests(); 3467 return boxSizingReliableVal 3468 }, 3469 pixelMarginRight: function() { 3470 computeStyleTests(); 3471 return pixelMarginRightVal 3472 }, 3473 reliableMarginLeft: function() { 3474 computeStyleTests(); 3475 return reliableMarginLeftVal 3476 } 3477 }) 3478 } 3479 )(); 3480 function curCSS(elem, name, computed) { 3481 var width, minWidth, maxWidth, ret, style = elem.style; 3482 computed = computed || getStyles(elem); 3483 if (computed) { 3484 ret = computed.getPropertyValue(name) || computed[name]; 3485 if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) { 3486 ret = jQuery.style(elem, name) 3487 } 3488 if (!support.pixelMarginRight() && rnumnonpx.test(ret) && rmargin.test(name)) { 3489 width = style.width; 3490 minWidth = style.minWidth; 3491 maxWidth = style.maxWidth; 3492 style.minWidth = style.maxWidth = style.width = ret; 3493 ret = computed.width; 3494 style.width = width; 3495 style.minWidth = minWidth; 3496 style.maxWidth = maxWidth 3497 } 3498 } 3499 return ret !== undefined ? ret + "" : ret 3500 } 3501 function addGetHookIf(conditionFn, hookFn) { 3502 return { 3503 get: function() { 3504 if (conditionFn()) { 3505 delete this.get; 3506 return 3507 } 3508 return (this.get = hookFn).apply(this, arguments) 3509 } 3510 } 3511 } 3512 var rdisplayswap = /^(none|table(?!-c[ea]).+)/ 3513 , rcustomProp = /^--/ 3514 , cssShow = { 3515 position: "absolute", 3516 visibility: "hidden", 3517 display: "block" 3518 } 3519 , cssNormalTransform = { 3520 letterSpacing: "0", 3521 fontWeight: "400" 3522 } 3523 , cssPrefixes = ["Webkit", "Moz", "ms"] 3524 , emptyStyle = document.createElement("div").style; 3525 function vendorPropName(name) { 3526 if (name in emptyStyle) { 3527 return name 3528 } 3529 var capName = name[0].toUpperCase() + name.slice(1) 3530 , i = cssPrefixes.length; 3531 while (i--) { 3532 name = cssPrefixes[i] + capName; 3533 if (name in emptyStyle) { 3534 return name 3535 } 3536 } 3537 } 3538 function finalPropName(name) { 3539 var ret = jQuery.cssProps[name]; 3540 if (!ret) { 3541 ret = jQuery.cssProps[name] = vendorPropName(name) || name 3542 } 3543 return ret 3544 } 3545 function setPositiveNumber(elem, value, subtract) { 3546 var matches = rcssNum.exec(value); 3547 return matches ? Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") : value 3548 } 3549 function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) { 3550 var i, val = 0; 3551 if (extra === (isBorderBox ? "border" : "content")) { 3552 i = 4 3553 } else { 3554 i = name === "width" ? 1 : 0 3555 } 3556 for (; i < 4; i += 2) { 3557 if (extra === "margin") { 3558 val += jQuery.css(elem, extra + cssExpand[i], true, styles) 3559 } 3560 if (isBorderBox) { 3561 if (extra === "content") { 3562 val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles) 3563 } 3564 if (extra !== "margin") { 3565 val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles) 3566 } 3567 } else { 3568 val += jQuery.css(elem, "padding" + cssExpand[i], true, styles); 3569 if (extra !== "padding") { 3570 val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles) 3571 } 3572 } 3573 } 3574 return val 3575 } 3576 function getWidthOrHeight(elem, name, extra) { 3577 var valueIsBorderBox, styles = getStyles(elem), val = curCSS(elem, name, styles), isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box"; 3578 if (rnumnonpx.test(val)) { 3579 return val 3580 } 3581 valueIsBorderBox = isBorderBox && (support.boxSizingReliable() || val === elem.style[name]); 3582 if (val === "auto") { 3583 val = elem["offset" + name[0].toUpperCase() + name.slice(1)] 3584 } 3585 val = parseFloat(val) || 0; 3586 return (val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles)) + "px" 3587 } 3588 jQuery.extend({ 3589 cssHooks: { 3590 opacity: { 3591 get: function(elem, computed) { 3592 if (computed) { 3593 var ret = curCSS(elem, "opacity"); 3594 return ret === "" ? "1" : ret 3595 } 3596 } 3597 } 3598 }, 3599 cssNumber: { 3600 "animationIterationCount": true, 3601 "columnCount": true, 3602 "fillOpacity": true, 3603 "flexGrow": true, 3604 "flexShrink": true, 3605 "fontWeight": true, 3606 "lineHeight": true, 3607 "opacity": true, 3608 "order": true, 3609 "orphans": true, 3610 "widows": true, 3611 "zIndex": true, 3612 "zoom": true 3613 }, 3614 cssProps: { 3615 "float": "cssFloat" 3616 }, 3617 style: function(elem, name, value, extra) { 3618 if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) { 3619 return 3620 } 3621 var ret, type, hooks, origName = jQuery.camelCase(name), isCustomProp = rcustomProp.test(name), style = elem.style; 3622 if (!isCustomProp) { 3623 name = finalPropName(origName) 3624 } 3625 hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; 3626 if (value !== undefined) { 3627 type = typeof value; 3628 if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) { 3629 value = adjustCSS(elem, name, ret); 3630 type = "number" 3631 } 3632 if (value == null || value !== value) { 3633 return 3634 } 3635 if (type === "number") { 3636 value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px") 3637 } 3638 if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) { 3639 style[name] = "inherit" 3640 } 3641 if (!hooks || !("set"in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) { 3642 if (isCustomProp) { 3643 style.setProperty(name, value) 3644 } else { 3645 style[name] = value 3646 } 3647 } 3648 } else { 3649 if (hooks && "get"in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) { 3650 return ret 3651 } 3652 return style[name] 3653 } 3654 }, 3655 css: function(elem, name, extra, styles) { 3656 var val, num, hooks, origName = jQuery.camelCase(name), isCustomProp = rcustomProp.test(name); 3657 if (!isCustomProp) { 3658 name = finalPropName(origName) 3659 } 3660 hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; 3661 if (hooks && "get"in hooks) { 3662 val = hooks.get(elem, true, extra) 3663 } 3664 if (val === undefined) { 3665 val = curCSS(elem, name, styles) 3666 } 3667 if (val === "normal" && name in cssNormalTransform) { 3668 val = cssNormalTransform[name] 3669 } 3670 if (extra === "" || extra) { 3671 num = parseFloat(val); 3672 return extra === true || isFinite(num) ? num || 0 : val 3673 } 3674 return val 3675 } 3676 }); 3677 jQuery.each(["height", "width"], function(i, name) { 3678 jQuery.cssHooks[name] = { 3679 get: function(elem, computed, extra) { 3680 if (computed) { 3681 return rdisplayswap.test(jQuery.css(elem, "dis
vendor: 40,037 bytes, lines 3681-4717
3681play")) && (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() { 3682 return getWidthOrHeight(elem, name, extra) 3683 }) : getWidthOrHeight(elem, name, extra) 3684 } 3685 }, 3686 set: function(elem, value, extra) { 3687 var matches, styles = extra && getStyles(elem), subtract = extra && augmentWidthOrHeight(elem, name, extra, jQuery.css(elem, "boxSizing", false, styles) === "border-box", styles); 3688 if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") { 3689 elem.style[name] = value; 3690 value = jQuery.css(elem, name) 3691 } 3692 return setPositiveNumber(elem, value, subtract) 3693 } 3694 } 3695 }); 3696 jQuery.cssHooks.marginLeft = addGetHookIf(support.reliableMarginLeft, function(elem, computed) { 3697 if (computed) { 3698 return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { 3699 marginLeft: 0 3700 }, function() { 3701 return elem.getBoundingClientRect().left 3702 })) + "px" 3703 } 3704 }); 3705 jQuery.each({ 3706 margin: "", 3707 padding: "", 3708 border: "Width" 3709 }, function(prefix, suffix) { 3710 jQuery.cssHooks[prefix + suffix] = { 3711 expand: function(value) { 3712 var i = 0 3713 , expanded = {} 3714 , parts = typeof value === "string" ? value.split(" ") : [value]; 3715 for (; i < 4; i++) { 3716 expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0] 3717 } 3718 return expanded 3719 } 3720 }; 3721 if (!rmargin.test(prefix)) { 3722 jQuery.cssHooks[prefix + suffix].set = setPositiveNumber 3723 } 3724 }); 3725 jQuery.fn.extend({ 3726 css: function(name, value) { 3727 return access(this, function(elem, name, value) { 3728 var styles, len, map = {}, i = 0; 3729 if (Array.isArray(name)) { 3730 styles = getStyles(elem); 3731 len = name.length; 3732 for (; i < len; i++) { 3733 map[name[i]] = jQuery.css(elem, name[i], false, styles) 3734 } 3735 return map 3736 } 3737 return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name) 3738 }, name, value, arguments.length > 1) 3739 } 3740 }); 3741 function Tween(elem, options, prop, end, easing) { 3742 return new Tween.prototype.init(elem,options,prop,end,easing) 3743 } 3744 jQuery.Tween = Tween; 3745 Tween.prototype = { 3746 constructor: Tween, 3747 init: function(elem, options, prop, end, easing, unit) { 3748 this.elem = elem; 3749 this.prop = prop; 3750 this.easing = easing || jQuery.easing._default; 3751 this.options = options; 3752 this.start = this.now = this.cur(); 3753 this.end = end; 3754 this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px") 3755 }, 3756 cur: function() { 3757 var hooks = Tween.propHooks[this.prop]; 3758 return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this) 3759 }, 3760 run: function(percent) { 3761 var eased, hooks = Tween.propHooks[this.prop]; 3762 if (this.options.duration) { 3763 this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration) 3764 } else { 3765 this.pos = eased = percent 3766 } 3767 this.now = (this.end - this.start) * eased + this.start; 3768 if (this.options.step) { 3769 this.options.step.call(this.elem, this.now, this) 3770 } 3771 if (hooks && hooks.set) { 3772 hooks.set(this) 3773 } else { 3774 Tween.propHooks._default.set(this) 3775 } 3776 return this 3777 } 3778 }; 3779 Tween.prototype.init.prototype = Tween.prototype; 3780 Tween.propHooks = { 3781 _default: { 3782 get: function(tween) { 3783 var result; 3784 if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) { 3785 return tween.elem[tween.prop] 3786 } 3787 result = jQuery.css(tween.elem, tween.prop, ""); 3788 return !result || result === "auto" ? 0 : result 3789 }, 3790 set: function(tween) { 3791 if (jQuery.fx.step[tween.prop]) { 3792 jQuery.fx.step[tween.prop](tween) 3793 } else if (tween.elem.nodeType === 1 && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) { 3794 jQuery.style(tween.elem, tween.prop, tween.now + tween.unit) 3795 } else { 3796 tween.elem[tween.prop] = tween.now 3797 } 3798 } 3799 } 3800 }; 3801 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 3802 set: function(tween) { 3803 if (tween.elem.nodeType && tween.elem.parentNode) { 3804 tween.elem[tween.prop] = tween.now 3805 } 3806 } 3807 }; 3808 jQuery.easing = { 3809 linear: function(p) { 3810 return p 3811 }, 3812 swing: function(p) { 3813 return 0.5 - Math.cos(p * Math.PI) / 2 3814 }, 3815 _default: "swing" 3816 }; 3817 jQuery.fx = Tween.prototype.init; 3818 jQuery.fx.step = {}; 3819 var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; 3820 function schedule() { 3821 if (inProgress) { 3822 if (document.hidden === false && window.requestAnimationFrame) { 3823 window.requestAnimationFrame(schedule) 3824 } else { 3825 window.setTimeout(schedule, jQuery.fx.interval) 3826 } 3827 jQuery.fx.tick() 3828 } 3829 } 3830 function createFxNow() { 3831 window.setTimeout(function() { 3832 fxNow = undefined 3833 }); 3834 return (fxNow = jQuery.now()) 3835 } 3836 function genFx(type, includeWidth) { 3837 var which, i = 0, attrs = { 3838 height: type 3839 }; 3840 includeWidth = includeWidth ? 1 : 0; 3841 for (; i < 4; i += 2 - includeWidth) { 3842 which = cssExpand[i]; 3843 attrs["margin" + which] = attrs["padding" + which] = type 3844 } 3845 if (includeWidth) { 3846 attrs.opacity = attrs.width = type 3847 } 3848 return attrs 3849 } 3850 function createTween(value, prop, animation) { 3851 var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index = 0, length = collection.length; 3852 for (; index < length; index++) { 3853 if ((tween = collection[index].call(animation, prop, value))) { 3854 return tween 3855 } 3856 } 3857 } 3858 function defaultPrefilter(elem, props, opts) { 3859 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width"in props || "height"in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow"); 3860 if (!opts.queue) { 3861 hooks = jQuery._queueHooks(elem, "fx"); 3862 if (hooks.unqueued == null) { 3863 hooks.unqueued = 0; 3864 oldfire = hooks.empty.fire; 3865 hooks.empty.fire = function() { 3866 if (!hooks.unqueued) { 3867 oldfire() 3868 } 3869 } 3870 } 3871 hooks.unqueued++; 3872 anim.always(function() { 3873 anim.always(function() { 3874 hooks.unqueued--; 3875 if (!jQuery.queue(elem, "fx").length) { 3876 hooks.empty.fire() 3877 } 3878 }) 3879 }) 3880 } 3881 for (prop in props) { 3882 value = props[prop]; 3883 if (rfxtypes.test(value)) { 3884 delete props[prop]; 3885 toggle = toggle || value === "toggle"; 3886 if (value === (hidden ? "hide" : "show")) { 3887 if (value === "show" && dataShow && dataShow[prop] !== undefined) { 3888 hidden = true 3889 } else { 3890 continue 3891 } 3892 } 3893 orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop) 3894 } 3895 } 3896 propTween = !jQuery.isEmptyObject(props); 3897 if (!propTween && jQuery.isEmptyObject(orig)) { 3898 return 3899 } 3900 if (isBox && elem.nodeType === 1) { 3901 opts.overflow = [style.overflow, style.overflowX, style.overflowY]; 3902 restoreDisplay = dataShow && dataShow.display; 3903 if (restoreDisplay == null) { 3904 restoreDisplay = dataPriv.get(elem, "display") 3905 } 3906 display = jQuery.css(elem, "display"); 3907 if (display === "none") { 3908 if (restoreDisplay) { 3909 display = restoreDisplay 3910 } else { 3911 showHide([elem], true); 3912 restoreDisplay = elem.style.display || restoreDisplay; 3913 display = jQuery.css(elem, "display"); 3914 showHide([elem]) 3915 } 3916 } 3917 if (display === "inline" || display === "inline-block" && restoreDisplay != null) { 3918 if (jQuery.css(elem, "float") === "none") { 3919 if (!propTween) { 3920 anim.done(function() { 3921 style.display = restoreDisplay 3922 }); 3923 if (restoreDisplay == null) { 3924 display = style.display; 3925 restoreDisplay = display === "none" ? "" : display 3926 } 3927 } 3928 style.display = "inline-block" 3929 } 3930 } 3931 } 3932 if (opts.overflow) { 3933 style.overflow = "hidden"; 3934 anim.always(function() { 3935 style.overflow = opts.overflow[0]; 3936 style.overflowX = opts.overflow[1]; 3937 style.overflowY = opts.overflow[2] 3938 }) 3939 } 3940 propTween = false; 3941 for (prop in orig) { 3942 if (!propTween) { 3943 if (dataShow) { 3944 if ("hidden"in dataShow) { 3945 hidden = dataShow.hidden 3946 } 3947 } else { 3948 dataShow = dataPriv.access(elem, "fxshow", { 3949 display: restoreDisplay 3950 }) 3951 } 3952 if (toggle) { 3953 dataShow.hidden = !hidden 3954 } 3955 if (hidden) { 3956 showHide([elem], true) 3957 } 3958 anim.done(function() { 3959 if (!hidden) { 3960 showHide([elem]) 3961 } 3962 dataPriv.remove(elem, "fxshow"); 3963 for (prop in orig) { 3964 jQuery.style(elem, prop, orig[prop]) 3965 } 3966 }) 3967 } 3968 propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim); 3969 if (!(prop in dataShow)) { 3970 dataShow[prop] = propTween.start; 3971 if (hidden) { 3972 propTween.end = propTween.start; 3973 propTween.start = 0 3974 } 3975 } 3976 } 3977 } 3978 function propFilter(props, specialEasing) { 3979 var index, name, easing, value, hooks; 3980 for (index in props) { 3981 name = jQuery.camelCase(index); 3982 easing = specialEasing[name]; 3983 value = props[index]; 3984 if (Array.isArray(value)) { 3985 easing = value[1]; 3986 value = props[index] = value[0] 3987 } 3988 if (index !== name) { 3989 props[name] = value; 3990 delete props[index] 3991 } 3992 hooks = jQuery.cssHooks[name]; 3993 if (hooks && "expand"in hooks) { 3994 value = hooks.expand(value); 3995 delete props[name]; 3996 for (index in value) { 3997 if (!(index in props)) { 3998 props[index] = value[index]; 3999 specialEasing[index] = easing 4000 } 4001 } 4002 } else { 4003 specialEasing[name] = easing 4004 } 4005 } 4006 } 4007 function Animation(elem, properties, options) { 4008 var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() { 4009 delete tick.elem 4010 }), tick = function() { 4011 if (stopped) { 4012 return false 4013 } 4014 var currentTime = fxNow || createFxNow() 4015 , remaining = Math.max(0, animation.startTime + animation.duration - currentTime) 4016 , temp = remaining / animation.duration || 0 4017 , percent = 1 - temp 4018 , index = 0 4019 , length = animation.tweens.length; 4020 for (; index < length; index++) { 4021 animation.tweens[index].run(percent) 4022 } 4023 deferred.notifyWith(elem, [animation, percent, remaining]); 4024 if (percent < 1 && length) { 4025 return remaining 4026 } 4027 if (!length) { 4028 deferred.notifyWith(elem, [animation, 1, 0]) 4029 } 4030 deferred.resolveWith(elem, [animation]); 4031 return false 4032 }, animation = deferred.promise({ 4033 elem: elem, 4034 props: jQuery.extend({}, properties), 4035 opts: jQuery.extend(true, { 4036 specialEasing: {}, 4037 easing: jQuery.easing._default 4038 }, options), 4039 originalProperties: properties, 4040 originalOptions: options, 4041 startTime: fxNow || createFxNow(), 4042 duration: options.duration, 4043 tweens: [], 4044 createTween: function(prop, end) { 4045 var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing); 4046 animation.tweens.push(tween); 4047 return tween 4048 }, 4049 stop: function(gotoEnd) { 4050 var index = 0 4051 , length = gotoEnd ? animation.tweens.length : 0; 4052 if (stopped) { 4053 return this 4054 } 4055 stopped = true; 4056 for (; index < length; index++) { 4057 animation.tweens[index].run(1) 4058 } 4059 if (gotoEnd) { 4060 deferred.notifyWith(elem, [animation, 1, 0]); 4061 deferred.resolveWith(elem, [animation, gotoEnd]) 4062 } else { 4063 deferred.rejectWith(elem, [animation, gotoEnd]) 4064 } 4065 return this 4066 } 4067 }), props = animation.props; 4068 propFilter(props, animation.opts.specialEasing); 4069 for (; index < length; index++) { 4070 result = Animation.prefilters[index].call(animation, elem, props, animation.opts); 4071 if (result) { 4072 if (jQuery.isFunction(result.stop)) { 4073 jQuery._queueHooks(animation.elem, animation.opts.queue).stop = jQuery.proxy(result.stop, result) 4074 } 4075 return result 4076 } 4077 } 4078 jQuery.map(props, createTween, animation); 4079 if (jQuery.isFunction(animation.opts.start)) { 4080 animation.opts.start.call(elem, animation) 4081 } 4082 animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always); 4083 jQuery.fx.timer(jQuery.extend(tick, { 4084 elem: elem, 4085 anim: animation, 4086 queue: animation.opts.queue 4087 })); 4088 return animation 4089 } 4090 jQuery.Animation = jQuery.extend(Animation, { 4091 tweeners: { 4092 "*": [function(prop, value) { 4093 var tween = this.createTween(prop, value); 4094 adjustCSS(tween.elem, prop, rcssNum.exec(value), tween); 4095 return tween 4096 } 4097 ] 4098 }, 4099 tweener: function(props, callback) { 4100 if (jQuery.isFunction(props)) { 4101 callback = props; 4102 props = ["*"] 4103 } else { 4104 props = props.match(rnothtmlwhite) 4105 } 4106 var prop, index = 0, length = props.length; 4107 for (; index < length; index++) { 4108 prop = props[index]; 4109 Animation.tweeners[prop] = Animation.tweeners[prop] || []; 4110 Animation.tweeners[prop].unshift(callback) 4111 } 4112 }, 4113 prefilters: [defaultPrefilter], 4114 prefilter: function(callback, prepend) { 4115 if (prepend) { 4116 Animation.prefilters.unshift(callback) 4117 } else { 4118 Animation.prefilters.push(callback) 4119 } 4120 } 4121 }); 4122 jQuery.speed = function(speed, easing, fn) { 4123 var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { 4124 complete: fn || !fn && easing || jQuery.isFunction(speed) && speed, 4125 duration: speed, 4126 easing: fn && easing || easing && !jQuery.isFunction(easing) && easing 4127 }; 4128 if (jQuery.fx.off) { 4129 opt.duration = 0 4130 } else { 4131 if (typeof opt.duration !== "number") { 4132 if (opt.duration in jQuery.fx.speeds) { 4133 opt.duration = jQuery.fx.speeds[opt.duration] 4134 } else { 4135 opt.duration = jQuery.fx.speeds._default 4136 } 4137 } 4138 } 4139 if (opt.queue == null || opt.queue === true) { 4140 opt.queue = "fx" 4141 } 4142 opt.old = opt.complete; 4143 opt.complete = function() { 4144 if (jQuery.isFunction(opt.old)) { 4145 opt.old.call(this) 4146 } 4147 if (opt.queue) { 4148 jQuery.dequeue(this, opt.queue) 4149 } 4150 } 4151 ; 4152 return opt 4153 } 4154 ; 4155 jQuery.fn.extend({ 4156 fadeTo: function(speed, to, easing, callback) { 4157 return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ 4158 opacity: to 4159 }, speed, easing, callback) 4160 }, 4161 animate: function(prop, speed, easing, callback) { 4162 var empty = jQuery.isEmptyObject(prop) 4163 , optall = jQuery.speed(speed, easing, callback) 4164 , doAnimation = function() { 4165 var anim = Animation(this, jQuery.extend({}, prop), optall); 4166 if (empty || dataPriv.get(this, "finish")) { 4167 anim.stop(true) 4168 } 4169 }; 4170 doAnimation.finish = doAnimation; 4171 return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation) 4172 }, 4173 stop: function(type, clearQueue, gotoEnd) { 4174 var stopQueue = function(hooks) { 4175 var stop = hooks.stop; 4176 delete hooks.stop; 4177 stop(gotoEnd) 4178 }; 4179 if (typeof type !== "string") { 4180 gotoEnd = clearQueue; 4181 clearQueue = type; 4182 type = undefined 4183 } 4184 if (clearQueue && type !== false) { 4185 this.queue(type || "fx", []) 4186 } 4187 return this.each(function() { 4188 var dequeue = true 4189 , index = type != null && type + "queueHooks" 4190 , timers = jQuery.timers 4191 , data = dataPriv.get(this); 4192 if (index) { 4193 if (data[index] && data[index].stop) { 4194 stopQueue(data[index]) 4195 } 4196 } else { 4197 for (index in data) { 4198 if (data[index] && data[index].stop && rrun.test(index)) { 4199 stopQueue(data[index]) 4200 } 4201 } 4202 } 4203 for (index = timers.length; index--; ) { 4204 if (timers[index].elem === this && (type == null || timers[index].queue === type)) { 4205 timers[index].anim.stop(gotoEnd); 4206 dequeue = false; 4207 timers.splice(index, 1) 4208 } 4209 } 4210 if (dequeue || !gotoEnd) { 4211 jQuery.dequeue(this, type) 4212 } 4213 }) 4214 }, 4215 finish: function(type) { 4216 if (type !== false) { 4217 type = type || "fx" 4218 } 4219 return this.each(function() { 4220 var index, data = dataPriv.get(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0; 4221 data.finish = true; 4222 jQuery.queue(this, type, []); 4223 if (hooks && hooks.stop) { 4224 hooks.stop.call(this, true) 4225 } 4226 for (index = timers.length; index--; ) { 4227 if (timers[index].elem === this && timers[index].queue === type) { 4228 timers[index].anim.stop(true); 4229 timers.splice(index, 1) 4230 } 4231 } 4232 for (index = 0; index < length; index++) { 4233 if (queue[index] && queue[index].finish) { 4234 queue[index].finish.call(this) 4235 } 4236 } 4237 delete data.finish 4238 }) 4239 } 4240 }); 4241 jQuery.each(["toggle", "show", "hide"], function(i, name) { 4242 var cssFn = jQuery.fn[name]; 4243 jQuery.fn[name] = function(speed, easing, callback) { 4244 return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback) 4245 } 4246 }); 4247 jQuery.each({ 4248 slideDown: genFx("show"), 4249 slideUp: genFx("hide"), 4250 slideToggle: genFx("toggle"), 4251 fadeIn: { 4252 opacity: "show" 4253 }, 4254 fadeOut: { 4255 opacity: "hide" 4256 }, 4257 fadeToggle: { 4258 opacity: "toggle" 4259 } 4260 }, function(name, props) { 4261 jQuery.fn[name] = function(speed, easing, callback) { 4262 return this.animate(props, speed, easing, callback) 4263 } 4264 }); 4265 jQuery.timers = []; 4266 jQuery.fx.tick = function() { 4267 var timer, i = 0, timers = jQuery.timers; 4268 fxNow = jQuery.now(); 4269 for (; i < timers.length; i++) { 4270 timer = timers[i]; 4271 if (!timer() && timers[i] === timer) { 4272 timers.splice(i--, 1) 4273 } 4274 } 4275 if (!timers.length) { 4276 jQuery.fx.stop() 4277 } 4278 fxNow = undefined 4279 } 4280 ; 4281 jQuery.fx.timer = function(timer) { 4282 jQuery.timers.push(timer); 4283 jQuery.fx.start() 4284 } 4285 ; 4286 jQuery.fx.interval = 13; 4287 jQuery.fx.start = function() { 4288 if (inProgress) { 4289 return 4290 } 4291 inProgress = true; 4292 schedule() 4293 } 4294 ; 4295 jQuery.fx.stop = function() { 4296 inProgress = null 4297 } 4298 ; 4299 jQuery.fx.speeds = { 4300 slow: 600, 4301 fast: 200, 4302 _default: 400 4303 }; 4304 jQuery.fn.delay = function(time, type) { 4305 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; 4306 type = type || "fx"; 4307 return this.queue(type, function(next, hooks) { 4308 var timeout = window.setTimeout(next, time); 4309 hooks.stop = function() { 4310 window.clearTimeout(timeout) 4311 } 4312 }) 4313 } 4314 ; 4315 (function() { 4316 var input = document.createElement("input") 4317 , select = document.createElement("select") 4318 , opt = select.appendChild(document.createElement("option")); 4319 input.type = "checkbox"; 4320 support.checkOn = input.value !== ""; 4321 support.optSelected = opt.selected; 4322 input = document.createElement("input"); 4323 input.value = "t"; 4324 input.type = "radio"; 4325 support.radioValue = input.value === "t" 4326 } 4327 )(); 4328 var boolHook, attrHandle = jQuery.expr.attrHandle; 4329 jQuery.fn.extend({ 4330 attr: function(name, value) { 4331 return access(this, jQuery.attr, name, value, arguments.length > 1) 4332 }, 4333 removeAttr: function(name) { 4334 return this.each(function() { 4335 jQuery.removeAttr(this, name) 4336 }) 4337 } 4338 }); 4339 jQuery.extend({ 4340 attr: function(elem, name, value) { 4341 var ret, hooks, nType = elem.nodeType; 4342 if (nType === 3 || nType === 8 || nType === 2) { 4343 return 4344 } 4345 if (typeof elem.getAttribute === "undefined") { 4346 return jQuery.prop(elem, name, value) 4347 } 4348 if (nType !== 1 || !jQuery.isXMLDoc(elem)) { 4349 hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : undefined) 4350 } 4351 if (value !== undefined) { 4352 if (value === null) { 4353 jQuery.removeAttr(elem, name); 4354 return 4355 } 4356 if (hooks && "set"in hooks && (ret = hooks.set(elem, value, name)) !== undefined) { 4357 return ret 4358 } 4359 elem.setAttribute(name, value + ""); 4360 return value 4361 } 4362 if (hooks && "get"in hooks && (ret = hooks.get(elem, name)) !== null) { 4363 return ret 4364 } 4365 ret = jQuery.find.attr(elem, name); 4366 return ret == null ? undefined : ret 4367 }, 4368 attrHooks: { 4369 type: { 4370 set: function(elem, value) { 4371 if (!support.radioValue && value === "radio" && nodeName(elem, "input")) { 4372 var val = elem.value; 4373 elem.setAttribute("type", value); 4374 if (val) { 4375 elem.value = val 4376 } 4377 return value 4378 } 4379 } 4380 } 4381 }, 4382 removeAttr: function(elem, value) { 4383 var name, i = 0, attrNames = value && value.match(rnothtmlwhite); 4384 if (attrNames && elem.nodeType === 1) { 4385 while ((name = attrNames[i++])) { 4386 elem.removeAttribute(name) 4387 } 4388 } 4389 } 4390 }); 4391 boolHook = { 4392 set: function(elem, value, name) { 4393 if (value === false) { 4394 jQuery.removeAttr(elem, name) 4395 } else { 4396 elem.setAttribute(name, name) 4397 } 4398 return name 4399 } 4400 }; 4401 jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(i, name) { 4402 var getter = attrHandle[name] || jQuery.find.attr; 4403 attrHandle[name] = function(elem, name, isXML) { 4404 var ret, handle, lowercaseName = name.toLowerCase(); 4405 if (!isXML) { 4406 handle = attrHandle[lowercaseName]; 4407 attrHandle[lowercaseName] = ret; 4408 ret = getter(elem, name, isXML) != null ? lowercaseName : null; 4409 attrHandle[lowercaseName] = handle 4410 } 4411 return ret 4412 } 4413 }); 4414 var rfocusable = /^(?:input|select|textarea|button)$/i 4415 , rclickable = /^(?:a|area)$/i; 4416 jQuery.fn.extend({ 4417 prop: function(name, value) { 4418 return access(this, jQuery.prop, name, value, arguments.length > 1) 4419 }, 4420 removeProp: function(name) { 4421 return this.each(function() { 4422 delete this[jQuery.propFix[name] || name] 4423 }) 4424 } 4425 }); 4426 jQuery.extend({ 4427 prop: function(elem, name, value) { 4428 var ret, hooks, nType = elem.nodeType; 4429 if (nType === 3 || nType === 8 || nType === 2) { 4430 return 4431 } 4432 if (nType !== 1 || !jQuery.isXMLDoc(elem)) { 4433 name = jQuery.propFix[name] || name; 4434 hooks = jQuery.propHooks[name] 4435 } 4436 if (value !== undefined) { 4437 if (hooks && "set"in hooks && (ret = hooks.set(elem, value, name)) !== undefined) { 4438 return ret 4439 } 4440 return (elem[name] = value) 4441 } 4442 if (hooks && "get"in hooks && (ret = hooks.get(elem, name)) !== null) { 4443 return ret 4444 } 4445 return elem[name] 4446 }, 4447 propHooks: { 4448 tabIndex: { 4449 get: function(elem) { 4450 var tabindex = jQuery.find.attr(elem, "tabindex"); 4451 if (tabindex) { 4452 return parseInt(tabindex, 10) 4453 } 4454 if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) { 4455 return 0 4456 } 4457 return -1 4458 } 4459 } 4460 }, 4461 propFix: { 4462 "for": "htmlFor", 4463 "class": "className" 4464 } 4465 }); 4466 if (!support.optSelected) { 4467 jQuery.propHooks.selected = { 4468 get: function(elem) { 4469 var parent = elem.parentNode; 4470 if (parent && parent.parentNode) { 4471 parent.parentNode.selectedIndex 4472 } 4473 return null 4474 }, 4475 set: function(elem) { 4476 var parent = elem.parentNode; 4477 if (parent) { 4478 parent.selectedIndex; 4479 if (parent.parentNode) { 4480 parent.parentNode.selectedIndex 4481 } 4482 } 4483 } 4484 } 4485 } 4486 jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() { 4487 jQuery.propFix[this.toLowerCase()] = this 4488 }); 4489 function stripAndCollapse(value) { 4490 var tokens = value.match(rnothtmlwhite) || []; 4491 return tokens.join(" ") 4492 } 4493 function getClass(elem) { 4494 return elem.getAttribute && elem.getAttribute("class") || "" 4495 } 4496 jQuery.fn.extend({ 4497 addClass: function(value) { 4498 var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; 4499 if (jQuery.isFunction(value)) { 4500 return this.each(function(j) { 4501 jQuery(this).addClass(value.call(this, j, getClass(this))) 4502 }) 4503 } 4504 if (typeof value === "string" && value) { 4505 classes = value.match(rnothtmlwhite) || []; 4506 while ((elem = this[i++])) { 4507 curValue = getClass(elem); 4508 cur = elem.nodeType === 1 && (" " + stripAndCollapse(curValue) + " "); 4509 if (cur) { 4510 j = 0; 4511 while ((clazz = classes[j++])) { 4512 if (cur.indexOf(" " + clazz + " ") < 0) { 4513 cur += clazz + " " 4514 } 4515 } 4516 finalValue = stripAndCollapse(cur); 4517 if (curValue !== finalValue) { 4518 elem.setAttribute("class", finalValue) 4519 } 4520 } 4521 } 4522 } 4523 return this 4524 }, 4525 removeClass: function(value) { 4526 var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; 4527 if (jQuery.isFunction(value)) { 4528 return this.each(function(j) { 4529 jQuery(this).removeClass(value.call(this, j, getClass(this))) 4530 }) 4531 } 4532 if (!arguments.length) { 4533 return this.attr("class", "") 4534 } 4535 if (typeof value === "string" && value) { 4536 classes = value.match(rnothtmlwhite) || []; 4537 while ((elem = this[i++])) { 4538 curValue = getClass(elem); 4539 cur = elem.nodeType === 1 && (" " + stripAndCollapse(curValue) + " "); 4540 if (cur) { 4541 j = 0; 4542 while ((clazz = classes[j++])) { 4543 while (cur.indexOf(" " + clazz + " ") > -1) { 4544 cur = cur.replace(" " + clazz + " ", " ") 4545 } 4546 } 4547 finalValue = stripAndCollapse(cur); 4548 if (curValue !== finalValue) { 4549 elem.setAttribute("class", finalValue) 4550 } 4551 } 4552 } 4553 } 4554 return this 4555 }, 4556 toggleClass: function(value, stateVal) { 4557 var type = typeof value; 4558 if (typeof stateVal === "boolean" && type === "string") { 4559 return stateVal ? this.addClass(value) : this.removeClass(value) 4560 } 4561 if (jQuery.isFunction(value)) { 4562 return this.each(function(i) { 4563 jQuery(this).toggleClass(value.call(this, i, getClass(this), stateVal), stateVal) 4564 }) 4565 } 4566 return this.each(function() { 4567 var className, i, self, classNames; 4568 if (type === "string") { 4569 i = 0; 4570 self = jQuery(this); 4571 classNames = value.match(rnothtmlwhite) || []; 4572 while ((className = classNames[i++])) { 4573 if (self.hasClass(className)) { 4574 self.removeClass(className) 4575 } else { 4576 self.addClass(className) 4577 } 4578 } 4579 } else if (value === undefined || type === "boolean") { 4580 className = getClass(this); 4581 if (className) { 4582 dataPriv.set(this, "__className__", className) 4583 } 4584 if (this.setAttribute) { 4585 this.setAttribute("class", className || value === false ? "" : dataPriv.get(this, "__className__") || "") 4586 } 4587 } 4588 }) 4589 }, 4590 hasClass: function(selector) { 4591 var className, elem, i = 0; 4592 className = " " + selector + " "; 4593 while ((elem = this[i++])) { 4594 if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) { 4595 return true 4596 } 4597 } 4598 return false 4599 } 4600 }); 4601 var rreturn = /\r/g; 4602 jQuery.fn.extend({ 4603 val: function(value) { 4604 var hooks, ret, isFunction, elem = this[0]; 4605 if (!arguments.length) { 4606 if (elem) { 4607 hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()]; 4608 if (hooks && "get"in hooks && (ret = hooks.get(elem, "value")) !== undefined) { 4609 return ret 4610 } 4611 ret = elem.value; 4612 if (typeof ret === "string") { 4613 return ret.replace(rreturn, "") 4614 } 4615 return ret == null ? "" : ret 4616 } 4617 return 4618 } 4619 isFunction = jQuery.isFunction(value); 4620 return this.each(function(i) { 4621 var val; 4622 if (this.nodeType !== 1) { 4623 return 4624 } 4625 if (isFunction) { 4626 val = value.call(this, i, jQuery(this).val()) 4627 } else { 4628 val = value 4629 } 4630 if (val == null) { 4631 val = "" 4632 } else if (typeof val === "number") { 4633 val += "" 4634 } else if (Array.isArray(val)) { 4635 val = jQuery.map(val, function(value) { 4636 return value == null ? "" : value + "" 4637 }) 4638 } 4639 hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]; 4640 if (!hooks || !("set"in hooks) || hooks.set(this, val, "value") === undefined) { 4641 this.value = val 4642 } 4643 }) 4644 } 4645 }); 4646 jQuery.extend({ 4647 valHooks: { 4648 option: { 4649 get: function(elem) { 4650 var val = jQuery.find.attr(elem, "value"); 4651 return val != null ? val : stripAndCollapse(jQuery.text(elem)) 4652 } 4653 }, 4654 select: { 4655 get: function(elem) { 4656 var value, option, i, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length; 4657 if (index < 0) { 4658 i = max 4659 } else { 4660 i = one ? index : 0 4661 } 4662 for (; i < max; i++) { 4663 option = options[i]; 4664 if ((option.selected || i === index) && !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) { 4665 value = jQuery(option).val(); 4666 if (one) { 4667 return value 4668 } 4669 values.push(value) 4670 } 4671 } 4672 return values 4673 }, 4674 set: function(elem, value) { 4675 var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length; 4676 while (i--) { 4677 option = options[i]; 4678 if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) { 4679 optionSet = true 4680 } 4681 } 4682 if (!optionSet) { 4683 elem.selectedIndex = -1 4684 } 4685 return values 4686 } 4687 } 4688 } 4689 }); 4690 jQuery.each(["radio", "checkbox"], function() { 4691 jQuery.valHooks[this] = { 4692 set: function(elem, value) { 4693 if (Array.isArray(value)) { 4694 return (elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1) 4695 } 4696 } 4697 }; 4698 if (!support.checkOn) { 4699 jQuery.valHooks[this].get = function(elem) { 4700 return elem.getAttribute("value") === null ? "on" : elem.value 4701 } 4702 } 4703 }); 4704 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; 4705 jQuery.extend(jQuery.event, { 4706 trigger: function(event, data, elem, onlyHandlers) { 4707 var i, cur, tmp, bubbleType, ontype, handle, special, eventPath = [elem || document], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : []; 4708 cur = tmp = elem = elem || document; 4709 if (elem.nodeType === 3 || elem.nodeType === 8) { 4710 return 4711 } 4712 if (rfocusMorph.test(type + jQuery.event.triggered)) { 4713 return 4714 } 4715 if (type.indexOf(".") > -1) { 4716 namespaces = type.split("."); 4717
4717 type = namespaces.shift(); 4718 namespaces.sort() 4719 } 4720 ontype = type.indexOf(":") < 0 && "on" + type; 4721 event = event[jQuery.expando] ? event : new jQuery.Event(type,typeof event === "object" && event); 4722 event.isTrigger = onlyHandlers ? 2 : 3; 4723 event.namespace = namespaces.join("."); 4724 event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; 4725 event.result = undefined; 4726 if (!event.target) { 4727 event.target = elem 4728 } 4729 data = data == null ? [event] : jQuery.makeArray(data, [event]); 4730 special = jQuery.event.special[type] || {}; 4731 if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) { 4732 return 4733 } 4734 if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) { 4735 bubbleType = special.delegateType || type; 4736 if (!rfocusMorph.test(bubbleType + type)) { 4737 cur = cur.parentNode 4738 } 4739 for (; cur; cur = cur.parentNode) { 4740 eventPath.push(cur); 4741 tmp = cur 4742 } 4743 if (tmp === (elem.ownerDocument || document)) { 4744 eventPath.push(tmp.defaultView || tmp.parentWindow || window) 4745 } 4746 } 4747 i = 0; 4748 while ((cur = eventPath[i++]) && !event.isPropagationStopped()) { 4749 event.type = i > 1 ? bubbleType : special.bindType || type; 4750 handle = (dataPriv.get(cur, "events") || {})[event.type] && dataPriv.get(cur, "handle"); 4751 if (handle) { 4752 handle.apply(cur, data) 4753 } 4754 handle = ontype && cur[ontype]; 4755 if (handle && handle.apply && acceptData(cur)) { 4756 event.result = handle.apply(cur, data); 4757 if (event.result === false) { 4758 event.preventDefault() 4759 } 4760 } 4761 } 4762 event.type = type; 4763 if (!onlyHandlers && !event.isDefaultPrevented()) { 4764 if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) { 4765 if (ontype && jQuery.isFunction(elem[type]) && !jQuery.isWindow(elem)) { 4766 tmp = elem[ontype]; 4767 if (tmp) { 4768 elem[ontype] = null 4769 } 4770 jQuery.event.triggered = type; 4771 elem[type](); 4772 jQuery.event.triggered = undefined; 4773 if (tmp) { 4774 elem[ontype] = tmp 4775 } 4776 } 4777 } 4778 } 4779 return event.result 4780 }, 4781 simulate: function(type, elem, event) { 4782 var e = jQuery.extend(new jQuery.Event(), event, { 4783 type: type, 4784 isSimulated: true 4785 }); 4786 jQuery.event.trigger(e, null, elem) 4787 } 4788 }); 4789 jQuery.fn.extend({ 4790 trigger: function(type, data) { 4791 return this.each(function() { 4792 jQuery.event.trigger(type, data, this) 4793 }) 4794 }, 4795 triggerHandler: function(type, data) { 4796 var elem = this[0]; 4797 if (elem) { 4798 return jQuery.event.trigger(type, data, elem, true) 4799 } 4800 } 4801 }); 4802 jQuery.each(("blur focus focusin focusout resize scroll click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup contextmenu").split(" "), function(i, name) { 4803 jQuery.fn[name] = function(data, fn) { 4804 return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name) 4805 } 4806 }); 4807 jQuery.fn.extend({ 4808 hover: function(fnOver, fnOut) { 4809 return this.mouseenter(fnOver).mouseleave(fnOut || fnOver) 4810 } 4811 }); 4812 support.focusin = "onfocusin"in window; 4813 if (!support.focusin) { 4814 jQuery.each({ 4815 focus: "focusin", 4816 blur: "focusout" 4817 }, function(orig, fix) { 4818 var handler = function(event) { 4819 jQuery.event.simulate(fix, event.target, jQuery.event.fix(event)) 4820 }; 4821 jQuery.event.special[fix] = { 4822 setup: function() { 4823 var doc = this.ownerDocument || this 4824 , attaches = dataPriv.access(doc, fix); 4825 if (!attaches) { 4826 doc.addEventListener(orig, handler, true) 4827 } 4828 dataPriv.access(doc, fix, (attaches || 0) + 1) 4829 }, 4830 teardown: function() { 4831 var doc = this.ownerDocument || this 4832 , attaches = dataPriv.access(doc, fix) - 1; 4833 if (!attaches) { 4834 doc.removeEventListener(orig, handler, true); 4835 dataPriv.remove(doc, fix) 4836 } else {
4837 dataPriv.access(doc, fix, attaches) 4838 } 4839 } 4840 } 4841 }) 4842 } 4843 var location = window.location; 4844 var nonce = jQuery.now(); 4845 var rquery = (/\?/); 4846 jQuery.parseXML = function(data) { 4847 var xml; 4848 if (!data || typeof data !== "string") { 4849 return null 4850 } 4851 try { 4852 xml = (new window.DOMParser()).parseFromString(data, "text/xml") 4853 } catch (e) { 4854 xml = undefined 4855 } 4856 if (!xml || xml.getElementsByTagName("parsererror").length) { 4857 jQuery.error("Invalid XML: " + data) 4858 } 4859 return xml 4860 } 4861 ; 4862 var rbracket = /\[\]$/ 4863 , rCRLF = /\r?\n/g 4864 , rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i 4865 , rsubmittable = /^(?:input|select|textarea|keygen)/i; 4866 function buildParams(prefix, obj, traditional, add) { 4867 var name; 4868 if (Array.isArray(obj)) { 4869 jQuery.each(obj, function(i, v) { 4870 if (traditional || rbracket.test(prefix)) { 4871 add(prefix, v) 4872 } else { 4873 buildParams(prefix + "[" + (typeof v === "object" && v != null ? i : "") + "]", v, traditional, add) 4874 } 4875 }) 4876 } else if (!traditional && jQuery.type(obj) === "object") { 4877 for (name in obj) { 4878 buildParams(prefix + "[" + name + "]", obj[name], traditional, add) 4879 } 4880 } else { 4881 add(prefix, obj) 4882 } 4883 } 4884 jQuery.param = function(a, traditional) { 4885 var prefix, s = [], add = function(key, valueOrFunction) { 4886 var value = jQuery.isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction; 4887 s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value) 4888 }; 4889 if (Array.isArray(a) || (a.jquery && !jQuery.isPlainObject(a))) { 4890 jQuery.each(a, function() { 4891 add(this.name, this.value) 4892 }) 4893 } else { 4894 for (prefix in a) { 4895 buildParams(prefix, a[prefix], traditional, add) 4896 } 4897 } 4898 return s.join("&") 4899 } 4900 ; 4901 jQuery.fn.extend({ 4902 serialize: function() { 4903 return jQuery.param(this.serializeArray()) 4904 }, 4905 serializeArray: function() { 4906 return this.map(function() { 4907 var elements = jQuery.prop(this, "elements"); 4908 return elements ? jQuery.makeArray(elements) : this 4909 }).filter(function() { 4910 var type = this.type; 4911 return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type)) 4912 }).map(function(i, elem) { 4913 var val = jQuery(this).val(); 4914 if (val == null) { 4915 return null 4916 } 4917 if (Array.isArray(val)) { 4918 return jQuery.map(val, function(val) { 4919 return { 4920 name: elem.name, 4921 value: val.replace(rCRLF, "\r\n") 4922 } 4923 }) 4924 } 4925 return { 4926 name: elem.name, 4927 value: val.replace(rCRLF, "\r\n") 4928 } 4929 }).get() 4930 } 4931 }); 4932 var r20 = /%20/g 4933 , rhash = /#.*$/ 4934 , rantiCache = /([?&])_=[^&]*/ 4935 , rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg 4936 , rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/ 4937 , rnoContent = /^(?:GET|HEAD)$/ 4938 , rprotocol = /^\/\// 4939 , prefilters = {} 4940 , transports = {} 4941 , allTypes = "*/".concat("*") 4942 , originAnchor = document.createElement("a"); 4943 originAnchor.href = location.href; 4944 function addToPrefiltersOrTransports(structure) { 4945 return function(dataTypeExpression, func) { 4946 if (typeof dataTypeExpression !== "string") { 4947 func = dataTypeExpression; 4948 dataTypeExpression = "*" 4949 } 4950 var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || []; 4951 if (jQuery.isFunction(func)) { 4952 while ((dataType = dataTypes[i++])) { 4953 if (dataType[0] === "+") { 4954 dataType = dataType.slice(1) || "*"; 4955 (structure[dataType] = structure[dataType] || []).unshift(func) 4956 } else { 4957 (structure[dataType] = structure[dataType] || []).push(func) 4958 } 4959 } 4960 } 4961 } 4962 }
vendor: 30,315 bytes, lines 4963-5710
4963 function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { 4964 var inspected = {} 4965 , seekingTransport = (structure === transports); 4966 function inspect(dataType) { 4967 var selected; 4968 inspected[dataType] = true; 4969 jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) { 4970 var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR); 4971 if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) { 4972 options.dataTypes.unshift(dataTypeOrTransport); 4973 inspect(dataTypeOrTransport); 4974 return false 4975 } else if (seekingTransport) { 4976 return !(selected = dataTypeOrTransport) 4977 } 4978 }); 4979 return selected 4980 } 4981 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*") 4982 } 4983 function ajaxExtend(target, src) { 4984 var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; 4985 for (key in src) { 4986 if (src[key] !== undefined) { 4987 (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key] 4988 } 4989 } 4990 if (deep) { 4991 jQuery.extend(true, target, deep) 4992 } 4993 return target 4994 } 4995 function ajaxHandleResponses(s, jqXHR, responses) { 4996 var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes; 4997 while (dataTypes[0] === "*") { 4998 dataTypes.shift(); 4999 if (ct === undefined) { 5000 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type") 5001 } 5002 } 5003 if (ct) { 5004 for (type in contents) { 5005 if (contents[type] && contents[type].test(ct)) { 5006 dataTypes.unshift(type); 5007 break 5008 } 5009 } 5010 } 5011 if (dataTypes[0]in responses) { 5012 finalDataType = dataTypes[0] 5013 } else { 5014 for (type in responses) { 5015 if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) { 5016 finalDataType = type; 5017 break 5018 } 5019 if (!firstDataType) { 5020 firstDataType = type 5021 } 5022 } 5023 finalDataType = finalDataType || firstDataType 5024 } 5025 if (finalDataType) { 5026 if (finalDataType !== dataTypes[0]) { 5027 dataTypes.unshift(finalDataType) 5028 } 5029 return responses[finalDataType] 5030 } 5031 } 5032 function ajaxConvert(s, response, jqXHR, isSuccess) { 5033 var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice(); 5034 if (dataTypes[1]) { 5035 for (conv in s.converters) { 5036 converters[conv.toLowerCase()] = s.converters[conv] 5037 } 5038 } 5039 current = dataTypes.shift(); 5040 while (current) { 5041 if (s.responseFields[current]) { 5042 jqXHR[s.responseFields[current]] = response 5043 } 5044 if (!prev && isSuccess && s.dataFilter) { 5045 response = s.dataFilter(response, s.dataType) 5046 } 5047 prev = current; 5048 current = dataTypes.shift(); 5049 if (current) { 5050 if (current === "*") { 5051 current = prev 5052 } else if (prev !== "*" && prev !== current) { 5053 conv = converters[prev + " " + current] || converters["* " + current]; 5054 if (!conv) { 5055 for (conv2 in converters) { 5056 tmp = conv2.split(" "); 5057 if (tmp[1] === current) { 5058 conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]]; 5059 if (conv) { 5060 if (conv === true) { 5061 conv = converters[conv2] 5062 } else if (converters[conv2] !== true) { 5063 current = tmp[0]; 5064 dataTypes.unshift(tmp[1]) 5065 } 5066 break 5067 } 5068 } 5069 } 5070 } 5071 if (conv !== true) { 5072 if (conv && s.throws) { 5073 response = conv(response) 5074 } else { 5075 try { 5076 response = conv(response) 5077 } catch (e) { 5078 return { 5079 state: "parsererror", 5080 error: conv ? e : "No conversion from " + prev + " to " + current 5081 } 5082 } 5083 } 5084 } 5085 } 5086 } 5087 } 5088 return { 5089 state: "success", 5090 data: response 5091 } 5092 } 5093 jQuery.extend({ 5094 active: 0, 5095 lastModified: {}, 5096 etag: {}, 5097 ajaxSettings: { 5098 url: location.href, 5099 type: "GET", 5100 isLocal: rlocalProtocol.test(location.protocol), 5101 global: true, 5102 processData: true, 5103 async: true, 5104 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 5105 accepts: { 5106 "*": allTypes, 5107 text: "text/plain", 5108 html: "text/html", 5109 xml: "application/xml, text/xml", 5110 json: "application/json, text/javascript" 5111 }, 5112 contents: { 5113 xml: /\bxml\b/, 5114 html: /\bhtml/, 5115 json: /\bjson\b/ 5116 }, 5117 responseFields: { 5118 xml: "responseXML", 5119 text: "responseText", 5120 json: "responseJSON" 5121 }, 5122 converters: { 5123 "* text": String, 5124 "text html": true, 5125 "text json": JSON.parse, 5126 "text xml": jQuery.parseXML 5127 }, 5128 flatOptions: { 5129 url: true, 5130 context: true 5131 } 5132 }, 5133 ajaxSetup: function(target, settings) { 5134 return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target) 5135 }, 5136 ajaxPrefilter: addToPrefiltersOrTransports(prefilters), 5137 ajaxTransport: addToPrefiltersOrTransports(transports), 5138 ajax: function(url, options) { 5139 if (typeof url === "object") { 5140 options = url; 5141 url = undefined 5142 } 5143 options = options || {}; 5144 var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed, fireGlobals, i, uncached, s = jQuery.ajaxSetup({}, options), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = { 5145 readyState: 0, 5146 getResponseHeader: function(key) { 5147 var match; 5148 if (completed) { 5149 if (!responseHeaders) { 5150 responseHeaders = {}; 5151 while ((match = rheaders.exec(responseHeadersString))) { 5152 responseHeaders[match[1].toLowerCase()] = match[2] 5153 } 5154 } 5155 match = responseHeaders[key.toLowerCase()] 5156 } 5157 return match == null ? null : match 5158 }, 5159 getAllResponseHeaders: function() { 5160 return completed ? responseHeadersString : null 5161 }, 5162 setRequestHeader: function(name, value) { 5163 if (completed == null) { 5164 name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name; 5165 requestHeaders[name] = value 5166 } 5167 return this 5168 }, 5169 overrideMimeType: function(type) { 5170 if (completed == null) { 5171 s.mimeType = type 5172 } 5173 return this 5174 }, 5175 statusCode: function(map) { 5176 var code; 5177 if (map) { 5178 if (completed) { 5179 jqXHR.always(map[jqXHR.status]) 5180 } else { 5181 for (code in map) { 5182 statusCode[code] = [statusCode[code], map[code]] 5183 } 5184 } 5185 } 5186 return this 5187 }, 5188 abort: function(statusText) { 5189 var finalText = statusText || strAbort; 5190 if (transport) { 5191 transport.abort(finalText) 5192 } 5193 done(0, finalText); 5194 return this 5195 } 5196 }; 5197 deferred.promise(jqXHR); 5198 s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//"); 5199 s.type = options.method || options.type || s.method || s.type; 5200 s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""]; 5201 if (s.crossDomain == null) { 5202 urlAnchor = document.createElement("a"); 5203 try { 5204 urlAnchor.href = s.url; 5205 urlAnchor.href = urlAnchor.href; 5206 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host 5207 } catch (e) { 5208 s.crossDomain = true 5209 } 5210 } 5211 if (s.data && s.processData && typeof s.data !== "string") { 5212 s.data = jQuery.param(s.data, s.traditional) 5213 } 5214 inspectPrefiltersOrTransports(prefilters, s, options, jqXHR); 5215 if (completed) { 5216 return jqXHR 5217 } 5218 fireGlobals = jQuery.event && s.global; 5219 if (fireGlobals && jQuery.active++ === 0) { 5220 jQuery.event.trigger("ajaxStart") 5221 } 5222 s.type = s.type.toUpperCase(); 5223 s.hasContent = !rnoContent.test(s.type); 5224 cacheURL = s.url.replace(rhash, ""); 5225 if (!s.hasContent) { 5226 uncached = s.url.slice(cacheURL.length); 5227 if (s.data) { 5228 cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data; 5229 delete s.data 5230 } 5231 if (s.cache === false) { 5232 cacheURL = cacheURL.replace(rantiCache, "$1"); 5233 uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + (nonce++) + uncached 5234 } 5235 s.url = cacheURL + uncached 5236 } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) { 5237 s.data = s.data.replace(r20, "+") 5238 } 5239 if (s.ifModified) { 5240 if (jQuery.lastModified[cacheURL]) { 5241 jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]) 5242 } 5243 if (jQuery.etag[cacheURL]) { 5244 jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]) 5245 } 5246 } 5247 if (s.data && s.hasContent && s.contentType !== false || options.contentType) { 5248 jqXHR.setRequestHeader("Content-Type", s.contentType) 5249 } 5250 jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]); 5251 for (i in s.headers) { 5252 jqXHR.setRequestHeader(i, s.headers[i]) 5253 } 5254 if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed)) { 5255 return jqXHR.abort() 5256 } 5257 strAbort = "abort"; 5258 completeDeferred.add(s.complete); 5259 jqXHR.done(s.success); 5260 jqXHR.fail(s.error); 5261 transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR); 5262 if (!transport) { 5263 done(-1, "No Transport") 5264 } else { 5265 jqXHR.readyState = 1; 5266 if (fireGlobals) { 5267 globalEventContext.trigger("ajaxSend", [jqXHR, s]) 5268 } 5269 if (completed) { 5270 return jqXHR 5271 } 5272 if (s.async && s.timeout > 0) { 5273 timeoutTimer = window.setTimeout(function() { 5274 jqXHR.abort("timeout") 5275 }, s.timeout) 5276 } 5277 try { 5278 completed = false; 5279 transport.send(requestHeaders, done) 5280 } catch (e) { 5281 if (completed) { 5282 throw e 5283 } 5284 done(-1, e) 5285 } 5286 } 5287 function done(status, nativeStatusText, responses, headers) { 5288 var isSuccess, success, error, response, modified, statusText = nativeStatusText; 5289 if (completed) { 5290 return 5291 } 5292 completed = true; 5293 if (timeoutTimer) { 5294 window.clearTimeout(timeoutTimer) 5295 } 5296 transport = undefined; 5297 responseHeadersString = headers || ""; 5298 jqXHR.readyState = status > 0 ? 4 : 0; 5299 isSuccess = status >= 200 && status < 300 || status === 304; 5300 if (responses) { 5301 response = ajaxHandleResponses(s, jqXHR, responses) 5302 } 5303 response = ajaxConvert(s, response, jqXHR, isSuccess); 5304 if (isSuccess) { 5305 if (s.ifModified) { 5306 modified = jqXHR.getResponseHeader("Last-Modified"); 5307 if (modified) { 5308 jQuery.lastModified[cacheURL] = modified 5309 } 5310 modified = jqXHR.getResponseHeader("etag"); 5311 if (modified) { 5312 jQuery.etag[cacheURL] = modified 5313 } 5314 } 5315 if (status === 204 || s.type === "HEAD") { 5316 statusText = "nocontent" 5317 } else if (status === 304) { 5318 statusText = "notmodified" 5319 } else { 5320 statusText = response.state; 5321 success = response.data; 5322 error = response.error; 5323 isSuccess = !error 5324 } 5325 } else { 5326 error = statusText; 5327 if (status || !statusText) { 5328 statusText = "error"; 5329 if (status < 0) { 5330 status = 0 5331 } 5332 } 5333 } 5334 jqXHR.status = status; 5335 jqXHR.statusText = (nativeStatusText || statusText) + ""; 5336 if (isSuccess) { 5337 deferred.resolveWith(callbackContext, [success, statusText, jqXHR]) 5338 } else { 5339 deferred.rejectWith(callbackContext, [jqXHR, statusText, error]) 5340 } 5341 jqXHR.statusCode(statusCode); 5342 statusCode = undefined; 5343 if (fireGlobals) { 5344 globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]) 5345 } 5346 completeDeferred.fireWith(callbackContext, [jqXHR, statusText]); 5347 if (fireGlobals) { 5348 globalEventContext.trigger("ajaxComplete", [jqXHR, s]); 5349 if (!(--jQuery.active)) { 5350 jQuery.event.trigger("ajaxStop") 5351 } 5352 } 5353 } 5354 return jqXHR 5355 }, 5356 getJSON: function(url, data, callback) { 5357 return jQuery.get(url, data, callback, "json") 5358 }, 5359 getScript: function(url, callback) { 5360 return jQuery.get(url, undefined, callback, "script") 5361 } 5362 }); 5363 jQuery.each(["get", "post"], function(i, method) { 5364 jQuery[method] = function(url, data, callback, type) { 5365 if (jQuery.isFunction(data)) { 5366 type = type || callback; 5367 callback = data; 5368 data = undefined 5369 } 5370 return jQuery.ajax(jQuery.extend({ 5371 url: url, 5372 type: method, 5373 dataType: type, 5374 data: data, 5375 success: callback 5376 }, jQuery.isPlainObject(url) && url)) 5377 } 5378 }); 5379 jQuery._evalUrl = function(url) { 5380 return jQuery.ajax({ 5381 url: url, 5382 type: "GET", 5383 dataType: "script", 5384 cache: true, 5385 async: false, 5386 global: false, 5387 "throws": true 5388 }) 5389 } 5390 ; 5391 jQuery.fn.extend({ 5392 wrapAll: function(html) { 5393 var wrap; 5394 if (this[0]) { 5395 if (jQuery.isFunction(html)) { 5396 html = html.call(this[0]) 5397 } 5398 wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true); 5399 if (this[0].parentNode) { 5400 wrap.insertBefore(this[0]) 5401 } 5402 wrap.map(function() { 5403 var elem = this; 5404 while (elem.firstElementChild) { 5405 elem = elem.firstElementChild 5406 } 5407 return elem 5408 }).append(this) 5409 } 5410 return this 5411 }, 5412 wrapInner: function(html) { 5413 if (jQuery.isFunction(html)) { 5414 return this.each(function(i) { 5415 jQuery(this).wrapInner(html.call(this, i)) 5416 }) 5417 } 5418 return this.each(function() { 5419 var self = jQuery(this) 5420 , contents = self.contents(); 5421 if (contents.length) { 5422 contents.wrapAll(html) 5423 } else { 5424 self.append(html) 5425 } 5426 }) 5427 }, 5428 wrap: function(html) { 5429 var isFunction = jQuery.isFunction(html); 5430 return this.each(function(i) { 5431 jQuery(this).wrapAll(isFunction ? html.call(this, i) : html) 5432 }) 5433 }, 5434 unwrap: function(selector) { 5435 this.parent(selector).not("body").each(function() { 5436 jQuery(this).replaceWith(this.childNodes) 5437 }); 5438 return this 5439 } 5440 }); 5441 jQuery.expr.pseudos.hidden = function(elem) { 5442 return !jQuery.expr.pseudos.visible(elem) 5443 } 5444 ; 5445 jQuery.expr.pseudos.visible = function(elem) { 5446 return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length) 5447 } 5448 ; 5449 jQuery.ajaxSettings.xhr = function() { 5450 try { 5451 return new window.XMLHttpRequest() 5452 } catch (e) {} 5453 } 5454 ; 5455 var xhrSuccessStatus = { 5456 0: 200, 5457 1223: 204 5458 } 5459 , xhrSupported = jQuery.ajaxSettings.xhr(); 5460 support.cors = !!xhrSupported && ("withCredentials"in xhrSupported); 5461 support.ajax = xhrSupported = !!xhrSupported; 5462 jQuery.ajaxTransport(function(options) { 5463 var callback, errorCallback; 5464 if (support.cors || xhrSupported && !options.crossDomain) { 5465 return { 5466 send: function(headers, complete) { 5467 var i, xhr = options.xhr(); 5468 xhr.open(options.type, options.url, options.async, options.username, options.password); 5469 if (options.xhrFields) { 5470 for (i in options.xhrFields) { 5471 xhr[i] = options.xhrFields[i] 5472 } 5473 } 5474 if (options.mimeType && xhr.overrideMimeType) { 5475 xhr.overrideMimeType(options.mimeType) 5476 } 5477 if (!options.crossDomain && !headers["X-Requested-With"]) { 5478 headers["X-Requested-With"] = "XMLHttpRequest" 5479 } 5480 for (i in headers) { 5481 xhr.setRequestHeader(i, headers[i]) 5482 } 5483 callback = function(type) { 5484 return function() { 5485 if (callback) { 5486 callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; 5487 if (type === "abort") { 5488 xhr.abort() 5489 } else if (type === "error") { 5490 if (typeof xhr.status !== "number") { 5491 complete(0, "error") 5492 } else { 5493 complete(xhr.status, xhr.statusText) 5494 } 5495 } else { 5496 complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText, (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { 5497 binary: xhr.response 5498 } : { 5499 text: xhr.responseText 5500 }, xhr.getAllResponseHeaders()) 5501 } 5502 } 5503 } 5504 } 5505 ; 5506 xhr.onload = callback(); 5507 errorCallback = xhr.onerror = callback("error"); 5508 if (xhr.onabort !== undefined) { 5509 xhr.onabort = errorCallback 5510 } else { 5511 xhr.onreadystatechange = function() { 5512 if (xhr.readyState === 4) { 5513 window.setTimeout(function() { 5514 if (callback) { 5515 errorCallback() 5516 } 5517 }) 5518 } 5519 } 5520 } 5521 callback = callback("abort"); 5522 try { 5523 xhr.send(options.hasContent && options.data || null) 5524 } catch (e) { 5525 if (callback) { 5526 throw e 5527 } 5528 } 5529 }, 5530 abort: function() { 5531 if (callback) { 5532 callback() 5533 } 5534 } 5535 } 5536 } 5537 }); 5538 jQuery.ajaxPrefilter(function(s) { 5539 if (s.crossDomain) { 5540 s.contents.script = false 5541 } 5542 }); 5543 jQuery.ajaxSetup({ 5544 accepts: { 5545 script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript" 5546 }, 5547 contents: { 5548 script: /\b(?:java|ecma)script\b/ 5549 }, 5550 converters: { 5551 "text script": function(text) { 5552 jQuery.globalEval(text); 5553 return text 5554 } 5555 } 5556 }); 5557 jQuery.ajaxPrefilter("script", function(s) { 5558 if (s.cache === undefined) { 5559 s.cache = false 5560 } 5561 if (s.crossDomain) { 5562 s.type = "GET" 5563 } 5564 }); 5565 jQuery.ajaxTransport("script", function(s) { 5566 if (s.crossDomain) { 5567 var script, callback; 5568 return { 5569 send: function(_, complete) { 5570 script = jQuery("<script>").prop({ 5571 charset: s.scriptCharset, 5572 src: s.url 5573 }).on("load error", callback = function(evt) { 5574 script.remove(); 5575 callback = null; 5576 if (evt) { 5577 complete(evt.type === "error" ? 404 : 200, evt.type) 5578 } 5579 } 5580 ); 5581 document.head.appendChild(script[0]) 5582 }, 5583 abort: function() { 5584 if (callback) { 5585 callback() 5586 } 5587 } 5588 } 5589 } 5590 }); 5591 var oldCallbacks = [] 5592 , rjsonp = /(=)\?(?=&|$)|\?\?/; 5593 jQuery.ajaxSetup({ 5594 jsonp: "callback", 5595 jsonpCallback: function() { 5596 var callback = oldCallbacks.pop() || (jQuery.expando + "_" + (nonce++)); 5597 this[callback] = true; 5598 return callback 5599 } 5600 }); 5601 jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) { 5602 var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data"); 5603 if (jsonProp || s.dataTypes[0] === "jsonp") { 5604 callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback; 5605 if (jsonProp) { 5606 s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName) 5607 } else if (s.jsonp !== false) { 5608 s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName 5609 } 5610 s.converters["script json"] = function() { 5611 if (!responseContainer) { 5612 jQuery.error(callbackName + " was not called") 5613 } 5614 return responseContainer[0] 5615 } 5616 ; 5617 s.dataTypes[0] = "json"; 5618 overwritten = window[callbackName]; 5619 window[callbackName] = function() { 5620 responseContainer = arguments 5621 } 5622 ; 5623 jqXHR.always(function() { 5624 if (overwritten === undefined) { 5625 jQuery(window).removeProp(callbackName) 5626 } else { 5627 window[callbackName] = overwritten 5628 } 5629 if (s[callbackName]) { 5630 s.jsonpCallback = originalSettings.jsonpCallback; 5631 oldCallbacks.push(callbackName) 5632 } 5633 if (responseContainer && jQuery.isFunction(overwritten)) { 5634 overwritten(responseContainer[0]) 5635 } 5636 responseContainer = overwritten = undefined 5637 }); 5638 return "script" 5639 } 5640 }); 5641 support.createHTMLDocument = (function() { 5642 var body = document.implementation.createHTMLDocument("").body; 5643 body.innerHTML = "<form></form><form></form>"; 5644 return body.childNodes.length === 2 5645 } 5646 )(); 5647 jQuery.parseHTML = function(data, context, keepScripts) { 5648 if (typeof data !== "string") { 5649 return [] 5650 } 5651 if (typeof context === "boolean") { 5652 keepScripts = context; 5653 context = false 5654 } 5655 var base, parsed, scripts; 5656 if (!context) { 5657 if (support.createHTMLDocument) { 5658 context = document.implementation.createHTMLDocument(""); 5659 base = context.createElement("base"); 5660 base.href = document.location.href; 5661 context.head.appendChild(base) 5662 } else { 5663 context = document 5664 } 5665 } 5666 parsed = rsingleTag.exec(data); 5667 scripts = !keepScripts && []; 5668 if (parsed) { 5669 return [context.createElement(parsed[1])] 5670 } 5671 parsed = buildFragment([data], context, scripts); 5672 if (scripts && scripts.length) { 5673 jQuery(scripts).remove() 5674 } 5675 return jQuery.merge([], parsed.childNodes) 5676 } 5677 ; 5678 jQuery.fn.load = function(url, params, callback) { 5679 var selector, type, response, self = this, off = url.indexOf(" "); 5680 if (off > -1) { 5681 selector = stripAndCollapse(url.slice(off)); 5682 url = url.slice(0, off) 5683 } 5684 if (jQuery.isFunction(params)) { 5685 callback = params; 5686 params = undefined 5687 } else if (params && typeof params === "object") { 5688 type = "POST" 5689 } 5690 if (self.length > 0) { 5691 jQuery.ajax({ 5692 url: url, 5693 type: type || "GET", 5694 dataType: "html", 5695 data: params 5696 }).done(function(responseText) { 5697 response = arguments; 5698 self.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText) 5699 }).always(callback && function(jqXHR, status) { 5700 self.each(function() { 5701 callback.apply(this, response || [jqXHR.responseText, status, jqXHR]) 5702 }) 5703 } 5704 ) 5705 } 5706 return this 5707 } 5708 ; 5709 jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) { 5710 jQuery.fn[type] = function(fn) {
5711 return this.on(type, fn) 5712 } 5713 }); 5714 jQuery.expr.pseudos.animated = function(elem) { 5715 return jQuery.grep(jQuery.timers, function(fn) { 5716 return elem === fn.elem 5717 }).length 5718 } 5719 ; 5720 jQuery.offset = { 5721 setOffset: function(elem, options, i) { 5722 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {}; 5723 if (position === "static") { 5724 elem.style.position = "relative" 5725 } 5726 curOffset = curElem.offset(); 5727 curCSSTop = jQuery.css(elem, "top"); 5728 curCSSLeft = jQuery.css(elem, "left"); 5729 calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1; 5730 if (calculatePosition) { 5731 curPosition = curElem.position(); 5732 curTop = curPosition.top; 5733 curLeft = curPosition.left 5734 } else { 5735 curTop = parseFloat(curCSSTop) || 0; 5736 curLeft = parseFloat(curCSSLeft) || 0 5737 } 5738 if (jQuery.isFunction(options)) { 5739 options = options.call(elem, i, jQuery.extend({}, curOffset)) 5740 } 5741 if (options.top != null) { 5742 props.top = (options.top - curOffset.top) + curTop 5743 } 5744 if (options.left != null) { 5745 props.left = (options.left - curOffset.left) + curLeft 5746 } 5747 if ("using"in options) { 5748 options.using.call(elem, props) 5749 } else { 5750 curElem.css(props) 5751 } 5752 } 5753 }; 5754 jQuery.fn.extend({ 5755 offset: function(options) { 5756 if (arguments.length) { 5757 return options === undefined ? this : this.each(function(i) { 5758 jQuery.offset.setOffset(this, options, i) 5759 }) 5760 } 5761 var doc, docElem, rect, win, elem = this[0]; 5762 if (!elem) { 5763 return 5764 } 5765 if (!elem.getClientRects().length) { 5766 return { 5767 top: 0, 5768 left: 0 5769 } 5770 } 5771 rect = elem.getBoundingClientRect(); 5772 doc = elem.ownerDocument; 5773 docElem = doc.documentElement; 5774 win = doc.defaultView; 5775 return { 5776 top: rect.top + win.pageYOffset - docElem.clientTop, 5777 left: rect.left + win.pageXOffset - docElem.clientLeft 5778 } 5779 }, 5780 position: function() { 5781 if (!this[0]) { 5782 return 5783 } 5784 var offsetParent, offset, elem = this[0], parentOffset = { 5785 top: 0, 5786 left: 0 5787 }; 5788 if (jQuery.css(elem, "position") === "fixed") { 5789 offset = elem.getBoundingClientRect() 5790 } else { 5791 offsetParent = this.offsetParent(); 5792 offset = this.offset(); 5793 if (!nodeName(offsetParent[0], "html")) { 5794 parentOffset = offsetParent.offset() 5795 } 5796 parentOffset = { 5797 top: parentOffset.top + jQuery.css(offsetParent[0], "borderTopWidth", true), 5798 left: parentOffset.left + jQuery.css(offsetParent[0], "borderLeftWidth", true) 5799 } 5800 } 5801 return { 5802 top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true), 5803 left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true) 5804 } 5805 }, 5806 offsetParent: function() { 5807 return this.map(function() { 5808 var offsetParent = this.offsetParent; 5809 while (offsetParent && jQuery.css(offsetParent, "position") === "static") { 5810 offsetParent = offsetParent.offsetParent 5811 } 5812 return offsetParent || documentElement 5813 }) 5814 } 5815 }); 5816 jQuery.each({ 5817 scrollLeft: "pageXOffset", 5818 scrollTop: "pageYOffset" 5819 }, function(method, prop) { 5820 var top = "pageYOffset" === prop; 5821 jQuery.fn[method] = function(val) { 5822 return access(this, function(elem, method, val) { 5823 var win; 5824 if (jQuery.isWindow(elem)) { 5825 win = elem 5826 } else if (elem.nodeType === 9) { 5827 win = elem.defaultView 5828 } 5829 if (val === undefined) { 5830 return win ? win[prop] : elem[method] 5831 } 5832 if (win) { 5833 win.scrollTo(!top ? val : win.pageXOffset, top ? val : win.pageYOffset) 5834 } else { 5835 elem[method] = val 5836 } 5837 }, method, val, arguments.length) 5838 } 5839 }); 5840 jQuery.each(["top", "left"], function(i, prop) { 5841 jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function(elem, computed) { 5842 if (computed) { 5843 computed = curCSS(elem, prop); 5844 return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed 5845 } 5846 }) 5847 }); 5848 jQuery.each({ 5849 Height: "height", 5850 Width: "width" 5851 }, function(name, type) { 5852 jQuery.each({
5853 padding: "inner" + name, 5854 content: type, 5855 "": "outer" + name 5856 }, function(defaultExtra, funcName) { 5857 jQuery.fn[funcName] = function(margin, value) { 5858 var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean") 5859 , extra = defaultExtra || (margin === true || value === true ? "margin" : "border"); 5860 return access(this, function(elem, type, value) { 5861 var doc; 5862 if (jQuery.isWindow(elem)) { 5863 return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name] 5864 } 5865 if (elem.nodeType === 9) { 5866 doc = elem.documentElement; 5867 return Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name]) 5868 } 5869 return value === undefined ? jQuery.css(elem, type, extra) : jQuery.style(elem, type, value, extra) 5870 }, type, chainable ? margin : undefined, chainable) 5871 } 5872 }) 5873 }); 5874 jQuery.fn.extend({ 5875 bind: function(types, data, fn) { 5876 return this.on(types, null, data, fn) 5877 }, 5878 unbind: function(types, fn) { 5879 return this.off(types, null, fn) 5880 }, 5881 delegate: function(selector, types, data, fn) { 5882 return this.on(types, selector, data, fn) 5883 }, 5884 undelegate: function(selector, types, fn) { 5885 return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn) 5886 } 5887 }); 5888 jQuery.holdReady = function(hold) { 5889 if (hold) { 5890 jQuery.readyWait++ 5891 } else { 5892 jQuery.ready(true) 5893 } 5894 } 5895 ; 5896 jQuery.isArray = Array.isArray; 5897 jQuery.parseJSON = JSON.parse; 5898 jQuery.nodeName = nodeName; 5899 if (typeof define === "function" && define.amd) { 5900 define("jquery", [], function() { 5901 return jQuery 5902 }) 5903 } 5904 var _jQuery = window.jQuery 5905 , _$ = window.$; 5906 jQuery.noConflict = function(deep) { 5907 if (window.$ === jQuery) { 5908 window.$ = _$ 5909 } 5910 if (deep && window.jQuery === jQuery) { 5911 window.jQuery = _jQuery 5912 } 5913 return jQuery 5914 } 5915 ; 5916 if (!noGlobal) { 5917 window.jQuery = window.$ = jQuery 5918 } 5919 return jQuery 5920}); 5921document.loaded = false; 5922$(document).ready(function() { 5923 document.loaded = true 5924}); 5925var observeDOM = (function() { 5926 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver 5927 , eventListenerSupported = window.addEventListener; 5928 return function(obj, callback) { 5929 if (MutationObserver) { 5930 var obs = new MutationObserver(function(mutations, observer) { 5931 if (mutations[0].addedNodes.length || mutations[0].removedNodes.length) 5932 callback() 5933 } 5934 ); 5935 obs.observe(obj, { 5936 childList: true, 5937 subtree: true 5938 }) 5939 } else if (eventListenerSupported) { 5940 obj.addEventListener('DOMNodeInserted', callback, false); 5941 obj.addEventListener('DOMNodeRemoved', callback, false) 5942 } 5943 } 5944} 5945)(); 5946function isMobileDevice() { 5947 var sUserAgent = navigator.userAgent.toLowerCase(); 5948 var oRegExp = /(ipod|ipad|android|pocket|mobile|portable|smartphone|handheld|symbian|wap|palm|avantgo|opera mini|opera mobi|nokia|chtml|blackberry|hiptop|lge vx|midp|maemo|mmp|netfront|nintendo ds|novarra|openweb|psp|phone|up.browser|up.link|windows ce)/; 5949 return oRegExp.test(sUserAgent) 5950} 5951function SessionKeepAlive() { 5952 var reqXML; 5953 var url = '/pfengine/refreshsession.asp'; 5954 if (window.XMLHttpRequest) { 5955 reqXML = new XMLHttpRequest(); 5956 reqXML.open('GET', url, true); 5957 reqXML.send(null); 5958 this.SessionKeepAliveTimer() 5959 } else if (window.ActiveXObject) { 5960 reqXML = new ActiveXObject('Microsoft.XMLHTTP');
5961 if (reqXML) { 5962 reqXML.open('GET', url, true); 5963 reqXML.send(); 5964 this.SessionKeepAliveTimer() 5965 } 5966 } 5967} 5968function SessionKeepAliveTimer() { 5969 window.setTimeout('SessionKeepAlive()', 1000 * 60 * ((15 / 2) - 0.1)) 5970} 5971this.SessionKeepAliveTimer(); 5972function openWin(windowURL, windowName, windowFeatures) { 5973 newWindow = window.open(windowURL, windowName, windowFeatures); 5974 if (newWindow != undefined) { 5975 newWindow.focus() 5976 } 5977} 5978function CreateContactLink(sWo, sWer, sWem, sParameter, sImg, sText, sSub) { 5979 if (sParameter != '' && sParameter != undefined) { 5980 sParameter = ' ' + sParameter 5981 } else { 5982 sParameter = '' 5983 } 5984 if (sSub != '' && sSub != undefined) { 5985 sSub = '?subject=' + sSub 5986 } else { 5987 sSub = '' 5988 } 5989 if (sImg != '' && sImg != undefined) { 5990 document.write('<a' + sParameter + ' href="mailto:' + sWem + '@' + sWer + '.' + sWo + sSub + '"><img src="' + sImg + '" alt="" /></a>') 5991 } else if (sText != '' && sText != undefined) {
5992 document.write('<a' + sParameter + ' href="mailto:' + sWem + '@' + sWer + '.' + sWo + sSub + '">' + sText + '</a>') 5993 } else { 5994 if (sWo.indexOf('?') >= 0) { 5995 if (sSub == '') { 5996 sSub = sWo.substring(sWo.indexOf('?'), sWo.lenght) 5997 } 5998 sWo = sWo.substring(0, sWo.indexOf('?')) 5999 } 6000 document.write('<a' + sParameter + ' href="mailto:' + sWem + '@' + sWer + '.' + sWo + sSub + '">' + sWem + '@' + sWer + '.' + sWo + '</a>') 6001 } 6002} 6003function CreateContactLinkById(sId, sWo, sWer, sWem, oParam) { 6004 var options = { 6005 sSub: '', 6006 bInsertText: true 6007 }; 6008 if (typeof (document.getElementById(sId)) == 'undefined' || document.getElementById(sId) == null) { 6009 return false 6010 } 6011 for (sKey in oParam) { 6012 options[sKey] = oParam[sKey] 6013 } 6014 if (options.sSub != '') { 6015 options.sSub = '?subject=' + options.sSub 6016 } 6017 document.getElementById(sId).setAttribute('href', 'mailto:' + sWem + '@' + sWer + '.' + sWo + options.sSub); 6018 if (options.sImg != undefined && options.sImg != '') { 6019 document.getElementById(sId).innerHTML = '<img src="' + options.sImg + '" alt="" />' 6020 } else if (options.sText != undefined && options.sText != '') { 6021 document.getElementById(sId).innerHTML = options.sText 6022 } else if (options.bInsertText) { 6023 document.getElementById(sId).innerHTML = sWem + '@' + sWer + '.' + sWo 6024 } 6025} 6026function UrlEncode(string) { 6027 return escape(utf8_encode(string)) 6028} 6029function UrlDecode(string) { 6030 return utf8_decode(unescape(string)) 6031} 6032function utf8_encode(string) { 6033 string = string.replace(/\r\n/g, "\n"); 6034 var utftext = ""; 6035 for (var n = 0; n < string.length; n++) { 6036 var c = string.charCodeAt(n); 6037 if (c < 128) { 6038 utftext += String.fromCharCode(c) 6039 } else if ((c > 127) && (c < 2048)) { 6040 utftext += String.fromCharCode((c >> 6) | 192); 6041 utftext += String.fromCharCode((c & 63) | 128) 6042 } else { 6043 utftext += String.fromCharCode((c >> 12) | 224); 6044 utftext += String.fromCharCode(((c >> 6) & 63) | 128); 6045 utftext += String.fromCharCode((c & 63) | 128) 6046 } 6047 } 6048 return utftext 6049} 6050function utf8_decode(utftext) { 6051 var string = ""; 6052 var i = 0; 6053 var c = c1 = c2 = 0; 6054 while (i < utftext.length) { 6055 c = utftext.charCodeAt(i); 6056 if (c < 128) { 6057 string += String.fromCharCode(c); 6058 i++ 6059 } else if ((c > 191) && (c < 224)) { 6060 c2 = utftext.charCodeAt(i + 1); 6061 string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 6062 i += 2 6063 } else { 6064 c2 = utftext.charCodeAt(i + 1); 6065 c3 = utftext.charCodeAt(i + 2); 6066 string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 6067 i += 3 6068 } 6069 } 6070 return string 6071} 6072var oScriptLoader = { 6073 oScriptsStatus: {}, 6074 isLoaded: function(sUrl) { 6075 this.initUrl(sUrl); 6076 return this.oScriptsStatus[sUrl].status == 'loaded' 6077 }, 6078 load: function(sUrl, callback) { 6079 this.initUrl(sUrl); 6080 if (!document.loaded) { 6081 $(document).ready($.proxy(function() { 6082 this.load(sUrl, callback) 6083 }, this)); 6084 return 6085 } 6086 if (!this.isLoaded(sUrl)) { 6087 if (typeof (callback) == 'function') { 6088 this.oScriptsStatus[sUrl].aCallbacks.push(callback) 6089 } 6090 if (this.oScriptsStatus[sUrl].status == 'loading' || this.oScriptsStatus[sUrl].status == 'wait') { 6091 return 6092 } 6093 this.oScriptsStatus[sUrl].status = 'loading'; 6094 var oHead = $(document.head || document.getElementsByTagName('head')[0] || document.documentElement); 6095 var oScript = document.createElement('script'); 6096 this.oScriptsStatus[sUrl].writeOriginal = document.write; 6097 document.write = $.proxy(function(s) { 6098 this.customWrite(s, sUrl) 6099 }, this); 6100 var isAbort = false;
6101 oScript.type = 'text/javascript'; 6102 oScript.src = sUrl; 6103 oScript.onload = oScript.onreadystatechange = $.proxy(function(_, isAbort) { 6104 if (isAbort || !oScript.readyState || /loaded|complete/.test(oScript.readyState)) { 6105 if (!isAbort) { 6106 this.checkAllLoaded(sUrl) 6107 } else { 6108 this.oScriptsStatus[sUrl].status = 'abort'; 6109 document.write = this.oScriptsStatus[sUrl].writeOriginal 6110 } 6111 } 6112 }, this); 6113 t = $(document).find('head')[0].appendChild(oScript) 6114 } else if (typeof (callback) == 'function') { 6115 callback() 6116 } 6117 }, 6118 initUrl: function(sUrl) { 6119 if (this.oScriptsStatus[sUrl] == undefined) { 6120 this.oScriptsStatus[sUrl] = { 6121 status: '', 6122 writeOriginal: undefined, 6123 aSubScripts: [], 6124 aCallbacks: [] 6125 }; 6126 $('head script').each($.proxy(function(i, oElement) { 6127 if ($(oElement).attr('src') == sUrl) { 6128 this.oScriptsStatus[sUrl].status = 'loaded' 6129 } 6130 }, this)) 6131 } 6132 }, 6133 customWrite: function(sText, sUrl) { 6134 var r = /.*src="(.*\.js)"/.exec(sText); 6135 if (Object.isArray(r)) { 6136 var sSubUrl = r[1]; 6137 if (!this.isLoaded(sSubUrl)) { 6138 this.oScriptsStatus[sUrl].status = 'wait'; 6139 this.oScriptsStatus[sUrl].aSubScripts.push(sSubUrl); 6140 this.load(sSubUrl, $.proxy(function() { 6141 this.checkAllLoaded(sUrl) 6142 }, this)) 6143 } 6144 } 6145 }, 6146 checkAllLoaded: function(sUrl) { 6147 var bAllLoaded = true; 6148 $.each(this.oScriptsStatus[sUrl].aSubScripts, $.proxy(function(i, sTempUrl) { 6149 bAllLoaded = bAllLoaded && this.isLoaded(sTempUrl) 6150 }, this)); 6151 if (bAllLoaded) { 6152 document.write = this.oScriptsStatus[sUrl].writeOriginal; 6153 this.oScriptsStatus[sUrl].status = 'loaded'; 6154 $.each(this.oScriptsStatus[sUrl].aCallbacks, $.proxy(function(i, callback) { 6155 callback() 6156 }, this)) 6157 } 6158 } 6159}; 6160$(document).ready(function() { 6161 initSVGs() 6162}); 6163function insertSVGSprite(sTimeStamp) { 6164 var sTimeStampParam = ""; 6165 if (sTimeStamp != undefined) { 6166 sTimeStampParam = "?ts=" + sTimeStamp 6167 } 6168 var div = $('<div></div>'); 6169 $(div).attr('id', 'svgsprite'); 6170 $(div).hide(); 6171 document.body.insertBefore(div[0], document.body.childNodes[0]); 6172 $('#svgsprite').load('/sprite.svg' + sTimeStampParam) 6173} 6174function initSVGs() { 6175 if (typeof (oWebConfigData) != 'undefined' && oWebConfigData.lIconsVersion > 1 && oWebConfigData.sSvgUrl != '') { 6176 var div = $('<div></div>'); 6177 $(div).attr('id', 'svgsprite').hide(); 6178 document.body.insertBefore(div[0], document.body.childNodes[0]); 6179 $.ajax(oWebConfigData.sSvgUrl, { 6180 dataType: 'text', 6181 cache: true, 6182 success: function(data) { 6183 $('#svgsprite').html(data) 6184 } 6185 }) 6186 } 6187} 6188(function($) { 6189 $.fn.createSvg = function(sClassName) { 6190 var oSvgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); 6191 var oSvgUse = document.createElementNS('http://www.w3.org/2000/svg', 'use'); 6192 oSvgUse.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#" + sClassName); 6193 oSvgElement.appendChild(oSvgUse); 6194 $(oSvgElement).addClass("icon " + sClassName); 6195 this.append(oSvgElement) 6196 } 6197} 6198)(jQuery); 6199function SetCookie(sCookieName, sCookieValue, lTimeOutDays, bUseSubdomains) { 6200 var sDomain = ''; 6201 var aSplittedDomain = []; 6202 if (bUseSubdomains == true) { 6203 sDomain = window.location.host; 6204 aSplittedDomain = sDomain.split('.'); 6205 if (aSplittedDomain.length > 1) { 6206 sDomain = aSplittedDomain[aSplittedDomain.length - 2] + '.' + aSplittedDomain[aSplittedDomain.length - 1]; 6207 if (aSplittedDomain.length > 2) { 6208 if (aSplittedDomain[aSplittedDomain.length - 2] == 'bz' && aSplittedDomain[aSplittedDomain.length - 1] == 'it') { 6209 sDomain = aSplittedDomain[aSplittedDomain.length - 3] + '.' + aSplittedDomain[aSplittedDomain.length - 2] + '.' + aSplittedDomain[aSplittedDomain.length - 1] 6210 } 6211 } 6212 } 6213 } 6214 if (sDomain != '') { 6215 sDomain = 'domain=' + sDomain + ';' 6216 } 6217 sCookieName = '' + sCookieName; 6218 sCookieValue = '' + sCookieValue; 6219 if (sCookieName.substr(0, 5) == 'Page_') { 6220 var sCookie = ';' + document.cookie; 6221 if (sCookie.search(sCookieName + '=') >= 0 && sCookieName.length > 0) { 6222 document.cookie = sCookieName + '=;expires=' + new Date(new Date().getTime() - 1).toGMTString() + ';path=/;' 6223 }
6224 sCookieName = sCookieName.replace('Page_', 'Page%5F') 6225 } 6226 var sCookieString = ''; 6227 if (lTimeOutDays > 0) { 6228 var dtTime = new Date(); 6229 dtTime = new Date(dtTime.getTime() + 1000 * 60 * 60 * 24 * lTimeOutDays); 6230 sCookieString = sCookieName + '=' + UrlEncode(sCookieValue) + ';expires=' + dtTime.toGMTString() + ';path=/;' + sDomain 6231 } else { 6232 sCookieString = sCookieName + '=' + UrlEncode(sCookieValue) + ';path=/;' + sDomain 6233 } 6234 if (window.location.protocol === 'https:') { 6235 sCookieString += ';samesite=none;secure' 6236 } 6237 document.cookie = sCookieString 6238} 6239function GetCookie(sCookieName) { 6240 var sCookie = ';' + document.cookie; 6241 var sCookieValue = ''; 6242 if (sCookieName.substr(0, 5) == 'Page_') { 6243 if (sCookie.search(sCookieName + '=') >= 0 && sCookieName.length > 0) { 6244 document.cookie = sCookieName + '=;expires=' + new Date(new Date().getTime() - 1).toGMTString() + ';path=/;' 6245 } 6246 sCookieName = sCookieName.replace('Page_', 'Page%5F') 6247 } 6248 if (sCookie.search(sCookieName + '=') >= 0 && sCookieName.length > 0) { 6249 sCookieValue = sCookie.substr(sCookie.search(sCookieName + '=') + sCookieName.length + 1); 6250 if (sCookieValue.search(';') >= 0) { 6251 sCookieValue = sCookieValue.substr(0, sCookieValue.search(';')) 6252 } 6253 } else { 6254 sCookieValue = '' 6255 } 6256 return UrlDecode(sCookieValue) 6257} 6258function DeleteCookie(sCookieName, sDomain, sPath) { 6259 if (sDomain) { 6260 sDomain = '; domain=' + sDomain 6261 } else { 6262 sDomain = '' 6263 } 6264 var sPath = sPath || '/'; 6265 var dtTime = new Date(); 6266 dtTime = new Date(dtTime.getTime() - 1); 6267 if (sCookieName.substr(0, 5) == 'Page_') { 6268 document.cookie = sCookieName + '=;expires=' + dtTime.toGMTString() + sDomain + ';path=' + sPath + ';'; 6269 sCookieName = sCookieName.replace('Page_', 'Page%5F') 6270 } 6271 document.cookie = sCookieName + '=;expires=' + dtTime.toGMTString() + sDomain + ';path=' + sPath + ';' 6272} 6273(function($) { 6274 function responsiveHelper() { 6275 var lVersion = 'v1.1'; 6276 var _oHandlerCalls = { 6277 "devicemode:change": [], 6278 "resize:change": [] 6279 }; 6280 function _one(sType, call, param) { 6281 var oEvent = { 6282 nr: 0, 6283 call: call, 6284 bExec: false, 6285 param: param, 6286 stop: $.proxy(function() { 6287 _oHandlerCalls[sType].splice(oEvent.nr - 1, 1) 6288 }, this) 6289 }; 6290 oEvent.nr = _oHandlerCalls[sType].push(oEvent); 6291 return oEvent 6292 } 6293 function _on(sType, call, param) { 6294 var oEvent = { 6295 nr: 0, 6296 call: call, 6297 param: param, 6298 stop: $.proxy(function() { 6299 _oHandlerCalls[sType].splice(oEvent.nr - 1, 1) 6300 }, this) 6301 }; 6302 oEvent.nr = _oHandlerCalls[sType].push(oEvent); 6303 return oEvent 6304 } 6305 function _checkEvents() { 6306 $.each(_oHandlerCalls["resize:change"], function() { 6307 var param = this.param || {}; 6308 if (param.lMinWidth != undefined || param.lMaxWidth != undefined || param.lMinHeight != undefined || param.lMaxHeight != undefined) { 6309 if (_isValidRange(param.lMinWidth, param.lMaxWidth, param.lMinHeight, param.lMaxHeight, param.sOperator)) { 6310 if (this.bExec == undefined) { 6311 this.call(this, param) 6312 } else if (this.bExec == false) { 6313 this.bExec = true; 6314 this.call(this, param) 6315 } 6316 } else if (this.bExec != undefined) { 6317 this.bExec = false 6318 } 6319 } else { 6320 this.call(this, param) 6321 } 6322 }) 6323 } 6324 function _fire(sType, param, bForce) { 6325 $.each(_oHandlerCalls[sType], function() { 6326 var oEventParam = this.param || {}; 6327 if (param == undefined) { 6328 param = oEventParam 6329 } 6330 if (oEventParam.lMinWidth != undefined || oEventParam.lMaxWidth != undefined || oEventParam.lMinHeight != undefined || oEventParam.lMaxHeight != undefined) { 6331 if (_isValidRange(oEventParam.lMinWidth, oEventParam.lMaxWidth, oEventParam.lMinHeight, oEventParam.lMaxHeight, oEventParam.sOperator)) { 6332 if (this.bExec == undefined || bForce) { 6333 this.call(this, param) 6334 } else if (this.bExec == false) { 6335 this.bExec = true; 6336 this.call(this, param) 6337 } 6338 } 6339 } else { 6340 this.call(this, param) 6341 } 6342 }) 6343 } 6344 function _isValidRange(lMinWidth, lMaxWidth, lMinHeight, lMaxHeight, sOperator) { 6345 if (!$.isNumeric(lMinWidth)) { 6346 lMinWidth = 0 6347 } 6348 if (!$.isNumeric(lMaxWidth)) { 6349 lMaxWidth = 0 6350 } 6351 if (!$.isNumeric(lMinHeight)) { 6352 lMinHeight = 0 6353 } 6354 if (!$.isNumeric(lMaxHeight)) { 6355 lMaxHeight = 0 6356 } 6357 if (typeof sOperator != "string") { 6358 sOperator = 'or' 6359 }
6360 var bWidth = false; 6361 var bHeight = false; 6362 if (window.matchMedia != undefined) { 6363 if (lMinWidth != 0 && lMaxWidth != 0) { 6364 bWidth = window.matchMedia('(min-width: ' + lMinWidth + 'px) and (max-width: ' + lMaxWidth + 'px)').matches 6365 } else if (lMinWidth != 0 && lMaxWidth == 0) { 6366 bWidth = window.matchMedia('(min-width: ' + lMinWidth + 'px)').matches 6367 } else if (lMinWidth == 0 && lMaxWidth != 0) { 6368 bWidth = window.matchMedia('(max-width: ' + lMaxWidth + 'px)').matches 6369 } 6370 if (lMinHeight != 0 && lMaxHeight != 0) { 6371 bHeight = window.matchMedia('(min-height: ' + lMinHeight + 'px) and (max-height: ' + lMaxHeight + 'px)').matches 6372 } else if (lMinHeight != 0 && lMaxHeight == 0) { 6373 bHeight = window.matchMedia('(min-height: ' + lMinHeight + 'px)').matches 6374 } else if (lMinHeight == 0 && lMaxHeight != 0) { 6375 bHeight = window.matchMedia('(max-height: ' + lMaxHeight + 'px)').matches 6376 } 6377 } else { 6378 var lWindowWidth = window.innerWidth || $(window).width(); 6379 if (lMinWidth != 0 && lMaxWidth != 0 && lWindowWidth >= lMinWidth && lWindowWidth <= lMaxWidth) { 6380 bWidth = true 6381 } else if (lMinWidth != 0 && lMaxWidth == 0 && lWindowWidth >= lMinWidth) { 6382 bWidth = true 6383 } else if (lMinWidth == 0 && lMaxWidth != 0 && lWindowWidth <= lMaxWidth) { 6384 bWidth = true 6385 } 6386 var lWindowHeight = window.innerHeight || $(window).height(); 6387 if (lMinHeight != 0 && lMaxHeight != 0 && lWindowHeight >= lMinHeight && lWindowHeight <= lMaxHeight) { 6388 bHeight = true 6389 } else if (lMinHeight != 0 && lMaxHeight == 0 && lWindowHeight >= lMinHeight) { 6390 bHeight = true 6391 } else if (lMinHeight == 0 && lMaxHeight != 0 && lWindowHeight <= lMaxHeight) { 6392 bHeight = true 6393 } 6394 } 6395 if (sOperator == 'or') { 6396 return bWidth || bHeight 6397 } else { 6398 return bWidth && bHeight 6399 } 6400 } 6401 this.on = function(sType, call, param) { 6402 return $.proxy(_on, this)(sType, call, param) 6403 } 6404 ; 6405 this.one = function(sType, call, param) { 6406 return $.proxy(_one, this)(sType, call, param) 6407 } 6408 ; 6409 this.fire = function(sType, param, bForce) { 6410 $.proxy(_fire, this)(sType, param, bForce) 6411 } 6412 ; 6413 this.isValidRange = function(lMinWidth, lMaxWidth, lMinHeight, lMaxHeight, sOperator) { 6414 return $.proxy(_isValidRange, this)(lMinWidth, lMaxWidth, lMinHeight, lMaxHeight, sOperator) 6415 } 6416 ; 6417 $(document).ready($.proxy(function() { 6418 $.proxy(_checkEvents, this)(); 6419 $(window).off("resize.resphelper").on("resize.resphelper", $.proxy(function() { 6420 $.proxy(_checkEvents, this)() 6421 }, this)) 6422 }, this)); 6423 return this 6424 } 6425 $.responsiveHelper = function() { 6426 var oResponsiveHelper = new responsiveHelper(); 6427 return oResponsiveHelper 6428 } 6429}(jQuery)); 6430var RespHelper = $.responsiveHelper(); 6431(function($) { 6432 $.fn.objectFit = function(sType, bUseCssObjectFit) { 6433 var sFitType = sType || 'cover'; 6434 var bIsObjectFitSupported; 6435 if ($(document.body).data('bIsObjectFitSupported') == undefined) { 6436 bIsObjectFitSupported = detectCSSFeature('object-fit'); 6437 $(document.body).data('bIsObjectFitSupported', bIsObjectFitSupported) 6438 } else { 6439 bIsObjectFitSupported = $(document.body).data('bIsObjectFitSupported') 6440 } 6441 if (typeof (bUseCssObjectFit) != 'boolean') { 6442 bUseCssObjectFit = bIsObjectFitSupported 6443 } else { 6444 bUseCssObjectFit = bUseCssObjectFit && bIsObjectFitSupported 6445 } 6446 this.each(function(i, o) { 6447 o = $(o); 6448 var oObject = $('img', o); 6449 if (!oObject.length) { 6450 if (o.is('video')) { 6451 oObject = o 6452 } else { 6453 oObject = $('video', o) 6454 } 6455 } 6456 if (!oObject.length) 6457 return true; 6458 if (o.data('bUseCssObjectFit') != undefined) { 6459 bUseCssObjectFit = o.data('bUseCssObjectFit') 6460 } else { 6461 o.data('bUseCssObjectFit', bUseCssObjectFit) 6462 } 6463 var lMinWidth = o.attr('data-object-fit-min-width') || 0; 6464 var lMinHeight = o.attr('data-object-fit-min-height') || 0; 6465 var bReset = false;
6466 if (window.matchMedia != undefined) { 6467 if (window.matchMedia('(max-width: ' + lMinWidth + 'px), (max-height: ' + lMinHeight + 'px)').matches) { 6468 bReset = true 6469 } 6470 } else { 6471 if ((window.innerWidth || $(window).width()) <= lMinWidth || (window.innerHeight || $(window).height()) <= lMinHeight) { 6472 bReset = true 6473 } 6474 } 6475 if (bReset) { 6476 o.removeClass('objectfit-cover'); 6477 oObject.css({ 6478 'width': '', 6479 'height': '', 6480 'left': '', 6481 'top': '', 6482 'object-fit': '' 6483 }); 6484 return true 6485 } 6486 var lObjectRatio = parseFloat(oObject.data('lObjectRatio'), 10) || 0; 6487 if (lObjectRatio == 0) { 6488 var element = oObject[0]; 6489 if (oObject.is('img')) { 6490 if (oObject.data('bObjectRatioCalc') == true) 6491 return; 6492 oObject.data('bObjectRatioCalc', true); 6493 var bImageRatio = false; 6494 var oPicture = oObject.parent('picture'); 6495 if (oPicture.length) { 6496 bImageRatio = oPicture.attr('data-imageratio-x') != undefined && oPicture.attr('data-imageratio-y') != undefined 6497 } 6498 if (bImageRatio) { 6499 lObjectRatio = parseFloat(oPicture.attr('data-imageratio-y'), 10) / parseFloat(oPicture.attr('data-imageratio-x'), 10); 6500 oObject.data('lObjectRatio', lObjectRatio); 6501 addObjectFitCover(o, oObject, bUseCssObjectFit, lObjectRatio) 6502 } else { 6503 if (element.complete) { 6504 lObjectRatio = element.height / element.width; 6505 oObject.data('lObjectRatio', lObjectRatio); 6506 addObjectFitCover(o, oObject, bUseCssObjectFit, lObjectRatio) 6507 } else { 6508 element.onload = function() { 6509 lObjectRatio = element.height / element.width; 6510 oObject.data('lObjectRatio', lObjectRatio); 6511 addObjectFitCover(o, oObject, bUseCssObjectFit, lObjectRatio) 6512 } 6513 } 6514 } 6515 } else { 6516 if (oObject.data('bObjectRatioCalc') == true) 6517 return; 6518 lObjectRatio = element.videoHeight / element.videoWidth; 6519 if (isNaN(lObjectRatio)) 6520 return true; 6521 oObject.data('bObjectRatioCalc', true); 6522 oObject.data('lObjectRatio', lObjectRatio); 6523 addObjectFitCover(o, oObject, bUseCssObjectFit, lObjectRatio) 6524 } 6525 } else { 6526 addObjectFitCover(o, oObject, bUseCssObjectFit, lObjectRatio) 6527 } 6528 }); 6529 function addObjectFitCover(o, oObject, bUseCssObjectFit, lObjectRatio) { 6530 if (sFitType == 'cover') { 6531 if (bUseCssObjectFit) { 6532 o.addClass('objectfit-cover'); 6533 oObject.css({ 6534 'object-fit': 'cover' 6535 }) 6536 } else { 6537 oObject.css({ 6538 'width': '', 6539 'height': '', 6540 'left': '', 6541 'top': '' 6542 }); 6543 var oRatio = getContainerRatio(o); 6544 if (oRatio) { 6545 var lContainerWidth = oRatio.width; 6546 var lContainerHeight = oRatio.height; 6547 var lContainerRatio = oRatio.ratio; 6548 var lWidth = 0; 6549 var lHeight = 0; 6550 if (lContainerRatio > lObjectRatio) { 6551 lHeight = lContainerHeight; 6552 lWidth = lContainerHeight / lObjectRatio 6553 } else { 6554 lHeight = lContainerWidth * lObjectRatio; 6555 lWidth = lContainerWidth 6556 } 6557 oObject.css({ 6558 'width': lWidth, 6559 'height': lHeight, 6560 'left': (lContainerWidth - lWidth) / 2, 6561 'top': (lContainerHeight - lHeight) / 2 6562 }) 6563 } 6564 } 6565 } 6566 } 6567 function getContainerRatio(oContainer) { 6568 if (!oContainer.parents('html').length) 6569 return null; 6570 displayType = oContainer.css('display'); 6571 if ((displayType == 'block' || displayType == '-webkit-box') && oContainer.width() > 0 && oContainer.height() > 0 && oContainer.is(':visible')) { 6572 return { 6573 obj: oContainer, 6574 width: oContainer.width(), 6575 height: oContainer.height(), 6576 ratio: (oContainer.height() / oContainer.width()) 6577 } 6578 } else { 6579 return getContainerRatio(oContainer.parent()) 6580 } 6581 } 6582 function detectCSSFeature(sFeatureName) { 6583 var bFeature = false;
6584 var aDomPrefixes = 'Webkit Moz ms O'.split(' '); 6585 var oBody = document.body; 6586 var sFeatureNameCapital; 6587 sFeatureName = sFeatureName.toLowerCase(); 6588 if (oBody.style[sFeatureName] !== undefined) { 6589 bFeature = true 6590 } 6591 if (bFeature === false) { 6592 sFeatureNameCapital = sFeatureName.charAt(0).toUpperCase() + sFeatureName.substr(1); 6593 for (var i = 0; i < aDomPrefixes.length; i++) { 6594 if (oBody.style[aDomPrefixes[i] + sFeatureNameCapital] !== undefined) { 6595 bFeature = true; 6596 break 6597 } 6598 } 6599 } 6600 return bFeature 6601 } 6602 } 6603} 6604)(jQuery); 6605(function(root, factory) { 6606 if (typeof define === 'function' && define.amd) { 6607 define(['jquery'], function(a0) { 6608 return (factory(a0)) 6609 }) 6610 } else if (typeof exports === 'object') { 6611 module.exports = factory(require('jquery')) 6612 } else { 6613 factory(root["jQuery"]) 6614 } 6615}(this, function($) { 6616 (function() { 6617 'use strict'; 6618 var defaults = { 6619 mode: 'lg-slide', 6620 cssEasing: 'ease', 6621 easing: 'linear', 6622 speed: 600, 6623 height: '100%', 6624 width: '100%', 6625 addClass: '', 6626 startClass: 'lg-start-zoom', 6627 backdropDuration: 150, 6628 hideBarsDelay: 6000, 6629 useLeft: false, 6630 closable: true, 6631 loop: true, 6632 escKey: true, 6633 keyPress: true, 6634 controls: true, 6635 slideEndAnimatoin: true, 6636 hideControlOnEnd: false, 6637 mousewheel: true, 6638 getCaptionFromTitleOrAlt: false, 6639 appendSubHtmlTo: '.lg-sub-html', 6640 subHtmlSelectorRelative: false, 6641 preload: 1, 6642 showAfterLoad: true, 6643 selector: '', 6644 selectWithin: '', 6645 nextHtml: '', 6646 prevHtml: '', 6647 index: false, 6648 iframeMaxWidth: '100%', 6649 download: true, 6650 counter: true, 6651 appendCounterTo: '.lg-toolbar', 6652 swipeThreshold: 50, 6653 enableSwipe: true, 6654 enableDrag: true, 6655 dynamic: false, 6656 dynamicEl: [], 6657 galleryId: 1 6658 }; 6659 function Plugin(element, options) { 6660 this.el = element; 6661 this.$el = $(element); 6662 this.s = $.extend({}, defaults, options); 6663 if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) { 6664 throw ('When using dynamic mode, you must also define dynamicEl as an Array.') 6665 } 6666 this.modules = {}; 6667 this.lGalleryOn = false; 6668 this.lgBusy = false; 6669 this.hideBartimeout = false; 6670 this.isTouch = ('ontouchstart'in document.documentElement); 6671 if (this.s.slideEndAnimatoin) { 6672 this.s.hideControlOnEnd = false 6673 } 6674 if (this.s.dynamic) { 6675 this.$items = this.s.dynamicEl 6676 } else { 6677 if (this.s.selector === 'this') { 6678 this.$items = this.$el 6679 } else if (this.s.selector !== '') { 6680 if (this.s.selectWithin) { 6681 this.$items = $(this.s.selectWithin).find(this.s.selector) 6682 } else { 6683 this.$items = this.$el.find($(this.s.selector)) 6684 } 6685 } else { 6686 this.$items = this.$el.children() 6687 } 6688 } 6689 this.$removeItems = Array(); 6690 var removeItemsCount = 0; 6691 if (this.$items.length > 0) { 6692 for (var i = 0; i < this.$items.length; i++) { 6693 var galleryElement = this.$items[i]; 6694 if ($(galleryElement).parents('.owl-item.cloned').length > 0) { 6695 this.$removeItems[removeItemsCount] = galleryElement; 6696 removeItemsCount++ 6697 } 6698 } 6699 } 6700 if (this.$removeItems.length > 0) { 6701 for (var i = 0; i < this.$removeItems.length; i++) { 6702 this.$items.splice($.inArray(this.$removeItems[i], this.$items), 1) 6703 } 6704 } 6705 this.$slide = ''; 6706 this.$outer = ''; 6707 this.init(); 6708 return this 6709 } 6710 Plugin.prototype.init = function() { 6711 var _this = this; 6712 if (_this.s.preload > _this.$items.length) { 6713 _this.s.preload = _this.$items.length 6714 } 6715 var _hash = window.location.hash; 6716 if (_hash.indexOf('lg=' + this.s.galleryId) > 0) { 6717 _this.index = parseInt(_hash.split('&slide=')[1], 10); 6718 $('body').addClass('lg-from-hash'); 6719 if (!$('body').hasClass('lg-on')) { 6720 setTimeout(function() { 6721 _this.build(_this.index) 6722 }); 6723 $('body').addClass('lg-on') 6724 } 6725 } 6726 if (_this.s.dynamic) { 6727 _this.$el.trigger('onBeforeOpen.lg'); 6728 _this.index = _this.s.index || 0; 6729 if (!$('body').hasClass('lg-on')) { 6730 setTimeout(function() { 6731 _this.build(_this.index); 6732 $('body').addClass('lg-on') 6733 }) 6734 } 6735 } else { 6736 _this.$items.on('click.lgcustom', function(event) { 6737 try { 6738 event.preventDefault(); 6739 event.preventDefault() 6740 } catch (er) { 6741 event.returnValue = false 6742 } 6743 _this.$el.trigger('onBeforeOpen.lg'); 6744 _this.index = _this.s.index || _this.$items.index(this); 6745 if (!$('body').hasClass('lg-on')) { 6746 _this.build(_this.index); 6747 $('body').addClass('lg-on') 6748 } 6749 }); 6750 if (_this.$removeItems.length) { 6751 $.each(_this.$removeItems, function() { 6752 $(this).on('click.lgcustom', function() {
6753 var oThis = this; 6754 $(_this.$items).each(function() { 6755 var bFound = false; 6756 if ($(oThis).attr('data-html') != undefined && $(oThis).attr('data-html') == $(this).attr('data-html')) { 6757 bFound = true 6758 } else if ($(oThis).attr('data-src') != undefined && $(oThis).attr('data-src') == $(this).attr('data-src')) { 6759 bFound = true 6760 } 6761 if (bFound) { 6762 $(this).trigger('click'); 6763 return false 6764 } 6765 }) 6766 }) 6767 }) 6768 } 6769 } 6770 } 6771 ; 6772 Plugin.prototype.build = function(index) { 6773 var _this = this; 6774 _this.structure(); 6775 $.each($.fn.lightGallery.modules, function(key) { 6776 _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el) 6777 }); 6778 _this.slide(index, false, false, false); 6779 if (_this.s.keyPress) { 6780 _this.keyPress() 6781 } 6782 if (_this.$items.length > 1) { 6783 _this.arrow(); 6784 setTimeout(function() { 6785 _this.enableDrag(); 6786 _this.enableSwipe() 6787 }, 50); 6788 if (_this.s.mousewheel) { 6789 _this.mousewheel() 6790 } 6791 } else { 6792 _this.$slide.on('click.lg', function() { 6793 _this.$el.trigger('onSlideClick.lg') 6794 }) 6795 } 6796 _this.counter(); 6797 _this.closeGallery(); 6798 _this.$el.trigger('onAfterOpen.lg'); 6799 _this.$outer.on('mousemove.lg click.lg touchstart.lg', function() { 6800 _this.$outer.removeClass('lg-hide-items'); 6801 clearTimeout(_this.hideBartimeout); 6802 _this.hideBartimeout = setTimeout(function() { 6803 _this.$outer.addClass('lg-hide-items') 6804 }, _this.s.hideBarsDelay) 6805 }); 6806 _this.$outer.trigger('mousemove.lg') 6807 } 6808 ; 6809 Plugin.prototype.structure = function() { 6810 var list = ''; 6811 var controls = ''; 6812 var i = 0; 6813 var subHtmlCont = ''; 6814 var template; 6815 var _this = this; 6816 $('body').append('<div class="lg-backdrop"></div>'); 6817 $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms'); 6818 for (i = 0; i < this.$items.length; i++) { 6819 list += '<div class="lg-item"><span class="picture-loading"></span></div>' 6820 } 6821 if (this.s.controls && this.$items.length > 1) { 6822 controls = '<div class="lg-actions">' + '<button class="lg-prev lg-icon">' + this.s.prevHtml + '</button>' + '<button class="lg-next lg-icon">' + this.s.nextHtml + '</button>' + '</div>' 6823 } 6824 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 6825 subHtmlCont = '<div class="lg-sub-html"></div>' 6826 } 6827 template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' + '<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' + '<div class="lg-inner">' + list + '</div>' + '<div class="lg-toolbar lg-group">' + '<span class="lg-close lg-icon"><svg class="icon icon-cross" xmlns:xlink="http://www.w3.org/1999/xlink"><use xlink:href="#icon-cross" /></svg></span>' + '</div>' + controls + subHtmlCont + '</div>' + '</div>'; 6828 $('body').append(template); 6829 this.$outer = $('.lg-outer'); 6830 this.$slide = this.$outer.find('.lg-item'); 6831 if (this.s.useLeft) { 6832 this.$outer.addClass('lg-use-left'); 6833 this.s.mode = 'lg-slide' 6834 } else { 6835 this.$outer.addClass('lg-use-css3') 6836 } 6837 _this.setTop(); 6838 $(window).on('resize.lg orientationchange.lg', function() { 6839 setTimeout(function() { 6840 _this.setTop() 6841 }, 100) 6842 }); 6843 this.$slide.eq(this.index).addClass('lg-current'); 6844 if (this.doCss()) { 6845 this.$outer.addClass('lg-css3') 6846 } else { 6847 this.$outer.addClass('lg-css'); 6848 this.s.speed = 0 6849 } 6850 this.$outer.addClass(this.s.mode); 6851 if (this.s.enableDrag && this.$items.length > 1) { 6852 this.$outer.addClass('lg-grab') 6853 } 6854 if (this.s.showAfterLoad) { 6855 this.$outer.addClass('lg-show-after-load') 6856 } 6857 if (this.doCss()) { 6858 var $inner = this.$outer.find('.lg-inner'); 6859 $inner.css('transition-timing-function', this.s.cssEasing); 6860 $inner.css('transition-duration', this.s.speed + 'ms') 6861 } 6862 setTimeout(function() { 6863 $('.lg-backdrop').addClass('in') 6864 }); 6865 setTimeout(function() { 6866 _this.$outer.addClass('lg-visible') 6867 }, this.s.backdropDuration); 6868 if (this.s.download) { 6869 this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"><svg class="icon icon-download" xmlns:xlink="http://www.w3.org/1999/xlink"><use xlink:href="#icon-download" /></svg></a>') 6870 } 6871 this.prevScrollTop = $(window).scrollTop() 6872 } 6873 ; 6874 Plugin.prototype.setTop = function() { 6875 if (this.s.height !== '100%') { 6876 var wH = $(window).height(); 6877 var top = (wH - parseInt(this.s.height, 10)) / 2; 6878 var $lGallery = this.$outer.find('.lg'); 6879 if (wH >= parseInt(this.s.height, 10)) { 6880 $lGallery.css('top', top + 'px') 6881 } else { 6882 $lGallery.css('top', '0px') 6883 } 6884 } 6885 } 6886 ; 6887 Plugin.prototype.doCss = function() { 6888 var support = function() { 6889 var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; 6890 var root = document.documentElement; 6891 var i = 0; 6892 for (i = 0; i < transition.length; i++) { 6893 if (transition[i]in root.style) { 6894 return true 6895 } 6896 } 6897 }; 6898 if (support()) { 6899 return true 6900 } 6901 return false 6902 } 6903 ; 6904 Plugin.prototype.isVideo = function(src, index) { 6905 var html; 6906 if (this.s.dynamic) { 6907 html = this.s.dynamicEl[index].html 6908 } else { 6909 html = this.$items.eq(index).attr('data-html') 6910 } 6911 if (!src) { 6912 if (html) { 6913 if ($(html).find('video')[0] != undefined) { 6914 return { 6915 html5: true 6916 } 6917 } else { 6918 return false 6919 } 6920 } else { 6921 console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html'); 6922 return false 6923 } 6924 } 6925 var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); 6926 var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); 6927 var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i); 6928 var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i); 6929 if (youtube) { 6930 return { 6931 youtube: youtube 6932 } 6933 } else if (vimeo) { 6934 return { 6935 vimeo: vimeo 6936 } 6937 } else if (dailymotion) { 6938 return { 6939 dailymotion: dailymotion 6940 } 6941 } else if (vk) { 6942 return { 6943 vk: vk 6944 } 6945 } 6946 } 6947 ; 6948 Plugin.prototype.counter = function() { 6949 if (this.s.counter) { 6950 $(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>') 6951 } 6952 } 6953 ; 6954 Plugin.prototype.initVideos = function() { 6955 this.$slide.eq(this.index).find('video').each($.proxy(function(i, video) { 6956 if (typeof (video.play) == 'function') { 6957 if ($(video).attr('data-autoplay') == 'true') { 6958 if (video.readyState == 4) { 6959 video.play(); 6960 this.checkVideoControls(video) 6961 } else { 6962 video.onloadeddata = $.proxy(function() { 6963 video.play(); 6964 this.checkVideoControls(video) 6965 }, this) 6966 } 6967 } 6968 } 6969 }, this)); 6970 this.$slide.eq(this.index).find('iframe[src*="youtube.com/"][src*="enablejsapi=1"], iframe[src*="youtu.be/"][src*="enablejsapi=1"]').each($.proxy(function(i, video) { 6971 if (typeof (YT) == 'undefined') { 6972 var tag = document.createElement('script'); 6973 tag.src = "https://www.youtube.com/iframe_api"; 6974 var youtubeiframe = document.getElementsByTagName('script')[0]; 6975 youtubeiframe.parentNode.insertBefore(tag, youtubeiframe) 6976 }
6977 if ($(video).data('youtubeplayer') == undefined) { 6978 var lYoutubeInterval = window.setInterval($.proxy(function() { 6979 if (typeof (YT) != 'undefined' && typeof (YT.Player) != 'undefined') { 6980 clearInterval(lYoutubeInterval); 6981 if ($(video).data('youtubeplayer-initialized') != undefined) 6982 return; 6983 $(video).data('youtubeplayer-initialized', true); 6984 var onPlayerReady = function() { 6985 if ($(video).attr('src').indexOf('&mute=1') > -1) 6986 $(video).data('youtubeplayer').mute(); 6987 if ($(video).attr('data-autoplay') == 'true') 6988 $(video).data('youtubeplayer').playVideo() 6989 }; 6990 $(video).data('youtubeplayer', new YT.Player(video,{ 6991 events: { 6992 'onReady': onPlayerReady 6993 } 6994 })) 6995 } 6996 }, this), 1000) 6997 } else { 6998 if ($(video).attr('data-autoplay') == 'true') { 6999 $(video).data('youtubeplayer').playVideo() 7000 } 7001 } 7002 }, this)) 7003 } 7004 ; 7005 Plugin.prototype.checkVideoControls = function(video) { 7006 if ($(video).closest('div').find('div.video-controls').length) { 7007 if (video.paused) { 7008 $(video).closest('div').find('div.video-controls').addClass('paused'); 7009 $(video).closest('div').find('div.video-controls').removeClass('playing') 7010 } else { 7011 $(video).closest('div').find('div.video-controls').addClass('playing'); 7012 $(video).closest('div').find('div.video-controls').removeClass('paused') 7013 } 7014 } 7015 } 7016 ; 7017 Plugin.prototype.addHtml = function(index) { 7018 var subHtml = null; 7019 var subHtmlUrl; 7020 var $currentEle; 7021 if (this.s.dynamic) { 7022 if (this.s.dynamicEl[index].subHtmlUrl) { 7023 subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl 7024 } else { 7025 subHtml = this.s.dynamicEl[index].subHtml 7026 } 7027 } else { 7028 $currentEle = this.$items.eq(index); 7029 if ($currentEle.attr('data-sub-html-url')) { 7030 subHtmlUrl = $currentEle.attr('data-sub-html-url') 7031 } else { 7032 subHtml = $currentEle.attr('data-sub-html'); 7033 if (this.s.getCaptionFromTitleOrAlt && !subHtml) { 7034 subHtml = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt') 7035 } 7036 } 7037 } 7038 if (!subHtmlUrl) { 7039 if (typeof subHtml !== 'undefined' && subHtml !== null) { 7040 var fL = subHtml.substring(0, 1); 7041 if (fL === '.' || fL === '#') { 7042 if (this.s.subHtmlSelectorRelative && !this.s.dynamic) { 7043 subHtml = $currentEle.find(subHtml).html() 7044 } else { 7045 subHtml = $(subHtml).html() 7046 } 7047 } 7048 } else { 7049 subHtml = '' 7050 } 7051 } 7052 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 7053 if (subHtmlUrl) { 7054 this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl) 7055 } else { 7056 this.$outer.find(this.s.appendSubHtmlTo).html(subHtml) 7057 } 7058 } else { 7059 if (subHtmlUrl) { 7060 this.$slide.eq(index).load(subHtmlUrl) 7061 } else { 7062 this.$slide.eq(index).append(subHtml) 7063 } 7064 } 7065 if (typeof subHtml !== 'undefined' && subHtml !== null) { 7066 if (subHtml === '') { 7067 this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html') 7068 } else { 7069 this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html') 7070 } 7071 } 7072 this.$el.trigger('onAfterAppendSubHtml.lg', [index]) 7073 } 7074 ; 7075 Plugin.prototype.preload = function(index) { 7076 var i = 1; 7077 var j = 1; 7078 for (i = 1; i <= this.s.preload; i++) { 7079 if (i >= this.$items.length - index) { 7080 break 7081 } 7082 this.loadContent(index + i, false, 0) 7083 } 7084 for (j = 1; j <= this.s.preload; j++) { 7085 if (index - j < 0) { 7086 break 7087 } 7088 this.loadContent(index - j, false, 0) 7089 } 7090 } 7091 ; 7092 Plugin.prototype.loadContent = function(index, rec, delay) { 7093 var _this = this; 7094 var _hasPoster = false;
7095 var _$img; 7096 var _src; 7097 var _poster; 7098 var _srcset; 7099 var _sizes; 7100 var _html; 7101 var getResponsiveSrc = function(srcItms) { 7102 var rsWidth = []; 7103 var rsSrc = []; 7104 for (var i = 0; i < srcItms.length; i++) { 7105 var __src = srcItms[i].split(' '); 7106 if (__src[0] === '') { 7107 __src.splice(0, 1) 7108 } 7109 rsSrc.push(__src[0]); 7110 rsWidth.push(__src[1]) 7111 } 7112 var wWidth = $(window).width(); 7113 for (var j = 0; j < rsWidth.length; j++) { 7114 if (parseInt(rsWidth[j], 10) > wWidth) { 7115 _src = rsSrc[j]; 7116 break 7117 } 7118 } 7119 }; 7120 if (_this.s.dynamic) { 7121 if (_this.s.dynamicEl[index].poster) { 7122 _hasPoster = true; 7123 _poster = _this.s.dynamicEl[index].poster 7124 } 7125 _html = _this.s.dynamicEl[index].html; 7126 _src = _this.s.dynamicEl[index].src; 7127 if (_this.s.dynamicEl[index].responsive) { 7128 var srcDyItms = _this.s.dynamicEl[index].responsive.split(','); 7129 getResponsiveSrc(srcDyItms) 7130 } 7131 _srcset = _this.s.dynamicEl[index].srcset; 7132 _sizes = _this.s.dynamicEl[index].sizes 7133 } else { 7134 if (_this.$items.eq(index).attr('data-poster')) { 7135 _hasPoster = true; 7136 _poster = _this.$items.eq(index).attr('data-poster') 7137 } 7138 _html = _this.$items.eq(index).attr('data-html'); 7139 _src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'); 7140 if (_this.$items.eq(index).attr('data-responsive')) { 7141 var srcItms = _this.$items.eq(index).attr('data-responsive').split(','); 7142 getResponsiveSrc(srcItms) 7143 } 7144 _srcset = _this.$items.eq(index).attr('data-srcset'); 7145 _sizes = _this.$items.eq(index).attr('data-sizes') 7146 } 7147 var iframe = false; 7148 if (_this.s.dynamic) { 7149 if (_this.s.dynamicEl[index].iframe) { 7150 iframe = true 7151 } 7152 } else { 7153 if (_this.$items.eq(index).attr('data-iframe') === 'true') { 7154 iframe = true 7155 } 7156 } 7157 var ajax = false; 7158 var ajaxparams = {}; 7159 if (_this.s.dynamic) { 7160 if (_this.s.dynamicEl[index].ajax) { 7161 ajax = true 7162 } 7163 if (_this.s.dynamicEl[index].ajaxparams) { 7164 ajaxparams = _this.s.dynamicEl[index].ajaxparams 7165 } 7166 } else { 7167 if (_this.$items.eq(index).attr('data-lightgallery-ajax') === 'true') { 7168 ajax = true 7169 } 7170 if (_this.$items.eq(index).attr('data-lightgallery-ajaxparams')) { 7171 ajaxparams = jQuery.parseJSON(_this.$items.eq(index).attr('data-lightgallery-ajaxparams')) 7172 } 7173 } 7174 if (ajax) { 7175 var ua = window.navigator.userAgent; 7176 var msie = ua.indexOf("MSIE "); 7177 $.ajax(msie > 0 ? encodeURI(_src) : _src, { 7178 data: ajaxparams, 7179 type: "GET", 7180 success: function(data) { 7181 _this.$slide.eq(index).prepend('<div class="lg-img-wrap lg-ajax-wrap"><div class="lg-object lg-ajax">' + data + '</div></div>'); 7182 var _speed = 0; 7183 if (delay && !$('body').hasClass('lg-from-hash')) { 7184 _speed = delay 7185 } 7186 setTimeout(function() { 7187 _this.$slide.eq(index).addClass('lg-complete'); 7188 _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]) 7189 }, _speed); 7190 var bCarousel = false;
7191 setTimeout(function() { 7192 $('[data-carousel="true"]', $('div.lg-ajax')).each(function(lIndex, oElement) { 7193 initCarousel(this); 7194 $('.lg-outer').addClass('lg-loadingcomplete'); 7195 bCarousel = true 7196 }); 7197 if (!bCarousel) { 7198 $('.lg-outer').addClass('lg-loadingcomplete') 7199 } 7200 $('video[data-resize="true"]', $('div.lg-video')).convertVideo(); 7201 _this.initVideos() 7202 }, _speed) 7203 } 7204 }) 7205 } 7206 var _isVideo = _this.isVideo(_src, index); 7207 if (!_this.$slide.eq(index).hasClass('lg-loaded')) { 7208 if (iframe) { 7209 _this.$slide.eq(index).prepend('<div class="lg-video-cont lg-has-iframe" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '" allow="autoplay; encrypted-media; picture-in-picture" allowfullscreen="true"></iframe></div></div>') 7210 } else if (_hasPoster && _isVideo && _isVideo.html5 && _this.$items.eq(index).attr('data-instant-video') === 'true') { 7211 _this.$slide.eq(index).prepend('<div class="lg-video-cont lg-has-html5"><div class="lg-video">' + $(_html).html() + '</div></div>'); 7212 _this.$slide.eq(index).find('video').attr('data-autoplay', 'true') 7213 } else if (_hasPoster) { 7214 var videoClass = ''; 7215 if (_isVideo && _isVideo.youtube) { 7216 videoClass = 'lg-has-youtube' 7217 } else if (_isVideo && _isVideo.vimeo) { 7218 videoClass = 'lg-has-vimeo' 7219 } else { 7220 videoClass = 'lg-has-html5' 7221 } 7222 _this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"><svg class="icon icon-play" xmlns:xlink="http://www.w3.org/1999/xlink"><use xlink:href="#icon-play" /></svg></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>') 7223 } else if (_isVideo) { 7224 _this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>'); 7225 _this.$el.trigger('hasVideo.lg', [index, _src, _html]) 7226 } else { 7227 if (!ajax) { 7228 if ($(_html)[0] != undefined) { 7229 _this.$slide.eq(index).prepend('<div class="lg-img-wrap lg-ajax-wrap"><div class="lg-object lg-ajax">' + $(_html).html() + '</div></div>') 7230 } else { 7231 _this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>') 7232 } 7233 } 7234 } 7235 _this.$el.trigger('onAferAppendSlide.lg', [index]); 7236 _$img = _this.$slide.eq(index).find('.lg-object'); 7237 if (_sizes) { 7238 _$img.attr('sizes', _sizes) 7239 } 7240 if (_srcset) { 7241 _$img.attr('srcset', _srcset); 7242 try { 7243 picturefill({ 7244 elements: [_$img[0]] 7245 }) 7246 } catch (e) { 7247 console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.') 7248 } 7249 } 7250 if (this.s.appendSubHtmlTo !== '.lg-sub-html') { 7251 _this.addHtml(index) 7252 } 7253 _this.$slide.eq(index).addClass('lg-loaded') 7254 } 7255 _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { 7256 var _speed = 0; 7257 if (delay && !$('body').hasClass('lg-from-hash')) { 7258 _speed = delay 7259 } 7260 setTimeout(function() { 7261 _this.$slide.eq(index).addClass('lg-complete'); 7262 _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]) 7263 }, _speed); 7264 if ($(_html)[0] != undefined) { 7265 setTimeout(function() { 7266 $('[data-lightgallery-carousel="true"]', $('div.lg-ajax')).each(function(lIndex, oElement) { 7267 initCarousel(this) 7268 }); 7269 $('video[data-resize="true"]', $('div.lg-video')).convertVideo(); 7270 _this.initVideos() 7271 }, _speed + 300) 7272 } 7273 }); 7274 if ($(_html)[0] != undefined) { 7275 _this.$slide.eq(index).find('.lg-object').trigger('load.lg') 7276 } 7277 if (_isVideo && _isVideo.html5 && (!_hasPoster || _this.$items.eq(index).attr('data-instant-video') === 'true')) { 7278 _this.$slide.eq(index).addClass('lg-complete'); 7279 $('video[data-resize="true"]', $('div.lg-video')).convertVideo(); 7280 _this.initVideos() 7281 } 7282 if (rec === true) { 7283 if (!_this.$slide.eq(index).hasClass('lg-complete')) { 7284 _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { 7285 _this.preload(index) 7286 }) 7287 } else { 7288 _this.preload(index) 7289 } 7290 } 7291 } 7292 ; 7293 Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) { 7294 var _prevIndex = this.$outer.find('.lg-current').index(); 7295 var _this = this; 7296 _this.$slide.eq(_prevIndex).find('iframe[src*="youtube.com/"][src*="enablejsapi=1"], iframe[src*="youtu.be/"][src*="enablejsapi=1"]').each(function(i, video) { 7297 var oVideo = $(video); 7298 if (oVideo.data('youtubeplayer') != undefined) { 7299 if (oVideo.attr('data-autoplay') == 'true') { 7300 oVideo.data('youtubeplayer').pauseVideo(); 7301 oVideo.data('youtubeplayer').seekTo(0, true) 7302 } else { 7303 oVideo.data('youtubeplayer').stopVideo() 7304 } 7305 } 7306 }); 7307 if (_this.lGalleryOn && (_prevIndex === index)) { 7308 return 7309 } 7310 var _length = this.$slide.length; 7311 var _time = _this.lGalleryOn ? this.s.speed : 0; 7312 if (!_this.lgBusy) { 7313 if (this.s.download) { 7314 var _src; 7315 if (_this.s.dynamic) { 7316 _src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src) 7317 } else { 7318 _src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src')) 7319 } 7320 if (_src) { 7321 $('#lg-download').attr('href', _src); 7322 _this.$outer.removeClass('lg-hide-download') 7323 } else { 7324 _this.$outer.addClass('lg-hide-download') 7325 } 7326 } 7327 this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 7328 _this.lgBusy = true; 7329 clearTimeout(_this.hideBartimeout); 7330 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 7331 setTimeout(function() { 7332 _this.addHtml(index) 7333 }, _time) 7334 } 7335 this.arrowDisable(index); 7336 if (!direction) { 7337 if (index < _prevIndex) { 7338 direction = 'prev' 7339 } else if (index > _prevIndex) {
7340 direction = 'next' 7341 } 7342 } 7343 if (!fromTouch) { 7344 _this.$outer.addClass('lg-no-trans'); 7345 this.$slide.removeClass('lg-prev-slide lg-next-slide'); 7346 if (direction === 'prev') { 7347 this.$slide.eq(index).addClass('lg-prev-slide'); 7348 this.$slide.eq(_prevIndex).addClass('lg-next-slide') 7349 } else { 7350 this.$slide.eq(index).addClass('lg-next-slide'); 7351 this.$slide.eq(_prevIndex).addClass('lg-prev-slide') 7352 } 7353 setTimeout(function() { 7354 _this.$slide.removeClass('lg-current'); 7355 _this.$slide.eq(index).addClass('lg-current'); 7356 _this.$outer.removeClass('lg-no-trans') 7357 }, 50) 7358 } else { 7359 this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); 7360 var touchPrev; 7361 var touchNext; 7362 if (_length > 2) { 7363 touchPrev = index - 1; 7364 touchNext = index + 1; 7365 if ((index === 0) && (_prevIndex === _length - 1)) { 7366 touchNext = 0; 7367 touchPrev = _length - 1 7368 } else if ((index === _length - 1) && (_prevIndex === 0)) { 7369 touchNext = 0; 7370 touchPrev = _length - 1 7371 } 7372 } else { 7373 touchPrev = 0; 7374 touchNext = 1 7375 } 7376 if (direction === 'prev') { 7377 _this.$slide.eq(touchNext).addClass('lg-next-slide') 7378 } else { 7379 _this.$slide.eq(touchPrev).addClass('lg-prev-slide') 7380 } 7381 _this.$slide.eq(index).addClass('lg-current') 7382 } 7383 if (_this.lGalleryOn) { 7384 setTimeout(function() { 7385 _this.loadContent(index, true, 0) 7386 }, this.s.speed + 50); 7387 setTimeout(function() { 7388 _this.lgBusy = false; 7389 _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]) 7390 }, this.s.speed) 7391 } else { 7392 _this.loadContent(index, true, _this.s.backdropDuration); 7393 _this.lgBusy = false; 7394 _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]) 7395 } 7396 _this.lGalleryOn = true; 7397 if (this.s.counter) { 7398 $('#lg-counter-current').text(index + 1) 7399 } 7400 } 7401 _this.index = index 7402 } 7403 ; 7404 Plugin.prototype.goToNextSlide = function(fromTouch) { 7405 var _this = this; 7406 var _loop = _this.s.loop; 7407 if (fromTouch && _this.$slide.length < 3) { 7408 _loop = false 7409 } 7410 if (!_this.lgBusy) { 7411 if ((_this.index + 1) < _this.$slide.length) { 7412 _this.index++; 7413 _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); 7414 _this.slide(_this.index, fromTouch, false, 'next') 7415 } else { 7416 if (_loop) { 7417 _this.index = 0; 7418 _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); 7419 _this.slide(_this.index, fromTouch, false, 'next') 7420 } else if (_this.s.slideEndAnimatoin && !fromTouch) { 7421 _this.$outer.addClass('lg-right-end'); 7422 setTimeout(function() { 7423 _this.$outer.removeClass('lg-right-end') 7424 }, 400) 7425 } 7426 } 7427 } 7428 } 7429 ; 7430 Plugin.prototype.goToPrevSlide = function(fromTouch) { 7431 var _this = this; 7432 var _loop = _this.s.loop; 7433 if (fromTouch && _this.$slide.length < 3) { 7434 _loop = false 7435 } 7436 if (!_this.lgBusy) { 7437 if (_this.index > 0) { 7438 _this.index--; 7439 _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); 7440 _this.slide(_this.index, fromTouch, false, 'prev') 7441 } else { 7442 if (_loop) { 7443 _this.index = _this.$items.length - 1; 7444 _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); 7445 _this.slide(_this.index, fromTouch, false, 'prev') 7446 } else if (_this.s.slideEndAnimatoin && !fromTouch) { 7447 _this.$outer.addClass('lg-left-end'); 7448 setTimeout(function() { 7449 _this.$outer.removeClass('lg-left-end') 7450 }, 400) 7451 } 7452 } 7453 } 7454 } 7455 ; 7456 Plugin.prototype.keyPress = function() { 7457 var _this = this; 7458 if (this.$items.length > 1) { 7459 $(window).on('keyup.lg', function(e) { 7460 if (_this.$items.length > 1) { 7461 if (e.keyCode === 37) { 7462 e.preventDefault(); 7463 _this.goToPrevSlide() 7464 } 7465 if (e.keyCode === 39) { 7466 e.preventDefault(); 7467 _this.goToNextSlide() 7468 } 7469 } 7470 }) 7471 } 7472 $(window).on('keydown.lg', function(e) { 7473 if (_this.s.escKey === true && e.keyCode === 27) { 7474 e.preventDefault(); 7475 if (!_this.$outer.hasClass('lg-thumb-open')) { 7476 _this.destroy() 7477 } else { 7478 _this.$outer.removeClass('lg-thumb-open') 7479 } 7480 } 7481 }) 7482 } 7483 ; 7484 Plugin.prototype.arrow = function() { 7485 var _this = this; 7486 this.$outer.find('.lg-prev').on('click.lg', function() { 7487 _this.goToPrevSlide() 7488 }); 7489 this.$outer.find('.lg-next').on('click.lg', function() { 7490 _this.goToNextSlide() 7491 }) 7492 } 7493 ; 7494 Plugin.prototype.arrowDisable = function(index) { 7495 if (!this.s.loop && this.s.hideControlOnEnd) { 7496 if ((index + 1) < this.$slide.length) { 7497 this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled') 7498 } else { 7499 this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled') 7500 } 7501 if (index > 0) { 7502 this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled') 7503 } else { 7504 this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled') 7505 } 7506 } 7507 } 7508 ; 7509 Plugin.prototype.setTranslate = function($el, xValue, yValue) { 7510 if (this.s.useLeft) { 7511 $el.css('left', xValue) 7512 } else { 7513 $el.css({ 7514 transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)' 7515 }) 7516 } 7517 } 7518 ; 7519 Plugin.prototype.touchMove = function(startCoords, endCoords) { 7520 var distance = endCoords - startCoords; 7521 if (Math.abs(distance) > 15) { 7522 this.$outer.addClass('lg-dragging'); 7523 this.setTranslate(this.$slide.eq(this.index), distance, 0); 7524 this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0); 7525 this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0) 7526 } 7527 } 7528 ; 7529 Plugin.prototype.touchEnd = function(distance) { 7530 var _this = this; 7531 if (_this.s.mode !== 'lg-slide') { 7532 _this.$outer.addClass('lg-slide') 7533 } 7534 this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0'); 7535 setTimeout(function() { 7536 _this.$outer.removeClass('lg-dragging'); 7537 if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { 7538 _this.goToNextSlide(true) 7539 } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { 7540 _this.goToPrevSlide(true) 7541 } else if (Math.abs(distance) < 5) { 7542 _this.$el.trigger('onSlideClick.lg') 7543 } 7544 _this.$slide.removeAttr('style') 7545 }); 7546 setTimeout(function() { 7547 if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') { 7548 _this.$outer.removeClass('lg-slide') 7549 } 7550 }, _this.s.speed + 100) 7551 } 7552 ; 7553 Plugin.prototype.enableSwipe = function() { 7554 var _this = this; 7555 var startCoords = 0; 7556 var endCoords = 0; 7557 var isMoved = false;
7558 if (_this.s.enableSwipe && _this.doCss()) { 7559 _this.$slide.on('touchstart.lg', function(e) { 7560 if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { 7561 e.preventDefault(); 7562 _this.manageSwipeClass(); 7563 startCoords = e.originalEvent.targetTouches[0].pageX 7564 } 7565 }); 7566 _this.$slide.on('touchmove.lg', function(e) { 7567 if (!_this.$outer.hasClass('lg-zoomed')) { 7568 e.preventDefault(); 7569 endCoords = e.originalEvent.targetTouches[0].pageX; 7570 _this.touchMove(startCoords, endCoords); 7571 isMoved = true 7572 } 7573 }); 7574 _this.$slide.on('touchend.lg', function() { 7575 if (!_this.$outer.hasClass('lg-zoomed')) { 7576 if (isMoved) { 7577 isMoved = false; 7578 _this.touchEnd(endCoords - startCoords) 7579 } else { 7580 _this.$el.trigger('onSlideClick.lg') 7581 } 7582 } 7583 }) 7584 } 7585 } 7586 ; 7587 Plugin.prototype.enableDrag = function() { 7588 var _this = this; 7589 var startCoords = 0; 7590 var endCoords = 0; 7591 var isDraging = false; 7592 var isMoved = false; 7593 if (_this.s.enableDrag && _this.doCss()) { 7594 _this.$slide.on('mousedown.lg', function(e) { 7595 if (!_this.$outer.hasClass('lg-zoomed')) { 7596 if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { 7597 e.preventDefault(); 7598 if (!_this.lgBusy) { 7599 _this.manageSwipeClass(); 7600 startCoords = e.pageX; 7601 isDraging = true; 7602 _this.$outer.scrollLeft += 1; 7603 _this.$outer.scrollLeft -= 1; 7604 _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); 7605 _this.$el.trigger('onDragstart.lg') 7606 } 7607 } 7608 } 7609 }); 7610 $(window).on('mousemove.lg', function(e) { 7611 if (isDraging) { 7612 isMoved = true; 7613 endCoords = e.pageX; 7614 _this.touchMove(startCoords, endCoords); 7615 _this.$el.trigger('onDragmove.lg') 7616 } 7617 }); 7618 $(window).on('mouseup.lg', function(e) { 7619 if (isMoved) { 7620 isMoved = false; 7621 _this.touchEnd(endCoords - startCoords); 7622 _this.$el.trigger('onDragend.lg') 7623 } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { 7624 _this.$el.trigger('onSlideClick.lg') 7625 } 7626 if (isDraging) { 7627 isDraging = false; 7628 _this.$outer.removeClass('lg-grabbing').addClass('lg-grab') 7629 } 7630 }) 7631 } 7632 } 7633 ; 7634 Plugin.prototype.manageSwipeClass = function() { 7635 var _touchNext = this.index + 1; 7636 var _touchPrev = this.index - 1; 7637 if (this.s.loop && this.$slide.length > 2) { 7638 if (this.index === 0) { 7639 _touchPrev = this.$slide.length - 1 7640 } else if (this.index === this.$slide.length - 1) { 7641 _touchNext = 0 7642 } 7643 } 7644 this.$slide.removeClass('lg-next-slide lg-prev-slide'); 7645 if (_touchPrev > -1) { 7646 this.$slide.eq(_touchPrev).addClass('lg-prev-slide') 7647 } 7648 this.$slide.eq(_touchNext).addClass('lg-next-slide') 7649 } 7650 ; 7651 Plugin.prototype.mousewheel = function() { 7652 var _this = this; 7653 _this.$outer.on('mousewheel.lg', function(e) { 7654 if (!e.deltaY) { 7655 return 7656 } 7657 if (e.deltaY > 0) { 7658 _this.goToPrevSlide() 7659 } else { 7660 _this.goToNextSlide() 7661 } 7662 e.preventDefault() 7663 }) 7664 } 7665 ; 7666 Plugin.prototype.closeGallery = function() { 7667 var _this = this; 7668 var mousedown = false;
7669 this.$outer.find('.lg-close').on('click.lg', function() { 7670 _this.destroy() 7671 }); 7672 if (_this.s.closable) { 7673 _this.$outer.on('mousedown.lg', function(e) { 7674 if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) { 7675 mousedown = true 7676 } else { 7677 mousedown = false 7678 } 7679 }); 7680 _this.$outer.on('mouseup.lg', function(e) { 7681 if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) { 7682 if (!_this.$outer.hasClass('lg-dragging')) { 7683 _this.destroy() 7684 } 7685 } 7686 }) 7687 } 7688 } 7689 ; 7690 Plugin.prototype.destroy = function(d) { 7691 var _this = this; 7692 if (!d) { 7693 _this.$el.trigger('onBeforeClose.lg'); 7694 $(window).scrollTop(_this.prevScrollTop) 7695 } 7696 if (d) { 7697 if (!_this.s.dynamic) { 7698 this.$items.off('click.lg click.lgcustom') 7699 } 7700 $.removeData(_this.el, 'lightGallery') 7701 } 7702 this.$el.off('.lg.tm'); 7703 $.each($.fn.lightGallery.modules, function(key) { 7704 if (_this.modules[key]) { 7705 _this.modules[key].destroy() 7706 } 7707 }); 7708 this.lGalleryOn = false; 7709 clearTimeout(_this.hideBartimeout); 7710 this.hideBartimeout = false; 7711 $(window).off('.lg'); 7712 $('body').removeClass('lg-on lg-from-hash'); 7713 if (_this.$outer) { 7714 _this.$outer.removeClass('lg-visible') 7715 } 7716 $('.lg-backdrop').removeClass('in'); 7717 setTimeout(function() { 7718 if (_this.$outer) { 7719 _this.$outer.remove() 7720 } 7721 $('.lg-backdrop').remove(); 7722 if (!d) { 7723 _this.$el.trigger('onCloseAfter.lg') 7724 } 7725 }, _this.s.backdropDuration + 50) 7726 } 7727 ; 7728 $.fn.lightGallery = function(options) { 7729 return this.each(function() { 7730 if (!$.data(this, 'lightGallery')) { 7731 $.data(this, 'lightGallery', new Plugin(this,options)) 7732 } else { 7733 try { 7734 $(this).data('lightGallery').init() 7735 } catch (err) { 7736 console.error('lightGallery has not initiated properly') 7737 } 7738 } 7739 }) 7740 } 7741 ; 7742 $.fn.lightGallery.modules = {} 7743 } 7744 )() 7745})); 7746onScrMngrLoaded(function() { 7747 $(document).ready(function() { 7748 var fn = function() { 7749 $('[data-lightgallery="true"][data-lightgallery-init!="true"]').each(function() { 7750 $(this).attr('data-lightgallery-init', true); 7751 initLightGallery(this) 7752 }) 7753 }; 7754 fn(); 7755 observeDOM(document.getElementsByTagName('body')[0], fn) 7756 }) 7757}); 7758function initLightGallery(oElement, options) { 7759 var oOptions; 7760 oElement = $(oElement); 7761 if (oElement.attr('data-lightgallery-config') && oElement.attr('data-lightgallery-config') != '') { 7762 try { 7763 oOptions = $.parseJSON(oElement.attr('data-lightgallery-config')) 7764 } catch (err) { 7765 console.warn('Error while JSON-Parsing from "data-lightgallery-config"! Please check JSON-String') 7766 } 7767 } 7768 oOptions = $.extend({ 7769 nextHtml: '<svg class="icon icon-next" xmlns:xlink="http://www.w3.org/1999/xlink"><use xlink:href="#icon-next" /></svg>', 7770 prevHtml: '<svg class="icon icon-prev" xmlns:xlink="http://www.w3.org/1999/xlink"><use xlink:href="#icon-prev" /></svg>' 7771 }, oOptions || {}, options || {}); 7772 oElement.lightGallery(oOptions) 7773} 7774(function(root, factory) { 7775 if (typeof define === 'function' && define.amd) { 7776 define(['jquery'], function(a0) { 7777 return (factory(a0)) 7778 }) 7779 } else if (typeof exports === 'object') { 7780 module.exports = factory(require('jquery')) 7781 } else { 7782 factory(jQuery) 7783 } 7784}(this, function($) { 7785 (function() { 7786 'use strict'; 7787 var defaults = { 7788 fullScreen: true 7789 }; 7790 function isFullScreen() { 7791 return (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement) 7792 } 7793 var Fullscreen = function(element) { 7794 this.core = $(element).data('lightGallery'); 7795 this.$el = $(element); 7796 this.core.s = $.extend({}, defaults, this.core.s); 7797 this.init(); 7798 return this 7799 }; 7800 Fullscreen.prototype.init = function() { 7801 var fullScreen = ''; 7802 if (this.core.s.fullScreen) { 7803 if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled && !document.mozFullScreenEnabled && !document.msFullscreenEnabled) { 7804 return 7805 } else { 7806 fullScreen = '<span class="lg-fullscreen lg-icon"><svg class="icon icon-enlarge" xmlns:xlink="http://www.w3.org/1999/xlink"><use xlink:href="#icon-enlarge" /></svg></span>'; 7807 this.core.$outer.find('.lg-toolbar').append(fullScreen); 7808 this.fullScreen() 7809 } 7810 } 7811 } 7812 ; 7813 Fullscreen.prototype.requestFullscreen = function() { 7814 var el = document.documentElement; 7815 if (el.requestFullscreen) { 7816 el.requestFullscreen() 7817 } else if (el.msRequestFullscreen) { 7818 el.msRequestFullscreen() 7819 } else if (el.mozRequestFullScreen) { 7820 el.mozRequestFullScreen() 7821 } else if (el.webkitRequestFullscreen) { 7822 el.webkitRequestFullscreen() 7823 } 7824 } 7825 ; 7826 Fullscreen.prototype.exitFullscreen = function() { 7827 if (document.exitFullscreen) { 7828 document.exitFullscreen() 7829 } else if (document.msExitFullscreen) { 7830 document.msExitFullscreen() 7831 } else if (document.mozCancelFullScreen) { 7832 document.mozCancelFullScreen() 7833 } else if (document.webkitExitFullscreen) { 7834 document.webkitExitFullscreen() 7835 } 7836 } 7837 ; 7838 Fullscreen.prototype.fullScreen = function() { 7839 var _this = this; 7840 $(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() { 7841 _this.core.$outer.toggleClass('lg-fullscreen-on'); 7842 if (_this.core.$outer.hasClass('lg-fullscreen-on')) { 7843 _this.core.$outer.find('span.lg-fullscreen svg').removeClass("icon-enlarge"); 7844 _this.core.$outer.find('span.lg-fullscreen svg').addClass("icon-decrease"); 7845 _this.core.$outer.find('span.lg-fullscreen svg use').attr("xlink:href", "#icon-decrease") 7846 } else { 7847 _this.core.$outer.find('span.lg-fullscreen svg').removeClass("icon-decrease"); 7848 _this.core.$outer.find('span.lg-fullscreen svg').addClass("icon-enlarge"); 7849 _this.core.$outer.find('span.lg-fullscreen svg use').attr("xlink:href", "#icon-enlarge") 7850 } 7851 }); 7852 this.core.$outer.find('.lg-fullscreen').on('click.lg', function() { 7853 if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { 7854 _this.requestFullscreen() 7855 } else { 7856 if (isFullScreen()) { 7857 _this.exitFullscreen() 7858 } else { 7859 _this.requestFullscreen() 7860 } 7861 } 7862 }) 7863 } 7864 ; 7865 Fullscreen.prototype.destroy = function() { 7866 if (isFullScreen()) { 7867 this.exitFullscreen() 7868 } 7869 $(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg') 7870 } 7871 ; 7872 $.fn.lightGallery.modules.fullscreen = Fullscreen 7873 } 7874 )() 7875})); 7876(function($) { 7877 function boxResizer(sSelector, options) { 7878 var version = 'v1.1'; 7879 var _options = $.extend({ 7880 lMinWidth: 0, 7881 lMaxWidth: 0, 7882 lMinHeight: 0, 7883 lMaxHeight: 0, 7884 sOperator: 'or', 7885 oDefaultElement: undefined, 7886 bGrid: false, 7887 sGridCssPath: '', 7888 sFirstClass: '',
7889 bForceHeight: false, 7890 lTolerance: 5, 7891 onResize: function() {}, 7892 onResizeFinish: function() {} 7893 }, options || {}); 7894 var _bLock = false; 7895 var _bInvalidated = false; 7896 var _lWindowWidth = 0; 7897 var _lWindowHeight = 0; 7898 var _lLastWidth = 0; 7899 var _bDefaultHeight = true; 7900 var _aElement = []; 7901 var _aGridElements = []; 7902 var _sClassId = ''; 7903 var _imageTimer = undefined; 7904 var _oContainer = undefined; 7905 var _bEventStop = false; 7906 var _lResizeTimer = null; 7907 var _sSelector = sSelector; 7908 var _resizeHandler = undefined; 7909 var _resizeEvent = undefined; 7910 var _destroyEvent = undefined; 7911 function _init(bFirstInitialize) { 7912 var aTempElement = []; 7913 var oThat = this; 7914 if (typeof (_sSelector) == 'string') { 7915 _aElement = $(_sSelector) 7916 } else if (bFirstInitialize) { 7917 _aElement = _sSelector 7918 } 7919 aTempElement = $(_aElement); 7920 if (_options.oDefaultElement != undefined) { 7921 aTempElement.push($(_options.oDefaultElement)) 7922 } 7923 if (bFirstInitialize) { 7924 if (_options.sGridCssPath != '') { 7925 _aGridElements = $(_options.sGridCssPath) 7926 } else { 7927 _aGridElements = _aElement 7928 } 7929 if (_aGridElements.length != _aElement.length) { 7930 _options.bGrid = false 7931 } 7932 } 7933 if (_aElement.length) { 7934 if (bFirstInitialize) { 7935 _oContainer = _aGridElements.first().parent(); 7936 $.proxy(_setClassID, this)(_sSelector) 7937 } 7938 $(document).trigger('clsBoxResizer:destroy', [_sClassId]); 7939 $.each(aTempElement, function() { 7940 $(this).data('defMinHeight', $(this).css('minHeight')); 7941 $(this).bind('clsBoxResizer:imageload', function() { 7942 window.clearTimeout(_imageTimer); 7943 _imageTimer = window.setTimeout(function() { 7944 $.proxy(_resize, oThat)() 7945 }, 250) 7946 }); 7947 $.proxy(_checkImageLoaded, oThat)($(this)) 7948 }); 7949 if (bFirstInitialize) { 7950 _resizeHandler = $.proxy(function() { 7951 window.clearTimeout(_lResizeTimer); 7952 _lResizeTimer = window.setTimeout($.proxy(function() { 7953 $.proxy(_resize, this)($(window).width() || window.innerWidth, $(window).height() || window.innerHeight) 7954 }, this), 250) 7955 }, this) 7956 } 7957 _resizeEvent = $(window).bind('resize.boxresizer', _resizeHandler); 7958 _destroyEvent = $(document).bind('clsBoxResizer:destroy', function(e, a) { 7959 $.proxy(_destroy, this)(e, a) 7960 }) 7961 } 7962 } 7963 function _reInitialize() { 7964 if (_bInvalidated) { 7965 _bInvalidated = false; 7966 $.proxy(_init, this)(false); 7967 $.proxy(_resize, this)() 7968 } 7969 } 7970 function _start() { 7971 _resizeEvent = $(window).unbind('resize.boxresizer', _resizeHandler); 7972 _resizeEvent = $(window).bind('resize.boxresizer', _resizeHandler); 7973 _bEventStop = false 7974 } 7975 function _stop() { 7976 _resizeEvent = $(window).unbind('resize.boxresizer', _resizeHandler); 7977 _bEventStop = true 7978 } 7979 function _setClassID(sElement) { 7980 if (typeof (sElement) == 'string') { 7981 _sClassId += sElement 7982 } else if (_oContainer != undefined) { 7983 _sClassId += $(_oContainer).attr("id") 7984 } 7985 _sClassId += _options.sGridCssPath; 7986 if (_sClassId != '') { 7987 _sClassId += _options.lMinWidth.toString(); 7988 _sClassId += _options.lMaxWidth.toString(); 7989 _sClassId += _options.lMinHeight.toString(); 7990 _sClassId += _options.lMaxHeight.toString(); 7991 _sClassId += _options.bGrid.toString(); 7992 _sClassId += typeof (_options.oDefaultElement); 7993 _sClassId += _options.sOperator 7994 } else { 7995 _sClassId = Date.parse(new Date()) + parseInt(Math.random() * 1000) 7996 } 7997 } 7998 function _checkImageLoaded(oElement) { 7999 $.proxy(_isPictureLoaded, this)(oElement); 8000 $.proxy(_isImageLoaded, this)(oElement); 8001 oElement.trigger('clsBoxResizer:imageload') 8002 } 8003 function _isImageLoaded(oElement) { 8004 $('img', oElement).each(function(i, oImg) { 8005 $(oImg).bind('load', function() { 8006 $(oElement).trigger('clsBoxResizer:imageload') 8007 } 8008 .bind(this)) 8009 } 8010 .bind(this)) 8011 } 8012 function _isPictureLoaded(oElement) { 8013 var aPics = []; 8014 if ($(oElement).prop('tagName').toLowerCase() == 'picture') { 8015 aPics = $(oElement) 8016 } else { 8017 aPics = $('picture', oElement) 8018 } 8019 aPics.each($.proxy(function(i, oPic) { 8020 $(oPic).bind('image:load', $.proxy(function() { 8021 $(oElement).trigger('clsBoxResizer:imageload') 8022 }, this)); 8023 if (!$(oPic).data('bImageLoaded')) { 8024 $(oElement).trigger('clsBoxResizer:imageload') 8025 } 8026 }, this)) 8027 } 8028 function _isLocked() { 8029 if (_bLock) { 8030 return true 8031 } 8032 if (_lLastWidth == _lWindowWidth && this.lLastHeight == _lWindowHeight) { 8033 return true 8034 } 8035 _lLastWidth = _lWindowWidth; 8036 this.lLastHeight = _lWindowHeight; 8037 if (!$.proxy(_isValidRange, this)()) { 8038 if (!_bDefaultHeight) { 8039 $.proxy(_setDefault, this)() 8040 } 8041 return true 8042 } 8043 return false 8044 } 8045 function _resize(lWinWidth, lWinHeight) { 8046 if ($.isNumeric(lWinWidth)) { 8047 _lWindowWidth = lWinWidth 8048 } else { 8049 _lLastWidth = 0; 8050 _lWindowWidth = window.innerWidth || $(window).width() 8051 } 8052 if ($.isNumeric(lWinHeight)) { 8053 _lWindowHeight = lWinHeight 8054 } else { 8055 this.lLastHeight = null; 8056 _lWindowHeight = window.innerHeight || $(window).height() 8057 } 8058 if ($.proxy(_isLocked, this)()) { 8059 return 8060 }
8061 _bLock = true; 8062 _resizeEvent = $(window).unbind('resize.boxresizer', _resizeHandler); 8063 _aElement.addClass('box-resizing'); 8064 if (_options.oDefaultElement != undefined) { 8065 $.proxy(_setHeightByElement, this)() 8066 } else { 8067 $.proxy(_setHeightAllElement, this)() 8068 } 8069 _aElement.removeClass('box-resizing'); 8070 _options.onResizeFinish(_aElement); 8071 _bLock = false; 8072 if (!_bEventStop) { 8073 _resizeEvent = $(window).bind('resize.boxresizer', _resizeHandler) 8074 } 8075 } 8076 function _setHeightAllElement() { 8077 var lMaxHeight = 0; 8078 var lMaxWidth = 0; 8079 var lWidth = 0; 8080 var lLastCount = 0; 8081 var bFirst = true; 8082 var oThat = this; 8083 if (_options.bGrid) { 8084 lMaxWidth = parseInt(_oContainer.width(), 10) + _options.lTolerance 8085 } 8086 _aElement.each(function(lCount, oElement) { 8087 if ($(this).is(':visible')) { 8088 var lTempHeight = 0; 8089 if (_options.bGrid) { 8090 if ($(_aGridElements[lCount]).is(':visible')) { 8091 lWidth += parseInt($(_aGridElements[lCount]).outerWidth(true), 10) 8092 } 8093 if (lWidth > lMaxWidth) { 8094 $.proxy(_setHeight, oThat)(lMaxHeight, lLastCount, lCount); 8095 lLastCount = lCount; 8096 lMaxHeight = 0; 8097 lWidth = parseInt($(_aGridElements[lCount]).outerWidth(true), 10); 8098 bFirst = true 8099 } 8100 } 8101 $(this).css({ 8102 'height': 'auto', 8103 'minHeight': '0px' 8104 }); 8105 lTempHeight = $(this).outerHeight(); 8106 if (lTempHeight > lMaxHeight) { 8107 lMaxHeight = lTempHeight 8108 } 8109 if (bFirst && _options.sFirstClass != '') { 8110 $(this).addClass(_options.sFirstClass); 8111 bFirst = false 8112 } else if (_options.sFirstClass != '') { 8113 $(this).removeClass(_options.sFirstClass) 8114 } 8115 } 8116 }); 8117 $.proxy(_setHeight, this)(lMaxHeight, lLastCount, _aElement.length) 8118 } 8119 function _setHeightByElement() { 8120 var oThat = this; 8121 var lMaxHeight = $(_options.oDefaultElement).outerHeight(); 8122 if ($(_options.oDefaultElement).is(':visible')) { 8123 _aElement.each(function(lCount) { 8124 if (_options.bForceHeight) { 8125 $.proxy(_setHeight, oThat)(lMaxHeight, lCount, lCount + 1) 8126 } else { 8127 $(this).css({ 8128 'height': 'auto', 8129 'minHeight': '0px' 8130 }); 8131 if ($(this).outerHeight() < lMaxHeight) { 8132 $.proxy(_setHeight, oThat)(lMaxHeight, lCount, lCount + 1) 8133 } 8134 } 8135 }) 8136 } 8137 } 8138 function _setHeight(lMaxHeight, lFrom, lTo) { 8139 for (var i = lFrom; i < lTo; i++) { 8140 var lHeight = lMaxHeight; 8141 lHeight -= parseInt(_aElement.eq(i).css("padding-top").replace("px", ""), 10) || 0; 8142 lHeight -= parseInt(_aElement.eq(i).css("padding-bottom").replace("px", ""), 10) || 0; 8143 lHeight -= parseInt(_aElement.eq(i).css("border-top-width").replace("px", ""), 10) || 0; 8144 lHeight -= parseInt(_aElement.eq(i).css("border-bottom-width").replace("px", ""), 10) || 0; 8145 if (lHeight >= 1) { 8146 _aElement.eq(i).css({ 8147 'height': lHeight + 'px' 8148 }) 8149 } 8150 } 8151 _options.onResize(lMaxHeight, _aElement.slice(lFrom, lTo)); 8152 _bDefaultHeight = false 8153 } 8154 function _setDefault() { 8155 _aElement.each(function() { 8156 $(this).css({ 8157 'height': 'auto', 8158 'minHeight': $(this).data('defMinHeight') 8159 }) 8160 }); 8161 _aElement.removeClass('box-resizing'); 8162 _bDefaultHeight = true 8163 } 8164 function _isValidRange() { 8165 if (_options.lMinWidth == 0 && _options.lMaxWidth == 0 && _options.lMinHeight == 0 && _options.lMaxHeight == 0) { 8166 return true 8167 }
8168 var bWidth = false; 8169 var bHeight = false; 8170 if (typeof (window.matchMedia) != 'undefined') { 8171 var lMinWidth = _options.lMinWidth + 1; 8172 if (_options.lMinWidth != 0 && _options.lMaxWidth != 0) { 8173 bWidth = window.matchMedia('(min-width: ' + lMinWidth + 'px) and (max-width: ' + _options.lMaxWidth + 'px)').matches 8174 } else if (_options.lMinWidth != 0 && _options.lMaxWidth == 0) { 8175 bWidth = window.matchMedia('(min-width: ' + lMinWidth + 'px)').matches 8176 } else if (_options.lMinWidth == 0 && _options.lMaxWidth != 0) { 8177 bWidth = window.matchMedia('(max-width: ' + _options.lMaxWidth + 'px)').matches 8178 } 8179 var lMinHeight = _options.lMinHeight + 1; 8180 if (_options.lMinHeight != 0 && _options.lMaxHeight != 0) { 8181 bHeight = window.matchMedia('(min-height: ' + lMinHeight + 'px) and (max-height: ' + _options.lMaxHeight + 'px)').matches 8182 } else if (_options.lMinHeight != 0 && _options.lMaxHeight == 0) { 8183 bHeight = window.matchMedia('(min-height: ' + lMinHeight + 'px)').matches 8184 } else if (_options.lMinHeight == 0 && _options.lMaxHeight != 0) { 8185 bHeight = window.matchMedia('(max-height: ' + _options.lMaxHeight + 'px)').matches 8186 } 8187 } else { 8188 if (_options.lMinWidth != 0 && _options.lMaxWidth != 0 && _lWindowWidth >= _options.lMinWidth && _lWindowWidth <= _options.lMaxWidth) { 8189 bWidth = true 8190 } else if (_options.lMinWidth != 0 && _options.lMaxWidth == 0 && _lWindowWidth >= _options.lMinWidth) { 8191 bWidth = true 8192 } else if (_options.lMinWidth == 0 && _options.lMaxWidth != 0 && _lWindowWidth <= _options.lMaxWidth) { 8193 bWidth = true 8194 } 8195 if (_options.lMinHeight != 0 && _options.lMaxHeight != 0 && _lWindowHeight >= _options.lMinHeight && _lWindowHeight <= _options.lMaxHeight) { 8196 bHeight = true 8197 } else if (_options.lMinHeight != 0 && _options.lMaxHeight == 0 && _lWindowHeight >= _options.lMinHeight) { 8198 bHeight = true 8199 } else if (_options.lMinHeight == 0 && _options.lMaxHeight != 0 && _lWindowHeight <= _options.lMaxHeight) { 8200 bHeight = true 8201 } 8202 } 8203 if (_options.sOperator == 'or') { 8204 return bWidth || bHeight 8205 } else { 8206 return bWidth && bHeight 8207 } 8208 } 8209 function _destroy(oEvent, aData) { 8210 if (typeof (oEvent) == 'undefined') { 8211 $(document).unbind('clsBoxResizer:destroy', [_sClassId]); 8212 $(window).unbind('resize.boxresizer', _resizeHandler); 8213 if (!_bDefaultHeight) { 8214 this.setDefault() 8215 } 8216 } else if (aData == this.sClassId) { 8217 $(document).unbind('clsBoxResizer:destroy', [_sClassId]); 8218 $(window).unbind('resize.boxresizer', _resizeHandler) 8219 } 8220 } 8221 this.reInitialize = function() { 8222 $.proxy(_reInitialize, this)() 8223 } 8224 ; 8225 this.start = function() { 8226 $.proxy(_start, this)() 8227 } 8228 ; 8229 this.stop = function() { 8230 $.proxy(_stop, this)() 8231 } 8232 ; 8233 this.resize = function(lWinWidth, lWinHeight) { 8234 $.proxy(_resize, this)(lWinWidth, lWinHeight) 8235 } 8236 ; 8237 this.destroy = function(oEvent, aData) { 8238 $.proxy(_destroy, this)(oEvent, aData) 8239 } 8240 ; 8241 $.proxy(_init, this)(true); 8242 return this 8243 } 8244 $.boxResizer = function(sSelector, options) { 8245 var oBoxResizer = new boxResizer(sSelector,options); 8246 return oBoxResizer 8247 } 8248}(jQuery)); 8249var oCssVarPoly = { 8250 storedXHRRequests: {}, 8251 supportCssVar: false, 8252 init: function init() { 8253 if (window.CSS && window.CSS.supports && window.CSS.supports('(--foo: red)')) { 8254 oCssVarPoly.supportCssVar = true; 8255 return 8256 } else { 8257 document.querySelector('body').classList.add('cssvars-polyfilled') 8258 } 8259 oCssVarPoly.reInit() 8260 }, 8261 reInit: function reInit() { 8262 if (oCssVarPoly.supportCssVar) 8263 return; 8264 oCssVarPoly.ratifiedVars = {}; 8265 oCssVarPoly.varsByBlock = {}; 8266 oCssVarPoly.oldCSS = {}; 8267 oCssVarPoly.findCSS(); 8268 oCssVarPoly.updateCSS() 8269 }, 8270 findCSS: function findCSS() { 8271 var styleBlocks = document.querySelectorAll('style:not(.inserted),link[type="text/css"]'); 8272 var counter = 1; 8273 [].forEach.call(styleBlocks, function(block) { 8274 var theCSS = void 0; 8275 if (block.nodeName === 'STYLE') { 8276 theCSS = block.innerHTML;
8277 oCssVarPoly.findSetters(theCSS, counter) 8278 } else if (block.nodeName === 'LINK') { 8279 var url = block.getAttribute('href'); 8280 if (oCssVarPoly.storedXHRRequests[url] != undefined) { 8281 theCSS = oCssVarPoly.storedXHRRequests[url]; 8282 oCssVarPoly.findSetters(oCssVarPoly.storedXHRRequests[url], counter) 8283 } else { 8284 oCssVarPoly.getLink(url, counter, function(counter, request) { 8285 oCssVarPoly.findSetters(request.responseText, counter); 8286 oCssVarPoly.oldCSS[counter] = request.responseText; 8287 oCssVarPoly.updateCSS(url) 8288 }); 8289 theCSS = '' 8290 } 8291 } 8292 oCssVarPoly.oldCSS[counter] = theCSS; 8293 counter++ 8294 }) 8295 }, 8296 findSetters: function findSetters(theCSS, counter) { 8297 oCssVarPoly.varsByBlock[counter] = theCSS.match(/(--.+?:.+?;)/g) || [] 8298 }, 8299 updateCSS: function updateCSS(url) { 8300 oCssVarPoly.ratifySetters(oCssVarPoly.varsByBlock); 8301 for (var curCSSID in oCssVarPoly.oldCSS) { 8302 var newCSS = oCssVarPoly.replaceGetters(oCssVarPoly.oldCSS[curCSSID], oCssVarPoly.ratifiedVars); 8303 if (url != undefined) { 8304 var baseurl = url; 8305 if (url.indexOf('/', 8) > -1) { 8306 baseurl = url.substr(0, url.indexOf('/', 8)) 8307 } 8308 newCSS = newCSS.replace(/url?.\(?.\/([^\(\)]*)(\.png|\.jpg|\.jpeg|\.gif|\.svg|\.ttf|\.woff2|\.woff|\.eot|\.otf)[^\)]*/g, 'url(' + baseurl + '/$1$2') 8309 } 8310 if (document.querySelector('#inserted' + curCSSID)) { 8311 document.querySelector('#inserted' + curCSSID).innerHTML = newCSS 8312 } else { 8313 var style = document.createElement('style'); 8314 style.type = 'text/css'; 8315 style.innerHTML = newCSS; 8316 style.classList.add('inserted'); 8317 style.id = 'inserted' + curCSSID; 8318 document.getElementsByTagName('head')[0].appendChild(style) 8319 } 8320 } 8321 }, 8322 replaceGetters: function replaceGetters(curCSS, varList) { 8323 for (var theVar in varList) { 8324 var res = theVar.match(/--[a-zA-Z0-9-]+/g); 8325 theVar = res[0]; 8326 var getterRegex = new RegExp('var\\(\\s*' + theVar + '\\s*.*?\\)','g'); 8327 curCSS = curCSS.replace(getterRegex, varList[theVar]); 8328 var getterRegex2 = new RegExp('var\\(\\s*(?:(?!\\)).)*\\s*,\\s*((?:(?!\\)).)*)\\)','g'); 8329 var matches = curCSS.match(getterRegex2); 8330 if (matches) { 8331 matches.forEach(function(match) { 8332 curCSS = curCSS.replace(match, match.match(/var\(.+,\s*(.+)\)/)[1]) 8333 }) 8334 } 8335 } 8336 ;return curCSS 8337 }, 8338 ratifySetters: function ratifySetters(varList) { 8339 for (var curBlock in varList) { 8340 var curVars = varList[curBlock]; 8341 curVars.forEach(function(theVar) { 8342 var matches = theVar.split(/:\s*/); 8343 oCssVarPoly.ratifiedVars[matches[0]] = matches[1].replace(/;/, '') 8344 }) 8345 } 8346 }, 8347 getLink: function getLink(url, counter, success) { 8348 var request = new XMLHttpRequest(); 8349 request.open('GET', url, true); 8350 request.overrideMimeType('text/css;'); 8351 request.onload = function() { 8352 if (request.status >= 200 && request.status < 400) { 8353 oCssVarPoly.storedXHRRequests[url] = request.responseText; 8354 if (typeof success === 'function') { 8355 success(counter, request) 8356 } 8357 } else { 8358 console.warn('an error was returned from:', url) 8359 } 8360 } 8361 ; 8362 request.onerror = function() { 8363 console.warn('we could not get anything from:', url) 8364 } 8365 ; 8366 request.send() 8367 } 8368}; 8369$(document).ready(function() { 8370 oCssVarPoly.init() 8371}); 8372window.dataLayer = window.dataLayer || []; 8373(function($) { 8374 function googleTagManagerHelper() { 8375 var _version = 'v1.0'; 8376 var _sLayerVariable = 'dataLayer'; 8377 var _sCurrencyCode = 'EUR'; 8378 function _getDataLayers(aLayerVariables) { 8379 if (typeof (aLayerVariables) !== 'object') { 8380 aLayerVariables = [] 8381 } 8382 if (aLayerVariables.indexOf(_sLayerVariable) === -1) { 8383 aLayerVariables.push(_sLayerVariable) 8384 } 8385 return aLayerVariables 8386 } 8387 function _bookingSeekdaEcommerce(oSeekdaData, aLayerVariables) { 8388 if (oSeekdaData != undefined) { 8389 var sRoomCodes = ''; 8390 $.each(oSeekdaData.selectedRoomCodes, function(i, o) { 8391 sRoomCodes = sRoomCodes + ', ' + o 8392 }); 8393 if (sRoomCodes == '') 8394 sRoomCodes = oSeekdaData.reservationId; 8395 var sLayerVariable = ''; 8396 aLayerVariables = _getDataLayers(aLayerVariables); 8397 for (var i = 0; i < aLayerVariables.length; i++) { 8398 sLayerVariable = aLayerVariables[i]; 8399 if (window[sLayerVariable] === undefined) 8400 window[sLayerVariable] = []; 8401 window[sLayerVariable].push({ 8402 'event': 'eCommerceTransaction', 8403 'ecommerce': { 8404 'purchase': { 8405 'actionField': { 8406 'id': oSeekdaData.reservationId.toString(), 8407 'affiliation': oSeekdaData.searchData.hotelId.toString(), 8408 'revenue': oSeekdaData.total, 8409 'tax': (oSeekdaData.total - oSeekdaData.totalWithoutTaxes), 8410 'shipping': 0, 8411 }, 8412 'products': [{ 8413 'name': sRoomCodes.substr(2).toString(), 8414 'id': oSeekdaData.reservationId.toString(), 8415 'price': oSeekdaData.total, 8416 'brand': '', 8417 'category': '', 8418 'variant': '', 8419 'quantity': 1, 8420 'coupon': '' 8421 }] 8422 } 8423 } 8424 }); 8425 window[sLayerVariable].push({ 8426 'event': 'purchase', 8427 'ecommerce': { 8428 'transaction_id': oSeekdaData.reservationId.toString(), 8429 'value': oSeekdaData.total, 8430 'tax': (oSeekdaData.total - oSeekdaData.totalWithoutTaxes), 8431 'shipping': 0, 8432 'currency': _sCurrencyCode, 8433 'items': [{ 8434 'item_name': sRoomCodes.substr(2).toString(), 8435 'item_id': oSeekdaData.reservationId.toString(), 8436 'affiliation': oSeekdaData.searchData.hotelId.toString(), 8437 'price': oSeekdaData.total, 8438 'quantity': 1, 8439 'item_brand': '', 8440 'item_category': '', 8441 'item_category2': '', 8442 'coupon': '' 8443 }] 8444 } 8445 }); 8446 window[sLayerVariable].push({ 8447 'event': 'formConversion-Seekda', 8448 'TotalPrice': oSeekdaData.total, 8449 'TransactionId': oSeekdaData.reservationId.toString(), 8450 'DateFrom': oSeekdaData.searchData.startDate, 8451 'DateTo': oSeekdaData.searchData.endDate, 8452 'GuestEMail': oSeekdaData.guestDetails.email 8453 }) 8454 } 8455 } 8456 } 8457 function _bookingSuedtirolEcommerce(oBookingData, aLayerVariables) { 8458 var oData = {}; 8459 if (oBookingData != undefined && typeof (oIrisData) != 'undefined' && oIrisData.Traces != undefined) { 8460 var aProducts = []; 8461 $.each(oBookingData.offers, function(i, o) { 8462 aProducts.push({ 8463 'name': o.title.toString() + ' - ' + o.room.roomSeq.toString(), 8464 'id': o.id.toString() + ' - ' + o.room.roomSeq.toString(), 8465 'price': o.price, 8466 'brand': '', 8467 'category': 'Offer', 8468 'variant': '', 8469 'quantity': 1, 8470 'coupon': '' 8471 }); 8472 aProducts.push({ 8473 'name': o.room.title.toString() + ' - ' + o.room.roomSeq.toString(), 8474 'id': o.room.id.toString() + ' - ' + o.room.code.toString() + ' - ' + o.room.roomSeq.toString(), 8475 'price': o.price, 8476 'brand': '', 8477 'category': 'Rooms', 8478 'variant': '', 8479 'quantity': 1, 8480 'coupon': '' 8481 }) 8482 }); 8483 if (oBookingData.extras != undefined) { 8484 $.each(oBookingData.extras, function(i, o) { 8485 aProducts.push({ 8486 'name': o.title.toString(), 8487 'id': o.id.toString(), 8488 'price': o.price, 8489 'brand': '', 8490 'category': 'Extras', 8491 'variant': '', 8492 'quantity': o.amount, 8493 'coupon': '' 8494 }) 8495 }) 8496 } 8497 var sLayerVariable = ''; 8498 aLayerVariables = _getDataLayers(aLayerVariables); 8499 for (var i = 0; i < aLayerVariables.length; i++) { 8500 sLayerVariable = aLayerVariables[i]; 8501 if (window[sLayerVariable] === undefined) 8502 window[sLayerVariable] = []; 8503 window[sLayerVariable].push({ 8504 'event': 'eCommerceTransaction', 8505 'ecommerce': { 8506 'purchase': { 8507 'actionField': { 8508 'id': oBookingData.bookingId.toString(), 8509 'affiliation': '', 8510 'revenue': oBookingData.price, 8511 'tax': 0, 8512 'shipping': 0, 8513 }, 8514 'products': aProducts 8515 } 8516 } 8517 }); 8518 window[sLayerVariable].push({ 8519 'event': 'formConversion-BookingSuedtirol', 8520 'TotalPrice': oBookingData.price, 8521 'TransactionId': oBookingData.bookingId.toString(), 8522 'DateFrom': oBookingData.arrival, 8523 'DateTo': oBookingData.departure, 8524 'GuestEMail': oBookingData.guest.email 8525 }) 8526 } 8527 } 8528 } 8529 function _bookingFeratelEcommerce(oBookingData, aLayerVariables) { 8530 if (oBookingData.pageType != '9901' || oBookingData === undefined) { 8531 return 8532 } 8533 if (oBookingData.bookingConfirmation === undefined || oBookingData.bookingConfirmation.items == undefined || oBookingData.bookingConfirmation.items.accommodations == undefined) { 8534 return 8535 } 8536 var aProducts = []; 8537 var aProductsGa4 = []; 8538 $.each(oBookingData.bookingConfirmation.items.accommodations, function(i, o) { 8539 aProducts.push({ 8540 'name': o.product.name.toString(), 8541 'id': o.productId.toString(), 8542 'price': o.price, 8543 'brand': '', 8544 'category': '', 8545 'variant': '', 8546 'quantity': o.units, 8547 'coupon': '' 8548 }) 8549 }); 8550 if (oBookingData.bookingConfirmation.items.additionalServices != undefined) { 8551 $.each(oBookingData.bookingConfirmation.items.additionalServices, function(i, o) { 8552 aProducts.push({ 8553 'name': o.product.name.toString(), 8554 'id': o.productId.toString(), 8555 'price': o.price, 8556 'brand': '', 8557 'category': 'Extras', 8558 'variant': '', 8559 'quantity': o.units, 8560 'coupon': '' 8561 }) 8562 }) 8563 } 8564 $.each(oBookingData.bookingConfirmation.items.accommodations, function(i, o) { 8565 aProductsGa4.push({ 8566 'item_name': o.product.name.toString(), 8567 'item_id': o.productId.toString(), 8568 'affiliation': '', 8569 'price': o.price, 8570 'item_brand': '', 8571 'item_category': '', 8572 'item_category2': '', 8573 'quantity': o.units, 8574 'coupon': '' 8575 }) 8576 }); 8577 if (oBookingData.bookingConfirmation.items.additionalServices != undefined) { 8578 $.each(oBookingData.bookingConfirmation.items.additionalServices, function(i, o) { 8579 aProductsGa4.push({ 8580 'item_name': o.product.name.toString(), 8581 'item_id': o.productId.toString(), 8582 'affiliation': '', 8583 'price': o.price, 8584 'item_brand': '', 8585 'item_category': 'Extras', 8586 'item_category2': '', 8587 'quantity': o.units, 8588 'coupon': '' 8589 }) 8590 }) 8591 } 8592 var sLayerVariable = ''; 8593 aLayerVariables = _getDataLayers(aLayerVariables); 8594 for (var i = 0; i < aLayerVariables.length; i++) { 8595 sLayerVariable = aLayerVariables[i]; 8596 if (window[sLayerVariable] === undefined) 8597 window[sLayerVariable] = []; 8598 window[sLayerVariable].push({ 8599 "event": "formSubmit-Feratel", 8600 "gaEventCategory": "Standard-Events", 8601 "gaEventAction": "Booking", 8602 "gaEventLabel": oBookingData.bookingConfirmation.transactionNumber.toString(), 8603 "gaEventValue": "", 8604 "gaVirtualPageView": "" 8605 }); 8606 window[sLayerVariable].push({ 8607 'event': 'eCommerceTransaction', 8608 'ecommerce': { 8609 'purchase': { 8610 'actionField': { 8611 'id': oBookingData.bookingConfirmation.transactionNumber.toString(), 8612 'affiliation': '', 8613 'revenue': oBookingData.bookingConfirmation.totalAmount, 8614 'tax': 0, 8615 'shipping': 0, 8616 }, 8617 'products': aProducts 8618 } 8619 } 8620 }); 8621 window[sLayerVariable].push({ 8622 'event': 'purchase', 8623 'ecommerce': { 8624 'transaction_id': oBookingData.bookingConfirmation.transactionNumber.toString(), 8625 'value': oBookingData.bookingConfirmatio
8625n.totalAmount, 8626 'tax': 0, 8627 'shipping': 0, 8628 'currency': _sCurrencyCode, 8629 'items': aProductsGa4 8630 } 8631 }); 8632 window[sLayerVariable].push({ 8633 'event': 'formConversion-BookingFeratel', 8634 'TotalPrice': oBookingData.bookingConfirmation.totalAmount, 8635 'TransactionId': oBookingData.bookingConfirmation.transactionNumber.toString() 8636 }) 8637 } 8638 } 8639 function _pushToConsole(oJson) { 8640 var sConsoleOutput = ''; 8641 $.each(oJson, function(sKey, sValue) { 8642 if (sConsoleOutput != '') 8643 sConsoleOutput = sConsoleOutput + '\n'; 8644 sConsoleOutput = sConsoleOutput + sKey + ': ' + sValue 8645 }); 8646 if (sConsoleOutput != '') { 8647 console.log(sConsoleOutput) 8648 } 8649 } 8650 this.bookingSeekdaEcommerce = function(oSeekdaData, aLayerVariables) { 8651 $.proxy(_bookingSeekdaEcommerce, this)(oSeekdaData, aLayerVariables) 8652 } 8653 ; 8654 this.bookingSuedtirolEcommerce = function(oBookingData, aLayerVariables) { 8655 $.proxy(_bookingSuedtirolEcommerce, this)(oBookingData, aLayerVariables) 8656 } 8657 ; 8658 this.bookingFeratelEcommerce = function(oBookingData, aLayerVariables) { 8659 $.proxy(_bookingFeratelEcommerce, this)(oBookingData, aLayerVariables) 8660 } 8661 ; 8662 this.pushToConsole = function(oJson) { 8663 $.proxy(_pushToConsole, this)(oJson) 8664 } 8665 ; 8666 return this 8667 } 8668 $.googleTagManagerHelper = function() { 8669 var oGoogleTagManagerHelper = new googleTagManagerHelper(); 8670 return oGoogleTagManagerHelper 8671 } 8672}(jQuery)); 8673var oGoogleTagManagerHelper = $.googleTagManagerHelper(); 8674(function($) { 8675 function jsonFormular(element, options) { 8676 $.data(element, 'jsonFormular', this); 8677 var _version = 'v1.2'; 8678 var _options = $.extend({ 8679 sJsonFormName: '', 8680 onSubmit: function() {}, 8681 onCheckFormular: function() {}, 8682 onAjaxUpdate: function() {}, 8683 onError: function() {}, 8684 onErrorComplete: function() {}, 8685 getOffset: function() { 8686 var lOffset = 0; 8687 if ($('header.pageheader').length && $('header.pageheader').css('position') == 'fixed') { 8688 lOffset = $('header.pageheader').height() + 50 8689 } 8690 return lOffset * -1 8691 },
8692 bScrollToError: false, 8693 lIconsVersion: 1, 8694 bReCaptcha: false, 8695 sReCaptchaType: '', 8696 sReCaptchaVersion: '', 8697 sReCaptchaInitFunction: '' 8698 }, options); 8699 var _oFormElement = element; 8700 var _bCaptchaPassed = false; 8701 var _sReCaptchaID = undefined; 8702 var _bLockAjax = false; 8703 var _bError = false; 8704 var _oCheckboxPath = []; 8705 var _aClickedButtons = []; 8706 var _aClickedButtonsTimeouts = []; 8707 var _aErrorKeys = []; 8708 var _bSubmitFormOnLoad = false; 8709 var _bCaptchaLoaded = false; 8710 var _bCaptchaScriptLoaded = false; 8711 var _oLazyReCaptchaEvent = undefined; 8712 var _oLazyReCaptchaEventFunction = undefined; 8713 function _resetLock() { 8714 _bLockAjax = false 8715 } 8716 function _checkFormular(oData, oThis) { 8717 if (_options.bReCaptcha && _options.sReCaptchaType == 'Invisible' && _options.sReCaptchaVersion == 'V2' && typeof oThis == 'undefined') { 8718 if (_bCaptchaPassed) { 8719 _startSubmit(oData, oThis) 8720 } else if (!_bCaptchaLoaded) { 8721 _bSubmitFormOnLoad = true; 8722 $.proxy(_loadLazyReCaptcha, oThis)() 8723 } else { 8724 _reCaptcha('execute', oData, oThis) 8725 } 8726 } else { 8727 _startSubmit(oData, oThis) 8728 } 8729 } 8730 function _reCaptcha(sStatus, oData, oThis) { 8731 if (_options.bReCaptcha) { 8732 if (_options.sReCaptchaType == 'Invisible' && _options.sReCaptchaVersion == 'V2') { 8733 switch (sStatus) { 8734 case 'render': 8735 _sReCaptchaID = grecaptcha.render(oData.FN + 'gaReCaptchaElement', { 8736 'sitekey': _options.sReCaptchaWebsiteKey, 8737 'size': 'invisible', 8738 'badge': 'inline', 8739 'callback': eval(oData.FN + 'ReCaptchaCallback'), 8740 'expired-callback': eval(oData.FN + 'ReCaptchaExpired'), 8741 'error-callback': eval(oData.FN + 'ReCaptchaError') 8742 }); 8743 _bCaptchaLoaded = true; 8744 if (_bSubmitFormOnLoad) { 8745 _bSubmitFormOnLoad = false; 8746 _checkFormular(oData, oThis) 8747 } 8748 break; 8749 case 'execute': 8750 grecaptcha.execute(_sReCaptchaID); 8751 break; 8752 case 'callback': 8753 var sCaptchaResponse = grecaptcha.getResponse(_sReCaptchaID); 8754 if (sCaptchaResponse != '') { 8755 $('#' + oData.FN + 'gReCaptchaResponse').val(sCaptchaResponse); 8756 _bCaptchaPassed = true; 8757 _startSubmit(oData, oThis) 8758 } 8759 break; 8760 case 'reset': 8761 $('#' + oData.FN + 'gReCaptchaResponse').val(''); 8762 _bCaptchaPassed = false; 8763 grecaptcha.reset(_sReCaptchaID); 8764 break 8765 } 8766 } 8767 } 8768 } 8769 function _addMspc(sFormJS, sFormName) { 8770 $('#' + sFormName + ' .zepp-mspc').eq(0).find('[type=checkbox]').click(); 8771 $('#' + sFormName)[0].addEventListener('form-checked', function(evt) { 8772 var tokenElement = $('#' + sFormName).find('[name=_mosparo_validationToken]'); 8773 if (tokenElement.val() == '' && 'validationToken'in evt.detail) { 8774 tokenElement.val(evt.detail.validationToken) 8775 } 8776 eval(sFormJS) 8777 }) 8778 } 8779 function _startSubmit(oData, oThis) { 8780 var oPostData = new Object(); 8781 var bUploading = false; 8782 _bError = false; 8783 if (_bLockAjax) { 8784 return 8785 } 8786 _options.onCheckFormular();
8787 if (typeof oThis == 'undefined' || typeof oThis == 'function') { 8788 _bLockAjax = true; 8789 $.each(oData.FF, function(sKey) { 8790 oData.FF[sKey] = ''; 8791 var oField = $('#' + oData.FN + sKey); 8792 if (sKey == '_mosparo_submitToken' || sKey == '_mosparo_validationToken') { 8793 oField = $('#' + oData.FN + ' [name=' + sKey + ']') 8794 } 8795 if ($(oField).length == 0) { 8796 $('#' + oData.FN + ' input[name="' + sKey + '"][type="radio"]').each(function(i, oField) { 8797 if ($(oField).is(':checked')) { 8798 oData.FF[sKey] = $(oField).val() 8799 } 8800 }); 8801 $('#' + oData.FN + ' input[name="' + sKey + '"][type="checkbox"]').each(function(i, oField) { 8802 if ($(oField).is(':checked')) { 8803 if (!(oData.FF[sKey]instanceof Array)) { 8804 oData.FF[sKey] = [] 8805 } 8806 oData.FF[sKey].push($(oField).val()) 8807 } 8808 }) 8809 } else { 8810 if ($(oField)[0].uploading == true) { 8811 bUploading = true 8812 } 8813 if ($(oField).attr('type') !== undefined && ($(oField).attr('type').toLowerCase() === 'checkbox' || $(oField).attr('type').toLowerCase() === 'radio')) { 8814 if ($(oField).is(':checked')) { 8815 oData.FF[sKey] = $(oField).val() 8816 } 8817 } else { 8818 oData.FF[sKey] = $(oField).val() 8819 } 8820 } 8821 }); 8822 oPostData = oData.FF; 8823 oPostData.bSend = true; 8824 if (typeof oThis == 'function') { 8825 oPostData.bOnlyCheck = true 8826 } 8827 oPostData.oData = JSON.stringify(oData) 8828 } else { 8829 var sFieldKey = ''; 8830 $.each(oData.FK, function(sKey) { 8831 if (oData.FK[sKey][oThis.name] !== undefined) { 8832 sFieldKey = sKey 8833 } else if (sKey == 'sendByFieldCheck') { 8834 $.each(oData.FK[sKey], function(sName) { 8835 oPostData[sName] = $('#' + oData.FN + sName).val() 8836 }) 8837 } 8838 }); 8839 if (oThis.tagName.toLowerCase() == 'input' && oThis.type.toLowerCase() == 'checkbox' && oThis.checked == false) { 8840 oData.FF[oThis.name] = '' 8841 } else { 8842 oData.FF[oThis.name] = $(oThis).val() 8843 } 8844 if (sFieldKey != '') { 8845 $.proxy(_remove, this)(oData, oThis, oData.RF[oThis.name]); 8846 $.each(oData.FK[sFieldKey], function(sKey) { 8847 if ($('#' + oData.FN + sKey)[0].tagName.toLowerCase() == 'input' && $('#' + oData.FN + sKey)[0].type.toLowerCase() == 'checkbox' && $('#' + oData.FN + sKey)[0].checked == false) { 8848 oPostData[sKey] = '' 8849 } else { 8850 oPostData[sKey] = $('#' + oData.FN + sKey).val() 8851 } 8852 }) 8853 } else { 8854 oPostData[oThis.name] = oData.FF[oThis.name] 8855 } 8856 oPostData.sFormName = oData.FN; 8857 oPostData.sFormGroupName = oData.GN; 8858 oPostData.bSend = true; 8859 oPostData.bOnlyField = true; 8860 oPostData.sFieldKey = oThis.name; 8861 if (oData.RF[oThis.name] !== undefined) { 8862 if (sFieldKey != '') { 8863 var sRF = ''; 8864 $.each(oData.FK[sFieldKey], function(sKey) { 8865 if (oData.RF[sKey] !== undefined) { 8866 sRF += '\',\'' + sKey + '\':\'' + oData.R
8866F[sKey] 8867 } 8868 }); 8869 oPostData.oData = '{\'RF\':{\'' + sRF.substr(3) + '\'}}' 8870 } else { 8871 oPostData.oData = '{\'RF\':{\'' + oThis.name + '\':\'' + oData.RF[oThis.name] + '\'}}' 8872 } 8873 } 8874 } 8875 if (oData.SA != '') { 8876 oPostData.sSharedKey = oData.SA 8877 } 8878 if (oData.FV != '') { 8879 oPostData.sFormVersion = oData.FV 8880 } 8881 if (bUploading) { 8882 alert(oData.DI['sUploadinProgress']); 8883 _bLockAjax = false; 8884 return 8885 } 8886 var sUrl = location.protocol + '//' + location.host + location.pathname + (location.search ? location.search : ''); 8887 if (oData.FA != '') { 8888 sUrl = oData.FA 8889 } 8890 var ua = window.navigator.userAgent; 8891 var msie = ua.indexOf('MSIE '); 8892 $.ajax(msie > 0 ? encodeURI(sUrl) : sUrl, { 8893 data: oPostData, 8894 type: 'POST', 8895 traditional: true, 8896 success: $.proxy(function(data) { 8897 var isJson = true; 8898 var oResponse = null; 8899 try { 8900 oResponse = $.parseJSON(data) 8901 } catch (e) { 8902 isJson = false 8903 } 8904 if (oData.AC != '' && !isJson) { 8905 $('#' + oData.AC).html(data); 8906 _options.onAjaxUpdate(); 8907 _bLockAjax = false; 8908 return 8909 } 8910 if (oResponse !== null && oResponse.OK == undefined) { 8911 if (_aErrorKeys.length > 0) { 8912 $.each(_aErrorKeys, function(k, v) { 8913 v.html('') 8914 }) 8915 } 8916 if (oResponse.submit == true) { 8917 if (oResponse.params !== undefined) { 8918 $.each(oResponse.params, function(sKey, sVal) { 8919 if ($('#' + oData.FN + sKey).length != 0) { 8920 $('#' + oData.FN + sKey).val(oResponse.params[sKey]) 8921 } else { 8922 $('#' + oData.FN).prepend($('<input />', { 8923 type: 'hidden', 8924 name: sKey, 8925 value: oResponse.params[sKey] 8926 })) 8927 } 8928 }) 8929 } 8930 if (oResponse.sAction !== undefined) { 8931 $('#' + oData.FN).prop('action', oResponse.sAction) 8932 } 8933 if (oResponse.sMethod !== undefined) { 8934 $('#' + oData.FN).prop('method', oResponse.sMethod) 8935 } 8936 if (oResponse.TF !== undefined) { 8937 $.each(oResponse.TF, function(sKey, sVal) { 8938 if ($('#' + oData.FN + sKey).length) { 8939 if (sVal == true || sVal == false) { 8940 $('#' + oData.FN + sKey)[0].disabled = !sVal 8941 } else { 8942 $('#' + oData.FN + sKey)[0].disabled = !$('#' + oData.FN + sKey)[0].disabled 8943 } 8944 } 8945 }) 8946 } 8947 if (oResponse.TM != undefined) { 8948 eval(oResponse.TM) 8949 } 8950 if (typeof (Iris) != 'undefined') { 8951 Iris.track('ThankYou', oData.FN, undefined, { 8952 'dynamicValues': (oResponse.params !== undefined ? oResponse.params : {}) 8953 }); 8954 Iris.getSetStatus(oResponse.IS, oData.FN, {
8955 'aSkipOtherActions': ['ThankYou'], 8956 'dynamicValues': (oResponse.params !== undefined ? oResponse.params : {}) 8957 }); 8958 Iris.getEcommerce(oResponse.IEC) 8959 } 8960 _options.onSubmit(oResponse.params !== undefined ? oResponse.params : {}); 8961 window.setTimeout(function() { 8962 $('#' + oData.FN)[0].submit() 8963 }, 2000); 8964 _bLockAjax = false; 8965 return 8966 } else if (oResponse.TH != undefined) { 8967 if (oResponse.TM != undefined) { 8968 eval(oResponse.TM) 8969 } 8970 $.each(oResponse.TH, $.proxy(function(sKey, sValue) { 8971 if ($('#' + sKey).length > 0) { 8972 $('#' + sKey).html(oResponse.TH[sKey]) 8973 } 8974 if (typeof (Iris) != 'undefined') { 8975 Iris.track('ThankYou', oData.FN, undefined, { 8976 'dynamicValues': (oResponse.params !== undefined ? oResponse.params : {}) 8977 }); 8978 Iris.getSetStatus(oResponse.IS, oData.FN, { 8979 'aSkipOtherActions': ['ThankYou'], 8980 'dynamicValues': (oResponse.params !== undefined ? oResponse.params : {}) 8981 }); 8982 Iris.getEcommerce(oResponse.IEC) 8983 } 8984 _options.onSubmit(oResponse.params !== undefined ? oResponse.params : {}) 8985 }, this)) 8986 } else if (oResponse.EH != undefined) { 8987 if (oResponse.TM != undefined) { 8988 eval(oResponse.TM) 8989 } 8990 $.each(oResponse.EH, $.proxy(function(sKey) { 8991 if ($('#' + sKey).length > 0) { 8992 _aErrorKeys.push($('#' + sKey)); 8993 $('#' + sKey).html(oResponse.EH[sKey]) 8994 } 8995 if (typeof (Iris) != 'undefined') { 8996 if (oThis == undefined) { 8997 Iris.track('Error', oData.FN) 8998 } else { 8999 Iris.track('FieldError', oData.FN) 9000 } 9001 } 9002 _bError = true; 9003 _options.onError(oResponse) 9004 }, this)) 9005 } else if (oResponse.RB != undefined) { 9006 $('#' + oData.FN + 'RequestBlocked').remove(); 9007 var oFormError = $('<div id="' + oData.FN + 'RequestBlocked" class="error">' + oResponse.RB + '</div>'); 9008 $('#' + oData.FN).prepend(oFormError); 9009 $('html, body').animate({ 9010 scrollTop: $('#' + oData.FN + ' div.error').first().offset().top + _options.getOffset() 9011 }, 1000) 9012 } else if (oResponse.RC != undefined) { 9013 _bCaptchaPassed = false; 9014 _reCaptcha('reset', oData, oThis); 9015 _reCaptcha('execute', oData, oThis) 9016 } else if (oResponse.MC != undefined) { 9017 eval('m' + oData.FN + '.requestSubmitToken()') 9018 } else { 9019 if (oResponse.TM != undefined) { 9020 eval(oResponse.TM) 9021 } 9022 if (typeof (Iris) != 'undefined') { 9023 if (oThis == undefined) { 9024 Iris.track('Error', oData.FN) 9025 } else { 9026 Iris.track('FieldError', oData.FN) 9027 } 9028 } 9029 _bError = true; 9030 _options.onError(oResponse) 9031 } 9032 } else {
9033 _bLockAjax = false; 9034 if ($(oThis) != undefined) { 9035 $(oThis).closest('div').removeClass('active active' + oData.FV); 9036 $(oThis).closest('div').removeClass('active') 9037 } 9038 if (oThis != undefined && oData.RF[oThis.name] !== undefined) { 9039 $(oThis).closest('div').addClass('ok ok' + oData.FV); 9040 if ($(oThis).length > 0) { 9041 if ($(oThis).next('div.okicon').length == 0) { 9042 if ($(oThis).first().attr('type') == null || ($(oThis).first().attr('type').toLowerCase() != 'checkbox' && $(oThis).first().attr('type').toLowerCase() != 'radio')) { 9043 if (oData.FV == 'V1' || oData.FV == 'V2') { 9044 var oOkIcon = $('<div></div>', { 9045 'class': 'okicon' 9046 }); 9047 var oOkIconInnen = $('<div></div>'); 9048 oOkIconInnen.html(''); 9049 oOkIconInnen.createSvg('icon-check'); 9050 oOkIcon.html(oOkIconInnen); 9051 $(oThis).after(oOkIcon) 9052 } else if (oData.FV == 'V6') { 9053 var oOkIcon = $('<div></div>', { 9054 'class': 'okicon' 9055 }); 9056 oOkIcon.html(''); 9057 oOkIcon.createSvg('icon-check'); 9058 $(oThis).after(oOkIcon) 9059 } 9060 } 9061 if (oResponse !== null && oResponse.OK != undefined && oResponse.OK[oThis.name] != undefined) { 9062 $.proxy(_createFormText, this)(oThis, oResponse.OK[oThis.name], oData.FV) 9063 } else { 9064 $.proxy(_createFormText, this)(oThis, '', oData.FV) 9065 } 9066 } 9067 } 9068 } 9069 return 9070 } 9071 if (typeof oThis == 'function') { 9072 if (oResponse.check == true) { 9073 oThis(true) 9074 } else { 9075 oThis(false) 9076 } 9077 _bLockAjax = false 9078 } 9079 if (_aClickedButtons.length > 0) { 9080 $.each(_aClickedButtons, $.proxy(function(i, o) { 9081 clearTimeout(_aClickedButtonsTimeouts[i]); 9082 $(o).removeClass('clicked'); 9083 $(o).children('span.spinner').remove() 9084 }, this)); 9085 _aClickedButtons = []; 9086 _aClickedButtonsTimeouts = [] 9087 } 9088 if (typeof (oResponse.ER) != 'undefined') { 9089 $.each(oResponse.ER, $.proxy(function(sKey, sValue) { 9090 var oField = $('#' + oData.FN + sKey); 9091 if ($(oField).length == 0) { 9092 oField = $('#' + oData.FN + ' input[name="' + sKey + '"][type="radio"]')[0] 9093 } 9094 if ($(oField).length == 0) { 9095 oField = $('#' + oData.FN + ' input[name="' + sKey + '"][type="checkbox"]')[0] 9096 } 9097 if ($(oField).val() == '') { 9098 $(oField).val(oData.RF[sKey]) 9099 } 9100 $(oField).closest('div').removeClass('active active' + oData.FV); 9101 if ($(oField).attr('type') == null || (($(oField).attr('type').toLowerCase() != 'checkbox' && $(oField).attr('type').toLowerCase() != 'radio') || (oData.FV != 'V1' && oData.FV != 'V2'))) { 9102 $(oField).closest('div').removeClass('ok ok' + oData.FV).addClass('error error' + oData.FV) 9103 } else { 9104 $(oField).closest('div').removeClass('ok').addClass('error') 9105 } 9106 _bError = true; 9107 $.proxy(_createError, this)(oData, oField, oResponse.ER, sKey) 9108 }, this)) 9109 } 9110 if (_bError) { 9111 if (_options.bScrollToError) { 9112 $('html, body').animate({ 9113 scrollTop: $('#' + oData.FN + ' div.error:not(:empty)').first().offset().top + _options.getOffset() 9114 }, 1000) 9115 }
9116 _options.onErrorComplete() 9117 } 9118 _bLockAjax = false 9119 }, this) 9120 }); 9121 oPostData = null 9122 } 9123 function _generateIcons(options) { 9124 _options = $.extend({ 9125 sFormName: '' 9126 }, $.extend(_options, options || {})); 9127 var sFormName = _options.sFormName; 9128 var oCheckboxField = null; 9129 var oRadioField = null; 9130 var oThat = this; 9131 $('#' + sFormName + ' div.checkboxfield').each(function(i, o) { 9132 oCheckboxField = $(o).find('input[type=checkbox]'); 9133 var oSvg = $(o).find('svg'); 9134 oSvg.removeClass(); 9135 var oUse = oSvg.find('use'); 9136 if ($(oCheckboxField).prop('checked') == undefined || $(oCheckboxField).prop('checked') == false) { 9137 oSvg.addClass('icon icon-checkbox'); 9138 oUse.attr('xlink:href', '#icon-checkbox') 9139 } else { 9140 oSvg.addClass('icon icon-checkbox-checked'); 9141 oUse.attr('xlink:href', '#icon-checkbox-checked') 9142 } 9143 }); 9144 $('#' + sFormName + ' div.radiofield').each(function(i, o) { 9145 oRadioField = $(o).find('input[type=radio]'); 9146 var oSvg = $(o).find('svg'); 9147 oSvg.removeClass(); 9148 var oUse = oSvg.find('use'); 9149 if ($(oRadioField).prop('checked') == undefined || $(oRadioField).prop('checked') == false) { 9150 oSvg.addClass('icon icon-radio'); 9151 oUse.attr('xlink:href', '#icon-radio') 9152 } else { 9153 oSvg.addClass('icon icon-radio-checked'); 9154 oUse.attr('xlink:href', '#icon-radio-checked') 9155 } 9156 }) 9157 } 9158 function _disableFieldByFieldCheck(oData) { 9159 $('input, select, textarea, button', '#' + oData.FN).each(function(i, o) { 9160 $(this).bind('blur', function() { 9161 if ($(o).closest('div')) { 9162 $(o).closest('div').removeClass('active').removeClass('active' + oData.FV) 9163 } 9164 }) 9165 }) 9166 } 9167 function _remove(oData, oThis, sDeleteThis) { 9168 var bWaiting = true; 9169 if ($(oThis).val() == sDeleteThis && sDeleteThis != undefined) 9170 $(oThis).val(''); 9171 if ($(oThis).next('div').length) { 9172 if ($(oThis).parent().find('div.erroricon').length) { 9173 $(oThis).parent().find('div.erroricon').remove() 9174 } 9175 if ($(oThis).next('div.formtext' + oData.FV).length) { 9176 if (oData.FV == 'V3' || oData.FV == 'V4' || oData.FV == 'V7') { 9177 $(oThis).next('div.formtext' + oData.FV).slideUp({ 9178 duration: 200, 9179 complete: function() { 9180 bWaiting = false; 9181 $(oThis).next('div.formtext' + oData.FV).remove() 9182 } 9183 }) 9184 } else { 9185 bWaiting = false; 9186 $(oThis).next('div.formtext' + oData.FV).remove() 9187 } 9188 } else { 9189 bWaiting = false 9190 } 9191 if ($(oThis).next('div.okicon').length) { 9192 $(oThis).next('div.okicon').remove() 9193 } 9194 } else { 9195 bWaiting = false 9196 } 9197 ($.proxy(function() { 9198 if (bWaiting) { 9199 setTimeout($.proxy(arguments.callee, this), 20) 9200 } else { 9201 $.proxy(_createFormText, this)(oThis, oData.IT[oThis.name], oData.FV); 9202 $.proxy(_setActiveStatus, this)(oThis, oData) 9203 } 9204 }, this))() 9205 } 9206 function _restoreRequiredValue(oThis, sRestoreThis) { 9207 if ($(oThis).val() == '' && sRestoreThis != undefined) 9208 $(oThis).val(sRestoreThis) 9209 } 9210 function _setCheckbox(oEvent) {
9211 var oThis = oEvent.target ? oEvent.target : oEvent.srcElement; 9212 var oSpan = $(oThis).prev('span'); 9213 var oSvg = $(oThis).prev('svg'); 9214 var bCheckedIcon = null; 9215 var sEventType = oEvent.type.toLowerCase(); 9216 if (sEventType.substr(0, 3) == 'key') { 9217 if (oEvent.keyCode != 32) { 9218 sEventType = '' 9219 } 9220 } 9221 if (sEventType == 'mouseup' || sEventType == 'keyup' || sEventType == 'mousedown' || sEventType == 'keydown' || sEventType == 'mouseout' || sEventType == 'click') { 9222 switch (sEventType) { 9223 case 'mouseup': 9224 case 'keyup': 9225 if (oThis.checked) { 9226 bCheckedIcon = false 9227 } else { 9228 bCheckedIcon = true 9229 } 9230 break; 9231 case 'mousedown': 9232 case 'keydown': 9233 if (oThis.checked) { 9234 bCheckedIcon = false 9235 } else { 9236 bCheckedIcon = true 9237 } 9238 break; 9239 case 'mouseout': 9240 case 'click': 9241 if (oThis.checked) { 9242 bCheckedIcon = true 9243 } else { 9244 bCheckedIcon = false 9245 } 9246 break 9247 } 9248 if (sEventType == 'click') { 9249 if (bCheckedIcon) { 9250 oSvg.removeClass('icon-checkbox'); 9251 oSvg.addClass('icon-checkbox-checked'); 9252 oSvg.find('use').attr('xlink:href', '#icon-checkbox-checked') 9253 } else { 9254 oSvg.removeClass('icon-checkbox-checked'); 9255 oSvg.addClass('icon-checkbox'); 9256 oSvg.find('use').attr('xlink:href', '#icon-checkbox') 9257 } 9258 } 9259 } 9260 } 9261 function _createFormText(oElement, sFormText, sVersion) { 9262 if ($(oElement).prop('tagName').toLowerCase() == 'select') { 9263 oElement = $(oElement).closest('span.field') 9264 } 9265 if ($(oElement).next('div.formtext' + sVersion).length > 0) { 9266 $(oElement).next('div.formtext' + sVersion).remove() 9267 } 9268 if (sFormText != '' && sFormText != undefined) { 9269 var oFormText = $('<div></div>', { 9270 'class': 'formtext' + sVersion 9271 }); 9272 if (sVersion == 'V3' || sVersion == 'V4' || sVersion == 'V7') { 9273 var oFormTextInnen = $('<div></div>'); 9274 $(oFormText).append(oFormTextInnen); 9275 $(oFormTextInnen).html(sFormText); 9276 $(oFormText).hide() 9277 } else { 9278 $(oFormText).html(sFormText) 9279 } 9280 if ($(oElement).prop('tagName').toLowerCase() == 'select') { 9281 $(oElement).next('span.select').after(oFormText) 9282 } else { 9283 $(oElement).after(oFormText) 9284 } 9285 if (sVersion == 'V1' || sVersion == 'V2') { 9286 var oFormTextInnen = document.createElement('div'); 9287 $(oFormText).append(oFormTextInnen) 9288 } 9289 if (sVersion == 'V3' || sVersion == 'V4' || sVersion == 'V7') { 9290 $(oFormText).slideDown(200) 9291 } 9292 } 9293 } 9294 function _setActiveStatus(oThis, oData) { 9295 $(oThis).closest('div').removeClass('ok').removeClass('ok' + oData.FV); 9296 $(oThis).closest('div').removeClass('error').removeClass('error' + oData.FV); 9297 if ($(oThis).attr('type') != null && ($(oThis).attr('type').toLowerCase() == 'checkbox' || $(oThis).attr('type').toLowerCase() == 'radio')) { 9298 $(oThis).closest('div').addClass('active') 9299 } else { 9300 $(oThis).closest('div').addClass('active').addClass('active' + oData.FV) 9301 } 9302 } 9303 function _setSelectbox(oThis) { 9304 $(oThis).parent().find('span.select').html($('option:selected', oThis).html()) 9305 } 9306 function _submitOnEnter(oEvent, sFunction) { 9307 if (oEvent.keyCode == 13 && !oEvent.shiftKey) { 9308 window.setTimeout(sFunction, 1) 9309 } 9310 return false 9311 } 9312 function _changeURL(sId, sUrl) { 9313 document.getElementById(sId).action = sUrl; 9314 document.getElementById(sId).submit() 9315 } 9316 function _setCheckboxPath(options) { 9317 if (options.oCheckedIcon != undefined) { 9318 _oCheckboxPath[1] = { 9319 'aPaths': options.oCheckedIcon.aPaths, 9320 'aColors': options.oCheckedIcon.aColors 9321 } 9322 } 9323 if (options.oIcon != undefined) { 9324 _oCheckboxPath[0] = { 9325 'aPaths': options.oIcon.aPaths, 9326 'aColors': options.oIcon.aColors 9327 } 9328 } 9329 } 9330 function _createError(oData, oField, oResponse, sKey) { 9331 if ($(oField).closest('div').children('div.erroricon').length == 0) { 9332 if (oData.FV == 'V1' || oData.FV == 'V2' || ((oData.FV == 'V3' || oData.FV == 'V4' || oData.FV == 'V7') && $(oField).attr('type') != null && $(oField).attr('type').toLowerCase() == 'checkbox')) { 9333 if ($(oField).next('div.erroricon').length > 0) { 9334 return 9335 } 9336 var oErrorIcon = $('<div></div>', { 9337 'class': 'erroricon' 9338 }); 9339 var oErrorIconInnen = $('<div></div>'); 9340 $(oErrorIcon).html(oErrorIconInnen); 9341 oErrorIcon.html(''); 9342 oErrorIcon.createSvg('icon-callsign-round-inv'); 9343 $(oField).after(oErrorIcon) 9344 } else if (oData.FV == 'V5') { 9345 if ($(oField).children('div.erroricon').length > 0) { 9346 return 9347 } 9348 var oErrorIcon = $('<div></div>', { 9349 'class': 'erroricon' 9350 }); 9351 oErrorIcon.html(''); 9352 oErrorIcon.createSvg('icon-callsign'); 9353 $(oField).after(oErrorIcon) 9354 } else if (oData.FV == 'V6') { 9355 if ($(oField).children('div.erroricon').length > 0) { 9356 return 9357 } 9358 var oErrorIcon = $('<div></div>', { 9359 'class': 'erroricon' 9360 }); 9361 oErrorIcon.html(''); 9362 oErrorIcon.createSvg('icon-cross'); 9363 $(oField).after(oErrorIcon) 9364 } 9365 } 9366 $.proxy(_createFormText, this)(oField, oResponse[sKey], oData.FV) 9367 } 9368 function _createSpinnerIcon(oThis) {
9369 oThis = $(oThis); 9370 _aClickedButtons.push(oThis); 9371 oThis.addClass('clicked'); 9372 var oSpinner = document.createElement('span'); 9373 oSpinner.setAttribute('class', 'spinner'); 9374 $(oSpinner).html(''); 9375 $(oSpinner).createSvg('icon-spinner'); 9376 oThis.append(oSpinner) 9377 } 9378 function _setRadioButton(oEvent) { 9379 var oThis = oEvent.target ? oEvent.target : oEvent.srcElement; 9380 var oSpan = $(oThis).prev('span'); 9381 var oSvg = $(oThis).prev('svg'); 9382 var sEventType = oEvent.type.toLowerCase(); 9383 var bCheckedIcon = null; 9384 if (sEventType == 'click') { 9385 switch (sEventType) { 9386 case 'mouseup': 9387 if (oThis.checked) { 9388 bCheckedIcon = false 9389 } else { 9390 bCheckedIcon = true 9391 } 9392 break; 9393 case 'mousedown': 9394 if (oThis.checked) { 9395 bCheckedIcon = false 9396 } else { 9397 bCheckedIcon = true 9398 } 9399 break; 9400 case 'mouseout': 9401 case 'click': 9402 if (oThis.checked) { 9403 bCheckedIcon = true 9404 } else { 9405 bCheckedIcon = false 9406 } 9407 break 9408 } 9409 $('input[name="' + oThis.name + '"][type="radio"]').each(function(i, oField) { 9410 oField = $(oField); 9411 var oFieldSvg = oField.prev('svg'); 9412 if (!oFieldSvg.hasClass('icon-radio-disabled') && !oFieldSvg.hasClass('icon-radio-checkeddisabled')) { 9413 oFieldSvg.removeClass('icon-radio-checked'); 9414 oFieldSvg.addClass('icon-radio'); 9415 oFieldSvg.find('use').attr('xlink:href', '#icon-radio') 9416 } 9417 }); 9418 if (bCheckedIcon) { 9419 oSvg.removeClass('icon-radio'); 9420 oSvg.addClass('icon-radio-checked'); 9421 oSvg.find('use').attr('xlink:href', '#icon-radio-checked') 9422 } 9423 } 9424 } 9425 ;function _uploadFormular(oData, sId) { 9426 document.getElementById(sId).uploading = true; 9427 var sText = $('#' + sId + 'text').html(); 9428 var frame = document.getElementById(sId + 'frame'); 9429 document.getElementById(sId + 'text').innerHTML = oData.DI['sUploadHinweisText']; 9430 frame.style.display = 'none'; 9431 $.proxy(_getUploadFieldIcon, this)(sId, 1, 0); 9432 $.proxy(_getUploadFieldIcon, this)(sId, 1, 1); 9433 $(frame).bind('load', function() { 9434 if (frame.contentWindow.document.getElementById('status') != undefined) { 9435 if (frame.contentWindow.document.getElementById('status').innerHTML != '') { 9436 try { 9437 var data = eval('(' + frame.contentWindow.document.getElementById('status').innerHTML + ')') 9438 } catch (err) { 9439 var data = {} 9440 } 9441 if ($('#' + sId + 'status').data('lStatus') == 1) { 9442 if (data.file != null) { 9443 document.getElementById(sId).uploading = false; 9444 document.getElementById(sId).value = data.file.tempfile; 9445 document.getElementById(sId + 'text').innerHTML = data.file.text; 9446 $.proxy(_getUploadFieldIcon, this)(sId, 3, 0); 9447 $.proxy(_getUploadFieldIcon, this)(sId, 3, 1) 9448 } else { 9449 document.getElementById(sId).uploading = false; 9450 if (data.error != null) { 9451 document.getElementById(sId + 'text').innerHTML = data.error 9452 } else { 9453 document.getElementById(sId + 'text').innerHTML = oData.DI['sUploadHttpError'] 9454 } 9455 $.proxy(_getUploadFieldIcon, this)(sId, 2, 0); 9456 $.proxy(_getUploadFieldIcon, this)(sId, 2, 1) 9457 } 9458 } 9459 } 9460 } else { 9461 if ($('#' + sId + 'status').data('lStatus') == 1) { 9462 document.getElementById(sId).uploading = false;
9463 document.getElementById(sId + 'text').innerHTML = oData.DI['sUploadHttpError']; 9464 $.proxy(_getUploadFieldIcon, this)(sId, 2, 0); 9465 $.proxy(_getUploadFieldIcon, this)(sId, 2, 1) 9466 } 9467 } 9468 if ($('#' + sId).parent().find('div.erroricon')) { 9469 $('#' + sId).parent().find('div.erroricon').remove() 9470 } 9471 } 9472 .bind(this)); 9473 $('#' + sId + 'button').on('click', function() { 9474 document.getElementById(sId).uploading = false; 9475 var temp = document.getElementById(sId + 'frame').src; 9476 document.getElementById(sId + 'frame').src = 'about:blank'; 9477 $.proxy(_getUploadFieldIcon, this)(sId, 0, 0); 9478 $.proxy(_getUploadFieldIcon, this)(sId, 0, 1); 9479 $('#' + sId + 'button').off('click'); 9480 document.getElementById(sId + 'frame').style.display = ''; 9481 document.getElementById(sId + 'frame').src = temp; 9482 document.getElementById(sId).value = ''; 9483 document.getElementById(sId + 'text').innerHTML = sText; 9484 $.proxy(_remove, this)(oData, $('#' + sId), oData.RF[document.getElementById(sId).name]) 9485 } 9486 .bind(this)) 9487 } 9488 function _getUploadFieldIcon(oElement, lStatus, lType) { 9489 if (typeof (oElement) == 'string') { 9490 oElement = $('#' + oElement + ((lType == 1) ? 'button' : 'status')) 9491 } 9492 oElement.attr('data-icon', 'status' + lStatus + 'type' + lType); 9493 if (lType == 0) { 9494 oElement.data('lStatus', lStatus) 9495 } 9496 var oSvg = oElement.find('svg'); 9497 switch (lStatus) { 9498 case 1: 9499 if (lType == 1) { 9500 oSvg.removeClass(''); 9501 oSvg.addClass('icon icon-cross-round-inv'); 9502 oSvg.find('use').attr('xlink:href', '#icon-cross-round-inv') 9503 } else { 9504 oSvg.removeClass(''); 9505 oSvg.addClass('icon icon-file'); 9506 oSvg.find('use').attr('xlink:href', '#icon-file') 9507 } 9508 break; 9509 case 2: 9510 if (lType == 1) { 9511 oSvg.removeClass(''); 9512 oSvg.addClass('icon icon-cross-round-inv'); 9513 oSvg.find('use').attr('xlink:href', '#icon-cross-round-inv') 9514 } else { 9515 oSvg.removeClass(''); 9516 oSvg.addClass('icon icon-ban'); 9517 oSvg.find('use').attr('xlink:href', '#icon-ban') 9518 } 9519 break; 9520 case 3: 9521 if (lType == 1) { 9522 oSvg.removeClass(''); 9523 oSvg.addClass('icon icon-cross-round-inv'); 9524 oSvg.find('use').attr('xlink:href', '#icon-cross-round-inv') 9525 } else { 9526 oSvg.removeClass(''); 9527 oSvg.addClass('icon icon-check-round-inv'); 9528 oSvg.find('use').attr('xlink:href', '#icon-check-round-inv') 9529 } 9530 break; 9531 default: 9532 if (lType == 1) { 9533 oSvg.removeClass(''); 9534 oSvg.addClass('icon icon-openfolder'); 9535 oSvg.find('use').attr('xlink:href', '#icon-openfolder') 9536 } else { 9537 oSvg.removeClass(''); 9538 oSvg.addClass('icon icon-file'); 9539 oSvg.find('use').attr('xlink:href', '#icon-file') 9540 } 9541 } 9542 } 9543 function _setFields(oFields) { 9544 var sFormName = oFields.FN; 9545 delete oFields.FN; 9546 $.each(oFields, function(key, value) { 9547 $('#' + sFormName + key).val(value) 9548 }) 9549 } 9550 function _initLazyReCaptcha() { 9551 if (_options.bReCaptcha) { 9552 if (_oLazyReCaptchaEvent) 9553 return; 9554 _oLazyReCaptchaEventFunction = $.proxy(function() { 9555 if ($.proxy(_visibleInViewport, this)(true, true)) { 9556 $.proxy(_loadLazyReCaptcha, this)() 9557 } 9558 }, this); 9559 _oLazyReCaptchaEvent = $(window).on('DOMContentLoaded.wdgJsonFormularLazyReCapcha load.wdgJsonFormularLazyReCapcha resize.wdgJsonFormularLazyReCapcha scroll.wdgJsonFormularLazyReCapcha transitionend.wdgJsonFormularLazyReCapcha animationend.wdgJsonFormularLazyReCapcha webkitAnimationEnd.wdgJsonFormularLazyReCapcha overlayJs:showContent.wdgJsonFormularLazyReCapcha', _oLazyReCaptchaEventFunction); 9560 if ($.proxy(_visibleInViewport, this)(true, true)) { 9561 $.proxy(_loadLazyReCaptcha, this)() 9562 } 9563 } 9564 } 9565 function _loadLazyReCaptcha() { 9566 if (_oLazyReCaptchaEvent && !_bCaptchaScriptLoaded) { 9567 _bCaptchaScriptLoaded = true; 9568 $(window).off('.wdgJsonFormularLazyReCapcha', _oLazyReCaptchaEventFunction); 9569 _oLazyReCaptchaEvent = undefined; 9570 var gTagScript = document.createElement('script'); 9571 gTagScript.type = 'text/javascript'; 9572 gTagScript.async = true; 9573 gTagScript.setAttribute('defer', 'true'); 9574 gTagScript.src = 'https://www.google.com/recaptcha/api.js?onload=' + _options.sReCaptchaInitFunction + '&render=explicit'; 9575 var s = document.getElementsByTagName('script')[0]; 9576 s.parentNode.insertBefore(gTagScript, s) 9577 } 9578 } 9579 function _visibleInViewport(partial, hidden, direction) { 9580 var oElement = $(_oFormElement); 9581 if (oElement.length < 1) 9582 return; 9583 var $t = oElement.length > 1 ? oElement.eq(0) : oElement 9584 , t = $t.get(0) 9585 , $w = $(window) 9586 , vpWidth = $w.width() 9587 , vpHeight = $w.height() 9588 , direction = (direction) ? direction : 'both' 9589 , clientSize = hidden === true ? t.offsetWidth * t.offsetHeight : true; 9590 if (typeof t.getBoundingClientRect === 'function') { 9591 var rec = t.getBoundingClientRect() 9592 , tViz = rec.top >= 0 && rec.top < vpHeight 9593 , bViz = rec.bottom >
9593 0 && rec.bottom <= vpHeight 9594 , vViz = rec.top <= 0 && rec.bottom > 0 9595 , lViz = rec.left >= 0 && rec.left < vpWidth 9596 , rViz = rec.right > 0 && rec.right <= vpWidth 9597 , hViz = rec.left <= 0 && rec.right > 0 9598 , vVisible = partial ? tViz || bViz || vViz : tViz && bViz 9599 , hVisible = partial ? lViz || rViz || hViz : lViz && rViz; 9600 if (direction === 'both') 9601 return clientSize && vVisible && hVisible; 9602 else if (direction === 'vertical') 9603 return clientSize && vVisible; 9604 else if (direction === 'horizontal') 9605 return clientSize && hVisible 9606 } else { 9607 var viewTop = $w.scrollTop() 9608 , viewBottom = viewTop + vpHeight 9609 , viewLeft = $w.scrollLeft() 9610 , viewRight = viewLeft + vpWidth 9611 , offset = $t.offset() 9612 , _top = offset.top 9613 , _bottom = _top + $t.outerHeight() 9614 , _left = offset.left 9615 , _right = _left + $t.outerWidth() 9616 , compareTop = partial === true ? _bottom : _top 9617 , compareBottom = partial === true ? _top : _bottom 9618 , compareLeft = partial === true ? _right : _left 9619 , compareRight = partial === true ? _left : _right; 9620 if (direction === 'both') 9621 return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop)) && ((compareRight <= viewRight) && (compareLeft >= viewLeft)); 9622 else if (direction === 'vertical') 9623 return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop)); 9624 else if (direction === 'horizontal') 9625 return !!clientSize && ((compareRight <= viewRight) && (compareLeft >= viewLeft)) 9626 } 9627 } 9628 function _initSelect2(oForm) { 9629 var select2Fields = $(oForm).find('div.selectfield.select2[data-select2="true"]'); 9630 if (select2Fields.length) { 9631 if ($.fn.select2 === undefined) 9632 return; 9633 select2Fields.each(function(i, o) { 9634 var config = $(o).attr('data-select2-config'); 9635 var oOptions = {}; 9636 if (config && config != '') { 9637 eval('oOptions = ' + config) 9638 } 9639 $(o).find('select').select2(oOptions) 9640 }) 9641 } 9642 } 9643 this.resetLock = function() { 9644 $.proxy(_resetLock, this)() 9645 } 9646 ;
9647 this.checkFormular = function(oData, oThis) { 9648 $.proxy(_checkFormular, this)(oData, oThis) 9649 } 9650 ; 9651 this.reCaptcha = function(sStatus, oData, oThis) { 9652 $.proxy(_reCaptcha, this)(sStatus, oData, oThis) 9653 } 9654 ; 9655 this.addMspc = function(sFormJs, sFormName) { 9656 $.proxy(_addMspc, this)(sFormJs, sFormName) 9657 } 9658 ; 9659 this.generateIcons = function(options) { 9660 $.proxy(_generateIcons, this)(options) 9661 } 9662 ; 9663 this.disableFieldByFieldCheck = function(oData) { 9664 $.proxy(_disableFieldByFieldCheck, this)(oData) 9665 } 9666 ; 9667 this.remove = function(oData, oThis, sDeleteThis) { 9668 $.proxy(_remove, this)(oData, oThis, sDeleteThis) 9669 } 9670 ; 9671 this.restoreRequiredValue = function(oThis, sRestoreThis) { 9672 $.proxy(_restoreRequiredValue, this)(oThis, sRestoreThis) 9673 } 9674 ; 9675 this.setCheckbox = function(oEvent) { 9676 $.proxy(_setCheckbox, this)(oEvent) 9677 } 9678 ; 9679 this.setSelectbox = function(oThis) { 9680 $.proxy(_setSelectbox, this)(oThis) 9681 } 9682 ; 9683 this.submitOnEnter = function(oEvent, sFunction) { 9684 $.proxy(_submitOnEnter, this)(oEvent, sFunction) 9685 } 9686 ; 9687 this.changeURL = function(sId, sUrl) { 9688 $.proxy(_changeURL, this)(sId, sUrl) 9689 } 9690 ; 9691 this.setCheckboxPath = function(options) { 9692 $.proxy(_setCheckboxPath, this)(options) 9693 } 9694 ;
9695 this.createError = function(oData, oField, oResponse, sKey) { 9696 $.proxy(_createError, this)(oData, oField, oResponse, sKey) 9697 } 9698 ; 9699 this.createSpinnerIcon = function(oThis) { 9700 $.proxy(_createSpinnerIcon, this)(oThis) 9701 } 9702 ; 9703 this.setRadioButton = function(oEvent) { 9704 $.proxy(_setRadioButton, this)(oEvent) 9705 } 9706 ; 9707 this.uploadFormular = function(oData, sId) { 9708 $.proxy(_uploadFormular, this)(oData, sId) 9709 } 9710 ; 9711 this.setFields = function(oFields) { 9712 $.proxy(_setFields, this)(oFields) 9713 } 9714 ; 9715 _initLazyReCaptcha(); 9716 _initSelect2(element); 9717 return this 9718 } 9719 $.jsonFormular = function(oThis, oOptions) { 9720 var oJsonFormular = new jsonFormular(oThis,oOptions); 9721 return oJsonFormular 9722 } 9723 ; 9724 $.fn.jsonFormular = function(oOptions) { 9725 return this.each(function() { 9726 $.jsonFormular(this, oOptions) 9727 }) 9728 } 9729}(jQuery)); 9730(function($) { 9731 $.extend({ 9732 tmpl: function(tmpl, vals) { 9733 var rgxp, repr; 9734 tmpl = tmpl || ''; 9735 vals = vals || {}; 9736 rgxp = /#\{([^{}]*)}/g; 9737 repr = function(str, match) { 9738 return typeof vals[match] === 'string' || typeof vals[match] === 'number' ? vals[match] : "" 9739 } 9740 ; 9741 return tmpl.replace(rgxp, repr) 9742 } 9743 }) 9744} 9745)(jQuery); 9746;(function($, window, document, undefined) { 9747 function Owl(element, options) { 9748 this.settings = null; 9749 this.options = $.extend({}, Owl.Defaults, options); 9750 this.$element = $(element); 9751 this._handlers = {}; 9752 this._plugins = {}; 9753 this._supress = {}; 9754 this._current = null; 9755 this._speed = null; 9756 this._coordinates = []; 9757 this._breakpoint = null; 9758 this._width = null; 9759 this._items = []; 9760 this._clones = []; 9761 this._mergers = []; 9762 this._widths = []; 9763 this._invalidated = {}; 9764 this._pipe = []; 9765 this._drag = { 9766 time: null, 9767 target: null, 9768 pointer: null, 9769 stage: { 9770 start: null, 9771 current: null 9772 }, 9773 direction: null 9774 }; 9775 this._states = { 9776 current: {}, 9777 tags: { 9778 'initializing': ['busy'], 9779 'animating': ['busy'], 9780 'dragging': ['interacting'] 9781 } 9782 }; 9783 $.each(['onResize', 'onThrottledResize'], $.proxy(function(i, handler) { 9784 this._handlers[handler] = $.proxy(this[handler], this) 9785 }, this)); 9786 $.each(Owl.Plugins, $.proxy(function(key, plugin) { 9787 this._plugins[key.charAt(0).toLowerCase() + key.slice(1)] = new plugin(this) 9788 }, this)); 9789 $.each(Owl.Workers, $.proxy(function(priority, worker) { 9790 this._pipe.push({ 9791 'filter': worker.filter, 9792 'run': $.proxy(worker.run, this) 9793 }) 9794 }, this)); 9795 this.setup(); 9796 this.initialize() 9797 } 9798 Owl.Defaults = { 9799 items: 3, 9800 loop: false, 9801 center: false, 9802 rewind: false, 9803 checkVisibility: true, 9804 mouseDrag: true, 9805 touchDrag: true, 9806 pullDrag: true, 9807 freeDrag: false, 9808 margin: 0, 9809 stagePadding: 0, 9810 merge: false, 9811 mergeFit: true, 9812 autoWidth: false, 9813 startPosition: 0, 9814 rtl: false, 9815 smartSpeed: 250, 9816 fluidSpeed: false, 9817 dragEndSpeed: false, 9818 responsive: {}, 9819 responsiveRefreshRate: 200, 9820 responsiveBaseElement: window, 9821 fallbackEasing: 'swing', 9822 slideTransition: '', 9823 info: false, 9824 nestedItemSelector: false, 9825 itemElement: 'div', 9826 stageElement: 'div', 9827 refreshClass: 'owl-refresh', 9828 loadedClass: 'owl-loaded', 9829 loadingClass: 'owl-loading', 9830 rtlClass: 'owl-rtl', 9831 responsiveClass: 'owl-responsive', 9832 dragClass: 'owl-drag', 9833 itemClass: 'owl-item', 9834 stageClass: 'owl-stage', 9835 stageOuterClass: 'owl-stage-outer', 9836 grabClass: 'owl-grab' 9837 }; 9838 Owl.Width = { 9839 Default: 'default', 9840 Inner: 'inner', 9841 Outer: 'outer' 9842 }; 9843 Owl.Type = { 9844 Event: 'event', 9845 State: 'state' 9846 }; 9847 Owl.Plugins = {}; 9848 Owl.Workers = [{ 9849 filter: ['width', 'settings'], 9850 run: function() { 9851 this._width = this.$element.width() 9852 } 9853 }, {
vendor: 4,288 bytes, lines 9854-9959
9854 filter: ['width', 'items', 'settings'], 9855 run: function(cache) { 9856 cache.current = this._items && this._items[this.relative(this._current)] 9857 } 9858 }, { 9859 filter: ['items', 'settings'], 9860 run: function() { 9861 this.$stage.children('.cloned').remove() 9862 } 9863 }, { 9864 filter: ['width', 'items', 'settings'], 9865 run: function(cache) { 9866 var margin = this.settings.margin || '' 9867 , grid = !this.settings.autoWidth 9868 , rtl = this.settings.rtl 9869 , css = { 9870 'width': 'auto', 9871 'margin-left': rtl ? margin : '', 9872 'margin-right': rtl ? '' : margin 9873 }; 9874 !grid && this.$stage.children().css(css); 9875 cache.css = css 9876 } 9877 }, { 9878 filter: ['width', 'items', 'settings'], 9879 run: function(cache) { 9880 var width = (Math.ceil(this.width()) / this.settings.items).toFixed(3) - this.settings.margin 9881 , merge = null 9882 , iterator = this._items.length 9883 , grid = !this.settings.autoWidth 9884 , widths = []; 9885 cache.items = { 9886 merge: false, 9887 width: width 9888 }; 9889 while (iterator--) { 9890 merge = this._mergers[iterator]; 9891 merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge; 9892 cache.items.merge = merge > 1 || cache.items.merge; 9893 widths[iterator] = !grid ? this._items[iterator].width() : width * merge 9894 } 9895 this._widths = widths 9896 } 9897 }, { 9898 filter: ['items', 'settings'], 9899 run: function() { 9900 var clones = [] 9901 , items = this._items 9902 , settings = this.settings 9903 , view = Math.max(settings.items * 2, 4) 9904 , size = Math.ceil(items.length / 2) * 2 9905 , repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0 9906 , append = '' 9907 , prepend = ''; 9908 repeat /= 2; 9909 while (repeat > 0) { 9910 clones.push(this.normalize(clones.length / 2, true)); 9911 append = append + items[clones[clones.length - 1]][0].outerHTML; 9912 clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true)); 9913 prepend = items[clones[clones.length - 1]][0].outerHTML + prepend; 9914 repeat -= 1 9915 } 9916 this._clones = clones; 9917 $(append).addClass('cloned').appendTo(this.$stage); 9918 $(prepend).addClass('cloned').prependTo(this.$stage) 9919 } 9920 }, { 9921 filter: ['width', 'items', 'settings'], 9922 run: function() { 9923 var rtl = this.settings.rtl ? 1 : -1 9924 , size = this._clones.length + this._items.length 9925 , iterator = -1 9926 , previous = 0 9927 , current = 0 9928 , coordinates = []; 9929 while (++iterator < size) { 9930 previous = coordinates[iterator - 1] || 0; 9931 current = this._widths[this.relative(iterator)] + this.settings.margin; 9932 coordinates.push(previous + current * rtl) 9933 } 9934 this._coordinates = coordinates 9935 } 9936 }, { 9937 filter: ['width', 'items', 'settings'], 9938 run: function() { 9939 var padding = this.settings.stagePadding 9940 , coordinates = this._coordinates 9941 , css = { 9942 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2, 9943 'padding-left': padding || '', 9944 'padding-right': padding || '' 9945 }; 9946 this.$stage.css(css) 9947 } 9948 }, { 9949 filter: ['width', 'items', 'settings'], 9950 run: function(cache) { 9951 var iterator = this._coordinates.length 9952 , grid = !this.settings.autoWidth 9953 , items = this.$stage.children(); 9954 if (grid && cache.items.merge) { 9955 while (iterator--) { 9956 cache.css.width = this._widths[this.relative(iterator)]; 9957 items.eq(iterator).css(cache.css) 9958 } 9959 } else if (grid) {
9960 cache.css.width = cache.items.width; 9961 items.css(cache.css) 9962 } 9963 } 9964 }, { 9965 filter: ['items'], 9966 run: function() { 9967 this._coordinates.length < 1 && this.$stage.removeAttr('style') 9968 } 9969 }, { 9970 filter: ['width', 'items', 'settings'], 9971 run: function(cache) { 9972 cache.current = cache.current ? this.$stage.children().index(cache.current) : 0; 9973 cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current)); 9974 this.reset(cache.current) 9975 } 9976 }, { 9977 filter: ['position'], 9978 run: function() { 9979 this.animate(this.coordinates(this._current)) 9980 } 9981 }, { 9982 filter: ['width', 'position', 'items', 'settings'], 9983 run: function() { 9984 var rtl = this.settings.rtl ? 1 : -1, padding = this.settings.stagePadding * 2, begin = this.coordinates(this.current()) + padding, end = begin + this.width() * rtl, inner, outer, matches = [], i, n; 9985 for (i = 0, 9986 n = this._coordinates.length; i < n; i++) { 9987 inner = this._coordinates[i - 1] || 0; 9988 outer = Math.abs(this._coordinates[i]) + padding * rtl; 9989 if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end))) || (this.op(outer, '<', begin) && this.op(outer, '>', end))) { 9990 matches.push(i) 9991 } 9992 } 9993 this.$stage.children('.active').removeClass('active'); 9994 this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active'); 9995 this.$stage.children('.center').removeClass('center'); 9996 if (this.settings.center) { 9997 this.$stage.children().eq(this.current()).addClass('center') 9998 } 9999 } 10000 }]; 10001 Owl.prototype.initializeStage = function() { 10002 this.$stage = this.$element.find('.' + this.settings.stageClass); 10003 if (this.$stage.length) { 10004 return 10005 } 10006 this.$element.addClass(this.options.loadingClass); 10007 this.$stage = $('<' + this.settings.stageElement + '>', { 10008 "class": this.settings.stageClass 10009 }).wrap($('<div/>', { 10010 "class": this.settings.stageOuterClass 10011 })); 10012 this.$element.append(this.$stage.parent()) 10013 } 10014 ; 10015 Owl.prototype.initializeItems = function() { 10016 var $items = this.$element.find('.owl-item'); 10017 if ($items.length) { 10018 this._items = $items.get().map(function(item) { 10019 return $(item) 10020 }); 10021 this._mergers = this._items.map(function() { 10022 return 1 10023 }); 10024 this.refresh(); 10025 return 10026 } 10027 this.replace(this.$element.children().not(this.$stage.parent())); 10028 if (this.isVisible()) { 10029 this.refresh() 10030 } else { 10031 this.invalidate('width') 10032 } 10033 this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass) 10034 } 10035 ; 10036 Owl.prototype.initialize = function() { 10037 this.enter('initializing'); 10038 this.trigger('initialize'); 10039 this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl); 10040 if (this.settings.autoWidth && !this.is('pre-loading')) { 10041 var imgs, nestedSelector, width; 10042 imgs = this.$element.find('img'); 10043 nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined; 10044 width = this.$element.children(nestedSelector).width(); 10045 if (imgs.length && width <= 0) { 10046 this.preloadAutoWidthImages(imgs) 10047 } 10048 } 10049 this.initializeStage(); 10050 this.initializeItems(); 10051 this.registerEventHandlers(); 10052 this.leave('initializing'); 10053 this.trigger('initialized') 10054 } 10055 ; 10056 Owl.prototype.isVisible = function() { 10057 return this.settings.checkVisibility ? this.$element.is(':visible') : true 10058 } 10059 ; 10060 Owl.prototype.setup = function() { 10061 var viewport = this.viewport() 10062 , overwrites = this.options.responsive 10063 , match = -1 10064 , settings = null; 10065 if (!overwrites) { 10066 settings = $.extend({}, this.options) 10067 } else { 10068 $.each(overwrites, function(breakpoint) { 10069 if (breakpoint <= viewport && breakpoint > match) { 10070 match = Number(breakpoint) 10071 } 10072 }); 10073 settings = $.extend({}
10073, this.options, overwrites[match]); 10074 if (typeof settings.stagePadding === 'function') { 10075 settings.stagePadding = settings.stagePadding() 10076 } 10077 delete settings.responsive; 10078 if (settings.responsiveClass) { 10079 this.$element.attr('class', this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s','g'), '$1' + match)) 10080 } 10081 } 10082 this.trigger('change', { 10083 property: { 10084 name: 'settings', 10085 value: settings 10086 } 10087 }); 10088 this._breakpoint = match; 10089 this.settings = settings; 10090 this.invalidate('settings'); 10091 this.trigger('changed', { 10092 property: { 10093 name: 'settings', 10094 value: this.settings 10095 } 10096 }) 10097 } 10098 ; 10099 Owl.prototype.optionsLogic = function() { 10100 if ((this._items.length < this.settings.items || (this._items.length == this.settings.items && !this.settings.loopSameItems)) && !this.settings.autoWidth) { 10101 if (this.settings.loop) { 10102 this.settings.loop = false 10103 } 10104 this.settings.mouseDrag = false; 10105 this.settings.touchDrag = false; 10106 this.settings.pullDrag = false 10107 } 10108 if ((this._items.length < this.settings.items || (this._items.length == this.settings.items && !this.settings.loopSameItems)) && (this.settings.nav || this.settings.dots)) { 10109 this.$element.addClass('no-navi'); 10110 this._width = this.$element.width() 10111 } else if (this.$element.hasClass('no-navi') && (this.settings.nav || this.settings.dots)) { 10112 this.$element.removeClass('no-navi'); 10113 this._width = this.$element.width() 10114 } 10115 if (this.settings.autoWidth) { 10116 this.settings.stagePadding = false; 10117 this.settings.merge = false 10118 } 10119 } 10120 ; 10121 Owl.prototype.prepare = function(item) { 10122 var event = this.trigger('prepare', { 10123 content: item 10124 }); 10125 if (!event.data) { 10126 event.data = $('<' + this.settings.itemElement + '/>').addClass(this.options.itemClass).append(item) 10127 } 10128 this.trigger('prepared', { 10129 content: event.data 10130 }); 10131 return event.data 10132 } 10133 ; 10134 Owl.prototype.update = function() { 10135 var i = 0 10136 , n = this._pipe.length 10137 , filter = $.proxy(function(p) { 10138 return this[p] 10139 }, this._invalidated) 10140 , cache = {}; 10141 while (i < n) { 10142 if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) { 10143 this._pipe[i].run(cache) 10144 } 10145 i++ 10146 } 10147 this._invalidated = {}; 10148 !this.is('valid') && this.enter('valid') 10149 } 10150 ; 10151 Owl.prototype.width = function(dimension) { 10152 dimension = dimension || Owl.Width.Default; 10153 switch (dimension) { 10154 case Owl.Width.Inner: 10155 case Owl.Width.Outer: 10156 return this._width; 10157 default: 10158 return this._width - this.settings.stagePadding * 2 + this.settings.margin 10159 } 10160 } 10161 ; 10162 Owl.prototype.refresh = function() { 10163 this.enter('refreshing'); 10164 this.trigger('refresh'); 10165 this.setup(); 10166 this.optionsLogic(); 10167 this.$element.addClass(this.options.refreshClass); 10168 this.update(); 10169 this.$element.removeClass(this.options.refreshClass); 10170 this.leave('refreshing'); 10171 this.trigger('refreshed') 10172 } 10173 ; 10174 Owl.prototype.onThrottledResize = function() { 10175 window.clearTimeout(this.resizeTimer); 10176 this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate) 10177 } 10178 ; 10179 Owl.prototype.onResize = function() { 10180 if (!this._items.length) { 10181 return false 10182 } 10183 if (this._width === this.$element.width()) { 10184 return false 10185 } 10186 if (!this.isVisible()) { 10187 return false 10188 } 10189 this.enter('resizing'); 10190 if (this.trigger('resize').isDefaultPrevented()) { 10191 this.leave('resizing'); 10192 return false 10193 } 10194 this.invalidate('width'); 10195 this.refresh(); 10196 this.leave('resizing'); 10197 this.trigger('resized') 10198 } 10199 ; 10200 Owl.prototype.registerEventHandlers = function() {
10201 if ($.support.transition) { 10202 this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this)) 10203 } 10204 if (this.settings.responsive !== false) { 10205 this.on(window, 'resize', this._handlers.onThrottledResize) 10206 } 10207 if (this.settings.mouseDrag) { 10208 this.$element.addClass(this.options.dragClass); 10209 this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this)); 10210 this.$stage.on('dragstart.owl.core selectstart.owl.core', function() { 10211 return false 10212 }) 10213 } 10214 if (this.settings.touchDrag) { 10215 this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this)); 10216 this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this)) 10217 } 10218 } 10219 ; 10220 Owl.prototype.onDragStart = function(event) { 10221 var stage = null; 10222 if (event.which === 3) { 10223 return 10224 } 10225 if ($.support.transform) { 10226 stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(','); 10227 stage = { 10228 x: stage[stage.length === 16 ? 12 : 4], 10229 y: stage[stage.length === 16 ? 13 : 5] 10230 } 10231 } else { 10232 stage = this.$stage.position(); 10233 stage = { 10234 x: this.settings.rtl ? stage.left + this.$stage.width() - this.width() + this.settings.margin : stage.left, 10235 y: stage.top 10236 } 10237 } 10238 if (this.is('animating')) { 10239 $.support.transform ? this.animate(stage.x) : this.$stage.stop(); 10240 this.invalidate('position') 10241 } 10242 this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown'); 10243 this.speed(0); 10244 this._drag.time = new Date().getTime(); 10245 this._drag.target = $(event.target); 10246 this._drag.stage.start = stage; 10247 this._drag.stage.current = stage; 10248 this._drag.pointer = this.pointer(event); 10249 $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this)); 10250 $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function(event) { 10251 var delta = this.difference(this._drag.pointer, this.pointer(event)); 10252 $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this)); 10253 if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) { 10254 return 10255 } 10256 event.preventDefault(); 10257 this.enter('dragging'); 10258 this.trigger('drag') 10259 }, this)) 10260 } 10261 ; 10262 Owl.prototype.onDragMove = function(event) { 10263 var minimum = null 10264 , maximum = null 10265 , pull = null 10266 , delta = this.difference(this._drag.pointer, this.pointer(event)) 10267 , stage = this.difference(this._drag.stage.start, delta); 10268 if (!this.is('dragging')) { 10269 return 10270 } 10271 event.preventDefault(); 10272 if (this.settings.loop) { 10273 minimum = this.coordinates(this.minimum()); 10274 maximum = this.coordinates(this.maximum() + 1) - minimum; 10275 stage.x = (((stage.x - minimum) % maximum + maximum) % maximum) + minimum 10276 } else { 10277 minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()); 10278 maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()); 10279 pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0; 10280 stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull) 10281 } 10282 this._drag.stage.current = stage; 10283 this.animate(stage.x) 10284 } 10285 ; 10286 Owl.prototype.onDragEnd = function(event) { 10287 var delta = this.difference(this._drag.pointer, this.pointer(event)) 10288 , stage = this._drag.stage.current 10289 , direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right'; 10290 $(document).off('.owl.core'); 10291 this.$element.removeClass(this.options.grabClass); 10292 if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) { 10293 this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed); 10294 this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction)); 10295 this.invalidate('position'); 10296 this.update(); 10297 this._drag.direction = direction; 10298 if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) { 10299 this._drag.target.one('click.owl.core', function() { 10300 return false 10301 }) 10302 } 10303 } 10304 if (!this.is('dragging')) { 10305 return 10306 } 10307 this.leave('dragging'); 10308 this.trigger('dragged') 10309 } 10310 ; 10311 Owl.prototype.closest = function(coordinate, direction) { 10312 var position = -1 10313 , pull = 30 10314 , width = this.width() 10315 , coordinates = this.coordinates(); 10316 if (!this.settings.freeDrag) { 10317 $.each(coordinates, $.proxy(function(index, value) { 10318 if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) { 10319 position = index 10320 } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) { 10321 position = index + 1 10322 } else if (this.op(coordinate, '<', value) && this.op(coordinate, '>', coordinates[index + 1] !== undefined ? coordinates[index + 1] : value - width)) { 10323 position = direction === 'left' ? index + 1 : index 10324 } 10325 return position === -1 10326 }, this)) 10327 } 10328 if (!this.settings.loop) { 10329 if (this.op(coordinate, '>', coordinates[this.minimum()])) { 10330 position = coordinate = this.minimum() 10331 } else if (this.op(coordinate, '<', coordinates[this.maximum()])) { 10332 position = coordinate = this.maximum() 10333 } 10334 } 10335 return position 10336 } 10337 ; 10338 Owl.prototype.animate = function(coordinate) { 10339 var animate = this.speed() > 0; 10340 this.is('animating') && this.onTransitionEnd(); 10341 if (animate) { 10342 this.enter('animating'); 10343 this.trigger('translate') 10344 }
10345 if ($.support.transform3d && $.support.transition) { 10346 this.$stage.css({ 10347 transform: 'translate3d(' + coordinate + 'px,0px,0px)', 10348 transition: (this.speed() / 1000) + 's' + (this.settings.slideTransition ? ' ' + this.settings.slideTransition : '') 10349 }) 10350 } else if (animate) { 10351 this.$stage.animate({ 10352 left: coordinate + 'px' 10353 }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this)) 10354 } else { 10355 this.$stage.css({ 10356 left: coordinate + 'px' 10357 }) 10358 } 10359 } 10360 ; 10361 Owl.prototype.is = function(state) { 10362 return this._states.current[state] && this._states.current[state] > 0 10363 } 10364 ; 10365 Owl.prototype.current = function(position) { 10366 if (position === undefined) { 10367 return this._current 10368 } 10369 if (this._items.length === 0) { 10370 return undefined 10371 } 10372 position = this.normalize(position); 10373 if (this._current !== position) { 10374 var event = this.trigger('change', { 10375 property: { 10376 name: 'position', 10377 value: position 10378 } 10379 }); 10380 if (event.data !== undefined) { 10381 position = this.normalize(event.data) 10382 } 10383 this._current = position; 10384 this.invalidate('position'); 10385 this.trigger('changed', { 10386 property: { 10387 name: 'position', 10388 value: this._current 10389 } 10390 }) 10391 } 10392 return this._current 10393 } 10394 ; 10395 Owl.prototype.invalidate = function(part) { 10396 if ($.type(part) === 'string') { 10397 this._invalidated[part] = true; 10398 this.is('valid') && this.leave('valid') 10399 } 10400 return $.map(this._invalidated, function(v, i) { 10401 return i 10402 }) 10403 } 10404 ; 10405 Owl.prototype.reset = function(position) { 10406 position = this.normalize(position); 10407 if (position === undefined) { 10408 return 10409 } 10410 this._speed = 0; 10411 this._current = position; 10412 this.suppress(['translate', 'translated']); 10413 this.animate(this.coordinates(position)); 10414 this.release(['translate', 'translated']) 10415 } 10416 ; 10417 Owl.prototype.normalize = function(position, relative) { 10418 var n = this._items.length 10419 , m = relative ? 0 : this._clones.length; 10420 if (!this.isNumeric(position) || n < 1) { 10421 position = undefined 10422 } else if (position < 0 || position >= n + m) { 10423 position = ((position - m / 2) % n + n) % n + m / 2 10424 } 10425 return position 10426 } 10427 ; 10428 Owl.prototype.relative = function(position) { 10429 position -= this._clones.length / 2; 10430 return this.normalize(position, true) 10431 } 10432 ; 10433 Owl.prototype.maximum = function(relative) { 10434 var settings = this.settings, maximum = this._coordinates.length, iterator, reciprocalItemsWidth, elementWidth; 10435 if (settings.loop) { 10436 maximum = this._clones.length / 2 + this._items.length - 1 10437 } else if (settings.autoWidth || settings.merge) { 10438 iterator = this._items.length; 10439 if (iterator) { 10440 reciprocalItemsWidth = this._items[--iterator].width(); 10441 elementWidth = this.$element.width(); 10442 while (iterator--) { 10443 reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin; 10444 if (reciprocalItemsWidth > elementWidth) { 10445 break 10446 } 10447 } 10448 } 10449 maximum = iterator + 1 10450 } else if (settings.center) { 10451 maximum = this._items.length - 1 10452 } else { 10453 maximum = this._items.length - settings.items 10454 } 10455 if (relative) { 10456 maximum -= this._clones.length / 2 10457 } 10458 return Math.max(maximum, 0) 10459 } 10460 ; 10461 Owl.prototype.minimum = function(relative) { 10462 return relative ? 0 : this._clones.length / 2 10463 } 10464 ; 10465 Owl.prototype.items = function(position) { 10466 if (position === undefined) { 10467 return this._items.slice() 10468 } 10469 position = this.normalize(position, true); 10470 return this._items[position] 10471 } 10472 ; 10473 Owl.prototype.mergers = function(position) { 10474 if (position === undefined) { 10475 return this._mergers.slice() 10476 } 10477 position = this.normalize(position, true); 10478 return this._mergers[position] 10479 } 10480 ; 10481 Owl.prototype.clones = function(position) { 10482 var odd = this._clones.length / 2 10483 , even = odd + this._items.length 10484 , map = function(index) {
10485 return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2 10486 }; 10487 if (position === undefined) { 10488 return $.map(this._clones, function(v, i) { 10489 return map(i) 10490 }) 10491 } 10492 return $.map(this._clones, function(v, i) { 10493 return v === position ? map(i) : null 10494 }) 10495 } 10496 ; 10497 Owl.prototype.speed = function(speed) { 10498 if (speed !== undefined) { 10499 this._speed = speed 10500 } 10501 return this._speed 10502 } 10503 ; 10504 Owl.prototype.coordinates = function(position) { 10505 var multiplier = 1, newPosition = position - 1, coordinate; 10506 if (position === undefined) { 10507 return $.map(this._coordinates, $.proxy(function(coordinate, index) { 10508 return this.coordinates(index) 10509 }, this)) 10510 } 10511 if (this.settings.center) { 10512 if (this.settings.rtl) { 10513 multiplier = -1; 10514 newPosition = position + 1 10515 } 10516 coordinate = this._coordinates[position]; 10517 coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier 10518 } else { 10519 coordinate = this._coordinates[newPosition] || 0 10520 } 10521 coordinate = Math.ceil(coordinate); 10522 return coordinate 10523 } 10524 ; 10525 Owl.prototype.duration = function(from, to, factor) { 10526 if (factor === 0) { 10527 return 0 10528 } 10529 return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed)) 10530 } 10531 ; 10532 Owl.prototype.to = function(position, speed) { 10533 var current = this.current() 10534 , revert = null 10535 , distance = position - this.relative(current) 10536 , direction = (distance > 0) - (distance < 0) 10537 , items = this._items.length 10538 , minimum = this.minimum() 10539 , maximum = this.maximum(); 10540 if (this.settings.loop) { 10541 if (!this.settings.rewind && Math.abs(distance) > items / 2) { 10542 distance += direction * -1 * items 10543 } 10544 position = current + distance; 10545 revert = ((position - minimum) % items + items) % items + minimum; 10546 if (revert !== position && revert - distance <= maximum && revert - distance > 0) { 10547 current = revert - distance; 10548 position = revert; 10549 this.reset(current) 10550 } 10551 } else if (this.settings.rewind) { 10552 maximum += 1; 10553 position = (position % maximum + maximum) % maximum 10554 } else { 10555 position = Math.max(minimum, Math.min(maximum, position)) 10556 } 10557 this.speed(this.duration(current, position, speed)); 10558 this.current(position); 10559 if (this.isVisible()) { 10560 this.update() 10561 } 10562 } 10563 ; 10564 Owl.prototype.next = function(speed) { 10565 speed = speed || false; 10566 this.to(this.relative(this.current()) + 1, speed) 10567 } 10568 ; 10569 Owl.prototype.prev = function(speed) { 10570 speed = speed || false; 10571 this.to(this.relative(this.current()) - 1, speed) 10572 } 10573 ; 10574 Owl.prototype.onTransitionEnd = function(event) { 10575 if (event !== undefined) { 10576 event.stopPropagation(); 10577 if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) { 10578 return false 10579 } 10580 } 10581 this.leave('animating'); 10582 this.trigger('translated') 10583 } 10584 ; 10585 Owl.prototype.viewport = function() { 10586 var width; 10587 if (this.options.responsiveBaseElement !== window) { 10588 width = $(this.options.responsiveBaseElement).width() 10589 } else if (window.innerWidth) { 10590 width = window.innerWidth 10591 } else if (document.documentElement && document.documentElement.clientWidth) { 10592 width = document.documentElement.clientWidth 10593 } else { 10594 console.warn('Can not detect viewport width.') 10595 } 10596 return width 10597 } 10598 ; 10599 Owl.prototype.replace = function(content) { 10600 this.$stage.empty(); 10601 this._items = []; 10602 if (content) { 10603 content = (content instanceof jQuery) ? content : $(content) 10604 } 10605 if (this.settings.nestedItemSelector) { 10606 content = content.find('.' + this.settings.nestedItemSelector) 10607 } 10608 content.filter(function() { 10609 return this.nodeType === 1 10610 }).each($.proxy(function(index, item) { 10611 item = this.prepare(item); 10612 this.$stage.append(item); 10613 this._items.push(item); 10614 this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1) 10615 }, this)); 10616 this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0); 10617 this.invalidate('items') 10618 } 10619 ; 10620 Owl.prototype.add = function(content, position) { 10621 var current = this.relative(this._current); 10622 position = position === undefined ? this._items.length : this.normalize(position, true); 10623 content = content instanceof jQuery ? content : $(content); 10624 this.trigger('add', { 10625 content: content, 10626 position: position 10627 }); 10628 content = this.prepare(content); 10629 if (this._items.length === 0 || position === this._items.length) { 10630 this._items.length === 0 && this.$stage.append(content); 10631 this._items.length !== 0 && this._items[position - 1].after(content); 10632 this._items.push(content); 10633 this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1) 10634 } else { 10635 this._items[position].before(content); 10636 this._items.splice(position, 0, content); 10637 this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1) 10638 } 10639 this._items[current] && this.reset(this._items[current].index()); 10640 this.invalidate('items'); 10641 this.trigger('added', { 10642 content: content, 10643 position: position 10644 }) 10645 } 10646 ; 10647 Owl.prototype.remove = function(position) { 10648 position = this.normalize(position, true); 10649 if (position === undefined) { 10650 return 10651 } 10652 this.trigger('remove', { 10653 content: this._items[position], 10654 position: position 10655 }); 10656 this._items[position].remove(); 10657 this._items.splice(position, 1); 10658 this._mergers.splice(position, 1); 10659 this.invalidate('items'); 10660 this.trigger('removed', { 10661 content: null, 10662 position: position 10663 }) 10664 } 10665 ; 10666 Owl.prototype.preloadAutoWidthImages = function(images) { 10667 images.each($.proxy(function(i, element) { 10668 this.enter('pre-loading'); 10669 element = $(element); 10670 $(new Image()).one('load', $.proxy(function(e) { 10671 element.attr('src', e.target.src); 10672 element.css('opacity', 1); 10673 this.leave('pre-loading'); 10674 !this.is('pre-loading') && !this.is('initializing') && this.refresh() 10675 }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina')) 10676 }, this)) 10677 } 10678 ; 10679 Owl.prototype.destroy = function() { 10680 this.$element.off('.owl.core'); 10681 this.$stage.off('.owl.core'); 10682 $(document).off('.owl.core'); 10683 if (this.settings.responsive !== false) { 10684 window.clearTimeout(this.resizeTimer); 10685 this.off(window, 'resize', this._handlers.onThrottledResize) 10686 } 10687 for (var i in this._plugins) { 10688 this._plugins[i].destroy() 10689 } 10690 this.$stage.children('.cloned').remove(); 10691 this.$stage.unwrap(); 10692 this.$stage.children().contents().unwrap(); 10693 this.$stage.children().unwrap(); 10694 this.$stage.remove(); 10695 this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr('class', this.$element.attr('class').replace(new RegExp(this.options.responsiveClass + '-\\S+\\s','g'), '')).removeData('owl.carousel') 10696 } 10697 ; 10698 Owl.prototype.op = function(a, o, b) { 10699 var rtl = this.settings.rtl; 10700 switch (o) { 10701 case '<': 10702 return rtl ? a > b : a < b; 10703 case '>': 10704 return rtl ? a < b : a > b; 10705 case '>=': 10706 return rtl ? a <= b : a >= b; 10707 case '<=': 10708 return rtl ? a >= b : a <= b; 10709 default: 10710 break 10711 } 10712 } 10713 ; 10714 Owl.prototype.on = function(element, event, listener, capture) { 10715 if (element.addEventListener) { 10716 element.addEventListener(event, listener, capture) 10717 } else if (element.attachEvent) { 10718 element.attachEvent('on' + event, listener) 10719 } 10720 } 10721 ; 10722 Owl.prototype.off = function(element, event, listener, capture) { 10723 if (element.removeEventListener) { 10724 element.removeEventListener(event, listener, capture) 10725 } else if (element.detachEvent) { 10726 element.detachEvent('on' + event, listener) 10727 } 10728 } 10729 ; 10730 Owl.prototype.trigger = function(name, data, namespace, state, enter) { 10731 var status = { 10732 item: { 10733 count: this._items.length, 10734 index: this.current() 10735 } 10736 } 10737 , handler = $.camelCase($.grep(['on', name, namespace], function(v) { 10738 return v 10739 }).join('-').toLowerCase()) 10740 , event = $.Event([name, 'owl', namespace || 'carousel'].join('.').toLowerCase(), $.extend({ 10741 relatedTarget: this 10742 }, status, data)); 10743 if (!this._supress[name]) { 10744 $.each(this._plugins, function(name, plugin) { 10745 if (plugin.onTrigger) { 10746 plugin.onTrigger(event) 10747 } 10748 }); 10749 this.register({ 10750 type: Owl.Type.Event, 10751 name: name 10752 }); 10753 this.$element.trigger(event); 10754 if (this.settings && typeof this.settings[handler] === 'function') { 10755 this.settings[handler].call(this, event) 10756 } 10757 } 10758 return event 10759 } 10760 ; 10761 Owl.prototype.enter = function(name) { 10762 $.each([name].concat(this._states.tags[name] || []), $.proxy(function(i, name) { 10763 if (this._states.current[name] === undefined) { 10764 this._states.current[name] = 0 10765 } 10766 this._states.current[name]++ 10767 }, this)) 10768 } 10769 ; 10770 Owl.prototype.leave = function(name) { 10771 $.each([name].concat(this._states.tags[name] || []), $.proxy(function(i, name) { 10772 this._states.current[name]-- 10773 }, this)) 10774 } 10775 ; 10776 Owl.prototype.register = function(object) { 10777 if (object.type === Owl.Type.Event) { 10778 if (!$.event.special[object.name]) { 10779 $.event.special[object.name] = {} 10780 } 10781 if (!$.event.special[object.name].owl) { 10782 var _default = $.event.special[object.name]._default; 10783 $.event.special[object.name]._default = function(e) { 10784 if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) { 10785 return _default.apply(this, arguments) 10786 } 10787 return e.namespace && e.namespace.indexOf('owl') > -1 10788 } 10789 ; 10790 $.event.special[object.name].owl = true 10791 } 10792 } else if (object.type === Owl.Type.State) { 10793 if (!this._states.tags[object.name]) { 10794 this._states.tags[object.name] = object.tags 10795 } else { 10796 this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags) 10797 } 10798 this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function(tag, i) { 10799 return $.inArray(tag, this._states.tags[object.name]) === i 10800 }, this)) 10801 } 10802 } 10803 ; 10804 Owl.prototype.suppress = function(events) { 10805 $.each(events, $.proxy(function(index, event) { 10806 this._supress[event] = true 10807 }, this)) 10808 } 10809 ; 10810 Owl.prototype.release = function(events) { 10811 $.each(events, $.proxy(function(index, event) { 10812 delete this._supress[event] 10813 }, this)) 10814 } 10815 ; 10816 Owl.prototype.pointer = function(event) { 10817 var result = { 10818 x: null, 10819 y: null 10820 }; 10821 event = event.originalEvent || event || window.event; 10822 event = event.touches && event.touches.length ? event.touches[0] : event.changedTouches && event.changedTouches.length ? event.changedTouches[0] : event; 10823 if (event.pageX) { 10824 result.x = event.pageX; 10825 result.y = event.pageY 10826 } else { 10827 result.x = event.clientX; 10828 result.y = event.clientY 10829 } 10830 return result 10831 } 10832 ; 10833 Owl.prototype.isNumeric = function(number) { 10834 return !isNaN(parseFloat(number)) 10835 } 10836 ; 10837 Owl.prototype.difference = function(first, second) { 10838 return { 10839 x: first.x - second.x, 10840 y: first.y - second.y 10841 } 10842 } 10843 ; 10844 $.fn.owlCarousel = function(option) { 10845 var args = Array.prototype.slice.call(arguments, 1); 10846 return this.each(function() { 10847 var $this = $(this) 10848 , data = $this.data('owl.carousel'); 10849 if (!data) { 10850 data = new Owl(this,typeof option == 'object' && option); 10851 $this.data('owl.carousel', data); 10852 $.each(['next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'], function(i, event) { 10853 data.register({ 10854 type: Owl.Type.Event, 10855 name: event 10856 }); 10857 data.$element.on(event + '.owl.carousel.core', $.proxy(function(e) { 10858 if (e.namespace && e.relatedTarget !== this) { 10859 this.suppress([event]); 10860 data[event].apply(this, [].slice.call(arguments, 1)); 10861 this.release([event]) 10862 } 10863 }, data)) 10864 }) 10865 } 10866 if (typeof option == 'string' && option.charAt(0) !== '_') { 10867 data[option].apply(data, args) 10868 } 10869 }) 10870 } 10871 ; 10872 $.fn.owlCarousel.Constructor = Owl 10873} 10874)(window.Zepto || window.jQuery, window, document); 10875(function($, window, document, undefined) { 10876 var AutoRefresh = function(carousel) { 10877 this._core = carousel; 10878 this._interval = null; 10879 this._visible = null; 10880 this._handlers = { 10881 'initialized.owl.carousel': $.proxy(function(e) { 10882 if (e.namespace && this._core.settings.autoRefresh) { 10883 this.watch() 10884 } 10885 }, this) 10886 }; 10887 this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options); 10888 this._core.$element.on(this._handlers) 10889 }; 10890 AutoRefresh.Defaults = { 10891 autoRefresh: true, 10892 autoRefreshInterval: 500 10893 }; 10894 AutoRefresh.prototype.watch = function() { 10895 if (this._interval) { 10896 return 10897 } 10898 this._visible = this._core.isVisible(); 10899 this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval) 10900 } 10901 ; 10902 AutoRefresh.prototype.refresh = function() { 10903 if (this._core.isVisible() === this._visible) { 10904 return 10905 } 10906 this._visible = !this._visible; 10907 this._core.$element.toggleClass('owl-hidden', !this._visible);
10908 this._visible && (this._core.invalidate('width') && this._core.refresh()) 10909 } 10910 ; 10911 AutoRefresh.prototype.destroy = function() { 10912 var handler, property; 10913 window.clearInterval(this._interval); 10914 for (handler in this._handlers) { 10915 this._core.$element.off(handler, this._handlers[handler]) 10916 } 10917 for (property in Object.getOwnPropertyNames(this)) { 10918 typeof this[property] != 'function' && (this[property] = null) 10919 } 10920 } 10921 ; 10922 $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh 10923} 10924)(window.Zepto || window.jQuery, window, document); 10925(function($, window, document, undefined) { 10926 var Lazy = function(carousel) { 10927 this._core = carousel; 10928 this._loaded = []; 10929 this._handlers = { 10930 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function(e) { 10931 if (!e.namespace) { 10932 return 10933 } 10934 if (!this._core.settings || !this._core.settings.lazyLoad) { 10935 return 10936 } 10937 if ((e.property && e.property.name == 'position') || e.type == 'initialized') { 10938 var settings = this._core.settings 10939 , n = (settings.center && Math.ceil(settings.items / 2) || settings.items) 10940 , i = ((settings.center && n * -1) || 0) 10941 , position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i 10942 , clones = this._core.clones().length 10943 , load = $.proxy(function(i, v) { 10944 this.load(v) 10945 }, this); 10946 if (settings.lazyLoadEager > 0) { 10947 n += settings.lazyLoadEager; 10948 if (settings.loop) { 10949 position -= settings.lazyLoadEager; 10950 n++ 10951 } 10952 } 10953 while (i++ < n) { 10954 this.load(clones / 2 + this._core.relative(position)); 10955 clones && $.each(this._core.clones(this._core.relative(position)), load); 10956 position++ 10957 } 10958 } 10959 }, this) 10960 }; 10961 this._core.options = $.extend({}, Lazy.Defaults, this._core.options); 10962 this._core.$element.on(this._handlers) 10963 }; 10964 Lazy.Defaults = { 10965 lazyLoad: false, 10966 lazyLoadEager: 0 10967 }; 10968 Lazy.prototype.load = function(position) { 10969 var $item = this._core.$stage.children().eq(position) 10970 , $elements = $item && $item.find('.owl-lazy'); 10971 if (!$elements || $.inArray($item.get(0), this._loaded) > -1) { 10972 return 10973 } 10974 $elements.each($.proxy(function(index, element) { 10975 var $element = $(element), image, url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src') || $element.attr('data-srcset'); 10976 this._core.trigger('load', { 10977 element: $element, 10978 url: url 10979 }, 'lazy'); 10980 if (url != undefined) { 10981 if ($element.is('img')) { 10982 $element.one('load.owl.lazy', $.proxy(function() { 10983 $element.css('opacity', 1); 10984 this._core.trigger('loaded', { 10985 element: $element, 10986 url: url 10987 }, 'lazy') 10988 }, this)).attr('src', url) 10989 } else if ($element.is('source')) { 10990 $element.one('load.owl.lazy', $.proxy(function() { 10991 this._core.trigger('loaded', { 10992 element: $element, 10993 url: url 10994 }, 'lazy') 10995 }, this)).attr('srcset', url) 10996 } else { 10997 image = new Image(); 10998 image.onload = $.proxy(function() { 10999 $element.css({ 11000 'background-image': 'url("' + url + '")', 11001 'opacity': '1' 11002 }); 11003 this._core.trigger('loaded', { 11004 element: $element, 11005 url: url 11006 }, 'lazy') 11007 }, this); 11008 image.src = url 11009 } 11010 } 11011 }, this)); 11012 this._loaded.push($item.get(0)) 11013 } 11014 ; 11015 Lazy.prototype.destroy = function() { 11016 var handler, property; 11017 for (handler in this.handlers) { 11018 this._core.$element.off(handler, this.handlers[handler]) 11019 } 11020 for (property in Object.getOwnPropertyNames(this)) { 11021 typeof this[property] != 'function' && (this[property] = null) 11022 } 11023 } 11024 ;
11025 $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy 11026} 11027)(window.Zepto || window.jQuery, window, document); 11028(function($, window, document, undefined) { 11029 var AutoHeight = function(carousel) { 11030 this._core = carousel; 11031 this._previousHeight = null; 11032 this._handlers = { 11033 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function(e) { 11034 if (e.namespace && this._core.settings.autoHeight) { 11035 this.update() 11036 } 11037 }, this), 11038 'changed.owl.carousel': $.proxy(function(e) { 11039 if (e.namespace && this._core.settings.autoHeight && e.property.name === 'position') { 11040 this.update() 11041 } 11042 }, this), 11043 'loaded.owl.lazy': $.proxy(function(e) { 11044 if (e.namespace && this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) { 11045 this.update() 11046 } 11047 }, this) 11048 }; 11049 this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options); 11050 this._core.$element.on(this._handlers); 11051 this._intervalId = null; 11052 var refThis = this; 11053 $(window).on('load', function() { 11054 if (refThis._core.settings.autoHeight) { 11055 refThis.update() 11056 } 11057 }); 11058 $(window).resize(function() { 11059 if (refThis._core.settings.autoHeight) { 11060 if (refThis._intervalId != null) { 11061 clearTimeout(refThis._intervalId) 11062 } 11063 refThis._intervalId = setTimeout(function() { 11064 refThis.update() 11065 }, 250) 11066 } 11067 }) 11068 }; 11069 AutoHeight.Defaults = { 11070 autoHeight: false, 11071 autoHeightClass: 'owl-height' 11072 }; 11073 AutoHeight.prototype.update = function() { 11074 var start = this._core._current 11075 , end = start + this._core.settings.items 11076 , lazyLoadEnabled = this._core.settings.lazyLoad 11077 , visible = this._core.$stage.children().toArray().slice(start, end) 11078 , heights = [] 11079 , maxheight = 0; 11080 $.each(visible, function(index, item) { 11081 heights.push($(item).height()) 11082 }); 11083 maxheight = Math.max.apply(null, heights); 11084 if (maxheight <= 1 && lazyLoadEnabled && this._previousHeight) { 11085 maxheight = this._previousHeight 11086 } 11087 this._previousHeight = maxheight; 11088 this._core.$stage.parent().height(maxheight).addClass(this._core.settings.autoHeightClass) 11089 } 11090 ; 11091 AutoHeight.prototype.destroy = function() { 11092 var handler, property; 11093 for (handler in this._handlers) { 11094 this._core.$element.off(handler, this._handlers[handler]) 11095 } 11096 for (property in Object.getOwnPropertyNames(this)) { 11097 typeof this[property] !== 'function' && (this[property] = null) 11098 } 11099 } 11100 ; 11101 $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight 11102} 11103)(window.Zepto || window.jQuery, window, document); 11104(function($, window, document, undefined) { 11105 var Video = function(carousel) { 11106 this._core = carousel; 11107 this._videos = {}; 11108 this._playing = null; 11109 this._handlers = { 11110 'initialized.owl.carousel': $.proxy(function(e) { 11111 if (e.namespace) { 11112 this._core.register({ 11113 type: 'state', 11114 name: 'playing', 11115 tags: ['interacting'] 11116 }) 11117 } 11118 }, this), 11119 'resize.owl.carousel': $.proxy(function(e) { 11120 if (e.namespace && this._core.settings.video && this.isInFullScreen()) { 11121 e.preventDefault() 11122 } 11123 }, this), 11124 'refreshed.owl.carousel': $.proxy(function(e) { 11125 if (e.namespace && this._core.is('resizing')) { 11126 this._core.$stage.find('.cloned .owl-video-frame').remove() 11127 } 11128 }, this), 11129 'changed.owl.carousel': $.proxy(function(e) { 11130 if (e.namespace && e.property.name === 'position' && this._playing) { 11131 this.stop() 11132 } 11133 }, this), 11134 'prepared.owl.carousel': $.proxy(function(e) { 11135 if (!e.namespace) { 11136 return 11137 } 11138 var $element = $(e.content).find('.owl-video'); 11139 if ($element.length) { 11140 $element.css('display', 'none'); 11141 this.fetch($element, $(e.content)) 11142 } 11143 }, this) 11144 }; 11145 this._core.options = $.extend({}, Video.Defaults, this._core.options); 11146 this._core.$element.on(this._handlers); 11147 this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) { 11148 this.play(e) 11149 }, this)) 11150 }; 11151 Video.Defaults = { 11152 video: false, 11153 videoHeight: false, 11154 videoWidth: false 11155 }; 11156 Video.prototype.fetch = function(target, item) { 11157 var type = (function() { 11158 if (target.attr('data-vimeo-id')) { 11159 return 'vimeo' 11160 } else if (target.attr('data-vzaar-id')) { 11161 return 'vzaar' 11162 } else { 11163 return 'youtube' 11164 } 11165 } 11166 )() 11167 , id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id') 11168 , width = target.attr('data-width') || this._core.settings.videoWidth 11169 , height = target.attr('data-height') || this._core.settings.videoHeight 11170 , url = target.attr('href'); 11171 if (url) { 11172 id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); 11173 if (id[3].indexOf('youtu') > -1) { 11174 type = 'youtube' 11175 } else if (id[3].indexOf('vimeo') > -1) { 11176 type = 'vimeo' 11177 } else if (id[3].indexOf('vzaar') > -1) { 11178 type = 'vzaar' 11179 } else { 11180 throw new Error('Video URL not supported.') 11181 } 11182 id = id[6] 11183 } else { 11184 throw new Error('Missing video URL.') 11185 } 11186 this._videos[url] = { 11187 type: type, 11188 id: id, 11189 width: width, 11190 height: height 11191 }; 11192 item.attr('data-video', url); 11193 this.thumbnail(target, this._videos[url]) 11194 } 11195 ; 11196 Video.prototype.thumbnail = function(target, video) { 11197 var tnLink, icon, path, dimensions = video.width && video.height ? 'width:' + video.width + 'px;height:' + video.height + 'px;' : '', customTn = target.find('img'), srcType = 'src', lazyClass = '', settings = this._core.settings, create = function(path) { 11198 icon = '<div class="owl-video-play-icon"></div>'; 11199 if (settings.lazyLoad) { 11200 tnLink = $('<div/>', { 11201 "class": 'owl-video-tn ' + lazyClass, 11202 "srcType": path 11203 }) 11204 } else { 11205 tnLink = $('<div/>', { 11206 "class": "owl-video-tn", 11207 "style": 'opacity:1;background-image:url(' + path + ')' 11208 }) 11209 } 11210 target.after(tnLink); 11211 target.after(icon) 11212 }; 11213 target.wrap($('<div/>', { 11214 "class": "owl-video-wrapper", 11215 "style": dimensions 11216 })); 11217 if (this._core.settings.lazyLoad) { 11218 srcType = 'data-src'; 11219 lazyClass = 'owl-lazy' 11220 } 11221 if (customTn.length) { 11222 create(customTn.attr(srcType)); 11223 customTn.remove(); 11224 return false 11225 } 11226 if (video.type === 'youtube') { 11227 path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; 11228 create(path) 11229 } else if (video.type === 'vimeo') { 11230 $.ajax({ 11231 type: 'GET', 11232 url: '//vimeo.com/api/v2/video/' + video.id + '.json', 11233 jsonp: 'callback', 11234 dataType: 'jsonp', 11235 success: function(data) { 11236 path = data[0].thumbnail_large; 11237 create(path) 11238 } 11239 }) 11240 } else if (video.type === 'vzaar') { 11241 $.ajax({ 11242 type: 'GET', 11243 url: '//vzaar.com/api/videos/' + video.id + '.json', 11244 jsonp: 'callback', 11245 dataType: 'jsonp', 11246 success: function(data) { 11247 path = data.framegrab_url; 11248 create(path) 11249 } 11250 }) 11251 } 11252 } 11253 ; 11254 Video.prototype.stop = function() { 11255 this._core.trigger('stop', null, 'video'); 11256 this._playing.find('.owl-video-frame').remove(); 11257 this._playing.removeClass('owl-video-playing'); 11258 this._playing = null; 11259 this._core.leave('playing'); 11260 this._core.trigger('stopped', null, 'video') 11261 } 11262 ; 11263 Video.prototype.play = function(event) { 11264 var target = $(event.target), item = target.closest('.' + this._core.settings.itemClass), video = this._videos[item.attr('data-video')], width = video.width || '100%', height = video.height || this._core.$stage.height(), html, iframe; 11265 if (this._playing) { 11266 return 11267 } 11268 this._core.enter('playing'); 11269 this._core.trigger('play', null, 'video'); 11270 item = this._core.items(this._core.relative(item.index())); 11271 this._core.reset(item.index()); 11272 html = $('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'); 11273 html.attr('height', height); 11274 html.attr('width', width); 11275 if (video.type === 'youtube') { 11276 html.attr('src', '//www.youtube.com/embed/' + video.id + '?autoplay=1&rel=0&v=' + video.id) 11277 } else if (video.type === 'vimeo') { 11278 html.attr('src', '//player.vimeo.com/video/' + video.id + '?autoplay=1') 11279 } else if (video.type === 'vzaar') { 11280 html.attr('src', '//view.vzaar.com/' + video.id + '/player?autoplay=true') 11281 } 11282 iframe = $(html).wrap('<div class="owl-video-frame" />').insertAfter(item.find('.owl-video')); 11283 this._playing = item.addClass('owl-video-playing') 11284 } 11285 ; 11286 Video.prototype.isInFullScreen = function() { 11287 var element = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; 11288 return element && $(element).parent().hasClass('owl-video-frame') 11289 } 11290 ; 11291 Video.prototype.destroy = function() { 11292 var handler, property; 11293 this._core.$element.off('click.owl.video'); 11294 for (handler in this._handlers) { 11295 this._core.$element.off(handler, this._handlers[handler]) 11296 } 11297 for (property in Object.getOwnPropertyNames(this)) { 11298 typeof this[property] != 'function' && (this[property] = null) 11299 } 11300 } 11301 ; 11302 $.fn.owlCarousel.Constructor.Plugins.Video = Video 11303} 11304)(window.Zepto || window.jQuery, window, document); 11305(function($, window, document, undefined) { 11306 var Animate = function(scope) { 11307 this.core = scope; 11308 this.core.options = $.extend({}, Animate.Defaults, this.core.options); 11309 this.swapping = true; 11310 this.previous = undefined; 11311 this.next = undefined; 11312 this.handlers = { 11313 'change.owl.carousel': $.proxy(function(e) { 11314 if (e.namespace && e.property.name == 'position') { 11315 this.previous = this.core.current(); 11316 this.next = e.property.value 11317 } 11318 }, this), 11319 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) { 11320 if (e.namespace) { 11321 this.swapping = e.type == 'translated' 11322 } 11323 }, this), 11324 'translate.owl.carousel': $.proxy(function(e) { 11325 if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) { 11326 this.swap() 11327 } 11328 }, this) 11329 }; 11330 this.core.$element.on(this.handlers) 11331 }; 11332 Animate.Defaults = { 11333 animateOut: false, 11334 animateIn: false 11335 }; 11336 Animate.prototype.swap = function() { 11337 if (this.core.settings.items !== 1) { 11338 return 11339 }
11340 if (!$.support.animation || !$.support.transition) { 11341 return 11342 } 11343 this.core.speed(0); 11344 var left, clear = $.proxy(this.clear, this), previous = this.core.$stage.children().eq(this.previous), next = this.core.$stage.children().eq(this.next), incoming = this.core.settings.animateIn, outgoing = this.core.settings.animateOut; 11345 if (this.core.current() === this.previous) { 11346 return 11347 } 11348 if (outgoing) { 11349 left = this.core.coordinates(this.previous) - this.core.coordinates(this.next); 11350 previous.one($.support.animation.end, clear).css({ 11351 'left': left + 'px' 11352 }).addClass('animated owl-animated-out').addClass(outgoing) 11353 } 11354 if (incoming) { 11355 next.one($.support.animation.end, clear).addClass('animated owl-animated-in').addClass(incoming) 11356 } 11357 } 11358 ; 11359 Animate.prototype.clear = function(e) { 11360 $(e.target).css({ 11361 'left': '' 11362 }).removeClass('animated owl-animated-out owl-animated-in').removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut); 11363 this.core.onTransitionEnd() 11364 } 11365 ; 11366 Animate.prototype.destroy = function() { 11367 var handler, property; 11368 for (handler in this.handlers) { 11369 this.core.$element.off(handler, this.handlers[handler]) 11370 } 11371 for (property in Object.getOwnPropertyNames(this)) { 11372 typeof this[property] != 'function' && (this[property] = null) 11373 } 11374 } 11375 ; 11376 $.fn.owlCarousel.Constructor.Plugins.Animate = Animate 11377} 11378)(window.Zepto || window.jQuery, window, document); 11379(function($, window, document, undefined) { 11380 var Autoplay = function(carousel) { 11381 this._core = carousel; 11382 this._call = null; 11383 this._time = 0; 11384 this._timeout = 0; 11385 this._paused = true; 11386 this._handlers = { 11387 'changed.owl.carousel': $.proxy(function(e) { 11388 if (e.namespace && e.property.name === 'settings') { 11389 if (this._core.settings.autoplay) { 11390 this.play() 11391 } else { 11392 this.stop() 11393 } 11394 } else if (e.namespace && e.property.name === 'position' && this._paused) { 11395 this._time = 0 11396 } 11397 }, this), 11398 'initialized.owl.carousel': $.proxy(function(e) { 11399 if (e.namespace && this._core.settings.autoplay) { 11400 this.play() 11401 } 11402 }, this), 11403 'play.owl.autoplay': $.proxy(function(e, t, s) { 11404 if (e.namespace) { 11405 this.play(t, s) 11406 } 11407 }, this), 11408 'stop.owl.autoplay': $.proxy(function(e) { 11409 if (e.namespace) { 11410 this.stop() 11411 } 11412 }, this), 11413 'mouseover.owl.autoplay': $.proxy(function() { 11414 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 11415 this.pause() 11416 } 11417 }, this), 11418 'mouseleave.owl.autoplay': $.proxy(function() { 11419 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 11420 this.play() 11421 } 11422 }, this), 11423 'touchstart.owl.core': $.proxy(function() { 11424 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 11425 this.pause() 11426 } 11427 }, this), 11428 'touchend.owl.core': $.proxy(function() { 11429 if (this._core.settings.autoplayHoverPause) { 11430 this.play() 11431 } 11432 }, this) 11433 }; 11434 this._core.$element.on(this._handlers); 11435 this._core.options = $.extend({}, Autoplay.Defaults, this._core.options) 11436 }; 11437 Autoplay.Defaults = { 11438 autoplay: false, 11439 autoplayTimeout: 5000, 11440 autoplayHoverPause: false, 11441 autoplaySpeed: false 11442 }; 11443 Autoplay.prototype._next = function(speed) { 11444 this._call = window.setTimeout($.proxy(this._next, this, speed), this._timeout * (Math.round(this.read() / this._timeout) + 1)
11444- this.read()); 11445 if (this._core.is('interacting') || document.hidden) { 11446 return 11447 } 11448 this._core.next(speed || this._core.settings.autoplaySpeed) 11449 } 11450 ; 11451 Autoplay.prototype.read = function() { 11452 return new Date().getTime() - this._time 11453 } 11454 ; 11455 Autoplay.prototype.play = function(timeout, speed) { 11456 var elapsed; 11457 if (!this._core.is('rotating')) { 11458 this._core.enter('rotating') 11459 } 11460 timeout = timeout || this._core.settings.autoplayTimeout; 11461 elapsed = Math.min(this._time % (this._timeout || timeout), timeout); 11462 if (this._paused) { 11463 this._time = this.read(); 11464 this._paused = false 11465 } else { 11466 window.clearTimeout(this._call) 11467 } 11468 this._time += this.read() % timeout - elapsed; 11469 this._timeout = timeout; 11470 this._call = window.setTimeout($.proxy(this._next, this, speed), timeout - elapsed) 11471 } 11472 ; 11473 Autoplay.prototype.stop = function() { 11474 if (this._core.is('rotating')) { 11475 this._time = 0; 11476 this._paused = true; 11477 window.clearTimeout(this._call); 11478 this._core.leave('rotating') 11479 } 11480 } 11481 ; 11482 Autoplay.prototype.pause = function() { 11483 if (this._core.is('rotating') && !this._paused) { 11484 this._time = this.read(); 11485 this._paused = true; 11486 window.clearTimeout(this._call) 11487 } 11488 } 11489 ; 11490 Autoplay.prototype.destroy = function() { 11491 var handler, property; 11492 this.stop(); 11493 for (handler in this._handlers) { 11494 this._core.$element.off(handler, this._handlers[handler]) 11495 } 11496 for (property in Object.getOwnPropertyNames(this)) { 11497 typeof this[property] != 'function' && (this[property] = null) 11498 } 11499 } 11500 ; 11501 $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay 11502} 11503)(window.Zepto || window.jQuery, window, document); 11504(function($, window, document, undefined) { 11505 'use strict'; 11506 var Navigation = function(carousel) { 11507 this._core = carousel; 11508 this._initialized = false; 11509 this._pages = []; 11510 this._controls = {}; 11511 this._templates = []; 11512 this.$element = this._core.$element; 11513 this._overrides = { 11514 next: this._core.next, 11515 prev: this._core.prev, 11516 to: this._core.to 11517 }; 11518 this._handlers = { 11519 'prepared.owl.carousel': $.proxy(function(e) { 11520 if (e.namespace && this._core.settings.dotsData) { 11521 this._templates.push('<div class="' + this._core.settings.dotClass + '">' + $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>') 11522 } 11523 }, this), 11524 'added.owl.carousel': $.proxy(function(e) { 11525 if (e.namespace && this._core.settings.dotsData) { 11526 this._templates.splice(e.position, 0, this._templates.pop()) 11527 } 11528 }, this), 11529 'remove.owl.carousel': $.proxy(function(e) { 11530 if (e.namespace && this._core.settings.dotsData) { 11531 this._templates.splice(e.position, 1) 11532 } 11533 }, this), 11534 'changed.owl.carousel': $.proxy(function(e) { 11535 if (e.namespace && e.property.name == 'position') { 11536 this.draw() 11537 } 11538 }, this), 11539 'initialized.owl.carousel': $.proxy(function(e) { 11540 if (e.namespace && !this._initialized) { 11541 this._core.trigger('initialize', null, 'navigation'); 11542 this.initialize(); 11543 this.update(); 11544 this.draw(); 11545 this._initialized = true; 11546 this._core.trigger('initialized', null, 'navigation') 11547 } 11548 }, this), 11549 'refreshed.owl.carousel': $.proxy(function(e) { 11550 if (e.namespace && this._initialized) { 11551 this._core.trigger('refresh', null, 'navigation'); 11552 this.update(); 11553 this.draw(); 11554 this._core.trigger('refreshed', null, 'navigation') 11555 } 11556 }, this) 11557 }; 11558 this._core.options = $.extend({}, Navigation.Defaults, this._core.options); 11559 this.$element.on(this._handlers) 11560 }; 11561 Navigation.Defaults = { 11562 nav: false, 11563 navText: ['<span aria-label="' + 'Previous' + '">‹</span>', '<span aria-label="' + 'Next' + '">›</span>'], 11564 navSpeed: false, 11565 navElement: 'div', 11566 navContainer: false, 11567 navContainerClass: 'owl-nav', 11568 navClass: ['owl-prev', 'owl-next'], 11569 slideBy: 1, 11570 dotClass: 'owl-dot', 11571 dotsClass: 'owl-dots', 11572 dotsActiveClass: 'active', 11573 dots: true, 11574 dotsEach: false, 11575 dotsData: false, 11576 dotsSpeed: false, 11577 dotsContainer: false 11578 }; 11579 Navigation.prototype.initialize = function() { 11580 var override, settings = this._core.settings; 11581 this._controls.$relative = (settings.navContainer ? $(settings.navContainer) : $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); 11582 this._controls.$previous = $('<' + settings.navElement + '>
11582').addClass(settings.navClass[0]).html(settings.navText[0]).prependTo(this._controls.$relative).on('click', $.proxy(function(e) { 11583 this.prev(settings.navSpeed) 11584 }, this)); 11585 this._controls.$next = $('<' + settings.navElement + '>').addClass(settings.navClass[1]).html(settings.navText[1]).appendTo(this._controls.$relative).on('click', $.proxy(function(e) { 11586 this.next(settings.navSpeed) 11587 }, this)); 11588 if (!settings.dotsData) { 11589 this._templates = [$('<div>').addClass(settings.dotClass).append($('<span>')).prop('outerHTML')] 11590 } 11591 this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer) : $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled'); 11592 this._controls.$absolute.on('click', 'div', $.proxy(function(e) { 11593 var index = $(e.target).parent().is(this._controls.$absolute) ? $(e.target).index() : $(e.target).parent().index(); 11594 e.preventDefault(); 11595 this.to(index, settings.dotsSpeed) 11596 }, this)); 11597 for (override in this._overrides) { 11598 this._core[override] = $.proxy(this[override], this) 11599 } 11600 } 11601 ; 11602 Navigation.prototype.destroy = function() { 11603 var handler, control, property, override, settings; 11604 settings = this._core.settings; 11605 for (handler in this._handlers) { 11606 this.$element.off(handler, this._handlers[handler]) 11607 } 11608 for (control in this._controls) { 11609 if (control === '$relative' && settings.navContainer) { 11610 this._controls[control].html('') 11611 } else { 11612 this._controls[control].remove() 11613 } 11614 } 11615 for (override in this.overides) { 11616 this._core[override] = this._overrides[override] 11617 } 11618 for (property in Object.getOwnPropertyNames(this)) { 11619 typeof this[property] != 'function' && (this[property] = null) 11620 } 11621 } 11622 ; 11623 Navigation.prototype.update = function() { 11624 var i, j, k, lower = this._core.clones().length / 2, upper = lower + this._core.items().length, maximum = this._core.maximum(true), settings = this._core.settings, size = settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items; 11625 if (settings.slideBy !== 'page') { 11626 settings.slideBy = Math.min(settings.slideBy, settings.items) 11627 } 11628 if (settings.dots || settings.slideBy == 'page') { 11629 this._pages = []; 11630 for (i = lower, 11631 j = 0, 11632 k = 0; i < upper; i++) { 11633 if (j >= size || j === 0) { 11634 this._pages.push({ 11635 start: Math.min(maximum, i - lower), 11636 end: i - lower + size - 1 11637 }); 11638 if (Math.min(maximum, i - lower) === maximum) { 11639 break 11640 } 11641 j = 0, 11642 ++k 11643 } 11644 j += this._core.mergers(this._core.relative(i)) 11645 } 11646 } 11647 } 11648 ; 11649 Navigation.prototype.draw = function() { 11650 var difference, settings = this._core.settings, disabled = this._core.items().length <= settings.items, index = this._core.relative(this._core.current()), loop = settings.loop || settings.rewind; 11651 this._controls.$relative.toggleClass('disabled', !settings.nav || disabled); 11652 if (settings.nav) { 11653 this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true)); 11654 this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true)) 11655 } 11656 this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled); 11657 if (settings.dots) { 11658 difference = this._pages.length - this._controls.$absolute.children().length; 11659 if (settings.dotsData && difference !== 0) { 11660 this._controls.$absolute.html(this._templates.join('')) 11661 } else if (difference > 0) { 11662 this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0])) 11663 } else if (difference < 0) { 11664 this._controls.$absolute.children().slice(difference).remove() 11665 } 11666 this._controls.$absolute.find('.' + settings.dotsActiveClass.replace(/\s+/g, '.')).removeClass(settings.dotsActiveClass); 11667 this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass(settings.dotsActiveClass) 11668 } 11669 } 11670 ; 11671 Navigation.prototype.onTrigger = function(event) { 11672 var settings = this._core.settings; 11673 event.page = { 11674 index: $.inArray(this.current(), this._pages), 11675 count: this._pages.length,
11676 size: settings && (settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items) 11677 } 11678 } 11679 ; 11680 Navigation.prototype.current = function() { 11681 var current = this._core.relative(this._core.current()); 11682 return $.grep(this._pages, $.proxy(function(page, index) { 11683 return page.start <= current && page.end >= current 11684 }, this)).pop() 11685 } 11686 ; 11687 Navigation.prototype.getPosition = function(successor) { 11688 var position, length, settings = this._core.settings; 11689 if (settings.slideBy == 'page') { 11690 position = $.inArray(this.current(), this._pages); 11691 length = this._pages.length; 11692 successor ? ++position : --position; 11693 position = this._pages[((position % length) + length) % length].start 11694 } else { 11695 position = this._core.relative(this._core.current()); 11696 length = this._core.items().length; 11697 successor ? position += settings.slideBy : position -= settings.slideBy 11698 } 11699 return position 11700 } 11701 ; 11702 Navigation.prototype.next = function(speed) { 11703 $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed) 11704 } 11705 ; 11706 Navigation.prototype.prev = function(speed) { 11707 $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed) 11708 } 11709 ; 11710 Navigation.prototype.to = function(position, speed, standard) { 11711 var length; 11712 if (!standard && this._pages.length) { 11713 length = this._pages.length; 11714 $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed) 11715 } else { 11716 $.proxy(this._overrides.to, this._core)(position, speed) 11717 } 11718 } 11719 ; 11720 $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation 11721} 11722)(window.Zepto || window.jQuery, window, document); 11723(function($, window, document, undefined) { 11724 'use strict'; 11725 var Hash = function(carousel) { 11726 this._core = carousel; 11727 this._hashes = {}; 11728 this.$element = this._core.$element; 11729 this._handlers = { 11730 'initialized.owl.carousel': $.proxy(function(e) { 11731 if (e.namespace && this._core.settings.startPosition === 'URLHash') { 11732 $(window).trigger('hashchange.owl.navigation') 11733 } 11734 }, this), 11735 'prepared.owl.carousel': $.proxy(function(e) { 11736 if (e.namespace) { 11737 var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash'); 11738 if (!hash) { 11739 return 11740 } 11741 this._hashes[hash] = e.content 11742 } 11743 }, this), 11744 'changed.owl.carousel': $.proxy(function(e) { 11745 if (e.namespace && e.property.name === 'position') { 11746 var current = this._core.items(this._core.relative(this._core.current())) 11747 , hash = $.map(this._hashes, function(item, hash) { 11748 return item === current ? hash : null 11749 }).join(); 11750 if (!hash || window.location.hash.slice(1) === hash) { 11751 return 11752 } 11753 window.location.hash = hash 11754 } 11755 }, this) 11756 }; 11757 this._core.options = $.extend({}, Hash.Defaults, this._core.options); 11758 this.$element.on(this._handlers); 11759 $(window).on('hashchange.owl.navigation', $.proxy(function(e) { 11760 var hash = window.location.hash.substring(1) 11761 , items = this._core.$stage.children() 11762 , position = this._hashes[hash] && items.index(this._hashes[hash]); 11763 if (position === undefined || position === this._core.current()) { 11764 return 11765 } 11766 this._core.to(this._core.relative(position), false, true) 11767 }, this)) 11768 }; 11769 Hash.Defaults = { 11770 URLhashListener: false 11771 }; 11772 Hash.prototype.destroy = function() { 11773 var handler, property; 11774 $(window).off('hashchange.owl.navigation'); 11775 for (handler in this._handlers) { 11776 this._core.$element.off(handler, this._handlers[handler]) 11777 } 11778 for (property in Object.getOwnPropertyNames(this)) { 11779 typeof this[property] != 'function' && (this[property] = null) 11780 } 11781 } 11782 ; 11783 $.fn.owlCarousel.Constructor.Plugins.Hash = Hash 11784} 11785)(window.Zepto || window.jQuery, window, document); 11786(function($, window, document, undefined) { 11787 var style = $('<support>').get(0).style 11788 , prefixes = 'Webkit Moz O ms'.split(' ') 11789 , events = { 11790 transition: { 11791 end: { 11792 WebkitTransition: 'webkitTransitionEnd', 11793 MozTransition: 'transitionend', 11794 OTransition: 'oTransitionEnd', 11795 transition: 'transitionend' 11796 } 11797 }, 11798 animation: { 11799 end: { 11800 WebkitAnimation: 'webkitAnimationEnd', 11801 MozAnimation: 'animationend', 11802 OAnimation: 'oAnimationEnd', 11803 animation: 'animationend' 11804 } 11805 } 11806 } 11807 , tests = { 11808 csstransforms: function() { 11809 return !!test('transform') 11810 }, 11811 csstransforms3d: function() { 11812 return !!test('perspective') 11813 }, 11814 csstransitions: function() { 11815 return !!test('transition') 11816 }, 11817 cssanimations: function() { 11818 return !!test('animation') 11819 } 11820 }; 11821 function test(property, prefixed) { 11822 var result = false 11823 , upper = property.charAt(0).toUpperCase() + property.slice(1); 11824 $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function(i, property) { 11825 if (style[property] !== undefined) { 11826 result = prefixed ? property : true; 11827 return false 11828 } 11829 }); 11830 return result 11831 } 11832 function prefixed(property) { 11833 return test(property, true) 11834 } 11835 if (tests.csstransitions()) { 11836 $.support.transition = new String(prefixed('transition')); 11837 $.support.transition.end = events.transition.end[$.support.transition] 11838 } 11839 if (tests.cssanimations()) { 11840 $.support.animation = new String(prefixed('animation')); 11841 $.support.animation.end = events.animation.end[$.support.animation] 11842 } 11843 if (tests.csstransforms()) { 11844 $.support.transform = new String(prefixed('transform')); 11845 $.support.transform3d = tests.csstransforms3d() 11846 } 11847} 11848)(window.Zepto || window.jQuery, window, document); 11849$(function() { 11850 $('[data-carousel="true"]').each(function(lIndex, oElement) { 11851 initCarousel(this) 11852 }) 11853}); 11854function initCarousel(oElement, options) { 11855 var oOptions; 11856 oElement = $(oElement); 11857 if (oElement.attr('data-carousel-config') && oElement.attr('data-carousel-config') != '') { 11858 try { 11859 oOptions = $.parseJSON(oElement.attr('data-carousel-config')) 11860 } catch (err) { 11861 console.log('Error while JSON-Parsing from "data-carousel-config"! Please check JSON-String') 11862 } 11863 } 11864 var aBoxResizer = []; 11865 if (oElement.attr('data-boxresizer') && oElement.attr('data-boxresizer') != '') { 11866 try { 11867 aBoxResizer = $.parseJSON(oElement.attr('data-boxresizer')) 11868 } catch (err) { 11869 var aTemp = oElement.attr('data-boxresizer').split('|'); 11870 $.each(aTemp, function(i, s) { 11871 aBoxResizer.push({ 11872 sSelector: s 11873 }) 11874 }) 11875 } 11876 } 11877 var onActive; 11878 if (oOptions) { 11879 onActive = eval(oOptions.onActive_Custom); 11880 delete oOptions.onActive_Custom 11881 } else { 11882 if (options) { 11883 onActive = eval(options.onActive_Custom); 11884 delete options.onActive_Custom 11885 } 11886 } 11887 var onDrag; 11888 if (oOptions) { 11889 onDrag = eval(oOptions.onDrag_Custom); 11890 delete oOptions.onDrag_Custom 11891 } else { 11892 if (options) { 11893 onDrag = eval(options.onDrag_Custom); 11894 delete options.onDrag_Custom 11895 } 11896 } 11897 var onDragged; 11898 if (oOptions) { 11899 onDragged = eval(oOptions.onDragged_Custom); 11900 delete oOptions.onDragged_Custom 11901 } else { 11902 if (options) { 11903 onDragged = eval(options.onDragged_Custom); 11904 delete options.onDragged_Custom 11905 } 11906 } 11907 oOptions = $.extend(true, { 11908 onInitialized: function(event) { 11909 var aStoredBoxResizer = []; 11910 $.each(aBoxResizer, function(i, o) { 11911 var oTemp = $.boxResizer(o.sSelector, o.oConfig); 11912 aStoredBoxResizer.push(oTemp); 11913 oTemp.resize() 11914 }); 11915 oElement.data('aBoxResizer', aStoredBoxResizer); 11916 $('.owl-prev, .owl-next, .owl-dot, [data-carousel-custom-navi], [data-carousel-custom-dot]', oElement).one('click', $.proxy(function() { 11917 oElement.trigger('stop.owl.autoplay'); 11918 this.settings.autoplay = false;
11919 this.options.autoplay = false 11920 }, this)); 11921 $('[data-carousel-custom-navi]', oElement).each(function(i, o) { 11922 var sDirection = $(o).attr('data-carousel-custom-navi'); 11923 if (sDirection == 'prev' || sDirection == 'next') { 11924 $(o).on('click', function() { 11925 oElement.trigger(sDirection + '.owl.carousel') 11926 }) 11927 } 11928 }); 11929 $('[data-carousel-custom-dot]', oElement).each(function(i, o) { 11930 var lIndex = (parseInt($(o).attr('data-carousel-custom-dot'), 10) || -1) - 1; 11931 if (lIndex >= 0) { 11932 $(o).on('click', function() { 11933 oElement.trigger('to.owl.carousel', [lIndex, undefined, true]) 11934 }) 11935 } 11936 }); 11937 if (typeof (initAdaptHeight) == 'function') { 11938 initAdaptHeight(oElement) 11939 } 11940 if (typeof (initObjectFit) == 'function') { 11941 initObjectFit('cover', oElement.parent()) 11942 } 11943 $.proxy(initVideos, this)(event) 11944 }, 11945 onChanged: function(event) { 11946 if (event && event.property && event.property.name == 'settings') { 11947 var aStoredBoxResizer = oElement.data('aBoxResizer'); 11948 if (aStoredBoxResizer) { 11949 $.each(aStoredBoxResizer, function(i, o) { 11950 o.bInvalidated = true 11951 }) 11952 } 11953 } 11954 if (typeof (onActive) == 'function') { 11955 onActive(event.relatedTarget.relative(event.relatedTarget.current()) || 0, event) 11956 } 11957 }, 11958 onRefreshed: function() { 11959 $('.cloned video, video.cloned', oElement).each(function() { 11960 if ($(this).attr('muted') != undefined) { 11961 $(this).prop('muted', true) 11962 } 11963 }); 11964 var aStoredBoxResizer = oElement.data('aBoxResizer'); 11965 if (aStoredBoxResizer) { 11966 $.each(aStoredBoxResizer, function(i, o) { 11967 o.reInitialize() 11968 }) 11969 } 11970 }, 11971 onChange: function(event) { 11972 $('video', oElement).each(function() { 11973 if (typeof (this.pause) == 'function') { 11974 this.pause(); 11975 if (this.currentTime != 0) { 11976 this.currentTime = 0 11977 } 11978 $(this).off('ended'); 11979 checkVideoControls(this) 11980 } 11981 }); 11982 $('iframe[src*="youtube.com/"][src*="enablejsapi=1"], iframe[src*="youtu.be/"][src*="enablejsapi=1"]', oElement).each(function(i, video) { 11983 var oVideo = $(video); 11984 if (oVideo.data('youtubeplayer') != undefined) { 11985 if (oVideo.attr('data-autoplay') == 'true') { 11986 oVideo.data('youtubeplayer').pauseVideo(); 11987 oVideo.data('youtubeplayer').seekTo(0, true) 11988 } else { 11989 oVideo.data('youtubeplayer').stopVideo() 11990 } 11991 } 11992 }) 11993 }, 11994 onDrag: function(event) { 11995 $('video', oElement).each(function() { 11996 if (typeof (this.pause) == 'function') { 11997 this.pause(); 11998 checkVideoControls(this) 11999 } 12000 }); 12001 $('iframe[src*="youtube.com/"][src*="enablejsapi=1"], iframe[src*="youtu.be/"][src*="enablejsapi=1"]', oElement).each(function(i, video) { 12002 if ($(video).data('youtubeplayer') != undefined) { 12003 $(video).data('youtubeplayer').pauseVideo() 12004 } 12005 }); 12006 if (typeof (onDrag) == 'function') { 12007 onDrag(event.relatedTarget.relative(event.relatedTarget.current()) || 0, event) 12008 } 12009 }, 12010 onDragged: function(event) { 12011 $.proxy(initVideos, this)(event); 12012 if (typeof (onDragged) == 'function') { 12013 onDragged(event.relatedTarget.relative(event.relatedTarget.current()) || 0, event) 12014 } 12015 }, 12016 onTranslated: function(event) { 12017 $.proxy(initVideos, this)(event) 12018 }, 12019 onResized: function() { 12020 if (typeof ($('[data-object-fit="cover"]', oElement.parent()).objectFit) == 'function') { 12021 $('[data-object-fit="cover"]', oElement.parent()).objectFit('cover') 12022 } 12023 }, 12024 onLoadLazy: function(event) { 12025 var element = event.element; 12026 var oPicture; 12027 if (element.is('picture')) { 12028 oPicture = element 12029 } else { 12030 oPicture = element.find('picture') 12031 } 12032 oPicture.one('image:load', $.proxy(function() { 12033 this.trigger('loaded', { 12034 element: event.element, 12035 url: event.url 12036 }, 'lazy') 12037 }, this)) 12038 } 12039 }, oOptions || {}, options || {}); 12040 function initVideos(event) { 12041 var bAutoPlay = this.settings.autoplay; 12042 $('.owl-item', oElement).eq(event.item.index).find('video').each($.proxy(function(i, video) { 12043 if (typeof (video.play) == 'function') { 12044 markVideoLoaded(video); 12045 $(video).one('play', $.proxy(function() { 12046 if (bAutoPlay) { 12047 oElement.trigger('stop.owl.autoplay') 12048 } 12049 }, this)); 12050 $(video).one('ended', $.proxy(function() { 12051 if (bAutoPlay) { 12052 oElement.trigger('play.owl.autoplay'); 12053 oElement.trigger('next.owl.carousel') 12054 } 12055 }, this)); 12056 if ($(video).attr('data-autoplay') == 'true') { 12057 $(video).attr('autoplay', 'true'); 12058 if (bAutoPlay) { 12059 oElement.trigger('play.owl.autoplay'); 12060 oElement.trigger('next.owl.autoplay') 12061 } 12062 if (video.readyState == 4) { 12063 video.play(); 12064 checkVideoControls(video) 12065 } else { 12066 video.onloadeddata = function() { 12067 video.play(); 12068 checkVideoControls(video) 12069 } 12070 } 12071 } 12072 } 12073 }, this)); 12074 $('.owl-item', oElement).eq(event.item.index).find('iframe[src*="youtube.com/"][src*="enablejsapi=1"], iframe[src*="youtu.be/"][src*="enablejsapi=1"]').each($.proxy(function(i, video) { 12075 if (bAutoPlay) { 12076 oElement.trigger('stop.owl.autoplay') 12077 } 12078 if (typeof (YT) == 'undefined') { 12079 var tag = document.createElement('script'); 12080 tag.src = "https://www.youtube.com/iframe_api"; 12081 var youtubeiframe = document.getElementsByTagName('script')[0]; 12082 youtubeiframe.parentNode.insertBefore(tag, youtubeiframe) 12083 }
12084 if ($(video).data('youtubeplayer') == undefined) { 12085 var lYoutubeInterval = window.setInterval($.proxy(function() { 12086 if (typeof (YT) != 'undefined' && typeof (YT.Player) != 'undefined') { 12087 clearInterval(lYoutubeInterval); 12088 if ($(video).data('youtubeplayer-initialized') != undefined) 12089 return; 12090 $(video).data('youtubeplayer-initialized', true); 12091 var onPlayerReady = function() { 12092 if ($(video).attr('src').indexOf('&mute=1') > -1) 12093 $(video).data('youtubeplayer').mute(); 12094 if ($(video).attr('data-autoplay') == 'true') 12095 $(video).data('youtubeplayer').playVideo() 12096 }; 12097 var onPlayerStateChange = $.proxy(function(o) { 12098 if (o.data === 1) { 12099 oElement.trigger('stop.owl.autoplay') 12100 } 12101 if (o.data === 0) { 12102 if (bAutoPlay) { 12103 oElement.trigger('play.owl.autoplay'); 12104 oElement.trigger('next.owl.carousel') 12105 } 12106 } 12107 }, this); 12108 $(video).data('youtubeplayer', new YT.Player(video,{ 12109 events: { 12110 'onReady': onPlayerReady, 12111 'onStateChange': onPlayerStateChange 12112 } 12113 })) 12114 } 12115 }, this), 1000) 12116 } else { 12117 if ($(video).attr('data-autoplay') == 'true') { 12118 $(video).data('youtubeplayer').playVideo() 12119 } 12120 } 12121 }, this)) 12122 } 12123 function checkVideoControls(video) { 12124 if ($(video).closest('div').find('div.video-controls').length) { 12125 if (video.paused) { 12126 $(video).closest('div').find('div.video-controls').addClass('paused'); 12127 $(video).closest('div').find('div.video-controls').removeClass('playing') 12128 } else { 12129 $(video).closest('div').find('div.video-controls').addClass('playing'); 12130 $(video).closest('div').find('div.video-controls').removeClass('paused') 12131 } 12132 } 12133 } 12134 oElement.owlCarousel(oOptions) 12135} 12136// Flags a video's wrappers once a frame can be shown, so CSS can fade in overlays and text (see Themestage T1). 12137// addEventListener on purpose: the carousel assigns `video.onloadeddata = ...` and would clobber a property handler. 12138function markVideoLoaded(video) { 12139 video = $(video)[0]; 12140 if (!video || video.markVideoLoadedBound) { 12141 return 12142 } 12143 video.markVideoLoadedBound = true; 12144 var setLoaded = function() { 12145 $(video).closest('div.video').addClass('video-loaded'); 12146 $(video).closest('article.element').addClass('video-loaded') 12147 }; 12148 if (video.readyState >= 2) { 12149 setLoaded(); 12150 return 12151 } 12152 video.addEventListener('loadeddata', setLoaded, { 12153 once: true 12154 }); 12155 // Content must never stay hidden if the video stalls. 12156 window.setTimeout(setLoaded, 4000) 12157} 12158(function($) { 12159 $.fn.convertVideo = function(args) { 12160 var defaults = { 12161 container: null, 12162 ignorePixelRatio: true 12163 }; 12164 var settings = $.extend({}, defaults, args); 12165 this.each(function() { 12166 var breakpoints = new Array(); 12167 var windowWidth, currentMedia, element, timeoutOffset; 12168 var PixelRatio = 1; 12169 if (!settings.ignorePixelRatio && window.devicePixelRatio !== undefined) 12170 PixelRatio = window.devicePixelRatio; 12171 element = $(this); 12172 element.next('noscript').remove(); 12173 if (element.attr('bVideoTagConverted') == 'true') 12174 return true; 12175 element.attr('bVideoTagConverted', true); 12176 getCurrentMedia(true); 12177 function getCurrentMedia(init) { 12178 if (init) { 12179 element.find('source').each(function() { 12180 var media; 12181 media = $(this).attr('data-media-minwidth'); 12182 if (media) { 12183 breakpoints.push(parseInt(media, 10)) 12184 } 12185 }); 12186 breakpoints.sort(function(a, b) { 12187 return a - b 12188 }) 12189 } 12190 var c = 0; 12191 if (settings.container == null) { 12192 windowWidth = $(window).width() * PixelRatio 12193 } else { 12194 windowWidth = ($(settings.container).width()) * PixelRatio 12195 } 12196 $.each(breakpoints, function(i, v) { 12197 if (parseInt(windowWidth) >= parseInt(v) && parseInt(c) <= parseInt(v)) 12198 c = v 12199 }); 12200 if (currentMedia !== c) { 12201 currentMedia = c; 12202 setVideo() 12203 } 12204 } 12205 function setVideo() { 12206 var sizes = new Object(); 12207 element.find('source').each(function() { 12208 var media, path, num; 12209 media = $(this).attr('data-media-minwidth'); 12210 path = $(this).attr('data-url'); 12211 if (media) { 12212 num = parseInt(media, 10) 12213 } else { 12214 num = 0 12215 } 12216 sizes[num] = path 12217 }); 12218 if (sizes[currentMedia] == undefined) { 12219 sizes[currentMedia] = '' 12220 } 12221 if (sizes[currentMedia] != '' && !element.attr('bVideoConverted')) { 12222 element.on('loadedmetadata', function() { 12223 $(this).attr('bVideoConverted', true); 12224 $(this).trigger('video:converted'); 12225 if (this.autoplay == true || $(this).attr('data-autoplay') == 'true') { 12226 $(this).one('autoplay.detect', function() { 12227 setVideoControls(this) 12228 }); 12229 if (detectAutoplay(this) < 0) { 12230 window.setTimeout($.proxy(function() { 12231 if ($(document).data('video-autoplay') == undefined || $(document).data('video-autoplay') != 1) { 12232 setVideoControls(this) 12233 } 12234 }, this), 1000) 12235 } else { 12236 setVideoControls(this) 12237 } 12238 } else { 12239 setVideoControls(this) 12240 } 12241 }); 12242 if ($(element).attr('data-autoplay') == 'true') { 12243 if (!$(element).closest('.owl-carousel').length) { 12244 $(element).attr('autoplay', 'true') 12245 } 12246 } 12247 element.attr('src', sizes[currentMedia]); 12248 if (navigator.connection != undefined && navigator.connection.saveData) { 12249 $(document).data('video-autoplay', 0); 12250 $('body').addClass('video-no-autoplay'); 12251 setVideoControls(element) 12252 } 12253 } else if (element.length) { 12254 // Native <source> children are already selected by the parser; load() would abort that fetch. 12255 if (!element[0].currentSrc) { 12256 element[0].load() 12257 } 12258 setVideoControls(element[0]) 12259 } 12260 } 12261 function detectAutoplay(oVideo) { 12262 if ($(document).data('video-autoplay') == undefined) { 12263 var testStarted = false;
12264 try { 12265 var playsinline = navigator.userAgent.match(/(iPhone|iPod|iPad)/g) ? ('playsInline'in document.createElement('video')) : true; 12266 if (!playsinline) { 12267 $(document).data('video-autoplay', 0); 12268 $('body').addClass('video-no-autoplay'); 12269 return -1 12270 } 12271 var $video = $('<video src="data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAA7RtZGF0AAACrAYF//+o3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE1MiByMTkgYmEyNDg5OSAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTcgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0xIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDM6MHgxMTMgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTEgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz0zIGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MyBiX3B5cmFtaWQ9MiBiX2FkYXB0PTEgYl9iaWFzPTAgZGlyZWN0PTEgd2VpZ2h0Yj0xIG9wZW5fZ29wPTAgd2VpZ2h0cD0yIGtleWludD0yNTAga2V5aW50X21pbj0yNSBzY2VuZWN1dD00MCBpbnRyYV9yZWZyZXNoPTAgcmNfbG9va2FoZWFkPTQwIHJjPWNyZiBtYnRyZWU9MSBjcmY9MjguMCBxY29tcD0wLjYwIHFwbWluPTAgcXBtYXg9NjkgcXBzdGVwPTQgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAACpliIQAJ//+8dzwKZrlxoFv6nFTjrH/8I5IvpuR7wM+8DluLAAQcGNdwkEAAAAKQZokbEJ/8yAHLAAAAAhBnkJ4jf8JeQAAAAgBnmF0Rf8KSAAAAAgBnmNqRf8KSQAAABBBmmhJqEFomUwIR//kQBXxAAAACUGehkURLG8JeQAAAAgBnqV0Rf8KSQAAAAgBnqdqRf8KSAAAAA9BmqxJqEFsmUwI/4cAU8AAAAAJQZ7KRRUsbwl5AAAACAGe6XRF/wpIAAAACAGe62pF/wpIAAAADkGa70moQWyZTAi/AAJPAAAACUGfDUUVLG8JeQAAAAgBny5qRf8KSQAAA8ptb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAACFwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAC9HRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAACFwAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAoAAAAFoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAhcAAAMAAAEAAAAAAmxtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAACzgAAAYAFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAIXbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAB13N0YmwAAACXc3RzZAAAAAAAAAABAAAAh2F2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAoABaAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAxYXZjQwFkAAv/4QAYZ2QAC6zZQo35IQAAAwAMAAADAs4PFCmWAQAGaOviSyLAAAAAGHN0dHMAAAAAAAAAAQAAABAAAAGAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAACIY3R0cwAAAAAAAAAPAAAAAQAAAwAAAAABAAAHgAAAAAEAAAMAAAAAAQAAAAAAAAABAAABgAAAAAEAAAeAAAAAAQAAAwAAAAABAAAAAAAAAAEAAAGAAAAAAQAAB4AAAAABAAADAAAAAAEAAAAAAAAAAQAAAYAAAAABAAAGAAAAAAIAAAGAAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAAQAAAAAQAAAFRzdHN6AAAAAAAAAAAAAAAQAAAC3gAAAA4AAAAMAAAADAAAAAwAAAAUAAAADQAAAAwAAAAMAAAAEwAAAA0AAAAMAAAADAAAABIAAAANAAAADAAAABRzdGNvAAAAAAAAAAEAAAAwAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ny43Ny4xMDA=" controls playsinline muted width="20" height="20" style="position:fixed;z-index:1000;top:0;left:0;display:none;"></video>'); 12272 $('body').prepend($video); 12273 testStarted = true; 12274 $video[0].play(); 12275 $video[0].onplay = function() { 12276 this.playing = true 12277 } 12278 ; 12279 $video[0].oncanplay = function() { 12280 var bAutoplay = 0; 12281 if ($video[0].playing) { 12282 $('body').addClass('video-autoplay'); 12283 bAutoplay = 1 12284 } else { 12285 $('body').addClass('video-no-autoplay'); 12286 bAutoplay = 0 12287 } 12288 $video[0].pause(); 12289 $video.remove(); 12290 $(document).data('video-autoplay', bAutoplay); 12291 $(oVideo).trigger('autoplay.detect'); 12292 return bAutoplay 12293 } 12294 ; 12295 return -1 12296 } catch (e) {} 12297 if (!testStarted) { 12298 $(document).data('video-autoplay', 0); 12299 $('body').addClass('video-no-autoplay'); 12300 return 0 12301 } 12302 } else { 12303 return $(document).data('video-autoplay') 12304 } 12305 } 12306 function setVideoControls(oVideo) { 12307 markVideoLoaded(oVideo); 12308 var oVideoControls = $(oVideo).next('.video-controls'); 12309 if (!oVideoControls.length && (oVideo.autoplay == true || $(oVideo).attr('data-autoplay') == 'true')) { 12310 if ($(document).data('video-autoplay') != 1) { 12311 oVideoControls = $('<div class="video-controls"><div class="play"></div><div class="pause"></div></div>'); 12312 $(oVideo).after(oVideoControls) 12313 } 12314 } 12315 if (oVideoControls.length) { 12316 if (typeof isMobileDevice === 'function' && isMobileDevice()
12316) { 12317 oVideoControls.addClass('controls-mobile') 12318 } 12319 oVideoControls.addClass('loaded'); 12320 $(oVideo).on('play', function() { 12321 oVideoControls.addClass('playing'); 12322 oVideoControls.removeClass('paused') 12323 }); 12324 $(oVideo).on('pause', function() { 12325 oVideoControls.removeClass('playing'); 12326 oVideoControls.addClass('paused') 12327 }); 12328 $('.play', oVideoControls).on('click', function() { 12329 var oPlayVideo = $(this).parent().prev('video')[0]; 12330 if (oPlayVideo.readyState === 0) { 12331 oPlayVideo.load() 12332 } 12333 oPlayVideo.play() 12334 }); 12335 $('.pause', oVideoControls).on('click', function() { 12336 $(this).parent().prev('video')[0].pause() 12337 }) 12338 } 12339 } 12340 }) 12341 } 12342 ; 12343 $(document).ready(function() { 12344 $('video[data-resize="true"]').convertVideo() 12345 }) 12346} 12347)(jQuery); 12348(function($) { 12349 function calendar(element, options) { 12350 $.data(element, 'calendar', this); 12351 var _version = 'v1.1'; 12352 var _options = $.extend({ 12353 dtStart: new Date(), 12354 bLoadFromInput: false, 12355 bYearPaging: false, 12356 bOnlyAfterToday: false, 12357 bVisableOnLoad: true, 12358 bRepositionOnOpen: false, 12359 sCalendarClass: 'kalender', 12360 aDays: ['Montag', 'Dienstag', 'Mitwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'], 12361 lDaysLength: 2, 12362 aMonths: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 12363 aDisabledDays: [], 12364 sJsonUrl: '', 12365 bLinkOnNoEvent: false, 12366 lVisibleMonths: 1, 12367 oDelete: { 12368 "bDelete": false 12369 }, 12370 sRelatedField: '', 12371 bTwoRelatedFieldCalendars: false, 12372 dtMinimum: null, 12373 dtMaximum: null, 12374 dtRelatedFieldMaximum: null, 12375 sDefaultDaysBetween: 'd7', 12376 lMinimumDaysBetween: 0, 12377 bCloseButton: false, 12378 sClonePositionId: '',
12379 bShowNextPrevBottom: false, 12380 bNoTable: false, 12381 bNoDays: false, 12382 bUseDayDivs: false, 12383 bNameInAllDays: false, 12384 bNoPosition: false, 12385 bStyleMode: false, 12386 sOpenDirection: 'top-left', 12387 sTarget: '', 12388 sResetElementId: '', 12389 bCloseOnWindowClick: false, 12390 bNoTriggerRelatedField: false, 12391 lEffectDuration: 1.0, 12392 setHref: function() {}, 12393 onAfterLoaded: function() {}, 12394 bUseEffect: true, 12395 bSvgIcon: false, 12396 lIconsVersion: 1, 12397 bRelatedField: false 12398 }, options || {}); 12399 var _element = $(element).attr('id'); 12400 var _input = $(element).attr('id'); 12401 var _oResponse = null; 12402 var _dtMinDate = null; 12403 var _dtMaxDate = null; 12404 var _oCloseButton = null; 12405 var _bRelatedEvent = null; 12406 var _bWindowLoaded = false; 12407 var _aRelatedFieldDisabledDays = []; 12408 var _bPrevDayLocked = false; 12409 function _init() { 12410 if (_options.sTarget != '') { 12411 _options.sTarget = ' target="' + _options.sTarget + '"' 12412 } 12413 if (_options.sResetElementId != '') { 12414 $(window).bind("load.calendar", $.proxy(function() { 12415 $("#" + _options.sResetElementId).bind('click', $.proxy(_unselectDays, this)) 12416 }, this)) 12417 } 12418 if (_options.dtMinimum != null) { 12419 var aMinimum = $.proxy(_isDate, this)(_options.dtMinimum); 12420 if (!aMinimum[0]) { 12421 _dtMinDate = eval(_options.dtMinimum) 12422 } else { 12423 _dtMinDate = _options.dtMinimum 12424 } 12425 } 12426 if (_options.dtMaximum != null) { 12427 var aMaximum = $.proxy(_isDate, this)(_options.dtMaximum); 12428 if (!aMaximum[0]) { 12429 _dtMaxDate = eval(_options.dtMaximum) 12430 } else { 12431 _dtMaxDate = _options.dtMaximum 12432 } 12433 } 12434 if (!$.isArray(_options.aDisabledDays)) { 12435 _options.aDisabledDays = _options.aDisabledDays.split(',') 12436 } 12437 _aRelatedFieldDisabledDays = _options.aDisabledDays.slice(); 12438 if (!_options.bRelatedField && _options.aDisabledDays.length && _options.lMinimumDaysBetween > 0) { 12439 $.each(_options.aDisabledDays, function(i, dtDisabledDay) { 12440 var oTmpDate = $.zeppDateFormat(dtDisabledDay).add(_options.lMinimumDaysBetween * -1); 12441 var aDatesBetween = $.zeppDateFormat(oTmpDate.getDate()).getDatesBetween(dtDisabledDay); 12442 $.each(aDatesBetween, function(i, oDate) { 12443 var sTmpDate = $.zeppDateFormat(oDate).format('d.m.Y'); 12444 if (_options.aDisabledDays.indexOf(sTmpDate) === -1) { 12445 _options.aDisabledDays.push(sTmpDate) 12446 } 12447 }) 12448 }) 12449 } 12450 if (_options.sRelatedField != '') { 12451 this.sSelectDaysStatus = 'load'; 12452 this.lClickedDay = -1; 12453 this.lSelectStartDay = -1; 12454 this.dtActualClickedDate = null; 12455 this.dtVisableDate = null; 12456 this.dtSelected = [null, null]; 12457 if (_options.bLoadFromInput == true) { 12458 if ($("#" + _input).val() != '' && $("#" + _options.sRelatedField).val() != '') { 12459 var aDate = $("#" + _input).val().split('.'); 12460 _options.dtStart = new Date(aDate[2],aDate[1] - 1,1); 12461 this.sSelectDaysStatus = 'end'; 12462 this.dtSelected[0] = new Date(aDate[2],aDate[1] - 1,aDate[0]); 12463 aDate = $("#" + _options.sRelatedField).val().split('.'); 12464 this.dtSelected[1] = new Date(aDate[2],aDate[1] - 1,aDate[0]) 12465 } 12466 } 12467 if (_options.bTwoRelatedFieldCalendars) { 12468 $(document).ready($.proxy(function() { 12469 if (!_bWindowLoaded) { 12470 _bWindowLoaded = true; 12471 if ($("#" + _options.sRelatedField).closest('div.inputfield')) { 12472 var oInputField = $("#" + _options.sRelatedField).closest('div.inputfield'); 12473 oInputField.removeClass('inputfield'); 12474 oInputField.addClass('calendarfield') 12475 } 12476 if ($("#" + _options.sRelatedField).closest('div.row.input')) { 12477 var oInput = $("#" + _options.sRelatedField).closest('div.row.input'); 12478 oInput.removeClass('input'); 12479 oInput.addClass('calendar') 12480 } 12481 var dtMinimum = 'if (!isNaN($.zeppDateFormat($(\'#' + _input + '\').val()).getDate())) { $.zeppDateFormat($(\'#' + _input + '\').val()).add(' + _options.lMinimumDaysBetween + ').format(\'d.m.Y\'); } else { $.zeppDateFormat().format(\'d.m.Y\'); }'; 12482 var dtRelatedFieldStart = new Date(); 12483 if (_dtMinDate != null) { 12484 if ($.zeppDateFormat(_dtMinDate).diff(new Date()) > 0) { 12485 dtMinimum = 'if (!isNaN($.zeppDateFormat($(\'#' + _input + '\').val()).getDate())) { $.zeppDateFormat($(\'#' + _input + '\').val()).add(' + _options.lMinimumDaysBetween + ').format(\'d.m.Y\'); } else { $.zeppDateFormat(\'' + _dtMinDate + '\').add(' + _options.lMinimumDaysBetween + ').format(\'d.m.Y\'); }'; 12486 dtRelatedFieldStart = $.zeppDateFormat(_dtMinDate).add(_options.lMinimumDaysBetween).getDate() 12487 } 12488 } 12489 $.calendar($('#' + _options.sRelatedField), { 12490 dtStart: dtRelatedFieldStart, 12491 bYearPaging: _options.bYearPaging, 12492 bOnlyAfterToday: true, 12493 sCalendarClass: _options.sCalendarClass, 12494 oDelete: _options.oDelete, 12495 aDays: _options.aDays, 12496 aMonths: _options.aMonths, 12497 bLoadFromInput: true, 12498 bVisableOnLoad: false, 12499 dtMinimum: dtMinimum, 12500 dtMaximum: _options.dtRelatedFieldMaximum, 12501 bCloseButton: _options.bCloseButton, 12502 bNoPosition: _options.bNoPosition, 12503 bRepositionOnOpen: _options.bRepositionOnOpen, 12504 bCloseOnWindowClick: true,
12505 lEffectDuration: _options.lEffectDuration, 12506 bUseEffect: _options.bUseEffect, 12507 bSvgIcon: _options.bSvgIcon, 12508 lIconsVersion: _options.lIconsVersion, 12509 bRelatedField: true, 12510 aDisabledDays: _aRelatedFieldDisabledDays 12511 }) 12512 } 12513 }, this)) 12514 } 12515 } 12516 if ((_element === undefined || $("#" + _element).prop("tagName").toLowerCase() == 'input') && _options.bVisableOnLoad) { 12517 var sId = 'kalender' + new Date().getTime(); 12518 document.write('<div id="' + sId + '" class="' + _options.sCalendarClass + 'container"> </div>'); 12519 _element = sId 12520 } 12521 if (_options.bVisableOnLoad) { 12522 $.proxy(_createCalendar, this)() 12523 } else { 12524 if (document.loaded) { 12525 $.proxy(_createOpener, this)() 12526 } else { 12527 $(document).ready($.proxy(function() { 12528 $.proxy(_createOpener, this)() 12529 }, this)) 12530 } 12531 } 12532 } 12533 function _createCalendar(lCustomMonth, lCustomYear) { 12534 var dtMonth = new Date(_options.dtStart); 12535 dtMonth.setDate(1); 12536 if (lCustomMonth === undefined) { 12537 lCustomMonth = dtMonth.getMonth() 12538 } else { 12539 if (lCustomMonth > 11) { 12540 lCustomMonth = 0; 12541 if (lCustomYear === undefined) { 12542 lCustomYear = dtMonth.getFullYear() 12543 } 12544 lCustomYear += 1 12545 } else if (lCustomMonth < 0) { 12546 lCustomMonth = 11; 12547 if (lCustomYear === undefined) { 12548 lCustomYear = dtMonth.getFullYear() 12549 } 12550 lCustomYear -= 1 12551 } 12552 } 12553 dtMonth.setMonth(lCustomMonth); 12554 if (lCustomYear === undefined) { 12555 lCustomYear = dtMonth.getFullYear() 12556 } 12557 dtMonth.setFullYear(lCustomYear); 12558 this.dtVisableDate = new Date(dtMonth); 12559 if (_options.sJsonUrl != '') { 12560 $.ajax(_options.sJsonUrl, { 12561 async: false, 12562 data: { 12563 'lMonth': dtMonth.getMonth() + 1, 12564 'lYear': dtMonth.getFullYear() 12565 }, 12566 type: "POST", 12567 success: $.proxy(function(data) { 12568 _oResponse = $.parseJSON(data); 12569 $.proxy(_createHtmlCalendar, this)(dtMonth, lCustomMonth, lCustomYear) 12570 }, this) 12571 }) 12572 } else { 12573 $.proxy(_createHtmlCalendar, this)(dtMonth, lCustomMonth, lCustomYear) 12574 } 12575 $(document.body).trigger('calendar:load') 12576 } 12577 function _createHtmlCalendar(dtMonth, lCustomMonth, lCustomYear) { 12578 var lDay = 1; 12579 var lMod = 0; 12580 var sContent = ''; 12581 var sDay = ''; 12582 var sPrevMonthClick = $.proxy(function() { 12583 $.proxy(_createCalendar, this)(lCustomMonth - 1, lCustomYear) 12584 }, this); 12585 var sNextMonthClick = $.proxy(function() { 12586 $.proxy(_createCalendar, this)(lCustomMonth + 1, lCustomYear) 12587 }, this); 12588 var sPrevYearClick = $.proxy(function() { 12589 $.proxy(_createCalendar, this)(lCustomMonth, lCustomYear - 1) 12590 }, this); 12591 var sNextYearClick = $.proxy(function() { 12592 $.proxy(_createCalendar, this)(lCustomMonth, lCustomYear + 1) 12593 }, this); 12594 var oCalendar = $('<div></div>', { 12595 'class': _options.sCalendarClass 12596 }); 12597 var oPrevMonth = $('<a></a>', { 12598 'class': 'prev' 12599 }).html('<'); 12600 var oNextMonth = $('<a></a>', { 12601 'class': 'next' 12602 }).html('>'); 12603 oPrevMonth[0].onclick = sPrevMonthClick; 12604 oNextMonth[0].onclick = sNextMonthClick; 12605 if (_options.bYearPaging) { 12606 var oPrevYear = $('<a></a>', { 12607 'class': 'prevyear' 12608 }).html('<<'); 12609 var oNextYear = $('<a></a>', { 12610 'class': 'nextyear' 12611 }).html('>>'); 12612 oPrevYear[0].onclick = sPrevYearClick; 12613 oNextYear[0].onclick = sNextYearClick 12614 } 12615 if (_options.bYearPaging) { 12616 oCalendar.append(oPrevYear) 12617 } 12618 oCalendar.append(oPrevMonth); 12619 oCalendar.append(oNextMonth); 12620 if (_options.bYearPaging) { 12621 oCalendar.append(oNextYear) 12622 } 12623 oCalendar.append('<div class="clear" > </div>'); 12624 var oCalendarBox = []; 12625 var oCalendarTable = []; 12626 var oCalendarMonth = [];
12627 _bPrevDayLocked = false; 12628 for (var j = 0; j < _options.lVisibleMonths; j++) { 12629 if (_options.lVisibleMonths > 1 && (j >= 1)) { 12630 $.ajax(_options.sJsonUrl, { 12631 async: false, 12632 data: { 12633 'lMonth': dtMonth.getMonth() + 1, 12634 'lYear': dtMonth.getFullYear() 12635 }, 12636 type: "POST", 12637 success: $.proxy(function(data) { 12638 _oResponse = $.parseJSON(data) 12639 }, this) 12640 }) 12641 } 12642 lMod = 0; 12643 lDay = 1; 12644 oCalendarBox[j] = $('<div></div>', { 12645 'class': _options.sCalendarClass + 'box' 12646 }); 12647 oCalendarMonth[j] = $('<b></b>').html(_options.aMonths[dtMonth.getMonth()] + ' ' + dtMonth.getFullYear()); 12648 oCalendarTable[j] = $('<table></table>'); 12649 if (!_options.bNoDays && !_options.bNameInAllDays) { 12650 sContent = '<tr>'; 12651 $.each(_options.aDays, $.proxy(function(i, sDay) { 12652 sContent += '<th>' + sDay.substr(0, _options.lDaysLength) + '</th>' 12653 }, this)); 12654 sContent += '</tr>' 12655 } 12656 sContent += '<tr>'; 12657 for (var i = 1; i < (dtMonth.getDay() == 0 ? 7 : dtMonth.getDay()); i++) { 12658 sContent += '<td> </td>'; 12659 lMod++ 12660 } 12661 while (lDay <= dtMonth.getDate()) { 12662 if (lMod % 7 == 0) { 12663 sContent += '</tr><tr>' 12664 } 12665 if (_options.bNameInAllDays) { 12666 sDay = '<span class="day">' + _options.aDays[(lMod % 7)].substr(0, _options.lDaysLength) + '</span>' 12667 } 12668 if ($.proxy(_checkDate, this)(dtMonth, '=') && !$.proxy(_isDayDisabled, this)(dtMonth)) { 12669 if ($.zeppDateFormat(new Date()).diff(dtMonth) == 0) { 12670 sContent += '<td class="today">' 12671 } else { 12672 sContent += '<td>' 12673 } 12674 if ($.proxy(_isEventOnDay, this)(dtMonth)) { 12675 sContent += $.proxy(_getHtmlData, this)(dtMonth); 12676 sContent += '<a' + _options.sTarget + $.proxy(_getHtmlDataOpener, this)(dtMonth) + $.proxy(_getBackground, this)(dtMonth) + ' href="' + $.proxy(_getHref, this)(dtMonth) + '">' + sDay + lDay + '</a>' 12677 } else { 12678 sContent += sDay + '<span>' + lDay + '</span>' 12679 } 12680 sContent += '</td>' 12681 } else if ((!_options.bOnlyAfterToday || $.proxy(_checkDate, this)(dtMonth, '>')) && $.proxy(_isEventOnDay, this)(dtMonth) && !$.proxy(_isDayDisabled, this)(dtMonth)) { 12682 sContent += '<td>' + $.proxy(_getHtmlData, this)(dtMonth) + '<a' + _options.sTarget + $.proxy(_getHtmlDataOpener, this)(dtMonth) + $.proxy(_getBackground, this)(dtMonth) + ' href="' + $.proxy(_getHref, this)(dtMonth) + '">' + sDay + lDay + '</a></td>' 12683 } else { 12684 sContent += '<td>' + sDay + '<span>' + lDay + '</span></td>' 12685 } 12686 lDay++; 12687 dtMonth.setDate(lDay); 12688 lMod++ 12689 } 12690 sContent += '</tr>'; 12691 if (_options.bUseDayDivs) { 12692 sContent = sContent.replace(/<td>/g, '<td><div class="day">'); 12693 sContent = sContent.replace(/<td class="today">/g, '<td><div class="day today">'); 12694 sContent = sContent.replace(/<\/td>/g, '</div></td>') 12695 } 12696 if (_options.bNoTable) { 12697 sContent = sContent.replace(/<\/?td[^>]*>/gi, ''); 12698 sContent = sContent.replace(/<\/?tr[^>]*>/gi, '') 12699 } 12700 oCalendarTable[j].html(sContent); 12701 oCalendarBox[j].html(oCalendarMonth[j]); 12702 oCalendarBox[j].append(_options.bNoTable ? sContent : oCalendarTable[j]); 12703 oCalendar.append(oCalendarBox[j]) 12704 } 12705 if (_options.bShowNextPrevBottom) { 12706 var oTempElement = $('<div></div>', { 12707 'class': 'untenweiterschalten' 12708 }); 12709 var oTempPrevMonth = oPrevMonth.clone(true); 12710 var oTempNextMonth = oNextMonth.clone(true); 12711 oTempPrevMonth[0].onclick = sPrevMonthClick; 12712 oTempNextMonth[0].onclick = sNextMonthClick; 12713 if (_options.bYearPaging) { 12714 var oTempPrevYear = oPrevYear.clone(true); 12715 var oTempNextYear = oNextYear.clone(true); 12716 oTempPrevYear[0].onclick = sPrevYearClick; 12717 oTempNextYear[0].onclick = sNextYearClick 12718 } 12719 oTempElement.append('<div class="clear" > </div>'); 12720 if (_options.bYearPaging) { 12721 oTempElement.append(oTempPrevYear) 12722 } 12723 oTempElement.append(oTempPrevMonth); 12724 oTempElement.append(oCalendarMonth[0].clone(true)); 12725 oTempElement.append(oTempNextMonth); 12726 if (_options.bYearPaging) { 12727 oTempElement.append(oTempNextYear) 12728 } 12729 oTempElement.append('<div class="clear" > </div>'); 12730 oCalendar.append(oTempElement) 12731 } 12732 if (_options.bCloseButton) { 12733 _oCloseButton = $('<a></a>', { 12734 'class': 'calendarclose' 12735 }).html('X'); 12736 _oCloseButton.bind('click', $.proxy(function() { 12737 $.proxy(_openClose, this)() 12738 }, this)); 12739 oCalendar.append(_oCloseButton) 12740 } 12741 oCalendar.append('<br class="clear" />'); 12742 $("#" + _element).html(oCalendar); 12743 _options.onAfterLoaded(); 12744 if (_options.sRelatedField == '' || _options.bTwoRelatedFieldCalendars) { 12745 if (_input !== undefined && $("#" + _input).prop("tagName").toLowerCase() == 'input') { 12746 $("#" + _element + ' td a').each($.proxy(function(i, o) { 12747 $(o).bind('click', $.proxy(function() { 12748 if (_options.bTwoRelatedFieldCalendars) {
12749 $("#" + _input).bind('input:internalchange', $.proxy(function() { 12750 $("#" + _input).unbind('input:internalchange'); 12751 $("#" + _input).trigger('input:related') 12752 }, this)) 12753 } 12754 $.proxy(_openClose, this)() 12755 }, this)) 12756 }, this)) 12757 } 12758 } else { 12759 if (this.dtSelected[0] == null) { 12760 this.sSelectDaysStatus = 'load' 12761 } 12762 $.proxy(_selectDays, this)(_element) 12763 } 12764 } 12765 function _createOpener() { 12766 var sId = 'kalender' + new Date().getTime(); 12767 var oElement = $('<div></div>', { 12768 'id': sId, 12769 'class': _options.sCalendarClass + 'container' 12770 }).html('X'); 12771 if (!_options.bStyleMode) { 12772 oElement.hide() 12773 } 12774 _element = sId; 12775 var oLink = $('<a></a>', { 12776 'id': 'opener' + sId, 12777 'href': 'javascript: void(0);', 12778 'class': _options.sCalendarClass + 'opener' 12779 }).html(' '); 12780 oLink.bind('click', $.proxy(function() { 12781 $.proxy(_openClose, this)() 12782 }, this)); 12783 if (_input !== undefined && $("#" + _input).prop("tagName").toLowerCase() == 'input') { 12784 if (_options.bTwoRelatedFieldCalendars == true) { 12785 $("#" + _input).bind('focus', $.proxy(function() { 12786 $.proxy(_openClose, this)() 12787 }, this)) 12788 } else { 12789 $("#" + _input + " " + _options.sRelatedField).each($.proxy(function(i, o) { 12790 $(o).bind('focus', $.proxy(function() { 12791 $.proxy(_openClose, this)() 12792 }, this)) 12793 }, this)) 12794 } 12795 $("#" + _input).after(oLink); 12796 if (_options.bNoPosition) { 12797 $(oLink).after(oElement) 12798 } else { 12799 $(document.body).append(oElement) 12800 } 12801 $.proxy(_createCalendar, this)() 12802 } else { 12803 $(document.body).append(oLink); 12804 $(document.body).append(oElement); 12805 $.proxy(_createCalendar, this)() 12806 } 12807 if (_options.bSvgIcon) { 12808 $(oLink).html(''); 12809 $(oLink).createSvg('icon-calendar') 12810 } 12811 if (!_options.bNoPosition) { 12812 var oCumulativeOffset = oLink.offset(); 12813 var oStyle = {}; 12814 oStyle.position = 'absolute'; 12815 oStyle.left = (oCumulativeOffset.left + oLink.width() + 2) + 'px'; 12816 oStyle.top = oCumulativeOffset.top + 'px'; 12817 oElement.css(oStyle) 12818 } 12819 } 12820 function _openClose() { 12821 if (_options.sRelatedField != '' && _options.bTwoRelatedFieldCalendars) { 12822 if (_bRelatedEvent == false) { 12823 _bRelatedEvent = true; 12824 $("#" + _input).bind('input:related', $.proxy(function() { 12825 setTimeout($.proxy(function() { 12826 var oDate = $.zeppDateFormat($("#" + _input).val()); 12827 switch (_options.sDefaultDaysBetween.substr(0, 1)) { 12828 case 'd': 12829 oDate.add(_options.sDefaultDaysBetween.substr(1), 'days'); 12830 break; 12831 case 'm': 12832 oDate.add(_options.sDefaultDaysBetween.substr(1), 'months'); 12833 break; 12834 case 'y': 12835 oDate.add(_options.sDefaultDaysBetween.substr(1), 'years'); 12836 break 12837 } 12838 if (_options.aDisabledDays.length && $.proxy(_isDayBetweenDisabled, this)($("#" + _input).val(), oDate.getDate())) { 12839 if (_options.lMinimumDaysBetween > 0) { 12840 var oDate = $.zeppDateFormat($("#" + _input).val()).add(_options.lMinimumDaysBetween); 12841 if ($.proxy(_isDayBetweenDisabled, this)($("#" + _input).val(), oDate.getDate())) { 12842 $("#" + _options.sRelatedField).val($("#" + _input).val()) 12843 } else { 12844 $("#" + _options.sRelatedField).val(oDate.format('d.m.Y')) 12845 } 12846 } else { 12847 $("#" + _options.sRelatedField).val($("#" + _input).val()) 12848 } 12849 } else { 12850 $("#" + _options.sRelatedField).val(oDate.format('d.m.Y')) 12851 } 12852 if (!_options.bNoTriggerRelatedField) { 12853 $("#" + _options.sRelatedField)[0].focus() 12854 } 12855 }, this), 200) 12856 }, this)) 12857 } else if (_bRelatedEvent == null) { 12858 _bRelatedEvent = false 12859 } 12860 } 12861 if (_options.dtMinimum != null) { 12862 var aMinimum = $.proxy(_isDate, this)(_options.dtMinimum); 12863 if (!aMinimum[0]) { 12864 _dtMinDate = eval(_options.dtMinimum) 12865 } else { 12866 _dtMinDate = _options.dtMinimum 12867 } 12868 } 12869 if (_options.dtMaximum != null) { 12870 var aMaximum = $.proxy(_isDate, this)(_options.dtMaximum); 12871 if (!aMaximum[0]) { 12872 _dtMaxDate = eval(_options.dtMaximum) 12873 } else { 12874 _dtMaxDate = _options.dtMaximum 12875 } 12876 } 12877 var aIsDate = $.proxy(_isDate, this)($("#" + _input).val()); 12878 if (_options.oDelete.bDelete) { 12879 eval(_options.oDelete.sObject + '.remove(' + _options.oDelete.sData + ', \'#' + _input + '\', \'' + _options.oDelete.sDeleteThis.replace("'", "\\'") + '\')'); 12880 if (_options.sRelatedField) { 12881 eval(_options.oDelete.sObject + '.remove(' + _options.oDelete.sData + ', \'#' + _options.sRelatedField + '\', \'' + _options.oDelete.sDeleteThis.replace("'", "\\'") + '\')') 12882 } 12883 } else if (_options.oDelete.sObject != undefined && typeof (_options.oDelete.remove) != 'undefined' && _options.oDelete.sData != undefined) { 12884 eval(_options.oDelete.sObject + '.remove(' + _options.oDelete.sData + ', \'#' + _input + '\', \'\')') 12885 } 12886 if (_input !== undefined && aIsDate[0]) { 12887 $.proxy(_createCalendar, this)(aIsDate[1].getMonth(), aIsDate[1].getFullYear()) 12888 } else { 12889 $.proxy(_createCalendar, this)(_options.dtStart.getMonth(), _options.dtStart.getFullYear()) 12890 } 12891 if (_options.bRepositionOnOpen) { 12892 var oLink = $('#opener' + _element); 12893 if (_options.sClonePositionId != '') { 12894 $("#" + _element).css({ 12895 position: $("#" + _options.sClonePositionId).css('position') 12896 }) 12897 } 12898 var oCumulativeOffset = oLink.offset(); 12899 var oStyle = {}; 12900 oStyle.left = (oCumulativeOffset.left + oLink.width() + 2) + 'px'; 12901 oStyle.top = oCumulativeOffset.top + 'px'; 12902 $("#" + _element).css(oStyle) 12903 } 12904 if ($("#" + _element).css("display") == 'none') { 12905 if (_options.bCloseOnWindowClick || (_options.sRelatedField != '' && _options.bTwoRelatedFieldCalendars)) { 12906 $(document).bind('click.calendar', $.proxy(function(e) { 12907 if (_options.bSvgIcon) { 12908 if (e.target.parentNode == null || e.target.parentNode.parentNode == null || e.target == $("#" + _input)[0]) { 12909 var oElement = $(e.target) 12910 } else if (e.target.tagName == 'HTML' || e.target.tagName == 'BODY') { 12911 var oElement = {} 12912 } else { 12913 var oElement = $(e.target); 12914 if (oElement.closest('a.' + _options.sCalendarClass.replace(/\ /g, '.') + 'opener').length > 0) { 12915 oElement = oElement.closest('a.' + _options.sCalendarClass.replace(/\ /g, '.') + 'opener') 12916 } 12917 } 12918 } else { 12919 var oElement = $(e.target) 12920 } 12921 if (oElement.length != 0 && oElement.closest('div.' + _options.sCalendarClass.replace(/\ /g, '.')).length == 0 && oElement[0] != $("#" + _input)[0] && !oElement.hasClass(_options.sCalendarClass + 'opener')) { 12922 if ($("#" + _element).css("display") != 'none') { 12923 $.proxy(_openClose, this)() 12924 } 12925 } 12926 }, this)) 12927 } 12928 var onFinish = $.proxy(function() { 12929 var lElementPosition = $("#" + _element).css('left'); 12930 var lElementWidth = 0; 12931 if (lElementPosition != null) { 12932 if (lElementPosition.indexOf('px') > -1) { 12933 lElementPosition = parseInt(lElementPosition.replace('px', ''), 10) 12934 } else { 12935 lElementPosition = 0 12936 } 12937 if ($("#" + _element).width() == 0) { 12938 lElementWidth = $("#" + _element).children('div').width() 12939 } else { 12940 lElementWidth = $("#" + _element).width() 12941 } 12942 if ($(document.body).width() < (lElementPosition + lElementWidth)) { 12943 if (_options.bUseEffect) { 12944 $("#" + _element).show().animate({ 12945 left: "+=" + ($(document.body).width() - (lElementPosition + lElementWidth) - 10) 12946 }, { 12947 duration: _options.lEffectDuration * 1000 12948 }) 12949 } else { 12950 $("#" + _element).show().css({ 12951 left: lElementPosition + ($(document.body).width() - lElementPosition - lElementWidth) - 10 12952 }) 12953 } 12954 } 12955 } 12956 }, this); 12957 if (_options.bUseEffect) { 12958 var lElementWidth = $("#" + _element).width(); 12959 if (lElementWidth == 0) 12960 lElementWidth = $("#" + _element).css("width").replace("px", ""); 12961 var lElementHeight = $("#" + _element).height(); 12962 if (lElementHeight == 0) 12963 lElementHeight = $("#" + _element).css("height").replace("px", ""); 12964 $("#" + _element).css({ 12965 width: "0px", 12966 height: "0px" 12967 }).show().animate({ 12968 width: lElementWidth, 12969 height: lElementHeight 12970 }, { 12971 duration: _options.lEffectDuration, 12972 complete: onFinish 12973 }) 12974 } else { 12975 $("#" + _element).show(); 12976 onFinish() 12977 } 12978 } else { 12979 var onFinish = $.proxy(function() { 12980 $("#" + _input).trigger('input:internalchange'); 12981 $("#" + _input).trigger('input:change') 12982 }, this); 12983 if (_options.bUseEffect) { 12984 $("#" + _element).fadeOut({ 12985 duration: 500, 12986 complete: onFinish 12987 }) 12988 } else { 12989 $("#" + _element).hide(); 12990 window.setTimeout(onFinish, 200) 12991 } 12992 } 12993 } 12994 function _isDate(dtDate) { 12995 var aDate = dtDate.split('.'); 12996 var d = new Date(dtDate); 12997 if (aDate.length == 3) { 12998 d = new Date(aDate[2],parseInt(aDate[1], 10) - 1,aDate[0]) 12999 } 13000 return [!isNaN(d.getDate()), d] 13001 } 13002 function _checkDate(dtActualDate, sOperator) { 13003 var dtToday = new Date(); 13004 if (_dtMinDate != null) { 13005 var aIsDate = $.proxy(_isDate, this)(_dtMinDate); 13006 if (aIsDate[0]) { 13007 dtToday = new Date(aIsDate[1].setMonth(aIsDate[1].getMonth())) 13008 } 13009 } 13010 if (_dtMaxDate != null) { 13011 var dtMaxDate = new Date(_dtMaxDate); 13012 var aIsDate = $.proxy(_isDate, this)(_dtMaxDate); 13013 if (aIsDate[0]) { 13014 dtMaxDate = new Date(aIsDate[1].setMonth(aIsDate[1].getMonth())) 13015 } 13016 } 13017 switch (sOperator) { 13018 case '=': 13019 if (dtMaxDate != null) { 13020 if (dtToday.getFullYear() == dtActualDate.getFullYear() && dtToday.getMonth() == dtActualDate.getMonth() && dtToday.getDate() == dtActualDate.getDate() && dtActualDate.getTime() <= dtMaxDate.getTime()) { 13021 return true 13022 } else { 13023 return false 13024 } 13025 } else { 13026 if (dtToday.getFullYear() == dtActualDate.getFullYear() && dtToday.getMonth() == dtActualDate.getMonth() && dtToday.getDate() == dtActualDate.getDate()) { 13027 return true 13028 } else { 13029 return false 13030 } 13031 } 13032 case '>': 13033 if (dtMaxDate != null) { 13034 if (dtToday.getTime() < dtActualDate.getTime() && dtActualDate.getTime() <= dtMaxDate.getTime()) { 13035 return true 13036 } else { 13037 return false 13038 } 13039 } else { 13040 if (dtToday.getTime() < dtActualDate.getTime()) { 13041 return true 13042 } else { 13043 return false 13044 } 13045 } 13046 } 13047 } 13048 function _getHref(dtDate) { 13049 if (_input !== undefined && $("#" + _input).prop("tagName").toLowerCase() == 'input') { 13050 var sValue; 13051 if (_options.sRelatedField == '' || _options.bTwoRelatedFieldCalendars) { 13052 sValue = '$(\'#' + _input + '\').val(\'' + (dtDate.getDate().toString().length == 1 ? '0' + dtDate.getDate() : dtDate.getDate()) + '.' + ((dtDate.getMonth() + 1).toString().length == 1 ? '0' + (dtDate.getMonth() + 1) : (dtDate.getMonth() + 1)) + '.' + dtDate.getFullYear() + '\');' 13053 } else { 13054 sValue = '' 13055 } 13056 return 'javascript: ' + sValue + 'void(0);' 13057 } else if (_oResponse != null) { 13058 if (_options.setHref != function() {} 13059 ) { 13060 return 'javascript: ' + _options.setHref(dtDate) + '; void(0);' 13061 } else { 13062 if (_oResponse[dtDate.getDate()] !== undefined && _oResponse[dtDate.getDate()].sUrl !== undefined) { 13063 return _oResponse[dtDate.getDate()].sUrl + '?lDay=' + dtDate.getDate() + '&lMonth=' + (dtDate.getMonth() + 1) + '&lYear=' + dtDate.getFullYear() 13064 } else { 13065 return _oResponse.sUrl + '?lDay=' + dtDate.getDate() + '&lMonth=' + (dtDate.getMon
13065th() + 1) + '&lYear=' + dtDate.getFullYear() 13066 } 13067 } 13068 } 13069 } 13070 function _getBackground(dtDate) { 13071 if (_options.sJsonUrl != '') { 13072 if (_oResponse != null && _oResponse[dtDate.getDate()] !== undefined && _oResponse[dtDate.getDate()].sBackgroundUrl !== undefined) { 13073 return ' style="background: url(' + _oResponse[dtDate.getDate()].sBackgroundUrl + ') no-repeat 0px 0px;"' 13074 } else { 13075 return '' 13076 } 13077 } else { 13078 return '' 13079 } 13080 } 13081 function _getHtmlData(dtDate) { 13082 if (_options.sJsonUrl != '') { 13083 if (_oResponse != null && _oResponse[dtDate.getDate()] !== undefined && _oResponse[dtDate.getDate()].sData !== undefined) { 13084 return '<div class="' + _options.sCalendarClass + 'open"><div class="' + _options.sCalendarClass + 'balloon" id="kalenderballoon' + dtDate.getTime() + '" style="display: none;"><div class="innen">' + _oResponse[dtDate.getDate()].sData + '</div></div></div>' 13085 } else { 13086 return '' 13087 } 13088 } else { 13089 return '' 13090 } 13091 } 13092 function _getHtmlDataOpener(dtDate) { 13093 if (_options.sJsonUrl != '') { 13094 if (_oResponse != null && _oResponse[dtDate.getDate()] !== undefined && _oResponse[dtDate.getDate()].sData !== undefined) { 13095 var sReturn = ''; 13096 $('#kalenderballoon' + dtDate.getTime()).slideDown(); 13097 sReturn += ' onmouseover="var oKb = $(\'#kalenderballoon' + dtDate.getTime() + '\');'; 13098 sReturn += 'var oKbDown = $(\'#test > div\');'; 13099 sReturn += 'var lTempWidth = oKb.width();'; 13100 sReturn += 'var lTempHeight = oKb.height();'; 13101 sReturn += 'oKb.children(\'div\').css(\'display\', \'none\');'; 13102 sReturn += 'oKb.css({ width: 0, height: 0, display: \'block\' }).animate({ width: lTempWidth + \'px\', height: lTempHeight + \'px\' }, { duration: 600, complete: function(){'; 13103 sReturn += '$(this).animate({ marginRight: \'-46px\' },{ duration: 200, complete: function(){'; 13104 sReturn += '$(this).children(\'div\').fadeIn({ duration: 600, complete: function(){'; 13105 sReturn += '$(this).bind(\'mouseover\', function (){'; 13106 sReturn += 'oKb.stop().children(\'div\').stop();'; 13107 sReturn += '});'; 13108 sReturn += '$(this).bind(\'mouseout\', function(){'; 13109 sReturn += 'setTimeout(function(){'; 13110 sReturn += 'oKb.fadeOut({'; 13111 sReturn += 'duration: 300,'; 13112 sReturn += 'complete: function(){'; 13113 sReturn += '$(this).css(\'display\', \'none\');'; 13114 sReturn += 'oKb.stop().children(\'div\').stop();'; 13115 sReturn += 'oKbDown.unbind(\'mouseover\');'; 13116 sReturn += 'oKbDown.unbind(\'mouseout\');'; 13117 sReturn += '}'; 13118 sReturn += '});'; 13119 sReturn += '}, 200);'; 13120 sReturn += '});'; 13121 sReturn += '}});'; 13122 sReturn += '}});'; 13123 sReturn += '}});"'; 13124 sReturn += ' onmouseout="var oKb = $(\'#kalenderballoon' + dtDate.getTime() + '\');'; 13125 sReturn += 'setTimeout(function(){'; 13126 sReturn += 'oKb.fadeOut({'; 13127 sReturn += 'duration: 300,'; 13128 sReturn += 'complete: function(){'; 13129 sReturn += '$(this).css(\'display\', \'none\');'; 13130 sReturn += '}'; 13131 sReturn += '});'; 13132 sReturn += '}, 200);"'; 13133 return sReturn 13134 } else { 13135 return '' 13136 } 13137 } else { 13138 return '' 13139 } 13140 } 13141 function _isEventOnDay(dtDate) { 13142 if (_options.sJsonUrl != '') { 13143 if (_options.bLinkOnNoEvent) { 13144 return true 13145 } else { 13146 if (_oResponse != null && _oResponse[dtDate.getDate()] !== undefined) { 13147 return true 13148 } else { 13149 return false 13150 } 13151 } 13152 } else { 13153 return true 13154 } 13155 } 13156 function _isDayDisabled(dtDate) { 13157 if (_options.aDisabledDays.indexOf($.zeppDateFormat(dtDate).format('d.m.Y')) !== -1) {
13158 _bPrevDayLocked = true; 13159 return true 13160 } 13161 if (_options.bRelatedField && _bPrevDayLocked) { 13162 return true 13163 } 13164 if (_options.bRelatedField && _dtMinDate != null) { 13165 var bDisabledDayFound = $.proxy(_isDayBetweenDisabled, this)(_dtMinDate, dtDate); 13166 _bPrevDayLocked = bDisabledDayFound; 13167 return bDisabledDayFound 13168 } 13169 return false 13170 } 13171 function _isDayBetweenDisabled(dtStart, dtEnd) { 13172 var aDatesBetween = $.zeppDateFormat(dtStart).getDatesBetween(dtEnd); 13173 var bDisabledDayFound = false; 13174 if (_options.bRelatedField) { 13175 var aDisabledDays = _options.aDisabledDays 13176 } else { 13177 var aDisabledDays = _aRelatedFieldDisabledDays 13178 } 13179 if (aDisabledDays.indexOf($.zeppDateFormat(dtEnd).format('d.m.Y')) !== -1) { 13180 return true 13181 } 13182 $.each(aDatesBetween, function(i, oDate) { 13183 var sTmpDate = $.zeppDateFormat(oDate).format('d.m.Y'); 13184 if (aDisabledDays.indexOf(sTmpDate) !== -1) { 13185 bDisabledDayFound = true 13186 } 13187 }); 13188 return bDisabledDayFound 13189 } 13190 function _selectDays(sId, oElement, sender) { 13191 if (this.sSelectDaysStatus == 'load') { 13192 if (typeof oElement == "undefined") { 13193 $("#" + sId + " td a").each($.proxy(function(i, o) { 13194 $(o).bind('click', $.proxy(function() { 13195 $.proxy(_selectDays, this)(sId, $(o), 'click') 13196 }, this)); 13197 $(o).bind('mouseover', $.proxy(function() { 13198 $.proxy(_selectDays, this)(sId, $(o), 'over') 13199 }, this)); 13200 $(o).attr('id', sId + $(o).html()) 13201 }, this)); 13202 if (this.lClickedDay > 0) { 13203 oElement = $("#" + (sId + 1)); 13204 this.lSelectStartDay = 1; 13205 this.sSelectDaysStatus = 'hover' 13206 } 13207 } 13208 if (sender == 'click') { 13209 $(oElement).addClass('selectstart'); 13210 this.sSelectDaysStatus = 'hover'; 13211 this.lClickedDay = $(oElement).html(); 13212 this.lSelectStartDay = this.lClickedDay; 13213 this.dtActualClickedDate = new Date(this.dtVisableDate); 13214 $("#" + _input).val((this.lClickedDay.length == 1 ? '0' + this.lClickedDay : this.lClickedDay) + '.' + ((this.dtActualClickedDate.getMonth() + 1).toString().length == 1 ? '0' + (this.dtActualClickedDate.getMonth() + 1) : (this.dtActualClickedDate.getMonth() + 1)) + '.' + this.dtActualClickedDate.getFullYear()) 13215 } 13216 } else if (this.sSelectDaysStatus == 'hover' && this.dtVisableDate.valueOf() >= this.dtActualClickedDate.valueOf()) { 13217 var lClickedValue, lHoverValue; 13218 if (this.dtActualClickedDate.valueOf() == this.dtVisableDate.valueOf()) { 13219 this.lSelectStartDay = this.lClickedDay; 13220 $("#" + sId + this.lClickedDay).addClass('selectstart') 13221 } 13222 lClickedValue = parseInt(this.lSelectStartDay, 10); 13223 if (this.lClickedDay != this.lSelectStartDay) { 13224 lClickedValue -= 1 13225 } 13226 lHoverValue = parseInt($(oElement).html(), 10); 13227 $("#" + sId + " td a.selected").each(function(i, o) { 13228 $(o).removeClass('selected') 13229 }); 13230 $("#" + sId + " td a.selectend").each(function(i, o) { 13231 $(o).removeClass('selectend') 13232 }); 13233 for (var i = lClickedValue; i <= lHoverValue; i++) { 13234 if (i == lHoverValue) { 13235 $("#" + (sId + i)).addClass('selectend') 13236 } else if (i != lClickedValue) { 13237 $("#" + (sId + i)).addClass('selected') 13238 } 13239 } 13240 if (sender == 'click') { 13241 if (lClickedValue == lHoverValue) { 13242 $("#" + sId + lClickedValue).removeClass('selectstart'); 13243 $("#" + sId + lClickedValue).removeClass('selectend'); 13244 this.sSelectDaysStatus = 'load'; 13245 this.lClickedDay = -1; 13246 this.lSelectStartDay = -1; 13247 this.dtActualClickedDate = null; 13248 $("#" + _input).val('') 13249 } else { 13250 var dtFrom = new Date(this.dtVisableDate); 13251 dtFrom.setDate(this.lSelectStartDay); 13252 var dtTo = new Date(this.dtVisableDate); 13253 dtTo.setDate(lHoverValue); 13254 if (dtFrom.getTime() <= dtTo.getTime()) { 13255 $("#" + _options.sRelatedField).val((lHoverValue.toString().length == 1 ? '0' + lHoverValue : lHoverValue) + '.' + ((this.dtVisableDate.getMonth() + 1).toString().length == 1 ? '0' + (this.dtVisableDate.getMonth() + 1) : (this.dtVisableDate.getMonth() + 1)) + '.' + this.dtVisableDate.getFullYear()); 13256 var dtSelectedStart = new Date(this.dtActualClickedDate); 13257 dtSelectedStart.setDate(this.lClickedDay); 13258 this.dtSelected[0] = dtSelectedStart; 13259 this.dtSelected[1] = dtTo; 13260 this.sSelectDaysStatus = 'end'; 13261 if (!_options.bVisableOnLoad) { 13262 $.proxy(_openClose, this)() 13263 } 13264 $("#" + _options.sRelatedField).trigger('input:internalchange'); 13265 $("#" + _options.sRelatedField).trigger('input:change') 13266 } 13267 } 13268 } 13269 } else if (this.sSelectDaysStatus == 'end' && sender == 'click') { 13270 $.proxy(_unselectDays, this)() 13271 } else if (this.sSelectDaysStatus == 'end') { 13272 if (this.dtSelected[0].getFullYear() == this.dtVisableDate.getFullYear() && this.dtSelected[0].getMonth() == this.dtVisableDate.getMonth() || this.dtSelected[1].getFullYear() == this.dtVisableDate.getFullYear() && this.dtSelected[1].getMonth() == this.dtVisableDate.getMonth()) { 13273 var oActualDay = new Date(); 13274 if (this.dtVisableDate.getFullYear() == oActualDay.getFullYear() && this.dtVisableDate.getMonth() == oActualDay.getMonth()) { 13275 lActualDay = oActualDay.getDate() 13276 } else { 13277 lActualDay = 1 13278 } 13279 var oStartDate = new Date(_options.dtStart); 13280 if (oActualDay < oStartDate) { 13281 lActualDay = oStartDate.getDate() 13282 } 13283 $("#" + _element + " table td a").each($.proxy(function(i, o) { 13284 if ($(o).attr('id') == undefined) { 13285 $(o).bind('click', $.proxy(function() { 13286 $.proxy(_selectDays, this)(sId, o, 'click') 13287 }, this)); 13288 $(o).bind('mouseover', $.proxy(function() { 13289 $.proxy(_selectDays, this)(sId, o, 'over') 13290 }, this)); 13291 $(o).attr('id', sId + $(o).html()) 13292 } 13293 if ((i + lActualDay) == this.dtSelected[0].getDate() && this.dtSelected[0].getMonth() == this.dtVisableDate.getMonth()) { 13294 $(o).addClass('selectstart') 13295 } else if (i + lActualDay == this.dtSelected[1].getDate() && this.dtSelected[1].getMonth() == this.dtVisableDate.getMonth()) { 13296 $(o).addClass('selectend') 13297 } else if (i + lActualDay > this.dtSelected[0].getDate() && i + lActualDay < this.dtSelected[1].getDate() || (this.dtSelected[1].getMonth() > this.dtSelected[0].getMonth() && i + lActualDay > this.dtSelected[0].getDate() && this.dtSelected[0].getMonth() == this.dtVisableDate.getMonth()) || (this.dtSelected[1].getFullYear() > this.dtSelected[0].getFullYear() && i + lActualDay > this.dtSelected[0].getDate() && this.dtSelected[0].getMonth() == this.dtVisableDate.getMonth()) || (this.dtSelected[1].getMonth() > this.dtSelected[0].getMonth() && i + lActualDay < this.dtSelected[1].getDate() && this.dtSelected[1].getMonth() == this.dtVisableDate.getMonth()) || (this.dtSelected[1].getFullYear() > this.dtSelected[0].getFullYear() && i + lActualDay < this.dtSelected[1].getDate() && this.dtSelected[1].getMonth() == this.dtVisableDate.getMonth())) { 13298 $(o).addClass('selected') 13299 } 13300 }, this)) 13301 } 13302 } 13303 } 13304 function _unselectDays() { 13305 $("#" + _element + " table td a").each(function(i, o) { 13306 $(o).attr("class", "") 13307 }); 13308 this.dtSelected[0] = null; 13309 this.dtSelected[1] = null; 13310 $("#" + _input).val(''); 13311 $("#" + _options.sRelatedField).val(''); 13312 this.sSelectDaysStatus = 'load'; 13313 this.lClickedDay = -1; 13314 this.lSelectStartDay = -1; 13315 this.dtActualClickedDate = null 13316 } 13317 _init(); 13318 return this 13319 } 13320 $.calendar = function(oThis, oOptions) { 13321 var oCalendar = new calendar($(oThis),oOptions); 13322 return oCalendar 13323 } 13324}(jQuery)); 13325(function($) { 13326 function dateFormat(date) { 13327 var _oDate = NaN; 13328 var _lDay = 24 * 60 * 60 * 1000; 13329 var _sDefaultFormat = 'd.m.Y'; 13330 function _create(date) { 13331 if (typeof date == 'undefined') { 13332 return new Date 13333 } 13334 if (date instanceof Date) { 13335 return date 13336 }
13337 var patterns = [['iso_8601', /^([1-9]\d{3})\s*-\s*(1[0-2]|0?[1-9])\s*-\s*(3[01]|[12]\d|0?[1-9])$/, '$2/$3/$1'], ['us', /^(1[0-2]|0?[1-9])\s*[\/-]\s*(3[01]|[12]\d|0?[1-9])\s*[\/-]\s*([1-9]\d{3})$/, '$1/$2/$3'], ['world', /^(3[01]|[12]\d|0?[1-9])\s*([\.\/])s*(1[0-2]|0?[1-9])\s*\2\s*([1-9]\d{3})$/, '$3/$1/$4'], ['chicago', /^(?:(?:mon|tue|wed|thu|fri|sat|sun)[a-z]*,?\s+)?(3[01]|[0-2]\d|\d)\s*([ -])\s*(?:(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*)\s*\2\s*([1-9]\d{3})$/i, '$3 $1, $4'], ['conversational', /^(?:(?:mon|tue|wed|thu|fri|sat|sun)[a-z]*,?\s+)?(?:(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*)\s+(3[01]|[0-2]\d|\d),?\s*([1-9]\d{3})$/i, '$1 $2, $3']]; 13338 var sDate = ''; 13339 for (var i = 0; i < patterns.length; i++) { 13340 var regex = patterns[i][1]; 13341 var fn = patterns[i][2]; 13342 if (!(match = date.match(regex))) { 13343 continue 13344 } 13345 sDate = Date.parse(date.replace(regex, fn)); 13346 if (!isNaN(sDate)) { 13347 return new Date(sDate) 13348 } 13349 } 13350 return NaN 13351 } 13352 function _add(lNumber, sUnit) { 13353 lNumber = parseInt(lNumber, 10); 13354 if (!sUnit) { 13355 sUnit = 'days' 13356 } 13357 switch (sUnit) { 13358 case 'days': 13359 _addDay(lNumber); 13360 break; 13361 case 'month': 13362 _addMonth(lNumber); 13363 break; 13364 case 'year': 13365 _addYear(lNumber); 13366 break 13367 } 13368 return this 13369 } 13370 function _addDay(lNumber) { 13371 _oDate.setDate(_oDate.getDate() + lNumber) 13372 } 13373 function _addMonth(lNumber) { 13374 var prevDay = _oDate.getDate(); 13375 $.proxy(_addYear, this)(Math[lNumber > 0 ? 'floor' : 'ceil'](lNumber / 12)); 13376 var prevMonth = _oDate.getMonth() + (lNumber % 12); 13377 if (prevMonth == 12) { 13378 prevMonth = 0; 13379 _oDate.setYear(_oDate.getFullYear() + 1) 13380 } else if (prevMonth == -1) { 13381 prevMonth = 11; 13382 _oDate.setYear(_oDate.getFullYear() - 1) 13383 } 13384 _oDate.setMonth(prevMonth); 13385 if (_oDate.getDate() != prevDay) { 13386 $.proxy(_addMonth, this)(-1); 13387 _oDate.setDate(_daysInMonth(_oDate.getFullYear(), _oDate.getMonth() + 1)) 13388 } 13389 } 13390 function _addYear(lNumber) { 13391 _oDate.setYear(_oDate.getFullYear() + Math[lNumber > 0 ? 'floor' : 'ceil'](lNumber)) 13392 } 13393 function _daysInMonth(lYear, lMonth) { 13394 if (lMonth == 2) { 13395 return new Date(lYear,1,29).getDate() == 29 ? 29 : 28 13396 } 13397 return [undefined, 31, undefined, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][lMonth] 13398 } 13399 function _diff(dateObj, sUnit, allowDecimal) { 13400 var unitDiff; 13401 dateObj = $.zeppDateFormat(dateObj).getDate(); 13402 if (dateObj === null) { 13403 return NaN 13404 } 13405 if (!sUnit) { 13406 sUnit = 'days' 13407 } 13408 switch (sUnit) { 13409 case 'days': 13410 unitDiff = _diffDay(dateObj); 13411 break; 13412 case 'month': 13413 unitDiff = _diffMonth(dateObj); 13414 break; 13415 case 'year': 13416 unitDiff = _diffYear(dateObj); 13417 break 13418 } 13419 return (allowDecimal ? unitDiff : Math[unitDiff > 0 ? 'floor' : 'ceil'](unitDiff)) 13420 } 13421 function _diffDay(dateObj) { 13422 return (_oDate.getTime() - dateObj.getTime()) / _lDay 13423 } 13424 function _diffMonth(dateObj) { 13425 var diffYears = _oDate.getFullYear() - dateObj.getFullYear(); 13426 var diffMonths = _oDate.getMonth() - dateObj.getMonth() + (diffYears * 12); 13427 var diffDays = _oDate.getDate() - dateObj.getDate(); 13428 return diffMonths + (diffDays / 30) 13429 } 13430 function _diffYear(dateObj) { 13431 return _diffMonth(dateObj) / 12 13432 } 13433 function _format(sFormat, bTwoDigits) { 13434 if (!sFormat) 13435 sFormat = _sDefaultFormat; 13436 if (!bTwoDigits) 13437 bTwoDigits = true; 13438 var lDay = _twoDigits(_oDate.getDate(), bTwoDigits); 13439 var lMonth = _twoDigits(_oDate.getMonth() + 1, bTwoDigits); 13440 var lYear = _oDate.getFullYear(); 13441 switch (sFormat) { 13442 case 'd.m.y': 13443 return lDay + '.' + lMonth + '.' + lYear.toString().substr(-2); 13444 case 'd.m.Y': 13445 return lDay + '.' + lMonth + '.' + lYear; 13446 case 'd/m/y': 13447 return lDay + '/' + lMonth + '/' + lYear.toString().substr(-2); 13448 case 'd/m/Y': 13449 return lDay + '/' + lMonth + '/' + lYear; 13450 case 'y-m-d': 13451 return lYear.toString().substr(-2) + '/' + lMonth + '/' + lDay; 13452 case 'Y-m-d': 13453 return lYear + '/' + lMonth + '/' + lDay; 13454 } 13455 return '' 13456 } 13457 function _twoDigits(lDay, bTwoDigits) { 13458 return (lDay < 10 && bTwoDigits ? '0' + lDay : lDay) 13459 } 13460 function _getDatesBetween(endDate) { 13461 var dates = [] 13462 , currentDate = _oDate 13463 , endDate = $.zeppDateFormat(endDate).getDate(); 13464 if (endDate === null) { 13465 return dates 13466 } 13467 addDays = function(days) { 13468 var date = new Date(this.valueOf()); 13469 date.setDate(date.getDate() + days); 13470 return date 13471 } 13472 ; 13473 while (currentDate < endDate) { 13474 dates.push(currentDate); 13475 currentDate = addDays.call(currentDate, 1) 13476 } 13477 return dates 13478 } 13479 this.add = function(lNumber, sUnit) { 13480 return $.proxy(_add, this)(lNumber, sUnit) 13481 } 13482 ; 13483 this.diff = function(dateObj, sUnit, bAllowDecimal) { 13484 return $.proxy(_diff, this)(dateObj, sUnit, bAllowDecimal) 13485 } 13486 ; 13487 this.getDatesBetween = function(dateObj) { 13488 return $.proxy(_getDatesBetween, this)(dateObj) 13489 } 13490 ; 13491 this.getDate = function() { 13492 return _oDate 13493 } 13494 ; 13495 this.format = function(sFormat, bTwoDigits) { 13496 return $.proxy(_format, this)(sFormat, bTwoDigits) 13497 } 13498 ; 13499 _oDate = _create(date); 13500 return this 13501 } 13502 $.zeppDateFormat = function(date) { 13503 var oDateFormat = new dateFormat(date); 13504 return oDateFormat 13505 } 13506}(jQuery)); 13507(function(factory) { 13508 if (typeof define === 'function' && define.amd) { 13509 define([], factory) 13510 } else if (typeof exports === 'object') { 13511 module.exports = factory() 13512 } else { 13513 window.noUiSlider = factory() 13514 } 13515}(function() { 13516 'use strict'; 13517 var VERSION = '10.0.0'; 13518 function isValidFormatter(entry) { 13519 return typeof entry === 'object' && typeof entry.to === 'function' && typeof entry.from === 'function' 13520 } 13521 function removeElement(el) { 13522 el.parentElement.removeChild(el) 13523 } 13524 function preventDefault(e) { 13525 e.preventDefault() 13526 } 13527 function unique(array) { 13528 return array.filter(function(a) { 13529 return !this[a] ? this[a] = true : false 13530 }, {}) 13531 } 13532 function closest(value, to) { 13533 return Math.round(value / to) * to 13534 } 13535 function offset(elem, orientation) { 13536 var rect = elem.getBoundingClientRect(); 13537 var doc = elem.ownerDocument; 13538 var docElem = doc.documentElement; 13539 var pageOffset = getPageOffset(doc); 13540 if (/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)) { 13541 pageOffset.x = 0 13542 } 13543 return orientation ? (rect.top + pageOffset.y - docElem.clientTop) : (rect.left + pageOffset.x - docElem.clientLeft) 13544 } 13545 function isNumeric(a) { 13546 return typeof a === 'number' && !isNaN(a) && isFinite(a) 13547 }
13548 function addClassFor(element, className, duration) { 13549 if (duration > 0) { 13550 addClass(element, className); 13551 setTimeout(function() { 13552 removeClass(element, className) 13553 }, duration) 13554 } 13555 } 13556 function limit(a) { 13557 return Math.max(Math.min(a, 100), 0) 13558 } 13559 function asArray(a) { 13560 return Array.isArray(a) ? a : [a] 13561 } 13562 function countDecimals(numStr) { 13563 numStr = String(numStr); 13564 var pieces = numStr.split("."); 13565 return pieces.length > 1 ? pieces[1].length : 0 13566 } 13567 function addClass(el, className) { 13568 if (el.classList) { 13569 el.classList.add(className) 13570 } else { 13571 el.className += ' ' + className 13572 } 13573 } 13574 function removeClass(el, className) { 13575 if (el.classList) { 13576 el.classList.remove(className) 13577 } else { 13578 el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)','gi'), ' ') 13579 } 13580 } 13581 function hasClass(el, className) { 13582 return el.classList ? el.classList.contains(className) : new RegExp('\\b' + className + '\\b').test(el.className) 13583 } 13584 function getPageOffset(doc) { 13585 var supportPageOffset = window.pageXOffset !== undefined; 13586 var isCSS1Compat = ((doc.compatMode || "") === "CSS1Compat"); 13587 var x = supportPageOffset ? window.pageXOffset : isCSS1Compat ? doc.documentElement.scrollLeft : doc.body.scrollLeft; 13588 var y = supportPageOffset ? window.pageYOffset : isCSS1Compat ? doc.documentElement.scrollTop : doc.body.scrollTop; 13589 return { 13590 x: x, 13591 y: y 13592 } 13593 } 13594 function getActions() { 13595 return window.navigator.pointerEnabled ? { 13596 start: 'pointerdown', 13597 move: 'pointermove', 13598 end: 'pointerup' 13599 } : window.navigator.msPointerEnabled ? { 13600 start: 'MSPointerDown', 13601 move: 'MSPointerMove', 13602 end: 'MSPointerUp' 13603 } : { 13604 start: 'mousedown touchstart', 13605 move: 'mousemove touchmove', 13606 end: 'mouseup touchend' 13607 } 13608 } 13609 function getSupportsPassive() { 13610 var supportsPassive = false; 13611 try { 13612 var opts = Object.defineProperty({}, 'passive', { 13613 get: function() { 13614 supportsPassive = true 13615 } 13616 }); 13617 window.addEventListener('test', null, opts) 13618 } catch (e) {} 13619 return supportsPassive 13620 } 13621 function getSupportsTouchActionNone() { 13622 return window.CSS && CSS.supports && CSS.supports('touch-action', 'none') 13623 } 13624 function subRangeRatio(pa, pb) { 13625 return (100 / (pb - pa)) 13626 } 13627 function fromPercentage(range, value) { 13628 return (value * 100) / (range[1] - range[0]) 13629 } 13630 function toPercentage(range, value) { 13631 return fromPercentage(range, range[0] < 0 ? value + Math.abs(range[0]) : value - range[0]) 13632 } 13633 function isPercentage(range, value) { 13634 return ((value * (range[1] - range[0])) / 100) + range[0] 13635 } 13636 function getJ(value, arr) { 13637 var j = 1; 13638 while (value >= arr[j]) { 13639 j += 1 13640 } 13641 return j 13642 } 13643 function toStepping(xVal, xPct, value) { 13644 if (value >= xVal.slice(-1)[0]) { 13645 return 100 13646 } 13647 var j = getJ(value, xVal), va, vb, pa, pb; 13648 va = xVal[j - 1]; 13649 vb = xVal[j]; 13650 pa = xPct[j - 1]; 13651 pb = xPct[j]; 13652 return pa + (toPercentage([va, vb], value) / subRangeRatio(pa, pb)) 13653 } 13654 function fromStepping(xVal, xPct, value) { 13655 if (value >= 100) { 13656 return xVal.slice(-1)[0] 13657 } 13658 var j = getJ(value, xPct), va, vb, pa, pb; 13659 va = xVal[j - 1]; 13660 vb = xVal[j]; 13661 pa = xPct[j - 1]; 13662 pb = xPct[j]; 13663 return isPercentage([va, vb], (value - pa) * subRangeRatio(pa, pb)) 13664 } 13665 function getStep(xPct, xSteps, snap, value) { 13666 if (value === 100) { 13667 return value 13668 } 13669 var j = getJ(value, xPct), a, b; 13670 if (snap) { 13671 a = xPct[j - 1]; 13672 b = xPct[j]; 13673 if ((value - a) > ((b - a) / 2)) { 13674 return b 13675 } 13676 return a 13677 } 13678 if (!xSteps[j - 1]) { 13679 return value 13680 } 13681 return xPct[j - 1] + closest(value - xPct[j - 1], xSteps[j - 1]) 13682 } 13683 function handleEntryPoint(index, value, that) { 13684 var percentage; 13685 if (typeof value === "number") { 13686 value = [value] 13687 } 13688 if (Object.prototype.toString.call(value) !== '[object Array]') { 13689 throw new Error("noUiSlider (" + VERSION + "): 'range' contains invali
13689d value.") 13690 } 13691 if (index === 'min') { 13692 percentage = 0 13693 } else if (index === 'max') { 13694 percentage = 100 13695 } else { 13696 percentage = parseFloat(index) 13697 } 13698 if (!isNumeric(percentage) || !isNumeric(value[0])) { 13699 throw new Error("noUiSlider (" + VERSION + "): 'range' value isn't numeric.") 13700 } 13701 that.xPct.push(percentage); 13702 that.xVal.push(value[0]); 13703 if (!percentage) { 13704 if (!isNaN(value[1])) { 13705 that.xSteps[0] = value[1] 13706 } 13707 } else { 13708 that.xSteps.push(isNaN(value[1]) ? false : value[1]) 13709 } 13710 that.xHighestCompleteStep.push(0) 13711 } 13712 function handleStepPoint(i, n, that) { 13713 if (!n) { 13714 return true 13715 } 13716 that.xSteps[i] = fromPercentage([that.xVal[i], that.xVal[i + 1]], n) / subRangeRatio(that.xPct[i], that.xPct[i + 1]); 13717 var totalSteps = (that.xVal[i + 1] - that.xVal[i]) / that.xNumSteps[i]; 13718 var highestStep = Math.ceil(Number(totalSteps.toFixed(3)) - 1); 13719 var step = that.xVal[i] + (that.xNumSteps[i] * highestStep); 13720 that.xHighestCompleteStep[i] = step 13721 } 13722 function Spectrum(entry, snap, singleStep) { 13723 this.xPct = []; 13724 this.xVal = []; 13725 this.xSteps = [singleStep || false]; 13726 this.xNumSteps = [false]; 13727 this.xHighestCompleteStep = []; 13728 this.snap = snap; 13729 var index, ordered = []; 13730 for (index in entry) { 13731 if (entry.hasOwnProperty(index)) { 13732 ordered.push([entry[index], index]) 13733 } 13734 } 13735 if (ordered.length && typeof ordered[0][0] === "object") { 13736 ordered.sort(function(a, b) { 13737 return a[0][0] - b[0][0] 13738 }) 13739 } else { 13740 ordered.sort(function(a, b) { 13741 return a[0] - b[0] 13742 }) 13743 } 13744 for (index = 0; index < ordered.length; index++) { 13745 handleEntryPoint(ordered[index][1], ordered[index][0], this) 13746 } 13747 this.xNumSteps = this.xSteps.slice(0); 13748 for (index = 0; index < this.xNumSteps.length; index++) { 13749 handleStepPoint(index, this.xNumSteps[index], this) 13750 } 13751 } 13752 Spectrum.prototype.getMargin = function(value) { 13753 var step = this.xNumSteps[0]; 13754 if (step && ((value / step) % 1) !== 0) { 13755 throw new Error("noUiSlider (" + VERSION + "): 'limit', 'margin' and 'padding' must be divisible by step.") 13756 } 13757 return this.xPct.length === 2 ? fromPercentage(this.xVal, value) : false 13758 } 13759 ; 13760 Spectrum.prototype.toStepping = function(value) { 13761 value = toStepping(this.xVal, this.xPct, value); 13762 return value 13763 } 13764 ; 13765 Spectrum.prototype.fromStepping = function(value) { 13766 return fromStepping(this.xVal, this.xPct, value) 13767 } 13768 ; 13769 Spectrum.prototype.getStep = function(value) { 13770 value = getStep(this.xPct, this.xSteps, this.snap, value); 13771 return value 13772 } 13773 ; 13774 Spectrum.prototype.getNearbySteps = function(value) { 13775 var j = getJ(value, this.xPct); 13776 return { 13777 stepBefore: { 13778 startValue: this.xVal[j - 2], 13779 step: this.xNumSteps[j - 2], 13780 highestStep: this.xHighestCompleteStep[j - 2] 13781 }, 13782 thisStep: { 13783 startValue: this.xVal[j - 1], 13784 step: this.xNumSteps[j - 1], 13785 highestStep: this.xHighestCompleteStep[j - 1] 13786 }, 13787 stepAfter: { 13788 startValue: this.xVal[j - 0], 13789 step: this.xNumSteps[j - 0], 13790 highestStep: this.xHighestCompleteStep[j - 0] 13791 } 13792 } 13793 } 13794 ; 13795 Spectrum.prototype.countStepDecimals = function() { 13796 var stepDecimals = this.xNumSteps.map(countDecimals); 13797 return Math.max.apply(null, stepDecimals) 13798 } 13799 ; 13800 Spectrum.prototype.convert = function(value) { 13801 return this.getStep(this.toStepping(value)) 13802 } 13803 ; 13804 var defaultFormatter = { 13805 'to': function(value) { 13806 return value !== undefined && value.toFixed(2) 13807 }, 13808 'from': Number 13809 }; 13810 function validateFormat(entry) { 13811 if (isValidFormatter(entry)) { 13812 return true 13813 } 13814 throw new Error("noUiSlider (" + VERSION + "): 'format' requires 'to' and 'from' methods.") 13815 } 13816 function testStep(parsed, entry) { 13817 if (!isNumeric(entry)) { 13818 throw new Error("noUiSlider (" + VERSION + "): 'step' is not numeric.") 13819 } 13820 parsed.singleStep = entry 13821 } 13822 function testRange(parsed, entry) { 13823 if (typeof entry !== 'object' || Array.isArray(entry)) { 13824 throw new Error("noUiSlider (" + VERSION + "): 'range' is not an object.") 13825 } 13826 if (entry.min === undefined || entry.max === undefined) { 13827 throw new Error("noUiSlider (" + VERSION + "): Missing 'min' or 'max' in 'range'.") 13828 } 13829 if (entry.min === entry.max) { 13830 throw new Error("noUiSlider (" + VERSION + "): 'range' 'min' and 'max' cannot be equal.") 13831 } 13832 parsed.spectrum = new Spectrum(entry,parsed.snap,parsed.singleStep) 13833 } 13834 function testStart(parsed, entry) { 13835 entry = asArray(entry); 13836 if (!Array.isArray(entry) || !entry.length) { 13837 throw new Error("noUiSlider (" + VERSION + "): 'start' option is incorrect.") 13838 } 13839 parsed.handles = entry.length; 13840 parsed.start = entry 13841 } 13842 function testSnap(parsed, entry) { 13843 parsed.snap = entry; 13844 if (typeof entry !== 'boolean') { 13845 throw new Error("noUiSlider (" + VERSION + "): 'snap' option must be a boolean.") 13846 } 13847 } 13848 function testAnimate(parsed, entry) { 13849 parsed.animate = entry; 13850 if (typeof entry !== 'boolean') { 13851 throw new Error("noUiSlider (" + VERSION + "): 'animate' option must be a boolean.") 13852 } 13853 } 13854 function testAnimationDuration(parsed, entry) { 13855 parsed.animationDuration = entry; 13856 if (typeof entry !== 'number') { 13857 throw new Error("noUiSlider (" + VERSION + "): 'animationDuration' option must be a number.") 13858 } 13859 } 13860 function testConnect(parsed, entry) { 13861 var connect = [false]; 13862 var i; 13863 if (entry === 'lower') { 13864 entry = [true, false] 13865 } else if (entry === 'upper') {
13866 entry = [false, true] 13867 } 13868 if (entry === true || entry === false) { 13869 for (i = 1; i < parsed.handles; i++) { 13870 connect.push(entry) 13871 } 13872 connect.push(false) 13873 } else if (!Array.isArray(entry) || !entry.length || entry.length !== parsed.handles + 1) { 13874 throw new Error("noUiSlider (" + VERSION + "): 'connect' option doesn't match handle count.") 13875 } else { 13876 connect = entry 13877 } 13878 parsed.connect = connect 13879 } 13880 function testOrientation(parsed, entry) { 13881 switch (entry) { 13882 case 'horizontal': 13883 parsed.ort = 0; 13884 break; 13885 case 'vertical': 13886 parsed.ort = 1; 13887 break; 13888 default: 13889 throw new Error("noUiSlider (" + VERSION + "): 'orientation' option is invalid.") 13890 } 13891 } 13892 function testMargin(parsed, entry) { 13893 if (!isNumeric(entry)) { 13894 throw new Error("noUiSlider (" + VERSION + "): 'margin' option must be numeric.") 13895 } 13896 if (entry === 0) { 13897 return 13898 } 13899 parsed.margin = parsed.spectrum.getMargin(entry); 13900 if (!parsed.margin) { 13901 throw new Error("noUiSlider (" + VERSION + "): 'margin' option is only supported on linear sliders.") 13902 } 13903 } 13904 function testLimit(parsed, entry) { 13905 if (!isNumeric(entry)) { 13906 throw new Error("noUiSlider (" + VERSION + "): 'limit' option must be numeric.") 13907 } 13908 parsed.limit = parsed.spectrum.getMargin(entry); 13909 if (!parsed.limit || parsed.handles < 2) { 13910 throw new Error("noUiSlider (" + VERSION + "): 'limit' option is only supported on linear sliders with 2 or more handles.") 13911 } 13912 } 13913 function testPadding(parsed, entry) { 13914 if (!isNumeric(entry)) { 13915 throw new Error("noUiSlider (" + VERSION + "): 'padding' option must be numeric.") 13916 } 13917 if (entry === 0) { 13918 return 13919 } 13920 parsed.padding = parsed.spectrum.getMargin(entry); 13921 if (!parsed.padding) { 13922 throw new Error("noUiSlider (" + VERSION + "): 'padding' option is only supported on linear sliders.") 13923 } 13924 if (parsed.padding < 0) { 13925 throw new Error("noUiSlider (" + VERSION + "): 'padding' option must be a positive number.") 13926 } 13927 if (parsed.padding >= 50) { 13928 throw new Error("noUiSlider (" + VERSION + "): 'padding' option must be less than half the range.") 13929 } 13930 } 13931 function testDirection(parsed, entry) { 13932 switch (entry) { 13933 case 'ltr': 13934 parsed.dir = 0; 13935 break; 13936 case 'rtl': 13937 parsed.dir = 1; 13938 break; 13939 default: 13940 throw new Error("noUiSlider (" + VERSION + "): 'direction' option was not recognized.") 13941 } 13942 } 13943 function testBehaviour(parsed, entry) { 13944 if (typeof entry !== 'string') { 13945 throw new Error("noUiSlider (" + VERSION + "): 'behaviour' must be a string containing options.") 13946 } 13947 var tap = entry.indexOf('tap') >= 0; 13948 var drag = entry.indexOf('drag') >= 0; 13949 var fixed = entry.indexOf('fixed') >= 0; 13950 var snap = entry.indexOf('snap') >= 0; 13951 var hover = entry.indexOf('hover') >= 0; 13952 if (fixed) { 13953 if (parsed.handles !== 2) { 13954 throw new Error("noUiSlider (" + VERSION + "): 'fixed' behaviour must be used with 2 handles") 13955 } 13956 testMargin(parsed, parsed.start[1] - parsed.start[0]) 13957 } 13958 parsed.events = { 13959 tap: tap || snap, 13960 drag: drag, 13961 fixed: fixed, 13962 snap: snap, 13963 hover: hover 13964 } 13965 } 13966 function testTooltips(parsed, entry) { 13967 if (entry === false) { 13968 return 13969 } else if (entry === true) { 13970 parsed.tooltips = []; 13971 for (var i = 0; i < parsed.handles; i++) { 13972 parsed.tooltips.push(true) 13973 } 13974 } else { 13975 parsed.tooltips = asArray(entry); 13976 if (parsed.tooltips.length !== parsed.handles) { 13977 throw new Error("noUiSlider (" + VERSION + "): must pass a formatter for all handles.") 13978 } 13979 parsed.tooltips.forEach(function(formatter) { 13980 if (typeof formatter !== 'boolean' && (typeof formatter !== 'object' || typeof formatter.to !== 'function')) { 13981 throw new Error("noUiSlider (" + VERSION + "): 'tooltips' must be passed a formatter or 'false'.") 13982 } 13983 }) 13984 } 13985 } 13986 function testAriaFormat(parsed, entry) { 13987 parsed.ariaFormat = entry; 13988 validateFormat(entry) 13989 } 13990 function testFormat(parsed, entry) { 13991 parsed.format = entry; 13992 validateFormat(entry) 13993 } 13994 function testCssPrefix(parsed, entry) { 13995 if (entry !== undefined && typeof entry !== 'string' && entry !== false) { 13996 throw new Error("noUiSlider (" + VERSION + "): 'cssPrefix' must be a string or `false`.") 13997 } 13998 parsed.cssPrefix = entry 13999 }
14000 function testCssClasses(parsed, entry) { 14001 if (entry !== undefined && typeof entry !== 'object') { 14002 throw new Error("noUiSlider (" + VERSION + "): 'cssClasses' must be an object.") 14003 } 14004 if (typeof parsed.cssPrefix === 'string') { 14005 parsed.cssClasses = {}; 14006 for (var key in entry) { 14007 if (!entry.hasOwnProperty(key)) { 14008 continue 14009 } 14010 parsed.cssClasses[key] = parsed.cssPrefix + entry[key] 14011 } 14012 } else { 14013 parsed.cssClasses = entry 14014 } 14015 } 14016 function testUseRaf(parsed, entry) { 14017 if (entry === true || entry === false) { 14018 parsed.useRequestAnimationFrame = entry 14019 } else { 14020 throw new Error("noUiSlider (" + VERSION + "): 'useRequestAnimationFrame' option should be true (default) or false.") 14021 } 14022 } 14023 function testOptions(options) { 14024 var parsed = { 14025 margin: 0, 14026 limit: 0, 14027 padding: 0, 14028 animate: true, 14029 animationDuration: 300, 14030 ariaFormat: defaultFormatter, 14031 format: defaultFormatter 14032 }; 14033 var tests = { 14034 'step': { 14035 r: false, 14036 t: testStep 14037 }, 14038 'start': { 14039 r: true, 14040 t: testStart 14041 }, 14042 'connect': { 14043 r: true, 14044 t: testConnect 14045 }, 14046 'direction': { 14047 r: true, 14048 t: testDirection 14049 }, 14050 'snap': { 14051 r: false, 14052 t: testSnap 14053 }, 14054 'animate': { 14055 r: false, 14056 t: testAnimate 14057 }, 14058 'animationDuration': { 14059 r: false, 14060 t: testAnimationDuration 14061 }, 14062 'range': { 14063 r: true, 14064 t: testRange 14065 }, 14066 'orientation': { 14067 r: false, 14068 t: testOrientation 14069 }, 14070 'margin': { 14071 r: false, 14072 t: testMargin 14073 }, 14074 'limit': { 14075 r: false, 14076 t: testLimit 14077 }, 14078 'padding': { 14079 r: false, 14080 t: testPadding 14081 }, 14082 'behaviour': { 14083 r: true, 14084 t: testBehaviour 14085 }, 14086 'ariaFormat': { 14087 r: false, 14088 t: testAriaFormat 14089 }, 14090 'format': { 14091 r: false, 14092 t: testFormat 14093 }, 14094 'tooltips': { 14095 r: false, 14096 t: testTooltips 14097 }, 14098 'cssPrefix': { 14099 r: false, 14100 t: testCssPrefix 14101 }, 14102 'cssClasses': { 14103 r: false,
14104 t: testCssClasses 14105 }, 14106 'useRequestAnimationFrame': { 14107 r: false, 14108 t: testUseRaf 14109 } 14110 }; 14111 var defaults = { 14112 'connect': false, 14113 'direction': 'ltr', 14114 'behaviour': 'tap', 14115 'orientation': 'horizontal', 14116 'cssPrefix': 'noUi-', 14117 'cssClasses': { 14118 target: 'target', 14119 base: 'base', 14120 origin: 'origin', 14121 handle: 'handle', 14122 handleLower: 'handle-lower', 14123 handleUpper: 'handle-upper', 14124 horizontal: 'horizontal', 14125 vertical: 'vertical', 14126 background: 'background', 14127 connect: 'connect', 14128 ltr: 'ltr', 14129 rtl: 'rtl', 14130 draggable: 'draggable', 14131 drag: 'state-drag', 14132 tap: 'state-tap', 14133 active: 'active', 14134 tooltip: 'tooltip', 14135 pips: 'pips', 14136 pipsHorizontal: 'pips-horizontal', 14137 pipsVertical: 'pips-vertical', 14138 marker: 'marker', 14139 markerHorizontal: 'marker-horizontal', 14140 markerVertical: 'marker-vertical', 14141 markerNormal: 'marker-normal', 14142 markerLarge: 'marker-large', 14143 markerSub: 'marker-sub', 14144 value: 'value', 14145 valueHorizontal: 'value-horizontal', 14146 valueVertical: 'value-vertical', 14147 valueNormal: 'value-normal', 14148 valueLarge: 'value-large', 14149 valueSub: 'value-sub' 14150 }, 14151 'useRequestAnimationFrame': true 14152 }; 14153 if (options.format && !options.ariaFormat) { 14154 options.ariaFormat = options.format 14155 } 14156 Object.keys(tests).forEach(function(name) { 14157 if (options[name] === undefined && defaults[name] === undefined) { 14158 if (tests[name].r) { 14159 throw new Error("noUiSlider (" + VERSION + "): '" + name + "' is required.") 14160 } 14161 return true 14162 } 14163 tests[name].t(parsed, options[name] === undefined ? defaults[name] : options[name]) 14164 }); 14165 parsed.pips = options.pips; 14166 var styles = [['left', 'top'], ['right', 'bottom']]; 14167 parsed.style = styles[parsed.dir][parsed.ort]; 14168 parsed.styleOposite = styles[parsed.dir ? 0 : 1][parsed.ort]; 14169 return parsed 14170 } 14171 function closure(target, options, originalOptions) { 14172 var actions = getActions(); 14173 var supportsTouchActionNone = getSupportsTouchActionNone(); 14174 var supportsPassive = supportsTouchActionNone && getSupportsPassive(); 14175 var scope_Target = target; 14176 var scope_Locations = []; 14177 var scope_Base; 14178 var scope_Handles; 14179 var scope_HandleNumbers = []; 14180 var scope_ActiveHandle = false; 14181 var scope_Connects; 14182 var scope_Spectrum = options.spectrum; 14183 var scope_Values = []; 14184 var scope_Events = {}; 14185 var scope_Self; 14186 var scope_Pips; 14187 var scope_Listeners = null; 14188 var scope_Document = target.ownerDocument; 14189 var scope_DocumentElement = scope_Document.documentElement; 14190 var scope_Body = scope_Document.body; 14191 function addNodeTo(target, className) { 14192 var div = scope_Document.createElement('div'); 14193 if (className) { 14194 addClass(div, className) 14195 } 14196 target.appendChild(div); 14197 return div 14198 } 14199 function addOrigin(base, handleNumber) { 14200 var origin = addNodeTo(base, options.cssClasses.origin); 14201 var handle = addNodeTo(origin, options.cssClasses.handle); 14202 handle.setAttribute('data-handle', handleNumber); 14203 handle.setAttribute('tabindex', '0'); 14204 handle.setAttribute('role', 'slider'); 14205 handle.setAttribute('aria-orientation', options.ort ? 'vertical' : 'horizontal'); 14206 if (handleNumber === 0) {
14207 addClass(handle, options.cssClasses.handleLower) 14208 } else if (handleNumber === options.handles - 1) { 14209 addClass(handle, options.cssClasses.handleUpper) 14210 } 14211 return origin 14212 } 14213 function addConnect(base, add) { 14214 if (!add) { 14215 return false 14216 } 14217 return addNodeTo(base, options.cssClasses.connect) 14218 } 14219 function addElements(connectOptions, base) { 14220 scope_Handles = []; 14221 scope_Connects = []; 14222 scope_Connects.push(addConnect(base, connectOptions[0])); 14223 for (var i = 0; i < options.handles; i++) { 14224 scope_Handles.push(addOrigin(base, i)); 14225 scope_HandleNumbers[i] = i; 14226 scope_Connects.push(addConnect(base, connectOptions[i + 1])) 14227 } 14228 } 14229 function addSlider(target) { 14230 addClass(target, options.cssClasses.target); 14231 if (options.dir === 0) { 14232 addClass(target, options.cssClasses.ltr) 14233 } else { 14234 addClass(target, options.cssClasses.rtl) 14235 } 14236 if (options.ort === 0) { 14237 addClass(target, options.cssClasses.horizontal) 14238 } else { 14239 addClass(target, options.cssClasses.vertical) 14240 } 14241 scope_Base = addNodeTo(target, options.cssClasses.base) 14242 } 14243 function addTooltip(handle, handleNumber) { 14244 if (!options.tooltips[handleNumber]) { 14245 return false 14246 } 14247 return addNodeTo(handle.firstChild, options.cssClasses.tooltip) 14248 } 14249 function tooltips() { 14250 var tips = scope_Handles.map(addTooltip); 14251 bindEvent('update', function(values, handleNumber, unencoded) { 14252 if (!tips[handleNumber]) { 14253 return 14254 } 14255 var formattedValue = values[handleNumber]; 14256 if (options.tooltips[handleNumber] !== true) { 14257 formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]) 14258 } 14259 tips[handleNumber].innerHTML = formattedValue 14260 }) 14261 } 14262 function aria() { 14263 bindEvent('update', function(values, handleNumber, unencoded, tap, positions) { 14264 scope_HandleNumbers.forEach(function(handleNumber) { 14265 var handle = scope_Handles[handleNumber]; 14266 var min = checkHandlePosition(scope_Locations, handleNumber, 0, true, true, true); 14267 var max = checkHandlePosition(scope_Locations, handleNumber, 100, true, true, true); 14268 var now = positions[handleNumber]; 14269 var text = options.ariaFormat.to(unencoded[handleNumber]); 14270 handle.children[0].setAttribute('aria-valuemin', min.toFixed(1)); 14271 handle.children[0].setAttribute('aria-valuemax', max.toFixed(1)); 14272 handle.children[0].setAttribute('aria-valuenow', now.toFixed(1)); 14273 handle.children[0].setAttribute('aria-valuetext', text) 14274 }) 14275 }) 14276 } 14277 function getGroup(mode, values, stepped) { 14278 if (mode === 'range' || mode === 'steps') { 14279 return scope_Spectrum.xVal 14280 } 14281 if (mode === 'count') { 14282 if (!values) { 14283 throw new Error("noUiSlider (" + VERSION + "): 'values' required for mode 'count'.") 14284 } 14285 var spread = (100 / (values - 1)); 14286 var v; 14287 var i = 0; 14288 values = []; 14289 while ((v = i++ * spread) <= 100) { 14290 values.push(v) 14291 } 14292 mode = 'positions' 14293 } 14294 if (mode === 'positions') { 14295 return values.map(function(value) { 14296 return scope_Spectrum.fromStepping(stepped ? scope_Spectrum.getStep(value) : value) 14297 }) 14298 } 14299 if (mode === 'values') { 14300 if (stepped) { 14301 return values.map(function(value) { 14302 return scope_Spectrum.fromStepping(scope_Spectrum.getStep(scope_Spectrum.toStepping(value))) 14303 }) 14304 } 14305 return values 14306 } 14307 } 14308 function generateSpread(density, mode, group) { 14309 function safeIncrement(value, increment) { 14310 return (value + increment).toFixed(7) / 1 14311 } 14312 var indexes = {}; 14313 var firstInRange = scope_Spectrum.xVal[0]; 14314 var lastInRange = scope_Spectrum.xVal[scope_Spectrum.xVal.length - 1]; 14315 var ignoreFirst = false;
14316 var ignoreLast = false; 14317 var prevPct = 0; 14318 group = unique(group.slice().sort(function(a, b) { 14319 return a - b 14320 })); 14321 if (group[0] !== firstInRange) { 14322 group.unshift(firstInRange); 14323 ignoreFirst = true 14324 } 14325 if (group[group.length - 1] !== lastInRange) { 14326 group.push(lastInRange); 14327 ignoreLast = true 14328 } 14329 group.forEach(function(current, index) { 14330 var step; 14331 var i; 14332 var q; 14333 var low = current; 14334 var high = group[index + 1]; 14335 var newPct; 14336 var pctDifference; 14337 var pctPos; 14338 var type; 14339 var steps; 14340 var realSteps; 14341 var stepsize; 14342 if (mode === 'steps') { 14343 step = scope_Spectrum.xNumSteps[index] 14344 } 14345 if (!step) { 14346 step = high - low 14347 } 14348 if (low === false || high === undefined) { 14349 return 14350 } 14351 step = Math.max(step, 0.0000001); 14352 for (i = low; i <= high; i = safeIncrement(i, step)) { 14353 newPct = scope_Spectrum.toStepping(i); 14354 pctDifference = newPct - prevPct; 14355 steps = pctDifference / density; 14356 realSteps = Math.round(steps); 14357 stepsize = pctDifference / realSteps; 14358 for (q = 1; q <= realSteps; q += 1) { 14359 pctPos = prevPct + (q * stepsize); 14360 indexes[pctPos.toFixed(5)] = ['x', 0] 14361 } 14362 type = (group.indexOf(i) > -1) ? 1 : (mode === 'steps' ? 2 : 0); 14363 if (!index && ignoreFirst) { 14364 type = 0 14365 } 14366 if (!(i === high && ignoreLast)) { 14367 indexes[newPct.toFixed(5)] = [i, type] 14368 } 14369 prevPct = newPct 14370 } 14371 }); 14372 return indexes 14373 } 14374 function addMarking(spread, filterFunc, formatter) { 14375 var element = scope_Document.createElement('div'); 14376 var valueSizeClasses = [options.cssClasses.valueNormal, options.cssClasses.valueLarge, options.cssClasses.valueSub]; 14377 var markerSizeClasses = [options.cssClasses.markerNormal, options.cssClasses.markerLarge, options.cssClasses.markerSub]; 14378 var valueOrientationClasses = [options.cssClasses.valueHorizontal, options.cssClasses.valueVertical]; 14379 var markerOrientationClasses = [options.cssClasses.markerHorizontal, options.cssClasses.markerVertical]; 14380 addClass(element, options.cssClasses.pips); 14381 addClass(element, options.ort === 0 ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical); 14382 function getClasses(type, source) { 14383 var a = source === options.cssClasses.value; 14384 var orientationClasses = a ? valueOrientationClasses : markerOrientationClasses; 14385 var sizeClasses = a ? valueSizeClasses : markerSizeClasses; 14386 return source + ' ' + orientationClasses[options.ort] + ' ' + sizeClasses[type] 14387 } 14388 function addSpread(offset, values) { 14389 values[1] = (values[1] && filterFunc) ? filterFunc(values[0], values[1]) : values[1]; 14390 var node = addNodeTo(element, false); 14391 node.className = getClasses(values[1], options.cssClasses.marker); 14392 node.style[options.style] = offset + '%'; 14393 if (values[1]) { 14394 node = addNodeTo(element, false); 14395 node.className = getClasses(values[1], options.cssClasses.value); 14396 node.style[options.style] = offset + '%'; 14397 node.innerText = formatter.to(values[0]) 14398 } 14399 }
14400 Object.keys(spread).forEach(function(a) { 14401 addSpread(a, spread[a]) 14402 }); 14403 return element 14404 } 14405 function removePips() { 14406 if (scope_Pips) { 14407 removeElement(scope_Pips); 14408 scope_Pips = null 14409 } 14410 } 14411 function pips(grid) { 14412 removePips(); 14413 var mode = grid.mode; 14414 var density = grid.density || 1; 14415 var filter = grid.filter || false; 14416 var values = grid.values || false; 14417 var stepped = grid.stepped || false; 14418 var group = getGroup(mode, values, stepped); 14419 var spread = generateSpread(density, mode, group); 14420 var format = grid.format || { 14421 to: Math.round 14422 }; 14423 scope_Pips = scope_Target.appendChild(addMarking(spread, filter, format)); 14424 return scope_Pips 14425 } 14426 function baseSize() { 14427 var rect = scope_Base.getBoundingClientRect() 14428 , alt = 'offset' + ['Width', 'Height'][options.ort]; 14429 return options.ort === 0 ? (rect.width || scope_Base[alt]) : (rect.height || scope_Base[alt]) 14430 } 14431 function attachEvent(events, element, callback, data) { 14432 var method = function(e) { 14433 if (scope_Target.hasAttribute('disabled')) { 14434 return false 14435 } 14436 if (hasClass(scope_Target, options.cssClasses.tap)) { 14437 return false 14438 } 14439 e = fixEvent(e, data.pageOffset); 14440 if (!e) { 14441 return false 14442 } 14443 if (events === actions.start && e.buttons !== undefined && e.buttons > 1) { 14444 return false 14445 } 14446 if (data.hover && e.buttons) { 14447 return false 14448 } 14449 if (!supportsPassive) { 14450 e.preventDefault() 14451 } 14452 e.calcPoint = e.points[options.ort]; 14453 callback(e, data) 14454 }; 14455 var methods = []; 14456 events.split(' ').forEach(function(eventName) { 14457 element.addEventListener(eventName, method, supportsPassive ? { 14458 passive: true 14459 } : false); 14460 methods.push([eventName, method]) 14461 }); 14462 return methods 14463 } 14464 function fixEvent(e, pageOffset) { 14465 var touch = e.type.indexOf('touch') === 0; 14466 var mouse = e.type.indexOf('mouse') === 0; 14467 var pointer = e.type.indexOf('pointer') === 0; 14468 var x; 14469 var y; 14470 if (e.type.indexOf('MSPointer') === 0) { 14471 pointer = true 14472 } 14473 if (touch) { 14474 if (e.touches.length > 1) { 14475 return false 14476 } 14477 x = e.changedTouches[0].pageX; 14478 y = e.changedTouches[0].pageY 14479 } 14480 pageOffset = pageOffset || getPageOffset(scope_Document); 14481 if (mouse || pointer) { 14482 x = e.clientX + pageOffset.x; 14483 y = e.clientY + pageOffset.y 14484 } 14485 e.pageOffset = pageOffset; 14486 e.points = [x, y]; 14487 e.cursor = mouse || pointer; 14488 return e 14489 } 14490 function calcPointToPercentage(calcPoint) { 14491 var location = calcPoint - offset(scope_Base, options.ort); 14492 var proposal = (location * 100) / baseSize(); 14493 return options.dir ? 100 - proposal : proposal 14494 } 14495 function getClosestHandle(proposal) { 14496 var closest = 100; 14497 var handleNumber = false; 14498 scope_Handles.forEach(function(handle, index) { 14499 if (handle.hasAttribute('disabled')) { 14500 return 14501 } 14502 var pos = Math.abs(scope_Locations[index] - proposal); 14503 if (pos < closest) { 14504 handleNumber = index; 14505 closest = pos 14506 } 14507 }); 14508 return handleNumber 14509 } 14510 function moveHandles(upward, proposal, locations, handleNumbers) { 14511 var proposals = locations.slice(); 14512 var b = [!upward, upward]; 14513 var f = [upward, !upward]; 14514 handleNumbers = handleNumbers.slice(); 14515 if (upward) { 14516 handleNumbers.reverse() 14517 } 14518 if (handleNumbers.length > 1) {
14519 handleNumbers.forEach(function(handleNumber, o) { 14520 var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false); 14521 if (to === false) { 14522 proposal = 0 14523 } else { 14524 proposal = to - proposals[handleNumber]; 14525 proposals[handleNumber] = to 14526 } 14527 }) 14528 } else { 14529 b = f = [true] 14530 } 14531 var state = false; 14532 handleNumbers.forEach(function(handleNumber, o) { 14533 state = setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o]) || state 14534 }); 14535 if (state) { 14536 handleNumbers.forEach(function(handleNumber) { 14537 fireEvent('update', handleNumber); 14538 fireEvent('slide', handleNumber) 14539 }) 14540 } 14541 } 14542 function fireEvent(eventName, handleNumber, tap) { 14543 Object.keys(scope_Events).forEach(function(targetEvent) { 14544 var eventType = targetEvent.split('.')[0]; 14545 if (eventName === eventType) { 14546 scope_Events[targetEvent].forEach(function(callback) { 14547 callback.call(scope_Self, scope_Values.map(options.format.to), handleNumber, scope_Values.slice(), tap || false, scope_Locations.slice()) 14548 }) 14549 } 14550 }) 14551 } 14552 function documentLeave(event, data) { 14553 if (event.type === "mouseout" && event.target.nodeName === "HTML" && event.relatedTarget === null) { 14554 eventEnd(event, data) 14555 } 14556 } 14557 function eventMove(event, data) { 14558 if (navigator.appVersion.indexOf("MSIE 9") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) { 14559 return eventEnd(event, data) 14560 } 14561 var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint); 14562 var proposal = (movement * 100) / data.baseSize; 14563 moveHandles(movement > 0, proposal, data.locations, data.handleNumbers) 14564 } 14565 function eventEnd(event, data) { 14566 if (scope_ActiveHandle) { 14567 removeClass(scope_ActiveHandle, options.cssClasses.active); 14568 scope_ActiveHandle = false 14569 } 14570 if (event.cursor) { 14571 scope_Body.style.cursor = ''; 14572 scope_Body.removeEventListener('selectstart', preventDefault) 14573 } 14574 scope_Listeners.forEach(function(c) { 14575 scope_DocumentElement.removeEventListener(c[0], c[1]) 14576 }); 14577 removeClass(scope_Target, options.cssClasses.drag); 14578 setZindex(); 14579 data.handleNumbers.forEach(function(handleNumber) { 14580 fireEvent('change', handleNumber); 14581 fireEvent('set', handleNumber); 14582 fireEvent('end', handleNumber) 14583 }) 14584 } 14585 function eventStart(event, data) { 14586 if (data.handleNumbers.length === 1) { 14587 var handle = scope_Handles[data.handleNumbers[0]]; 14588 if (handle.hasAttribute('disabled')) { 14589 return false 14590 } 14591 scope_ActiveHandle = handle.children[0]; 14592 addClass(scope_ActiveHandle, options.cssClasses.active) 14593 } 14594 event.stopPropagation(); 14595 var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, { 14596 startCalcPoint: event.calcPoint, 14597 baseSize: baseSize(), 14598 pageOffset: event.pageOffset, 14599 handleNumbers: data.handleNumbers, 14600 buttonsProperty: event.buttons, 14601 locations: scope_Locations.slice() 14602 }); 14603 var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, { 14604 handleNumbers: data.handleNumbers 14605 }); 14606 var outEvent = attachEvent("mouseout", scope_DocumentElement, documentLeave, { 14607 handleNumbers: data.handleNumbers 14608 }); 14609 scope_Listeners = moveEvent.concat(endEvent, outEvent); 14610 if (event.cursor) { 14611 scope_Body.style.cursor = getComputedStyle(event.target).cursor; 14612 if (scope_Handles.length > 1) {
14613 addClass(scope_Target, options.cssClasses.drag) 14614 } 14615 scope_Body.addEventListener('selectstart', preventDefault, false) 14616 } 14617 data.handleNumbers.forEach(function(handleNumber) { 14618 fireEvent('start', handleNumber) 14619 }) 14620 } 14621 function eventTap(event) { 14622 event.stopPropagation(); 14623 var proposal = calcPointToPercentage(event.calcPoint); 14624 var handleNumber = getClosestHandle(proposal); 14625 if (handleNumber === false) { 14626 return false 14627 } 14628 if (!options.events.snap) { 14629 addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration) 14630 } 14631 setHandle(handleNumber, proposal, true, true); 14632 setZindex(); 14633 fireEvent('slide', handleNumber, true); 14634 fireEvent('update', handleNumber, true); 14635 fireEvent('change', handleNumber, true); 14636 fireEvent('set', handleNumber, true); 14637 if (options.events.snap) { 14638 eventStart(event, { 14639 handleNumbers: [handleNumber] 14640 }) 14641 } 14642 } 14643 function eventHover(event) { 14644 var proposal = calcPointToPercentage(event.calcPoint); 14645 var to = scope_Spectrum.getStep(proposal); 14646 var value = scope_Spectrum.fromStepping(to); 14647 Object.keys(scope_Events).forEach(function(targetEvent) { 14648 if ('hover' === targetEvent.split('.')[0]) { 14649 scope_Events[targetEvent].forEach(function(callback) { 14650 callback.call(scope_Self, value) 14651 }) 14652 } 14653 }) 14654 } 14655 function bindSliderEvents(behaviour) { 14656 if (!behaviour.fixed) { 14657 scope_Handles.forEach(function(handle, index) { 14658 attachEvent(actions.start, handle.children[0], eventStart, { 14659 handleNumbers: [index] 14660 }) 14661 }) 14662 } 14663 if (behaviour.tap) { 14664 attachEvent(actions.start, scope_Base, eventTap, {}) 14665 } 14666 if (behaviour.hover) { 14667 attachEvent(actions.move, scope_Base, eventHover, { 14668 hover: true 14669 }) 14670 } 14671 if (behaviour.drag) { 14672 scope_Connects.forEach(function(connect, index) { 14673 if (connect === false || index === 0 || index === scope_Connects.length - 1) { 14674 return 14675 } 14676 var handleBefore = scope_Handles[index - 1]; 14677 var handleAfter = scope_Handles[index]; 14678 var eventHolders = [connect]; 14679 addClass(connect, options.cssClasses.draggable); 14680 if (behaviour.fixed) { 14681 eventHolders.push(handleBefore.children[0]); 14682 eventHolders.push(handleAfter.children[0]) 14683 } 14684 eventHolders.forEach(function(eventHolder) { 14685 attachEvent(actions.start, eventHolder, eventStart, { 14686 handles: [handleBefore, handleAfter], 14687 handleNumbers: [index - 1, index] 14688 }) 14689 }) 14690 }) 14691 } 14692 } 14693 function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue) { 14694 if (scope_Handles.length > 1) { 14695 if (lookBackward && handleNumber > 0) { 14696 to = Math.max(to, reference[handleNumber - 1] + options.margin) 14697 } 14698 if (lookForward && handleNumber < scope_Handles.length - 1) { 14699 to = Math.min(to, reference[handleNumber + 1] - options.margin) 14700 } 14701 } 14702 if (scope_Handles.length > 1 && options.limit) { 14703 if (lookBackward && handleNumber > 0) { 14704 to = Math.min(to, reference[handleNumber - 1] + options.limit) 14705 } 14706 if (lookForward && handleNumber < scope_Handles.length - 1) { 14707 to = Math.max(to, reference[handleNumber + 1] - options.limit) 14708 } 14709 } 14710 if (options.padding) { 14711 if (handleNumber === 0) { 14712 to = Math.max(to, options.padding) 14713 } 14714 if (handleNumber === scope_Handles.length - 1) { 14715 to = Math.min(to, 100 - options.padding) 14716 } 14717 } 14718 to = scope_Spectrum.getStep(to); 14719 to = limit(to); 14720 if (to === reference[handleNumber] && !getValue) { 14721 return false 14722 } 14723 return to 14724 } 14725 function toPct(pct) { 14726 return pct + '%' 14727 } 14728 function updateHandlePosition(handleNumber, to) { 14729 scope_Locations[handleNumber] = to; 14730 scope_Values[handleNumber] = scope_Spectrum.fromStepping(to); 14731 var stateUpdate = function() { 14732 scope_Handles[handleNumber].style[options.style] = toPct(to); 14733 updateConnect(handleNumber); 14734 updateConnect(handleNumber + 1) 14735 }; 14736 if (window.requestAnimationFrame && options.useRequestAnimationFrame) { 14737 window.requestAnimationFrame(stateUpdate) 14738 } else { 14739 stateUpdate() 14740 } 14741 } 14742 function setZindex() {
14743 scope_HandleNumbers.forEach(function(handleNumber) { 14744 var dir = (scope_Locations[handleNumber] > 50 ? -1 : 1); 14745 var zIndex = 3 + (scope_Handles.length + (dir * handleNumber)); 14746 scope_Handles[handleNumber].childNodes[0].style.zIndex = zIndex 14747 }) 14748 } 14749 function setHandle(handleNumber, to, lookBackward, lookForward) { 14750 to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false); 14751 if (to === false) { 14752 return false 14753 } 14754 updateHandlePosition(handleNumber, to); 14755 return true 14756 } 14757 function updateConnect(index) { 14758 if (!scope_Connects[index]) { 14759 return 14760 } 14761 var l = 0; 14762 var h = 100; 14763 if (index !== 0) { 14764 l = scope_Locations[index - 1] 14765 } 14766 if (index !== scope_Connects.length - 1) { 14767 h = scope_Locations[index] 14768 } 14769 scope_Connects[index].style[options.style] = toPct(l); 14770 scope_Connects[index].style[options.styleOposite] = toPct(100 - h) 14771 } 14772 function setValue(to, handleNumber) { 14773 if (to === null || to === false) { 14774 return 14775 } 14776 if (typeof to === 'number') { 14777 to = String(to) 14778 } 14779 to = options.format.from(to); 14780 if (to !== false && !isNaN(to)) { 14781 setHandle(handleNumber, scope_Spectrum.toStepping(to), false, false) 14782 } 14783 } 14784 function valueSet(input, fireSetEvent) { 14785 var values = asArray(input); 14786 var isInit = scope_Locations[0] === undefined; 14787 fireSetEvent = (fireSetEvent === undefined ? true : !!fireSetEvent); 14788 values.forEach(setValue); 14789 if (options.animate && !isInit) { 14790 addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration) 14791 } 14792 scope_HandleNumbers.forEach(function(handleNumber) { 14793 setHandle(handleNumber, scope_Locations[handleNumber], true, false) 14794 }); 14795 setZindex(); 14796 scope_HandleNumbers.forEach(function(handleNumber) { 14797 fireEvent('update', handleNumber); 14798 if (values[handleNumber] !== null && fireSetEvent) { 14799 fireEvent('set', handleNumber) 14800 } 14801 }) 14802 } 14803 function valueReset(fireSetEvent) { 14804 valueSet(options.start, fireSetEvent) 14805 } 14806 function valueGet() { 14807 var values = scope_Values.map(options.format.to); 14808 if (values.length === 1) { 14809 return values[0] 14810 } 14811 return values 14812 } 14813 function destroy() { 14814 for (var key in options.cssClasses) { 14815 if (!options.cssClasses.hasOwnProperty(key)) { 14816 continue 14817 } 14818 removeClass(scope_Target, options.cssClasses[key]) 14819 } 14820 while (scope_Target.firstChild) { 14821 scope_Target.removeChild(scope_Target.firstChild) 14822 } 14823 delete scope_Target.noUiSlider 14824 } 14825 function getCurrentStep() { 14826 return scope_Locations.map(function(location, index) { 14827 var nearbySteps = scope_Spectrum.getNearbySteps(location); 14828 var value = scope_Values[index]; 14829 var increment = nearbySteps.thisStep.step; 14830 var decrement = null; 14831 if (increment !== false) { 14832 if (value + increment > nearbySteps.stepAfter.startValue) { 14833 increment = nearbySteps.stepAfter.startValue - value 14834 } 14835 } 14836 if (value > nearbySteps.thisStep.startValue) { 14837 decrement = nearbySteps.thisStep.step 14838 } else if (nearbySteps.stepBefore.step === false) { 14839 decrement = false 14840 } else { 14841 decrement = value - nearbySteps.stepBefore.highestStep 14842 } 14843 if (location === 100) { 14844 increment = null 14845 } else if (location === 0) { 14846 decrement = null 14847 } 14848 var stepDecimals = scope_Spectrum.countStepDecimals(); 14849 if (increment !== null && increment !== false) { 14850 increment = Number(increment.toFixed(stepDecimals)) 14851 } 14852 if (decrement !== null && decrement !== false) { 14853 decrement = Number(decrement.toFixed(stepDecimals)) 14854 } 14855 return [decrement, increment] 14856 }) 14857 } 14858 function bindEvent(namespacedEvent, callback) { 14859 scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || []; 14860 scope_Events[namespacedEvent].push(callback); 14861 if (namespacedEvent.split('.')[0] === 'update') {
14862 scope_Handles.forEach(function(a, index) { 14863 fireEvent('update', index) 14864 }) 14865 } 14866 } 14867 function removeEvent(namespacedEvent) { 14868 var event = namespacedEvent && namespacedEvent.split('.')[0]; 14869 var namespace = event && namespacedEvent.substring(event.length); 14870 Object.keys(scope_Events).forEach(function(bind) { 14871 var tEvent = bind.split('.')[0] 14872 , tNamespace = bind.substring(tEvent.length); 14873 if ((!event || event === tEvent) && (!namespace || namespace === tNamespace)) { 14874 delete scope_Events[bind] 14875 } 14876 }) 14877 } 14878 function updateOptions(optionsToUpdate, fireSetEvent) { 14879 var v = valueGet(); 14880 var updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format']; 14881 updateAble.forEach(function(name) { 14882 if (optionsToUpdate[name] !== undefined) { 14883 originalOptions[name] = optionsToUpdate[name] 14884 } 14885 }); 14886 var newOptions = testOptions(originalOptions); 14887 updateAble.forEach(function(name) { 14888 if (optionsToUpdate[name] !== undefined) { 14889 options[name] = newOptions[name] 14890 } 14891 }); 14892 scope_Spectrum = newOptions.spectrum; 14893 options.margin = newOptions.margin; 14894 options.limit = newOptions.limit; 14895 options.padding = newOptions.padding; 14896 if (options.pips) { 14897 pips(options.pips) 14898 } 14899 scope_Locations = []; 14900 valueSet(optionsToUpdate.start || v, fireSetEvent) 14901 } 14902 if (scope_Target.noUiSlider) { 14903 throw new Error("noUiSlider (" + VERSION + "): Slider was already initialized.") 14904 } 14905 addSlider(scope_Target); 14906 addElements(options.connect, scope_Base); 14907 scope_Self = { 14908 destroy: destroy, 14909 steps: getCurrentStep, 14910 on: bindEvent, 14911 off: removeEvent, 14912 get: valueGet, 14913 set: valueSet, 14914 reset: valueReset, 14915 __moveHandles: function(a, b, c) { 14916 moveHandles(a, b, scope_Locations, c) 14917 }, 14918 options: originalOptions, 14919 updateOptions: updateOptions, 14920 target: scope_Target, 14921 removePips: removePips, 14922 pips: pips 14923 }; 14924 bindSliderEvents(options.events); 14925 valueSet(options.start); 14926 if (options.pips) { 14927 pips(options.pips) 14928 } 14929 if (options.tooltips) { 14930 tooltips() 14931 } 14932 aria(); 14933 return scope_Self 14934 } 14935 function initialize(target, originalOptions) { 14936 if (!target || !target.nodeName) { 14937 throw new Error("noUiSlider (" + VERSION + "): create requires a single element, got: " + target) 14938 } 14939 var options = testOptions(originalOptions, target); 14940 var api = closure(target, options, originalOptions); 14941 target.noUiSlider = api; 14942 return api 14943 } 14944 return { 14945 version: VERSION, 14946 create: initialize 14947 } 14948})); 14949(function($) { 14950 function overlayJs(options) { 14951 var version = 'v2.1'; 14952 var _options = $.extend({ 14953 sAjaxUrl: '', 14954 oAjaxParam: {}, 14955 oInsertElement: $(document.body), 14956 sContent: '', 14957 sBgID: '', 14958 sBgClass: 'overlayjs2bg', 14959 oBgStyle: {}, 14960 sContainerID: '', 14961 sContainerClass: 'overlayjs2container', 14962 oContainerStyle: {}, 14963 sContentClass: 'content', 14964 oContentStyle: {}, 14965 sBgInnenClass: 'bginnen', 14966 oBgInnenStyle: {}, 14967 sInnenClass: 'innen', 14968 oInnenStyle: {}, 14969 bCloseBtn: true, 14970 sCloseBtnId: '', 14971 sCloseBtnClass: 'close', 14972 oCloseBtnStyle: {}, 14973 sCloseIconColor: '#929292',
14974 sCloseIconBgColor: '#FFFFFF', 14975 sCloseIconSVGClass: 'icon-cross-round-inv', 14976 oCloseIcon: {}, 14977 lIconsVersion: 1, 14978 lduration: 0.5, 14979 oAlignedElement: undefined, 14980 lAlignedOffset: 0, 14981 bDefaultStyle: true, 14982 bUsePositionFixed: true, 14983 onBeforeOpen: function() {}, 14984 onAfterFinishOpen: function() {}, 14985 onBeforeClose: function() {}, 14986 onAfterFinishClose: function() {} 14987 }, options || {}); 14988 var _oBg = undefined; 14989 var _oContainer = undefined; 14990 var _oContent = undefined; 14991 var _oBgInnen = undefined; 14992 var _oInnen = undefined; 14993 var _oCloseBtn = undefined; 14994 var _bLock = false; 14995 var _bHtmlLoad = false; 14996 var _bDeleteHtml = false; 14997 var _sLastAjaxUrl = ''; 14998 var _sLastAjaxParam = ''; 14999 var _sDefaultTop = ''; 15000 var _lDefaultTop = 0; 15001 var _sStatus = 'fixed'; 15002 var _imageTimer = null; 15003 var _imageloadEvent = null; 15004 if (typeof (oWebConfigData) != 'undefined') { 15005 if (oWebConfigData.lIconsVersion > 1) { 15006 _options.lIconsVersion = oWebConfigData.lIconsVersion 15007 } 15008 } 15009 function _open(options) { 15010 if (_bLock) { 15011 return 15012 } 15013 _bLock = true; 15014 var sText = _options.sContent; 15015 if (typeof (options) == 'string') { 15016 sText = options 15017 } else { 15018 _options = $.extend(_options, options || {}); 15019 sText = _options.sContent 15020 } 15021 $.proxy(_loadHtml, this)(); 15022 if (sText != '') { 15023 _options.onBeforeOpen(_oContainer); 15024 $.proxy(_loadContentText, this)(sText) 15025 } else if (_options.sAjaxUrl != '') { 15026 _options.onBeforeOpen(_oContainer); 15027 $.proxy(_loadContentAjax, this)() 15028 } else { 15029 _bLock = false 15030 } 15031 } 15032 function _toggle(options) { 15033 _bDeleteHtml = true; 15034 $.proxy(_open, this)(options) 15035 } 15036 function _close() { 15037 if (_bLock) { 15038 return 15039 } 15040 _bLock = true; 15041 _options.onBeforeClose(_oContainer); 15042 $(_oContainer).fadeOut({ 15043 duration: _options.lduration * 1000, 15044 complete: $.proxy(function() { 15045 $(_oBg).hide(); 15046 if (_bDeleteHtml) { 15047 $.proxy(_destroy, this)() 15048 } 15049 $(window).unbind("resize.overlayjs"); 15050 $(_oContainer).unbind("overlayJs:imageload"); 15051 _bLock = false; 15052 _options.onAfterFinishClose(_oContainer) 15053 }, this) 15054 }) 15055 } 15056 function _loadContentText(sText) { 15057 _sLastAjaxUrl = ''; 15058 _sLastAjaxParam = ''; 15059 $.proxy(_setContentPosition, this)(); 15060 var lTempOpacity = $(_oBg).css('opacity'); 15061 $(_oBg).css("opacity", "0").show().animate({ 15062 opacity: lTempOpacity 15063 }, { 15064 duration: _options.lduration * 1000, 15065 complete: $.proxy(function() { 15066 $(_oInnen).html(sText); 15067 $.proxy(_showContent, this)() 15068 }, this) 15069 }) 15070 } 15071 function _loadContentAjax() { 15072 $.proxy(_setContentPosition, this)();
15073 if (_options.sAjaxUrl != _sLastAjaxUrl || Object.toQueryString(_options.oAjaxParam) != _sLastAjaxParam) { 15074 $.ajax(_options.sAjaxUrl, { 15075 data: _options.oAjaxParam, 15076 type: "GET", 15077 success: $.proxy(function(data) { 15078 $(_oInnen).html(data); 15079 _sLastAjaxUrl = _options.sAjaxUrl; 15080 _sLastAjaxParam = decodeURIComponent($.param(_options.oAjaxParam)); 15081 $.proxy(_showContent, this)() 15082 }, this) 15083 }) 15084 } else { 15085 $.proxy(_showContent, this)() 15086 } 15087 var lTempOpacity = $(_oBg).css('opacity'); 15088 $(_oBg).css("opacity", "0").show().animate({ 15089 opacity: lTempOpacity 15090 }, { 15091 duration: _options.lduration * 1000 15092 }) 15093 } 15094 function _showContent() { 15095 var lTempOpacity = $(_oContainer).css('opacity'); 15096 $(_oContainer).css("opacity", "0").show().animate({ 15097 opacity: lTempOpacity 15098 }, { 15099 duration: _options.lduration * 1000, 15100 complete: $.proxy(function() { 15101 $.proxy(_setPosition, this)(); 15102 _options.onAfterFinishOpen(_oContainer); 15103 $(window).trigger('overlayJs:showContent'); 15104 _bLock = false 15105 }, this) 15106 }) 15107 } 15108 function _loadHtml() { 15109 if (!_bHtmlLoad) { 15110 var oParam = {}; 15111 oParam = { 15112 'class': _options.sBgClass 15113 }; 15114 if (_options.sBgID != '') { 15115 oParam.id = _options.sBgID 15116 } 15117 _oBg = document.createElement('div'); 15118 $.each(oParam, $.proxy(function(k, v) { 15119 _oBg.setAttribute(k, v) 15120 }, this)); 15121 $(_oBg).bind("click.overlayjs", $.proxy(_close, this)); 15122 $(_oBg).hide(); 15123 oParam = { 15124 'class': _options.sContainerClass 15125 }; 15126 if (_options.sContainerID != '') { 15127 oParam.id = _options.sContainerID 15128 } 15129 _oContainer = document.createElement("div"); 15130 $.each(oParam, $.proxy(function(k, v) { 15131 _oContainer.setAttribute(k, v) 15132 }, this)); 15133 $(_oContainer).hide(); 15134 _oContent = document.createElement("div"); 15135 _oContent.setAttribute("class", _options.sContentClass); 15136 $(_oContainer).append(_oContent); 15137 _oBgInnen = document.createElement("div"); 15138 _oBgInnen.setAttribute("class", _options.sBgInnenClass); 15139 $(_oBgInnen).bind('click.overlayjs', $.proxy(_close, this)); 15140 $(_oContainer).append(_oBgInnen); 15141 _oInnen = document.createElement("div"); 15142 $(_oInnen).addClass(_options.sInnenClass).html(" "); 15143 $(_oContent).append(_oInnen); 15144 $(_options.oInsertElement).append(_oBg); 15145 $(_options.oInsertElement).append(_oContainer); 15146 if (_options.bCloseBtn) { 15147 oParam = { 15148 'class': _options.sCloseBtnClass 15149 }; 15150 if (_options.sCloseBtnId != '') { 15151 oParam.id = _options.sCloseBtnId 15152 } 15153 _oCloseBtn = document.createElement("div"); 15154 $.each(oParam, $.proxy(function(k, v) { 15155 _oCloseBtn.setAttribute(k, v) 15156 }, this)); 15157 $(_oCloseBtn).bind('click.overlayjs', $.proxy(_close, this)); 15158 $(_oContent).append(_oCloseBtn); 15159 $(_oCloseBtn).html(' '); 15160 $(_oCloseBtn).html(''); 15161 $(_oCloseBtn).createSvg(_options.sCloseIconSVGClass); 15162 $(_oCloseBtn).find('svg').attr('style', 'width: 40px; height: 40px;') 15163 } 15164 if (_options.bDefaultStyle) { 15165 $.proxy(_loadStyle, this)() 15166 } 15167 _bHtmlLoad = true 15168 } 15169 } 15170 function _loadStyle() { 15171 var oCssStyle = {}; 15172 oCssStyle = $.extend({ 15173 'backgroundColor': '#1e1e1e', 15174 'opacity': 0.86, 15175 'position': 'fixed', 15176 'left': '0px', 15177 'top': '0px', 15178 'zIndex': 80, 15179 'width': '100%', 15180 'height': '100%' 15181 }, _options.oBgStyle); 15182 $(_oBg).css(oCssStyle); 15183 oCssStyle = $.extend({ 15184 'position': 'fixed', 15185 'left': '0px', 15186 'top': '3%', 15187 'zIndex': 90, 15188 'width': '100%', 15189 'textAlign': 'center' 15190 }, _options.oContainerStyle); 15191 $(_oContainer).css(oCssStyle); 15192 oCssStyle = $.extend({ 15193 'position': 'absolute', 15194 'left': '0px', 15195 'top': '0px', 15196 'width': '100%', 15197 'height': '100%' 15198 }, _options.oBgInnenStyle); 15199 $(_oBgInnen).css(oCssStyle); 15200 oCssStyle = $.extend({ 15201 'position': 'relative', 15202 'marginLeft': 'auto', 15203 'marginRight': 'auto', 15204 'width': '90%', 15205 'maxWidth': '1000px', 15206 'textAlign': 'left' 15207 }, _options.oContentStyle); 15208 $(_oContent).css(oCssStyle); 15209 oCssStyle = $.extend({ 15210 'padding': '1.5em 1.5em 1.5em 1.5em', 15211 'backgroundColor': '#FFFFFF', 15212 'position': 'relative', 15213 'zIndex': 1 15214 }, _options.oInnenStyle); 15215 $(_oInnen).css(oCssStyle); 15216 if (_options.bCloseBtn) { 15217 oCssStyle = $.extend({ 15218 'cursor': 'pointer', 15219 'width': '2.375em', 15220 'height': '2.375em', 15221 'position': 'absolute', 15222 'top': '-0.6875em', 15223 'right': '-0.6875em', 15224 'zIndex': 2 15225 }, _options.oCloseBtnStyle); 15226 $(_oCloseBtn).css(oCssStyle) 15227 } 15228 } 15229 function _setPosition() { 15230 $.proxy(_setContentPosition, this)(); 15231 if (_options.bUsePositionFixed) { 15232 _sDefaultTop = $(_oContainer).css('top'); 15233 _lDefaultTop = $(_oContainer).offset().top; 15234 _imageloadEvent = $(_oContainer).bind('overlayJs:imageload', $.proxy(function() { 15235 window.clearTimeout(_imageTimer); 15236 _imageTimer = window.setTimeout($.proxy(function() { 15237 $.proxy(_checkContentPosition, this)() 15238 }, this), 250); 15239 $(_oContainer).unbind('overlayJs:imageload') 15240 }, this)); 15241 $.proxy(_isImageLoaded, this)(_oContainer, $("img", _oContainer)); 15242 this.resizeEvent = $(window).bind('resize.overlayjs', $.proxy(_checkContentPosition, this)) 15243 } 15244 } 15245 function _setContentPosition() { 15246 if (_options.oAlignedElement) { 15247 var lOffsetTop = $(_options.oAlignedElement).offset().top + _options.lAlignedOffset + $(_oContainer).position().top; 15248 $(_oContainer).css({ 15249 'position': 'absolute', 15250 'top': lOffsetTop + 'px' 15251 }); 15252 _options.bUsePositionFixed = false;
15253 $(window).unbind('resize.overlayjs'); 15254 _sStatus == 'absolute' 15255 } else if (_options.bUsePositionFixed == false) { 15256 var fTop = 0; 15257 var fViewportOffset = 0; 15258 var sTop = '3%'; 15259 if (_options.oContainerStyle.top != undefined) { 15260 sTop = _options.oContainerStyle.top; 15261 if (_options.oContainerStyle.top.indexOf('%') > 0) { 15262 fTop = parseFloat(_options.oContainerStyle.top); 15263 fViewportOffset = $(window).scrollTop() / 100 * (100 + fTop) 15264 } else if (_options.oContainerStyle.top.indexOf('px') > 0) { 15265 fTop = parseFloat(_options.oContainerStyle.top); 15266 fViewportOffset = $(window).scrollTop() + fTop 15267 } else if (_options.oContainerStyle.top.indexOf('em') > 0) { 15268 fTop = parseFloat(_options.oContainerStyle.top); 15269 var fFontSize = parseFloat($(_oContainer).css('font-size')); 15270 fTop = fFontSize / fTop; 15271 fViewportOffset = $(window).scrollTop() + fTop 15272 } 15273 } else { 15274 fTop = parseFloat(sTop); 15275 fViewportOffset = $(window).scrollTop() / 100 * (100 + fTop) 15276 } 15277 $(_oContainer).css({ 15278 'position': 'absolute', 15279 'top': fViewportOffset + 'px' 15280 }); 15281 $(_oBg).css({ 15282 'position': 'absolute', 15283 'height': $(document).height() 15284 }); 15285 _sStatus == 'absolute' 15286 } 15287 } 15288 function _checkContentPosition() { 15289 var fTop = 0; 15290 var fViewportOffset = 0; 15291 var sTop = '3%'; 15292 if (_options.oContainerStyle.top != undefined) { 15293 sTop = _options.oContainerStyle.top; 15294 if (_options.oContainerStyle.top.indexOf('%') > 0) { 15295 fTop = parseFloat(_options.oContainerStyle.top); 15296 fViewportOffset = $(window).scrollTop() / 100 * (100 + fTop) 15297 } else if (_options.oContainerStyle.top.indexOf('px') > 0) { 15298 fTop = parseFloat(_options.oContainerStyle.top); 15299 fViewportOffset = $(window).scrollTop() + fTop 15300 } else if (_options.oContainerStyle.top.indexOf('em') > 0) { 15301 fTop = parseFloat(_options.oContainerStyle.top); 15302 var fFontSize = parseFloat($(_oContainer).css('font-size')); 15303 fTop = fFontSize / fTop; 15304 fViewportOffset = $(window).scrollTop() + fTop 15305 } 15306 } else { 15307 fTop = parseFloat(sTop); 15308 fViewportOffset = $(window).scrollTop() / 100 * (100 + fTop) 15309 } 15310 if (_sStatus == 'fixed' && fTop + $(_oContainer).find('div.' + _options.sContentClass).outerHeight(true) > $(window).height()) { 15311 $(_oContainer).css({ 15312 'position': 'absolute', 15313 'top': fViewportOffset + 'px' 15314 }); 15315 _sStatus = 'absolute' 15316 } else if (_sStatus == 'absolute' && $(_oContainer).find('div.' + _options.sContentClass).outerHeight(true) + fTop < $(window).height()) { 15317 $(_oContainer).css({ 15318 'position': 'fixed', 15319 'top': sTop 15320 }); 15321 $.proxy(_setContentPosition, this)(); 15322 _options.bUsePositionFixed = true; 15323 _sStatus = 'fixed' 15324 } else if (_sStatus == 'absolute') { 15325 $(_oContainer).css({ 15326 'position': 'absolute', 15327 'top': fViewportOffset + 'px' 15328 }); 15329 _sStatus = 'absolute' 15330 } 15331 } 15332 function _isImageLoaded(oElement, aImg) { 15333 var bLoaded = true; 15334 aImg.each(function(i, oImg) { 15335 bLoaded = oImg.complete && bLoaded 15336 }); 15337 if (bLoaded) { 15338 $(oElement).trigger('overlayJs:imageload') 15339 } else { 15340 window.setTimeout($.proxy(function() { 15341 $.proxy(_isImageLoaded, this)(oElement, aImg) 15342 }, this), 250) 15343 } 15344 } 15345 function _destroy() { 15346 this.resizeEvent = $(window).unbind('resize.overlayjs'); 15347 _sLastAjaxUrl = ''; 15348 _sLastAjaxParam = ''; 15349 if (_oInnen) { 15350 $(_oInnen).remove() 15351 } 15352 if (_oCloseBtn) { 15353 $(_oCloseBtn).unbind("click.overlayjs"); 15354 $(_oCloseBtn).remove() 15355 } 15356 if (_oContent) { 15357 $(_oContent).remove() 15358 } 15359 if (_oBgInnen) { 15360 $(_oBgInnen).unbind("click.overlayjs"); 15361 $(_oBgInnen).remove() 15362 } 15363 if (_oContainer) { 15364 $(_oContainer).remove() 15365 } 15366 if (_oBg) { 15367 $(_oBg).unbind("click.overlayjs"); 15368 $(_oBg).remove() 15369 } 15370 _bHtmlLoad = false 15371 } 15372 this.open = function(options) { 15373 $.proxy(_open, this)(options) 15374 } 15375 ; 15376 this.toggle = function(options) { 15377 $.proxy(_toggle, this)(options) 15378 } 15379 ; 15380 this.close = function() { 15381 $.proxy(_close, this)() 15382 } 15383 ; 15384 return this 15385 } 15386 $.overlayJs = function(options) { 15387 var oOverlay = new overlayJs(options); 15388 return oOverlay 15389 } 15390}(jQuery)); 15391(function(window, factory) { 15392 if (typeof define == 'function' && define.amd) { 15393 define('jquery-bridget/jquery-bridget', ['jquery'], function(jQuery) { 15394 return factory(window, jQuery) 15395 }) 15396 } else if (typeof module == 'object' && module.exports) { 15397 module.exports = factory(window, require('jquery')) 15398 } else { 15399 window.jQueryBridget = factory(window, window.jQuery) 15400 } 15401}(window, function factory(window, jQuery) { 15402 'use strict'; 15403 var arraySlice = Array.prototype.slice; 15404 var console = window.console; 15405 var logError = typeof console == 'undefined' ? function() {} 15406 : function(message) { 15407 console.error(message) 15408 } 15409 ; 15410 function jQueryBridget(namespace, PluginClass, $) { 15411 $ = $ || jQuery || window.jQuery; 15412 if (!$) { 15413 return 15414 } 15415 if (!PluginClass.prototype.option) { 15416 PluginClass.prototype.option = function(opts) { 15417 if (!$.isPlainObject(opts)) { 15418 return 15419 } 15420 this.options = $.extend(true, this.options, opts) 15421 } 15422 } 15423 $.fn[namespace] = function(arg0) { 15424 if (typeof arg0 == 'string') { 15425 var args = arraySlice.call(arguments, 1); 15426 return methodCall(this, arg0, args) 15427 } 15428 plainCall(this, arg0); 15429 return this 15430 } 15431 ; 15432 function methodCall($elems, methodName, args) { 15433 var returnValue; 15434 var pluginMethodStr = '$().' + namespace + '("' + methodName + '")'; 15435 $elems.each(function(i, elem) { 15436 var instance = $.data(elem, namespace); 15437 if (!instance) { 15438 logError(namespace + ' not initialized. Cannot call methods, i.e. ' + pluginMethodStr); 15439 return 15440 } 15441 var method = instance[methodName]; 15442 if (!method || methodName.charAt(0) == '_') { 15443 logError(pluginMethodStr + ' is not a valid method'); 15444 return 15445 } 15446 var value = method.apply(instance, args); 15447 returnValue = returnValue === undefined ? value : returnValue 15448 }); 15449 return returnValue !== undefined ? returnValue : $elems 15450 } 15451 function plainCall($elems, options) { 15452 $elems.each(function(i, elem) { 15453 var instance = $.data(elem, namespace); 15454 if (instance) { 15455 instance.option(options); 15456 instance._init() 15457 } else { 15458 instance = new PluginClass(elem,options); 15459 $.data(elem, namespace, instance) 15460 } 15461 }) 15462 } 15463 updateJQuery($) 15464 } 15465 function updateJQuery($) { 15466 if (!$ || ($ && $.bridget)) { 15467 return 15468 } 15469 $.bridget = jQueryBridget 15470 } 15471 updateJQuery(jQuery || window.jQuery); 15472 return jQueryBridget 15473})); 15474(function(global, factory) { 15475 if (typeof define == 'function' && define.amd) { 15476 define('ev-emitter/ev-emitter', factory) 15477 } else if (typeof module == 'object' && module.exports) { 15478 module.exports = factory() 15479 } else { 15480 global.EvEmitter = factory() 15481 } 15482}(typeof window != 'undefined' ? window : this, function() { 15483 function EvEmitter() {} 15484 var proto = EvEmitter.prototype; 15485 proto.on = function(eventName, listener) { 15486 if (!eventName || !listener) { 15487 return 15488 } 15489 var events = this._events = this._events || {}; 15490 var listeners = events[eventName] = events[eventName] || []; 15491 if (listeners.indexOf(listener) == -1) { 15492 listeners.push(listener) 15493 } 15494 return this 15495 } 15496 ; 15497 proto.once = function(eventName, listener) { 15498 if (!eventName || !listener) { 15499 return 15500 } 15501 this.on(eventName, listener); 15502 var onceEvents = this._onceEvents = this._onceEvents || {}; 15503 var onceListeners = onceEvents[eventName] = onceEvents[eventName] || {}; 15504 onceListeners[listener] = true; 15505 return this 15506 } 15507 ; 15508 proto.off = function(eventName, listener) { 15509 var listeners = this._events && this._events[eventName]; 15510 if (!listeners || !listeners.length) { 15511 return 15512 } 15513 var index = listeners.indexOf(listener); 15514 if (index != -1) { 15515 listeners.splice(index, 1) 15516 } 15517 return this 15518 } 15519 ; 15520 proto.emitEvent = function(eventName, args) { 15521 var listeners = this._events && this._events[eventName]; 15522 if (!listeners || !listeners.length) { 15523 return 15524 } 15525 listeners = listeners.slice(0); 15526 args = args || []; 15527 var onceListeners = this._onceEvents && this._onceEvents[eventName]; 15528 for (var i = 0; i < listeners.length; i++) { 15529 var listener = listeners[i]; 15530 var isOnce = onceListeners && onceListeners[listener]; 15531 if (isOnce) { 15532 this.off(eventName, listener); 15533 delete onceListeners[listener] 15534 } 15535 listener.apply(this, args) 15536 } 15537 return this 15538 } 15539 ; 15540 proto.allOff = function() { 15541 delete this._events; 15542 delete this._onceEvents 15543 } 15544 ; 15545 return EvEmitter 15546})); 15547(function(window, factory) { 15548 'use strict'; 15549 if (typeof define == 'function' && define.amd) { 15550 define('get-size/get-size', [], function() { 15551 return factory() 15552 }) 15553 } else if (typeof module == 'object' && module.exports) { 15554 module.exports = factory() 15555 } else { 15556 window.getSize = factory() 15557 } 15558} 15559)(window, function factory() { 15560 'use strict'; 15561 function getStyleSize(value) { 15562 var num = parseFloat(value); 15563 var isValid = value.indexOf('%') == -1 && !isNaN(num); 15564 return isValid && num 15565 } 15566 function noop() {} 15567 var logError = typeof console == 'undefined' ? noop : function(message) { 15568 console.error(message) 15569 } 15570 ; 15571 var measurements = ['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth', 'borderBottomWidth']; 15572 var measurementsLength = measurements.length; 15573 function getZeroSize() { 15574 var size = { 15575 width: 0, 15576 height: 0, 15577 innerWidth: 0, 15578 innerHeight: 0, 15579 outerWidth: 0, 15580 outerHeight: 0 15581 }; 15582 for (var i = 0; i < measurementsLength; i++) { 15583 var measurement = measurements[i]; 15584 size[measurement] = 0 15585 } 15586 return size 15587 } 15588 function getStyle(elem) { 15589 var style = getComputedStyle(elem); 15590 if (!style) { 15591 logError('Style returned ' + style + '. Are you running this code in a hidden iframe on Firefox? ' + 'See http://bit.ly/getsizebug1') 15592 } 15593 return style 15594 } 15595 var isSetup = false;
15596 var isBoxSizeOuter; 15597 function setup() { 15598 if (isSetup) { 15599 return 15600 } 15601 isSetup = true; 15602 var div = document.createElement('div'); 15603 div.style.width = '200px'; 15604 div.style.padding = '1px 2px 3px 4px'; 15605 div.style.borderStyle = 'solid'; 15606 div.style.borderWidth = '1px 2px 3px 4px'; 15607 div.style.boxSizing = 'border-box'; 15608 var body = document.body || document.documentElement; 15609 body.appendChild(div); 15610 var style = getStyle(div); 15611 getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize(style.width) == 200; 15612 body.removeChild(div) 15613 } 15614 function getSize(elem) { 15615 setup(); 15616 if (typeof elem == 'string') { 15617 elem = document.querySelector(elem) 15618 } 15619 if (!elem || typeof elem != 'object' || !elem.nodeType) { 15620 return 15621 } 15622 var style = getStyle(elem); 15623 if (style.display == 'none') { 15624 return getZeroSize() 15625 } 15626 var size = {}; 15627 size.width = elem.offsetWidth; 15628 size.height = elem.offsetHeight; 15629 var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; 15630 for (var i = 0; i < measurementsLength; i++) { 15631 var measurement = measurements[i]; 15632 var value = style[measurement]; 15633 var num = parseFloat(value); 15634 size[measurement] = !isNaN(num) ? num : 0 15635 } 15636 var paddingWidth = size.paddingLeft + size.paddingRight; 15637 var paddingHeight = size.paddingTop + size.paddingBottom; 15638 var marginWidth = size.marginLeft + size.marginRight; 15639 var marginHeight = size.marginTop + size.marginBottom; 15640 var borderWidth = size.borderLeftWidth + size.borderRightWidth; 15641 var borderHeight = size.borderTopWidth + size.borderBottomWidth; 15642 var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; 15643 var styleWidth = getStyleSize(style.width); 15644 if (styleWidth !== false) { 15645 size.width = styleWidth + (isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth) 15646 } 15647 var styleHeight = getStyleSize(style.height); 15648 if (styleHeight !== false) { 15649 size.height = styleHeight + (isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight) 15650 } 15651 size.innerWidth = size.width - (paddingWidth + borderWidth); 15652 size.innerHeight = size.height - (paddingHeight + borderHeight); 15653 size.outerWidth = size.width + marginWidth; 15654 size.outerHeight = size.height + marginHeight; 15655 return size 15656 } 15657 return getSize 15658}); 15659(function(window, factory) { 15660 'use strict'; 15661 if (typeof define == 'function' && define.amd) { 15662 define('desandro-matches-selector/matches-selector', factory) 15663 } else if (typeof module == 'object' && module.exports) { 15664 module.exports = factory() 15665 } else { 15666 window.matchesSelector = factory() 15667 } 15668}(window, function factory() { 15669 'use strict'; 15670 var matchesMethod = (function() { 15671 var ElemProto = window.Element.prototype; 15672 if (ElemProto.matches) { 15673 return 'matches' 15674 } 15675 if (ElemProto.matchesSelector) { 15676 return 'matchesSelector' 15677 } 15678 var prefixes = ['webkit', 'moz', 'ms', 'o']; 15679 for (var i = 0; i < prefixes.length; i++) { 15680 var prefix = prefixes[i]; 15681 var method = prefix + 'MatchesSelector'; 15682 if (ElemProto[method]) { 15683 return method 15684 } 15685 } 15686 } 15687 )(); 15688 return function matchesSelector(elem, selector) { 15689 return elem[matchesMethod](selector) 15690 } 15691})); 15692(function(window, factory) { 15693 if (typeof define == 'function' && define.amd) { 15694 define('fizzy-ui-utils/utils', ['desandro-matches-selector/matches-selector'], function(matchesSelector) { 15695 return factory(window, matchesSelector) 15696 }) 15697 } else if (typeof module == 'object' && module.exports) { 15698 module.exports = factory(window, require('desandro-matches-selector')) 15699 } else { 15700 window.fizzyUIUtils = factory(window, window.matchesSelector) 15701 } 15702}(window, function factory(window, matchesSelector) { 15703 var utils = {}; 15704 utils.extend = function(a, b) { 15705 for (var prop in b) { 15706 a[prop] = b[prop] 15707 } 15708 return a 15709 } 15710 ; 15711 utils.modulo = function(num, div) { 15712 return ((num % div) + div) % div 15713 } 15714 ; 15715 utils.makeArray = function(obj) { 15716 var ary = []; 15717 if (Array.isArray(obj)) { 15718 ary = obj 15719 } else if (obj && typeof obj == 'object' && typeof obj.length == 'number') { 15720 for (var i = 0; i < obj.length; i++) { 15721 ary.push(obj[i]) 15722 } 15723 } else { 15724 ary.push(obj) 15725 } 15726 return ary 15727 } 15728 ; 15729 utils.removeFrom = function(ary, obj) { 15730 var index = ary.indexOf(obj); 15731 if (index != -1) { 15732 ary.splice(index, 1) 15733 } 15734 } 15735 ; 15736 utils.getParent = function(elem, selector) { 15737 while (elem.parentNode && elem != document.body) { 15738 elem = elem.parentNode; 15739 if (matchesSelector(elem, selector)) { 15740 return elem 15741 } 15742 } 15743 } 15744 ; 15745 utils.getQueryElement = function(elem) { 15746 if (typeof elem == 'string') { 15747 return document.querySelector(elem) 15748 } 15749 return elem 15750 } 15751 ; 15752 utils.handleEvent = function(event) { 15753 var method = 'on' + event.type; 15754 if (this[method]) { 15755 this[method](event) 15756 } 15757 } 15758 ; 15759 utils.filterFindElements = function(elems, selector) { 15760 elems = utils.makeArray(elems); 15761 var ffElems = [];
15762 elems.forEach(function(elem) { 15763 if (!(elem instanceof HTMLElement)) { 15764 return 15765 } 15766 if (!selector) { 15767 ffElems.push(elem); 15768 return 15769 } 15770 if (matchesSelector(elem, selector)) { 15771 ffElems.push(elem) 15772 } 15773 var childElems = elem.querySelectorAll(selector); 15774 for (var i = 0; i < childElems.length; i++) { 15775 ffElems.push(childElems[i]) 15776 } 15777 }); 15778 return ffElems 15779 } 15780 ; 15781 utils.debounceMethod = function(_class, methodName, threshold) { 15782 var method = _class.prototype[methodName]; 15783 var timeoutName = methodName + 'Timeout'; 15784 _class.prototype[methodName] = function() { 15785 var timeout = this[timeoutName]; 15786 if (timeout) { 15787 clearTimeout(timeout) 15788 } 15789 var args = arguments; 15790 var _this = this; 15791 this[timeoutName] = setTimeout(function() { 15792 method.apply(_this, args); 15793 delete _this[timeoutName] 15794 }, threshold || 100) 15795 } 15796 } 15797 ; 15798 utils.docReady = function(callback) { 15799 var readyState = document.readyState; 15800 if (readyState == 'complete' || readyState == 'interactive') { 15801 setTimeout(callback) 15802 } else { 15803 document.addEventListener('DOMContentLoaded', callback) 15804 } 15805 } 15806 ; 15807 utils.toDashed = function(str) { 15808 return str.replace(/(.)([A-Z])/g, function(match, $1, $2) { 15809 return $1 + '-' + $2 15810 }).toLowerCase() 15811 } 15812 ; 15813 var console = window.console; 15814 utils.htmlInit = function(WidgetClass, namespace) { 15815 utils.docReady(function() { 15816 var dashedNamespace = utils.toDashed(namespace); 15817 var dataAttr = 'data-' + dashedNamespace; 15818 var dataAttrElems = document.querySelectorAll('[' + dataAttr + ']'); 15819 var jsDashElems = document.querySelectorAll('.js-' + dashedNamespace); 15820 var elems = utils.makeArray(dataAttrElems).concat(utils.makeArray(jsDashElems)); 15821 var dataOptionsAttr = dataAttr + '-options'; 15822 var jQuery = window.jQuery; 15823 elems.forEach(function(elem) { 15824 var attr = elem.getAttribute(dataAttr) || elem.getAttribute(dataOptionsAttr); 15825 var options; 15826 try { 15827 options = attr && JSON.parse(attr) 15828 } catch (error) { 15829 if (console) { 15830 console.error('Error parsing ' + dataAttr + ' on ' + elem.className + ': ' + error) 15831 } 15832 return 15833 } 15834 var instance = new WidgetClass(elem,options); 15835 if (jQuery) { 15836 jQuery.data(elem, namespace, instance) 15837 } 15838 }) 15839 }) 15840 } 15841 ; 15842 return utils 15843})); 15844(function(window, factory) { 15845 if (typeof define == 'function' && define.amd) { 15846 define('outlayer/item', ['ev-emitter/ev-emitter', 'get-size/get-size'], factory) 15847 } else if (typeof module == 'object' && module.exports) { 15848 module.exports = factory(require('ev-emitter'), require('get-size')) 15849 } else { 15850 window.Outlayer = {}; 15851 window.Outlayer.Item = factory(window.EvEmitter, window.getSize) 15852 } 15853}(window, function factory(EvEmitter, getSize) { 15854 'use strict'; 15855 function isEmptyObj(obj) { 15856 for (var prop in obj) { 15857 return false 15858 } 15859 prop = null; 15860 return true 15861 } 15862 var docElemStyle = document.documentElement.style; 15863 var transitionProperty = typeof docElemStyle.transition == 'string' ? 'transition' : 'WebkitTransition'; 15864 var transformProperty = typeof docElemStyle.transform == 'string' ? 'transform' : 'WebkitTransform'; 15865 var transitionEndEvent = { 15866 WebkitTransition: 'webkitTransitionEnd', 15867 transition: 'transitionend' 15868 }[transitionProperty]; 15869 var vendorProperties = { 15870 transform: transformProperty, 15871 transition: transitionProperty, 15872 transitionDuration: transitionProperty + 'Duration', 15873 transitionProperty: transitionProperty + 'Property', 15874 transitionDelay: transitionProperty + 'Delay' 15875 }; 15876 function Item(element, layout) { 15877 if (!element) { 15878 return 15879 } 15880 this.element = element; 15881 this.layout = layout; 15882 this.position = { 15883 x: 0, 15884 y: 0 15885 }; 15886 this._create() 15887 } 15888 var proto = Item.prototype = Object.create(EvEmitter.prototype); 15889 proto.constructor = Item; 15890 proto._create = function() { 15891 this._transn = { 15892 ingProperties: {}, 15893 clean: {}, 15894 onEnd: {} 15895 }; 15896 this.css({ 15897 position: 'absolute' 15898 }) 15899 } 15900 ; 15901 proto.handleEvent = function(event) { 15902 var method = 'on' + event.type; 15903 if (this[method]) { 15904 this[method](event) 15905 } 15906 } 15907 ; 15908 proto.getSize = function() { 15909 this.size = getSize(this.element) 15910 } 15911 ; 15912 proto.css = function(style) { 15913 var elemStyle = this.element.style; 15914 for (var prop in style) {
15915 var supportedProp = vendorProperties[prop] || prop; 15916 elemStyle[supportedProp] = style[prop] 15917 } 15918 } 15919 ; 15920 proto.getPosition = function() { 15921 var style = getComputedStyle(this.element); 15922 var isOriginLeft = this.layout._getOption('originLeft'); 15923 var isOriginTop = this.layout._getOption('originTop'); 15924 var xValue = style[isOriginLeft ? 'left' : 'right']; 15925 var yValue = style[isOriginTop ? 'top' : 'bottom']; 15926 var layoutSize = this.layout.size; 15927 var x = xValue.indexOf('%') != -1 ? (parseFloat(xValue) / 100) * layoutSize.width : parseInt(xValue, 10); 15928 var y = yValue.indexOf('%') != -1 ? (parseFloat(yValue) / 100) * layoutSize.height : parseInt(yValue, 10); 15929 x = isNaN(x) ? 0 : x; 15930 y = isNaN(y) ? 0 : y; 15931 x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; 15932 y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; 15933 this.position.x = x; 15934 this.position.y = y 15935 } 15936 ; 15937 proto.layoutPosition = function() { 15938 var layoutSize = this.layout.size; 15939 var style = {}; 15940 var isOriginLeft = this.layout._getOption('originLeft'); 15941 var isOriginTop = this.layout._getOption('originTop'); 15942 var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight'; 15943 var xProperty = isOriginLeft ? 'left' : 'right'; 15944 var xResetProperty = isOriginLeft ? 'right' : 'left'; 15945 var x = this.position.x + layoutSize[xPadding]; 15946 style[xProperty] = this.getXValue(x); 15947 style[xResetProperty] = ''; 15948 var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom'; 15949 var yProperty = isOriginTop ? 'top' : 'bottom'; 15950 var yResetProperty = isOriginTop ? 'bottom' : 'top'; 15951 var y = this.position.y + layoutSize[yPadding]; 15952 style[yProperty] = this.getYValue(y); 15953 style[yResetProperty] = ''; 15954 this.css(style); 15955 this.emitEvent('layout', [this]) 15956 } 15957 ; 15958 proto.getXValue = function(x) { 15959 var isHorizontal = this.layout._getOption('horizontal'); 15960 return this.layout.options.percentPosition && !isHorizontal ? ((x / this.layout.size.width) * 100) + '%' : x + 'px' 15961 } 15962 ; 15963 proto.getYValue = function(y) { 15964 var isHorizontal = this.layout._getOption('horizontal'); 15965 return this.layout.options.percentPosition && isHorizontal ? ((y / this.layout.size.height) * 100) + '%' : y + 'px' 15966 } 15967 ; 15968 proto._transitionTo = function(x, y) { 15969 this.getPosition(); 15970 var curX = this.position.x; 15971 var curY = this.position.y; 15972 var compareX = parseInt(x, 10); 15973 var compareY = parseInt(y, 10); 15974 var didNotMove = compareX === this.position.x && compareY === this.position.y; 15975 this.setPosition(x, y); 15976 if (didNotMove && !this.isTransitioning) { 15977 this.layoutPosition(); 15978 return 15979 } 15980 var transX = x - curX; 15981 var transY = y - curY; 15982 var transitionStyle = {}; 15983 transitionStyle.transform = this.getTranslate(transX, transY); 15984 this.transition({ 15985 to: transitionStyle, 15986 onTransitionEnd: { 15987 transform: this.layoutPosition 15988 }, 15989 isCleaning: true 15990 }) 15991 } 15992 ; 15993 proto.getTranslate = function(x, y) { 15994 var isOriginLeft = this.layout._getOption('originLeft'); 15995 var isOriginTop = this.layout._getOption('originTop'); 15996 x = isOriginLeft ? x : -x; 15997 y = isOriginTop ? y : -y; 15998 return 'translate3d(' + x + 'px, ' + y + 'px, 0)' 15999 } 16000 ; 16001 proto.goTo = function(x, y) { 16002 this.setPosition(x, y); 16003 this.layoutPosition() 16004 } 16005 ; 16006 proto.moveTo = proto._transitionTo; 16007 proto.setPosition = function(x, y) { 16008 this.position.x = parseInt(x, 10); 16009 this.position.y = parseInt(y, 10) 16010 } 16011 ; 16012 proto._nonTransition = function(args) { 16013 this.css(args.to); 16014 if (args.isCleaning) { 16015 this._removeStyles(args.to) 16016 } 16017 for (var prop in args.onTransitionEnd) { 16018 args.onTransitionEnd[prop].call(this) 16019 } 16020 } 16021 ; 16022 proto.transition = function(args) { 16023 if (!parseFloat(this.layout.options.transitionDuration)) { 16024 this._nonTransition(args); 16025 return 16026 } 16027 var _transition = this._transn; 16028 for (var prop in args.onTransitionEnd) { 16029 _transition.onEnd[prop] = args.onTransitionEnd[prop] 16030 } 16031 for (prop in args.to) { 16032 _transition.ingProperties[prop] = true; 16033 if (args.isCleaning) { 16034 _transition.clean[prop] = true 16035 } 16036 } 16037 if (args.from) { 16038 this.css(args.from); 16039 var h = this.element.offsetHeight; 16040 h = null 16041 } 16042 this.enableTransition(args.to); 16043 this.css(args.to); 16044 this.isTransitioning = true 16045 } 16046 ; 16047 function toDashedAll(str) { 16048 return str.replace(/([A-Z])/g, function($1) { 16049 return '-' + $1.toLowerCase() 16050 }) 16051 } 16052 var transitionProps = 'opacity,' + toDashedAll(transformProperty); 16053 proto.enableTransition = function() { 16054 if (this.isTransitioning) { 16055 return 16056 } 16057 var duration = this.layout.options.transitionDuration; 16058 duration = typeof duration == 'number' ? duration + 'ms' : duration; 16059 this.css({ 16060 transitionProperty: transitionProps, 16061 transitionDuration: duration, 16062 transitionDelay: this.staggerDelay || 0 16063 }); 16064 this.element.addEventListener(transitionEndEvent, this, false) 16065 } 16066 ; 16067 proto.onwebkitTransitionEnd = function(event) { 16068 this.ontransitionend(event) 16069 } 16070 ; 16071 proto.onotransitionend = function(event) { 16072 this.ontransitionend(event) 16073 } 16074 ; 16075 var dashedVendorProperties = {
16076 '-webkit-transform': 'transform' 16077 }; 16078 proto.ontransitionend = function(event) { 16079 if (event.target !== this.element) { 16080 return 16081 } 16082 var _transition = this._transn; 16083 var propertyName = dashedVendorProperties[event.propertyName] || event.propertyName; 16084 delete _transition.ingProperties[propertyName]; 16085 if (isEmptyObj(_transition.ingProperties)) { 16086 this.disableTransition() 16087 } 16088 if (propertyName in _transition.clean) { 16089 this.element.style[event.propertyName] = ''; 16090 delete _transition.clean[propertyName] 16091 } 16092 if (propertyName in _transition.onEnd) { 16093 var onTransitionEnd = _transition.onEnd[propertyName]; 16094 onTransitionEnd.call(this); 16095 delete _transition.onEnd[propertyName] 16096 } 16097 this.emitEvent('transitionEnd', [this]) 16098 } 16099 ; 16100 proto.disableTransition = function() { 16101 this.removeTransitionStyles(); 16102 this.element.removeEventListener(transitionEndEvent, this, false); 16103 this.isTransitioning = false 16104 } 16105 ; 16106 proto._removeStyles = function(style) { 16107 var cleanStyle = {}; 16108 for (var prop in style) { 16109 cleanStyle[prop] = '' 16110 } 16111 this.css(cleanStyle) 16112 } 16113 ; 16114 var cleanTransitionStyle = { 16115 transitionProperty: '', 16116 transitionDuration: '', 16117 transitionDelay: '' 16118 }; 16119 proto.removeTransitionStyles = function() { 16120 this.css(cleanTransitionStyle) 16121 } 16122 ; 16123 proto.stagger = function(delay) { 16124 delay = isNaN(delay) ? 0 : delay; 16125 this.staggerDelay = delay + 'ms' 16126 } 16127 ; 16128 proto.removeElem = function() { 16129 this.element.parentNode.removeChild(this.element); 16130 this.css({ 16131 display: '' 16132 }); 16133 this.emitEvent('remove', [this]) 16134 } 16135 ; 16136 proto.remove = function() { 16137 if (!transitionProperty || !parseFloat(this.layout.options.transitionDuration)) { 16138 this.removeElem(); 16139 return 16140 } 16141 this.once('transitionEnd', function() { 16142 this.removeElem() 16143 }); 16144 this.hide() 16145 } 16146 ; 16147 proto.reveal = function() { 16148 delete this.isHidden; 16149 this.css({ 16150 display: '' 16151 }); 16152 var options = this.layout.options; 16153 var onTransitionEnd = {}; 16154 var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle'); 16155 onTransitionEnd[transitionEndProperty] = this.onRevealTransitionEnd; 16156 this.transition({ 16157 from: options.hiddenStyle, 16158 to: options.visibleStyle, 16159 isCleaning: true, 16160 onTransitionEnd: onTransitionEnd 16161 }) 16162 } 16163 ; 16164 proto.onRevealTransitionEnd = function() { 16165 if (!this.isHidden) { 16166 this.emitEvent('reveal') 16167 } 16168 } 16169 ; 16170 proto.getHideRevealTransitionEndProperty = function(styleProperty) { 16171 var optionStyle = this.layout.options[styleProperty]; 16172 if (optionStyle.opacity) { 16173 return 'opacity' 16174 } 16175 for (var prop in optionStyle) { 16176 return prop 16177 } 16178 } 16179 ; 16180 proto.hide = function() { 16181 this.isHidden = true; 16182 this.css({ 16183 display: '' 16184 }); 16185 var options = this.layout.options; 16186 var onTransitionEnd = {}; 16187 var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle'); 16188 onTransitionEnd[transitionEndProperty] = this.onHideTransitionEnd; 16189 this.transition({ 16190 from: options.visibleStyle, 16191 to: options.hiddenStyle, 16192 isCleaning: true, 16193 onTransitionEnd: onTransitionEnd 16194 }) 16195 } 16196 ; 16197 proto.onHideTransitionEnd = function() { 16198 if (this.isHidden) { 16199 this.css({ 16200 display: 'none' 16201 }); 16202 this.emitEvent('hide') 16203 } 16204 } 16205 ; 16206 proto.destroy = function() { 16207 this.css({ 16208 position: '', 16209 left: '', 16210 right: '', 16211 top: '', 16212 bottom: '', 16213 transition: '', 16214 transform: '' 16215 }) 16216 } 16217 ; 16218 return Item 16219})); 16220(function(window, factory) { 16221 'use strict'; 16222 if (typeof define == 'function' && define.amd) { 16223 define('outlayer/outlayer', ['ev-emitter/ev-emitter', 'get-size/get-size', 'fizzy-ui-utils/utils', './item'], function(EvEmitter, getSize, utils, Item) { 16224 return factory(window, EvEmitter, getSize, utils, Item) 16225 }) 16226 } else if (typeof module == 'object' && module.exports) { 16227 module.exports = factory(window, require('ev-emitter'), require('get-size'), require('fizzy-ui-utils'), require('./item')) 16228 } else { 16229 window.Outlayer = factory(window, window.EvEmitter, window.getSize, window.fizzyUIUtils, window.Outlayer.Item) 16230 } 16231}(window, function factory(window, EvEmitter, getSize, utils, Item) { 16232 'use strict'; 16233 var console = window.console; 16234 var jQuery = window.jQuery; 16235 var noop = function() {}; 16236 var GUID = 0; 16237 var instances = {}; 16238 function Outlayer(element, options) { 16239 var queryElement = utils.getQueryElement(element); 16240 if (!queryElement) { 16241 if (console) { 16242 console.error('Bad element for ' + this.constructor.namespace + ': ' + (queryElement || element)) 16243 } 16244 return 16245 } 16246 this.element = queryElement; 16247 if (jQuery) { 16248 this.$element = jQuery(this.element) 16249 } 16250 this.options = utils.extend({}, this.constructor.defaults); 16251 this.option(options); 16252 var id = ++GUID; 16253 this.element.outlayerGUID = id; 16254 instances[id] = this; 16255 this._create(); 16256 var isInitLayout = this._getOption('initLayout'); 16257 if (isInitLayout) { 16258 this.layout() 16259 } 16260 } 16261 Outlayer.namespace = 'outlayer'; 16262 Outlayer.Item = Item; 16263 Outlayer.defaults = { 16264 containerStyle: { 16265 position: 'relative' 16266 }, 16267 initLayout: true, 16268 originLeft: true, 16269 originTop: true, 16270 resize: true, 16271 resizeContainer: true, 16272 transitionDuration: '0.4s', 16273 hiddenStyle: { 16274 opacity: 0, 16275 transform: 'scale(0.001)' 16276 }, 16277 visibleStyle: { 16278 opacity: 1, 16279 transform: 'scale(1)' 16280 } 16281 }; 16282 var proto = Outlayer.prototype; 16283 utils.extend(proto, EvEmitter.prototype); 16284 proto.option = function(opts) { 16285 utils.extend(this.options, opts) 16286 } 16287 ; 16288 proto._getOption = function(option) { 16289 var oldOption = this.constructor.compatOptions[option]; 16290 return oldOption && this.options[oldOption] !== undefined ? this.options[oldOption] : this.options[option] 16291 } 16292 ; 16293 Outlayer.compatOptions = { 16294 initLayout: 'isInitLayout', 16295 horizontal: 'isHorizontal', 16296 layoutInstant: 'isLayoutInstant', 16297 originLeft: 'isOriginLeft', 16298 originTop: 'isOriginTop', 16299 resize: 'isResizeBound', 16300 resizeContainer: 'isResizingContainer' 16301 }; 16302 proto._create = function() { 16303 this.reloadItems(); 16304 this.stamps = []; 16305 this.stamp(this.options.stamp); 16306 utils.extend(this.element.style, this.options.containerStyle); 16307 var canBindResize = this._getOption('resize'); 16308 if (canBindResize) { 16309 this.bindResize() 16310 } 16311 } 16312 ; 16313 proto.reloadItems = function() { 16314 this.items = this._itemize(this.element.children) 16315 } 16316 ; 16317 proto._itemize = function(elems) { 16318 var itemElems = this._filterFindItemElements(elems); 16319 var Item = this.constructor.Item; 16320 var items = []; 16321 for (var i = 0; i < itemElems.length; i++) { 16322 var elem = itemElems[i]; 16323 var item = new Item(elem,this); 16324 items.push(item) 16325 } 16326 return items 16327 } 16328 ; 16329 proto._filterFindItemElements = function(elems) { 16330 return utils.filterFindElements(elems, this.options.itemSelector) 16331 } 16332 ; 16333 proto.getItemElements = function() { 16334 return this.items.map(function(item) { 16335 return item.element 16336 }) 16337 } 16338 ; 16339 proto.layout = function() { 16340 this._resetLayout(); 16341 this._manageStamps(); 16342 var layoutInstant = this._getOption('layoutInstant'); 16343 var isInstant = layoutInstant !== undefined ? layoutInstant : !this._isLayoutInited; 16344 this.layoutItems(this.items, isInstant); 16345 this._isLayoutInited = true 16346 } 16347 ; 16348 proto._init = proto.layout; 16349 proto._resetLayout = function() {
16350 this.getSize() 16351 } 16352 ; 16353 proto.getSize = function() { 16354 this.size = getSize(this.element) 16355 } 16356 ; 16357 proto._getMeasurement = function(measurement, size) { 16358 var option = this.options[measurement]; 16359 var elem; 16360 if (!option) { 16361 this[measurement] = 0 16362 } else { 16363 if (typeof option == 'string') { 16364 elem = this.element.querySelector(option) 16365 } else if (option instanceof HTMLElement) { 16366 elem = option 16367 } 16368 this[measurement] = elem ? getSize(elem)[size] : option 16369 } 16370 } 16371 ; 16372 proto.layoutItems = function(items, isInstant) { 16373 items = this._getItemsForLayout(items); 16374 this._layoutItems(items, isInstant); 16375 this._postLayout() 16376 } 16377 ; 16378 proto._getItemsForLayout = function(items) { 16379 return items.filter(function(item) { 16380 return !item.isIgnored 16381 }) 16382 } 16383 ; 16384 proto._layoutItems = function(items, isInstant) { 16385 this._emitCompleteOnItems('layout', items); 16386 if (!items || !items.length) { 16387 return 16388 } 16389 var queue = []; 16390 items.forEach(function(item) { 16391 var position = this._getItemLayoutPosition(item); 16392 position.item = item; 16393 position.isInstant = isInstant || item.isLayoutInstant; 16394 queue.push(position) 16395 }, this); 16396 this._processLayoutQueue(queue) 16397 } 16398 ; 16399 proto._getItemLayoutPosition = function() { 16400 return { 16401 x: 0, 16402 y: 0 16403 } 16404 } 16405 ; 16406 proto._processLayoutQueue = function(queue) { 16407 this.updateStagger(); 16408 queue.forEach(function(obj, i) { 16409 this._positionItem(obj.item, obj.x, obj.y, obj.isInstant, i) 16410 }, this) 16411 } 16412 ; 16413 proto.updateStagger = function() { 16414 var stagger = this.options.stagger; 16415 if (stagger === null || stagger === undefined) { 16416 this.stagger = 0; 16417 return 16418 } 16419 this.stagger = getMilliseconds(stagger); 16420 return this.stagger 16421 } 16422 ; 16423 proto._positionItem = function(item, x, y, isInstant, i) { 16424 if (isInstant) { 16425 item.goTo(x, y) 16426 } else { 16427 item.stagger(i * this.stagger); 16428 item.moveTo(x, y) 16429 } 16430 } 16431 ; 16432 proto._postLayout = function() { 16433 this.resizeContainer() 16434 } 16435 ; 16436 proto.resizeContainer = function() { 16437 var isResizingContainer = this._getOption('resizeContainer'); 16438 if (!isResizingContainer) { 16439 return 16440 } 16441 var size = this._getContainerSize(); 16442 if (size) { 16443 this._setContainerMeasure(size.width, true); 16444 this._setContainerMeasure(size.height, false) 16445 } 16446 } 16447 ; 16448 proto._getContainerSize = noop; 16449 proto._setContainerMeasure = function(measure, isWidth) { 16450 if (measure === undefined) { 16451 return 16452 } 16453 var elemSize = this.size; 16454 if (elemSize.isBorderBox) { 16455 measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + elemSize.borderLeftWidth + elemSize.borderRightWidth : elemSize.paddingBottom + elemSize.paddingTop + elemSize.borderTopWidth + elemSize.borderBottomWidth 16456 } 16457 measure = Math.max(measure, 0); 16458 this.element.style[isWidth ? 'width' : 'height'] = measure + 'px' 16459 } 16460 ; 16461 proto._emitCompleteOnItems = function(eventName, items) { 16462 var _this = this; 16463 function onComplete() { 16464 _this.dispatchEvent(eventName + 'Complete', null, [items]) 16465 } 16466 var count = items.length; 16467 if (!items || !count) { 16468 onComplete(); 16469 return 16470 } 16471 var doneCount = 0; 16472 function tick() { 16473 doneCount++; 16474 if (doneCount == count) { 16475 onComplete() 16476 } 16477 } 16478 items.forEach(function(item) { 16479 item.once(eventName, tick) 16480 }) 16481 } 16482 ; 16483 proto.dispatchEvent = function(type, event, args) { 16484 var emitArgs = event ? [event].concat(args) : args; 16485 this.emitEvent(type, emitArgs); 16486 if (jQuery) { 16487 this.$element = this.$element || jQuery(this.element); 16488 if (event) { 16489 var $event = jQuery.Event(event); 16490 $event.type = type; 16491 this.$element.trigger($event, args) 16492 } else { 16493 this.$element.trigger(type, args) 16494 } 16495 } 16496 } 16497 ; 16498 proto.ignore = function(elem) { 16499 var item = this.getItem(elem); 16500 if (item) { 16501 item.isIgnored = true 16502 } 16503 } 16504 ; 16505 proto.unignore = function(elem) { 16506 var item = this.getItem(elem); 16507 if (item) { 16508 delete item.isIgnored 16509 } 16510 } 16511 ; 16512 proto.stamp = function(elems) { 16513 elems = this._find(elems); 16514 if (!elems) { 16515 return 16516 }
16517 this.stamps = this.stamps.concat(elems); 16518 elems.forEach(this.ignore, this) 16519 } 16520 ; 16521 proto.unstamp = function(elems) { 16522 elems = this._find(elems); 16523 if (!elems) { 16524 return 16525 } 16526 elems.forEach(function(elem) { 16527 utils.removeFrom(this.stamps, elem); 16528 this.unignore(elem) 16529 }, this) 16530 } 16531 ; 16532 proto._find = function(elems) { 16533 if (!elems) { 16534 return 16535 } 16536 if (typeof elems == 'string') { 16537 elems = this.element.querySelectorAll(elems) 16538 } 16539 elems = utils.makeArray(elems); 16540 return elems 16541 } 16542 ; 16543 proto._manageStamps = function() { 16544 if (!this.stamps || !this.stamps.length) { 16545 return 16546 } 16547 this._getBoundingRect(); 16548 this.stamps.forEach(this._manageStamp, this) 16549 } 16550 ; 16551 proto._getBoundingRect = function() { 16552 var boundingRect = this.element.getBoundingClientRect(); 16553 var size = this.size; 16554 this._boundingRect = { 16555 left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, 16556 top: boundingRect.top + size.paddingTop + size.borderTopWidth, 16557 right: boundingRect.right - (size.paddingRight + size.borderRightWidth), 16558 bottom: boundingRect.bottom - (size.paddingBottom + size.borderBottomWidth) 16559 } 16560 } 16561 ; 16562 proto._manageStamp = noop; 16563 proto._getElementOffset = function(elem) { 16564 var boundingRect = elem.getBoundingClientRect(); 16565 var thisRect = this._boundingRect; 16566 var size = getSize(elem); 16567 var offset = { 16568 left: boundingRect.left - thisRect.left - size.marginLeft, 16569 top: boundingRect.top - thisRect.top - size.marginTop, 16570 right: thisRect.right - boundingRect.right - size.marginRight, 16571 bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom 16572 }; 16573 return offset 16574 } 16575 ; 16576 proto.handleEvent = utils.handleEvent; 16577 proto.bindResize = function() { 16578 window.addEventListener('resize', this); 16579 this.isResizeBound = true 16580 } 16581 ; 16582 proto.unbindResize = function() { 16583 window.removeEventListener('resize', this); 16584 this.isResizeBound = false 16585 } 16586 ; 16587 proto.onresize = function() { 16588 this.resize() 16589 } 16590 ; 16591 utils.debounceMethod(Outlayer, 'onresize', 100); 16592 proto.resize = function() { 16593 if (!this.isResizeBound || !this.needsResizeLayout()) { 16594 return 16595 } 16596 this.layout() 16597 } 16598 ; 16599 proto.needsResizeLayout = function() { 16600 var size = getSize(this.element); 16601 var hasSizes = this.size && size; 16602 return hasSizes && size.innerWidth !== this.size.innerWidth 16603 } 16604 ; 16605 proto.addItems = function(elems) { 16606 var items = this._itemize(elems); 16607 if (items.length) { 16608 this.items = this.items.concat(items) 16609 } 16610 return items 16611 } 16612 ; 16613 proto.appended = function(elems) { 16614 var items = this.addItems(elems); 16615 if (!items.length) { 16616 return 16617 } 16618 this.layoutItems(items, true); 16619 this.reveal(items) 16620 } 16621 ; 16622 proto.prepended = function(elems) { 16623 var items = this._itemize(elems); 16624 if (!items.length) { 16625 return 16626 } 16627 var previousItems = this.items.slice(0); 16628 this.items = items.concat(previousItems); 16629 this._resetLayout(); 16630 this._manageStamps(); 16631 this.layoutItems(items, true); 16632 this.reveal(items); 16633 this.layoutItems(previousItems) 16634 } 16635 ; 16636 proto.reveal = function(items) { 16637 this._emitCompleteOnItems('reveal', items); 16638 if (!items || !items.length) { 16639 return 16640 } 16641 var stagger = this.updateStagger(); 16642 items.forEach(function(item, i) { 16643 item.stagger(i * stagger); 16644 item.reveal() 16645 }) 16646 } 16647 ; 16648 proto.hide = function(items) { 16649 this._emitCompleteOnItems('hide', items); 16650 if (!items || !items.length) { 16651 return 16652 } 16653 var stagger = this.updateStagger();
16654 items.forEach(function(item, i) { 16655 item.stagger(i * stagger); 16656 item.hide() 16657 }) 16658 } 16659 ; 16660 proto.revealItemElements = function(elems) { 16661 var items = this.getItems(elems); 16662 this.reveal(items) 16663 } 16664 ; 16665 proto.hideItemElements = function(elems) { 16666 var items = this.getItems(elems); 16667 this.hide(items) 16668 } 16669 ; 16670 proto.getItem = function(elem) { 16671 for (var i = 0; i < this.items.length; i++) { 16672 var item = this.items[i]; 16673 if (item.element == elem) { 16674 return item 16675 } 16676 } 16677 } 16678 ; 16679 proto.getItems = function(elems) { 16680 elems = utils.makeArray(elems); 16681 var items = []; 16682 elems.forEach(function(elem) { 16683 var item = this.getItem(elem); 16684 if (item) { 16685 items.push(item) 16686 } 16687 }, this); 16688 return items 16689 } 16690 ; 16691 proto.remove = function(elems) { 16692 var removeItems = this.getItems(elems); 16693 this._emitCompleteOnItems('remove', removeItems); 16694 if (!removeItems || !removeItems.length) { 16695 return 16696 } 16697 removeItems.forEach(function(item) { 16698 item.remove(); 16699 utils.removeFrom(this.items, item) 16700 }, this) 16701 } 16702 ; 16703 proto.destroy = function() { 16704 var style = this.element.style; 16705 style.height = ''; 16706 style.position = ''; 16707 style.width = ''; 16708 this.items.forEach(function(item) { 16709 item.destroy() 16710 }); 16711 this.unbindResize(); 16712 var id = this.element.outlayerGUID; 16713 delete instances[id]; 16714 delete this.element.outlayerGUID; 16715 if (jQuery) { 16716 jQuery.removeData(this.element, this.constructor.namespace) 16717 } 16718 } 16719 ; 16720 Outlayer.data = function(elem) { 16721 elem = utils.getQueryElement(elem); 16722 var id = elem && elem.outlayerGUID; 16723 return id && instances[id] 16724 } 16725 ; 16726 Outlayer.create = function(namespace, options) { 16727 var Layout = subclass(Outlayer); 16728 Layout.defaults = utils.extend({}, Outlayer.defaults); 16729 utils.extend(Layout.defaults, options); 16730 Layout.compatOptions = utils.extend({}, Outlayer.compatOptions); 16731 Layout.namespace = namespace; 16732 Layout.data = Outlayer.data; 16733 Layout.Item = subclass(Item); 16734 utils.htmlInit(Layout, namespace); 16735 if (jQuery && jQuery.bridget) { 16736 jQuery.bridget(namespace, Layout) 16737 } 16738 return Layout 16739 } 16740 ; 16741 function subclass(Parent) { 16742 function SubClass() { 16743 Parent.apply(this, arguments) 16744 } 16745 SubClass.prototype = Object.create(Parent.prototype); 16746 SubClass.prototype.constructor = SubClass; 16747 return SubClass 16748 } 16749 var msUnits = { 16750 ms: 1, 16751 s: 1000 16752 }; 16753 function getMilliseconds(time) { 16754 if (typeof time == 'number') { 16755 return time 16756 } 16757 var matches = time.match(/(^\d*\.?\d*)(\w*)/); 16758 var num = matches && matches[1]; 16759 var unit = matches && matches[2]; 16760 if (!num.length) { 16761 return 0 16762 } 16763 num = parseFloat(num); 16764 var mult = msUnits[unit] || 1; 16765 return num * mult 16766 } 16767 Outlayer.Item = Item; 16768 return Outlayer 16769})); 16770(function(window, factory) { 16771 if (typeof define == 'function' && define.amd) { 16772 define(['outlayer/outlayer', 'get-size/get-size'], factory) 16773 } else if (typeof module == 'object' && module.exports) { 16774 module.exports = factory(require('outlayer'), require('get-size')) 16775 } else { 16776 window.Masonry = factory(window.Outlayer, window.getSize) 16777 } 16778}(window, function factory(Outlayer, getSize) { 16779 var Masonry = Outlayer.create('masonry');
16780 Masonry.compatOptions.fitWidth = 'isFitWidth'; 16781 var proto = Masonry.prototype; 16782 proto._resetLayout = function() { 16783 this.getSize(); 16784 this._getMeasurement('columnWidth', 'outerWidth'); 16785 this._getMeasurement('gutter', 'outerWidth'); 16786 this.measureColumns(); 16787 this.colYs = []; 16788 for (var i = 0; i < this.cols; i++) { 16789 this.colYs.push(0) 16790 } 16791 this.maxY = 0; 16792 this.horizontalColIndex = 0 16793 } 16794 ; 16795 proto.measureColumns = function() { 16796 this.getContainerWidth(); 16797 if (!this.columnWidth) { 16798 var firstItem = this.items[0]; 16799 var firstItemElem = firstItem && firstItem.element; 16800 this.columnWidth = firstItemElem && getSize(firstItemElem).outerWidth || this.containerWidth 16801 } 16802 var columnWidth = this.columnWidth += this.gutter; 16803 var containerWidth = this.containerWidth + this.gutter; 16804 var cols = containerWidth / columnWidth; 16805 var excess = columnWidth - containerWidth % columnWidth; 16806 var mathMethod = excess && excess < 1 ? 'round' : 'floor'; 16807 cols = Math[mathMethod](cols); 16808 this.cols = Math.max(cols, 1) 16809 } 16810 ; 16811 proto.getContainerWidth = function() { 16812 var isFitWidth = this._getOption('fitWidth'); 16813 var container = isFitWidth ? this.element.parentNode : this.element; 16814 var size = getSize(container); 16815 this.containerWidth = size && size.innerWidth 16816 } 16817 ; 16818 proto._getItemLayoutPosition = function(item) { 16819 item.getSize(); 16820 var remainder = item.size.outerWidth % this.columnWidth; 16821 var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil'; 16822 var colSpan = Math[mathMethod](item.size.outerWidth / this.columnWidth); 16823 colSpan = Math.min(colSpan, this.cols); 16824 var colPosMethod = this.options.horizontalOrder ? '_getHorizontalColPosition' : '_getTopColPosition'; 16825 var colPosition = this[colPosMethod](colSpan, item); 16826 var position = { 16827 x: this.columnWidth * colPosition.col, 16828 y: colPosition.y 16829 }; 16830 var setHeight = colPosition.y + item.size.outerHeight; 16831 var setMax = colSpan + colPosition.col; 16832 for (var i = colPosition.col; i < setMax; i++) { 16833 this.colYs[i] = setHeight 16834 } 16835 return position 16836 } 16837 ; 16838 proto._getTopColPosition = function(colSpan) { 16839 var colGroup = this._getTopColGroup(colSpan); 16840 var minimumY = Math.min.apply(Math, colGroup); 16841 return { 16842 col: colGroup.indexOf(minimumY), 16843 y: minimumY, 16844 } 16845 } 16846 ; 16847 proto._getTopColGroup = function(colSpan) { 16848 if (colSpan < 2) { 16849 return this.colYs 16850 } 16851 var colGroup = []; 16852 var groupCount = this.cols + 1 - colSpan; 16853 for (var i = 0; i < groupCount; i++) { 16854 colGroup[i] = this._getColGroupY(i, colSpan) 16855 } 16856 return colGroup 16857 } 16858 ; 16859 proto._getColGroupY = function(col, colSpan) { 16860 if (colSpan < 2) { 16861 return this.colYs[col] 16862 } 16863 var groupColYs = this.colYs.slice(col, col + colSpan); 16864 return Math.max.apply(Math, groupColYs) 16865 } 16866 ; 16867 proto._getHorizontalColPosition = function(colSpan, item) { 16868 var col = this.horizontalColIndex % this.cols; 16869 var isOver = colSpan > 1 && col + colSpan > this.cols; 16870 col = isOver ? 0 : col; 16871 var hasSize = item.size.outerWidth && item.size.outerHeight; 16872 this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex; 16873 return { 16874 col: col, 16875 y: this._getColGroupY(col, colSpan), 16876 } 16877 } 16878 ; 16879 proto._manageStamp = function(stamp) { 16880 var stampSize = getSize(stamp); 16881 var offset = this._getElementOffset(stamp); 16882 var isOriginLeft = this._getOption('originLeft'); 16883 var firstX = isOriginLeft ? offset.left : offset.right; 16884 var lastX = firstX + stampSize.outerWidth; 16885 var firstCol = Math.floor(firstX / this.columnWidth); 16886 firstCol = Math.max(0, firstCol); 16887 var lastCol = Math.floor(lastX / this.columnWidth); 16888 lastCol -= lastX % this.columnWidth ? 0 : 1; 16889 lastCol = Math.min(this.cols - 1, lastCol); 16890 var isOriginTop = this._getOption('originTop'); 16891 var stampMaxY = (isOriginTop ? offset.top : offset.bottom) + stampSize.outerHeight; 16892 for (var i = firstCol; i <= lastCol; i++) { 16893 this.colYs[i] = Math.max(stampMaxY, this.colYs[i]) 16894 } 16895 } 16896 ; 16897 proto._getContainerSize = function() { 16898 this.maxY = Math.max.apply(Math, this.colYs); 16899 var size = { 16900 height: this.maxY 16901 }; 16902 if (this._getOption('fitWidth')) { 16903 size.width = this._getContainerFitWidth() 16904 } 16905 return size 16906 } 16907 ; 16908 proto._getContainerFitWidth = function() { 16909 var unusedCols = 0; 16910 var i = this.cols; 16911 while (--i) { 16912 if (this.colYs[i] !== 0) { 16913 break 16914 } 16915 unusedCols++ 16916 } 16917 return (this.cols - unusedCols) * this.columnWidth - this.gutter 16918 } 16919 ; 16920 proto.needsResizeLayout = function() { 16921 var previousWidth = this.containerWidth; 16922 this.getContainerWidth(); 16923 return previousWidth != this.containerWidth 16924 } 16925 ; 16926 return Masonry 16927})); 16928/*P:1560.331*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.