1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { 40/******/ configurable: false, 41/******/ enumerable: true, 42/******/ get: getter 43/******/ }); 44/******/ } 45/******/ }; 46/******/ 47/******/ // getDefaultExport function for compatibility with non-harmony modules 48/******/ __webpack_require__.n = function(module) { 49/******/ var getter = module && module.__esModule ? 50/******/ function getDefault() { return module['default']; } : 51/******/ function getModuleExports() { return module; }; 52/******/ __webpack_require__.d(getter, 'a', getter); 53/******/ return getter; 54/******/ }; 55/******/ 56/******/ // Object.prototype.hasOwnProperty.call 57/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 58/******/ 59/******/ // __webpack_public_path__ 60/******/ __webpack_require__.p = ""; 61/******/ 62/******/ // Load entry module and return exports 63/******/ return __webpack_require__(__webpack_require__.s = 58); 64/******/ }) 65/************************************************************************/ 66/******/ ([ 67/* 0 */ 68/***/ (function(module, exports, __webpack_require__) { 69 70var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 71 * jQuery JavaScript Library v1.12.4 72 * http://jquery.com/ 73 * 74 * Includes Sizzle.js 75 * http://sizzlejs.com/ 76 * 77 * Copyright jQuery Foundation and other contributors 78 * Released under the MIT license 79 * http://jquery.org/license 80 * 81 * Date: 2016-05-20T17:17Z 82 */ 83 84(function (global, factory) { 85 86 if (typeof module === "object" && typeof module.exports === "object") { 87 // For CommonJS and CommonJS-like environments where a proper `window` 88 // is present, execute the factory and get jQuery. 89 // For environments that do not have a `window` with a `document` 90 // (such as Node.js), expose a factory as module.exports. 91 // This accentuates the need for the creation of a real `window`. 92 // e.g. var jQuery = require("jquery")(window); 93 // See ticket #14549 for more info. 94 module.exports = global.document ? factory(global, true) : function (w) { 95 if (!w.document) { 96 throw new Error("jQuery requires a window with a document"); 97 } 98 return factory(w); 99 }; 100 } else { 101 factory(global); 102 } 103 104 // Pass this if window is not defined yet 105})(typeof window !== "undefined" ? window : this, function (window, noGlobal) { 106 107 // Support: Firefox 18+ 108 // Can't be in strict mode, several libs including ASP.NET trace 109 // the stack via arguments.caller.callee and Firefox dies if
vendor: 4,159 bytes, lines 110-294
110 // you try to trace through "use strict" call chains. (#13335) 111 //"use strict"; 112 var deletedIds = []; 113 114 var document = window.document; 115 116 var slice = deletedIds.slice; 117 118 var concat = deletedIds.concat; 119 120 var push = deletedIds.push; 121 122 var indexOf = deletedIds.indexOf; 123 124 var class2type = {}; 125 126 var toString = class2type.toString; 127 128 var hasOwn = class2type.hasOwnProperty; 129 130 var support = {}; 131 132 var version = "1.12.4", 133 134 135 // Define a local copy of jQuery 136 jQuery = function (selector, context) { 137 138 // The jQuery object is actually just the init constructor 'enhanced' 139 // Need init if jQuery is called (just allow error to be thrown if not included) 140 return new jQuery.fn.init(selector, context); 141 }, 142 143 144 // Support: Android<4.1, IE<9 145 // Make sure we trim BOM and NBSP 146 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 147 148 149 // Matches dashed string for camelizing 150 rmsPrefix = /^-ms-/, 151 rdashAlpha = /-([\da-z])/gi, 152 153 154 // Used by jQuery.camelCase as callback to replace() 155 fcamelCase = function (all, letter) { 156 return letter.toUpperCase(); 157 }; 158 159 jQuery.fn = jQuery.prototype = { 160 161 // The current version of jQuery being used 162 jquery: version, 163 164 constructor: jQuery, 165 166 // Start with an empty selector 167 selector: "", 168 169 // The default length of a jQuery object is 0 170 length: 0, 171 172 toArray: function () { 173 return slice.call(this); 174 }, 175 176 // Get the Nth element in the matched element set OR 177 // Get the whole matched element set as a clean array 178 get: function (num) { 179 return num != null ? 180 181 // Return just the one element from the set 182 num < 0 ? this[num + this.length] : this[num] : 183 184 // Return all the elements in a clean array 185 slice.call(this); 186 }, 187 188 // Take an array of elements and push it onto the stack 189 // (returning the new matched element set) 190 pushStack: function (elems) { 191 192 // Build a new jQuery matched element set 193 var ret = jQuery.merge(this.constructor(), elems); 194 195 // Add the old object onto the stack (as a reference) 196 ret.prevObject = this; 197 ret.context = this.context; 198 199 // Return the newly-formed element set 200 return ret; 201 }, 202 203 // Execute a callback for every element in the matched set. 204 each: function (callback) { 205 return jQuery.each(this, callback); 206 }, 207 208 map: function (callback) { 209 return this.pushStack(jQuery.map(this, function (elem, i) { 210 return callback.call(elem, i, elem); 211 })); 212 }, 213 214 slice: function () { 215 return this.pushStack(slice.apply(this, arguments)); 216 }, 217 218 first: function () { 219 return this.eq(0); 220 }, 221 222 last: function () { 223 return this.eq(-1); 224 }, 225 226 eq: function (i) { 227 var len = this.length, 228 j = +i + (i < 0 ? len : 0); 229 return this.pushStack(j >= 0 && j < len ? [this[j]] : []); 230 }, 231 232 end: function () { 233 return this.prevObject || this.constructor(); 234 }, 235 236 // For internal use only. 237 // Behaves like an Array's method, not like a jQuery method. 238 push: push, 239 sort: deletedIds.sort, 240 splice: deletedIds.splice 241 }; 242 243 jQuery.extend = jQuery.fn.extend = function () { 244 var src, 245 copyIsArray, 246 copy, 247 name, 248 options, 249 clone, 250 target = arguments[0] || {}, 251 i = 1, 252 length = arguments.length, 253 deep = false; 254 255 // Handle a deep copy situation 256 if (typeof target === "boolean") { 257 deep = target; 258 259 // skip the boolean and the target 260 target = arguments[i] || {}; 261 i++; 262 } 263 264 // Handle case when target is a string or something (possible in deep copy) 265 if (typeof target !== "object" && !jQuery.isFunction(target)) { 266 target = {}; 267 } 268 269 // extend jQuery itself if only one argument is passed 270 if (i === length) { 271 target = this; 272 i--; 273 } 274 275 for (; i < length; i++) { 276 277 // Only deal with non-null/undefined values 278 if ((options = arguments[i]) != null) { 279 280 // Extend the base object 281 for (name in options) { 282 src = target[name]; 283 copy = options[name]; 284 285 // Prevent never-ending loop 286 if (target === copy) { 287 continue; 288 } 289 290 // Recurse if we're merging plain objects or arrays 291 if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) { 292 293 if (copyIsArray) { 294 copyIsArray = false;
vendor: 8,553 bytes, lines 295-636
295 clone = src && jQuery.isArray(src) ? src : []; 296 } else { 297 clone = src && jQuery.isPlainObject(src) ? src : {}; 298 } 299 300 // Never move original objects, clone them 301 target[name] = jQuery.extend(deep, clone, copy); 302 303 // Don't bring in undefined values 304 } else if (copy !== undefined) { 305 target[name] = copy; 306 } 307 } 308 } 309 } 310 311 // Return the modified object 312 return target; 313 }; 314 315 jQuery.extend({ 316 317 // Unique for each copy of jQuery on the page 318 expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""), 319 320 // Assume jQuery is ready without the ready module 321 isReady: true, 322 323 error: function (msg) { 324 throw new Error(msg); 325 }, 326 327 noop: function () {}, 328 329 // See test/unit/core.js for details concerning isFunction. 330 // Since version 1.3, DOM methods and functions like alert 331 // aren't supported. They return false on IE (#2968). 332 isFunction: function (obj) { 333 return jQuery.type(obj) === "function"; 334 }, 335 336 isArray: Array.isArray || function (obj) { 337 return jQuery.type(obj) === "array"; 338 }, 339 340 isWindow: function (obj) { 341 /* jshint eqeqeq: false */ 342 return obj != null && obj == obj.window; 343 }, 344 345 isNumeric: function (obj) { 346 347 // parseFloat NaNs numeric-cast false positives (null|true|false|"") 348 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 349 // subtraction forces infinities to NaN 350 // adding 1 corrects loss of precision from parseFloat (#15100) 351 var realStringObj = obj && obj.toString(); 352 return !jQuery.isArray(obj) && realStringObj - parseFloat(realStringObj) + 1 >= 0; 353 }, 354 355 isEmptyObject: function (obj) { 356 var name; 357 for (name in obj) { 358 return false; 359 } 360 return true; 361 }, 362 363 isPlainObject: function (obj) { 364 var key; 365 366 // Must be an Object. 367 // Because of IE, we also have to check the presence of the constructor property. 368 // Make sure that DOM nodes and window objects don't pass through, as well 369 if (!obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) { 370 return false; 371 } 372 373 try { 374 375 // Not own constructor property must be Object 376 if (obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) { 377 return false; 378 } 379 } catch (e) { 380 381 // IE8,9 Will throw exceptions on certain host objects #9897 382 return false; 383 } 384 385 // Support: IE<9 386 // Handle iteration over inherited properties before own properties. 387 if (!support.ownFirst) { 388 for (key in obj) { 389 return hasOwn.call(obj, key); 390 } 391 } 392 393 // Own properties are enumerated firstly, so to speed up, 394 // if last one is own, then all properties are own. 395 for (key in obj) {} 396 397 return key === undefined || hasOwn.call(obj, key); 398 }, 399 400 type: function (obj) { 401 if (obj == null) { 402 return obj + ""; 403 } 404 return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj; 405 }, 406 407 // Workarounds based on findings by Jim Driscoll 408 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context 409 globalEval: function (data) { 410 if (data && jQuery.trim(data)) { 411 412 // We use execScript on Internet Explorer 413 // We use an anonymous function so that context is window 414 // rather than jQuery in Firefox 415 (window.execScript || function (data) { 416 window["eval"].call(window, data); // jscs:ignore requireDotNotation 417 })(data); 418 } 419 }, 420 421 // Convert dashed to camelCase; used by the css and data modules 422 // Microsoft forgot to hump their vendor prefix (#9572) 423 camelCase: function (string) { 424 return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase); 425 }, 426 427 nodeName: function (elem, name) { 428 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 429 }, 430 431 each: function (obj, callback) { 432 var length, 433 i = 0; 434 435 if (isArrayLike(obj)) { 436 length = obj.length; 437 for (; i < length; i++) { 438 if (callback.call(obj[i], i, obj[i]) === false) { 439 break; 440 } 441 } 442 } else { 443 for (i in obj) { 444 if (callback.call(obj[i], i, obj[i]) === false) { 445 break; 446 } 447 } 448 } 449 450 return obj; 451 }, 452 453 // Support: Android<4.1, IE<9 454 trim: function (text) { 455 return text == null ? "" : (text + "").replace(rtrim, ""); 456 }, 457 458 // results is for internal usage only 459 makeArray: function (arr, results) { 460 var ret = results || []; 461 462 if (arr != null) { 463 if (isArrayLike(Object(arr))) { 464 jQuery.merge(ret, typeof arr === "string" ? [arr] : arr); 465 } else { 466 push.call(ret, arr); 467 } 468 } 469 470 return ret; 471 }, 472 473 inArray: function (elem, arr, i) { 474 var len; 475 476 if (arr) { 477 if (indexOf) { 478 return indexOf.call(arr, elem, i); 479 } 480 481 len = arr.length; 482 i = i ? i < 0 ? Math.max(0, len + i) : i : 0; 483 484 for (; i < len; i++) { 485 486 // Skip accessing in sparse arrays 487 if (i in arr && arr[i] === elem) { 488 return i; 489 } 490 } 491 } 492 493 return -1; 494 }, 495 496 merge: function (first, second) { 497 var len = +second.length, 498 j = 0, 499 i = first.length; 500 501 while (j < len) { 502 first[i++] = second[j++]; 503 } 504 505 // Support: IE<9 506 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) 507 if (len !== len) { 508 while (second[j] !== undefined) { 509 first[i++] = second[j++]; 510 } 511 } 512 513 first.length = i; 514 515 return first; 516 }, 517 518 grep: function (elems, callback, invert) { 519 var callbackInverse, 520 matches = [], 521 i = 0, 522 length = elems.length, 523 callbackExpect = !invert; 524 525 // Go through the array, only saving the items 526 // that pass the validator function 527 for (; i < length; i++) { 528 callbackInverse = !callback(elems[i], i); 529 if (callbackInverse !== callbackExpect) { 530 matches.push(elems[i]); 531 } 532 } 533 534 return matches; 535 }, 536 537 // arg is for internal usage only 538 map: function (elems, callback, arg) { 539 var length, 540 value, 541 i = 0, 542 ret = []; 543 544 // Go through the array, translating each of the items to their new values 545 if (isArrayLike(elems)) { 546 length = elems.length; 547 for (; i < length; i++) { 548 value = callback(elems[i], i, arg); 549 550 if (value != null) { 551 ret.push(value); 552 } 553 } 554 555 // Go through every key on the object, 556 } else { 557 for (i in elems) { 558 value = callback(elems[i], i, arg); 559 560 if (value != null) { 561 ret.push(value); 562 } 563 } 564 } 565 566 // Flatten any nested arrays 567 return concat.apply([], ret); 568 }, 569 570 // A global GUID counter for objects 571 guid: 1, 572 573 // Bind a function to a context, optionally partially applying any 574 // arguments. 575 proxy: function (fn, context) { 576 var args, proxy, tmp; 577 578 if (typeof context === "string") { 579 tmp = fn[context]; 580 context = fn; 581 fn = tmp; 582 } 583 584 // Quick check to determine if target is callable, in the spec 585 // this throws a TypeError, but we will just return undefined. 586 if (!jQuery.isFunction(fn)) { 587 return undefined; 588 } 589 590 // Simulated bind 591 args = slice.call(arguments, 2); 592 proxy = function () { 593 return fn.apply(context || this, args.concat(slice.call(arguments))); 594 }; 595 596 // Set the guid of unique handler to the same of original handler, so it can be removed 597 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 598 599 return proxy; 600 }, 601 602 now: function () { 603 return +new Date(); 604 }, 605 606 // jQuery.support is not used in Core but other projects attach their 607 // properties to it so it needs to exist. 608 support: support 609 }); 610 611 // JSHint would error on this code due to the Symbol not being defined in ES5. 612 // Defining this global in .jshintrc would create a danger of using the global 613 // unguarded in another place, it seems safer to just disable JSHint for these 614 // three lines. 615 /* jshint ignore: start */ 616 if (typeof Symbol === "function") { 617 jQuery.fn[Symbol.iterator] = deletedIds[Symbol.iterator]; 618 } 619 /* jshint ignore: end */ 620 621 // Populate the class2type map 622 jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (i, name) { 623 class2type["[object " + name + "]"] = name.toLowerCase(); 624 }); 625 626 function isArrayLike(obj) { 627 628 // Support: iOS 8.2 (not reproducible in simulator) 629 // `in` check used to prevent JIT error (gh-2145) 630 // hasOwn isn't used here due to false negatives 631 // regarding Nodelist length in IE 632 var length = !!obj && "length" in obj && obj.length, 633 type = jQuery.type(obj); 634 635 if (type === "function" || jQuery.isWindow(obj)) { 636 return false;
vendor: 4,770 bytes, lines 637-782
637 } 638 639 return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj; 640 } 641 var Sizzle = 642 /*! 643 * Sizzle CSS Selector Engine v2.2.1 644 * http://sizzlejs.com/ 645 * 646 * Copyright jQuery Foundation and other contributors 647 * Released under the MIT license 648 * http://jquery.org/license 649 * 650 * Date: 2015-10-17 651 */ 652 function (window) { 653 654 var i, 655 support, 656 Expr, 657 getText, 658 isXML, 659 tokenize, 660 compile, 661 select, 662 outermostContext, 663 sortInput, 664 hasDuplicate, 665 666 667 // Local document vars 668 setDocument, 669 document, 670 docElem, 671 documentIsHTML, 672 rbuggyQSA, 673 rbuggyMatches, 674 matches, 675 contains, 676 677 678 // Instance-specific data 679 expando = "sizzle" + 1 * new Date(), 680 preferredDoc = window.document, 681 dirruns = 0, 682 done = 0, 683 classCache = createCache(), 684 tokenCache = createCache(), 685 compilerCache = createCache(), 686 sortOrder = function (a, b) { 687 if (a === b) { 688 hasDuplicate = true; 689 } 690 return 0; 691 }, 692 693 694 // General-purpose constants 695 MAX_NEGATIVE = 1 << 31, 696 697 698 // Instance methods 699 hasOwn = {}.hasOwnProperty, 700 arr = [], 701 pop = arr.pop, 702 push_native = arr.push, 703 push = arr.push, 704 slice = arr.slice, 705 706 // Use a stripped-down indexOf as it's faster than native 707 // http://jsperf.com/thor-indexof-vs-for/5 708 indexOf = function (list, elem) { 709 var i = 0, 710 len = list.length; 711 for (; i < len; i++) { 712 if (list[i] === elem) { 713 return i; 714 } 715 } 716 return -1; 717 }, 718 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 719 720 721 // Regular expressions 722 723 // http://www.w3.org/TR/css3-selectors/#whitespace 724 whitespace = "[\\x20\\t\\r\\n\\f]", 725 726 727 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 728 identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 729 730 731 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 732 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 733 // Operator (capture 2) 734 "*([*^$|!~]?=)" + whitespace + 735 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 736 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", 737 pseudos = ":(" + identifier + ")(?:\\((" + 738 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 739 // 1. quoted (capture 3; capture 4 or capture 5) 740 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 741 // 2. simple (capture 6) 742 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 743 // 3. anything else (capture 2) 744 ".*" + ")\\)|)", 745 746 747 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 748 rwhitespace = new RegExp(whitespace + "+", "g"), 749 rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), 750 rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), 751 rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), 752 rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"), 753 rpseudo = new RegExp(pseudos), 754 ridentifier = new RegExp("^" + identifier + "$"), 755 matchExpr = { 756 "ID": new RegExp("^#(" + identifier + ")"), 757 "CLASS": new RegExp("^\\.(" + identifier + ")"), 758 "TAG": new RegExp("^(" + identifier + "|[*])"), 759 "ATTR": new RegExp("^" + attributes), 760 "PSEUDO": new RegExp("^" + pseudos), 761 "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"), 762 "bool": new RegExp("^(?:" + booleans + ")$", "i"), 763 // For use in libraries implementing .is() 764 // We use this for POS matching in `select` 765 "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i") 766 }, 767 rinputs = /^(?:input|select|textarea|button)$/i, 768 rheader = /^h\d$/i, 769 rnative = /^[^{]+\{\s*\[native \w/, 770 771 772 // Easily-parseable/retrievable ID or TAG or CLASS selectors 773 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 774 rsibling = /[+~]/, 775 rescape = /'|\\/g, 776 777 778 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 779 runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"), 780 funescape = function (_, escaped, escapedWhitespace) { 781 var high = "0x" + escaped - 0x10000; 782 // NaN means non-codepoint
783 // Support: Firefox<24 784 // Workaround erroneous numeric interpretation of +"0x" 785 return high !== high || escapedWhitespace ? escaped : high < 0 ? 786 // BMP codepoint 787 String.fromCharCode(high + 0x10000) : 788 // Supplemental Plane codepoint (surrogate pair) 789 String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00); 790 }, 791 792 793 // Used for iframes 794 // See setDocument() 795 // Removing the function wrapper causes a "Permission Denied" 796 // error in IE 797 unloadHandler = function () { 798 setDocument(); 799 }; 800 801 // Optimize for push.apply( _, NodeList ) 802 try { 803 push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes); 804 // Support: Android<4.0 805 // Detect silently failing push.apply 806 arr[preferredDoc.childNodes.length].nodeType; 807 } catch (e) { 808 push = { apply: arr.length ? 809 810 // Leverage slice if possible 811 function (target, els) { 812 push_native.apply(target, slice.call(els)); 813 } : 814 815 // Support: IE<9 816 // Otherwise append directly 817 function (target, els) { 818 var j = target.length, 819 i = 0; 820 // Can't trust NodeList.length 821 while (target[j++] = els[i++]) {} 822 target.length = j - 1; 823 } 824 }; 825 } 826 827 function Sizzle(selector, context, results, seed) { 828 var m, 829 i, 830 elem, 831 nid, 832 nidselect, 833 match, 834 groups, 835 newSelector, 836 newContext = context && context.ownerDocument, 837 838 839 // nodeType defaults to 9, since context defaults to document 840 nodeType = context ? context.nodeType : 9; 841 842 results = results || []; 843 844 // Return early from calls with invalid selector or context 845 if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) { 846 847 return results; 848 } 849 850 // Try to shortcut find operations (as opposed to filters) in HTML documents 851 if (!seed) { 852 853 if ((context ? context.ownerDocument || context : preferredDoc) !== document) { 854 setDocument(context); 855 } 856 context = context || document; 857 858 if (documentIsHTML) { 859 860 // If the selector is sufficiently simple, try using a "get*By*" DOM method 861 // (excepting DocumentFragment context, where the methods don't exist) 862 if (nodeType !== 11 && (match = rquickExpr.exec(selector))) { 863 864 // ID selector 865 if (m = match[1]) { 866 867 // Document context 868 if (nodeType === 9) { 869 if (elem = context.getElementById(m)) { 870 871 // Support: IE, Opera, Webkit 872 // TODO: identify versions 873 // getElementById can match elements by name instead of ID 874 if (elem.id === m) { 875 results.push(elem); 876 return results; 877 } 878 } else { 879 return results; 880 } 881 882 // Element context 883 } else { 884 885 // Support: IE, Opera, Webkit 886 // TODO: identify versions 887 // getElementById can match elements by name instead of ID 888 if (newContext && (elem = newContext.getElementById(m)) && contains(context, elem) && elem.id === m) { 889 890 results.push(elem); 891 return results; 892 } 893 } 894 895 // Type selector 896 } else if (match[2]) { 897 push.apply(results, context.getElementsByTagName(selector)); 898 return results; 899 900 // Class selector 901 } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) { 902 903 push.apply(results, context.getElementsByClassName(m)); 904 return results; 905 } 906 } 907 908 // Take advantage of querySelectorAll 909 if (support.qsa && !compilerCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) { 910 911 if (nodeType !== 1) { 912 newContext = context; 913 newSelector = selector; 914 915 // qSA looks outside Element context, which is not what we want 916 // Thanks to Andrew Dupont for this workaround technique 917 // Support: IE <=8 918 // Exclude object elements 919 } else if (context.nodeName.toLowerCase() !== "object") { 920 921 // Capture the context ID, setting it first if necessary 922 if (nid = context.getAttribute("id")) { 923 nid = nid.replace(rescape, "\\$&"); 924 } else { 925 context.setAttribute("id", nid = expando); 926 } 927 928 // Prefix every selector in the list 929 groups = tokenize(selector); 930 i = groups.length; 931 nidselect = ridentifier.test(nid) ? "#" + nid : "[id='" + nid + "']"; 932 while (i--) { 933 groups[i] = nidselect + " " + toSelector(groups[i]); 934 } 935 newSelector = groups.join(","); 936 937 // Expand context for sibling selectors
vendor: 18,442 bytes, lines 938-1532
938 newContext = rsibling.test(selector) && testContext(context.parentNode) || context; 939 } 940 941 if (newSelector) { 942 try { 943 push.apply(results, newContext.querySelectorAll(newSelector)); 944 return results; 945 } catch (qsaError) {} finally { 946 if (nid === expando) { 947 context.removeAttribute("id"); 948 } 949 } 950 } 951 } 952 } 953 } 954 955 // All others 956 return select(selector.replace(rtrim, "$1"), context, results, seed); 957 } 958 959 /** 960 * Create key-value caches of limited size 961 * @returns {function(string, object)} Returns the Object data after storing it on itself with 962 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 963 * deleting the oldest entry 964 */ 965 function createCache() { 966 var keys = []; 967 968 function cache(key, value) { 969 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 970 if (keys.push(key + " ") > Expr.cacheLength) { 971 // Only keep the most recent entries 972 delete cache[keys.shift()]; 973 } 974 return cache[key + " "] = value; 975 } 976 return cache; 977 } 978 979 /** 980 * Mark a function for special use by Sizzle 981 * @param {Function} fn The function to mark 982 */ 983 function markFunction(fn) { 984 fn[expando] = true; 985 return fn; 986 } 987 988 /** 989 * Support testing using an element 990 * @param {Function} fn Passed the created div and expects a boolean result 991 */ 992 function assert(fn) { 993 var div = document.createElement("div"); 994 995 try { 996 return !!fn(div); 997 } catch (e) { 998 return false; 999 } finally { 1000 // Remove from its parent by default 1001 if (div.parentNode) { 1002 div.parentNode.removeChild(div); 1003 } 1004 // release memory in IE 1005 div = null; 1006 } 1007 } 1008 1009 /** 1010 * Adds the same handler for all of the specified attrs 1011 * @param {String} attrs Pipe-separated list of attributes 1012 * @param {Function} handler The method that will be applied 1013 */ 1014 function addHandle(attrs, handler) { 1015 var arr = attrs.split("|"), 1016 i = arr.length; 1017 1018 while (i--) { 1019 Expr.attrHandle[arr[i]] = handler; 1020 } 1021 } 1022 1023 /** 1024 * Checks document order of two siblings 1025 * @param {Element} a 1026 * @param {Element} b 1027 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 1028 */ 1029 function siblingCheck(a, b) { 1030 var cur = b && a, 1031 diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE); 1032 1033 // Use IE sourceIndex if available on both nodes 1034 if (diff) { 1035 return diff; 1036 } 1037 1038 // Check if b follows a 1039 if (cur) { 1040 while (cur = cur.nextSibling) { 1041 if (cur === b) { 1042 return -1; 1043 } 1044 } 1045 } 1046 1047 return a ? 1 : -1; 1048 } 1049 1050 /** 1051 * Returns a function to use in pseudos for input types 1052 * @param {String} type 1053 */ 1054 function createInputPseudo(type) { 1055 return function (elem) { 1056 var name = elem.nodeName.toLowerCase(); 1057 return name === "input" && elem.type === type; 1058 }; 1059 } 1060 1061 /** 1062 * Returns a function to use in pseudos for buttons 1063 * @param {String} type 1064 */ 1065 function createButtonPseudo(type) { 1066 return function (elem) { 1067 var name = elem.nodeName.toLowerCase(); 1068 return (name === "input" || name === "button") && elem.type === type; 1069 }; 1070 } 1071 1072 /** 1073 * Returns a function to use in pseudos for positionals 1074 * @param {Function} fn 1075 */ 1076 function createPositionalPseudo(fn) { 1077 return markFunction(function (argument) { 1078 argument = +argument; 1079 return markFunction(function (seed, matches) { 1080 var j, 1081 matchIndexes = fn([], seed.length, argument), 1082 i = matchIndexes.length; 1083 1084 // Match elements found at the specified indexes 1085 while (i--) { 1086 if (seed[j = matchIndexes[i]]) { 1087 seed[j] = !(matches[j] = seed[j]); 1088 } 1089 } 1090 }); 1091 }); 1092 } 1093 1094 /** 1095 * Checks a node for validity as a Sizzle context 1096 * @param {Element|Object=} context 1097 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1098 */ 1099 function testContext(context) { 1100 return context && typeof context.getElementsByTagName !== "undefined" && context; 1101 } 1102 1103 // Expose support vars for convenience 1104 support = Sizzle.support = {}; 1105 1106 /** 1107 * Detects XML nodes 1108 * @param {Element|Object} elem An element or a document 1109 * @returns {Boolean} True iff elem is a non-HTML XML node 1110 */ 1111 isXML = Sizzle.isXML = function (elem) { 1112 // documentElement is verified for cases where it doesn't yet exist 1113 // (such as loading iframes in IE - #4833) 1114 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 1115 return documentElement ? documentElement.nodeName !== "HTML" : false; 1116 }; 1117 1118 /** 1119 * Sets document-related variables once based on the current document 1120 * @param {Element|Object} [doc] An element or document object to use to set the document 1121 * @returns {Object} Returns the current document 1122 */ 1123 setDocument = Sizzle.setDocument = function (node) { 1124 var hasCompare, 1125 parent, 1126 doc = node ? node.ownerDocument || node : preferredDoc; 1127 1128 // Return early if doc is invalid or already selected 1129 if (doc === document || doc.nodeType !== 9 || !doc.documentElement) { 1130 return document; 1131 } 1132 1133 // Update global variables 1134 document = doc; 1135 docElem = document.documentElement; 1136 documentIsHTML = !isXML(document); 1137 1138 // Support: IE 9-11, Edge 1139 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 1140 if ((parent = document.defaultView) && parent.top !== parent) { 1141 // Support: IE 11 1142 if (parent.addEventListener) { 1143 parent.addEventListener("unload", unloadHandler, false); 1144 1145 // Support: IE 9 - 10 only 1146 } else if (parent.attachEvent) { 1147 parent.attachEvent("onunload", unloadHandler); 1148 } 1149 } 1150 1151 /* Attributes 1152 ---------------------------------------------------------------------- */ 1153 1154 // Support: IE<8 1155 // Verify that getAttribute really returns attributes and not properties 1156 // (excepting IE8 booleans) 1157 support.attributes = assert(function (div) { 1158 div.className = "i"; 1159 return !div.getAttribute("className"); 1160 }); 1161 1162 /* getElement(s)By* 1163 ---------------------------------------------------------------------- */ 1164 1165 // Check if getElementsByTagName("*") returns only elements 1166 support.getElementsByTagName = assert(function (div) { 1167 div.appendChild(document.createComment("")); 1168 return !div.getElementsByTagName("*").length; 1169 }); 1170 1171 // Support: IE<9 1172 support.getElementsByClassName = rnative.test(document.getElementsByClassName); 1173 1174 // Support: IE<10 1175 // Check if getElementById returns elements by name 1176 // The broken getElementById methods don't pick up programatically-set names, 1177 // so use a roundabout getElementsByName test 1178 support.getById = assert(function (div) { 1179 docElem.appendChild(div).id = expando; 1180 return !document.getElementsByName || !document.getElementsByName(expando).length; 1181 }); 1182 1183 // ID find and filter 1184 if (support.getById) { 1185 Expr.find["ID"] = function (id, context) { 1186 if (typeof context.getElementById !== "undefined" && documentIsHTML) { 1187 var m = context.getElementById(id); 1188 return m ? [m] : []; 1189 } 1190 }; 1191 Expr.filter["ID"] = function (id) { 1192 var attrId = id.replace(runescape, funescape); 1193 return function (elem) { 1194 return elem.getAttribute("id") === attrId; 1195 }; 1196 }; 1197 } else { 1198 // Support: IE6/7 1199 // getElementById is not reliable as a find shortcut 1200 delete Expr.find["ID"]; 1201 1202 Expr.filter["ID"] = function (id) { 1203 var attrId = id.replace(runescape, funescape); 1204 return function (elem) { 1205 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); 1206 return node && node.value === attrId; 1207 }; 1208 }; 1209 } 1210 1211 // Tag 1212 Expr.find["TAG"] = support.getElementsByTagName ? function (tag, context) { 1213 if (typeof context.getElementsByTagName !== "undefined") { 1214 return context.getElementsByTagName(tag); 1215 1216 // DocumentFragment nodes don't have gEBTN 1217 } else if (support.qsa) { 1218 return context.querySelectorAll(tag); 1219 } 1220 } : function (tag, context) { 1221 var elem, 1222 tmp = [], 1223 i = 0, 1224 1225 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 1226 results = context.getElementsByTagName(tag); 1227 1228 // Filter out possible comments 1229 if (tag === "*") { 1230 while (elem = results[i++]) { 1231 if (elem.nodeType === 1) { 1232 tmp.push(elem); 1233 } 1234 } 1235 1236 return tmp; 1237 } 1238 return results; 1239 }; 1240 1241 // Class 1242 Expr.find["CLASS"] = support.getElementsByClassName && function (className, context) { 1243 if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) { 1244 return context.getElementsByClassName(className); 1245 } 1246 }; 1247 1248 /* QSA/matchesSelector 1249 ---------------------------------------------------------------------- */ 1250 1251 // QSA and matchesSelector support 1252 1253 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 1254 rbuggyMatches = []; 1255 1256 // qSa(:focus) reports false when true (Chrome 21) 1257 // We allow this because of a bug in IE8/9 that throws an error 1258 // whenever `document.activeElement` is accessed on an iframe 1259 // So, we allow :focus to pass through QSA all the time to avoid the IE error 1260 // See http://bugs.jquery.com/ticket/13378 1261 rbuggyQSA = []; 1262 1263 if (support.qsa = rnative.test(document.querySelectorAll)) { 1264 // Build QSA regex 1265 // Regex strategy adopted from Diego Perini 1266 assert(function (div) { 1267 // Select is set to empty string on purpose 1268 // This is to test IE's treatment of not explicitly 1269 // setting a boolean content attribute, 1270 // since its presence should be enough 1271 // http://bugs.jquery.com/ticket/12359 1272 docElem.appendChild(div).innerHTML = "<a id='" + expando + "'></a>" + "<select id='" + expando + "-\r\\' msallowcapture=''>" + "<option selected=''></option></select>"; 1273 1274 // Support: IE8, Opera 11-12.16 1275 // Nothing should be selected when empty strings follow ^= or $= or *= 1276 // The test attribute must be unknown in Opera but "safe" for WinRT 1277 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 1278 if (div.querySelectorAll("[msallowcapture^='']").length) { 1279 rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")"); 1280 } 1281 1282 // Support: IE8 1283 // Boolean attributes and "value" are not treated correctly 1284 if (!div.querySelectorAll("[selected]").length) { 1285 rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")"); 1286 } 1287 1288 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 1289 if (!div.querySelectorAll("[id~=" + expando + "-]").length) { 1290 rbuggyQSA.push("~="); 1291 } 1292 1293 // Webkit/Opera - :checked should return selected option elements 1294 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1295 // IE8 throws error here and will not see later tests 1296 if (!div.querySelectorAll(":checked").length) { 1297 rbuggyQSA.push(":checked"); 1298 } 1299 1300 // Support: Safari 8+, iOS 8+ 1301 // https://bugs.webkit.org/show_bug.cgi?id=136851 1302 // In-page `selector#id sibing-combinator selector` fails 1303 if (!div.querySelectorAll("a#" + expando + "+*").length) { 1304 rbuggyQSA.push(".#.+[+~]"); 1305 } 1306 }); 1307 1308 assert(function (div) { 1309 // Support: Windows 8 Native Apps 1310 // The type and name attributes are restricted during .innerHTML assignment 1311 var input = document.createElement("input"); 1312 input.setAttribute("type", "hidden"); 1313 div.appendChild(input).setAttribute("name", "D"); 1314 1315 // Support: IE8 1316 // Enforce case-sensitivity of name attribute 1317 if (div.querySelectorAll("[name=d]").length) { 1318 rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?="); 1319 } 1320 1321 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 1322 // IE8 throws error here and will not see later tests 1323 if (!div.querySelectorAll(":enabled").length) { 1324 rbuggyQSA.push(":enabled", ":disabled"); 1325 } 1326 1327 // Opera 10-11 does not throw on post-comma invalid pseudos 1328 div.querySelectorAll("*,:x"); 1329 rbuggyQSA.push(",.*:"); 1330 }); 1331 } 1332 1333 if (support.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) { 1334 1335 assert(function (div) { 1336 // Check to see if it's possible to do matchesSelector 1337 // on a disconnected node (IE 9) 1338 support.disconnectedMatch = matches.call(div, "div"); 1339 1340 // This should fail with an exception 1341 // Gecko does not error, returns false instead 1342 matches.call(div, "[s!='']:x"); 1343 rbuggyMatches.push("!=", pseudos); 1344 }); 1345 } 1346 1347 rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")); 1348 rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")); 1349 1350 /* Contains 1351 ---------------------------------------------------------------------- */ 1352 hasCompare = rnative.test(docElem.compareDocumentPosition); 1353 1354 // Element contains another 1355 // Purposefully self-exclusive 1356 // As in, an element does not contain itself 1357 contains = hasCompare || rnative.test(docElem.contains) ? function (a, b) { 1358 var adown = a.nodeType === 9 ? a.documentElement : a, 1359 bup = b && b.parentNode; 1360 return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16)); 1361 } : function (a, b) { 1362 if (b) { 1363 while (b = b.parentNode) { 1364 if (b === a) { 1365 return true; 1366 } 1367 } 1368 } 1369 return false; 1370 }; 1371 1372 /* Sorting 1373 ---------------------------------------------------------------------- */ 1374 1375 // Document order sorting 1376 sortOrder = hasCompare ? function (a, b) { 1377 1378 // Flag for duplicate removal 1379 if (a === b) { 1380 hasDuplicate = true; 1381 return 0; 1382 } 1383 1384 // Sort on method existence if only one input has compareDocumentPosition 1385 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1386 if (compare) { 1387 return compare; 1388 } 1389 1390 // Calculate position if both inputs belong to the same document 1391 compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1392 1393 // Otherwise we know they are disconnected 1394 1; 1395 1396 // Disconnected nodes 1397 if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) { 1398 1399 // Choose the first element that is related to our preferred document 1400 if (a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) { 1401 return -1; 1402 } 1403 if (b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) { 1404 return 1; 1405 } 1406 1407 // Maintain original order 1408 return sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0; 1409 } 1410 1411 return compare & 4 ? -1 : 1; 1412 } : function (a, b) { 1413 // Exit early if the nodes are identical 1414 if (a === b) { 1415 hasDuplicate = true; 1416 return 0; 1417 } 1418 1419 var cur, 1420 i = 0, 1421 aup = a.parentNode, 1422 bup = b.parentNode, 1423 ap = [a], 1424 bp = [b]; 1425 1426 // Parentless nodes are either documents or disconnected 1427 if (!aup || !bup) { 1428 return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0; 1429 1430 // If the nodes are siblings, we can do a quick check 1431 } else if (aup === bup) { 1432 return siblingCheck(a, b); 1433 } 1434 1435 // Otherwise we need full lists of their ancestors for comparison 1436 cur = a; 1437 while (cur = cur.parentNode) { 1438 ap.unshift(cur); 1439 } 1440 cur = b; 1441 while (cur = cur.parentNode) { 1442 bp.unshift(cur); 1443 } 1444 1445 // Walk down the tree looking for a discrepancy 1446 while (ap[i] === bp[i]) { 1447 i++; 1448 } 1449 1450 return i ? 1451 // Do a sibling check if the nodes have a common ancestor 1452 siblingCheck(ap[i], bp[i]) : 1453 1454 // Otherwise nodes in our document sort first 1455 ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; 1456 }; 1457 1458 return document; 1459 }; 1460 1461 Sizzle.matches = function (expr, elements) { 1462 return Sizzle(expr, null, null, elements); 1463 }; 1464 1465 Sizzle.matchesSelector = function (elem, expr) { 1466 // Set document vars if needed 1467 if ((elem.ownerDocument || elem) !== document) { 1468 setDocument(elem); 1469 } 1470 1471 // Make sure that attribute selectors are quoted 1472 expr = expr.replace(rattributeQuotes, "='$1']"); 1473 1474 if (support.matchesSelector && documentIsHTML && !compilerCache[expr + " "] && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) { 1475 1476 try { 1477 var ret = matches.call(elem, expr); 1478 1479 // IE 9's matchesSelector returns false on disconnected nodes 1480 if (ret || support.disconnectedMatch || 1481 // As well, disconnected nodes are said to be in a document 1482 // fragment in IE 9 1483 elem.document && elem.document.nodeType !== 11) { 1484 return ret; 1485 } 1486 } catch (e) {} 1487 } 1488 1489 return Sizzle(expr, document, null, [elem]).length > 0; 1490 }; 1491 1492 Sizzle.contains = function (context, elem) { 1493 // Set document vars if needed 1494 if ((context.ownerDocument || context) !== document) { 1495 setDocument(context); 1496 } 1497 return contains(context, elem); 1498 }; 1499 1500 Sizzle.attr = function (elem, name) { 1501 // Set document vars if needed 1502 if ((elem.ownerDocument || elem) !== document) { 1503 setDocument(elem); 1504 } 1505 1506 var fn = Expr.attrHandle[name.toLowerCase()], 1507 1508 // Don't get fooled by Object.prototype properties (jQuery #13807) 1509 val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined; 1510 1511 return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; 1512 }; 1513 1514 Sizzle.error = function (msg) { 1515 throw new Error("Syntax error, unrecognized expression: " + msg); 1516 }; 1517 1518 /** 1519 * Document sorting and removing duplicates 1520 * @param {ArrayLike} results 1521 */ 1522 Sizzle.uniqueSort = function (results) { 1523 var elem, 1524 duplicates = [], 1525 j = 0, 1526 i = 0; 1527 1528 // Unless we *know* we can detect duplicates, assume their presence 1529 hasDuplicate = !support.detectDuplicates; 1530 sortInput = !support.sortStable && results.slice(0); 1531 results.sort(sortOrder); 1532
vendor: 12,805 bytes, lines 1533-1939
1533 if (hasDuplicate) { 1534 while (elem = results[i++]) { 1535 if (elem === results[i]) { 1536 j = duplicates.push(i); 1537 } 1538 } 1539 while (j--) { 1540 results.splice(duplicates[j], 1); 1541 } 1542 } 1543 1544 // Clear input after sorting to release objects 1545 // See https://github.com/jquery/sizzle/pull/225 1546 sortInput = null; 1547 1548 return results; 1549 }; 1550 1551 /** 1552 * Utility function for retrieving the text value of an array of DOM nodes 1553 * @param {Array|Element} elem 1554 */ 1555 getText = Sizzle.getText = function (elem) { 1556 var node, 1557 ret = "", 1558 i = 0, 1559 nodeType = elem.nodeType; 1560 1561 if (!nodeType) { 1562 // If no nodeType, this is expected to be an array 1563 while (node = elem[i++]) { 1564 // Do not traverse comment nodes 1565 ret += getText(node); 1566 } 1567 } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) { 1568 // Use textContent for elements 1569 // innerText usage removed for consistency of new lines (jQuery #11153) 1570 if (typeof elem.textContent === "string") { 1571 return elem.textContent; 1572 } else { 1573 // Traverse its children 1574 for (elem = elem.firstChild; elem; elem = elem.nextSibling) { 1575 ret += getText(elem); 1576 } 1577 } 1578 } else if (nodeType === 3 || nodeType === 4) { 1579 return elem.nodeValue; 1580 } 1581 // Do not include comment or processing instruction nodes 1582 1583 return ret; 1584 }; 1585 1586 Expr = Sizzle.selectors = { 1587 1588 // Can be adjusted by the user 1589 cacheLength: 50, 1590 1591 createPseudo: markFunction, 1592 1593 match: matchExpr, 1594 1595 attrHandle: {}, 1596 1597 find: {}, 1598 1599 relative: { 1600 ">": { dir: "parentNode", first: true }, 1601 " ": { dir: "parentNode" }, 1602 "+": { dir: "previousSibling", first: true }, 1603 "~": { dir: "previousSibling" } 1604 }, 1605 1606 preFilter: { 1607 "ATTR": function (match) { 1608 match[1] = match[1].replace(runescape, funescape); 1609 1610 // Move the given value to match[3] whether quoted or unquoted 1611 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape); 1612 1613 if (match[2] === "~=") { 1614 match[3] = " " + match[3] + " "; 1615 } 1616 1617 return match.slice(0, 4); 1618 }, 1619 1620 "CHILD": function (match) { 1621 /* matches from matchExpr["CHILD"] 1622 1 type (only|nth|...) 1623 2 what (child|of-type) 1624 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1625 4 xn-component of xn+y argument ([+-]?\d*n|) 1626 5 sign of xn-component 1627 6 x of xn-component 1628 7 sign of y-component 1629 8 y of y-component 1630 */ 1631 match[1] = match[1].toLowerCase(); 1632 1633 if (match[1].slice(0, 3) === "nth") { 1634 // nth-* requires argument 1635 if (!match[3]) { 1636 Sizzle.error(match[0]); 1637 } 1638 1639 // numeric x and y parameters for Expr.filter.CHILD 1640 // remember that false/true cast respectively to 0/1 1641 match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd")); 1642 match[5] = +(match[7] + match[8] || match[3] === "odd"); 1643 1644 // other types prohibit arguments 1645 } else if (match[3]) { 1646 Sizzle.error(match[0]); 1647 } 1648 1649 return match; 1650 }, 1651 1652 "PSEUDO": function (match) { 1653 var excess, 1654 unquoted = !match[6] && match[2]; 1655 1656 if (matchExpr["CHILD"].test(match[0])) { 1657 return null; 1658 } 1659 1660 // Accept quoted arguments as-is 1661 if (match[3]) { 1662 match[2] = match[4] || match[5] || ""; 1663 1664 // Strip excess characters from unquoted arguments 1665 } else if (unquoted && rpseudo.test(unquoted) && ( 1666 // Get excess from tokenize (recursively) 1667 excess = tokenize(unquoted, true)) && ( 1668 // advance to the next closing parenthesis 1669 excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) { 1670 1671 // excess is a negative index 1672 match[0] = match[0].slice(0, excess); 1673 match[2] = unquoted.slice(0, excess); 1674 } 1675 1676 // Return only captures needed by the pseudo filter method (type and argument) 1677 return match.slice(0, 3); 1678 } 1679 }, 1680 1681 filter: { 1682 1683 "TAG": function (nodeNameSelector) { 1684 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); 1685 return nodeNameSelector === "*" ? function () { 1686 return true; 1687 } : function (elem) { 1688 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 1689 }; 1690 }, 1691 1692 "CLASS": function (className) { 1693 var pattern = classCache[className + " "]; 1694 1695 return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function (elem) { 1696 return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""); 1697 }); 1698 }, 1699 1700 "ATTR": function (name, operator, check) { 1701 return function (elem) { 1702 var result = Sizzle.attr(elem, name); 1703 1704 if (result == null) { 1705 return operator === "!="; 1706 } 1707 if (!operator) { 1708 return true; 1709 } 1710 1711 result += ""; 1712 1713 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; 1714 }; 1715 }, 1716 1717 "CHILD": function (type, what, argument, first, last) { 1718 var simple = type.slice(0, 3) !== "nth", 1719 forward = type.slice(-4) !== "last", 1720 ofType = what === "of-type"; 1721 1722 return first === 1 && last === 0 ? 1723 1724 // Shortcut for :nth-*(n) 1725 function (elem) { 1726 return !!elem.parentNode; 1727 } : function (elem, context, xml) { 1728 var cache, 1729 uniqueCache, 1730 outerCache, 1731 node, 1732 nodeIndex, 1733 start, 1734 dir = simple !== forward ? "nextSibling" : "previousSibling", 1735 parent = elem.parentNode, 1736 name = ofType && elem.nodeName.toLowerCase(), 1737 useCache = !xml && !ofType, 1738 diff = false; 1739 1740 if (parent) { 1741 1742 // :(first|last|only)-(child|of-type) 1743 if (simple) { 1744 while (dir) { 1745 node = elem; 1746 while (node = node[dir]) { 1747 if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) { 1748 1749 return false; 1750 } 1751 } 1752 // Reverse direction for :only-* (if we haven't yet done so) 1753 start = dir = type === "only" && !start && "nextSibling"; 1754 } 1755 return true; 1756 } 1757 1758 start = [forward ? parent.firstChild : parent.lastChild]; 1759 1760 // non-xml :nth-child(...) stores cache data on `parent` 1761 if (forward && useCache) { 1762 1763 // Seek `elem` from a previously-cached index 1764 1765 // ...in a gzip-friendly way 1766 node = parent; 1767 outerCache = node[expando] || (node[expando] = {}); 1768 1769 // Support: IE <9 only 1770 // Defend against cloned attroperties (jQuery gh-1709) 1771 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); 1772 1773 cache = uniqueCache[type] || []; 1774 nodeIndex = cache[0] === dirruns && cache[1]; 1775 diff = nodeIndex && cache[2]; 1776 node = nodeIndex && parent.childNodes[nodeIndex]; 1777 1778 while (node = ++nodeIndex && node && node[dir] || ( 1779 1780 // Fallback to seeking `elem` from the start 1781 diff = nodeIndex = 0) || start.pop()) { 1782 1783 // When found, cache indexes on `parent` and break 1784 if (node.nodeType === 1 && ++diff && node === elem) { 1785 uniqueCache[type] = [dirruns, nodeIndex, diff]; 1786 break; 1787 } 1788 } 1789 } else { 1790 // Use previously-cached element index if available 1791 if (useCache) { 1792 // ...in a gzip-friendly way 1793 node = elem; 1794 outerCache = node[expando] || (node[expando] = {}); 1795 1796 // Support: IE <9 only 1797 // Defend against cloned attroperties (jQuery gh-1709) 1798 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); 1799 1800 cache = uniqueCache[type] || []; 1801 nodeIndex = cache[0] === dirruns && cache[1]; 1802 diff = nodeIndex; 1803 } 1804 1805 // xml :nth-child(...) 1806 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 1807 if (diff === false) { 1808 // Use the same loop as above to seek `elem` from the start 1809 while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) { 1810 1811 if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) { 1812 1813 // Cache the index of each encountered element 1814 if (useCache) { 1815 outerCache = node[expando] || (node[expando] = {}); 1816 1817 // Support: IE <9 only 1818 // Defend against cloned attroperties (jQuery gh-1709) 1819 uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); 1820 1821 uniqueCache[type] = [dirruns, diff]; 1822 } 1823 1824 if (node === elem) { 1825 break; 1826 } 1827 } 1828 } 1829 } 1830 } 1831 1832 // Incorporate the offset, then check against cycle size 1833 diff -= last; 1834 return diff === first || diff % first === 0 && diff / first >= 0; 1835 } 1836 }; 1837 }, 1838 1839 "PSEUDO": function (pseudo, argument) { 1840 // pseudo-class names are case-insensitive 1841 // http://www.w3.org/TR/selectors/#pseudo-classes 1842 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 1843 // Remember that setFilters inherits from pseudos 1844 var args, 1845 fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo); 1846 1847 // The user may use createPseudo to indicate that 1848 // arguments are needed to create the filter function 1849 // just as Sizzle does 1850 if (fn[expando]) { 1851 return fn(argument); 1852 } 1853 1854 // But maintain support for old signatures 1855 if (fn.length > 1) { 1856 args = [pseudo, pseudo, "", argument]; 1857 return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) { 1858 var idx, 1859 matched = fn(seed, argument), 1860 i = matched.length; 1861 while (i--) { 1862 idx = indexOf(seed, matched[i]); 1863 seed[idx] = !(matches[idx] = matched[i]); 1864 } 1865 }) : function (elem) { 1866 return fn(elem, 0, args); 1867 }; 1868 } 1869 1870 return fn; 1871 } 1872 }, 1873 1874 pseudos: { 1875 // Potentially complex pseudos 1876 "not": markFunction(function (selector) { 1877 // Trim the selector passed to compile 1878 // to avoid treating leading and trailing 1879 // spaces as combinators 1880 var input = [], 1881 results = [], 1882 matcher = compile(selector.replace(rtrim, "$1")); 1883 1884 return matcher[expando] ? markFunction(function (seed, matches, context, xml) { 1885 var elem, 1886 unmatched = matcher(seed, null, xml, []), 1887 i = seed.length; 1888 1889 // Match elements unmatched by `matcher` 1890 while (i--) { 1891 if (elem = unmatched[i]) { 1892 seed[i] = !(matches[i] = elem); 1893 } 1894 } 1895 }) : function (elem, context, xml) { 1896 input[0] = elem; 1897 matcher(input, null, xml, results); 1898 // Don't keep the element (issue #299) 1899 input[0] = null; 1900 return !results.pop(); 1901 }; 1902 }), 1903 1904 "has": markFunction(function (selector) { 1905 return function (elem) { 1906 return Sizzle(selector, elem).length > 0; 1907 }; 1908 }), 1909 1910 "contains": markFunction(function (text) { 1911 text = text.replace(runescape, funescape); 1912 return function (elem) { 1913 return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1; 1914 }; 1915 }), 1916 1917 // "Whether an element is represented by a :lang() selector 1918 // is based solely on the element's language value 1919 // being equal to the identifier C, 1920 // or beginning with the identifier C immediately followed by "-". 1921 // The matching of C against the element's language value is performed case-insensitively. 1922 // The identifier C does not have to be a valid language name." 1923 // http://www.w3.org/TR/selectors/#lang-pseudo 1924 "lang": markFunction(function (lang) { 1925 // lang value must be a valid identifier 1926 if (!ridentifier.test(lang || "")) { 1927 Sizzle.error("unsupported lang: " + lang); 1928 } 1929 lang = lang.replace(runescape, funescape).toLowerCase(); 1930 return function (elem) { 1931 var elemLang; 1932 do { 1933 if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) { 1934 1935 elemLang = elemLang.toLowerCase(); 1936 return elemLang === lang || elemLang.indexOf(lang + "-") === 0; 1937 } 1938 } while ((elem = elem.parentNode) && elem.nodeType === 1); 1939 return false;
vendor: 4,299 bytes, lines 1940-2093
1940 }; 1941 }), 1942 1943 // Miscellaneous 1944 "target": function (elem) { 1945 var hash = window.location && window.location.hash; 1946 return hash && hash.slice(1) === elem.id; 1947 }, 1948 1949 "root": function (elem) { 1950 return elem === docElem; 1951 }, 1952 1953 "focus": function (elem) { 1954 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 1955 }, 1956 1957 // Boolean properties 1958 "enabled": function (elem) { 1959 return elem.disabled === false; 1960 }, 1961 1962 "disabled": function (elem) { 1963 return elem.disabled === true; 1964 }, 1965 1966 "checked": function (elem) { 1967 // In CSS3, :checked should return both checked and selected elements 1968 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1969 var nodeName = elem.nodeName.toLowerCase(); 1970 return nodeName === "input" && !!elem.checked || nodeName === "option" && !!elem.selected; 1971 }, 1972 1973 "selected": function (elem) { 1974 // Accessing this property makes selected-by-default 1975 // options in Safari work properly 1976 if (elem.parentNode) { 1977 elem.parentNode.selectedIndex; 1978 } 1979 1980 return elem.selected === true; 1981 }, 1982 1983 // Contents 1984 "empty": function (elem) { 1985 // http://www.w3.org/TR/selectors/#empty-pseudo 1986 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 1987 // but not by others (comment: 8; processing instruction: 7; etc.) 1988 // nodeType < 6 works because attributes (2) do not appear as children 1989 for (elem = elem.firstChild; elem; elem = elem.nextSibling) { 1990 if (elem.nodeType < 6) { 1991 return false; 1992 } 1993 } 1994 return true; 1995 }, 1996 1997 "parent": function (elem) { 1998 return !Expr.pseudos["empty"](elem); 1999 }, 2000 2001 // Element/input types 2002 "header": function (elem) { 2003 return rheader.test(elem.nodeName); 2004 }, 2005 2006 "input": function (elem) { 2007 return rinputs.test(elem.nodeName); 2008 }, 2009 2010 "button": function (elem) { 2011 var name = elem.nodeName.toLowerCase(); 2012 return name === "input" && elem.type === "button" || name === "button"; 2013 }, 2014 2015 "text": function (elem) { 2016 var attr; 2017 return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( 2018 2019 // Support: IE<8 2020 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 2021 (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text"); 2022 }, 2023 2024 // Position-in-collection 2025 "first": createPositionalPseudo(function () { 2026 return [0]; 2027 }), 2028 2029 "last": createPositionalPseudo(function (matchIndexes, length) { 2030 return [length - 1]; 2031 }), 2032 2033 "eq": createPositionalPseudo(function (matchIndexes, length, argument) { 2034 return [argument < 0 ? argument + length : argument]; 2035 }), 2036 2037 "even": createPositionalPseudo(function (matchIndexes, length) { 2038 var i = 0; 2039 for (; i < length; i += 2) { 2040 matchIndexes.push(i); 2041 } 2042 return matchIndexes; 2043 }), 2044 2045 "odd": createPositionalPseudo(function (matchIndexes, length) { 2046 var i = 1; 2047 for (; i < length; i += 2) { 2048 matchIndexes.push(i); 2049 } 2050 return matchIndexes; 2051 }), 2052 2053 "lt": createPositionalPseudo(function (matchIndexes, length, argument) { 2054 var i = argument < 0 ? argument + length : argument; 2055 for (; --i >= 0;) { 2056 matchIndexes.push(i); 2057 } 2058 return matchIndexes; 2059 }), 2060 2061 "gt": createPositionalPseudo(function (matchIndexes, length, argument) { 2062 var i = argument < 0 ? argument + length : argument; 2063 for (; ++i < length;) { 2064 matchIndexes.push(i); 2065 } 2066 return matchIndexes; 2067 }) 2068 } 2069 }; 2070 2071 Expr.pseudos["nth"] = Expr.pseudos["eq"]; 2072 2073 // Add button/input type pseudos 2074 for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) { 2075 Expr.pseudos[i] = createInputPseudo(i); 2076 } 2077 for (i in { submit: true, reset: true }) { 2078 Expr.pseudos[i] = createButtonPseudo(i); 2079 } 2080 2081 // Easy API for creating new setFilters 2082 function setFilters() {} 2083 setFilters.prototype = Expr.filters = Expr.pseudos; 2084 Expr.setFilters = new setFilters(); 2085 2086 tokenize = Sizzle.tokenize = function (selector, parseOnly) { 2087 var matched, 2088 match, 2089 tokens, 2090 type, 2091 soFar, 2092 groups, 2093 preFilters,
vendor: 7,182 bytes, lines 2094-2359
2094 cached = tokenCache[selector + " "]; 2095 2096 if (cached) { 2097 return parseOnly ? 0 : cached.slice(0); 2098 } 2099 2100 soFar = selector; 2101 groups = []; 2102 preFilters = Expr.preFilter; 2103 2104 while (soFar) { 2105 2106 // Comma and first run 2107 if (!matched || (match = rcomma.exec(soFar))) { 2108 if (match) { 2109 // Don't consume trailing commas as valid 2110 soFar = soFar.slice(match[0].length) || soFar; 2111 } 2112 groups.push(tokens = []); 2113 } 2114 2115 matched = false; 2116 2117 // Combinators 2118 if (match = rcombinators.exec(soFar)) { 2119 matched = match.shift(); 2120 tokens.push({ 2121 value: matched, 2122 // Cast descendant combinators to space 2123 type: match[0].replace(rtrim, " ") 2124 }); 2125 soFar = soFar.slice(matched.length); 2126 } 2127 2128 // Filters 2129 for (type in Expr.filter) { 2130 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) { 2131 matched = match.shift(); 2132 tokens.push({ 2133 value: matched, 2134 type: type, 2135 matches: match 2136 }); 2137 soFar = soFar.slice(matched.length); 2138 } 2139 } 2140 2141 if (!matched) { 2142 break; 2143 } 2144 } 2145 2146 // Return the length of the invalid excess 2147 // if we're just parsing 2148 // Otherwise, throw an error or return tokens 2149 return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : 2150 // Cache the tokens 2151 tokenCache(selector, groups).slice(0); 2152 }; 2153 2154 function toSelector(tokens) { 2155 var i = 0, 2156 len = tokens.length, 2157 selector = ""; 2158 for (; i < len; i++) { 2159 selector += tokens[i].value; 2160 } 2161 return selector; 2162 } 2163 2164 function addCombinator(matcher, combinator, base) { 2165 var dir = combinator.dir, 2166 checkNonElements = base && dir === "parentNode", 2167 doneName = done++; 2168 2169 return combinator.first ? 2170 // Check against closest ancestor/preceding element 2171 function (elem, context, xml) { 2172 while (elem = elem[dir]) { 2173 if (elem.nodeType === 1 || checkNonElements) { 2174 return matcher(elem, context, xml); 2175 } 2176 } 2177 } : 2178 2179 // Check against all ancestor/preceding elements 2180 function (elem, context, xml) { 2181 var oldCache, 2182 uniqueCache, 2183 outerCache, 2184 newCache = [dirruns, doneName]; 2185 2186 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 2187 if (xml) { 2188 while (elem = elem[dir]) { 2189 if (elem.nodeType === 1 || checkNonElements) { 2190 if (matcher(elem, context, xml)) { 2191 return true; 2192 } 2193 } 2194 } 2195 } else { 2196 while (elem = elem[dir]) { 2197 if (elem.nodeType === 1 || checkNonElements) { 2198 outerCache = elem[expando] || (elem[expando] = {}); 2199 2200 // Support: IE <9 only 2201 // Defend against cloned attroperties (jQuery gh-1709) 2202 uniqueCache = outerCache[elem.uniqueID] || (outerCache[elem.uniqueID] = {}); 2203 2204 if ((oldCache = uniqueCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) { 2205 2206 // Assign to newCache so results back-propagate to previous elements 2207 return newCache[2] = oldCache[2]; 2208 } else { 2209 // Reuse newcache so results back-propagate to previous elements 2210 uniqueCache[dir] = newCache; 2211 2212 // A match means we're done; a fail means we have to keep checking 2213 if (newCache[2] = matcher(elem, context, xml)) { 2214 return true; 2215 } 2216 } 2217 } 2218 } 2219 } 2220 }; 2221 } 2222 2223 function elementMatcher(matchers) { 2224 return matchers.length > 1 ? function (elem, context, xml) { 2225 var i = matchers.length; 2226 while (i--) { 2227 if (!matchers[i](elem, context, xml)) { 2228 return false; 2229 } 2230 } 2231 return true; 2232 } : matchers[0]; 2233 } 2234 2235 function multipleContexts(selector, contexts, results) { 2236 var i = 0, 2237 len = contexts.length; 2238 for (; i < len; i++) { 2239 Sizzle(selector, contexts[i], results); 2240 } 2241 return results; 2242 } 2243 2244 function condense(unmatched, map, filter, context, xml) { 2245 var elem, 2246 newUnmatched = [], 2247 i = 0, 2248 len = unmatched.length, 2249 mapped = map != null; 2250 2251 for (; i < len; i++) { 2252 if (elem = unmatched[i]) { 2253 if (!filter || filter(elem, context, xml)) { 2254 newUnmatched.push(elem); 2255 if (mapped) { 2256 map.push(i); 2257 } 2258 } 2259 } 2260 } 2261 2262 return newUnmatched; 2263 } 2264 2265 function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { 2266 if (postFilter && !postFilter[expando]) { 2267 postFilter = setMatcher(postFilter); 2268 } 2269 if (postFinder && !postFinder[expando]) { 2270 postFinder = setMatcher(postFinder, postSelector); 2271 } 2272 return markFunction(function (seed, results, context, xml) { 2273 var temp, 2274 i, 2275 elem, 2276 preMap = [], 2277 postMap = [], 2278 preexisting = results.length, 2279 2280 2281 // Get initial elements from seed or context 2282 elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []), 2283 2284 2285 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2286 matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, 2287 matcherOut = matcher ? 2288 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 2289 postFinder || (seed ? preFilter : preexisting || postFilter) ? 2290 2291 // ...intermediate processing is necessary 2292 [] : 2293 2294 // ...otherwise use results directly 2295 results : matcherIn; 2296 2297 // Find primary matches 2298 if (matcher) { 2299 matcher(matcherIn, matcherOut, context, xml); 2300 } 2301 2302 // Apply postFilter 2303 if (postFilter) { 2304 temp = condense(matcherOut, postMap); 2305 postFilter(temp, [], context, xml); 2306 2307 // Un-match failing elements by moving them back to matcherIn 2308 i = temp.length; 2309 while (i--) { 2310 if (elem = temp[i]) { 2311 matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem); 2312 } 2313 } 2314 } 2315 2316 if (seed) { 2317 if (postFinder || preFilter) { 2318 if (postFinder) { 2319 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2320 temp = []; 2321 i = matcherOut.length; 2322 while (i--) { 2323 if (elem = matcherOut[i]) { 2324 // Restore matcherIn since elem is not yet a final match 2325 temp.push(matcherIn[i] = elem); 2326 } 2327 } 2328 postFinder(null, matcherOut = [], temp, xml); 2329 } 2330 2331 // Move matched elements from seed to results to keep them synchronized 2332 i = matcherOut.length; 2333 while (i--) { 2334 if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) { 2335 2336 seed[temp] = !(results[temp] = elem); 2337 } 2338 } 2339 } 2340 2341 // Add elements to results, through postFinder if defined 2342 } else { 2343 matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut); 2344 if (postFinder) { 2345 postFinder(null, results, matcherOut, xml); 2346 } else { 2347 push.apply(results, matcherOut); 2348 } 2349 } 2350 }); 2351 } 2352 2353 function matcherFromTokens(tokens) { 2354 var checkContext, 2355 matcher, 2356 j, 2357 len = tokens.length, 2358 leadingRelative = Expr.relative[tokens[0].type], 2359 implicitRelative = leadingRelative || Expr.relative[" "],
vendor: 7,952 bytes, lines 2360-2596
2360 i = leadingRelative ? 1 : 0, 2361 2362 2363 // The foundational matcher ensures that elements are reachable from top-level context(s) 2364 matchContext = addCombinator(function (elem) { 2365 return elem === checkContext; 2366 }, implicitRelative, true), 2367 matchAnyContext = addCombinator(function (elem) { 2368 return indexOf(checkContext, elem) > -1; 2369 }, implicitRelative, true), 2370 matchers = [function (elem, context, xml) { 2371 var ret = !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); 2372 // Avoid hanging onto element (issue #299) 2373 checkContext = null; 2374 return ret; 2375 }]; 2376 2377 for (; i < len; i++) { 2378 if (matcher = Expr.relative[tokens[i].type]) { 2379 matchers = [addCombinator(elementMatcher(matchers), matcher)]; 2380 } else { 2381 matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); 2382 2383 // Return special upon seeing a positional matcher 2384 if (matcher[expando]) { 2385 // Find the next relative operator (if any) for proper handling 2386 j = ++i; 2387 for (; j < len; j++) { 2388 if (Expr.relative[tokens[j].type]) { 2389 break; 2390 } 2391 } 2392 return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector( 2393 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2394 tokens.slice(0, i - 1).concat({ value: tokens[i - 2].type === " " ? "*" : "" })).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens)); 2395 } 2396 matchers.push(matcher); 2397 } 2398 } 2399 2400 return elementMatcher(matchers); 2401 } 2402 2403 function matcherFromGroupMatchers(elementMatchers, setMatchers) { 2404 var bySet = setMatchers.length > 0, 2405 byElement = elementMatchers.length > 0, 2406 superMatcher = function (seed, context, xml, results, outermost) { 2407 var elem, 2408 j, 2409 matcher, 2410 matchedCount = 0, 2411 i = "0", 2412 unmatched = seed && [], 2413 setMatched = [], 2414 contextBackup = outermostContext, 2415 2416 // We must always have either seed elements or outermost context 2417 elems = seed || byElement && Expr.find["TAG"]("*", outermost), 2418 2419 // Use integer dirruns iff this is the outermost matcher 2420 dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, 2421 len = elems.length; 2422 2423 if (outermost) { 2424 outermostContext = context === document || context || outermost; 2425 } 2426 2427 // Add elements passing elementMatchers directly to results 2428 // Support: IE<9, Safari 2429 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 2430 for (; i !== len && (elem = elems[i]) != null; i++) { 2431 if (byElement && elem) { 2432 j = 0; 2433 if (!context && elem.ownerDocument !== document) { 2434 setDocument(elem); 2435 xml = !documentIsHTML; 2436 } 2437 while (matcher = elementMatchers[j++]) { 2438 if (matcher(elem, context || document, xml)) { 2439 results.push(elem); 2440 break; 2441 } 2442 } 2443 if (outermost) { 2444 dirruns = dirrunsUnique; 2445 } 2446 } 2447 2448 // Track unmatched elements for set filters 2449 if (bySet) { 2450 // They will have gone through all possible matchers 2451 if (elem = !matcher && elem) { 2452 matchedCount--; 2453 } 2454 2455 // Lengthen the array for every element, matched or not 2456 if (seed) { 2457 unmatched.push(elem); 2458 } 2459 } 2460 } 2461 2462 // `i` is now the count of elements visited above, and adding it to `matchedCount` 2463 // makes the latter nonnegative. 2464 matchedCount += i; 2465 2466 // Apply set filters to unmatched elements 2467 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 2468 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 2469 // no element matchers and no seed. 2470 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 2471 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 2472 // numerically zero. 2473 if (bySet && i !== matchedCount) { 2474 j = 0; 2475 while (matcher = setMatchers[j++]) { 2476 matcher(unmatched, setMatched, context, xml); 2477 } 2478 2479 if (seed) { 2480 // Reintegrate element matches to eliminate the need for sorting 2481 if (matchedCount > 0) { 2482 while (i--) { 2483 if (!(unmatched[i] || setMatched[i])) { 2484 setMatched[i] = pop.call(results); 2485 } 2486 } 2487 } 2488 2489 // Discard index placeholder values to get only actual matches 2490 setMatched = condense(setMatched); 2491 } 2492 2493 // Add matches to results 2494 push.apply(results, setMatched); 2495 2496 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2497 if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) { 2498 2499 Sizzle.uniqueSort(results); 2500 } 2501 } 2502 2503 // Override manipulation of globals by nested matchers 2504 if (outermost) { 2505 dirruns = dirrunsUnique; 2506 outermostContext = contextBackup; 2507 } 2508 2509 return unmatched; 2510 }; 2511 2512 return bySet ? markFunction(superMatcher) : superMatcher; 2513 } 2514 2515 compile = Sizzle.compile = function (selector, match /* Internal Use Only */) { 2516 var i, 2517 setMatchers = [], 2518 elementMatchers = [], 2519 cached = compilerCache[selector + " "]; 2520 2521 if (!cached) { 2522 // Generate a function of recursive functions that can be used to check each element 2523 if (!match) { 2524 match = tokenize(selector); 2525 } 2526 i = match.length; 2527 while (i--) { 2528 cached = matcherFromTokens(match[i]); 2529 if (cached[expando]) { 2530 setMatchers.push(cached); 2531 } else { 2532 elementMatchers.push(cached); 2533 } 2534 } 2535 2536 // Cache the compiled function 2537 cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); 2538 2539 // Save selector and tokenization 2540 cached.selector = selector; 2541 } 2542 return cached; 2543 }; 2544 2545 /** 2546 * A low-level selection function that works with Sizzle's compiled 2547 * selector functions 2548 * @param {String|Function} selector A selector or a pre-compiled 2549 * selector function built with Sizzle.compile 2550 * @param {Element} context 2551 * @param {Array} [results] 2552 * @param {Array} [seed] A set of elements to match against 2553 */ 2554 select = Sizzle.select = function (selector, context, results, seed) { 2555 var i, 2556 tokens, 2557 token, 2558 type, 2559 find, 2560 compiled = typeof selector === "function" && selector, 2561 match = !seed && tokenize(selector = compiled.selector || selector); 2562 2563 results = results || []; 2564 2565 // Try to minimize operations if there is only one selector in the list and no seed 2566 // (the latter of which guarantees us context) 2567 if (match.length === 1) { 2568 2569 // Reduce context if the leading compound selector is an ID 2570 tokens = match[0] = match[0].slice(0); 2571 if (tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) { 2572 2573 context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0]; 2574 if (!context) { 2575 return results; 2576 2577 // Precompiled matchers will still verify ancestry, so step up a level 2578 } else if (compiled) { 2579 context = context.parentNode; 2580 } 2581 2582 selector = selector.slice(tokens.shift().value.length); 2583 } 2584 2585 // Fetch a seed set for right-to-left matching 2586 i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length; 2587 while (i--) { 2588 token = tokens[i]; 2589 2590 // Abort if we hit a combinator 2591 if (Expr.relative[type = token.type]) { 2592 break; 2593 } 2594 if (find = Expr.find[type]) { 2595 // Search, expanding context for leading sibling combinators 2596 if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testC
vendor: 5,935 bytes, lines 2596-2810
2596ontext(context.parentNode) || context)) { 2597 2598 // If seed is empty or no tokens remain, we can return early 2599 tokens.splice(i, 1); 2600 selector = seed.length && toSelector(tokens); 2601 if (!selector) { 2602 push.apply(results, seed); 2603 return results; 2604 } 2605 2606 break; 2607 } 2608 } 2609 } 2610 } 2611 2612 // Compile and execute a filtering function if one is not provided 2613 // Provide `match` to avoid retokenization if we modified the selector above 2614 (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context); 2615 return results; 2616 }; 2617 2618 // One-time assignments 2619 2620 // Sort stability 2621 support.sortStable = expando.split("").sort(sortOrder).join("") === expando; 2622 2623 // Support: Chrome 14-35+ 2624 // Always assume duplicates if they aren't passed to the comparison function 2625 support.detectDuplicates = !!hasDuplicate; 2626 2627 // Initialize against the default document 2628 setDocument(); 2629 2630 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 2631 // Detached nodes confoundingly follow *each other* 2632 support.sortDetached = assert(function (div1) { 2633 // Should return 1, but returns 4 (following) 2634 return div1.compareDocumentPosition(document.createElement("div")) & 1; 2635 }); 2636 2637 // Support: IE<8 2638 // Prevent attribute/property "interpolation" 2639 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 2640 if (!assert(function (div) { 2641 div.innerHTML = "<a href='#'></a>"; 2642 return div.firstChild.getAttribute("href") === "#"; 2643 })) { 2644 addHandle("type|href|height|width", function (elem, name, isXML) { 2645 if (!isXML) { 2646 return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2); 2647 } 2648 }); 2649 } 2650 2651 // Support: IE<9 2652 // Use defaultValue in place of getAttribute("value") 2653 if (!support.attributes || !assert(function (div) { 2654 div.innerHTML = "<input/>"; 2655 div.firstChild.setAttribute("value", ""); 2656 return div.firstChild.getAttribute("value") === ""; 2657 })) { 2658 addHandle("value", function (elem, name, isXML) { 2659 if (!isXML && elem.nodeName.toLowerCase() === "input") { 2660 return elem.defaultValue; 2661 } 2662 }); 2663 } 2664 2665 // Support: IE<9 2666 // Use getAttributeNode to fetch booleans when getAttribute lies 2667 if (!assert(function (div) { 2668 return div.getAttribute("disabled") == null; 2669 })) { 2670 addHandle(booleans, function (elem, name, isXML) { 2671 var val; 2672 if (!isXML) { 2673 return elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; 2674 } 2675 }); 2676 } 2677 2678 return Sizzle; 2679 }(window); 2680 2681 jQuery.find = Sizzle; 2682 jQuery.expr = Sizzle.selectors; 2683 jQuery.expr[":"] = jQuery.expr.pseudos; 2684 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 2685 jQuery.text = Sizzle.getText; 2686 jQuery.isXMLDoc = Sizzle.isXML; 2687 jQuery.contains = Sizzle.contains; 2688 2689 var dir = function (elem, dir, until) { 2690 var matched = [], 2691 truncate = until !== undefined; 2692 2693 while ((elem = elem[dir]) && elem.nodeType !== 9) { 2694 if (elem.nodeType === 1) { 2695 if (truncate && jQuery(elem).is(until)) { 2696 break; 2697 } 2698 matched.push(elem); 2699 } 2700 } 2701 return matched; 2702 }; 2703 2704 var siblings = function (n, elem) { 2705 var matched = []; 2706 2707 for (; n; n = n.nextSibling) { 2708 if (n.nodeType === 1 && n !== elem) { 2709 matched.push(n); 2710 } 2711 } 2712 2713 return matched; 2714 }; 2715 2716 var rneedsContext = jQuery.expr.match.needsContext; 2717 2718 var rsingleTag = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/; 2719 2720 var risSimple = /^.[^:#\[\.,]*$/; 2721 2722 // Implement the identical functionality for filter and not 2723 function winnow(elements, qualifier, not) { 2724 if (jQuery.isFunction(qualifier)) { 2725 return jQuery.grep(elements, function (elem, i) { 2726 /* jshint -W018 */ 2727 return !!qualifier.call(elem, i, elem) !== not; 2728 }); 2729 } 2730 2731 if (qualifier.nodeType) { 2732 return jQuery.grep(elements, function (elem) { 2733 return elem === qualifier !== not; 2734 }); 2735 } 2736 2737 if (typeof qualifier === "string") { 2738 if (risSimple.test(qualifier)) { 2739 return jQuery.filter(qualifier, elements, not); 2740 } 2741 2742 qualifier = jQuery.filter(qualifier, elements); 2743 } 2744 2745 return jQuery.grep(elements, function (elem) { 2746 return jQuery.inArray(elem, qualifier) > -1 !== not; 2747 }); 2748 } 2749 2750 jQuery.filter = function (expr, elems, not) { 2751 var elem = elems[0]; 2752 2753 if (not) { 2754 expr = ":not(" + expr + ")"; 2755 } 2756 2757 return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function (elem) { 2758 return elem.nodeType === 1; 2759 })); 2760 }; 2761 2762 jQuery.fn.extend({ 2763 find: function (selector) { 2764 var i, 2765 ret = [], 2766 self = this, 2767 len = self.length; 2768 2769 if (typeof selector !== "string") { 2770 return this.pushStack(jQuery(selector).filter(function () { 2771 for (i = 0; i < len; i++) { 2772 if (jQuery.contains(self[i], this)) { 2773 return true; 2774 } 2775 } 2776 })); 2777 } 2778 2779 for (i = 0; i < len; i++) { 2780 jQuery.find(selector, self[i], ret); 2781 } 2782 2783 // Needed because $( selector, context ) becomes $( context ).find( selector ) 2784 ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret); 2785 ret.selector = this.selector ? this.selector + " " + selector : selector; 2786 return ret; 2787 }, 2788 filter: function (selector) { 2789 return this.pushStack(winnow(this, selector || [], false)); 2790 }, 2791 not: function (selector) { 2792 return this.pushStack(winnow(this, selector || [], true)); 2793 }, 2794 is: function (selector) { 2795 return !!winnow(this, 2796 2797 // If this is a positional/relative selector, check membership in the returned set 2798 // so $("p:first").is("p:last") won't return true for a doc with two "p". 2799 typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length; 2800 } 2801 }); 2802 2803 // Initialize a jQuery object 2804 2805 2806 // A central reference to the root jQuery(document) 2807 var rootjQuery, 2808 2809 2810 // A simple way to check for HTML strings
vendor: 9,553 bytes, lines 2811-3167
2811 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 2812 // Strict HTML recognition (#11290: must start with <) 2813 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 2814 init = jQuery.fn.init = function (selector, context, root) { 2815 var match, elem; 2816 2817 // HANDLE: $(""), $(null), $(undefined), $(false) 2818 if (!selector) { 2819 return this; 2820 } 2821 2822 // init accepts an alternate rootjQuery 2823 // so migrate can support jQuery.sub (gh-2101) 2824 root = root || rootjQuery; 2825 2826 // Handle HTML strings 2827 if (typeof selector === "string") { 2828 if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) { 2829 2830 // Assume that strings that start and end with <> are HTML and skip the regex check 2831 match = [null, selector, null]; 2832 } else { 2833 match = rquickExpr.exec(selector); 2834 } 2835 2836 // Match html or make sure no context is specified for #id 2837 if (match && (match[1] || !context)) { 2838 2839 // HANDLE: $(html) -> $(array) 2840 if (match[1]) { 2841 context = context instanceof jQuery ? context[0] : context; 2842 2843 // scripts is true for back-compat 2844 // Intentionally let the error be thrown if parseHTML is not present 2845 jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true)); 2846 2847 // HANDLE: $(html, props) 2848 if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) { 2849 for (match in context) { 2850 2851 // Properties of context are called as methods if possible 2852 if (jQuery.isFunction(this[match])) { 2853 this[match](context[match]); 2854 2855 // ...and otherwise set as attributes 2856 } else { 2857 this.attr(match, context[match]); 2858 } 2859 } 2860 } 2861 2862 return this; 2863 2864 // HANDLE: $(#id) 2865 } else { 2866 elem = document.getElementById(match[2]); 2867 2868 // Check parentNode to catch when Blackberry 4.6 returns 2869 // nodes that are no longer in the document #6963 2870 if (elem && elem.parentNode) { 2871 2872 // Handle the case where IE and Opera return items 2873 // by name instead of ID 2874 if (elem.id !== match[2]) { 2875 return rootjQuery.find(selector); 2876 } 2877 2878 // Otherwise, we inject the element directly into the jQuery object 2879 this.length = 1; 2880 this[0] = elem; 2881 } 2882 2883 this.context = document; 2884 this.selector = selector; 2885 return this; 2886 } 2887 2888 // HANDLE: $(expr, $(...)) 2889 } else if (!context || context.jquery) { 2890 return (context || root).find(selector); 2891 2892 // HANDLE: $(expr, context) 2893 // (which is just equivalent to: $(context).find(expr) 2894 } else { 2895 return this.constructor(context).find(selector); 2896 } 2897 2898 // HANDLE: $(DOMElement) 2899 } else if (selector.nodeType) { 2900 this.context = this[0] = selector; 2901 this.length = 1; 2902 return this; 2903 2904 // HANDLE: $(function) 2905 // Shortcut for document ready 2906 } else if (jQuery.isFunction(selector)) { 2907 return typeof root.ready !== "undefined" ? root.ready(selector) : 2908 2909 // Execute immediately if ready is not present 2910 selector(jQuery); 2911 } 2912 2913 if (selector.selector !== undefined) { 2914 this.selector = selector.selector; 2915 this.context = selector.context; 2916 } 2917 2918 return jQuery.makeArray(selector, this); 2919 }; 2920 2921 // Give the init function the jQuery prototype for later instantiation 2922 init.prototype = jQuery.fn; 2923 2924 // Initialize central reference 2925 rootjQuery = jQuery(document); 2926 2927 var rparentsprev = /^(?:parents|prev(?:Until|All))/, 2928 2929 2930 // methods guaranteed to produce a unique set when starting from a unique set 2931 guaranteedUnique = { 2932 children: true, 2933 contents: true, 2934 next: true, 2935 prev: true 2936 }; 2937 2938 jQuery.fn.extend({ 2939 has: function (target) { 2940 var i, 2941 targets = jQuery(target, this), 2942 len = targets.length; 2943 2944 return this.filter(function () { 2945 for (i = 0; i < len; i++) { 2946 if (jQuery.contains(this, targets[i])) { 2947 return true; 2948 } 2949 } 2950 }); 2951 }, 2952 2953 closest: function (selectors, context) { 2954 var cur, 2955 i = 0, 2956 l = this.length, 2957 matched = [], 2958 pos = rneedsContext.test(selectors) || typeof selectors !== "string" ? jQuery(selectors, context || this.context) : 0; 2959 2960 for (; i < l; i++) { 2961 for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) { 2962 2963 // Always skip document fragments 2964 if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : 2965 2966 // Don't pass non-elements to Sizzle 2967 cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) { 2968 2969 matched.push(cur); 2970 break; 2971 } 2972 } 2973 } 2974 2975 return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched); 2976 }, 2977 2978 // Determine the position of an element within 2979 // the matched set of elements 2980 index: function (elem) { 2981 2982 // No argument, return index in parent 2983 if (!elem) { 2984 return this[0] && this[0].parentNode ? this.first().prevAll().length : -1; 2985 } 2986 2987 // index in selector 2988 if (typeof elem === "string") { 2989 return jQuery.inArray(this[0], jQuery(elem)); 2990 } 2991 2992 // Locate the position of the desired element 2993 return jQuery.inArray( 2994 2995 // If it receives a jQuery object, the first element is used 2996 elem.jquery ? elem[0] : elem, this); 2997 }, 2998 2999 add: function (selector, context) { 3000 return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context)))); 3001 }, 3002 3003 addBack: function (selector) { 3004 return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector)); 3005 } 3006 }); 3007 3008 function sibling(cur, dir) { 3009 do { 3010 cur = cur[dir]; 3011 } while (cur && cur.nodeType !== 1); 3012 3013 return cur; 3014 } 3015 3016 jQuery.each({ 3017 parent: function (elem) { 3018 var parent = elem.parentNode; 3019 return parent && parent.nodeType !== 11 ? parent : null; 3020 }, 3021 parents: function (elem) { 3022 return dir(elem, "parentNode"); 3023 }, 3024 parentsUntil: function (elem, i, until) { 3025 return dir(elem, "parentNode", until); 3026 }, 3027 next: function (elem) { 3028 return sibling(elem, "nextSibling"); 3029 }, 3030 prev: function (elem) { 3031 return sibling(elem, "previousSibling"); 3032 }, 3033 nextAll: function (elem) { 3034 return dir(elem, "nextSibling"); 3035 }, 3036 prevAll: function (elem) { 3037 return dir(elem, "previousSibling"); 3038 }, 3039 nextUntil: function (elem, i, until) { 3040 return dir(elem, "nextSibling", until); 3041 }, 3042 prevUntil: function (elem, i, until) { 3043 return dir(elem, "previousSibling", until); 3044 }, 3045 siblings: function (elem) { 3046 return siblings((elem.parentNode || {}).firstChild, elem); 3047 }, 3048 children: function (elem) { 3049 return siblings(elem.firstChild); 3050 }, 3051 contents: function (elem) { 3052 return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.merge([], elem.childNodes); 3053 } 3054 }, function (name, fn) { 3055 jQuery.fn[name] = function (until, selector) { 3056 var ret = jQuery.map(this, fn, until); 3057 3058 if (name.slice(-5) !== "Until") { 3059 selector = until; 3060 } 3061 3062 if (selector && typeof selector === "string") { 3063 ret = jQuery.filter(selector, ret); 3064 } 3065 3066 if (this.length > 1) { 3067 3068 // Remove duplicates 3069 if (!guaranteedUnique[name]) { 3070 ret = jQuery.uniqueSort(ret); 3071 } 3072 3073 // Reverse order for parents* and prev-derivatives 3074 if (rparentsprev.test(name)) { 3075 ret = ret.reverse(); 3076 } 3077 } 3078 3079 return this.pushStack(ret); 3080 }; 3081 }); 3082 var rnotwhite = /\S+/g; 3083 3084 // Convert String-formatted options into Object-formatted ones 3085 function createOptions(options) { 3086 var object = {}; 3087 jQuery.each(options.match(rnotwhite) || [], function (_, flag) { 3088 object[flag] = true; 3089 }); 3090 return object; 3091 } 3092 3093 /* 3094 * Create a callback list using the following parameters: 3095 * 3096 * options: an optional list of space-separated options that will change how 3097 * the callback list behaves or a more traditional option object 3098 * 3099 * By default a callback list will act like an event callback list and can be 3100 * "fired" multiple times. 3101 * 3102 * Possible options: 3103 * 3104 * once: will ensure the callback list can only be fired once (like a Deferred) 3105 * 3106 * memory: will keep track of previous values and will call any callback added 3107 * after the list has been fired right away with the latest "memorized" 3108 * values (like a Deferred) 3109 * 3110 * unique: will ensure a callback can only be added once (no duplicate in the list) 3111 * 3112 * stopOnFalse: interrupt callings when a callback returns false 3113 * 3114 */ 3115 jQuery.Callbacks = function (options) { 3116 3117 // Convert options from String-formatted to Object-formatted if needed 3118 // (we check in cache first) 3119 options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options); 3120 3121 var // Flag to know if list is currently firing 3122 firing, 3123 3124 3125 // Last fire value for non-forgettable lists 3126 memory, 3127 3128 3129 // Flag to know if list was already fired 3130 fired, 3131 3132 3133 // Flag to prevent firing 3134 locked, 3135 3136 3137 // Actual callback list 3138 list = [], 3139 3140 3141 // Queue of execution data for repeatable lists 3142 queue = [], 3143 3144 3145 // Index of currently firing callback (modified by add/remove as needed) 3146 firingIndex = -1, 3147 3148 3149 // Fire callbacks 3150 fire = function () { 3151 3152 // Enforce single-firing 3153 locked = options.once; 3154 3155 // Execute callbacks for all pending executions, 3156 // respecting firingIndex overrides and runtime changes 3157 fired = firing = true; 3158 for (; queue.length; firingIndex = -1) { 3159 memory = queue.shift(); 3160 while (++firingIndex < list.length) { 3161 3162 // Run callback and check for early termination 3163 if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) { 3164 3165 // Jump to end and forget the data so .add doesn't re-fire 3166 firingIndex = list.length; 3167 memory = false;
vendor: 8,134 bytes, lines 3168-3497
3168 } 3169 } 3170 } 3171 3172 // Forget the data if we're done with it 3173 if (!options.memory) { 3174 memory = false; 3175 } 3176 3177 firing = false; 3178 3179 // Clean up if we're done firing for good 3180 if (locked) { 3181 3182 // Keep an empty list if we have data for future add calls 3183 if (memory) { 3184 list = []; 3185 3186 // Otherwise, this object is spent 3187 } else { 3188 list = ""; 3189 } 3190 } 3191 }, 3192 3193 3194 // Actual Callbacks object 3195 self = { 3196 3197 // Add a callback or a collection of callbacks to the list 3198 add: function () { 3199 if (list) { 3200 3201 // If we have memory from a past run, we should fire after adding 3202 if (memory && !firing) { 3203 firingIndex = list.length - 1; 3204 queue.push(memory); 3205 } 3206 3207 (function add(args) { 3208 jQuery.each(args, function (_, arg) { 3209 if (jQuery.isFunction(arg)) { 3210 if (!options.unique || !self.has(arg)) { 3211 list.push(arg); 3212 } 3213 } else if (arg && arg.length && jQuery.type(arg) !== "string") { 3214 3215 // Inspect recursively 3216 add(arg); 3217 } 3218 }); 3219 })(arguments); 3220 3221 if (memory && !firing) { 3222 fire(); 3223 } 3224 } 3225 return this; 3226 }, 3227 3228 // Remove a callback from the list 3229 remove: function () { 3230 jQuery.each(arguments, function (_, arg) { 3231 var index; 3232 while ((index = jQuery.inArray(arg, list, index)) > -1) { 3233 list.splice(index, 1); 3234 3235 // Handle firing indexes 3236 if (index <= firingIndex) { 3237 firingIndex--; 3238 } 3239 } 3240 }); 3241 return this; 3242 }, 3243 3244 // Check if a given callback is in the list. 3245 // If no argument is given, return whether or not list has callbacks attached. 3246 has: function (fn) { 3247 return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0; 3248 }, 3249 3250 // Remove all callbacks from the list 3251 empty: function () { 3252 if (list) { 3253 list = []; 3254 } 3255 return this; 3256 }, 3257 3258 // Disable .fire and .add 3259 // Abort any current/pending executions 3260 // Clear all callbacks and values 3261 disable: function () { 3262 locked = queue = []; 3263 list = memory = ""; 3264 return this; 3265 }, 3266 disabled: function () { 3267 return !list; 3268 }, 3269 3270 // Disable .fire 3271 // Also disable .add unless we have memory (since it would have no effect) 3272 // Abort any pending executions 3273 lock: function () { 3274 locked = true; 3275 if (!memory) { 3276 self.disable(); 3277 } 3278 return this; 3279 }, 3280 locked: function () { 3281 return !!locked; 3282 }, 3283 3284 // Call all callbacks with the given context and arguments 3285 fireWith: function (context, args) { 3286 if (!locked) { 3287 args = args || []; 3288 args = [context, args.slice ? args.slice() : args]; 3289 queue.push(args); 3290 if (!firing) { 3291 fire(); 3292 } 3293 } 3294 return this; 3295 }, 3296 3297 // Call all the callbacks with the given arguments 3298 fire: function () { 3299 self.fireWith(this, arguments); 3300 return this; 3301 }, 3302 3303 // To know if the callbacks have already been called at least once 3304 fired: function () { 3305 return !!fired; 3306 } 3307 }; 3308 3309 return self; 3310 }; 3311 3312 jQuery.extend({ 3313 3314 Deferred: function (func) { 3315 var tuples = [ 3316 3317 // action, add listener, listener list, final state 3318 ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"], ["notify", "progress", jQuery.Callbacks("memory")]], 3319 state = "pending", 3320 promise = { 3321 state: function () { 3322 return state; 3323 }, 3324 always: function () { 3325 deferred.done(arguments).fail(arguments); 3326 return this; 3327 }, 3328 then: function () /* fnDone, fnFail, fnProgress */{ 3329 var fns = arguments; 3330 return jQuery.Deferred(function (newDefer) { 3331 jQuery.each(tuples, function (i, tuple) { 3332 var fn = jQuery.isFunction(fns[i]) && fns[i]; 3333 3334 // deferred[ done | fail | progress ] for forwarding actions to newDefer 3335 deferred[tuple[1]](function () { 3336 var returned = fn && fn.apply(this, arguments); 3337 if (returned && jQuery.isFunction(returned.promise)) { 3338 returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject); 3339 } else { 3340 newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments); 3341 } 3342 }); 3343 }); 3344 fns = null; 3345 }).promise(); 3346 }, 3347 3348 // Get a promise for this deferred 3349 // If obj is provided, the promise aspect is added to the object 3350 promise: function (obj) { 3351 return obj != null ? jQuery.extend(obj, promise) : promise; 3352 } 3353 }, 3354 deferred = {}; 3355 3356 // Keep pipe for back-compat 3357 promise.pipe = promise.then; 3358 3359 // Add list-specific methods 3360 jQuery.each(tuples, function (i, tuple) { 3361 var list = tuple[2], 3362 stateString = tuple[3]; 3363 3364 // promise[ done | fail | progress ] = list.add 3365 promise[tuple[1]] = list.add; 3366 3367 // Handle state 3368 if (stateString) { 3369 list.add(function () { 3370 3371 // state = [ resolved | rejected ] 3372 state = stateString; 3373 3374 // [ reject_list | resolve_list ].disable; progress_list.lock 3375 }, tuples[i ^ 1][2].disable, tuples[2][2].lock); 3376 } 3377 3378 // deferred[ resolve | reject | notify ] 3379 deferred[tuple[0]] = function () { 3380 deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments); 3381 return this; 3382 }; 3383 deferred[tuple[0] + "With"] = list.fireWith; 3384 }); 3385 3386 // Make the deferred a promise 3387 promise.promise(deferred); 3388 3389 // Call given func if any 3390 if (func) { 3391 func.call(deferred, deferred); 3392 } 3393 3394 // All done! 3395 return deferred; 3396 }, 3397 3398 // Deferred helper 3399 when: function (subordinate /* , ..., subordinateN */) { 3400 var i = 0, 3401 resolveValues = slice.call(arguments), 3402 length = resolveValues.length, 3403 3404 3405 // the count of uncompleted subordinates 3406 remaining = length !== 1 || subordinate && jQuery.isFunction(subordinate.promise) ? length : 0, 3407 3408 3409 // the master Deferred. 3410 // If resolveValues consist of only a single Deferred, just use that. 3411 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 3412 3413 3414 // Update function for both resolve and progress values 3415 updateFunc = function (i, contexts, values) { 3416 return function (value) { 3417 contexts[i] = this; 3418 values[i] = arguments.length > 1 ? slice.call(arguments) : value; 3419 if (values === progressValues) { 3420 deferred.notifyWith(contexts, values); 3421 } else if (! --remaining) { 3422 deferred.resolveWith(contexts, values); 3423 } 3424 }; 3425 }, 3426 progressValues, 3427 progressContexts, 3428 resolveContexts; 3429 3430 // add listeners to Deferred subordinates; treat others as resolved 3431 if (length > 1) { 3432 progressValues = new Array(length); 3433 progressContexts = new Array(length); 3434 resolveContexts = new Array(length); 3435 for (; i < length; i++) { 3436 if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) { 3437 resolveValues[i].promise().progress(updateFunc(i, progressContexts, progressValues)).done(updateFunc(i, resolveContexts, resolveValues)).fail(deferred.reject); 3438 } else { 3439 --remaining; 3440 } 3441 } 3442 } 3443 3444 // if we're not waiting on anything, resolve the master 3445 if (!remaining) { 3446 deferred.resolveWith(resolveContexts, resolveValues); 3447 } 3448 3449 return deferred.promise(); 3450 } 3451 }); 3452 3453 // The deferred used on DOM ready 3454 var readyList; 3455 3456 jQuery.fn.ready = function (fn) { 3457 3458 // Add the callback 3459 jQuery.ready.promise().done(fn); 3460 3461 return this; 3462 }; 3463 3464 jQuery.extend({ 3465 3466 // Is the DOM ready to be used? Set to true once it occurs. 3467 isReady: false, 3468 3469 // A counter to track how many items to wait for before 3470 // the ready event fires. See #6781 3471 readyWait: 1, 3472 3473 // Hold (or release) the ready event 3474 holdReady: function (hold) { 3475 if (hold) { 3476 jQuery.readyWait++; 3477 } else { 3478 jQuery.ready(true); 3479 } 3480 }, 3481 3482 // Handle when the DOM is ready 3483 ready: function (wait) { 3484 3485 // Abort if there are pending holds or we're already ready 3486 if (wait === true ? --jQuery.readyWait : jQuery.isReady) { 3487 return; 3488 } 3489 3490 // Remember that the DOM is ready 3491 jQuery.isReady = true; 3492 3493 // If a normal DOM Ready event fired, decrement, and wait if need be 3494 if (wait !== true && --jQuery.readyWait > 0) { 3495 return; 3496 } 3497
3498 // If there are functions bound, to execute 3499 readyList.resolveWith(document, [jQuery]); 3500 3501 // Trigger any bound ready events 3502 if (jQuery.fn.triggerHandler) { 3503 jQuery(document).triggerHandler("ready"); 3504 jQuery(document).off("ready"); 3505 } 3506 } 3507 }); 3508 3509 /** 3510 * Clean-up method for dom ready events 3511 */ 3512 function detach() { 3513 if (document.addEventListener) { 3514 document.removeEventListener("DOMContentLoaded", completed); 3515 window.removeEventListener("load", completed); 3516 } else { 3517 document.detachEvent("onreadystatechange", completed); 3518 window.detachEvent("onload", completed); 3519 } 3520 } 3521 3522 /** 3523 * The ready event handler and self cleanup method 3524 */ 3525 function completed() { 3526 3527 // readyState === "complete" is good enough for us to call the dom ready in oldIE 3528 if (document.addEventListener || window.event.type === "load" || document.readyState === "complete") { 3529 3530 detach(); 3531 jQuery.ready(); 3532 } 3533 } 3534 3535 jQuery.ready.promise = function (obj) { 3536 if (!readyList) { 3537 3538 readyList = jQuery.Deferred(); 3539 3540 // Catch cases where $(document).ready() is called 3541 // after the browser event has already occurred. 3542 // Support: IE6-10 3543 // Older IE sometimes signals "interactive" too soon 3544 if (document.readyState === "complete" || document.readyState !== "loading" && !document.documentElement.doScroll) { 3545 3546 // Handle it asynchronously to allow scripts the opportunity to delay ready 3547 window.setTimeout(jQuery.ready); 3548 3549 // Standards-based browsers support DOMContentLoaded 3550 } else if (document.addEventListener) { 3551 3552 // Use the handy event callback 3553 document.addEventListener("DOMContentLoaded", completed); 3554 3555 // A fallback to window.onload, that will always work 3556 window.addEventListener("load", completed); 3557 3558 // If IE event model is used 3559 } else { 3560 3561 // Ensure firing before onload, maybe late but safe also for iframes 3562 document.attachEvent("onreadystatechange", completed); 3563 3564 // A fallback to window.onload, that will always work 3565 window.attachEvent("onload", completed); 3566 3567 // If IE and not a frame 3568 // continually check to see if the document is ready 3569 var top = false; 3570 3571 try { 3572 top = window.frameElement == null && document.documentElement; 3573 } catch (e) {} 3574 3575 if (top && top.doScroll) { 3576 (function doScrollCheck() { 3577 if (!jQuery.isReady) { 3578 3579 try { 3580 3581 // Use the trick by Diego Perini 3582 // http://javascript.nwbox.com/IEContentLoaded/ 3583 top.doScroll("left"); 3584 } catch (e) { 3585 return window.setTimeout(doScrollCheck, 50); 3586 } 3587 3588 // detach all dom ready events 3589 detach(); 3590 3591 // and execute any waiting functions 3592 jQuery.ready(); 3593 } 3594 })(); 3595 } 3596 } 3597 } 3598 return readyList.promise(obj); 3599 }; 3600 3601 // Kick off the DOM ready check even if the user does not 3602 jQuery.ready.promise(); 3603 3604 // Support: IE<9 3605 // Iteration over object's inherited properties before its own 3606 var i; 3607 for (i in jQuery(support)) { 3608 break; 3609 } 3610 support.ownFirst = i === "0"; 3611 3612 // Note: most support tests are defined in their respective modules. 3613 // false until the test is run 3614 support.inlineBlockNeedsLayout = false; 3615 3616 // Execute ASAP in case we need to set body.style.zoom 3617 jQuery(function () { 3618 3619 // Minified: var a,b,c,d 3620 var val, div, body, container; 3621 3622 body = document.getElementsByTagName("body")[0]; 3623 if (!body || !body.style) { 3624 3625 // Return for frameset docs that don't have a body 3626 return; 3627 } 3628 3629 // Setup 3630 div = document.createElement("div"); 3631 container = document.createElement("div"); 3632 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 3633 body.appendChild(container).appendChild(div); 3634 3635 if (typeof div.style.zoom !== "undefined") { 3636 3637 // Support: IE<8 3638 // Check if natively block-level elements act like inline-block 3639 // elements when setting their display to 'inline' and giving 3640 // them layout 3641 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; 3642 3643 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; 3644 if (val) { 3645 3646 // Prevent IE 6 from affecting layout for positioned elements #11048 3647 // Prevent IE from shrinking the body in IE 7 mode #12869
vendor: 12,463 bytes, lines 3648-4159
3648 // Support: IE<8 3649 body.style.zoom = 1; 3650 } 3651 } 3652 3653 body.removeChild(container); 3654 }); 3655 3656 (function () { 3657 var div = document.createElement("div"); 3658 3659 // Support: IE<9 3660 support.deleteExpando = true; 3661 try { 3662 delete div.test; 3663 } catch (e) { 3664 support.deleteExpando = false; 3665 } 3666 3667 // Null elements to avoid leaks in IE. 3668 div = null; 3669 })(); 3670 var acceptData = function (elem) { 3671 var noData = jQuery.noData[(elem.nodeName + " ").toLowerCase()], 3672 nodeType = +elem.nodeType || 1; 3673 3674 // Do not set data on non-element DOM nodes because it will not be cleared (#8335). 3675 return nodeType !== 1 && nodeType !== 9 ? false : 3676 3677 // Nodes accept data unless otherwise specified; rejection can be conditional 3678 !noData || noData !== true && elem.getAttribute("classid") === noData; 3679 }; 3680 3681 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 3682 rmultiDash = /([A-Z])/g; 3683 3684 function dataAttr(elem, key, data) { 3685 3686 // If nothing was found internally, try to fetch any 3687 // data from the HTML5 data-* attribute 3688 if (data === undefined && elem.nodeType === 1) { 3689 3690 var name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase(); 3691 3692 data = elem.getAttribute(name); 3693 3694 if (typeof data === "string") { 3695 try { 3696 data = data === "true" ? true : data === "false" ? false : data === "null" ? null : 3697 3698 // Only convert to a number if it doesn't change the string 3699 +data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data; 3700 } catch (e) {} 3701 3702 // Make sure we set the data so it isn't changed later 3703 jQuery.data(elem, key, data); 3704 } else { 3705 data = undefined; 3706 } 3707 } 3708 3709 return data; 3710 } 3711 3712 // checks a cache object for emptiness 3713 function isEmptyDataObject(obj) { 3714 var name; 3715 for (name in obj) { 3716 3717 // if the public data object is empty, the private is still empty 3718 if (name === "data" && jQuery.isEmptyObject(obj[name])) { 3719 continue; 3720 } 3721 if (name !== "toJSON") { 3722 return false; 3723 } 3724 } 3725 3726 return true; 3727 } 3728 3729 function internalData(elem, name, data, pvt /* Internal Use Only */) { 3730 if (!acceptData(elem)) { 3731 return; 3732 } 3733 3734 var ret, 3735 thisCache, 3736 internalKey = jQuery.expando, 3737 3738 3739 // We have to handle DOM nodes and JS objects differently because IE6-7 3740 // can't GC object references properly across the DOM-JS boundary 3741 isNode = elem.nodeType, 3742 3743 3744 // Only DOM nodes need the global jQuery cache; JS object data is 3745 // attached directly to the object so GC can occur automatically 3746 cache = isNode ? jQuery.cache : elem, 3747 3748 3749 // Only defining an ID for JS objects if its cache already exists allows 3750 // the code to shortcut on the same path as a DOM node with no cache 3751 id = isNode ? elem[internalKey] : elem[internalKey] && internalKey; 3752 3753 // Avoid doing any more work than we need to when trying to get data on an 3754 // object that has no data at all 3755 if ((!id || !cache[id] || !pvt && !cache[id].data) && data === undefined && typeof name === "string") { 3756 return; 3757 } 3758 3759 if (!id) { 3760 3761 // Only DOM nodes need a new unique ID for each element since their data 3762 // ends up in the global cache 3763 if (isNode) { 3764 id = elem[internalKey] = deletedIds.pop() || jQuery.guid++; 3765 } else { 3766 id = internalKey; 3767 } 3768 } 3769 3770 if (!cache[id]) { 3771 3772 // Avoid exposing jQuery metadata on plain JS objects when the object 3773 // is serialized using JSON.stringify 3774 cache[id] = isNode ? {} : { toJSON: jQuery.noop }; 3775 } 3776 3777 // An object can be passed to jQuery.data instead of a key/value pair; this gets 3778 // shallow copied over onto the existing cache 3779 if (typeof name === "object" || typeof name === "function") { 3780 if (pvt) { 3781 cache[id] = jQuery.extend(cache[id], name); 3782 } else { 3783 cache[id].data = jQuery.extend(cache[id].data, name); 3784 } 3785 } 3786 3787 thisCache = cache[id]; 3788 3789 // jQuery data() is stored in a separate object inside the object's internal data 3790 // cache in order to avoid key collisions between internal data and user-defined 3791 // data. 3792 if (!pvt) { 3793 if (!thisCache.data) { 3794 thisCache.data = {}; 3795 } 3796 3797 thisCache = thisCache.data; 3798 } 3799 3800 if (data !== undefined) { 3801 thisCache[jQuery.camelCase(name)] = data; 3802 } 3803 3804 // Check for both converted-to-camel and non-converted data property names 3805 // If a data property was specified 3806 if (typeof name === "string") { 3807 3808 // First Try to find as-is property data 3809 ret = thisCache[name]; 3810 3811 // Test for null|undefined property data 3812 if (ret == null) { 3813 3814 // Try to find the camelCased property 3815 ret = thisCache[jQuery.camelCase(name)]; 3816 } 3817 } else { 3818 ret = thisCache; 3819 } 3820 3821 return ret; 3822 } 3823 3824 function internalRemoveData(elem, name, pvt) { 3825 if (!acceptData(elem)) { 3826 return; 3827 } 3828 3829 var thisCache, 3830 i, 3831 isNode = elem.nodeType, 3832 3833 3834 // See jQuery.data for more information 3835 cache = isNode ? jQuery.cache : elem, 3836 id = isNode ? elem[jQuery.expando] : jQuery.expando; 3837 3838 // If there is already no cache entry for this object, there is no 3839 // purpose in continuing 3840 if (!cache[id]) { 3841 return; 3842 } 3843 3844 if (name) { 3845 3846 thisCache = pvt ? cache[id] : cache[id].data; 3847 3848 if (thisCache) { 3849 3850 // Support array or space separated string names for data keys 3851 if (!jQuery.isArray(name)) { 3852 3853 // try the string as a key before any manipulation 3854 if (name in thisCache) { 3855 name = [name]; 3856 } else { 3857 3858 // split the camel cased version by spaces unless a key with the spaces exists 3859 name = jQuery.camelCase(name); 3860 if (name in thisCache) { 3861 name = [name]; 3862 } else { 3863 name = name.split(" "); 3864 } 3865 } 3866 } else { 3867 3868 // If "name" is an array of keys... 3869 // When data is initially created, via ("key", "val") signature, 3870 // keys will be converted to camelCase. 3871 // Since there is no way to tell _how_ a key was added, remove 3872 // both plain key and camelCase key. #12786 3873 // This will only penalize the array argument path. 3874 name = name.concat(jQuery.map(name, jQuery.camelCase)); 3875 } 3876 3877 i = name.length; 3878 while (i--) { 3879 delete thisCache[name[i]]; 3880 } 3881 3882 // If there is no data left in the cache, we want to continue 3883 // and let the cache object itself get destroyed 3884 if (pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache)) { 3885 return; 3886 } 3887 } 3888 } 3889 3890 // See jQuery.data for more information 3891 if (!pvt) { 3892 delete cache[id].data; 3893 3894 // Don't destroy the parent cache unless the internal data object 3895 // had been the only thing left in it 3896 if (!isEmptyDataObject(cache[id])) { 3897 return; 3898 } 3899 } 3900 3901 // Destroy the cache 3902 if (isNode) { 3903 jQuery.cleanData([elem], true); 3904 3905 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) 3906 /* jshint eqeqeq: false */ 3907 } else if (support.deleteExpando || cache != cache.window) { 3908 /* jshint eqeqeq: true */ 3909 delete cache[id]; 3910 3911 // When all else fails, undefined 3912 } else { 3913 cache[id] = undefined; 3914 } 3915 } 3916 3917 jQuery.extend({ 3918 cache: {}, 3919 3920 // The following elements (space-suffixed to avoid Object.prototype collisions) 3921 // throw uncatchable exceptions if you attempt to set expando properties 3922 noData: { 3923 "applet ": true, 3924 "embed ": true, 3925 3926 // ...but Flash objects (which have this classid) *can* handle expandos 3927 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 3928 }, 3929 3930 hasData: function (elem) { 3931 elem = elem.nodeType ? jQuery.cache[elem[jQuery.expando]] : elem[jQuery.expando]; 3932 return !!elem && !isEmptyDataObject(elem); 3933 }, 3934 3935 data: function (elem, name, data) { 3936 return internalData(elem, name, data); 3937 }, 3938 3939 removeData: function (elem, name) { 3940 return internalRemoveData(elem, name); 3941 }, 3942 3943 // For internal use only. 3944 _data: function (elem, name, data) { 3945 return internalData(elem, name, data, true); 3946 }, 3947 3948 _removeData: function (elem, name) { 3949 return internalRemoveData(elem, name, true); 3950 } 3951 }); 3952 3953 jQuery.fn.extend({ 3954 data: function (key, value) { 3955 var i, 3956 name, 3957 data, 3958 elem = this[0], 3959 attrs = elem && elem.attributes; 3960 3961 // Special expections of .data basically thwart jQuery.access, 3962 // so implement the relevant behavior ourselves 3963 3964 // Gets all values 3965 if (key === undefined) { 3966 if (this.length) { 3967 data = jQuery.data(elem); 3968 3969 if (elem.nodeType === 1 && !jQuery._data(elem, "parsedAttrs")) { 3970 i = attrs.length; 3971 while (i--) { 3972 3973 // Support: IE11+ 3974 // The attrs elements can be null (#14894) 3975 if (attrs[i]) { 3976 name = attrs[i].name; 3977 if (name.indexOf("data-") === 0) { 3978 name = jQuery.camelCase(name.slice(5)); 3979 dataAttr(elem, name, data[name]); 3980 } 3981 } 3982 } 3983 jQuery._data(elem, "parsedAttrs", true); 3984 } 3985 } 3986 3987 return data; 3988 } 3989 3990 // Sets multiple values 3991 if (typeof key === "object") { 3992 return this.each(function () { 3993 jQuery.data(this, key); 3994 }); 3995 } 3996 3997 return arguments.length > 1 ? 3998 3999 // Sets one value 4000 this.each(function () { 4001 jQuery.data(this, key, value); 4002 }) : 4003 4004 // Gets one value 4005 // Try to fetch any internally stored data first 4006 elem ? dataAttr(elem, key, jQuery.data(elem, key)) : undefined; 4007 }, 4008 4009 removeData: function (key) { 4010 return this.each(function () { 4011 jQuery.removeData(this, key); 4012 }); 4013 } 4014 }); 4015 4016 jQuery.extend({ 4017 queue: function (elem, type, data) { 4018 var queue; 4019 4020 if (elem) { 4021 type = (type || "fx") + "queue"; 4022 queue = jQuery._data(elem, type); 4023 4024 // Speed up dequeue by getting out quickly if this is just a lookup 4025 if (data) { 4026 if (!queue || jQuery.isArray(data)) { 4027 queue = jQuery._data(elem, type, jQuery.makeArray(data)); 4028 } else { 4029 queue.push(data); 4030 } 4031 } 4032 return queue || []; 4033 } 4034 }, 4035 4036 dequeue: function (elem, type) { 4037 type = type || "fx"; 4038 4039 var queue = jQuery.queue(elem, type), 4040 startLength = queue.length, 4041 fn = queue.shift(), 4042 hooks = jQuery._queueHooks(elem, type), 4043 next = function () { 4044 jQuery.dequeue(elem, type); 4045 }; 4046 4047 // If the fx queue is dequeued, always remove the progress sentinel 4048 if (fn === "inprogress") { 4049 fn = queue.shift(); 4050 startLength--; 4051 } 4052 4053 if (fn) { 4054 4055 // Add a progress sentinel to prevent the fx queue from being 4056 // automatically dequeued 4057 if (type === "fx") { 4058 queue.unshift("inprogress"); 4059 } 4060 4061 // clear up the last queue stop function 4062 delete hooks.stop; 4063 fn.call(elem, next, hooks); 4064 } 4065 4066 if (!startLength && hooks) { 4067 hooks.empty.fire(); 4068 } 4069 }, 4070 4071 // not intended for public consumption - generates a queueHooks object, 4072 // or returns the current one 4073 _queueHooks: function (elem, type) { 4074 var key = type + "queueHooks"; 4075 return jQuery._data(elem, key) || jQuery._data(elem, key, { 4076 empty: jQuery.Callbacks("once memory").add(function () { 4077 jQuery._removeData(elem, type + "queue"); 4078 jQuery._removeData(elem, key); 4079 }) 4080 }); 4081 } 4082 }); 4083 4084 jQuery.fn.extend({ 4085 queue: function (type, data) { 4086 var setter = 2; 4087 4088 if (typeof type !== "string") { 4089 data = type; 4090 type = "fx"; 4091 setter--; 4092 } 4093 4094 if (arguments.length < setter) { 4095 return jQuery.queue(this[0], type); 4096 } 4097 4098 return data === undefined ? this : this.each(function () { 4099 var queue = jQuery.queue(this, type, data); 4100 4101 // ensure a hooks for this queue 4102 jQuery._queueHooks(this, type); 4103 4104 if (type === "fx" && queue[0] !== "inprogress") { 4105 jQuery.dequeue(this, type); 4106 } 4107 }); 4108 }, 4109 dequeue: function (type) { 4110 return this.each(function () { 4111 jQuery.dequeue(this, type); 4112 }); 4113 }, 4114 clearQueue: function (type) { 4115 return this.queue(type || "fx", []); 4116 }, 4117 4118 // Get a promise resolved when queues of a certain type 4119 // are emptied (fx is the type by default) 4120 promise: function (type, obj) { 4121 var tmp, 4122 count = 1, 4123 defer = jQuery.Deferred(), 4124 elements = this, 4125 i = this.length, 4126 resolve = function () { 4127 if (! --count) { 4128 defer.resolveWith(elements, [elements]); 4129 } 4130 }; 4131 4132 if (typeof type !== "string") { 4133 obj = type; 4134 type = undefined; 4135 } 4136 type = type || "fx"; 4137 4138 while (i--) { 4139 tmp = jQuery._data(elements[i], type + "queueHooks"); 4140 if (tmp && tmp.empty) { 4141 count++; 4142 tmp.empty.add(resolve); 4143 } 4144 } 4145 resolve(); 4146 return defer.promise(obj); 4147 } 4148 }); 4149 4150 (function () { 4151 var shrinkWrapBlocksVal; 4152 4153 support.shrinkWrapBlocks = function () { 4154 if (shrinkWrapBlocksVal != null) { 4155 return shrinkWrapBlocksVal; 4156 } 4157 4158 // Will be changed later if needed. 4159 shrinkWrapBlocksVal = false;
4160 4161 // Minified: var b,c,d 4162 var div, body, container; 4163 4164 body = document.getElementsByTagName("body")[0]; 4165 if (!body || !body.style) { 4166 4167 // Test fired too early or in an unsupported environment, exit. 4168 return; 4169 } 4170 4171 // Setup 4172 div = document.createElement("div"); 4173 container = document.createElement("div"); 4174 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 4175 body.appendChild(container).appendChild(div); 4176 4177 // Support: IE6 4178 // Check if elements with layout shrink-wrap their children 4179 if (typeof div.style.zoom !== "undefined") { 4180 4181 // Reset CSS: box-sizing; display; margin; border 4182 div.style.cssText = 4183 4184 // Support: Firefox<29, Android 2.3 4185 // Vendor-prefix box-sizing 4186 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;" + "padding:1px;width:1px;zoom:1"; 4187 div.appendChild(document.createElement("div")).style.width = "5px"; 4188 shrinkWrapBlocksVal = div.offsetWidth !== 3; 4189 } 4190 4191 body.removeChild(container); 4192 4193 return shrinkWrapBlocksVal; 4194 }; 4195 })(); 4196 var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; 4197 4198 var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"); 4199 4200 var cssExpand = ["Top", "Right", "Bottom", "Left"]; 4201 4202 var isHidden = function (elem, el) { 4203 4204 // isHidden might be called from jQuery#filter function; 4205 // in that case, element will be second argument 4206 elem = el || elem; 4207 return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem); 4208 }; 4209 4210 function adjustCSS(elem, prop, valueParts, tween) { 4211 var adjusted, 4212 scale = 1, 4213 maxIterations = 20, 4214 currentValue = tween ? function () { 4215 return tween.cur(); 4216 } : function () { 4217 return jQuery.css(elem, prop, ""); 4218 }, 4219 initial = currentValue(), 4220 unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), 4221 4222 4223 // Starting value computation is required for potential unit mismatches 4224 initialInUnit = (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop)); 4225 4226 if (initialInUnit && initialInUnit[3] !== unit) { 4227 4228 // Trust units reported by jQuery.css 4229 unit = unit || initialInUnit[3]; 4230 4231 // Make sure we update the tween properties later on 4232 valueParts = valueParts || []; 4233 4234 // Iteratively approximate from a nonzero starting point 4235 initialInUnit = +initial || 1; 4236 4237 do { 4238 4239 // If previous iteration zeroed out, double until we get *something*. 4240 // Use string for doubling so we don't accidentally see scale as unchanged below 4241 scale = scale || ".5"; 4242 4243 // Adjust and apply 4244 initialInUnit = initialInUnit / scale; 4245 jQuery.style(elem, prop, initialInUnit + unit); 4246 4247 // Update scale, tolerating zero or NaN from tween.cur() 4248 // Break the loop if scale is unchanged or perfect, or if we've just had enough. 4249 } while (scale !== (scale = currentValue() / initial) && scale !== 1 && --maxIterations); 4250 } 4251 4252 if (valueParts) { 4253 initialInUnit = +initialInUnit || +initial || 0; 4254 4255 // Apply relative offset (+=/-=) if specified 4256 adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2]; 4257 if (tween) { 4258 tween.unit = unit; 4259 tween.start = initialInUnit; 4260 tween.end = adjusted; 4261 } 4262 } 4263 return adjusted; 4264 } 4265 4266 // Multifunctional method to get and set values of a collection 4267 // The value/s can optionally be executed if it's a function 4268 var access = function (elems, fn, key, value, chainable, emptyGet, raw) { 4269 var i = 0, 4270 length = elems.length, 4271 bulk = key == null; 4272 4273 // Sets many values 4274 if (jQuery.type(key) === "object") { 4275 chainable = true; 4276 for (i in key) { 4277 access(elems, fn, i, key[i], true, emptyGet, raw); 4278 } 4279 4280 // Sets one value 4281 } else if (value !== undefined) { 4282 chainable = true; 4283 4284 if (!jQuery.isFunction(value)) { 4285 raw = true; 4286 } 4287 4288 if (bulk) { 4289 4290 // Bulk operations run against the entire set 4291 if (raw) { 4292 fn.call(elems, value); 4293 fn = null; 4294 4295 // ...except when executing function values 4296 } else { 4297 bulk = fn; 4298 fn = function (elem, key, value) {
4299 return bulk.call(jQuery(elem), value); 4300 }; 4301 } 4302 } 4303 4304 if (fn) { 4305 for (; i < length; i++) { 4306 fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key))); 4307 } 4308 } 4309 } 4310 4311 return chainable ? elems : 4312 4313 // Gets 4314 bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet; 4315 }; 4316 var rcheckableType = /^(?:checkbox|radio)$/i; 4317 4318 var rtagName = /<([\w:-]+)/; 4319 4320 var rscriptType = /^$|\/(?:java|ecma)script/i; 4321 4322 var rleadingWhitespace = /^\s+/; 4323 4324 var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + "details|dialog|figcaption|figure|footer|header|hgroup|main|" + "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; 4325 4326 function createSafeFragment(document) { 4327 var list = nodeNames.split("|"), 4328 safeFrag = document.createDocumentFragment(); 4329 4330 if (safeFrag.createElement) { 4331 while (list.length) { 4332 safeFrag.createElement(list.pop()); 4333 } 4334 } 4335 return safeFrag; 4336 } 4337 4338 (function () { 4339 var div = document.createElement("div"), 4340 fragment = document.createDocumentFragment(), 4341 input = document.createElement("input"); 4342 4343 // Setup 4344 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 4345 4346 // IE strips leading whitespace when .innerHTML is used 4347 support.leadingWhitespace = div.firstChild.nodeType === 3; 4348 4349 // Make sure that tbody elements aren't automatically inserted 4350 // IE will insert them into empty tables 4351 support.tbody = !div.getElementsByTagName("tbody").length; 4352 4353 // Make sure that link elements get serialized correctly by innerHTML 4354 // This requires a wrapper element in IE 4355 support.htmlSerialize = !!div.getElementsByTagName("link").length; 4356 4357 // Makes sure cloning an html5 element does not cause problems 4358 // Where outerHTML is undefined, this still works 4359 support.html5Clone = document.createElement("nav").cloneNode(true).outerHTML !== "<:nav></:nav>"; 4360 4361 // Check if a disconnected checkbox will retain its checked 4362 // value of true after appended to the DOM (IE6/7) 4363 input.type = "checkbox"; 4364 input.checked = true; 4365 fragment.appendChild(input); 4366 support.appendChecked = input.checked; 4367 4368 // Make sure textarea (and checkbox) defaultValue is properly cloned 4369 // Support: IE6-IE11+ 4370 div.innerHTML = "<textarea>x</textarea>"; 4371 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue; 4372 4373 // #11217 - WebKit loses check when the name is after the checked attribute 4374 fragment.appendChild(div); 4375 4376 // Support: Windows Web Apps (WWA) 4377 // `name` and `type` must use .setAttribute for WWA (#14901) 4378 input = document.createElement("input"); 4379 input.setAttribute("type", "radio"); 4380 input.setAttribute("checked", "checked"); 4381 input.setAttribute("name", "t"); 4382 4383 div.appendChild(input); 4384 4385 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 4386 // old WebKit doesn't clone checked state correctly in fragments 4387 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked; 4388 4389 // Support: IE<9 4390 // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ 4391 support.noCloneEvent = !!div.addEventListener; 4392 4393 // Support: IE<9 4394 // Since attributes and properties are the same in IE, 4395 // cleanData must set properties to undefined rather than use removeAttribute 4396 div[jQuery.expando] = 1; 4397 support.attributes = !div.getAttribute(jQuery.expando); 4398 })(); 4399 4400 // We have to close these tags to support XHTML (#13200) 4401 var wrapMap = { 4402 option: [1, "<select multiple='multiple'>", "</select>"], 4403 legend: [1, "<fieldset>", "</fieldset>"], 4404 area: [1, "<map>", "</map>"], 4405 4406 // Support: IE8 4407 param: [1, "<object>", "</object>"], 4408 thead: [1, "<table>", "</table>"], 4409 tr: [2, "<table><tbody>", "</tbody></table>"], 4410 col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], 4411 td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], 4412 4413 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, 4414 // unless wrapped in a div with non-breaking characters in front of it. 4415 _default: support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] 4416 }; 4417 4418 // Support: IE8-IE9 4419 wrapMap.optgroup = wrapMap.option; 4420 4421 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4422 wrapMap.th = wrapMap.td; 4423 4424 function getAll(context, tag) { 4425 var elems, 4426 elem, 4427 i = 0, 4428 found = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName(tag || "*") : typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll(tag || "*") : undefined; 4429 4430 if (!found) { 4431 for (found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++) { 4432 if (!tag || jQuery.nodeName(elem, tag)) { 4433 found.push(elem); 4434 } else { 4435 jQuery.merge(found, getAll(elem, tag)); 4436 } 4437 } 4438 } 4439 4440 return tag === undefined || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], found) : found; 4441 } 4442 4443 // Mark scripts as having already been evaluated 4444 function setGlobalEval(elems, refElements) { 4445 var elem, 4446 i = 0; 4447 for (; (elem = elems[i]) != null; i++) { 4448 jQuery._data(elem, "globalEval", !refElements || jQuery._data(refElements[i], "globalEval")); 4449 } 4450 } 4451
4452 var rhtml = /<|&#?\w+;/, 4453 rtbody = /<tbody/i; 4454 4455 function fixDefaultChecked(elem) { 4456 if (rcheckableType.test(elem.type)) { 4457 elem.defaultChecked = elem.checked; 4458 } 4459 } 4460 4461 function buildFragment(elems, context, scripts, selection, ignored) { 4462 var j, 4463 elem, 4464 contains, 4465 tmp, 4466 tag, 4467 tbody, 4468 wrap, 4469 l = elems.length, 4470 4471 4472 // Ensure a safe fragment 4473 safe = createSafeFragment(context), 4474 nodes = [], 4475 i = 0; 4476 4477 for (; i < l; i++) { 4478 elem = elems[i]; 4479 4480 if (elem || elem === 0) { 4481 4482 // Add nodes directly 4483 if (jQuery.type(elem) === "object") { 4484 jQuery.merge(nodes, elem.nodeType ? [elem] : elem); 4485 4486 // Convert non-html into a text node 4487 } else if (!rhtml.test(elem)) { 4488 nodes.push(context.createTextNode(elem)); 4489 4490 // Convert html into DOM nodes 4491 } else { 4492 tmp = tmp || safe.appendChild(context.createElement("div")); 4493 4494 // Deserialize a standard representation 4495 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(); 4496 wrap = wrapMap[tag] || wrapMap._default; 4497 4498 tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2]; 4499 4500 // Descend through wrappers to the right content 4501 j = wrap[0]; 4502 while (j--) { 4503 tmp = tmp.lastChild; 4504 } 4505 4506 // Manually add leading whitespace removed by IE 4507 if (!support.leadingWhitespace && rleadingWhitespace.test(elem)) { 4508 nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0])); 4509 } 4510 4511 // Remove IE's autoinserted <tbody> from table fragments 4512 if (!support.tbody) { 4513 4514 // String was a <table>, *may* have spurious <tbody> 4515 elem = tag === "table" && !rtbody.test(elem) ? tmp.firstChild : 4516 4517 // String was a bare <thead> or <tfoot> 4518 wrap[1] === "<table>" && !rtbody.test(elem) ? tmp : 0; 4519 4520 j = elem && elem.childNodes.length; 4521 while (j--) { 4522 if (jQuery.nodeName(tbody = elem.childNodes[j], "tbody") && !tbody.childNodes.length) { 4523 4524 elem.removeChild(tbody); 4525 } 4526 } 4527 } 4528 4529 jQuery.merge(nodes, tmp.childNodes); 4530 4531 // Fix #12392 for WebKit and IE > 9 4532 tmp.textContent = ""; 4533 4534 // Fix #12392 for oldIE 4535 while (tmp.firstChild) { 4536 tmp.removeChild(tmp.firstChild); 4537 } 4538 4539 // Remember the top-level container for proper cleanup 4540 tmp = safe.lastChild; 4541 } 4542 } 4543 } 4544 4545 // Fix #11356: Clear elements from fragment 4546 if (tmp) { 4547 safe.removeChild(tmp); 4548 } 4549 4550 // Reset defaultChecked for any radios and checkboxes 4551 // about to be appended to the DOM in IE 6/7 (#8060) 4552 if (!support.appendChecked) { 4553 jQuery.grep(getAll(nodes, "input"), fixDefaultChecked); 4554 } 4555 4556 i = 0; 4557 while (elem = nodes[i++]) { 4558 4559 // Skip elements already in the context collection (trac-4087) 4560 if (selection && jQuery.inArray(elem, selection) > -1) { 4561 if (ignored) { 4562 ignored.push(elem); 4563 } 4564 4565 continue; 4566 } 4567 4568 contains = jQuery.contains(elem.ownerDocument, elem); 4569 4570 // Append to fragment 4571 tmp = getAll(safe.appendChild(elem), "script"); 4572 4573 // Preserve script evaluation history 4574 if (contains) { 4575 setGlobalEval(tmp); 4576 } 4577 4578 // Capture executables 4579 if (scripts) { 4580 j = 0; 4581 while (elem = tmp[j++]) { 4582 if (rscriptType.test(elem.type || "")) { 4583 scripts.push(elem); 4584 } 4585 } 4586 } 4587 } 4588 4589 tmp = null; 4590 4591 return safe; 4592 } 4593 4594 (function () { 4595 var i, 4596 eventName, 4597 div = document.createElement("div"); 4598 4599 // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) 4600 for (i in { submit: true, change: true, focusin: true }) { 4601 eventName = "on" + i; 4602
vendor: 28,100 bytes, lines 4603-5571
4603 if (!(support[i] = eventName in window)) { 4604 4605 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) 4606 div.setAttribute(eventName, "t"); 4607 support[i] = div.attributes[eventName].expando === false; 4608 } 4609 } 4610 4611 // Null elements to avoid leaks in IE. 4612 div = null; 4613 })(); 4614 4615 var rformElems = /^(?:input|select|textarea)$/i, 4616 rkeyEvent = /^key/, 4617 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 4618 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 4619 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 4620 4621 function returnTrue() { 4622 return true; 4623 } 4624 4625 function returnFalse() { 4626 return false; 4627 } 4628 4629 // Support: IE9 4630 // See #13393 for more info 4631 function safeActiveElement() { 4632 try { 4633 return document.activeElement; 4634 } catch (err) {} 4635 } 4636 4637 function on(elem, types, selector, data, fn, one) { 4638 var origFn, type; 4639 4640 // Types can be a map of types/handlers 4641 if (typeof types === "object") { 4642 4643 // ( types-Object, selector, data ) 4644 if (typeof selector !== "string") { 4645 4646 // ( types-Object, data ) 4647 data = data || selector; 4648 selector = undefined; 4649 } 4650 for (type in types) { 4651 on(elem, type, selector, data, types[type], one); 4652 } 4653 return elem; 4654 } 4655 4656 if (data == null && fn == null) { 4657 4658 // ( types, fn ) 4659 fn = selector; 4660 data = selector = undefined; 4661 } else if (fn == null) { 4662 if (typeof selector === "string") { 4663 4664 // ( types, selector, fn ) 4665 fn = data; 4666 data = undefined; 4667 } else { 4668 4669 // ( types, data, fn ) 4670 fn = data; 4671 data = selector; 4672 selector = undefined; 4673 } 4674 } 4675 if (fn === false) { 4676 fn = returnFalse; 4677 } else if (!fn) { 4678 return elem; 4679 } 4680 4681 if (one === 1) { 4682 origFn = fn; 4683 fn = function (event) { 4684 4685 // Can use an empty set, since event contains the info 4686 jQuery().off(event); 4687 return origFn.apply(this, arguments); 4688 }; 4689 4690 // Use same guid so caller can remove using origFn 4691 fn.guid = origFn.guid || (origFn.guid = jQuery.guid++); 4692 } 4693 return elem.each(function () { 4694 jQuery.event.add(this, types, fn, data, selector); 4695 }); 4696 } 4697 4698 /* 4699 * Helper functions for managing events -- not part of the public interface. 4700 * Props to Dean Edwards' addEvent library for many of the ideas. 4701 */ 4702 jQuery.event = { 4703 4704 global: {}, 4705 4706 add: function (elem, types, handler, data, selector) { 4707 var tmp, 4708 events, 4709 t, 4710 handleObjIn, 4711 special, 4712 eventHandle, 4713 handleObj, 4714 handlers, 4715 type, 4716 namespaces, 4717 origType, 4718 elemData = jQuery._data(elem); 4719 4720 // Don't attach events to noData or text/comment nodes (but allow plain objects) 4721 if (!elemData) { 4722 return; 4723 } 4724 4725 // Caller can pass in an object of custom data in lieu of the handler 4726 if (handler.handler) { 4727 handleObjIn = handler; 4728 handler = handleObjIn.handler; 4729 selector = handleObjIn.selector; 4730 } 4731 4732 // Make sure that the handler has a unique ID, used to find/remove it later 4733 if (!handler.guid) { 4734 handler.guid = jQuery.guid++; 4735 } 4736 4737 // Init the element's event structure and main handler, if this is the first 4738 if (!(events = elemData.events)) { 4739 events = elemData.events = {}; 4740 } 4741 if (!(eventHandle = elemData.handle)) { 4742 eventHandle = elemData.handle = function (e) { 4743 4744 // Discard the second event of a jQuery.event.trigger() and 4745 // when an event is called after a page has unloaded 4746 return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply(eventHandle.elem, arguments) : undefined; 4747 }; 4748 4749 // Add elem as a property of the handle fn to prevent a memory leak 4750 // with IE non-native events 4751 eventHandle.elem = elem; 4752 } 4753 4754 // Handle multiple events separated by a space 4755 types = (types || "").match(rnotwhite) || [""]; 4756 t = types.length; 4757 while (t--) { 4758 tmp = rtypenamespace.exec(types[t]) || []; 4759 type = origType = tmp[1]; 4760 namespaces = (tmp[2] || "").split(".").sort(); 4761 4762 // There *must* be a type, no attaching namespace-only handlers 4763 if (!type) { 4764 continue; 4765 } 4766 4767 // If event changes its type, use the special event handlers for the changed type 4768 special = jQuery.event.special[type] || {}; 4769 4770 // If selector defined, determine special event api type, otherwise given type 4771 type = (selector ? special.delegateType : special.bindType) || type; 4772 4773 // Update special based on newly reset type 4774 special = jQuery.event.special[type] || {}; 4775 4776 // handleObj is passed to all event handlers 4777 handleObj = jQuery.extend({ 4778 type: type, 4779 origType: origType, 4780 data: data, 4781 handler: handler, 4782 guid: handler.guid, 4783 selector: selector, 4784 needsContext: selector && jQuery.expr.match.needsContext.test(selector), 4785 namespace: namespaces.join(".") 4786 }, handleObjIn); 4787 4788 // Init the event handler queue if we're the first 4789 if (!(handlers = events[type])) { 4790 handlers = events[type] = []; 4791 handlers.delegateCount = 0; 4792 4793 // Only use addEventListener/attachEvent if the special events handler returns false 4794 if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) { 4795 4796 // Bind the global event handler to the element 4797 if (elem.addEventListener) { 4798 elem.addEventListener(type, eventHandle, false); 4799 } else if (elem.attachEvent) { 4800 elem.attachEvent("on" + type, eventHandle); 4801 } 4802 } 4803 } 4804 4805 if (special.add) { 4806 special.add.call(elem, handleObj); 4807 4808 if (!handleObj.handler.guid) { 4809 handleObj.handler.guid = handler.guid; 4810 } 4811 } 4812 4813 // Add to the element's handler list, delegates in front 4814 if (selector) { 4815 handlers.splice(handlers.delegateCount++, 0, handleObj); 4816 } else { 4817 handlers.push(handleObj); 4818 } 4819 4820 // Keep track of which events have ever been used, for event optimization 4821 jQuery.event.global[type] = true; 4822 } 4823 4824 // Nullify elem to prevent memory leaks in IE 4825 elem = null; 4826 }, 4827 4828 // Detach an event or set of events from an element 4829 remove: function (elem, types, handler, selector, mappedTypes) { 4830 var j, 4831 handleObj, 4832 tmp, 4833 origCount, 4834 t, 4835 events, 4836 special, 4837 handlers, 4838 type, 4839 namespaces, 4840 origType, 4841 elemData = jQuery.hasData(elem) && jQuery._data(elem); 4842 4843 if (!elemData || !(events = elemData.events)) { 4844 return; 4845 } 4846 4847 // Once for each type.namespace in types; type may be omitted 4848 types = (types || "").match(rnotwhite) || [""]; 4849 t = types.length; 4850 while (t--) { 4851 tmp = rtypenamespace.exec(types[t]) || []; 4852 type = origType = tmp[1]; 4853 namespaces = (tmp[2] || "").split(".").sort(); 4854 4855 // Unbind all events (on this namespace, if provided) for the element 4856 if (!type) { 4857 for (type in events) { 4858 jQuery.event.remove(elem, type + types[t], handler, selector, true); 4859 } 4860 continue; 4861 } 4862 4863 special = jQuery.event.special[type] || {}; 4864 type = (selector ? special.delegateType : special.bindType) || type; 4865 handlers = events[type] || []; 4866 tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"); 4867 4868 // Remove matching events 4869 origCount = j = handlers.length; 4870 while (j--) { 4871 handleObj = handlers[j]; 4872 4873 if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) { 4874 handlers.splice(j, 1); 4875 4876 if (handleObj.selector) { 4877 handlers.delegateCount--; 4878 } 4879 if (special.remove) { 4880 special.remove.call(elem, handleObj); 4881 } 4882 } 4883 } 4884 4885 // Remove generic event handler if we removed something and no more handlers exist 4886 // (avoids potential for endless recursion during removal of special event handlers) 4887 if (origCount && !handlers.length) { 4888 if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) { 4889 4890 jQuery.removeEvent(elem, type, elemData.handle); 4891 } 4892 4893 delete events[type]; 4894 } 4895 } 4896 4897 // Remove the expando if it's no longer used 4898 if (jQuery.isEmptyObject(events)) { 4899 delete elemData.handle; 4900 4901 // removeData also checks for emptiness and clears the expando if empty 4902 // so use it instead of delete 4903 jQuery._removeData(elem, "events"); 4904 } 4905 }, 4906 4907 trigger: function (event, data, elem, onlyHandlers) { 4908 var handle, 4909 ontype, 4910 cur, 4911 bubbleType, 4912 special, 4913 tmp, 4914 i, 4915 eventPath = [elem || document], 4916 type = hasOwn.call(event, "type") ? event.type : event, 4917 namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : []; 4918 4919 cur = tmp = elem = elem || document; 4920 4921 // Don't do events on text and comment nodes 4922 if (elem.nodeType === 3 || elem.nodeType === 8) { 4923 return; 4924 } 4925 4926 // focus/blur morphs to focusin/out; ensure we're not firing them right now 4927 if (rfocusMorph.test(type + jQuery.event.triggered)) { 4928 return; 4929 } 4930 4931 if (type.indexOf(".") > -1) { 4932 4933 // Namespaced trigger; create a regexp to match event type in handle() 4934 namespaces = type.split("."); 4935 type = namespaces.shift(); 4936 namespaces.sort(); 4937 } 4938 ontype = type.indexOf(":") < 0 && "on" + type; 4939 4940 // Caller can pass in a jQuery.Event object, Object, or just an event type string 4941 event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event); 4942 4943 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 4944 event.isTrigger = onlyHandlers ? 2 : 3; 4945 event.namespace = namespaces.join("."); 4946 event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; 4947 4948 // Clean up the event in case it is being reused 4949 event.result = undefined; 4950 if (!event.target) { 4951 event.target = elem; 4952 } 4953 4954 // Clone any incoming data and prepend the event, creating the handler arg list 4955 data = data == null ? [event] : jQuery.makeArray(data, [event]); 4956 4957 // Allow special events to draw outside the lines 4958 special = jQuery.event.special[type] || {}; 4959 if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) { 4960 return; 4961 } 4962 4963 // Determine event propagation path in advance, per W3C events spec (#9951) 4964 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 4965 if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) { 4966 4967 bubbleType = special.delegateType || type; 4968 if (!rfocusMorph.test(bubbleType + type)) { 4969 cur = cur.parentNode; 4970 } 4971 for (; cur; cur = cur.parentNode) { 4972 eventPath.push(cur); 4973 tmp = cur; 4974 } 4975 4976 // Only add window if we got to document (e.g., not plain obj or detached DOM) 4977 if (tmp === (elem.ownerDocument || document)) { 4978 eventPath.push(tmp.defaultView || tmp.parentWindow || window); 4979 } 4980 } 4981 4982 // Fire handlers on the event path 4983 i = 0; 4984 while ((cur = eventPath[i++]) && !event.isPropagationStopped()) { 4985 4986 event.type = i > 1 ? bubbleType : special.bindType || type; 4987 4988 // jQuery handler 4989 handle = (jQuery._data(cur, "events") || {})[event.type] && jQuery._data(cur, "handle"); 4990 4991 if (handle) { 4992 handle.apply(cur, data); 4993 } 4994 4995 // Native handler 4996 handle = ontype && cur[ontype]; 4997 if (handle && handle.apply && acceptData(cur)) { 4998 event.result = handle.apply(cur, data); 4999 if (event.result === false) { 5000 event.preventDefault(); 5001 } 5002 } 5003 } 5004 event.type = type; 5005 5006 // If nobody prevented the default action, do it now 5007 if (!onlyHandlers && !event.isDefaultPrevented()) { 5008 5009 if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) { 5010 5011 // Call a native DOM method on the target with the same name name as the event. 5012 // Can't use an .isFunction() check here because IE6/7 fails that test. 5013 // Don't do default actions on window, that's where global variables be (#6170) 5014 if (ontype && elem[type] && !jQuery.isWindow(elem)) { 5015 5016 // Don't re-trigger an onFOO event when we call its FOO() method 5017 tmp = elem[ontype]; 5018 5019 if (tmp) { 5020 elem[ontype] = null; 5021 } 5022 5023 // Prevent re-triggering of the same event, since we already bubbled it above 5024 jQuery.event.triggered = type; 5025 try { 5026 elem[type](); 5027 } catch (e) { 5028 5029 // IE<9 dies on focus/blur to hidden element (#1486,#12518) 5030 // only reproducible on winXP IE8 native, not IE9 in IE8 mode 5031 } 5032 jQuery.event.triggered = undefined; 5033 5034 if (tmp) { 5035 elem[ontype] = tmp; 5036 } 5037 } 5038 } 5039 } 5040 5041 return event.result; 5042 }, 5043 5044 dispatch: function (event) { 5045 5046 // Make a writable jQuery.Event from the native event object 5047 event = jQuery.event.fix(event); 5048 5049 var i, 5050 j, 5051 ret, 5052 matched, 5053 handleObj, 5054 handlerQueue = [], 5055 args = slice.call(arguments), 5056 handlers = (jQuery._data(this, "events") || {})[event.type] || [], 5057 special = jQuery.event.special[event.type] || {}; 5058 5059 // Use the fix-ed jQuery.Event rather than the (read-only) native event 5060 args[0] = event; 5061 event.delegateTarget = this; 5062 5063 // Call the preDispatch hook for the mapped type, and let it bail if desired 5064 if (special.preDispatch && special.preDispatch.call(this, event) === false) { 5065 return; 5066 } 5067 5068 // Determine handlers 5069 handlerQueue = jQuery.event.handlers.call(this, event, handlers); 5070 5071 // Run delegates first; they may want to stop propagation beneath us 5072 i = 0; 5073 while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) { 5074 event.currentTarget = matched.elem; 5075 5076 j = 0; 5077 while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) { 5078 5079 // Triggered event must either 1) have no namespace, or 2) have namespace(s) 5080 // a subset or equal to those in the bound event (both can have no namespace). 5081 if (!event.rnamespace || event.rnamespace.test(handleObj.namespace)) { 5082 5083 event.handleObj = handleObj; 5084 event.data = handleObj.data; 5085 5086 ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args); 5087 5088 if (ret !== undefined) { 5089 if ((event.result = ret) === false) { 5090 event.preventDefault(); 5091 event.stopPropagation(); 5092 } 5093 } 5094 } 5095 } 5096 } 5097 5098 // Call the postDispatch hook for the mapped type 5099 if (special.postDispatch) { 5100 special.postDispatch.call(this, event); 5101 } 5102 5103 return event.result; 5104 }, 5105 5106 handlers: function (event, handlers) { 5107 var i, 5108 matches, 5109 sel, 5110 handleObj, 5111 handlerQueue = [], 5112 delegateCount = handlers.delegateCount, 5113 cur = event.target; 5114 5115 // Support (at least): Chrome, IE9 5116 // Find delegate handlers 5117 // Black-hole SVG <use> instance trees (#13180) 5118 // 5119 // Support: Firefox<=42+ 5120 // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) 5121 if (delegateCount && cur.nodeType && (event.type !== "click" || isNaN(event.button) || event.button < 1)) { 5122 5123 /* jshint eqeqeq: false */ 5124 for (; cur != this; cur = cur.parentNode || this) { 5125 /* jshint eqeqeq: true */ 5126 5127 // Don't check non-elements (#13208) 5128 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 5129 if (cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click")) { 5130 matches = []; 5131 for (i = 0; i < delegateCount; i++) { 5132 handleObj = handlers[i]; 5133 5134 // Don't conflict with Object.prototype properties (#13203) 5135 sel = handleObj.selector + " "; 5136 5137 if (matches[sel] === undefined) { 5138 matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length; 5139 } 5140 if (matches[sel]) { 5141 matches.push(handleObj); 5142 } 5143 } 5144 if (matches.length) { 5145 handlerQueue.push({ elem: cur, handlers: matches }); 5146 } 5147 } 5148 } 5149 } 5150 5151 // Add the remaining (directly-bound) handlers 5152 if (delegateCount < handlers.length) { 5153 handlerQueue.push({ elem: this, handlers: handlers.slice(delegateCount) }); 5154 } 5155 5156 return handlerQueue; 5157 }, 5158 5159 fix: function (event) { 5160 if (event[jQuery.expando]) { 5161 return event; 5162 } 5163 5164 // Create a writable copy of the event object and normalize some properties 5165 var i, 5166 prop, 5167 copy, 5168 type = event.type, 5169 originalEvent = event, 5170 fixHook = this.fixHooks[type]; 5171 5172 if (!fixHook) { 5173 this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type) ? this.keyHooks : {}; 5174 } 5175 copy = fixHook.props ? this.props.concat(fixHook.props) : this.props; 5176 5177 event = new jQuery.Event(originalEvent); 5178 5179 i = copy.length; 5180 while (i--) { 5181 prop = copy[i]; 5182 event[prop] = originalEvent[prop]; 5183 } 5184 5185 // Support: IE<9 5186 // Fix target property (#1925) 5187 if (!event.target) { 5188 event.target = originalEvent.srcElement || document; 5189 } 5190 5191 // Support: Safari 6-8+ 5192 // Target should not be a text node (#504, #13143) 5193 if (event.target.nodeType === 3) { 5194 event.target = event.target.parentNode; 5195 } 5196 5197 // Support: IE<9 5198 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) 5199 event.metaKey = !!event.metaKey; 5200 5201 return fixHook.filter ? fixHook.filter(event, originalEvent) : event; 5202 }, 5203 5204 // Includes some event props shared by KeyEvent and MouseEvent 5205 props: ("altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + "metaKey relatedTarget shiftKey target timeStamp view which").split(" "), 5206 5207 fixHooks: {}, 5208 5209 keyHooks: { 5210 props: "char charCode key keyCode".split(" "), 5211 filter: function (event, original) { 5212 5213 // Add which for key events 5214 if (event.which == null) { 5215 event.which = original.charCode != null ? original.charCode : original.keyCode; 5216 } 5217 5218 return event; 5219 } 5220 }, 5221 5222 mouseHooks: { 5223 props: ("button buttons clientX clientY fromElement offsetX offsetY " + "pageX pageY screenX screenY toElement").split(" "), 5224 filter: function (event, original) { 5225 var body, 5226 eventDoc, 5227 doc, 5228 button = original.button, 5229 fromElement = original.fromElement; 5230 5231 // Calculate pageX/Y if missing and clientX/Y available 5232 if (event.pageX == null && original.clientX != null) { 5233 eventDoc = event.target.ownerDocument || document; 5234 doc = eventDoc.documentElement; 5235 body = eventDoc.body; 5236 5237 event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); 5238 event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); 5239 } 5240 5241 // Add relatedTarget, if necessary 5242 if (!event.relatedTarget && fromElement) { 5243 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; 5244 } 5245 5246 // Add which for click: 1 === left; 2 === middle; 3 === right 5247 // Note: button is not normalized, so don't use it 5248 if (!event.which && button !== undefined) { 5249 event.which = button & 1 ? 1 : button & 2 ? 3 : button & 4 ? 2 : 0; 5250 } 5251 5252 return event; 5253 } 5254 }, 5255 5256 special: { 5257 load: { 5258 5259 // Prevent triggered image.load events from bubbling to window.load 5260 noBubble: true 5261 }, 5262 focus: { 5263 5264 // Fire native event if possible so blur/focus sequence is correct 5265 trigger: function () { 5266 if (this !== safeActiveElement() && this.focus) { 5267 try { 5268 this.focus(); 5269 return false; 5270 } catch (e) { 5271 5272 // Support: IE<9 5273 // If we error on focus to hidden element (#1486, #12518), 5274 // let .trigger() run the handlers 5275 } 5276 } 5277 }, 5278 delegateType: "focusin" 5279 }, 5280 blur: { 5281 trigger: function () { 5282 if (this === safeActiveElement() && this.blur) { 5283 this.blur(); 5284 return false; 5285 } 5286 }, 5287 delegateType: "focusout" 5288 }, 5289 click: { 5290 5291 // For checkbox, fire native event so checked state will be right 5292 trigger: function () { 5293 if (jQuery.nodeName(this, "input") && this.type === "checkbox" && this.click) { 5294 this.click(); 5295 return false; 5296 } 5297 }, 5298 5299 // For cross-browser consistency, don't fire native .click() on links 5300 _default: function (event) { 5301 return jQuery.nodeName(event.target, "a"); 5302 } 5303 }, 5304 5305 beforeunload: { 5306 postDispatch: function (event) { 5307 5308 // Support: Firefox 20+ 5309 // Firefox doesn't alert if the returnValue field is not set. 5310 if (event.result !== undefined && event.originalEvent) { 5311 event.originalEvent.returnValue = event.result; 5312 } 5313 } 5314 } 5315 }, 5316 5317 // Piggyback on a donor event to simulate a different one 5318 simulate: function (type, elem, event) { 5319 var e = jQuery.extend(new jQuery.Event(), event, { 5320 type: type, 5321 isSimulated: true 5322 5323 // Previously, `originalEvent: {}` was set here, so stopPropagation call 5324 // would not be triggered on donor event, since in our own 5325 // jQuery.event.stopPropagation function we had a check for existence of 5326 // originalEvent.stopPropagation method, so, consequently it would be a noop. 5327 // 5328 // Guard for simulated events was moved to jQuery.event.stopPropagation function 5329 // since `originalEvent` should point to the original event for the 5330 // constancy with other events and for more focused logic 5331 }); 5332 5333 jQuery.event.trigger(e, null, elem); 5334 5335 if (e.isDefaultPrevented()) { 5336 event.preventDefault(); 5337 } 5338 } 5339 }; 5340 5341 jQuery.removeEvent = document.removeEventListener ? function (elem, type, handle) { 5342 5343 // This "if" is needed for plain objects 5344 if (elem.removeEventListener) { 5345 elem.removeEventListener(type, handle); 5346 } 5347 } : function (elem, type, handle) { 5348 var name = "on" + type; 5349 5350 if (elem.detachEvent) { 5351 5352 // #8545, #7054, preventing memory leaks for custom events in IE6-8 5353 // detachEvent needed property on element, by name of that event, 5354 // to properly expose it to GC 5355 if (typeof elem[name] === "undefined") { 5356 elem[name] = null; 5357 } 5358 5359 elem.detachEvent(name, handle); 5360 } 5361 }; 5362 5363 jQuery.Event = function (src, props) { 5364 5365 // Allow instantiation without the 'new' keyword 5366 if (!(this instanceof jQuery.Event)) { 5367 return new jQuery.Event(src, props); 5368 } 5369 5370 // Event object 5371 if (src && src.type) { 5372 this.originalEvent = src; 5373 this.type = src.type; 5374 5375 // Events bubbling up the document may have been marked as prevented 5376 // by a handler lower down the tree; reflect the correct value. 5377 this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && 5378 5379 // Support: IE < 9, Android < 4.0 5380 src.returnValue === false ? returnTrue : returnFalse; 5381 5382 // Event type 5383 } else { 5384 this.type = src; 5385 } 5386 5387 // Put explicitly provided properties onto the event object 5388 if (props) { 5389 jQuery.extend(this, props); 5390 } 5391 5392 // Create a timestamp if incoming event doesn't have one 5393 this.timeStamp = src && src.timeStamp || jQuery.now(); 5394 5395 // Mark it as fixed 5396 this[jQuery.expando] = true; 5397 }; 5398 5399 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 5400 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 5401 jQuery.Event.prototype = { 5402 constructor: jQuery.Event, 5403 isDefaultPrevented: returnFalse, 5404 isPropagationStopped: returnFalse, 5405 isImmediatePropagationStopped: returnFalse, 5406 5407 preventDefault: function () { 5408 var e = this.originalEvent; 5409 5410 this.isDefaultPrevented = returnTrue; 5411 if (!e) { 5412 return; 5413 } 5414 5415 // If preventDefault exists, run it on the original event 5416 if (e.preventDefault) { 5417 e.preventDefault(); 5418 5419 // Support: IE 5420 // Otherwise set the returnValue property of the original event to false 5421 } else { 5422 e.returnValue = false; 5423 } 5424 }, 5425 stopPropagation: function () { 5426 var e = this.originalEvent; 5427 5428 this.isPropagationStopped = returnTrue; 5429 5430 if (!e || this.isSimulated) { 5431 return; 5432 } 5433 5434 // If stopPropagation exists, run it on the original event 5435 if (e.stopPropagation) { 5436 e.stopPropagation(); 5437 } 5438 5439 // Support: IE 5440 // Set the cancelBubble property of the original event to true 5441 e.cancelBubble = true; 5442 }, 5443 stopImmediatePropagation: function () { 5444 var e = this.originalEvent; 5445 5446 this.isImmediatePropagationStopped = returnTrue; 5447 5448 if (e && e.stopImmediatePropagation) { 5449 e.stopImmediatePropagation(); 5450 } 5451 5452 this.stopPropagation(); 5453 } 5454 }; 5455 5456 // Create mouseenter/leave events using mouseover/out and event-time checks 5457 // so that event delegation works in jQuery. 5458 // Do the same for pointerenter/pointerleave and pointerover/pointerout 5459 // 5460 // Support: Safari 7 only 5461 // Safari sends mouseenter too often; see: 5462 // https://code.google.com/p/chromium/issues/detail?id=470258 5463 // for the description of the bug (it existed in older Chrome versions as well). 5464 jQuery.each({ 5465 mouseenter: "mouseover", 5466 mouseleave: "mouseout", 5467 pointerenter: "pointerover", 5468 pointerleave: "pointerout" 5469 }, function (orig, fix) { 5470 jQuery.event.special[orig] = { 5471 delegateType: fix, 5472 bindType: fix, 5473 5474 handle: function (event) { 5475 var ret, 5476 target = this, 5477 related = event.relatedTarget, 5478 handleObj = event.handleObj; 5479 5480 // For mouseenter/leave call the handler if related is outside the target. 5481 // NB: No relatedTarget if the mouse left/entered the browser window 5482 if (!related || related !== target && !jQuery.contains(target, related)) { 5483 event.type = handleObj.origType; 5484 ret = handleObj.handler.apply(this, arguments); 5485 event.type = fix; 5486 } 5487 return ret; 5488 } 5489 }; 5490 }); 5491 5492 // IE submit delegation 5493 if (!support.submit) { 5494 5495 jQuery.event.special.submit = { 5496 setup: function () { 5497 5498 // Only need this for delegated form submit events 5499 if (jQuery.nodeName(this, "form")) { 5500 return false; 5501 } 5502 5503 // Lazy-add a submit handler when a descendant form may potentially be submitted 5504 jQuery.event.add(this, "click._submit keypress._submit", function (e) { 5505 5506 // Node name check avoids a VML-related crash in IE (#9807) 5507 var elem = e.target, 5508 form = jQuery.nodeName(elem, "input") || jQuery.nodeName(elem, "button") ? 5509 5510 // Support: IE <=8 5511 // We use jQuery.prop instead of elem.form 5512 // to allow fixing the IE8 delegated submit issue (gh-2332) 5513 // by 3rd party polyfills/workarounds. 5514 jQuery.prop(elem, "form") : undefined; 5515 5516 if (form && !jQuery._data(form, "submit")) { 5517 jQuery.event.add(form, "submit._submit", function (event) { 5518 event._submitBubble = true; 5519 }); 5520 jQuery._data(form, "submit", true); 5521 } 5522 }); 5523 5524 // return undefined since we don't need an event listener 5525 }, 5526 5527 postDispatch: function (event) { 5528 5529 // If form was submitted by the user, bubble the event up the tree 5530 if (event._submitBubble) { 5531 delete event._submitBubble; 5532 if (this.parentNode && !event.isTrigger) { 5533 jQuery.event.simulate("submit", this.parentNode, event); 5534 } 5535 } 5536 }, 5537 5538 teardown: function () { 5539 5540 // Only need this for delegated form submit events 5541 if (jQuery.nodeName(this, "form")) { 5542 return false; 5543 } 5544 5545 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above 5546 jQuery.event.remove(this, "._submit"); 5547 } 5548 }; 5549 } 5550 5551 // IE change delegation and checkbox/radio fix 5552 if (!support.change) { 5553 5554 jQuery.event.special.change = { 5555 5556 setup: function () { 5557 5558 if (rformElems.test(this.nodeName)) { 5559 5560 // IE doesn't fire change on a check/radio until blur; trigger it on click 5561 // after a propertychange. Eat the blur-change in special.change.handle. 5562 // This still fires onchange a second time for check/radio after blur. 5563 if (this.type === "checkbox" || this.type === "radio") { 5564 jQuery.event.add(this, "propertychange._change", function (event) { 5565 if (event.originalEvent.propertyName === "checked") { 5566 this._justChanged = true; 5567 } 5568 }); 5569 jQuery.event.add(this, "click._change", function (event) { 5570 if (this._justChanged && !event.isTrigger) { 5571 this._justChanged = false;
5572 } 5573 5574 // Allow triggered, simulated change events (#11500) 5575 jQuery.event.simulate("change", this, event); 5576 }); 5577 } 5578 return false; 5579 } 5580 5581 // Delegated event; lazy-add a change handler on descendant inputs 5582 jQuery.event.add(this, "beforeactivate._change", function (e) { 5583 var elem = e.target; 5584 5585 if (rformElems.test(elem.nodeName) && !jQuery._data(elem, "change")) { 5586 jQuery.event.add(elem, "change._change", function (event) { 5587 if (this.parentNode && !event.isSimulated && !event.isTrigger) { 5588 jQuery.event.simulate("change", this.parentNode, event); 5589 } 5590 }); 5591 jQuery._data(elem, "change", true); 5592 } 5593 }); 5594 }, 5595 5596 handle: function (event) { 5597 var elem = event.target; 5598 5599 // Swallow native change events from checkbox/radio, we already triggered them above 5600 if (this !== elem || event.isSimulated || event.isTrigger || elem.type !== "radio" && elem.type !== "checkbox") { 5601 5602 return event.handleObj.handler.apply(this, arguments); 5603 } 5604 }, 5605 5606 teardown: function () { 5607 jQuery.event.remove(this, "._change"); 5608 5609 return !rformElems.test(this.nodeName); 5610 } 5611 }; 5612 } 5613 5614 // Support: Firefox 5615 // Firefox doesn't have focus(in | out) events
vendor: 1,180 bytes, lines 5616-5647
5616 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 5617 // 5618 // Support: Chrome, Safari 5619 // focus(in | out) events fire after focus & blur events, 5620 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 5621 // Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 5622 if (!support.focusin) { 5623 jQuery.each({ focus: "focusin", blur: "focusout" }, function (orig, fix) { 5624 5625 // Attach a single capturing handler on the document while someone wants focusin/focusout 5626 var handler = function (event) { 5627 jQuery.event.simulate(fix, event.target, jQuery.event.fix(event)); 5628 }; 5629 5630 jQuery.event.special[fix] = { 5631 setup: function () { 5632 var doc = this.ownerDocument || this, 5633 attaches = jQuery._data(doc, fix); 5634 5635 if (!attaches) { 5636 doc.addEventListener(orig, handler, true); 5637 } 5638 jQuery._data(doc, fix, (attaches || 0) + 1); 5639 }, 5640 teardown: function () { 5641 var doc = this.ownerDocument || this, 5642 attaches = jQuery._data(doc, fix) - 1; 5643 5644 if (!attaches) { 5645 doc.removeEventListener(orig, handler, true); 5646 jQuery._removeData(doc, fix); 5647 } else {
vendor: 11,646 bytes, lines 5648-6057
5648 jQuery._data(doc, fix, attaches); 5649 } 5650 } 5651 }; 5652 }); 5653 } 5654 5655 jQuery.fn.extend({ 5656 5657 on: function (types, selector, data, fn) { 5658 return on(this, types, selector, data, fn); 5659 }, 5660 one: function (types, selector, data, fn) { 5661 return on(this, types, selector, data, fn, 1); 5662 }, 5663 off: function (types, selector, fn) { 5664 var handleObj, type; 5665 if (types && types.preventDefault && types.handleObj) { 5666 5667 // ( event ) dispatched jQuery.Event 5668 handleObj = types.handleObj; 5669 jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler); 5670 return this; 5671 } 5672 if (typeof types === "object") { 5673 5674 // ( types-object [, selector] ) 5675 for (type in types) { 5676 this.off(type, selector, types[type]); 5677 } 5678 return this; 5679 } 5680 if (selector === false || typeof selector === "function") { 5681 5682 // ( types [, fn] ) 5683 fn = selector; 5684 selector = undefined; 5685 } 5686 if (fn === false) { 5687 fn = returnFalse; 5688 } 5689 return this.each(function () { 5690 jQuery.event.remove(this, types, fn, selector); 5691 }); 5692 }, 5693 5694 trigger: function (type, data) { 5695 return this.each(function () { 5696 jQuery.event.trigger(type, data, this); 5697 }); 5698 }, 5699 triggerHandler: function (type, data) { 5700 var elem = this[0]; 5701 if (elem) { 5702 return jQuery.event.trigger(type, data, elem, true); 5703 } 5704 } 5705 }); 5706 5707 var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, 5708 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), 5709 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, 5710 5711 5712 // Support: IE 10-11, Edge 10240+ 5713 // In IE/Edge using regex groups here causes severe slowdowns. 5714 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 5715 rnoInnerhtml = /<script|<style|<link/i, 5716 5717 5718 // checked="checked" or checked 5719 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5720 rscriptTypeMasked = /^true\/(.*)/, 5721 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, 5722 safeFragment = createSafeFragment(document), 5723 fragmentDiv = safeFragment.appendChild(document.createElement("div")); 5724 5725 // Support: IE<8 5726 // Manipulating tables requires a tbody 5727 function manipulationTarget(elem, content) { 5728 return jQuery.nodeName(elem, "table") && jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr") ? elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody")) : elem; 5729 } 5730 5731 // Replace/restore the type attribute of script elements for safe DOM manipulation 5732 function disableScript(elem) { 5733 elem.type = (jQuery.find.attr(elem, "type") !== null) + "/" + elem.type; 5734 return elem; 5735 } 5736 function restoreScript(elem) { 5737 var match = rscriptTypeMasked.exec(elem.type); 5738 if (match) { 5739 elem.type = match[1]; 5740 } else { 5741 elem.removeAttribute("type"); 5742 } 5743 return elem; 5744 } 5745 5746 function cloneCopyEvent(src, dest) { 5747 if (dest.nodeType !== 1 || !jQuery.hasData(src)) { 5748 return; 5749 } 5750 5751 var type, 5752 i, 5753 l, 5754 oldData = jQuery._data(src), 5755 curData = jQuery._data(dest, oldData), 5756 events = oldData.events; 5757 5758 if (events) { 5759 delete curData.handle; 5760 curData.events = {}; 5761 5762 for (type in events) { 5763 for (i = 0, l = events[type].length; i < l; i++) { 5764 jQuery.event.add(dest, type, events[type][i]); 5765 } 5766 } 5767 } 5768 5769 // make the cloned public data object a copy from the original 5770 if (curData.data) { 5771 curData.data = jQuery.extend({}, curData.data); 5772 } 5773 } 5774 5775 function fixCloneNodeIssues(src, dest) { 5776 var nodeName, e, data; 5777 5778 // We do not need to do anything for non-Elements 5779 if (dest.nodeType !== 1) { 5780 return; 5781 } 5782 5783 nodeName = dest.nodeName.toLowerCase(); 5784 5785 // IE6-8 copies events bound via attachEvent when using cloneNode. 5786 if (!support.noCloneEvent && dest[jQuery.expando]) { 5787 data = jQuery._data(dest); 5788 5789 for (e in data.events) { 5790 jQuery.removeEvent(dest, e, data.handle); 5791 } 5792 5793 // Event data gets referenced instead of copied if the expando gets copied too 5794 dest.removeAttribute(jQuery.expando); 5795 } 5796 5797 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text 5798 if (nodeName === "script" && dest.text !== src.text) { 5799 disableScript(dest).text = src.text; 5800 restoreScript(dest); 5801 5802 // IE6-10 improperly clones children of object elements using classid. 5803 // IE10 throws NoModificationAllowedError if parent is null, #12132. 5804 } else if (nodeName === "object") { 5805 if (dest.parentNode) { 5806 dest.outerHTML = src.outerHTML; 5807 } 5808 5809 // This path appears unavoidable for IE9. When cloning an object 5810 // element in IE9, the outerHTML strategy above is not sufficient. 5811 // If the src has innerHTML and the destination does not, 5812 // copy the src.innerHTML into the dest.innerHTML. #10324 5813 if (support.html5Clone && src.innerHTML && !jQuery.trim(dest.innerHTML)) { 5814 dest.innerHTML = src.innerHTML; 5815 } 5816 } else if (nodeName === "input" && rcheckableType.test(src.type)) { 5817 5818 // IE6-8 fails to persist the checked state of a cloned checkbox 5819 // or radio button. Worse, IE6-7 fail to give the cloned element 5820 // a checked appearance if the defaultChecked value isn't also set 5821 5822 dest.defaultChecked = dest.checked = src.checked; 5823 5824 // IE6-7 get confused and end up setting the value of a cloned 5825 // checkbox/radio button to an empty string instead of "on" 5826 if (dest.value !== src.value) { 5827 dest.value = src.value; 5828 } 5829 5830 // IE6-8 fails to return the selected option to the default selected 5831 // state when cloning options 5832 } else if (nodeName === "option") { 5833 dest.defaultSelected = dest.selected = src.defaultSelected; 5834 5835 // IE6-8 fails to set the defaultValue to the correct value when 5836 // cloning other types of input fields 5837 } else if (nodeName === "input" || nodeName === "textarea") { 5838 dest.defaultValue = src.defaultValue; 5839 } 5840 } 5841 5842 function domManip(collection, args, callback, ignored) { 5843 5844 // Flatten any nested arrays 5845 args = concat.apply([], args); 5846 5847 var first, 5848 node, 5849 hasScripts, 5850 scripts, 5851 doc, 5852 fragment, 5853 i = 0, 5854 l = collection.length, 5855 iNoClone = l - 1, 5856 value = args[0], 5857 isFunction = jQuery.isFunction(value); 5858 5859 // We can't cloneNode fragments that contain checked, in WebKit 5860 if (isFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) { 5861 return collection.each(function (index) { 5862 var self = collection.eq(index); 5863 if (isFunction) { 5864 args[0] = value.call(this, index, self.html()); 5865 } 5866 domManip(self, args, callback, ignored); 5867 }); 5868 } 5869 5870 if (l) { 5871 fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored); 5872 first = fragment.firstChild; 5873 5874 if (fragment.childNodes.length === 1) { 5875 fragment = first; 5876 } 5877 5878 // Require either new content or an interest in ignored elements to invoke the callback 5879 if (first || ignored) { 5880 scripts = jQuery.map(getAll(fragment, "script"), disableScript); 5881 hasScripts = scripts.length; 5882 5883 // Use the original fragment for the last item 5884 // instead of the first because it can end up 5885 // being emptied incorrectly in certain situations (#8070). 5886 for (; i < l; i++) { 5887 node = fragment; 5888 5889 if (i !== iNoClone) { 5890 node = jQuery.clone(node, true, true); 5891 5892 // Keep references to cloned scripts for later restoration 5893 if (hasScripts) { 5894 5895 // Support: Android<4.1, PhantomJS<2 5896 // push.apply(_, arraylike) throws on ancient WebKit 5897 jQuery.merge(scripts, getAll(node, "script")); 5898 } 5899 } 5900 5901 callback.call(collection[i], node, i); 5902 } 5903 5904 if (hasScripts) { 5905 doc = scripts[scripts.length - 1].ownerDocument; 5906 5907 // Reenable scripts 5908 jQuery.map(scripts, restoreScript); 5909 5910 // Evaluate executable scripts on first document insertion 5911 for (i = 0; i < hasScripts; i++) { 5912 node = scripts[i]; 5913 if (rscriptType.test(node.type || "") && !jQuery._data(node, "globalEval") && jQuery.contains(doc, node)) { 5914 5915 if (node.src) { 5916 5917 // Optional AJAX dependency, but won't run scripts if not present 5918 if (jQuery._evalUrl) { 5919 jQuery._evalUrl(node.src); 5920 } 5921 } else { 5922 jQuery.globalEval((node.text || node.textContent || node.innerHTML || "").replace(rcleanScript, "")); 5923 } 5924 } 5925 } 5926 } 5927 5928 // Fix #11809: Avoid leaking memory 5929 fragment = first = null; 5930 } 5931 } 5932 5933 return collection; 5934 } 5935 5936 function remove(elem, selector, keepData) { 5937 var node, 5938 elems = selector ? jQuery.filter(selector, elem) : elem, 5939 i = 0; 5940 5941 for (; (node = elems[i]) != null; i++) { 5942 5943 if (!keepData && node.nodeType === 1) { 5944 jQuery.cleanData(getAll(node)); 5945 } 5946 5947 if (node.parentNode) { 5948 if (keepData && jQuery.contains(node.ownerDocument, node)) { 5949 setGlobalEval(getAll(node, "script")); 5950 } 5951 node.parentNode.removeChild(node); 5952 } 5953 } 5954 5955 return elem; 5956 } 5957 5958 jQuery.extend({ 5959 htmlPrefilter: function (html) { 5960 return html.replace(rxhtmlTag, "<$1></$2>"); 5961 }, 5962 5963 clone: function (elem, dataAndEvents, deepDataAndEvents) { 5964 var destElements, 5965 node, 5966 clone, 5967 i, 5968 srcElements, 5969 inPage = jQuery.contains(elem.ownerDocument, elem); 5970 5971 if (support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test("<" + elem.nodeName + ">")) { 5972 5973 clone = elem.cloneNode(true); 5974 5975 // IE<=8 does not properly clone detached, unknown element nodes 5976 } else { 5977 fragmentDiv.innerHTML = elem.outerHTML; 5978 fragmentDiv.removeChild(clone = fragmentDiv.firstChild); 5979 } 5980 5981 if ((!support.noCloneEvent || !support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) { 5982 5983 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 5984 destElements = getAll(clone); 5985 srcElements = getAll(elem); 5986 5987 // Fix all IE cloning issues 5988 for (i = 0; (node = srcElements[i]) != null; ++i) { 5989 5990 // Ensure that the destination node is not null; Fixes #9587 5991 if (destElements[i]) { 5992 fixCloneNodeIssues(node, destElements[i]); 5993 } 5994 } 5995 } 5996 5997 // Copy the events from the original to the clone 5998 if (dataAndEvents) { 5999 if (deepDataAndEvents) { 6000 srcElements = srcElements || getAll(elem); 6001 destElements = destElements || getAll(clone); 6002 6003 for (i = 0; (node = srcElements[i]) != null; i++) { 6004 cloneCopyEvent(node, destElements[i]); 6005 } 6006 } else { 6007 cloneCopyEvent(elem, clone); 6008 } 6009 } 6010 6011 // Preserve script evaluation history 6012 destElements = getAll(clone, "script"); 6013 if (destElements.length > 0) { 6014 setGlobalEval(destElements, !inPage && getAll(elem, "script")); 6015 } 6016 6017 destElements = srcElements = node = null; 6018 6019 // Return the cloned set 6020 return clone; 6021 }, 6022 6023 cleanData: function (elems, /* internal */forceAcceptData) { 6024 var elem, 6025 type, 6026 id, 6027 data, 6028 i = 0, 6029 internalKey = jQuery.expando, 6030 cache = jQuery.cache, 6031 attributes = support.attributes, 6032 special = jQuery.event.special; 6033 6034 for (; (elem = elems[i]) != null; i++) { 6035 if (forceAcceptData || acceptData(elem)) { 6036 6037 id = elem[internalKey]; 6038 data = id && cache[id]; 6039 6040 if (data) { 6041 if (data.events) { 6042 for (type in data.events) { 6043 if (special[type]) { 6044 jQuery.event.remove(elem, type); 6045 6046 // This is a shortcut to avoid jQuery.event.remove's overhead 6047 } else { 6048 jQuery.removeEvent(elem, type, data.handle); 6049 } 6050 } 6051 } 6052 6053 // Remove cache only if it was not already removed by jQuery.event.remove 6054 if (cache[id]) { 6055 6056 delete cache[id]; 6057
6058 // Support: IE<9 6059 // IE does not allow us to delete expando properties from nodes 6060 // IE creates expando attributes along with the property 6061 // IE does not have a removeAttribute function on Document nodes 6062 if (!attributes && typeof elem.removeAttribute !== "undefined") { 6063 elem.removeAttribute(internalKey); 6064 6065 // Webkit & Blink performance suffers when deleting properties 6066 // from DOM nodes, so set to undefined instead 6067 // https://code.google.com/p/chromium/issues/detail?id=378607 6068 } else { 6069 elem[internalKey] = undefined; 6070 } 6071 6072 deletedIds.push(id); 6073 } 6074 } 6075 } 6076 } 6077 } 6078 }); 6079 6080 jQuery.fn.extend({ 6081 6082 // Keep domManip exposed until 3.0 (gh-2225) 6083 domManip: domManip, 6084 6085 detach: function (selector) { 6086 return remove(this, selector, true); 6087 }, 6088 6089 remove: function (selector) { 6090 return remove(this, selector); 6091 }, 6092 6093 text: function (value) { 6094 return access(this, function (value) { 6095 return value === undefined ? jQuery.text(this) : this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(value)); 6096 }, null, value, arguments.length); 6097 }, 6098 6099 append: function () { 6100 return domManip(this, arguments, function (elem) { 6101 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 6102 var target = manipulationTarget(this, elem); 6103 target.appendChild(elem); 6104 } 6105 }); 6106 }, 6107 6108 prepend: function () { 6109 return domManip(this, arguments, function (elem) { 6110 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 6111 var target = manipulationTarget(this, elem); 6112 target.insertBefore(elem, target.firstChild); 6113 } 6114 }); 6115 }, 6116 6117 before: function () { 6118 return domManip(this, arguments, function (elem) { 6119 if (this.parentNode) { 6120 this.parentNode.insertBefore(elem, this); 6121 } 6122 }); 6123 }, 6124 6125 after: function () { 6126 return domManip(this, arguments, function (elem) { 6127 if (this.parentNode) { 6128 this.parentNode.insertBefore(elem, this.nextSibling); 6129 } 6130 }); 6131 }, 6132 6133 empty: function () { 6134 var elem, 6135 i = 0; 6136 6137 for (; (elem = this[i]) != null; i++) { 6138 6139 // Remove element nodes and prevent memory leaks 6140 if (elem.nodeType === 1) { 6141 jQuery.cleanData(getAll(elem, false)); 6142 } 6143 6144 // Remove any remaining nodes 6145 while (elem.firstChild) { 6146 elem.removeChild(elem.firstChild); 6147 } 6148 6149 // If this is a select, ensure that it displays empty (#12336) 6150 // Support: IE<9 6151 if (elem.options && jQuery.nodeName(elem, "select")) { 6152 elem.options.length = 0; 6153 } 6154 } 6155 6156 return this; 6157 }, 6158 6159 clone: function (dataAndEvents, deepDataAndEvents) { 6160 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 6161 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 6162 6163 return this.map(function () { 6164 return jQuery.clone(this, dataAndEvents, deepDataAndEvents); 6165 }); 6166 }, 6167 6168 html: function (value) { 6169 return access(this, function (value) { 6170 var elem = this[0] || {}, 6171 i = 0, 6172 l = this.length; 6173 6174 if (value === undefined) { 6175 return elem.nodeType === 1 ? elem.innerHTML.replace(rinlinejQuery, "") : undefined; 6176 } 6177 6178 // See if we can take a shortcut and just use innerHTML 6179 if (typeof value === "string" && !rnoInnerhtml.test(value) && (support.htmlSerialize || !rnoshimcache.test(value)) && (support.leadingWhitespace || !rleadingWhitespace.test(value)) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) { 6180 6181 value = jQuery.htmlPrefilter(value); 6182 6183 try { 6184 for (; i < l; i++) { 6185 6186 // Remove element nodes and prevent memory leaks 6187 elem = this[i] || {}; 6188 if (elem.nodeType === 1) { 6189 jQuery.cleanData(getAll(elem, false)); 6190 elem.innerHTML = value; 6191 } 6192 } 6193 6194 elem = 0; 6195 6196 // If using innerHTML throws an exception, use the fallback method 6197 } catch (e) {} 6198 } 6199 6200 if (elem) { 6201 this.empty().append(value); 6202 } 6203 }, null, value, arguments.length); 6204 }, 6205 6206 replaceWith: function () { 6207 var ignored = []; 6208 6209 // Make the changes, replacing each non-ignored context element with the new content 6210 return domManip(this, arguments, function (elem) { 6211 var parent = this.parentNode; 6212 6213 if (jQuery.inArray(this, ignored) < 0) { 6214 jQuery.cleanData(getAll(this)); 6215 if (parent) { 6216 parent.replaceChild(elem, this); 6217 } 6218 } 6219 6220 // Force callback invocation 6221 }, ignored); 6222 } 6223 }); 6224 6225 jQuery.each({ 6226 appendTo: "append",
vendor: 1,203 bytes, lines 6227-6274
6227 prependTo: "prepend", 6228 insertBefore: "before", 6229 insertAfter: "after", 6230 replaceAll: "replaceWith" 6231 }, function (name, original) { 6232 jQuery.fn[name] = function (selector) { 6233 var elems, 6234 i = 0, 6235 ret = [], 6236 insert = jQuery(selector), 6237 last = insert.length - 1; 6238 6239 for (; i <= last; i++) { 6240 elems = i === last ? this : this.clone(true); 6241 jQuery(insert[i])[original](elems); 6242 6243 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() 6244 push.apply(ret, elems.get()); 6245 } 6246 6247 return this.pushStack(ret); 6248 }; 6249 }); 6250 6251 var iframe, 6252 elemdisplay = { 6253 6254 // Support: Firefox 6255 // We have to pre-define these values for FF (#10227) 6256 HTML: "block", 6257 BODY: "block" 6258 }; 6259 6260 /** 6261 * Retrieve the actual display of a element 6262 * @param {String} name nodeName of the element 6263 * @param {Object} doc Document object 6264 */ 6265 6266 // Called only from within defaultDisplay 6267 function actualDisplay(name, doc) { 6268 var elem = jQuery(doc.createElement(name)).appendTo(doc.body), 6269 display = jQuery.css(elem[0], "display"); 6270 6271 // We don't have any data stored on the element, 6272 // so use "detach" method as fast way to get rid of the element 6273 elem.detach(); 6274
6275 return display; 6276 } 6277 6278 /** 6279 * Try to determine the default display value of an element 6280 * @param {String} nodeName 6281 */ 6282 function defaultDisplay(nodeName) { 6283 var doc = document, 6284 display = elemdisplay[nodeName]; 6285 6286 if (!display) { 6287 display = actualDisplay(nodeName, doc); 6288 6289 // If the simple way fails, read from inside an iframe 6290 if (display === "none" || !display) { 6291 6292 // Use the already-created iframe if possible 6293 iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement); 6294 6295 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 6296 doc = (iframe[0].contentWindow || iframe[0].contentDocument).document; 6297 6298 // Support: IE 6299 doc.write(); 6300 doc.close(); 6301 6302 display = actualDisplay(nodeName, doc); 6303 iframe.detach(); 6304 } 6305 6306 // Store the correct default display 6307 elemdisplay[nodeName] = display; 6308 } 6309 6310 return display; 6311 } 6312 var rmargin = /^margin/; 6313 6314 var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i"); 6315 6316 var swap = function (elem, options, callback, args) { 6317 var ret, 6318 name, 6319 old = {}; 6320 6321 // Remember the old values, and insert the new ones 6322 for (name in options) { 6323 old[name] = elem.style[name]; 6324 elem.style[name] = options[name]; 6325 } 6326 6327 ret = callback.apply(elem, args || []); 6328 6329 // Revert the old values 6330 for (name in options) { 6331 elem.style[name] = old[name]; 6332 } 6333 6334 return ret; 6335 }; 6336 6337 var documentElement = document.documentElement; 6338 6339 (function () { 6340 var pixelPositionVal, 6341 pixelMarginRightVal, 6342 boxSizingReliableVal, 6343 reliableHiddenOffsetsVal, 6344 reliableMarginRightVal, 6345 reliableMarginLeftVal, 6346 container = document.createElement("div"), 6347 div = document.createElement("div"); 6348 6349 // Finish early in limited (non-browser) environments 6350 if (!div.style) { 6351 return; 6352 } 6353 6354 div.style.cssText = "float:left;opacity:.5"; 6355 6356 // Support: IE<9 6357 // Make sure that element opacity exists (as opposed to filter) 6358 support.opacity = div.style.opacity === "0.5"; 6359 6360 // Verify style float existence 6361 // (IE uses styleFloat instead of cssFloat) 6362 support.cssFloat = !!div.style.cssFloat; 6363 6364 div.style.backgroundClip = "content-box"; 6365 div.cloneNode(true).style.backgroundClip = ""; 6366 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 6367 6368 container = document.createElement("div"); 6369 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + "padding:0;margin-top:1px;position:absolute"; 6370 div.innerHTML = ""; 6371 container.appendChild(div); 6372 6373 // Support: Firefox<29, Android 2.3 6374 // Vendor-prefix box-sizing 6375 support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" || div.style.WebkitBoxSizing === ""; 6376 6377 jQuery.extend(support, { 6378 reliableHiddenOffsets: function () { 6379 if (pixelPositionVal == null) { 6380 computeStyleTests(); 6381 } 6382 return reliableHiddenOffsetsVal; 6383 }, 6384 6385 boxSizingReliable: function () { 6386 6387 // We're checking for pixelPositionVal here instead of boxSizingReliableVal 6388 // since that compresses better and they're computed together anyway. 6389 if (pixelPositionVal == null) { 6390 computeStyleTests(); 6391 } 6392 return boxSizingReliableVal; 6393 }, 6394 6395 pixelMarginRight: function () { 6396 6397 // Support: Android 4.0-4.3 6398 if (pixelPositionVal == null) { 6399 computeStyleTests(); 6400 } 6401 return pixelMarginRightVal; 6402 }, 6403 6404 pixelPosition: function () { 6405 if (pixelPositionVal == null) { 6406 computeStyleTests(); 6407 } 6408 return pixelPositionVal; 6409 }, 6410 6411 reliableMarginRight: function () { 6412 6413 // Support: Android 2.3 6414 if (pixelPositionVal == null) { 6415 computeStyleTests(); 6416 } 6417 return reliableMarginRightVal; 6418 }, 6419 6420 reliableMarginLeft: function () { 6421 6422 // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 6423 if (pixelPositionVal == null) { 6424 computeStyleTests(); 6425 } 6426 return reliableMarginLeftVal; 6427 } 6428 }); 6429 6430 function computeStyleTests() { 6431 var contents, 6432 divStyle, 6433 documentElement = document.documentElement; 6434 6435 // Setup 6436 documentElement.appendChild(container); 6437 6438 div.style.cssText = 6439
6440 // Support: Android 2.3 6441 // Vendor-prefix box-sizing 6442 "-webkit-box-sizing:border-box;box-sizing:border-box;" + "position:relative;display:block;" + "margin:auto;border:1px;padding:1px;" + "top:1%;width:50%"; 6443 6444 // Support: IE<9 6445 // Assume reasonable values in the absence of getComputedStyle 6446 pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false; 6447 pixelMarginRightVal = reliableMarginRightVal = true; 6448 6449 // Check for getComputedStyle so that this code is not run in IE<9. 6450 if (window.getComputedStyle) { 6451 divStyle = window.getComputedStyle(div); 6452 pixelPositionVal = (divStyle || {}).top !== "1%"; 6453 reliableMarginLeftVal = (divStyle || {}).marginLeft === "2px"; 6454 boxSizingReliableVal = (divStyle || { width: "4px" }).width === "4px"; 6455 6456 // Support: Android 4.0 - 4.3 only 6457 // Some styles come back with percentage values, even though they shouldn't 6458 div.style.marginRight = "50%"; 6459 pixelMarginRightVal = (divStyle || { marginRight: "4px" }).marginRight === "4px"; 6460 6461 // Support: Android 2.3 only 6462 // Div with explicit width and no margin-right incorrectly 6463 // gets computed margin-right based on width of container (#3333) 6464 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 6465 contents = div.appendChild(document.createElement("div")); 6466 6467 // Reset CSS: box-sizing; display; margin; border; padding 6468 contents.style.cssText = div.style.cssText = 6469 6470 // Support: Android 2.3 6471 // Vendor-prefix box-sizing 6472 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; 6473 contents.style.marginRight = contents.style.width = "0"; 6474 div.style.width = "1px"; 6475 6476 reliableMarginRightVal = !parseFloat((window.getComputedStyle(contents) || {}).marginRight); 6477 6478 div.removeChild(contents); 6479 } 6480 6481 // Support: IE6-8 6482 // First check that getClientRects works as expected 6483 // Check if table cells still have offsetWidth/Height when they are set 6484 // to display:none and there are still other visible table cells in a 6485 // table row; if so, offsetWidth/Height are not reliable for use when 6486 // determining if an element has been hidden directly using 6487 // display:none (it is still safe to use offsets if a parent element is 6488 // hidden; don safety goggles and see bug #4512 for more information). 6489 div.style.display = "none"; 6490 reliableHiddenOffsetsVal = div.getClientRects().length === 0; 6491 if (reliableHiddenOffsetsVal) { 6492 div.style.display = ""; 6493 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; 6494 div.childNodes[0].style.borderCollapse = "separate"; 6495 contents = div.getElementsByTagName("td"); 6496 contents[0].style.cssText = "margin:0;border:0;padding:0;display:none"; 6497 reliableHiddenOffsetsVal = contents[0].offsetHeight === 0; 6498 if (reliableHiddenOffsetsVal) { 6499 contents[0].style.display = ""; 6500 contents[1].style.display = "none"; 6501 reliableHiddenOffsetsVal = contents[0].offsetHeight === 0; 6502 } 6503 } 6504 6505 // Teardown 6506 documentElement.removeChild(container); 6507 } 6508 })(); 6509 6510 var getStyles, 6511 curCSS, 6512 rposition = /^(top|right|bottom|left)$/; 6513 6514 if (window.getComputedStyle) { 6515 getStyles = function (elem) { 6516 6517 // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 6518 // IE throws on elements created in popups 6519 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6520 var view = elem.ownerDocument.defaultView; 6521 6522 if (!view || !view.opener) { 6523 view = window; 6524 } 6525 6526 return view.getComputedStyle(elem); 6527 }; 6528 6529 curCSS = function (elem, name, computed) { 6530 var width, 6531 minWidth, 6532 maxWidth, 6533 ret, 6534 style = elem.style; 6535 6536 computed = computed || getStyles(elem); 6537 6538 // getPropertyValue is only needed for .css('filter') in IE9, see #12537 6539 ret = computed ? computed.getPropertyValue(name) || computed[name] : undefined; 6540 6541 // Support: Opera 12.1x only 6542 // Fall back to style even without computed 6543 // computed is undefined for elems on document fragments 6544 if ((ret === "" || ret === undefined) && !jQuery.contains(elem.ownerDocument, elem)) { 6545 ret = jQuery.style(elem, name); 6546 } 6547 6548 if (computed) { 6549 6550 // A tribute to the "awesome hack by Dean Edwards" 6551 // Chrome < 17 and Safari 5.0 uses "computed value" 6552 // instead of "used value" for margin-right 6553 // Safari 5.1.7 (at least) returns percentage for a larger set of values, 6554 // but width seems to be reliably pixels 6555 // this is against the CSSOM draft spec: 6556 // http://dev.w3.org/csswg/cssom/#resolved-values 6557 if (!support.pixelMarginRight() && rnumnonpx.test(ret) && rmargin.test(name)) { 6558 6559 // Remember the original values 6560 width = style.width; 6561 minWidth = style.minWidth; 6562 maxWidth = style.maxWidth; 6563 6564 // Put in the new values to get a computed value out 6565 style.minWidth = style.maxWidth = style.width = ret; 6566 ret = computed.width; 6567 6568 // Revert the changed values 6569 style.width = width; 6570 style.minWidth = minWidth; 6571 style.maxWidth = maxWidth; 6572 } 6573 } 6574
vendor: 4,252 bytes, lines 6575-6727
6575 // Support: IE 6576 // IE returns zIndex value as an integer. 6577 return ret === undefined ? ret : ret + ""; 6578 }; 6579 } else if (documentElement.currentStyle) { 6580 getStyles = function (elem) { 6581 return elem.currentStyle; 6582 }; 6583 6584 curCSS = function (elem, name, computed) { 6585 var left, 6586 rs, 6587 rsLeft, 6588 ret, 6589 style = elem.style; 6590 6591 computed = computed || getStyles(elem); 6592 ret = computed ? computed[name] : undefined; 6593 6594 // Avoid setting ret to empty string here 6595 // so we don't default to auto 6596 if (ret == null && style && style[name]) { 6597 ret = style[name]; 6598 } 6599 6600 // From the awesome hack by Dean Edwards 6601 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 6602 6603 // If we're not dealing with a regular pixel number 6604 // but a number that has a weird ending, we need to convert it to pixels 6605 // but not position css attributes, as those are 6606 // proportional to the parent element instead 6607 // and we can't measure the parent instead because it 6608 // might trigger a "stacking dolls" problem 6609 if (rnumnonpx.test(ret) && !rposition.test(name)) { 6610 6611 // Remember the original values 6612 left = style.left; 6613 rs = elem.runtimeStyle; 6614 rsLeft = rs && rs.left; 6615 6616 // Put in the new values to get a computed value out 6617 if (rsLeft) { 6618 rs.left = elem.currentStyle.left; 6619 } 6620 style.left = name === "fontSize" ? "1em" : ret; 6621 ret = style.pixelLeft + "px"; 6622 6623 // Revert the changed values 6624 style.left = left; 6625 if (rsLeft) { 6626 rs.left = rsLeft; 6627 } 6628 } 6629 6630 // Support: IE 6631 // IE returns zIndex value as an integer. 6632 return ret === undefined ? ret : ret + "" || "auto"; 6633 }; 6634 } 6635 6636 function addGetHookIf(conditionFn, hookFn) { 6637 6638 // Define the hook, we'll check on the first run if it's really needed. 6639 return { 6640 get: function () { 6641 if (conditionFn()) { 6642 6643 // Hook not needed (or it's not possible to use it due 6644 // to missing dependency), remove it. 6645 delete this.get; 6646 return; 6647 } 6648 6649 // Hook needed; redefine it so that the support test is not executed again. 6650 return (this.get = hookFn).apply(this, arguments); 6651 } 6652 }; 6653 } 6654 6655 var ralpha = /alpha\([^)]*\)/i, 6656 ropacity = /opacity\s*=\s*([^)]*)/i, 6657 6658 6659 // swappable if display is none or starts with table except 6660 // "table", "table-cell", or "table-caption" 6661 // see here for display values: 6662 // https://developer.mozilla.org/en-US/docs/CSS/display 6663 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 6664 rnumsplit = new RegExp("^(" + pnum + ")(.*)$", "i"), 6665 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 6666 cssNormalTransform = { 6667 letterSpacing: "0", 6668 fontWeight: "400" 6669 }, 6670 cssPrefixes = ["Webkit", "O", "Moz", "ms"], 6671 emptyStyle = document.createElement("div").style; 6672 6673 // return a css property mapped to a potentially vendor prefixed property 6674 function vendorPropName(name) { 6675 6676 // shortcut for names that are not vendor prefixed 6677 if (name in emptyStyle) { 6678 return name; 6679 } 6680 6681 // check for vendor prefixed names 6682 var capName = name.charAt(0).toUpperCase() + name.slice(1), 6683 i = cssPrefixes.length; 6684 6685 while (i--) { 6686 name = cssPrefixes[i] + capName; 6687 if (name in emptyStyle) { 6688 return name; 6689 } 6690 } 6691 } 6692 6693 function showHide(elements, show) { 6694 var display, 6695 elem, 6696 hidden, 6697 values = [], 6698 index = 0, 6699 length = elements.length; 6700 6701 for (; index < length; index++) { 6702 elem = elements[index]; 6703 if (!elem.style) { 6704 continue; 6705 } 6706 6707 values[index] = jQuery._data(elem, "olddisplay"); 6708 display = elem.style.display; 6709 if (show) { 6710 6711 // Reset the inline display of this element to learn if it is 6712 // being hidden by cascaded rules or not 6713 if (!values[index] && display === "none") { 6714 elem.style.display = ""; 6715 } 6716 6717 // Set elements which have been overridden with display: none 6718 // in a stylesheet to whatever the default browser style is 6719 // for such an element 6720 if (elem.style.display === "" && isHidden(elem)) { 6721 values[index] = jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName)); 6722 } 6723 } else { 6724 hidden = isHidden(elem); 6725 6726 if (display && display !== "none" || !hidden) { 6727 jQuery._data(elem, "olddisplay", hidden ? display : jQuery.css(elem, "dis
vendor: 6,095 bytes, lines 6727-6928
6727play")); 6728 } 6729 } 6730 } 6731 6732 // Set the display of most of the elements in a second loop 6733 // to avoid the constant reflow 6734 for (index = 0; index < length; index++) { 6735 elem = elements[index]; 6736 if (!elem.style) { 6737 continue; 6738 } 6739 if (!show || elem.style.display === "none" || elem.style.display === "") { 6740 elem.style.display = show ? values[index] || "" : "none"; 6741 } 6742 } 6743 6744 return elements; 6745 } 6746 6747 function setPositiveNumber(elem, value, subtract) { 6748 var matches = rnumsplit.exec(value); 6749 return matches ? 6750 6751 // Guard against undefined "subtract", e.g., when used as in cssHooks 6752 Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") : value; 6753 } 6754 6755 function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) { 6756 var i = extra === (isBorderBox ? "border" : "content") ? 6757 6758 // If we already have the right measurement, avoid augmentation 6759 4 : 6760 6761 // Otherwise initialize for horizontal or vertical properties 6762 name === "width" ? 1 : 0, 6763 val = 0; 6764 6765 for (; i < 4; i += 2) { 6766 6767 // both box models exclude margin, so add it if we want it 6768 if (extra === "margin") { 6769 val += jQuery.css(elem, extra + cssExpand[i], true, styles); 6770 } 6771 6772 if (isBorderBox) { 6773 6774 // border-box includes padding, so remove it if we want content 6775 if (extra === "content") { 6776 val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles); 6777 } 6778 6779 // at this point, extra isn't border nor margin, so remove border 6780 if (extra !== "margin") { 6781 val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles); 6782 } 6783 } else { 6784 6785 // at this point, extra isn't content, so add padding 6786 val += jQuery.css(elem, "padding" + cssExpand[i], true, styles); 6787 6788 // at this point, extra isn't content nor padding, so add border 6789 if (extra !== "padding") { 6790 val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles); 6791 } 6792 } 6793 } 6794 6795 return val; 6796 } 6797 6798 function getWidthOrHeight(elem, name, extra) { 6799 6800 // Start with offset property, which is equivalent to the border-box value 6801 var valueIsBorderBox = true, 6802 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 6803 styles = getStyles(elem), 6804 isBorderBox = support.boxSizing && jQuery.css(elem, "boxSizing", false, styles) === "border-box"; 6805 6806 // some non-html elements return undefined for offsetWidth, so check for null/undefined 6807 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 6808 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 6809 if (val <= 0 || val == null) { 6810 6811 // Fall back to computed then uncomputed css if necessary 6812 val = curCSS(elem, name, styles); 6813 if (val < 0 || val == null) { 6814 val = elem.style[name]; 6815 } 6816 6817 // Computed unit is not pixels. Stop here and return. 6818 if (rnumnonpx.test(val)) { 6819 return val; 6820 } 6821 6822 // we need the check for style in case a browser which returns unreliable values 6823 // for getComputedStyle silently falls back to the reliable elem.style 6824 valueIsBorderBox = isBorderBox && (support.boxSizingReliable() || val === elem.style[name]); 6825 6826 // Normalize "", auto, and prepare for extra 6827 val = parseFloat(val) || 0; 6828 } 6829 6830 // use the active box-sizing model to add/subtract irrelevant styles 6831 return val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles) + "px"; 6832 } 6833 6834 jQuery.extend({ 6835 6836 // Add in style property hooks for overriding the default 6837 // behavior of getting and setting a style property 6838 cssHooks: { 6839 opacity: { 6840 get: function (elem, computed) { 6841 if (computed) { 6842 6843 // We should always get a number back from opacity 6844 var ret = curCSS(elem, "opacity"); 6845 return ret === "" ? "1" : ret; 6846 } 6847 } 6848 } 6849 }, 6850 6851 // Don't automatically add "px" to these possibly-unitless properties 6852 cssNumber: { 6853 "animationIterationCount": true, 6854 "columnCount": true, 6855 "fillOpacity": true, 6856 "flexGrow": true, 6857 "flexShrink": true, 6858 "fontWeight": true, 6859 "lineHeight": true, 6860 "opacity": true, 6861 "order": true, 6862 "orphans": true, 6863 "widows": true, 6864 "zIndex": true, 6865 "zoom": true 6866 }, 6867 6868 // Add in properties whose names you wish to fix before 6869 // setting or getting the value 6870 cssProps: { 6871 6872 // normalize float css property 6873 "float": support.cssFloat ? "cssFloat" : "styleFloat" 6874 }, 6875 6876 // Get and set the style property on a DOM Node 6877 style: function (elem, name, value, extra) { 6878 6879 // Don't set styles on text and comment nodes 6880 if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) { 6881 return; 6882 } 6883 6884 // Make sure that we're working with the right name 6885 var ret, 6886 type, 6887 hooks, 6888 origName = jQuery.camelCase(name), 6889 style = elem.style; 6890 6891 name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(origName) || origName); 6892 6893 // gets hook for the prefixed version 6894 // followed by the unprefixed version 6895 hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; 6896 6897 // Check if we're setting a value 6898 if (value !== undefined) { 6899 type = typeof value; 6900 6901 // Convert "+=" or "-=" to relative numbers (#7345) 6902 if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) { 6903 value = adjustCSS(elem, name, ret); 6904 6905 // Fixes bug #9237 6906 type = "number"; 6907 } 6908 6909 // Make sure that null and NaN values aren't set. See: #7116 6910 if (value == null || value !== value) { 6911 return; 6912 } 6913 6914 // If a number was passed in, add the unit (except for certain CSS properties) 6915 if (type === "number") { 6916 value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px"); 6917 } 6918 6919 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, 6920 // but it would mean to define eight 6921 // (for every problematic property) identical functions 6922 if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) { 6923 style[name] = "inherit"; 6924 } 6925 6926 // If a hook was provided, use that value, otherwise just set the specified value 6927 if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) { 6928
vendor: 4,360 bytes, lines 6929-7055
6929 // Support: IE 6930 // Swallow errors from 'invalid' CSS values (#5509) 6931 try { 6932 style[name] = value; 6933 } catch (e) {} 6934 } 6935 } else { 6936 6937 // If a hook was provided get the non-computed value from there 6938 if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) { 6939 6940 return ret; 6941 } 6942 6943 // Otherwise just get the value from the style object 6944 return style[name]; 6945 } 6946 }, 6947 6948 css: function (elem, name, extra, styles) { 6949 var num, 6950 val, 6951 hooks, 6952 origName = jQuery.camelCase(name); 6953 6954 // Make sure that we're working with the right name 6955 name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(origName) || origName); 6956 6957 // gets hook for the prefixed version 6958 // followed by the unprefixed version 6959 hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]; 6960 6961 // If a hook was provided get the computed value from there 6962 if (hooks && "get" in hooks) { 6963 val = hooks.get(elem, true, extra); 6964 } 6965 6966 // Otherwise, if a way to get the computed value exists, use that 6967 if (val === undefined) { 6968 val = curCSS(elem, name, styles); 6969 } 6970 6971 //convert "normal" to computed value 6972 if (val === "normal" && name in cssNormalTransform) { 6973 val = cssNormalTransform[name]; 6974 } 6975 6976 // Return, converting to number if forced or a qualifier was provided and val looks numeric 6977 if (extra === "" || extra) { 6978 num = parseFloat(val); 6979 return extra === true || isFinite(num) ? num || 0 : val; 6980 } 6981 return val; 6982 } 6983 }); 6984 6985 jQuery.each(["height", "width"], function (i, name) { 6986 jQuery.cssHooks[name] = { 6987 get: function (elem, computed, extra) { 6988 if (computed) { 6989 6990 // certain elements can have dimension info if we invisibly show them 6991 // however, it must have a current display style that would benefit from this 6992 return rdisplayswap.test(jQuery.css(elem, "display")) && elem.offsetWidth === 0 ? swap(elem, cssShow, function () { 6993 return getWidthOrHeight(elem, name, extra); 6994 }) : getWidthOrHeight(elem, name, extra); 6995 } 6996 }, 6997 6998 set: function (elem, value, extra) { 6999 var styles = extra && getStyles(elem); 7000 return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight(elem, name, extra, support.boxSizing && jQuery.css(elem, "boxSizing", false, styles) === "border-box", styles) : 0); 7001 } 7002 }; 7003 }); 7004 7005 if (!support.opacity) { 7006 jQuery.cssHooks.opacity = { 7007 get: function (elem, computed) { 7008 7009 // IE uses filters for opacity 7010 return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? 0.01 * parseFloat(RegExp.$1) + "" : computed ? "1" : ""; 7011 }, 7012 7013 set: function (elem, value) { 7014 var style = elem.style, 7015 currentStyle = elem.currentStyle, 7016 opacity = jQuery.isNumeric(value) ? "alpha(opacity=" + value * 100 + ")" : "", 7017 filter = currentStyle && currentStyle.filter || style.filter || ""; 7018 7019 // IE has trouble with opacity if it does not have layout 7020 // Force it by setting the zoom level 7021 style.zoom = 1; 7022 7023 // if setting opacity to 1, and no other filters exist - 7024 // attempt to remove filter attribute #6652 7025 // if value === "", then remove inline opacity #12685 7026 if ((value >= 1 || value === "") && jQuery.trim(filter.replace(ralpha, "")) === "" && style.removeAttribute) { 7027 7028 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText 7029 // if "filter:" is present at all, clearType is disabled, we want to avoid this 7030 // style.removeAttribute is IE Only, but so apparently is this code path... 7031 style.removeAttribute("filter"); 7032 7033 // if there is no filter style applied in a css rule 7034 // or unset inline opacity, we are done 7035 if (value === "" || currentStyle && !currentStyle.filter) { 7036 return; 7037 } 7038 } 7039 7040 // otherwise, set new filter values 7041 style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : filter + " " + opacity; 7042 } 7043 }; 7044 } 7045 7046 jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight, function (elem, computed) { 7047 if (computed) { 7048 return swap(elem, { "display": "inline-block" }, curCSS, [elem, "marginRight"]); 7049 } 7050 }); 7051 7052 jQuery.cssHooks.marginLeft = addGetHookIf(support.reliableMarginLeft, function (elem, computed) { 7053 if (computed) { 7054 return (parseFloat(curCSS(elem, "marginLeft")) || ( 7055
vendor: 4,554 bytes, lines 7056-7219
7056 // Support: IE<=11+ 7057 // Running getBoundingClientRect on a disconnected node in IE throws an error 7058 // Support: IE8 only 7059 // getClientRects() errors on disconnected elems 7060 jQuery.contains(elem.ownerDocument, elem) ? elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function () { 7061 return elem.getBoundingClientRect().left; 7062 }) : 0)) + "px"; 7063 } 7064 }); 7065 7066 // These hooks are used by animate to expand properties 7067 jQuery.each({ 7068 margin: "", 7069 padding: "", 7070 border: "Width" 7071 }, function (prefix, suffix) { 7072 jQuery.cssHooks[prefix + suffix] = { 7073 expand: function (value) { 7074 var i = 0, 7075 expanded = {}, 7076 7077 7078 // assumes a single number if not a string 7079 parts = typeof value === "string" ? value.split(" ") : [value]; 7080 7081 for (; i < 4; i++) { 7082 expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; 7083 } 7084 7085 return expanded; 7086 } 7087 }; 7088 7089 if (!rmargin.test(prefix)) { 7090 jQuery.cssHooks[prefix + suffix].set = setPositiveNumber; 7091 } 7092 }); 7093 7094 jQuery.fn.extend({ 7095 css: function (name, value) { 7096 return access(this, function (elem, name, value) { 7097 var styles, 7098 len, 7099 map = {}, 7100 i = 0; 7101 7102 if (jQuery.isArray(name)) { 7103 styles = getStyles(elem); 7104 len = name.length; 7105 7106 for (; i < len; i++) { 7107 map[name[i]] = jQuery.css(elem, name[i], false, styles); 7108 } 7109 7110 return map; 7111 } 7112 7113 return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name); 7114 }, name, value, arguments.length > 1); 7115 }, 7116 show: function () { 7117 return showHide(this, true); 7118 }, 7119 hide: function () { 7120 return showHide(this); 7121 }, 7122 toggle: function (state) { 7123 if (typeof state === "boolean") { 7124 return state ? this.show() : this.hide(); 7125 } 7126 7127 return this.each(function () { 7128 if (isHidden(this)) { 7129 jQuery(this).show(); 7130 } else { 7131 jQuery(this).hide(); 7132 } 7133 }); 7134 } 7135 }); 7136 7137 function Tween(elem, options, prop, end, easing) { 7138 return new Tween.prototype.init(elem, options, prop, end, easing); 7139 } 7140 jQuery.Tween = Tween; 7141 7142 Tween.prototype = { 7143 constructor: Tween, 7144 init: function (elem, options, prop, end, easing, unit) { 7145 this.elem = elem; 7146 this.prop = prop; 7147 this.easing = easing || jQuery.easing._default; 7148 this.options = options; 7149 this.start = this.now = this.cur(); 7150 this.end = end; 7151 this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px"); 7152 }, 7153 cur: function () { 7154 var hooks = Tween.propHooks[this.prop]; 7155 7156 return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this); 7157 }, 7158 run: function (percent) { 7159 var eased, 7160 hooks = Tween.propHooks[this.prop]; 7161 7162 if (this.options.duration) { 7163 this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration); 7164 } else { 7165 this.pos = eased = percent; 7166 } 7167 this.now = (this.end - this.start) * eased + this.start; 7168 7169 if (this.options.step) { 7170 this.options.step.call(this.elem, this.now, this); 7171 } 7172 7173 if (hooks && hooks.set) { 7174 hooks.set(this); 7175 } else { 7176 Tween.propHooks._default.set(this); 7177 } 7178 return this; 7179 } 7180 }; 7181 7182 Tween.prototype.init.prototype = Tween.prototype; 7183 7184 Tween.propHooks = { 7185 _default: { 7186 get: function (tween) { 7187 var result; 7188 7189 // Use a property on the element directly when it is not a DOM element, 7190 // or when there is no matching style property that exists. 7191 if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) { 7192 return tween.elem[tween.prop]; 7193 } 7194 7195 // passing an empty string as a 3rd parameter to .css will automatically 7196 // attempt a parseFloat and fallback to a string if the parse fails 7197 // so, simple values such as "10px" are parsed to Float. 7198 // complex values such as "rotate(1rad)" are returned as is. 7199 result = jQuery.css(tween.elem, tween.prop, ""); 7200 7201 // Empty strings, null, undefined and "auto" are converted to 0. 7202 return !result || result === "auto" ? 0 : result; 7203 }, 7204 set: function (tween) { 7205 7206 // use step hook for back compat - use cssHook if its there - use .style if its 7207 // available and use plain properties where available 7208 if (jQuery.fx.step[tween.prop]) { 7209 jQuery.fx.step[tween.prop](tween); 7210 } else if (tween.elem.nodeType === 1 && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) { 7211 jQuery.style(tween.elem, tween.prop, tween.now + tween.unit); 7212 } else { 7213 tween.elem[tween.prop] = tween.now; 7214 } 7215 } 7216 } 7217 }; 7218 7219 // Support: IE <=9
vendor: 5,745 bytes, lines 7220-7439
7220 // Panic based approach to setting things on disconnected nodes 7221 7222 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 7223 set: function (tween) { 7224 if (tween.elem.nodeType && tween.elem.parentNode) { 7225 tween.elem[tween.prop] = tween.now; 7226 } 7227 } 7228 }; 7229 7230 jQuery.easing = { 7231 linear: function (p) { 7232 return p; 7233 }, 7234 swing: function (p) { 7235 return 0.5 - Math.cos(p * Math.PI) / 2; 7236 }, 7237 _default: "swing" 7238 }; 7239 7240 jQuery.fx = Tween.prototype.init; 7241 7242 // Back Compat <1.8 extension point 7243 jQuery.fx.step = {}; 7244 7245 var fxNow, 7246 timerId, 7247 rfxtypes = /^(?:toggle|show|hide)$/, 7248 rrun = /queueHooks$/; 7249 7250 // Animations created synchronously will run synchronously 7251 function createFxNow() { 7252 window.setTimeout(function () { 7253 fxNow = undefined; 7254 }); 7255 return fxNow = jQuery.now(); 7256 } 7257 7258 // Generate parameters to create a standard animation 7259 function genFx(type, includeWidth) { 7260 var which, 7261 attrs = { height: type }, 7262 i = 0; 7263 7264 // if we include width, step value is 1 to do all cssExpand values, 7265 // if we don't include width, step value is 2 to skip over Left and Right 7266 includeWidth = includeWidth ? 1 : 0; 7267 for (; i < 4; i += 2 - includeWidth) { 7268 which = cssExpand[i]; 7269 attrs["margin" + which] = attrs["padding" + which] = type; 7270 } 7271 7272 if (includeWidth) { 7273 attrs.opacity = attrs.width = type; 7274 } 7275 7276 return attrs; 7277 } 7278 7279 function createTween(value, prop, animation) { 7280 var tween, 7281 collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), 7282 index = 0, 7283 length = collection.length; 7284 for (; index < length; index++) { 7285 if (tween = collection[index].call(animation, prop, value)) { 7286 7287 // we're done with this property 7288 return tween; 7289 } 7290 } 7291 } 7292 7293 function defaultPrefilter(elem, props, opts) { 7294 /* jshint validthis: true */ 7295 var prop, 7296 value, 7297 toggle, 7298 tween, 7299 hooks, 7300 oldfire, 7301 display, 7302 checkDisplay, 7303 anim = this, 7304 orig = {}, 7305 style = elem.style, 7306 hidden = elem.nodeType && isHidden(elem), 7307 dataShow = jQuery._data(elem, "fxshow"); 7308 7309 // handle queue: false promises 7310 if (!opts.queue) { 7311 hooks = jQuery._queueHooks(elem, "fx"); 7312 if (hooks.unqueued == null) { 7313 hooks.unqueued = 0; 7314 oldfire = hooks.empty.fire; 7315 hooks.empty.fire = function () { 7316 if (!hooks.unqueued) { 7317 oldfire(); 7318 } 7319 }; 7320 } 7321 hooks.unqueued++; 7322 7323 anim.always(function () { 7324 7325 // doing this makes sure that the complete handler will be called 7326 // before this completes 7327 anim.always(function () { 7328 hooks.unqueued--; 7329 if (!jQuery.queue(elem, "fx").length) { 7330 hooks.empty.fire(); 7331 } 7332 }); 7333 }); 7334 } 7335 7336 // height/width overflow pass 7337 if (elem.nodeType === 1 && ("height" in props || "width" in props)) { 7338 7339 // Make sure that nothing sneaks out 7340 // Record all 3 overflow attributes because IE does not 7341 // change the overflow attribute when overflowX and 7342 // overflowY are set to the same value 7343 opts.overflow = [style.overflow, style.overflowX, style.overflowY]; 7344 7345 // Set display property to inline-block for height/width 7346 // animations on inline elements that are having width/height animated 7347 display = jQuery.css(elem, "display"); 7348 7349 // Test default display if display is currently "none" 7350 checkDisplay = display === "none" ? jQuery._data(elem, "olddisplay") || defaultDisplay(elem.nodeName) : display; 7351 7352 if (checkDisplay === "inline" && jQuery.css(elem, "float") === "none") { 7353 7354 // inline-level elements accept inline-block; 7355 // block-level elements need to be inline with layout 7356 if (!support.inlineBlockNeedsLayout || defaultDisplay(elem.nodeName) === "inline") { 7357 style.display = "inline-block"; 7358 } else { 7359 style.zoom = 1; 7360 } 7361 } 7362 } 7363 7364 if (opts.overflow) { 7365 style.overflow = "hidden"; 7366 if (!support.shrinkWrapBlocks()) { 7367 anim.always(function () { 7368 style.overflow = opts.overflow[0]; 7369 style.overflowX = opts.overflow[1]; 7370 style.overflowY = opts.overflow[2]; 7371 }); 7372 } 7373 } 7374 7375 // show/hide pass 7376 for (prop in props) { 7377 value = props[prop]; 7378 if (rfxtypes.exec(value)) { 7379 delete props[prop]; 7380 toggle = toggle || value === "toggle"; 7381 if (value === (hidden ? "hide" : "show")) { 7382 7383 // If there is dataShow left over from a stopped hide or show 7384 // and we are going to proceed with show, we should pretend to be hidden 7385 if (value === "show" && dataShow && dataShow[prop] !== undefined) { 7386 hidden = true; 7387 } else { 7388 continue; 7389 } 7390 } 7391 orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop); 7392 7393 // Any non-fx value stops us from restoring the original display value 7394 } else { 7395 display = undefined; 7396 } 7397 } 7398 7399 if (!jQuery.isEmptyObject(orig)) { 7400 if (dataShow) { 7401 if ("hidden" in dataShow) { 7402 hidden = dataShow.hidden; 7403 } 7404 } else { 7405 dataShow = jQuery._data(elem, "fxshow", {}); 7406 } 7407 7408 // store state if its toggle - enables .stop().toggle() to "reverse" 7409 if (toggle) { 7410 dataShow.hidden = !hidden; 7411 } 7412 if (hidden) { 7413 jQuery(elem).show(); 7414 } else { 7415 anim.done(function () { 7416 jQuery(elem).hide(); 7417 }); 7418 } 7419 anim.done(function () { 7420 var prop; 7421 jQuery._removeData(elem, "fxshow"); 7422 for (prop in orig) { 7423 jQuery.style(elem, prop, orig[prop]); 7424 } 7425 }); 7426 for (prop in orig) { 7427 tween = createTween(hidden ? dataShow[prop] : 0, prop, anim); 7428 7429 if (!(prop in dataShow)) { 7430 dataShow[prop] = tween.start; 7431 if (hidden) { 7432 tween.end = tween.start; 7433 tween.start = prop === "width" || prop === "height" ? 1 : 0; 7434 } 7435 } 7436 } 7437 7438 // If this is a noop like .hide().hide(), restore an overwritten display value 7439 } else if ((display === "none" ? defaultDisplay(elem.nodeName) : dis
vendor: 5,869 bytes, lines 7439-7665
7439play) === "inline") { 7440 style.display = display; 7441 } 7442 } 7443 7444 function propFilter(props, specialEasing) { 7445 var index, name, easing, value, hooks; 7446 7447 // camelCase, specialEasing and expand cssHook pass 7448 for (index in props) { 7449 name = jQuery.camelCase(index); 7450 easing = specialEasing[name]; 7451 value = props[index]; 7452 if (jQuery.isArray(value)) { 7453 easing = value[1]; 7454 value = props[index] = value[0]; 7455 } 7456 7457 if (index !== name) { 7458 props[name] = value; 7459 delete props[index]; 7460 } 7461 7462 hooks = jQuery.cssHooks[name]; 7463 if (hooks && "expand" in hooks) { 7464 value = hooks.expand(value); 7465 delete props[name]; 7466 7467 // not quite $.extend, this wont overwrite keys already present. 7468 // also - reusing 'index' from above because we have the correct "name" 7469 for (index in value) { 7470 if (!(index in props)) { 7471 props[index] = value[index]; 7472 specialEasing[index] = easing; 7473 } 7474 } 7475 } else { 7476 specialEasing[name] = easing; 7477 } 7478 } 7479 } 7480 7481 function Animation(elem, properties, options) { 7482 var result, 7483 stopped, 7484 index = 0, 7485 length = Animation.prefilters.length, 7486 deferred = jQuery.Deferred().always(function () { 7487 7488 // don't match elem in the :animated selector 7489 delete tick.elem; 7490 }), 7491 tick = function () { 7492 if (stopped) { 7493 return false; 7494 } 7495 var currentTime = fxNow || createFxNow(), 7496 remaining = Math.max(0, animation.startTime + animation.duration - currentTime), 7497 7498 7499 // Support: Android 2.3 7500 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 7501 temp = remaining / animation.duration || 0, 7502 percent = 1 - temp, 7503 index = 0, 7504 length = animation.tweens.length; 7505 7506 for (; index < length; index++) { 7507 animation.tweens[index].run(percent); 7508 } 7509 7510 deferred.notifyWith(elem, [animation, percent, remaining]); 7511 7512 if (percent < 1 && length) { 7513 return remaining; 7514 } else { 7515 deferred.resolveWith(elem, [animation]); 7516 return false; 7517 } 7518 }, 7519 animation = deferred.promise({ 7520 elem: elem, 7521 props: jQuery.extend({}, properties), 7522 opts: jQuery.extend(true, { 7523 specialEasing: {}, 7524 easing: jQuery.easing._default 7525 }, options), 7526 originalProperties: properties, 7527 originalOptions: options, 7528 startTime: fxNow || createFxNow(), 7529 duration: options.duration, 7530 tweens: [], 7531 createTween: function (prop, end) { 7532 var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing); 7533 animation.tweens.push(tween); 7534 return tween; 7535 }, 7536 stop: function (gotoEnd) { 7537 var index = 0, 7538 7539 7540 // if we are going to the end, we want to run all the tweens 7541 // otherwise we skip this part 7542 length = gotoEnd ? animation.tweens.length : 0; 7543 if (stopped) { 7544 return this; 7545 } 7546 stopped = true; 7547 for (; index < length; index++) { 7548 animation.tweens[index].run(1); 7549 } 7550 7551 // resolve when we played the last frame 7552 // otherwise, reject 7553 if (gotoEnd) { 7554 deferred.notifyWith(elem, [animation, 1, 0]); 7555 deferred.resolveWith(elem, [animation, gotoEnd]); 7556 } else { 7557 deferred.rejectWith(elem, [animation, gotoEnd]); 7558 } 7559 return this; 7560 } 7561 }), 7562 props = animation.props; 7563 7564 propFilter(props, animation.opts.specialEasing); 7565 7566 for (; index < length; index++) { 7567 result = Animation.prefilters[index].call(animation, elem, props, animation.opts); 7568 if (result) { 7569 if (jQuery.isFunction(result.stop)) { 7570 jQuery._queueHooks(animation.elem, animation.opts.queue).stop = jQuery.proxy(result.stop, result); 7571 } 7572 return result; 7573 } 7574 } 7575 7576 jQuery.map(props, createTween, animation); 7577 7578 if (jQuery.isFunction(animation.opts.start)) { 7579 animation.opts.start.call(elem, animation); 7580 } 7581 7582 jQuery.fx.timer(jQuery.extend(tick, { 7583 elem: elem, 7584 anim: animation, 7585 queue: animation.opts.queue 7586 })); 7587 7588 // attach callbacks from options 7589 return animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always); 7590 } 7591 7592 jQuery.Animation = jQuery.extend(Animation, { 7593 7594 tweeners: { 7595 "*": [function (prop, value) { 7596 var tween = this.createTween(prop, value); 7597 adjustCSS(tween.elem, prop, rcssNum.exec(value), tween); 7598 return tween; 7599 }] 7600 }, 7601 7602 tweener: function (props, callback) { 7603 if (jQuery.isFunction(props)) { 7604 callback = props; 7605 props = ["*"]; 7606 } else { 7607 props = props.match(rnotwhite); 7608 } 7609 7610 var prop, 7611 index = 0, 7612 length = props.length; 7613 7614 for (; index < length; index++) { 7615 prop = props[index]; 7616 Animation.tweeners[prop] = Animation.tweeners[prop] || []; 7617 Animation.tweeners[prop].unshift(callback); 7618 } 7619 }, 7620 7621 prefilters: [defaultPrefilter], 7622 7623 prefilter: function (callback, prepend) { 7624 if (prepend) { 7625 Animation.prefilters.unshift(callback); 7626 } else { 7627 Animation.prefilters.push(callback); 7628 } 7629 } 7630 }); 7631 7632 jQuery.speed = function (speed, easing, fn) { 7633 var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { 7634 complete: fn || !fn && easing || jQuery.isFunction(speed) && speed, 7635 duration: speed, 7636 easing: fn && easing || easing && !jQuery.isFunction(easing) && easing 7637 }; 7638 7639 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default; 7640 7641 // normalize opt.queue - true/undefined/null -> "fx" 7642 if (opt.queue == null || opt.queue === true) { 7643 opt.queue = "fx"; 7644 } 7645 7646 // Queueing 7647 opt.old = opt.complete; 7648 7649 opt.complete = function () { 7650 if (jQuery.isFunction(opt.old)) { 7651 opt.old.call(this); 7652 } 7653 7654 if (opt.queue) { 7655 jQuery.dequeue(this, opt.queue); 7656 } 7657 }; 7658 7659 return opt; 7660 }; 7661 7662 jQuery.fn.extend({ 7663 fadeTo: function (speed, to, easing, callback) { 7664 7665 // show any hidden elements after setting opacity to 0
vendor: 8,995 bytes, lines 7666-8006
7666 return this.filter(isHidden).css("opacity", 0).show() 7667 7668 // animate to the value specified 7669 .end().animate({ opacity: to }, speed, easing, callback); 7670 }, 7671 animate: function (prop, speed, easing, callback) { 7672 var empty = jQuery.isEmptyObject(prop), 7673 optall = jQuery.speed(speed, easing, callback), 7674 doAnimation = function () { 7675 7676 // Operate on a copy of prop so per-property easing won't be lost 7677 var anim = Animation(this, jQuery.extend({}, prop), optall); 7678 7679 // Empty animations, or finishing resolves immediately 7680 if (empty || jQuery._data(this, "finish")) { 7681 anim.stop(true); 7682 } 7683 }; 7684 doAnimation.finish = doAnimation; 7685 7686 return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation); 7687 }, 7688 stop: function (type, clearQueue, gotoEnd) { 7689 var stopQueue = function (hooks) { 7690 var stop = hooks.stop; 7691 delete hooks.stop; 7692 stop(gotoEnd); 7693 }; 7694 7695 if (typeof type !== "string") { 7696 gotoEnd = clearQueue; 7697 clearQueue = type; 7698 type = undefined; 7699 } 7700 if (clearQueue && type !== false) { 7701 this.queue(type || "fx", []); 7702 } 7703 7704 return this.each(function () { 7705 var dequeue = true, 7706 index = type != null && type + "queueHooks", 7707 timers = jQuery.timers, 7708 data = jQuery._data(this); 7709 7710 if (index) { 7711 if (data[index] && data[index].stop) { 7712 stopQueue(data[index]); 7713 } 7714 } else { 7715 for (index in data) { 7716 if (data[index] && data[index].stop && rrun.test(index)) { 7717 stopQueue(data[index]); 7718 } 7719 } 7720 } 7721 7722 for (index = timers.length; index--;) { 7723 if (timers[index].elem === this && (type == null || timers[index].queue === type)) { 7724 7725 timers[index].anim.stop(gotoEnd); 7726 dequeue = false; 7727 timers.splice(index, 1); 7728 } 7729 } 7730 7731 // start the next in the queue if the last step wasn't forced 7732 // timers currently will call their complete callbacks, which will dequeue 7733 // but only if they were gotoEnd 7734 if (dequeue || !gotoEnd) { 7735 jQuery.dequeue(this, type); 7736 } 7737 }); 7738 }, 7739 finish: function (type) { 7740 if (type !== false) { 7741 type = type || "fx"; 7742 } 7743 return this.each(function () { 7744 var index, 7745 data = jQuery._data(this), 7746 queue = data[type + "queue"], 7747 hooks = data[type + "queueHooks"], 7748 timers = jQuery.timers, 7749 length = queue ? queue.length : 0; 7750 7751 // enable finishing flag on private data 7752 data.finish = true; 7753 7754 // empty the queue first 7755 jQuery.queue(this, type, []); 7756 7757 if (hooks && hooks.stop) { 7758 hooks.stop.call(this, true); 7759 } 7760 7761 // look for any active animations, and finish them 7762 for (index = timers.length; index--;) { 7763 if (timers[index].elem === this && timers[index].queue === type) { 7764 timers[index].anim.stop(true); 7765 timers.splice(index, 1); 7766 } 7767 } 7768 7769 // look for any animations in the old queue and finish them 7770 for (index = 0; index < length; index++) { 7771 if (queue[index] && queue[index].finish) { 7772 queue[index].finish.call(this); 7773 } 7774 } 7775 7776 // turn off finishing flag 7777 delete data.finish; 7778 }); 7779 } 7780 }); 7781 7782 jQuery.each(["toggle", "show", "hide"], function (i, name) { 7783 var cssFn = jQuery.fn[name]; 7784 jQuery.fn[name] = function (speed, easing, callback) { 7785 return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback); 7786 }; 7787 }); 7788 7789 // Generate shortcuts for custom animations 7790 jQuery.each({ 7791 slideDown: genFx("show"), 7792 slideUp: genFx("hide"), 7793 slideToggle: genFx("toggle"), 7794 fadeIn: { opacity: "show" }, 7795 fadeOut: { opacity: "hide" }, 7796 fadeToggle: { opacity: "toggle" } 7797 }, function (name, props) { 7798 jQuery.fn[name] = function (speed, easing, callback) { 7799 return this.animate(props, speed, easing, callback); 7800 }; 7801 }); 7802 7803 jQuery.timers = []; 7804 jQuery.fx.tick = function () { 7805 var timer, 7806 timers = jQuery.timers, 7807 i = 0; 7808 7809 fxNow = jQuery.now(); 7810 7811 for (; i < timers.length; i++) { 7812 timer = timers[i]; 7813 7814 // Checks the timer has not already been removed 7815 if (!timer() && timers[i] === timer) { 7816 timers.splice(i--, 1); 7817 } 7818 } 7819 7820 if (!timers.length) { 7821 jQuery.fx.stop(); 7822 } 7823 fxNow = undefined; 7824 }; 7825 7826 jQuery.fx.timer = function (timer) { 7827 jQuery.timers.push(timer); 7828 if (timer()) { 7829 jQuery.fx.start(); 7830 } else { 7831 jQuery.timers.pop(); 7832 } 7833 }; 7834 7835 jQuery.fx.interval = 13; 7836 7837 jQuery.fx.start = function () { 7838 if (!timerId) { 7839 timerId = window.setInterval(jQuery.fx.tick, jQuery.fx.interval); 7840 } 7841 }; 7842 7843 jQuery.fx.stop = function () { 7844 window.clearInterval(timerId); 7845 timerId = null; 7846 }; 7847 7848 jQuery.fx.speeds = { 7849 slow: 600, 7850 fast: 200, 7851 7852 // Default speed 7853 _default: 400 7854 }; 7855 7856 // Based off of the plugin by Clint Helfers, with permission. 7857 // http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 7858 jQuery.fn.delay = function (time, type) { 7859 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; 7860 type = type || "fx"; 7861 7862 return this.queue(type, function (next, hooks) { 7863 var timeout = window.setTimeout(next, time); 7864 hooks.stop = function () { 7865 window.clearTimeout(timeout); 7866 }; 7867 }); 7868 }; 7869 7870 (function () { 7871 var a, 7872 input = document.createElement("input"), 7873 div = document.createElement("div"), 7874 select = document.createElement("select"), 7875 opt = select.appendChild(document.createElement("option")); 7876 7877 // Setup 7878 div = document.createElement("div"); 7879 div.setAttribute("className", "t"); 7880 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 7881 a = div.getElementsByTagName("a")[0]; 7882 7883 // Support: Windows Web Apps (WWA) 7884 // `type` must use .setAttribute for WWA (#14901) 7885 input.setAttribute("type", "checkbox"); 7886 div.appendChild(input); 7887 7888 a = div.getElementsByTagName("a")[0]; 7889 7890 // First batch of tests. 7891 a.style.cssText = "top:1px"; 7892 7893 // Test setAttribute on camelCase class. 7894 // If it works, we need attrFixes when doing get/setAttribute (ie6/7) 7895 support.getSetAttribute = div.className !== "t"; 7896 7897 // Get the style information from getAttribute 7898 // (IE uses .cssText instead) 7899 support.style = /top/.test(a.getAttribute("style")); 7900 7901 // Make sure that URLs aren't manipulated 7902 // (IE normalizes it by default) 7903 support.hrefNormalized = a.getAttribute("href") === "/a"; 7904 7905 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) 7906 support.checkOn = !!input.value; 7907 7908 // Make sure that a selected-by-default option has a working selected property. 7909 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) 7910 support.optSelected = opt.selected; 7911 7912 // Tests for enctype support on a form (#6743) 7913 support.enctype = !!document.createElement("form").enctype; 7914 7915 // Make sure that the options inside disabled selects aren't marked as disabled 7916 // (WebKit marks them as disabled) 7917 select.disabled = true; 7918 support.optDisabled = !opt.disabled; 7919 7920 // Support: IE8 only 7921 // Check if we can trust getAttribute("value") 7922 input = document.createElement("input"); 7923 input.setAttribute("value", ""); 7924 support.input = input.getAttribute("value") === ""; 7925 7926 // Check if an input maintains its value after becoming a radio 7927 input.value = "t"; 7928 input.setAttribute("type", "radio"); 7929 support.radioValue = input.value === "t"; 7930 })(); 7931 7932 var rreturn = /\r/g, 7933 rspaces = /[\x20\t\r\n\f]+/g; 7934 7935 jQuery.fn.extend({ 7936 val: function (value) { 7937 var hooks, 7938 ret, 7939 isFunction, 7940 elem = this[0]; 7941 7942 if (!arguments.length) { 7943 if (elem) { 7944 hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()]; 7945 7946 if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) { 7947 return ret; 7948 } 7949 7950 ret = elem.value; 7951 7952 return typeof ret === "string" ? 7953 7954 // handle most common string cases 7955 ret.replace(rreturn, "") : 7956 7957 // handle cases where value is null/undef or number 7958 ret == null ? "" : ret; 7959 } 7960 7961 return; 7962 } 7963 7964 isFunction = jQuery.isFunction(value); 7965 7966 return this.each(function (i) { 7967 var val; 7968 7969 if (this.nodeType !== 1) { 7970 return; 7971 } 7972 7973 if (isFunction) { 7974 val = value.call(this, i, jQuery(this).val()); 7975 } else { 7976 val = value; 7977 } 7978 7979 // Treat null/undefined as ""; convert numbers to string 7980 if (val == null) { 7981 val = ""; 7982 } else if (typeof val === "number") { 7983 val += ""; 7984 } else if (jQuery.isArray(val)) { 7985 val = jQuery.map(val, function (value) { 7986 return value == null ? "" : value + ""; 7987 }); 7988 } 7989 7990 hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]; 7991 7992 // If set returns undefined, fall back to normal setting 7993 if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) { 7994 this.value = val; 7995 } 7996 }); 7997 } 7998 }); 7999 8000 jQuery.extend({ 8001 valHooks: { 8002 option: { 8003 get: function (elem) { 8004 var val = jQuery.find.attr(elem, "value"); 8005 return val != null ? val : 8006
vendor: 4,966 bytes, lines 8007-8195
8007 // Support: IE10-11+ 8008 // option.text throws exceptions (#14686, #14858) 8009 // Strip and collapse whitespace 8010 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 8011 jQuery.trim(jQuery.text(elem)).replace(rspaces, " "); 8012 } 8013 }, 8014 select: { 8015 get: function (elem) { 8016 var value, 8017 option, 8018 options = elem.options, 8019 index = elem.selectedIndex, 8020 one = elem.type === "select-one" || index < 0, 8021 values = one ? null : [], 8022 max = one ? index + 1 : options.length, 8023 i = index < 0 ? max : one ? index : 0; 8024 8025 // Loop through all the selected options 8026 for (; i < max; i++) { 8027 option = options[i]; 8028 8029 // oldIE doesn't update selected after form reset (#2551) 8030 if ((option.selected || i === index) && ( 8031 8032 // Don't return options that are disabled or in a disabled optgroup 8033 support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) { 8034 8035 // Get the specific value for the option 8036 value = jQuery(option).val(); 8037 8038 // We don't need an array for one selects 8039 if (one) { 8040 return value; 8041 } 8042 8043 // Multi-Selects return an array 8044 values.push(value); 8045 } 8046 } 8047 8048 return values; 8049 }, 8050 8051 set: function (elem, value) { 8052 var optionSet, 8053 option, 8054 options = elem.options, 8055 values = jQuery.makeArray(value), 8056 i = options.length; 8057 8058 while (i--) { 8059 option = options[i]; 8060 8061 if (jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) { 8062 8063 // Support: IE6 8064 // When new option element is added to select box we need to 8065 // force reflow of newly added node in order to workaround delay 8066 // of initialization properties 8067 try { 8068 option.selected = optionSet = true; 8069 } catch (_) { 8070 8071 // Will be executed only in IE6 8072 option.scrollHeight; 8073 } 8074 } else { 8075 option.selected = false; 8076 } 8077 } 8078 8079 // Force browsers to behave consistently when non-matching value is set 8080 if (!optionSet) { 8081 elem.selectedIndex = -1; 8082 } 8083 8084 return options; 8085 } 8086 } 8087 } 8088 }); 8089 8090 // Radios and checkboxes getter/setter 8091 jQuery.each(["radio", "checkbox"], function () { 8092 jQuery.valHooks[this] = { 8093 set: function (elem, value) { 8094 if (jQuery.isArray(value)) { 8095 return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1; 8096 } 8097 } 8098 }; 8099 if (!support.checkOn) { 8100 jQuery.valHooks[this].get = function (elem) { 8101 return elem.getAttribute("value") === null ? "on" : elem.value; 8102 }; 8103 } 8104 }); 8105 8106 var nodeHook, 8107 boolHook, 8108 attrHandle = jQuery.expr.attrHandle, 8109 ruseDefault = /^(?:checked|selected)$/i, 8110 getSetAttribute = support.getSetAttribute, 8111 getSetInput = support.input; 8112 8113 jQuery.fn.extend({ 8114 attr: function (name, value) { 8115 return access(this, jQuery.attr, name, value, arguments.length > 1); 8116 }, 8117 8118 removeAttr: function (name) { 8119 return this.each(function () { 8120 jQuery.removeAttr(this, name); 8121 }); 8122 } 8123 }); 8124 8125 jQuery.extend({ 8126 attr: function (elem, name, value) { 8127 var ret, 8128 hooks, 8129 nType = elem.nodeType; 8130 8131 // Don't get/set attributes on text, comment and attribute nodes 8132 if (nType === 3 || nType === 8 || nType === 2) { 8133 return; 8134 } 8135 8136 // Fallback to prop when attributes are not supported 8137 if (typeof elem.getAttribute === "undefined") { 8138 return jQuery.prop(elem, name, value); 8139 } 8140 8141 // All attributes are lowercase 8142 // Grab necessary hook if one is defined 8143 if (nType !== 1 || !jQuery.isXMLDoc(elem)) { 8144 name = name.toLowerCase(); 8145 hooks = jQuery.attrHooks[name] || (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook); 8146 } 8147 8148 if (value !== undefined) { 8149 if (value === null) { 8150 jQuery.removeAttr(elem, name); 8151 return; 8152 } 8153 8154 if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) { 8155 return ret; 8156 } 8157 8158 elem.setAttribute(name, value + ""); 8159 return value; 8160 } 8161 8162 if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { 8163 return ret; 8164 } 8165 8166 ret = jQuery.find.attr(elem, name); 8167 8168 // Non-existent attributes return null, we normalize to undefined 8169 return ret == null ? undefined : ret; 8170 }, 8171 8172 attrHooks: { 8173 type: { 8174 set: function (elem, value) { 8175 if (!support.radioValue && value === "radio" && jQuery.nodeName(elem, "input")) { 8176 8177 // Setting the type on a radio button after the value resets the value in IE8-9 8178 // Reset value to default in case type is set after value during creation 8179 var val = elem.value; 8180 elem.setAttribute("type", value); 8181 if (val) { 8182 elem.value = val; 8183 } 8184 return value; 8185 } 8186 } 8187 } 8188 }, 8189 8190 removeAttr: function (elem, value) { 8191 var name, 8192 propName, 8193 i = 0, 8194 attrNames = value && value.match(rnotwhite); 8195
vendor: 4,714 bytes, lines 8196-8359
8196 if (attrNames && elem.nodeType === 1) { 8197 while (name = attrNames[i++]) { 8198 propName = jQuery.propFix[name] || name; 8199 8200 // Boolean attributes get special treatment (#10870) 8201 if (jQuery.expr.match.bool.test(name)) { 8202 8203 // Set corresponding property to false 8204 if (getSetInput && getSetAttribute || !ruseDefault.test(name)) { 8205 elem[propName] = false; 8206 8207 // Support: IE<9 8208 // Also clear defaultChecked/defaultSelected (if appropriate) 8209 } else { 8210 elem[jQuery.camelCase("default-" + name)] = elem[propName] = false; 8211 } 8212 8213 // See #9699 for explanation of this approach (setting first, then removal) 8214 } else { 8215 jQuery.attr(elem, name, ""); 8216 } 8217 8218 elem.removeAttribute(getSetAttribute ? name : propName); 8219 } 8220 } 8221 } 8222 }); 8223 8224 // Hooks for boolean attributes 8225 boolHook = { 8226 set: function (elem, value, name) { 8227 if (value === false) { 8228 8229 // Remove boolean attributes when set to false 8230 jQuery.removeAttr(elem, name); 8231 } else if (getSetInput && getSetAttribute || !ruseDefault.test(name)) { 8232 8233 // IE<8 needs the *property* name 8234 elem.setAttribute(!getSetAttribute && jQuery.propFix[name] || name, name); 8235 } else { 8236 8237 // Support: IE<9 8238 // Use defaultChecked and defaultSelected for oldIE 8239 elem[jQuery.camelCase("default-" + name)] = elem[name] = true; 8240 } 8241 return name; 8242 } 8243 }; 8244 8245 jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function (i, name) { 8246 var getter = attrHandle[name] || jQuery.find.attr; 8247 8248 if (getSetInput && getSetAttribute || !ruseDefault.test(name)) { 8249 attrHandle[name] = function (elem, name, isXML) { 8250 var ret, handle; 8251 if (!isXML) { 8252 8253 // Avoid an infinite loop by temporarily removing this function from the getter 8254 handle = attrHandle[name]; 8255 attrHandle[name] = ret; 8256 ret = getter(elem, name, isXML) != null ? name.toLowerCase() : null; 8257 attrHandle[name] = handle; 8258 } 8259 return ret; 8260 }; 8261 } else { 8262 attrHandle[name] = function (elem, name, isXML) { 8263 if (!isXML) { 8264 return elem[jQuery.camelCase("default-" + name)] ? name.toLowerCase() : null; 8265 } 8266 }; 8267 } 8268 }); 8269 8270 // fix oldIE attroperties 8271 if (!getSetInput || !getSetAttribute) { 8272 jQuery.attrHooks.value = { 8273 set: function (elem, value, name) { 8274 if (jQuery.nodeName(elem, "input")) { 8275 8276 // Does not return so that setAttribute is also used 8277 elem.defaultValue = value; 8278 } else { 8279 8280 // Use nodeHook if defined (#1954); otherwise setAttribute is fine 8281 return nodeHook && nodeHook.set(elem, value, name); 8282 } 8283 } 8284 }; 8285 } 8286 8287 // IE6/7 do not support getting/setting some attributes with get/setAttribute 8288 if (!getSetAttribute) { 8289 8290 // Use this for any attribute in IE6/7 8291 // This fixes almost every IE6/7 issue 8292 nodeHook = { 8293 set: function (elem, value, name) { 8294 8295 // Set the existing or create a new attribute node 8296 var ret = elem.getAttributeNode(name); 8297 if (!ret) { 8298 elem.setAttributeNode(ret = elem.ownerDocument.createAttribute(name)); 8299 } 8300 8301 ret.value = value += ""; 8302 8303 // Break association with cloned elements by also using setAttribute (#9646) 8304 if (name === "value" || value === elem.getAttribute(name)) { 8305 return value; 8306 } 8307 } 8308 }; 8309 8310 // Some attributes are constructed with empty-string values when not defined 8311 attrHandle.id = attrHandle.name = attrHandle.coords = function (elem, name, isXML) { 8312 var ret; 8313 if (!isXML) { 8314 return (ret = elem.getAttributeNode(name)) && ret.value !== "" ? ret.value : null; 8315 } 8316 }; 8317 8318 // Fixing value retrieval on a button requires this module 8319 jQuery.valHooks.button = { 8320 get: function (elem, name) { 8321 var ret = elem.getAttributeNode(name); 8322 if (ret && ret.specified) { 8323 return ret.value; 8324 } 8325 }, 8326 set: nodeHook.set 8327 }; 8328 8329 // Set contenteditable to false on removals(#10429) 8330 // Setting to empty string throws an error as an invalid value 8331 jQuery.attrHooks.contenteditable = { 8332 set: function (elem, value, name) { 8333 nodeHook.set(elem, value === "" ? false : value, name); 8334 } 8335 }; 8336 8337 // Set width and height to auto instead of 0 on empty string( Bug #8150 ) 8338 // This is for removals 8339 jQuery.each(["width", "height"], function (i, name) { 8340 jQuery.attrHooks[name] = { 8341 set: function (elem, value) { 8342 if (value === "") { 8343 elem.setAttribute(name, "auto"); 8344 return value; 8345 } 8346 } 8347 }; 8348 }); 8349 } 8350 8351 if (!support.style) { 8352 jQuery.attrHooks.style = { 8353 get: function (elem) { 8354 8355 // Return undefined in the case of empty string 8356 // Note: IE uppercases css property names, but if we were to .toLowerCase() 8357 // .cssText, that would destroy case sensitivity in URL's, like in "background" 8358 return elem.style.cssText || undefined; 8359 },
8360 set: function (elem, value) { 8361 return elem.style.cssText = value + ""; 8362 } 8363 }; 8364 } 8365 8366 var rfocusable = /^(?:input|select|textarea|button|object)$/i, 8367 rclickable = /^(?:a|area)$/i; 8368 8369 jQuery.fn.extend({ 8370 prop: function (name, value) { 8371 return access(this, jQuery.prop, name, value, arguments.length > 1); 8372 }, 8373 8374 removeProp: function (name) { 8375 name = jQuery.propFix[name] || name; 8376 return this.each(function () { 8377 8378 // try/catch handles cases where IE balks (such as removing a property on window) 8379 try { 8380 this[name] = undefined; 8381 delete this[name]; 8382 } catch (e) {} 8383 }); 8384 } 8385 }); 8386 8387 jQuery.extend({ 8388 prop: function (elem, name, value) { 8389 var ret, 8390 hooks, 8391 nType = elem.nodeType; 8392 8393 // Don't get/set properties on text, comment and attribute nodes 8394 if (nType === 3 || nType === 8 || nType === 2) { 8395 return; 8396 } 8397 8398 if (nType !== 1 || !jQuery.isXMLDoc(elem)) { 8399 8400 // Fix name and attach hooks 8401 name = jQuery.propFix[name] || name; 8402 hooks = jQuery.propHooks[name]; 8403 } 8404 8405 if (value !== undefined) { 8406 if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) { 8407 return ret; 8408 } 8409 8410 return elem[name] = value; 8411 } 8412 8413 if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { 8414 return ret; 8415 } 8416 8417 return elem[name]; 8418 }, 8419 8420 propHooks: { 8421 tabIndex: { 8422 get: function (elem) { 8423 8424 // elem.tabIndex doesn't always return the 8425 // correct value when it hasn't been explicitly set 8426 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 8427 // Use proper attribute retrieval(#12072) 8428 var tabindex = jQuery.find.attr(elem, "tabindex"); 8429 8430 return tabindex ? parseInt(tabindex, 10) : rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ? 0 : -1; 8431 } 8432 } 8433 }, 8434 8435 propFix: { 8436 "for": "htmlFor", 8437 "class": "className" 8438 } 8439 }); 8440 8441 // Some attributes require a special call on IE 8442 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 8443 if (!support.hrefNormalized) { 8444 8445 // href/src property should get the full normalized URL (#10299/#12915) 8446 jQuery.each(["href", "src"], function (i, name) { 8447 jQuery.propHooks[name] = { 8448 get: function (elem) { 8449 return elem.getAttribute(name, 4); 8450 } 8451 }; 8452 }); 8453 } 8454 8455 // Support: Safari, IE9+ 8456 // Accessing the selectedIndex property 8457 // forces the browser to respect setting selected 8458 // on the option 8459 // The getter ensures a default option is selected 8460 // when in an optgroup 8461 if (!support.optSelected) { 8462 jQuery.propHooks.selected = { 8463 get: function (elem) { 8464 var parent = elem.parentNode; 8465 8466 if (parent) { 8467 parent.selectedIndex; 8468 8469 // Make sure that it also works with optgroups, see #5701 8470 if (parent.parentNode) { 8471 parent.parentNode.selectedIndex; 8472 } 8473 } 8474 return null; 8475 }, 8476 set: function (elem) { 8477 var parent = elem.parentNode; 8478 if (parent) { 8479 parent.selectedIndex; 8480 8481 if (parent.parentNode) { 8482 parent.parentNode.selectedIndex; 8483 } 8484 } 8485 } 8486 }; 8487 } 8488 8489 jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { 8490 jQuery.propFix[this.toLowerCase()] = this; 8491 }); 8492 8493 // IE6/7 call enctype encoding 8494 if (!support.enctype) { 8495 jQuery.propFix.enctype = "encoding"; 8496 } 8497 8498 var rclass = /[\t\r\n\f]/g; 8499 8500 function getClass(elem) { 8501 return jQuery.attr(elem, "class") || ""; 8502 } 8503 8504 jQuery.fn.extend({ 8505 addClass: function (value) { 8506 var classes, 8507 elem, 8508 cur, 8509 curValue, 8510 clazz, 8511 j, 8512 finalValue, 8513 i = 0; 8514 8515 if (jQuery.isFunction(value)) { 8516 return this.each(function (j) { 8517 jQuery(this).addClass(value.call(this, j, getClass(this))); 8518 }); 8519 } 8520 8521 if (typeof value === "string" && value) { 8522 classes = value.match(rnotwhite) || []; 8523 8524 while (elem = this[i++]) { 8525 curValue = getClass(elem); 8526 cur = elem.nodeType === 1 && (" " + curValue + " ").replace(rclass, " "); 8527 8528 if (cur) { 8529 j = 0; 8530 while (clazz = classes[j++]) { 8531 if (cur.indexOf(" " + clazz + " ") < 0) { 8532 cur += clazz + " "; 8533 } 8534 } 8535 8536 // only assign if different to avoid unneeded rendering. 8537 finalValue = jQuery.trim(cur); 8538 if (curValue !== finalValue) { 8539 jQuery.attr(elem, "class", finalValue); 8540 } 8541 } 8542 } 8543 } 8544 8545 return this; 8546 }, 8547 8548 removeClass: function (value) { 8549 var classes, 8550 elem, 8551 cur, 8552 curValue, 8553 clazz, 8554 j, 8555 finalValue, 8556 i = 0; 8557 8558 if (jQuery.isFunction(value)) { 8559 return this.each(function (j) { 8560 jQuery(this).removeClass(value.call(this, j, getClass(this))); 8561 }); 8562 } 8563 8564 if (!arguments.length) { 8565 return this.attr("class", ""); 8566 } 8567 8568 if (typeof value === "string" && value) { 8569 classes = value.match(rnotwhite) || []; 8570 8571 while (elem = this[i++]) { 8572 curValue = getClass(elem); 8573 8574 // This expression is here for better compressibility (see addClass) 8575 cur = elem.nodeType === 1 && (" " + curValue + " ").replace(rclass, " "); 8576 8577 if (cur) { 8578 j = 0; 8579 while (clazz = classes[j++]) { 8580
8581 // Remove *all* instances 8582 while (cur.indexOf(" " + clazz + " ") > -1) { 8583 cur = cur.replace(" " + clazz + " ", " "); 8584 } 8585 } 8586 8587 // Only assign if different to avoid unneeded rendering. 8588 finalValue = jQuery.trim(cur); 8589 if (curValue !== finalValue) { 8590 jQuery.attr(elem, "class", finalValue); 8591 } 8592 } 8593 } 8594 } 8595 8596 return this; 8597 }, 8598 8599 toggleClass: function (value, stateVal) { 8600 var type = typeof value; 8601 8602 if (typeof stateVal === "boolean" && type === "string") { 8603 return stateVal ? this.addClass(value) : this.removeClass(value); 8604 } 8605 8606 if (jQuery.isFunction(value)) { 8607 return this.each(function (i) { 8608 jQuery(this).toggleClass(value.call(this, i, getClass(this), stateVal), stateVal); 8609 }); 8610 } 8611 8612 return this.each(function () { 8613 var className, i, self, classNames; 8614 8615 if (type === "string") { 8616 8617 // Toggle individual class names 8618 i = 0; 8619 self = jQuery(this); 8620 classNames = value.match(rnotwhite) || []; 8621 8622 while (className = classNames[i++]) { 8623 8624 // Check each className given, space separated list 8625 if (self.hasClass(className)) { 8626 self.removeClass(className); 8627 } else { 8628 self.addClass(className); 8629 } 8630 } 8631 8632 // Toggle whole class name 8633 } else if (value === undefined || type === "boolean") { 8634 className = getClass(this); 8635 if (className) { 8636 8637 // store className if set 8638 jQuery._data(this, "__className__", className); 8639 } 8640 8641 // If the element has a class name or if we're passed "false", 8642 // then remove the whole classname (if there was one, the above saved it). 8643 // Otherwise bring back whatever was previously saved (if anything), 8644 // falling back to the empty string if nothing was stored. 8645 jQuery.attr(this, "class", className || value === false ? "" : jQuery._data(this, "__className__") || ""); 8646 } 8647 }); 8648 }, 8649 8650 hasClass: function (selector) { 8651 var className, 8652 elem, 8653 i = 0; 8654 8655 className = " " + selector + " "; 8656 while (elem = this[i++]) { 8657 if (elem.nodeType === 1 && (" " + getClass(elem) + " ").replace(rclass, " ").indexOf(className) > -1) { 8658 return true; 8659 } 8660 } 8661 8662 return false; 8663 } 8664 }); 8665 8666 // Return jQuery for attributes-only inclusion 8667 8668 8669 jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function (i, name) { 8670 8671 // Handle event binding 8672 jQuery.fn[name] = function (data, fn) { 8673 return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name); 8674 }; 8675 }); 8676 8677 jQuery.fn.extend({ 8678 hover: function (fnOver, fnOut) { 8679 return this.mouseenter(fnOver).mouseleave(fnOut || fnOver); 8680 } 8681 }); 8682 8683 var location = window.location; 8684 8685 var nonce = jQuery.now(); 8686 8687 var rquery = /\?/; 8688 8689 var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; 8690 8691 jQuery.parseJSON = function (data) { 8692 8693 // Attempt to parse using the native JSON parser first 8694 if (window.JSON && window.JSON.parse) { 8695 8696 // Support: Android 2.3 8697 // Workaround failure to string-cast null input 8698 return window.JSON.parse(data + ""); 8699 } 8700 8701 var requireNonComma, 8702 depth = null, 8703 str = jQuery.trim(data + ""); 8704 8705 // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains 8706 // after removing valid tokens 8707 return str && !jQuery.trim(str.replace(rvalidtokens, function (token, comma, open, close) { 8708 8709 // Force termination if we see a misplaced comma 8710 if (requireNonComma && comma) { 8711 depth = 0; 8712 } 8713 8714 // Perform no more replacements after returning to outermost depth 8715 if (depth === 0) { 8716 return token; 8717 } 8718 8719 // Commas must not follow "[", "{", or "," 8720 requireNonComma = open || comma; 8721 8722 // Determine new depth 8723 // array/object open ("[" or "{"): depth += true - false (increment) 8724 // array/object close ("]" or "}"): depth += false - true (decrement) 8725 // other cases ("," or primitive): depth += true - true (numeric cast) 8726 depth += !close - !open; 8727 8728 // Remove this token 8729 return ""; 8730 })) ? Function("return " + str)() : jQuery.error("Invalid JSON: " + data); 8731 }; 8732 8733 // Cross-browser xml parsing 8734 jQuery.parseXML = function (data) { 8735 var xml, tmp; 8736 if (!data || typeof data !== "string") { 8737 return null; 8738 } 8739 try { 8740 if (window.DOMParser) { 8741 // Standard 8742 tmp = new window.DOMParser(); 8743 xml = tmp.parseFromString(data, "text/xml"); 8744 } else { 8745 // IE 8746 xml = new window.ActiveXObject("Microsoft.XMLDOM"); 8747 xml.async = "false"; 8748 xml.loadXML(data); 8749 } 8750 } catch (e) { 8751 xml = undefined; 8752 } 8753 if (!xml || !xml.documentElement || xml.getElementsByTagName("parsererror").length) { 8754 jQuery.error("Invalid XML: " + data); 8755 } 8756 return xml; 8757 }; 8758 8759 var rhash = /#.*$/, 8760 rts = /([?&])_=[^&]*/, 8761 8762 8763 // IE leaves an \r character at EOL 8764 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, 8765 8766
vendor: 13,733 bytes, lines 8767-9311
8767 // #7653, #8125, #8152: local protocol detection 8768 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 8769 rnoContent = /^(?:GET|HEAD)$/, 8770 rprotocol = /^\/\//, 8771 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, 8772 8773 8774 /* Prefilters 8775 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 8776 * 2) These are called: 8777 * - BEFORE asking for a transport 8778 * - AFTER param serialization (s.data is a string if s.processData is true) 8779 * 3) key is the dataType 8780 * 4) the catchall symbol "*" can be used 8781 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 8782 */ 8783 prefilters = {}, 8784 8785 8786 /* Transports bindings 8787 * 1) key is the dataType 8788 * 2) the catchall symbol "*" can be used 8789 * 3) selection will start with transport dataType and THEN go to "*" if needed 8790 */ 8791 transports = {}, 8792 8793 8794 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 8795 allTypes = "*/".concat("*"), 8796 8797 8798 // Document location 8799 ajaxLocation = location.href, 8800 8801 8802 // Segment location into parts 8803 ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || []; 8804 8805 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 8806 function addToPrefiltersOrTransports(structure) { 8807 8808 // dataTypeExpression is optional and defaults to "*" 8809 return function (dataTypeExpression, func) { 8810 8811 if (typeof dataTypeExpression !== "string") { 8812 func = dataTypeExpression; 8813 dataTypeExpression = "*"; 8814 } 8815 8816 var dataType, 8817 i = 0, 8818 dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || []; 8819 8820 if (jQuery.isFunction(func)) { 8821 8822 // For each dataType in the dataTypeExpression 8823 while (dataType = dataTypes[i++]) { 8824 8825 // Prepend if requested 8826 if (dataType.charAt(0) === "+") { 8827 dataType = dataType.slice(1) || "*"; 8828 (structure[dataType] = structure[dataType] || []).unshift(func); 8829 8830 // Otherwise append 8831 } else { 8832 (structure[dataType] = structure[dataType] || []).push(func); 8833 } 8834 } 8835 } 8836 }; 8837 } 8838 8839 // Base inspection function for prefilters and transports 8840 function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { 8841 8842 var inspected = {}, 8843 seekingTransport = structure === transports; 8844 8845 function inspect(dataType) { 8846 var selected; 8847 inspected[dataType] = true; 8848 jQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) { 8849 var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR); 8850 if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) { 8851 8852 options.dataTypes.unshift(dataTypeOrTransport); 8853 inspect(dataTypeOrTransport); 8854 return false; 8855 } else if (seekingTransport) { 8856 return !(selected = dataTypeOrTransport); 8857 } 8858 }); 8859 return selected; 8860 } 8861 8862 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*"); 8863 } 8864 8865 // A special extend for ajax options 8866 // that takes "flat" options (not to be deep extended) 8867 // Fixes #9887 8868 function ajaxExtend(target, src) { 8869 var deep, 8870 key, 8871 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 8872 8873 for (key in src) { 8874 if (src[key] !== undefined) { 8875 (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key]; 8876 } 8877 } 8878 if (deep) { 8879 jQuery.extend(true, target, deep); 8880 } 8881 8882 return target; 8883 } 8884 8885 /* Handles responses to an ajax request: 8886 * - finds the right dataType (mediates between content-type and expected dataType) 8887 * - returns the corresponding response 8888 */ 8889 function ajaxHandleResponses(s, jqXHR, responses) { 8890 var firstDataType, 8891 ct, 8892 finalDataType, 8893 type, 8894 contents = s.contents, 8895 dataTypes = s.dataTypes; 8896 8897 // Remove auto dataType and get content-type in the process 8898 while (dataTypes[0] === "*") { 8899 dataTypes.shift(); 8900 if (ct === undefined) { 8901 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); 8902 } 8903 } 8904 8905 // Check if we're dealing with a known content-type 8906 if (ct) { 8907 for (type in contents) { 8908 if (contents[type] && contents[type].test(ct)) { 8909 dataTypes.unshift(type); 8910 break; 8911 } 8912 } 8913 } 8914 8915 // Check to see if we have a response for the expected dataType 8916 if (dataTypes[0] in responses) { 8917 finalDataType = dataTypes[0]; 8918 } else { 8919 8920 // Try convertible dataTypes 8921 for (type in responses) { 8922 if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) { 8923 finalDataType = type; 8924 break; 8925 } 8926 if (!firstDataType) { 8927 firstDataType = type; 8928 } 8929 } 8930 8931 // Or just use first one 8932 finalDataType = finalDataType || firstDataType; 8933 } 8934 8935 // If we found a dataType 8936 // We add the dataType to the list if needed 8937 // and return the corresponding response 8938 if (finalDataType) { 8939 if (finalDataType !== dataTypes[0]) { 8940 dataTypes.unshift(finalDataType); 8941 } 8942 return responses[finalDataType]; 8943 } 8944 } 8945 8946 /* Chain conversions given the request and the original response 8947 * Also sets the responseXXX fields on the jqXHR instance 8948 */ 8949 function ajaxConvert(s, response, jqXHR, isSuccess) { 8950 var conv2, 8951 current, 8952 conv, 8953 tmp, 8954 prev, 8955 converters = {}, 8956 8957 8958 // Work with a copy of dataTypes in case we need to modify it for conversion 8959 dataTypes = s.dataTypes.slice(); 8960 8961 // Create converters map with lowercased keys 8962 if (dataTypes[1]) { 8963 for (conv in s.converters) { 8964 converters[conv.toLowerCase()] = s.converters[conv]; 8965 } 8966 } 8967 8968 current = dataTypes.shift(); 8969 8970 // Convert to each sequential dataType 8971 while (current) { 8972 8973 if (s.responseFields[current]) { 8974 jqXHR[s.responseFields[current]] = response; 8975 } 8976 8977 // Apply the dataFilter if provided 8978 if (!prev && isSuccess && s.dataFilter) { 8979 response = s.dataFilter(response, s.dataType); 8980 } 8981 8982 prev = current; 8983 current = dataTypes.shift(); 8984 8985 if (current) { 8986 8987 // There's only work to do if current dataType is non-auto 8988 if (current === "*") { 8989 8990 current = prev; 8991 8992 // Convert response if prev dataType is non-auto and differs from current 8993 } else if (prev !== "*" && prev !== current) { 8994 8995 // Seek a direct converter 8996 conv = converters[prev + " " + current] || converters["* " + current]; 8997 8998 // If none found, seek a pair 8999 if (!conv) { 9000 for (conv2 in converters) { 9001 9002 // If conv2 outputs current 9003 tmp = conv2.split(" "); 9004 if (tmp[1] === current) { 9005 9006 // If prev can be converted to accepted input 9007 conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]]; 9008 if (conv) { 9009 9010 // Condense equivalence converters 9011 if (conv === true) { 9012 conv = converters[conv2]; 9013 9014 // Otherwise, insert the intermediate dataType 9015 } else if (converters[conv2] !== true) { 9016 current = tmp[0]; 9017 dataTypes.unshift(tmp[1]); 9018 } 9019 break; 9020 } 9021 } 9022 } 9023 } 9024 9025 // Apply converter (if not an equivalence) 9026 if (conv !== true) { 9027 9028 // Unless errors are allowed to bubble, catch and return them 9029 if (conv && s["throws"]) { 9030 // jscs:ignore requireDotNotation 9031 response = conv(response); 9032 } else { 9033 try { 9034 response = conv(response); 9035 } catch (e) { 9036 return { 9037 state: "parsererror", 9038 error: conv ? e : "No conversion from " + prev + " to " + current 9039 }; 9040 } 9041 } 9042 } 9043 } 9044 } 9045 } 9046 9047 return { state: "success", data: response }; 9048 } 9049 9050 jQuery.extend({ 9051 9052 // Counter for holding the number of active queries 9053 active: 0, 9054 9055 // Last-Modified header cache for next request 9056 lastModified: {}, 9057 etag: {}, 9058 9059 ajaxSettings: { 9060 url: ajaxLocation, 9061 type: "GET", 9062 isLocal: rlocalProtocol.test(ajaxLocParts[1]), 9063 global: true, 9064 processData: true, 9065 async: true, 9066 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 9067 /* 9068 timeout: 0, 9069 data: null, 9070 dataType: null, 9071 username: null, 9072 password: null, 9073 cache: null, 9074 throws: false, 9075 traditional: false, 9076 headers: {}, 9077 */ 9078 9079 accepts: { 9080 "*": allTypes, 9081 text: "text/plain", 9082 html: "text/html", 9083 xml: "application/xml, text/xml", 9084 json: "application/json, text/javascript" 9085 }, 9086 9087 contents: { 9088 xml: /\bxml\b/, 9089 html: /\bhtml/, 9090 json: /\bjson\b/ 9091 }, 9092 9093 responseFields: { 9094 xml: "responseXML", 9095 text: "responseText", 9096 json: "responseJSON" 9097 }, 9098 9099 // Data converters 9100 // Keys separate source (or catchall "*") and destination types with a single space 9101 converters: { 9102 9103 // Convert anything to text 9104 "* text": String, 9105 9106 // Text to html (true = no transformation) 9107 "text html": true, 9108 9109 // Evaluate text as a json expression 9110 "text json": jQuery.parseJSON, 9111 9112 // Parse text as xml 9113 "text xml": jQuery.parseXML 9114 }, 9115 9116 // For options that shouldn't be deep extended: 9117 // you can add your own custom options here if 9118 // and when you create one that shouldn't be 9119 // deep extended (see ajaxExtend) 9120 flatOptions: { 9121 url: true, 9122 context: true 9123 } 9124 }, 9125 9126 // Creates a full fledged settings object into target 9127 // with both ajaxSettings and settings fields. 9128 // If target is omitted, writes into ajaxSettings. 9129 ajaxSetup: function (target, settings) { 9130 return settings ? 9131 9132 // Building a settings object 9133 ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : 9134 9135 // Extending ajaxSettings 9136 ajaxExtend(jQuery.ajaxSettings, target); 9137 }, 9138 9139 ajaxPrefilter: addToPrefiltersOrTransports(prefilters), 9140 ajaxTransport: addToPrefiltersOrTransports(transports), 9141 9142 // Main method 9143 ajax: function (url, options) { 9144 9145 // If url is an object, simulate pre-1.5 signature 9146 if (typeof url === "object") { 9147 options = url; 9148 url = undefined; 9149 } 9150 9151 // Force options to be an object 9152 options = options || {}; 9153 9154 var 9155 9156 // Cross-domain detection vars 9157 parts, 9158 9159 9160 // Loop variable 9161 i, 9162 9163 9164 // URL without anti-cache param 9165 cacheURL, 9166 9167 9168 // Response headers as string 9169 responseHeadersString, 9170 9171 9172 // timeout handle 9173 timeoutTimer, 9174 9175 9176 // To know if global events are to be dispatched 9177 fireGlobals, 9178 transport, 9179 9180 9181 // Response headers 9182 responseHeaders, 9183 9184 9185 // Create the final options object 9186 s = jQuery.ajaxSetup({}, options), 9187 9188 9189 // Callbacks context 9190 callbackContext = s.context || s, 9191 9192 9193 // Context for global events is callbackContext if it is a DOM node or jQuery collection 9194 globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, 9195 9196 9197 // Deferreds 9198 deferred = jQuery.Deferred(), 9199 completeDeferred = jQuery.Callbacks("once memory"), 9200 9201 9202 // Status-dependent callbacks 9203 statusCode = s.statusCode || {}, 9204 9205 9206 // Headers (they are sent all at once) 9207 requestHeaders = {}, 9208 requestHeadersNames = {}, 9209 9210 9211 // The jqXHR state 9212 state = 0, 9213 9214 9215 // Default abort message 9216 strAbort = "canceled", 9217 9218 9219 // Fake xhr 9220 jqXHR = { 9221 readyState: 0, 9222 9223 // Builds headers hashtable if needed 9224 getResponseHeader: function (key) { 9225 var match; 9226 if (state === 2) { 9227 if (!responseHeaders) { 9228 responseHeaders = {}; 9229 while (match = rheaders.exec(responseHeadersString)) { 9230 responseHeaders[match[1].toLowerCase()] = match[2]; 9231 } 9232 } 9233 match = responseHeaders[key.toLowerCase()]; 9234 } 9235 return match == null ? null : match; 9236 }, 9237 9238 // Raw string 9239 getAllResponseHeaders: function () { 9240 return state === 2 ? responseHeadersString : null; 9241 }, 9242 9243 // Caches the header 9244 setRequestHeader: function (name, value) { 9245 var lname = name.toLowerCase(); 9246 if (!state) { 9247 name = requestHeadersNames[lname] = requestHeadersNames[lname] || name; 9248 requestHeaders[name] = value; 9249 } 9250 return this; 9251 }, 9252 9253 // Overrides response content-type header 9254 overrideMimeType: function (type) { 9255 if (!state) { 9256 s.mimeType = type; 9257 } 9258 return this; 9259 }, 9260 9261 // Status-dependent callbacks 9262 statusCode: function (map) { 9263 var code; 9264 if (map) { 9265 if (state < 2) { 9266 for (code in map) { 9267 9268 // Lazy-add the new callback in a way that preserves old ones 9269 statusCode[code] = [statusCode[code], map[code]]; 9270 } 9271 } else { 9272 9273 // Execute the appropriate callbacks 9274 jqXHR.always(map[jqXHR.status]); 9275 } 9276 } 9277 return this; 9278 }, 9279 9280 // Cancel the request 9281 abort: function (statusText) { 9282 var finalText = statusText || strAbort; 9283 if (transport) { 9284 transport.abort(finalText); 9285 } 9286 done(0, finalText); 9287 return this; 9288 } 9289 }; 9290 9291 // Attach deferreds 9292 deferred.promise(jqXHR).complete = completeDeferred.add; 9293 jqXHR.success = jqXHR.done; 9294 jqXHR.error = jqXHR.fail; 9295 9296 // Remove hash character (#7531: and string promotion) 9297 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) 9298 // Handle falsy url in the settings object (#10093: consistency with old signature) 9299 // We also use the url parameter if available 9300 s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "").replace(rprotocol, ajaxLocParts[1] + "//"); 9301 9302 // Alias method option to type as per ticket #12004 9303 s.type = options.method || options.type || s.method || s.type; 9304 9305 // Extract dataTypes list 9306 s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(rnotwhite) || [""]; 9307 9308 // A cross-domain request is in order when we have a protocol:host:port mismatch 9309 if (s.crossDomain == null) { 9310 parts = rurl.exec(s.url.toLowerCase()); 9311 s.crossDomain = !!(parts && (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] || (parts[3] || (parts[1] === "http:" ? "80" : "443")) !== (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443")))
vendor: 9,321 bytes, lines 9311-9682
9311); 9312 } 9313 9314 // Convert data if not already a string 9315 if (s.data && s.processData && typeof s.data !== "string") { 9316 s.data = jQuery.param(s.data, s.traditional); 9317 } 9318 9319 // Apply prefilters 9320 inspectPrefiltersOrTransports(prefilters, s, options, jqXHR); 9321 9322 // If request was aborted inside a prefilter, stop there 9323 if (state === 2) { 9324 return jqXHR; 9325 } 9326 9327 // We can fire global events as of now if asked to 9328 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 9329 fireGlobals = jQuery.event && s.global; 9330 9331 // Watch for a new set of requests 9332 if (fireGlobals && jQuery.active++ === 0) { 9333 jQuery.event.trigger("ajaxStart"); 9334 } 9335 9336 // Uppercase the type 9337 s.type = s.type.toUpperCase(); 9338 9339 // Determine if request has content 9340 s.hasContent = !rnoContent.test(s.type); 9341 9342 // Save the URL in case we're toying with the If-Modified-Since 9343 // and/or If-None-Match header later on 9344 cacheURL = s.url; 9345 9346 // More options handling for requests with no content 9347 if (!s.hasContent) { 9348 9349 // If data is available, append data to url 9350 if (s.data) { 9351 cacheURL = s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data; 9352 9353 // #9682: remove data so that it's not used in an eventual retry 9354 delete s.data; 9355 } 9356 9357 // Add anti-cache in url if needed 9358 if (s.cache === false) { 9359 s.url = rts.test(cacheURL) ? 9360 9361 // If there is already a '_' parameter, set its value 9362 cacheURL.replace(rts, "$1_=" + nonce++) : 9363 9364 // Otherwise add one to the end 9365 cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce++; 9366 } 9367 } 9368 9369 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9370 if (s.ifModified) { 9371 if (jQuery.lastModified[cacheURL]) { 9372 jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]); 9373 } 9374 if (jQuery.etag[cacheURL]) { 9375 jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]); 9376 } 9377 } 9378 9379 // Set the correct header, if data is being sent 9380 if (s.data && s.hasContent && s.contentType !== false || options.contentType) { 9381 jqXHR.setRequestHeader("Content-Type", s.contentType); 9382 } 9383 9384 // Set the Accepts header for the server, depending on the dataType 9385 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["*"]); 9386 9387 // Check for headers option 9388 for (i in s.headers) { 9389 jqXHR.setRequestHeader(i, s.headers[i]); 9390 } 9391 9392 // Allow custom headers/mimetypes and early abort 9393 if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) { 9394 9395 // Abort if not done already and return 9396 return jqXHR.abort(); 9397 } 9398 9399 // aborting is no longer a cancellation 9400 strAbort = "abort"; 9401 9402 // Install callbacks on deferreds 9403 for (i in { success: 1, error: 1, complete: 1 }) { 9404 jqXHR[i](s[i]); 9405 } 9406 9407 // Get transport 9408 transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR); 9409 9410 // If no transport, we auto-abort 9411 if (!transport) { 9412 done(-1, "No Transport"); 9413 } else { 9414 jqXHR.readyState = 1; 9415 9416 // Send global event 9417 if (fireGlobals) { 9418 globalEventContext.trigger("ajaxSend", [jqXHR, s]); 9419 } 9420 9421 // If request was aborted inside ajaxSend, stop there 9422 if (state === 2) { 9423 return jqXHR; 9424 } 9425 9426 // Timeout 9427 if (s.async && s.timeout > 0) { 9428 timeoutTimer = window.setTimeout(function () { 9429 jqXHR.abort("timeout"); 9430 }, s.timeout); 9431 } 9432 9433 try { 9434 state = 1; 9435 transport.send(requestHeaders, done); 9436 } catch (e) { 9437 9438 // Propagate exception as error if not done 9439 if (state < 2) { 9440 done(-1, e); 9441 9442 // Simply rethrow otherwise 9443 } else { 9444 throw e; 9445 } 9446 } 9447 } 9448 9449 // Callback for when everything is done 9450 function done(status, nativeStatusText, responses, headers) { 9451 var isSuccess, 9452 success, 9453 error, 9454 response, 9455 modified, 9456 statusText = nativeStatusText; 9457 9458 // Called once 9459 if (state === 2) { 9460 return; 9461 } 9462 9463 // State is "done" now 9464 state = 2; 9465 9466 // Clear timeout if it exists 9467 if (timeoutTimer) { 9468 window.clearTimeout(timeoutTimer); 9469 } 9470 9471 // Dereference transport for early garbage collection 9472 // (no matter how long the jqXHR object will be used) 9473 transport = undefined; 9474 9475 // Cache response headers 9476 responseHeadersString = headers || ""; 9477 9478 // Set readyState 9479 jqXHR.readyState = status > 0 ? 4 : 0; 9480 9481 // Determine if successful 9482 isSuccess = status >= 200 && status < 300 || status === 304; 9483 9484 // Get response data 9485 if (responses) { 9486 response = ajaxHandleResponses(s, jqXHR, responses); 9487 } 9488 9489 // Convert no matter what (that way responseXXX fields are always set) 9490 response = ajaxConvert(s, response, jqXHR, isSuccess); 9491 9492 // If successful, handle type chaining 9493 if (isSuccess) { 9494 9495 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9496 if (s.ifModified) { 9497 modified = jqXHR.getResponseHeader("Last-Modified"); 9498 if (modified) { 9499 jQuery.lastModified[cacheURL] = modified; 9500 } 9501 modified = jqXHR.getResponseHeader("etag"); 9502 if (modified) { 9503 jQuery.etag[cacheURL] = modified; 9504 } 9505 } 9506 9507 // if no content 9508 if (status === 204 || s.type === "HEAD") { 9509 statusText = "nocontent"; 9510 9511 // if not modified 9512 } else if (status === 304) { 9513 statusText = "notmodified"; 9514 9515 // If we have data, let's convert it 9516 } else { 9517 statusText = response.state; 9518 success = response.data; 9519 error = response.error; 9520 isSuccess = !error; 9521 } 9522 } else { 9523 9524 // We extract error from statusText 9525 // then normalize statusText and status for non-aborts 9526 error = statusText; 9527 if (status || !statusText) { 9528 statusText = "error"; 9529 if (status < 0) { 9530 status = 0; 9531 } 9532 } 9533 } 9534 9535 // Set data for the fake xhr object 9536 jqXHR.status = status; 9537 jqXHR.statusText = (nativeStatusText || statusText) + ""; 9538 9539 // Success/Error 9540 if (isSuccess) { 9541 deferred.resolveWith(callbackContext, [success, statusText, jqXHR]); 9542 } else { 9543 deferred.rejectWith(callbackContext, [jqXHR, statusText, error]); 9544 } 9545 9546 // Status-dependent callbacks 9547 jqXHR.statusCode(statusCode); 9548 statusCode = undefined; 9549 9550 if (fireGlobals) { 9551 globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]); 9552 } 9553 9554 // Complete 9555 completeDeferred.fireWith(callbackContext, [jqXHR, statusText]); 9556 9557 if (fireGlobals) { 9558 globalEventContext.trigger("ajaxComplete", [jqXHR, s]); 9559 9560 // Handle the global AJAX counter 9561 if (! --jQuery.active) { 9562 jQuery.event.trigger("ajaxStop"); 9563 } 9564 } 9565 } 9566 9567 return jqXHR; 9568 }, 9569 9570 getJSON: function (url, data, callback) { 9571 return jQuery.get(url, data, callback, "json"); 9572 }, 9573 9574 getScript: function (url, callback) { 9575 return jQuery.get(url, undefined, callback, "script"); 9576 } 9577 }); 9578 9579 jQuery.each(["get", "post"], function (i, method) { 9580 jQuery[method] = function (url, data, callback, type) { 9581 9582 // shift arguments if data argument was omitted 9583 if (jQuery.isFunction(data)) { 9584 type = type || callback; 9585 callback = data; 9586 data = undefined; 9587 } 9588 9589 // The url can be an options object (which then must have .url) 9590 return jQuery.ajax(jQuery.extend({ 9591 url: url, 9592 type: method, 9593 dataType: type, 9594 data: data, 9595 success: callback 9596 }, jQuery.isPlainObject(url) && url)); 9597 }; 9598 }); 9599 9600 jQuery._evalUrl = function (url) { 9601 return jQuery.ajax({ 9602 url: url, 9603 9604 // Make this explicit, since user can override this through ajaxSetup (#11264) 9605 type: "GET", 9606 dataType: "script", 9607 cache: true, 9608 async: false, 9609 global: false, 9610 "throws": true 9611 }); 9612 }; 9613 9614 jQuery.fn.extend({ 9615 wrapAll: function (html) { 9616 if (jQuery.isFunction(html)) { 9617 return this.each(function (i) { 9618 jQuery(this).wrapAll(html.call(this, i)); 9619 }); 9620 } 9621 9622 if (this[0]) { 9623 9624 // The elements to wrap the target around 9625 var wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true); 9626 9627 if (this[0].parentNode) { 9628 wrap.insertBefore(this[0]); 9629 } 9630 9631 wrap.map(function () { 9632 var elem = this; 9633 9634 while (elem.firstChild && elem.firstChild.nodeType === 1) { 9635 elem = elem.firstChild; 9636 } 9637 9638 return elem; 9639 }).append(this); 9640 } 9641 9642 return this; 9643 }, 9644 9645 wrapInner: function (html) { 9646 if (jQuery.isFunction(html)) { 9647 return this.each(function (i) { 9648 jQuery(this).wrapInner(html.call(this, i)); 9649 }); 9650 } 9651 9652 return this.each(function () { 9653 var self = jQuery(this), 9654 contents = self.contents(); 9655 9656 if (contents.length) { 9657 contents.wrapAll(html); 9658 } else { 9659 self.append(html); 9660 } 9661 }); 9662 }, 9663 9664 wrap: function (html) { 9665 var isFunction = jQuery.isFunction(html); 9666 9667 return this.each(function (i) { 9668 jQuery(this).wrapAll(isFunction ? html.call(this, i) : html); 9669 }); 9670 }, 9671 9672 unwrap: function () { 9673 return this.parent().each(function () { 9674 if (!jQuery.nodeName(this, "body")) { 9675 jQuery(this).replaceWith(this.childNodes); 9676 } 9677 }).end(); 9678 } 9679 }); 9680 9681 function getDisplay(elem) { 9682 return elem.style && elem.style.display || jQuery.css(elem, "dis
9682play"); 9683 } 9684 9685 function filterHidden(elem) { 9686 9687 // Disconnected elements are considered hidden 9688 if (!jQuery.contains(elem.ownerDocument || document, elem)) { 9689 return true; 9690 } 9691 while (elem && elem.nodeType === 1) { 9692 if (getDisplay(elem) === "none" || elem.type === "hidden") { 9693 return true; 9694 } 9695 elem = elem.parentNode; 9696 } 9697 return false; 9698 } 9699 9700 jQuery.expr.filters.hidden = function (elem) { 9701 9702 // Support: Opera <= 12.12 9703 // Opera reports offsetWidths and offsetHeights less than zero on some elements 9704 return support.reliableHiddenOffsets() ? elem.offsetWidth <= 0 && elem.offsetHeight <= 0 && !elem.getClientRects().length : filterHidden(elem); 9705 }; 9706 9707 jQuery.expr.filters.visible = function (elem) { 9708 return !jQuery.expr.filters.hidden(elem); 9709 }; 9710 9711 var r20 = /%20/g, 9712 rbracket = /\[\]$/, 9713 rCRLF = /\r?\n/g, 9714 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 9715 rsubmittable = /^(?:input|select|textarea|keygen)/i; 9716 9717 function buildParams(prefix, obj, traditional, add) { 9718 var name; 9719 9720 if (jQuery.isArray(obj)) { 9721 9722 // Serialize array item. 9723 jQuery.each(obj, function (i, v) { 9724 if (traditional || rbracket.test(prefix)) { 9725 9726 // Treat each array item as a scalar. 9727 add(prefix, v); 9728 } else { 9729 9730 // Item is non-scalar (array or object), encode its numeric index. 9731 buildParams(prefix + "[" + (typeof v === "object" && v != null ? i : "") + "]", v, traditional, add); 9732 } 9733 }); 9734 } else if (!traditional && jQuery.type(obj) === "object") { 9735 9736 // Serialize object item. 9737 for (name in obj) { 9738 buildParams(prefix + "[" + name + "]", obj[name], traditional, add); 9739 } 9740 } else { 9741 9742 // Serialize scalar item. 9743 add(prefix, obj); 9744 } 9745 } 9746 9747 // Serialize an array of form elements or a set of 9748 // key/values into a query string 9749 jQuery.param = function (a, traditional) { 9750 var prefix, 9751 s = [], 9752 add = function (key, value) { 9753 9754 // If value is a function, invoke it and return its value 9755 value = jQuery.isFunction(value) ? value() : value == null ? "" : value; 9756 s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value); 9757 }; 9758 9759 // Set traditional to true for jQuery <= 1.3.2 behavior. 9760 if (traditional === undefined) { 9761 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 9762 } 9763 9764 // If an array was passed in, assume that it is an array of form elements. 9765 if (jQuery.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) { 9766 9767 // Serialize the form elements 9768 jQuery.each(a, function () { 9769 add(this.name, this.value); 9770 }); 9771 } else { 9772 9773 // If traditional, encode the "old" way (the way 1.3.2 or older 9774 // did it), otherwise encode params recursively. 9775 for (prefix in a) { 9776 buildParams(prefix, a[prefix], traditional, add); 9777 } 9778 } 9779 9780 // Return the resulting serialization 9781 return s.join("&").replace(r20, "+"); 9782 }; 9783 9784 jQuery.fn.extend({ 9785 serialize: function () { 9786 return jQuery.param(this.serializeArray()); 9787 }, 9788 serializeArray: function () { 9789 return this.map(function () { 9790 9791 // Can add propHook for "elements" to filter or add form elements 9792 var elements = jQuery.prop(this, "elements"); 9793 return elements ? jQuery.makeArray(elements) : this; 9794 }).filter(function () { 9795 var type = this.type; 9796 9797 // Use .is(":disabled") so that fieldset[disabled] works 9798 return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type)); 9799 }).map(function (i, elem) { 9800 var val = jQuery(this).val(); 9801 9802 return val == null ? null : jQuery.isArray(val) ? jQuery.map(val, function (val) { 9803 return { name: elem.name, value: val.replace(rCRLF, "\r\n") }; 9804 }) : { name: elem.name, value: val.replace(rCRLF, "\r\n") }; 9805 }).get(); 9806 } 9807 }); 9808 9809 // Create the request object 9810 // (This is still attached to ajaxSettings for backward compatibility) 9811 jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? 9812 9813 // Support: IE6-IE8 9814 function () { 9815 9816 // XHR cannot access local files, always use ActiveX for that case 9817 if (this.isLocal) { 9818 return createActiveXHR(); 9819 } 9820
9821 // Support: IE 9-11 9822 // IE seems to error on cross-domain PATCH requests when ActiveX XHR 9823 // is used. In IE 9+ always use the native XHR. 9824 // Note: this condition won't catch Edge as it doesn't define 9825 // document.documentMode but it also doesn't support ActiveX so it won't 9826 // reach this code. 9827 if (document.documentMode > 8) { 9828 return createStandardXHR(); 9829 } 9830 9831 // Support: IE<9 9832 // oldIE XHR does not support non-RFC2616 methods (#13240) 9833 // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx 9834 // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 9835 // Although this check for six methods instead of eight 9836 // since IE also does not support "trace" and "connect" 9837 return (/^(get|post|head|put|delete|options)$/i.test(this.type) && createStandardXHR() || createActiveXHR() 9838 ); 9839 } : 9840 9841 // For all other browsers, use the standard XMLHttpRequest object 9842 createStandardXHR; 9843 9844 var xhrId = 0, 9845 xhrCallbacks = {}, 9846 xhrSupported = jQuery.ajaxSettings.xhr(); 9847 9848 // Support: IE<10 9849 // Open requests must be manually aborted on unload (#5280) 9850 // See https://support.microsoft.com/kb/2856746 for more info 9851 if (window.attachEvent) { 9852 window.attachEvent("onunload", function () { 9853 for (var key in xhrCallbacks) { 9854 xhrCallbacks[key](undefined, true); 9855 } 9856 }); 9857 } 9858 9859 // Determine support properties 9860 support.cors = !!xhrSupported && "withCredentials" in xhrSupported; 9861 xhrSupported = support.ajax = !!xhrSupported; 9862 9863 // Create transport if the browser can provide an xhr 9864 if (xhrSupported) { 9865 9866 jQuery.ajaxTransport(function (options) { 9867 9868 // Cross domain only allowed if supported through XMLHttpRequest 9869 if (!options.crossDomain || support.cors) { 9870 9871 var callback; 9872 9873 return { 9874 send: function (headers, complete) { 9875 var i, 9876 xhr = options.xhr(), 9877 id = ++xhrId; 9878 9879 // Open the socket 9880 xhr.open(options.type, options.url, options.async, options.username, options.password); 9881 9882 // Apply custom fields if provided 9883 if (options.xhrFields) { 9884 for (i in options.xhrFields) { 9885 xhr[i] = options.xhrFields[i]; 9886 } 9887 } 9888 9889 // Override mime type if needed 9890 if (options.mimeType && xhr.overrideMimeType) { 9891 xhr.overrideMimeType(options.mimeType); 9892 } 9893 9894 // X-Requested-With header 9895 // For cross-domain requests, seeing as conditions for a preflight are 9896 // akin to a jigsaw puzzle, we simply never set it to be sure. 9897 // (it can always be set on a per-request basis or even using ajaxSetup)
vendor: 8,552 bytes, lines 9898-10207
9898 // For same-domain requests, won't change header if already provided. 9899 if (!options.crossDomain && !headers["X-Requested-With"]) { 9900 headers["X-Requested-With"] = "XMLHttpRequest"; 9901 } 9902 9903 // Set headers 9904 for (i in headers) { 9905 9906 // Support: IE<9 9907 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting 9908 // request header to a null-value. 9909 // 9910 // To keep consistent with other XHR implementations, cast the value 9911 // to string and ignore `undefined`. 9912 if (headers[i] !== undefined) { 9913 xhr.setRequestHeader(i, headers[i] + ""); 9914 } 9915 } 9916 9917 // Do send the request 9918 // This may raise an exception which is actually 9919 // handled in jQuery.ajax (so no try/catch here) 9920 xhr.send(options.hasContent && options.data || null); 9921 9922 // Listener 9923 callback = function (_, isAbort) { 9924 var status, statusText, responses; 9925 9926 // Was never called and is aborted or complete 9927 if (callback && (isAbort || xhr.readyState === 4)) { 9928 9929 // Clean up 9930 delete xhrCallbacks[id]; 9931 callback = undefined; 9932 xhr.onreadystatechange = jQuery.noop; 9933 9934 // Abort manually if needed 9935 if (isAbort) { 9936 if (xhr.readyState !== 4) { 9937 xhr.abort(); 9938 } 9939 } else { 9940 responses = {}; 9941 status = xhr.status; 9942 9943 // Support: IE<10 9944 // Accessing binary-data responseText throws an exception 9945 // (#11426) 9946 if (typeof xhr.responseText === "string") { 9947 responses.text = xhr.responseText; 9948 } 9949 9950 // Firefox throws an exception when accessing 9951 // statusText for faulty cross-domain requests 9952 try { 9953 statusText = xhr.statusText; 9954 } catch (e) { 9955 9956 // We normalize with Webkit giving an empty statusText 9957 statusText = ""; 9958 } 9959 9960 // Filter status for non standard behaviors 9961 9962 // If the request is local and we have data: assume a success 9963 // (success with no data won't get notified, that's the best we 9964 // can do given current implementations) 9965 if (!status && options.isLocal && !options.crossDomain) { 9966 status = responses.text ? 200 : 404; 9967 9968 // IE - #1450: sometimes returns 1223 when it should be 204 9969 } else if (status === 1223) { 9970 status = 204; 9971 } 9972 } 9973 } 9974 9975 // Call complete if needed 9976 if (responses) { 9977 complete(status, statusText, responses, xhr.getAllResponseHeaders()); 9978 } 9979 }; 9980 9981 // Do send the request 9982 // `xhr.send` may raise an exception, but it will be 9983 // handled in jQuery.ajax (so no try/catch here) 9984 if (!options.async) { 9985 9986 // If we're in sync mode we fire the callback 9987 callback(); 9988 } else if (xhr.readyState === 4) { 9989 9990 // (IE6 & IE7) if it's in cache and has been 9991 // retrieved directly we need to fire the callback 9992 window.setTimeout(callback); 9993 } else { 9994 9995 // Register the callback, but delay it in case `xhr.send` throws 9996 // Add to the list of active xhr callbacks 9997 xhr.onreadystatechange = xhrCallbacks[id] = callback; 9998 } 9999 }, 10000 10001 abort: function () { 10002 if (callback) { 10003 callback(undefined, true); 10004 } 10005 } 10006 }; 10007 } 10008 }); 10009 } 10010 10011 // Functions to create xhrs 10012 function createStandardXHR() { 10013 try { 10014 return new window.XMLHttpRequest(); 10015 } catch (e) {} 10016 } 10017 10018 function createActiveXHR() { 10019 try { 10020 return new window.ActiveXObject("Microsoft.XMLHTTP"); 10021 } catch (e) {} 10022 } 10023 10024 // Install script dataType 10025 jQuery.ajaxSetup({ 10026 accepts: { 10027 script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript" 10028 }, 10029 contents: { 10030 script: /\b(?:java|ecma)script\b/ 10031 }, 10032 converters: { 10033 "text script": function (text) { 10034 jQuery.globalEval(text); 10035 return text; 10036 } 10037 } 10038 }); 10039 10040 // Handle cache's special case and global 10041 jQuery.ajaxPrefilter("script", function (s) { 10042 if (s.cache === undefined) { 10043 s.cache = false; 10044 } 10045 if (s.crossDomain) { 10046 s.type = "GET"; 10047 s.global = false; 10048 } 10049 }); 10050 10051 // Bind script tag hack transport 10052 jQuery.ajaxTransport("script", function (s) { 10053 10054 // This transport only deals with cross domain requests 10055 if (s.crossDomain) { 10056 10057 var script, 10058 head = document.head || jQuery("head")[0] || document.documentElement; 10059 10060 return { 10061 10062 send: function (_, callback) { 10063 10064 script = document.createElement("script"); 10065 10066 script.async = true; 10067 10068 if (s.scriptCharset) { 10069 script.charset = s.scriptCharset; 10070 } 10071 10072 script.src = s.url; 10073 10074 // Attach handlers for all browsers 10075 script.onload = script.onreadystatechange = function (_, isAbort) { 10076 10077 if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) { 10078 10079 // Handle memory leak in IE 10080 script.onload = script.onreadystatechange = null; 10081 10082 // Remove the script 10083 if (script.parentNode) { 10084 script.parentNode.removeChild(script); 10085 } 10086 10087 // Dereference the script 10088 script = null; 10089 10090 // Callback if not abort 10091 if (!isAbort) { 10092 callback(200, "success"); 10093 } 10094 } 10095 }; 10096 10097 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending 10098 // Use native DOM manipulation to avoid our domManip AJAX trickery 10099 head.insertBefore(script, head.firstChild); 10100 }, 10101 10102 abort: function () { 10103 if (script) { 10104 script.onload(undefined, true); 10105 } 10106 } 10107 }; 10108 } 10109 }); 10110 10111 var oldCallbacks = [], 10112 rjsonp = /(=)\?(?=&|$)|\?\?/; 10113 10114 // Default jsonp settings 10115 jQuery.ajaxSetup({ 10116 jsonp: "callback", 10117 jsonpCallback: function () { 10118 var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce++; 10119 this[callback] = true; 10120 return callback; 10121 } 10122 }); 10123 10124 // Detect, normalize options and install callbacks for jsonp requests 10125 jQuery.ajaxPrefilter("json jsonp", function (s, originalSettings, jqXHR) { 10126 10127 var callbackName, 10128 overwritten, 10129 responseContainer, 10130 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"); 10131 10132 // Handle iff the expected data type is "jsonp" or we have a parameter to set 10133 if (jsonProp || s.dataTypes[0] === "jsonp") { 10134 10135 // Get callback name, remembering preexisting value associated with it 10136 callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback; 10137 10138 // Insert callback into url or form data 10139 if (jsonProp) { 10140 s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName); 10141 } else if (s.jsonp !== false) { 10142 s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName; 10143 } 10144 10145 // Use data converter to retrieve json after script execution 10146 s.converters["script json"] = function () { 10147 if (!responseContainer) { 10148 jQuery.error(callbackName + " was not called"); 10149 } 10150 return responseContainer[0]; 10151 }; 10152 10153 // force json dataType 10154 s.dataTypes[0] = "json"; 10155 10156 // Install callback 10157 overwritten = window[callbackName]; 10158 window[callbackName] = function () { 10159 responseContainer = arguments; 10160 }; 10161 10162 // Clean-up function (fires after converters) 10163 jqXHR.always(function () { 10164 10165 // If previous value didn't exist - remove it 10166 if (overwritten === undefined) { 10167 jQuery(window).removeProp(callbackName); 10168 10169 // Otherwise restore preexisting value 10170 } else { 10171 window[callbackName] = overwritten; 10172 } 10173 10174 // Save back as free 10175 if (s[callbackName]) { 10176 10177 // make sure that re-using the options doesn't screw things around 10178 s.jsonpCallback = originalSettings.jsonpCallback; 10179 10180 // save the callback name for future use 10181 oldCallbacks.push(callbackName); 10182 } 10183 10184 // Call if it was a function and we have a response 10185 if (responseContainer && jQuery.isFunction(overwritten)) { 10186 overwritten(responseContainer[0]); 10187 } 10188 10189 responseContainer = overwritten = undefined; 10190 }); 10191 10192 // Delegate to script 10193 return "script"; 10194 } 10195 }); 10196 10197 // data: string of html 10198 // context (optional): If specified, the fragment will be created in this context, 10199 // defaults to document 10200 // keepScripts (optional): If true, will include scripts passed in the html string 10201 jQuery.parseHTML = function (data, context, keepScripts) { 10202 if (!data || typeof data !== "string") { 10203 return null; 10204 } 10205 if (typeof context === "boolean") { 10206 keepScripts = context; 10207 context = false;
10208 } 10209 context = context || document; 10210 10211 var parsed = rsingleTag.exec(data), 10212 scripts = !keepScripts && []; 10213 10214 // Single tag 10215 if (parsed) { 10216 return [context.createElement(parsed[1])]; 10217 } 10218 10219 parsed = buildFragment([data], context, scripts); 10220 10221 if (scripts && scripts.length) { 10222 jQuery(scripts).remove(); 10223 } 10224 10225 return jQuery.merge([], parsed.childNodes); 10226 }; 10227 10228 // Keep a copy of the old load method 10229 var _load = jQuery.fn.load; 10230 10231 /** 10232 * Load a url into a page 10233 */ 10234 jQuery.fn.load = function (url, params, callback) { 10235 if (typeof url !== "string" && _load) { 10236 return _load.apply(this, arguments); 10237 } 10238 10239 var selector, 10240 type, 10241 response, 10242 self = this, 10243 off = url.indexOf(" "); 10244 10245 if (off > -1) { 10246 selector = jQuery.trim(url.slice(off, url.length)); 10247 url = url.slice(0, off); 10248 } 10249 10250 // If it's a function 10251 if (jQuery.isFunction(params)) { 10252 10253 // We assume that it's the callback 10254 callback = params; 10255 params = undefined; 10256 10257 // Otherwise, build a param string 10258 } else if (params && typeof params === "object") { 10259 type = "POST"; 10260 } 10261 10262 // If we have elements to modify, make the request 10263 if (self.length > 0) { 10264 jQuery.ajax({ 10265 url: url, 10266 10267 // If "type" variable is undefined, then "GET" method will be used. 10268 // Make value of this field explicit since 10269 // user can override it through ajaxSetup method 10270 type: type || "GET", 10271 dataType: "html", 10272 data: params 10273 }).done(function (responseText) { 10274 10275 // Save response for use in complete callback 10276 response = arguments; 10277 10278 self.html(selector ? 10279 10280 // If a selector was specified, locate the right elements in a dummy div 10281 // Exclude scripts to avoid IE 'Permission Denied' errors 10282 jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : 10283 10284 // Otherwise use the full result 10285 responseText); 10286 10287 // If the request succeeds, this function gets "data", "status", "jqXHR" 10288 // but they are ignored because response was set above. 10289 // If it fails, this function gets "jqXHR", "status", "error" 10290 }).always(callback && function (jqXHR, status) { 10291 self.each(function () { 10292 callback.apply(this, response || [jqXHR.responseText, status, jqXHR]); 10293 }); 10294 }); 10295 } 10296 10297 return this; 10298 }; 10299 10300 // Attach a bunch of functions for handling common AJAX events 10301 jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (i, type) { 10302 jQuery.fn[type] = function (fn) { 10303 return this.on(type, fn); 10304 }; 10305 }); 10306 10307 jQuery.expr.filters.animated = function (elem) { 10308 return jQuery.grep(jQuery.timers, function (fn) { 10309 return elem === fn.elem; 10310 }).length; 10311 }; 10312 10313 /** 10314 * Gets a window from an element 10315 */ 10316 function getWindow(elem) { 10317 return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; 10318 } 10319 10320 jQuery.offset = { 10321 setOffset: function (elem, options, i) { 10322 var curPosition, 10323 curLeft, 10324 curCSSTop, 10325 curTop, 10326 curOffset, 10327 curCSSLeft, 10328 calculatePosition, 10329 position = jQuery.css(elem, "position"), 10330 curElem = jQuery(elem), 10331 props = {}; 10332 10333 // set position first, in-case top/left are set even on static elem 10334 if (position === "static") { 10335 elem.style.position = "relative"; 10336 } 10337 10338 curOffset = curElem.offset(); 10339 curCSSTop = jQuery.css(elem, "top"); 10340 curCSSLeft = jQuery.css(elem, "left"); 10341 calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1; 10342 10343 // need to be able to calculate position if either top or left 10344 // is auto and position is either absolute or fixed 10345 if (calculatePosition) { 10346 curPosition = curElem.position(); 10347 curTop = curPosition.top; 10348 curLeft = curPosition.left; 10349 } else { 10350 curTop = parseFloat(curCSSTop) || 0; 10351 curLeft = parseFloat(curCSSLeft) || 0; 10352 } 10353 10354 if (jQuery.isFunction(options)) { 10355 10356 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 10357 options = options.call(elem, i, jQuery.extend({}, curOffset)); 10358 } 10359 10360 if (options.top != null) { 10361 props.top = options.top - curOffset.top + curTop; 10362 } 10363 if (options.left != null) { 10364 props.left = options.left - curOffset.left + curLeft; 10365 } 10366 10367 if ("using" in options) { 10368 options.using.call(elem, props); 10369 } else { 10370 curElem.css(props); 10371 } 10372 } 10373 }; 10374 10375 jQuery.fn.extend({ 10376 offset: function (options) { 10377 if (arguments.length) {
vendor: 7,971 bytes, lines 10378-10625
10378 return options === undefined ? this : this.each(function (i) { 10379 jQuery.offset.setOffset(this, options, i); 10380 }); 10381 } 10382 10383 var docElem, 10384 win, 10385 box = { top: 0, left: 0 }, 10386 elem = this[0], 10387 doc = elem && elem.ownerDocument; 10388 10389 if (!doc) { 10390 return; 10391 } 10392 10393 docElem = doc.documentElement; 10394 10395 // Make sure it's not a disconnected DOM node 10396 if (!jQuery.contains(docElem, elem)) { 10397 return box; 10398 } 10399 10400 // If we don't have gBCR, just use 0,0 rather than error 10401 // BlackBerry 5, iOS 3 (original iPhone) 10402 if (typeof elem.getBoundingClientRect !== "undefined") { 10403 box = elem.getBoundingClientRect(); 10404 } 10405 win = getWindow(doc); 10406 return { 10407 top: box.top + (win.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0), 10408 left: box.left + (win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0) 10409 }; 10410 }, 10411 10412 position: function () { 10413 if (!this[0]) { 10414 return; 10415 } 10416 10417 var offsetParent, 10418 offset, 10419 parentOffset = { top: 0, left: 0 }, 10420 elem = this[0]; 10421 10422 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, 10423 // because it is its only offset parent 10424 if (jQuery.css(elem, "position") === "fixed") { 10425 10426 // we assume that getBoundingClientRect is available when computed position is fixed 10427 offset = elem.getBoundingClientRect(); 10428 } else { 10429 10430 // Get *real* offsetParent 10431 offsetParent = this.offsetParent(); 10432 10433 // Get correct offsets 10434 offset = this.offset(); 10435 if (!jQuery.nodeName(offsetParent[0], "html")) { 10436 parentOffset = offsetParent.offset(); 10437 } 10438 10439 // Add offsetParent borders 10440 parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true); 10441 parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true); 10442 } 10443 10444 // Subtract parent offsets and element margins 10445 // note: when an element has margin: auto the offsetLeft and marginLeft 10446 // are the same in Safari causing offset.left to incorrectly be 0 10447 return { 10448 top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true), 10449 left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true) 10450 }; 10451 }, 10452 10453 offsetParent: function () { 10454 return this.map(function () { 10455 var offsetParent = this.offsetParent; 10456 10457 while (offsetParent && !jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static") { 10458 offsetParent = offsetParent.offsetParent; 10459 } 10460 return offsetParent || documentElement; 10461 }); 10462 } 10463 }); 10464 10465 // Create scrollLeft and scrollTop methods 10466 jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (method, prop) { 10467 var top = /Y/.test(prop); 10468 10469 jQuery.fn[method] = function (val) { 10470 return access(this, function (elem, method, val) { 10471 var win = getWindow(elem); 10472 10473 if (val === undefined) { 10474 return win ? prop in win ? win[prop] : win.document.documentElement[method] : elem[method]; 10475 } 10476 10477 if (win) { 10478 win.scrollTo(!top ? val : jQuery(win).scrollLeft(), top ? val : jQuery(win).scrollTop()); 10479 } else { 10480 elem[method] = val; 10481 } 10482 }, method, val, arguments.length, null); 10483 }; 10484 }); 10485 10486 // Support: Safari<7-8+, Chrome<37-44+ 10487 // Add the top/left cssHooks using jQuery.fn.position 10488 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 10489 // getComputedStyle returns percent when specified for top/left/bottom/right 10490 // rather than make the css module depend on the offset module, we just check for it here 10491 jQuery.each(["top", "left"], function (i, prop) { 10492 jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function (elem, computed) { 10493 if (computed) { 10494 computed = curCSS(elem, prop); 10495 10496 // if curCSS returns percentage, fallback to offset 10497 return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed; 10498 } 10499 }); 10500 }); 10501 10502 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 10503 jQuery.each({ Height: "height", Width: "width" }, function (name, type) { 10504 jQuery.each({ padding: "inner" + name, content: type, "": "outer" + name }, function (defaultExtra, funcName) { 10505 10506 // margin is only for outerHeight, outerWidth 10507 jQuery.fn[funcName] = function (margin, value) { 10508 var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), 10509 extra = defaultExtra || (margin === true || value === true ? "margin" : "border"); 10510 10511 return access(this, function (elem, type, value) { 10512 var doc; 10513 10514 if (jQuery.isWindow(elem)) { 10515 10516 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 10517 // isn't a whole lot we can do. See pull request at this URL for discussion: 10518 // https://github.com/jquery/jquery/pull/764 10519 return elem.document.documentElement["client" + name]; 10520 } 10521 10522 // Get document width or height 10523 if (elem.nodeType === 9) { 10524 doc = elem.documentElement; 10525 10526 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 10527 // whichever is greatest 10528 // unfortunately, this causes bug #3838 in IE6/8 only, 10529 // but there is currently no good, small way to fix it. 10530 return Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name]); 10531 } 10532 10533 return value === undefined ? 10534 10535 // Get width or height on the element, requesting but not forcing parseFloat 10536 jQuery.css(elem, type, extra) : 10537 10538 // Set width or height on the element 10539 jQuery.style(elem, type, value, extra); 10540 }, type, chainable ? margin : undefined, chainable, null); 10541 }; 10542 }); 10543 }); 10544 10545 jQuery.fn.extend({ 10546 10547 bind: function (types, data, fn) { 10548 return this.on(types, null, data, fn); 10549 }, 10550 unbind: function (types, fn) { 10551 return this.off(types, null, fn); 10552 }, 10553 10554 delegate: function (selector, types, data, fn) { 10555 return this.on(types, selector, data, fn); 10556 }, 10557 undelegate: function (selector, types, fn) { 10558 10559 // ( namespace ) or ( selector, types [, fn] ) 10560 return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn); 10561 } 10562 }); 10563 10564 // The number of elements contained in the matched element set 10565 jQuery.fn.size = function () { 10566 return this.length; 10567 }; 10568 10569 jQuery.fn.andSelf = jQuery.fn.addBack; 10570 10571 // Register as a named AMD module, since jQuery can be concatenated with other 10572 // files that may use define, but not via a proper concatenation script that 10573 // understands anonymous AMD modules. A named AMD is safest and most robust 10574 // way to register. Lowercase jquery is used because AMD module names are 10575 // derived from file names, and jQuery is normally delivered in a lowercase 10576 // file name. Do this after creating the global so that if an AMD module wants 10577 // to call noConflict to hide this version of jQuery, it will work. 10578 10579 // Note that for maximum portability, libraries that are not jQuery should 10580 // declare themselves as anonymous modules, and avoid setting a global if an 10581 // AMD loader is present. jQuery is a special case. For more information, see 10582 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 10583 10584 if (true) { 10585 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 10586 return jQuery; 10587 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 10588 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 10589 } 10590 10591 var 10592 10593 // Map over jQuery in case of overwrite 10594 _jQuery = window.jQuery, 10595 10596 10597 // Map over the $ in case of overwrite 10598 _$ = window.$; 10599 10600 jQuery.noConflict = function (deep) { 10601 if (window.$ === jQuery) { 10602 window.$ = _$; 10603 } 10604 10605 if (deep && window.jQuery === jQuery) { 10606 window.jQuery = _jQuery; 10607 } 10608 10609 return jQuery; 10610 }; 10611 10612 // Expose jQuery and $ identifiers, even in 10613 // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 10614 // and CommonJS for browser emulators (#13566) 10615 if (!noGlobal) { 10616 window.jQuery = window.$ = jQuery; 10617 } 10618 10619 return jQuery; 10620}); 10621 10622/***/ }), 10623/* 1 */, 10624/* 2 */, 10625/* 3 */
vendor: 10,907 bytes, lines 10626-11049
10626/***/ (function(module, exports) { 10627 10628/* 10629 MIT License http://www.opensource.org/licenses/mit-license.php 10630 Author Tobias Koppers @sokra 10631*/ 10632// css base code, injected by the css-loader 10633module.exports = function (useSourceMap) { 10634 var list = []; 10635 10636 // return the list of modules as css string 10637 list.toString = function toString() { 10638 return this.map(function (item) { 10639 var content = cssWithMappingToString(item, useSourceMap); 10640 if (item[2]) { 10641 return "@media " + item[2] + "{" + content + "}"; 10642 } else { 10643 return content; 10644 } 10645 }).join(""); 10646 }; 10647 10648 // import a list of modules into the list 10649 list.i = function (modules, mediaQuery) { 10650 if (typeof modules === "string") modules = [[null, modules, ""]]; 10651 var alreadyImportedModules = {}; 10652 for (var i = 0; i < this.length; i++) { 10653 var id = this[i][0]; 10654 if (typeof id === "number") alreadyImportedModules[id] = true; 10655 } 10656 for (i = 0; i < modules.length; i++) { 10657 var item = modules[i]; 10658 // skip already imported module 10659 // this implementation is not 100% perfect for weird media query combinations 10660 // when a module is imported multiple times with different media queries. 10661 // I hope this will never occur (Hey this way we have smaller bundles) 10662 if (typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { 10663 if (mediaQuery && !item[2]) { 10664 item[2] = mediaQuery; 10665 } else if (mediaQuery) { 10666 item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; 10667 } 10668 list.push(item); 10669 } 10670 } 10671 }; 10672 return list; 10673}; 10674 10675function cssWithMappingToString(item, useSourceMap) { 10676 var content = item[1] || ''; 10677 var cssMapping = item[3]; 10678 if (!cssMapping) { 10679 return content; 10680 } 10681 10682 if (useSourceMap && typeof btoa === 'function') { 10683 var sourceMapping = toComment(cssMapping); 10684 var sourceURLs = cssMapping.sources.map(function (source) { 10685 return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; 10686 }); 10687 10688 return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); 10689 } 10690 10691 return [content].join('\n'); 10692} 10693 10694// Adapted from convert-source-map (MIT) 10695function toComment(sourceMap) { 10696 // eslint-disable-next-line no-undef 10697 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); 10698 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; 10699 10700 return '/*# ' + data + ' */'; 10701} 10702 10703/***/ }), 10704/* 4 */ 10705/***/ (function(module, exports, __webpack_require__) { 10706 10707/* 10708 MIT License http://www.opensource.org/licenses/mit-license.php 10709 Author Tobias Koppers @sokra 10710*/ 10711 10712var stylesInDom = {}; 10713 10714var memoize = function (fn) { 10715 var memo; 10716 10717 return function () { 10718 if (typeof memo === "undefined") memo = fn.apply(this, arguments); 10719 return memo; 10720 }; 10721}; 10722 10723var isOldIE = memoize(function () { 10724 // Test for IE <= 9 as proposed by Browserhacks 10725 // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 10726 // Tests for existence of standard globals is to allow style-loader 10727 // to operate correctly into non-standard environments 10728 // @see https://github.com/webpack-contrib/style-loader/issues/177 10729 return window && document && document.all && !window.atob; 10730}); 10731 10732var getElement = (function (fn) { 10733 var memo = {}; 10734 10735 return function(selector) { 10736 if (typeof memo[selector] === "undefined") { 10737 memo[selector] = fn.call(this, selector); 10738 } 10739 10740 return memo[selector] 10741 }; 10742})(function (target) { 10743 return document.querySelector(target) 10744}); 10745 10746var singleton = null; 10747var singletonCounter = 0; 10748var stylesInsertedAtTop = []; 10749 10750var fixUrls = __webpack_require__(11); 10751 10752module.exports = function(list, options) { 10753 if (typeof DEBUG !== "undefined" && DEBUG) { 10754 if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); 10755 } 10756 10757 options = options || {}; 10758 10759 options.attrs = typeof options.attrs === "object" ? options.attrs : {}; 10760 10761 // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> 10762 // tags it will allow on a page 10763 if (!options.singleton) options.singleton = isOldIE(); 10764 10765 // By default, add <style> tags to the <head> element 10766 if (!options.insertInto) options.insertInto = "head"; 10767 10768 // By default, add <style> tags to the bottom of the target 10769 if (!options.insertAt) options.insertAt = "bottom"; 10770 10771 var styles = listToStyles(list, options); 10772 10773 addStylesToDom(styles, options); 10774 10775 return function update (newList) { 10776 var mayRemove = []; 10777 10778 for (var i = 0; i < styles.length; i++) { 10779 var item = styles[i]; 10780 var domStyle = stylesInDom[item.id]; 10781 10782 domStyle.refs--; 10783 mayRemove.push(domStyle); 10784 } 10785 10786 if(newList) { 10787 var newStyles = listToStyles(newList, options); 10788 addStylesToDom(newStyles, options); 10789 } 10790 10791 for (var i = 0; i < mayRemove.length; i++) { 10792 var domStyle = mayRemove[i]; 10793 10794 if(domStyle.refs === 0) { 10795 for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); 10796 10797 delete stylesInDom[domStyle.id]; 10798 } 10799 } 10800 }; 10801}; 10802 10803function addStylesToDom (styles, options) { 10804 for (var i = 0; i < styles.length; i++) { 10805 var item = styles[i]; 10806 var domStyle = stylesInDom[item.id]; 10807 10808 if(domStyle) { 10809 domStyle.refs++; 10810 10811 for(var j = 0; j < domStyle.parts.length; j++) { 10812 domStyle.parts[j](item.parts[j]); 10813 } 10814 10815 for(; j < item.parts.length; j++) { 10816 domStyle.parts.push(addStyle(item.parts[j], options)); 10817 } 10818 } else { 10819 var parts = []; 10820 10821 for(var j = 0; j < item.parts.length; j++) { 10822 parts.push(addStyle(item.parts[j], options)); 10823 } 10824 10825 stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; 10826 } 10827 } 10828} 10829 10830function listToStyles (list, options) { 10831 var styles = []; 10832 var newStyles = {}; 10833 10834 for (var i = 0; i < list.length; i++) { 10835 var item = list[i]; 10836 var id = options.base ? item[0] + options.base : item[0]; 10837 var css = item[1]; 10838 var media = item[2]; 10839 var sourceMap = item[3]; 10840 var part = {css: css, media: media, sourceMap: sourceMap}; 10841 10842 if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]}); 10843 else newStyles[id].parts.push(part); 10844 } 10845 10846 return styles; 10847} 10848 10849function insertStyleElement (options, style) { 10850 var target = getElement(options.insertInto) 10851 10852 if (!target) { 10853 throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid."); 10854 } 10855 10856 var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1]; 10857 10858 if (options.insertAt === "top") { 10859 if (!lastStyleElementInsertedAtTop) { 10860 target.insertBefore(style, target.firstChild); 10861 } else if (lastStyleElementInsertedAtTop.nextSibling) { 10862 target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling); 10863 } else { 10864 target.appendChild(style); 10865 } 10866 stylesInsertedAtTop.push(style); 10867 } else if (options.insertAt === "bottom") { 10868 target.appendChild(style); 10869 } else { 10870 throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'."); 10871 } 10872} 10873 10874function removeStyleElement (style) { 10875 if (style.parentNode === null) return false; 10876 style.parentNode.removeChild(style); 10877 10878 var idx = stylesInsertedAtTop.indexOf(style); 10879 if(idx >= 0) { 10880 stylesInsertedAtTop.splice(idx, 1); 10881 } 10882} 10883 10884function createStyleElement (options) { 10885 var style = document.createElement("style"); 10886 10887 options.attrs.type = "text/css"; 10888 10889 addAttrs(style, options.attrs); 10890 insertStyleElement(options, style); 10891 10892 return style; 10893} 10894 10895function createLinkElement (options) { 10896 var link = document.createElement("link"); 10897 10898 options.attrs.type = "text/css"; 10899 options.attrs.rel = "stylesheet"; 10900 10901 addAttrs(link, options.attrs); 10902 insertStyleElement(options, link); 10903 10904 return link; 10905} 10906 10907function addAttrs (el, attrs) { 10908 Object.keys(attrs).forEach(function (key) { 10909 el.setAttribute(key, attrs[key]); 10910 }); 10911} 10912 10913function addStyle (obj, options) { 10914 var style, update, remove, result; 10915 10916 // If a transform function was defined, run it on the css 10917 if (options.transform && obj.css) { 10918 result = options.transform(obj.css); 10919 10920 if (result) { 10921 // If transform returns a value, use that instead of the original css. 10922 // This allows running runtime transformations on the css. 10923 obj.css = result; 10924 } else { 10925 // If the transform function returns a falsy value, don't add this css. 10926 // This allows conditional loading of css 10927 return function() { 10928 // noop 10929 }; 10930 } 10931 } 10932 10933 if (options.singleton) { 10934 var styleIndex = singletonCounter++; 10935 10936 style = singleton || (singleton = createStyleElement(options)); 10937 10938 update = applyToSingletonTag.bind(null, style, styleIndex, false); 10939 remove = applyToSingletonTag.bind(null, style, styleIndex, true); 10940 10941 } else if ( 10942 obj.sourceMap && 10943 typeof URL === "function" && 10944 typeof URL.createObjectURL === "function" && 10945 typeof URL.revokeObjectURL === "function" && 10946 typeof Blob === "function" && 10947 typeof btoa === "function" 10948 ) { 10949 style = createLinkElement(options); 10950 update = updateLink.bind(null, style, options); 10951 remove = function () { 10952 removeStyleElement(style); 10953 10954 if(style.href) URL.revokeObjectURL(style.href); 10955 }; 10956 } else { 10957 style = createStyleElement(options); 10958 update = applyToTag.bind(null, style); 10959 remove = function () { 10960 removeStyleElement(style); 10961 }; 10962 } 10963 10964 update(obj); 10965 10966 return function updateStyle (newObj) { 10967 if (newObj) { 10968 if ( 10969 newObj.css === obj.css && 10970 newObj.media === obj.media && 10971 newObj.sourceMap === obj.sourceMap 10972 ) { 10973 return; 10974 } 10975 10976 update(obj = newObj); 10977 } else { 10978 remove(); 10979 } 10980 }; 10981} 10982 10983var replaceText = (function () { 10984 var textStore = []; 10985 10986 return function (index, replacement) { 10987 textStore[index] = replacement; 10988 10989 return textStore.filter(Boolean).join('\n'); 10990 }; 10991})(); 10992 10993function applyToSingletonTag (style, index, remove, obj) { 10994 var css = remove ? "" : obj.css; 10995 10996 if (style.styleSheet) { 10997 style.styleSheet.cssText = replaceText(index, css); 10998 } else { 10999 var cssNode = document.createTextNode(css); 11000 var childNodes = style.childNodes; 11001 11002 if (childNodes[index]) style.removeChild(childNodes[index]); 11003 11004 if (childNodes.length) { 11005 style.insertBefore(cssNode, childNodes[index]); 11006 } else { 11007 style.appendChild(cssNode); 11008 } 11009 } 11010} 11011 11012function applyToTag (style, obj) { 11013 var css = obj.css; 11014 var media = obj.media; 11015 11016 if(media) { 11017 style.setAttribute("media", media) 11018 } 11019 11020 if(style.styleSheet) { 11021 style.styleSheet.cssText = css; 11022 } else { 11023 while(style.firstChild) { 11024 style.removeChild(style.firstChild); 11025 } 11026 11027 style.appendChild(document.createTextNode(css)); 11028 } 11029} 11030 11031function updateLink (link, options, obj) { 11032 var css = obj.css; 11033 var sourceMap = obj.sourceMap; 11034 11035 /* 11036 If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled 11037 and there is no publicPath defined then lets turn convertToAbsoluteUrls 11038 on by default. Otherwise default to the convertToAbsoluteUrls option 11039 directly 11040 */ 11041 var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap; 11042 11043 if (options.convertToAbsoluteUrls || autoFixUrls) { 11044 css = fixUrls(css); 11045 } 11046 11047 if (sourceMap) { 11048 // http://stackoverflow.com/a/26603875 11049 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)
11049))) + " */"; 11050 } 11051 11052 var blob = new Blob([css], { type: "text/css" }); 11053 11054 var oldSrc = link.href; 11055 11056 link.href = URL.createObjectURL(blob); 11057 11058 if(oldSrc) URL.revokeObjectURL(oldSrc); 11059} 11060 11061 11062/***/ }), 11063/* 5 */, 11064/* 6 */ 11065/***/ (function(module, __webpack_exports__, __webpack_require__) { 11066 11067"use strict"; 11068/* eslint consistent-return: "off" */ 11069/* eslint func-names: ["off"] */ 11070/* eslint max-len: ["off", { "code": 200 }] */ 11071/* eslint prefer-destructuring: ["off"] */ 11072/** 11073 * ------------------------------------------------------------------ 11074 * 夿æµè§å¨ç±»å 11075 * ------------------------------------------------------------------ 11076 */ 11077 11078const browserType = function () { 11079 const userAgent = navigator.userAgent; // å徿µè§å¨çuserAgentå符串 11080 const isOpera = userAgent.indexOf('Opera') > -1; // 夿æ¯å¦Operaæµè§å¨ 11081 // let isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //夿æ¯å¦IEæµè§å¨ 11082 const isIE = window.ActiveXObject || 'ActiveXObject' in window; 11083 // let isEdge = userAgent.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !isIE; //夿æ¯å¦IEçEdgeæµè§å¨ 11084 const isEdge = userAgent.indexOf('Edge') > -1; // 夿æ¯å¦IEçEdgeæµè§å¨ 11085 const isFF = userAgent.indexOf('Firefox') > -1; // 夿æ¯å¦Firefoxæµè§å¨ 11086 const isSafari = userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') === -1; // 夿æ¯å¦Safariæµè§å¨ 11087 const isChrome = userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Safari') > -1 && !isEdge; // 夿Chromeæµè§å¨ 11088 11089 if (isIE) { 11090 const reIE = new RegExp('MSIE (\\d+\\.\\d+);'); 11091 reIE.test(userAgent); 11092 const fIEVersion = parseFloat(RegExp.$1); 11093 if (userAgent.indexOf('MSIE 6.0') !== -1) { 11094 return 'IE6'; 11095 } else if (fIEVersion === 7) { 11096 return 'IE7'; 11097 } else if (fIEVersion === 8) { 11098 return 'IE8'; 11099 } else if (fIEVersion === 9) { 11100 return 'IE9'; 11101 } else if (fIEVersion === 10) { 11102 return 'IE10'; 11103 } else if (userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)) { 11104 return 'IE11'; 11105 } 11106 return '0'; // IEçæ¬è¿ä½ 11107 } // isIE end 11108 11109 if (isFF) { 11110 return 'FF'; 11111 } 11112 if (isOpera) { 11113 return 'Opera'; 11114 } 11115 if (isSafari) { 11116 return 'Safari'; 11117 } 11118 if (isChrome) { 11119 return 'Chrome'; 11120 } 11121 if (isEdge) { 11122 return 'Edge'; 11123 } 11124}; 11125 11126/* harmony default export */ __webpack_exports__["a"] = (browserType); 11127 11128/***/ }), 11129/* 7 */, 11130/* 8 */, 11131/* 9 */ 11132/***/ (function(module, __webpack_exports__, __webpack_require__) { 11133 11134"use strict"; 11135/** 11136 * ------------------------------------------------------------------ 11137 * æ¨¡ç» - 11138 * ------------------------------------------------------------------ 11139 */ 11140 11141/** 11142* 彿°åè½ç®è¿°: åä¼ ç»é¢å®½åº¦ 11143* å ·ä½æè¿°ä¸äºç»è: 11144* @date 2017-10-30 11145* @author Telliex<[email protected]> 11146* Fish<[email protected]> 11147*/ 11148 11149const viewport = () => { 11150 let e = window; 11151 let a = 'inner'; 11152 if (!('innerWidth' in window)) { 11153 a = 'client'; 11154 e = document.documentElement || document.body; 11155 } 11156 return e[`${a}Width`]; 11157}; 11158/* harmony default export */ __webpack_exports__["a"] = (viewport); 11159 11160/***/ }), 11161/* 10 */ 11162/***/ (function(module, __webpack_exports__, __webpack_require__) { 11163 11164"use strict"; 11165/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 11166/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 11167/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__browser__ = __webpack_require__(6); 11168/* eslint consistent-return: "off" */ 11169/* eslint func-names: ["off"] */ 11170/* eslint max-len: ["off", { "code": 200 }] */ 11171/* eslint prefer-destructuring: ["off"] */ 11172/* eslint no-undef: "off" */ 11173 11174/* eslint class-methods-use-this: ["error", { "exceptMethods": ["viewport","ie8Browser"," modernBrowser","modernBrowser","flashSupported"] }] */ 11175/** 11176 * ------------------------------------------------------------------ 11177 * æ¨¡ç» - 11178 * ------------------------------------------------------------------ 11179 */ 11180 11181/** 11182 * 彿°åè½ç®è¿°: åä¼ ç»é¢å®½åº¦ 11183 * å ·ä½æè¿°ä¸äºç»è: 11184 * @date 2017-10-30 11185 * @author Telliex<[email protected]> 11186 * Fish<[email protected]> 11187 */ 11188 11189 11190 11191 11192// ------------ 嵿¸¬ç覽å¨çæ 11193 11194class BrowserChecker { 11195 /* 11196 | 嵿¸¬ Desktop / Mobile 11197 */ 11198 viewport(windowSize) { 11199 if (windowSize >= 1360) { 11200 return 'max'; 11201 } else if (windowSize >= 960 && windowSize < 1360) { 11202 return 'desktop'; 11203 } else if (windowSize >= 768 && windowSize < 960) { 11204 return 'tablet'; 11205 } 11206 return 'mobile'; 11207 } 11208 11209 /* 11210 | 嵿¸¬æ¯å¦çº IE8 以ä¸çæ¬ 11211 */ 11212 ie8Browser() { 11213 if (__WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE6' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE7' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE8') { 11214 return true; 11215 } 11216 return false;
11217 } 11218 11219 /* 11220 | 嵿¸¬æ¯å¦çº Modern Browser 11221 */ 11222 modernBrowser() { 11223 if (__WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE6' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE7' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE8' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE9' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE10') { 11224 return false; 11225 } 11226 return true; 11227 } 11228 11229 /* 11230 | 夿·æ¯å¦æ¯æ´/å®è£ Flash 11231 */ 11232 flashSupported() { 11233 if (__WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE6' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE7' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE8' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE9' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE10' || __WEBPACK_IMPORTED_MODULE_1__browser__["a" /* default */] === 'IE11') { 11234 if (window.ActiveXObject) { 11235 try { 11236 if (new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) { 11237 return true; 11238 } 11239 } catch (e) { 11240 // .. 11241 } 11242 } 11243 if (navigator.plugins) { 11244 for (let i = 0; i < navigator.plugins.length; i += 1) { 11245 if (navigator.plugins[i].name.toLowerCase().indexOf('shockwave flash') >= 0) { 11246 return true; 11247 } 11248 } 11249 return false; 11250 } 11251 return false; 11252 } 11253 return true; 11254 } 11255} 11256 11257// 宣å åå Class 11258const globalBrowserChecker = new BrowserChecker(); 11259/* harmony default export */ __webpack_exports__["a"] = (globalBrowserChecker); 11260 11261/***/ }), 11262/* 11 */ 11263/***/ (function(module, exports) { 11264 11265 11266/** 11267 * When source maps are enabled, `style-loader` uses a link element with a data-uri to 11268 * embed the css on the page. This breaks all relative urls because now they are relative to a 11269 * bundle instead of the current page. 11270 * 11271 * One solution is to only use full urls, but that may be impossible. 11272 * 11273 * Instead, this function "fixes" the relative urls to be absolute according to the current page location. 11274 * 11275 * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command. 11276 * 11277 */ 11278 11279module.exports = function (css) { 11280 // get current location 11281 var location = typeof window !== "undefined" && window.location; 11282 11283 if (!location) { 11284 throw new Error("fixUrls requires window.location"); 11285 } 11286 11287 // blank or null? 11288 if (!css || typeof css !== "string") { 11289 return css; 11290 } 11291 11292 var baseUrl = location.protocol + "//" + location.host; 11293 var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/"); 11294 11295 // convert each url(...) 11296 /* 11297 This regular expression is just a way to recursively match brackets within 11298 a string. 11299 /url\s*\( = Match on the word "url" with any whitespace after it and then a parens 11300 ( = Start a capturing group 11301 (?: = Start a non-capturing group 11302 [^)(] = Match anything that isn't a parentheses 11303 | = OR 11304 \( = Match a start parentheses 11305 (?: = Start another non-capturing groups 11306 [^)(]+ = Match anything that isn't a parentheses 11307 | = OR 11308 \( = Match a start parentheses 11309 [^)(]* = Match anything that isn't a parentheses 11310 \) = Match a end parentheses 11311 ) = End Group 11312 *\) = Match anything and then a close parens 11313 ) = Close non-capturing group 11314 * = Match anything 11315 ) = Close capturing group 11316 \) = Match a close parens 11317 /gi = Get all matches, not the first. Be case insensitive. 11318 */ 11319 var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function (fullMatch, origUrl) { 11320 // strip quotes (if they exist) 11321 var unquotedOrigUrl = origUrl.trim().replace(/^"(.*)"$/, function (o, $1) { 11322 return $1; 11323 }).replace(/^'(.*)'$/, function (o, $1) { 11324 return $1; 11325 }); 11326 11327 // already a full url? no change 11328 if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) { 11329 return fullMatch; 11330 } 11331 11332 // convert the url to a full url 11333 var newUrl; 11334 11335 if (unquotedOrigUrl.indexOf("//") === 0) { 11336 //TODO: should we add protocol? 11337 newUrl = unquotedOrigUrl; 11338 } else if (unquotedOrigUrl.indexOf("/") === 0) { 11339 // path should be relative to the base url 11340 newUrl = baseUrl + unquotedOrigUrl; // already starts with '/' 11341 } else { 11342 // path should be relative to current directory 11343 newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './' 11344 } 11345 11346 // send back the fixed url(...) 11347 return "url(" + JSON.stringify(newUrl) + ")"; 11348 }); 11349 11350 // send back the fixed css 11351 return fixedCss; 11352}; 11353 11354/***/ }), 11355/* 12 */ 11356/***/ (function(module, exports, __webpack_require__) { 11357 11358/* WEBPACK VAR INJECTION */(function(__webpack_provided_window_dot_jQuery, jQuery) {/** 11359 * Owl Carousel v2.2.0 11360 * Copyright 2013-2016 David Deutsch 11361 * Licensed under MIT (https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE) 11362 */ 11363/** 11364 * Owl carousel
vendor: 32,275 bytes, lines 11365-12619
11365 * @version 2.1.6 11366 * @author Bartosz Wojciechowski 11367 * @author David Deutsch 11368 * @license The MIT License (MIT) 11369 * @todo Lazy Load Icon 11370 * @todo prevent animationend bubling 11371 * @todo itemsScaleUp 11372 * @todo Test Zepto 11373 * @todo stagePadding calculate wrong active classes 11374 */ 11375;(function ($, window, document, undefined) { 11376 11377 /** 11378 * Creates a carousel. 11379 * @class The Owl Carousel. 11380 * @public 11381 * @param {HTMLElement|jQuery} element - The element to create the carousel for. 11382 * @param {Object} [options] - The options 11383 */ 11384 function Owl(element, options) { 11385 11386 /** 11387 * Current settings for the carousel. 11388 * @public 11389 */ 11390 this.settings = null; 11391 11392 /** 11393 * Current options set by the caller including defaults. 11394 * @public 11395 */ 11396 this.options = $.extend({}, Owl.Defaults, options); 11397 11398 /** 11399 * Plugin element. 11400 * @public 11401 */ 11402 this.$element = $(element); 11403 11404 /** 11405 * Proxied event handlers. 11406 * @protected 11407 */ 11408 this._handlers = {}; 11409 11410 /** 11411 * References to the running plugins of this carousel. 11412 * @protected 11413 */ 11414 this._plugins = {}; 11415 11416 /** 11417 * Currently suppressed events to prevent them from beeing retriggered. 11418 * @protected 11419 */ 11420 this._supress = {}; 11421 11422 /** 11423 * Absolute current position. 11424 * @protected 11425 */ 11426 this._current = null; 11427 11428 /** 11429 * Animation speed in milliseconds. 11430 * @protected 11431 */ 11432 this._speed = null; 11433 11434 /** 11435 * Coordinates of all items in pixel. 11436 * @todo The name of this member is missleading. 11437 * @protected 11438 */ 11439 this._coordinates = []; 11440 11441 /** 11442 * Current breakpoint. 11443 * @todo Real media queries would be nice. 11444 * @protected 11445 */ 11446 this._breakpoint = null; 11447 11448 /** 11449 * Current width of the plugin element. 11450 */ 11451 this._width = null; 11452 11453 /** 11454 * All real items. 11455 * @protected 11456 */ 11457 this._items = []; 11458 11459 /** 11460 * All cloned items. 11461 * @protected 11462 */ 11463 this._clones = []; 11464 11465 /** 11466 * Merge values of all items. 11467 * @todo Maybe this could be part of a plugin. 11468 * @protected 11469 */ 11470 this._mergers = []; 11471 11472 /** 11473 * Widths of all items. 11474 */ 11475 this._widths = []; 11476 11477 /** 11478 * Invalidated parts within the update process. 11479 * @protected 11480 */ 11481 this._invalidated = {}; 11482 11483 /** 11484 * Ordered list of workers for the update process. 11485 * @protected 11486 */ 11487 this._pipe = []; 11488 11489 /** 11490 * Current state information for the drag operation. 11491 * @todo #261 11492 * @protected 11493 */ 11494 this._drag = { 11495 time: null, 11496 target: null, 11497 pointer: null, 11498 stage: { 11499 start: null, 11500 current: null 11501 }, 11502 direction: null 11503 }; 11504 11505 /** 11506 * Current state information and their tags. 11507 * @type {Object} 11508 * @protected 11509 */ 11510 this._states = { 11511 current: {}, 11512 tags: { 11513 'initializing': ['busy'], 11514 'animating': ['busy'], 11515 'dragging': ['interacting'] 11516 } 11517 }; 11518 11519 $.each(['onResize', 'onThrottledResize'], $.proxy(function (i, handler) { 11520 this._handlers[handler] = $.proxy(this[handler], this); 11521 }, this)); 11522 11523 $.each(Owl.Plugins, $.proxy(function (key, plugin) { 11524 this._plugins[key.charAt(0).toLowerCase() + key.slice(1)] = new plugin(this); 11525 }, this)); 11526 11527 $.each(Owl.Workers, $.proxy(function (priority, worker) { 11528 this._pipe.push({ 11529 'filter': worker.filter, 11530 'run': $.proxy(worker.run, this) 11531 }); 11532 }, this)); 11533 11534 this.setup(); 11535 this.initialize(); 11536 } 11537 11538 /** 11539 * Default options for the carousel. 11540 * @public 11541 */ 11542 Owl.Defaults = { 11543 items: 3, 11544 loop: false, 11545 center: false, 11546 rewind: false, 11547 11548 mouseDrag: true, 11549 touchDrag: true, 11550 pullDrag: true, 11551 freeDrag: false, 11552 11553 margin: 0, 11554 stagePadding: 0, 11555 11556 merge: false, 11557 mergeFit: true, 11558 autoWidth: false, 11559 11560 startPosition: 0, 11561 rtl: false, 11562 11563 smartSpeed: 250, 11564 fluidSpeed: false, 11565 dragEndSpeed: false, 11566 11567 responsive: {}, 11568 responsiveRefreshRate: 200, 11569 responsiveBaseElement: window, 11570 11571 fallbackEasing: 'swing', 11572 11573 info: false, 11574 11575 nestedItemSelector: false, 11576 itemElement: 'div', 11577 stageElement: 'div', 11578 11579 refreshClass: 'owl-refresh', 11580 loadedClass: 'owl-loaded', 11581 loadingClass: 'owl-loading', 11582 rtlClass: 'owl-rtl', 11583 responsiveClass: 'owl-responsive', 11584 dragClass: 'owl-drag', 11585 itemClass: 'owl-item', 11586 stageClass: 'owl-stage', 11587 stageOuterClass: 'owl-stage-outer', 11588 grabClass: 'owl-grab' 11589 }; 11590 11591 /** 11592 * Enumeration for width. 11593 * @public 11594 * @readonly 11595 * @enum {String} 11596 */ 11597 Owl.Width = { 11598 Default: 'default', 11599 Inner: 'inner', 11600 Outer: 'outer' 11601 }; 11602 11603 /** 11604 * Enumeration for types. 11605 * @public 11606 * @readonly 11607 * @enum {String} 11608 */ 11609 Owl.Type = { 11610 Event: 'event', 11611 State: 'state' 11612 }; 11613 11614 /** 11615 * Contains all registered plugins. 11616 * @public 11617 */ 11618 Owl.Plugins = {}; 11619 11620 /** 11621 * List of workers involved in the update process. 11622 */ 11623 Owl.Workers = [{ 11624 filter: ['width', 'settings'], 11625 run: function () { 11626 this._width = this.$element.width(); 11627 } 11628 }, { 11629 filter: ['width', 'items', 'settings'], 11630 run: function (cache) { 11631 cache.current = this._items && this._items[this.relative(this._current)]; 11632 } 11633 }, { 11634 filter: ['items', 'settings'], 11635 run: function () { 11636 this.$stage.children('.cloned').remove(); 11637 } 11638 }, { 11639 filter: ['width', 'items', 'settings'], 11640 run: function (cache) { 11641 var margin = this.settings.margin || '', 11642 grid = !this.settings.autoWidth, 11643 rtl = this.settings.rtl, 11644 css = { 11645 'width': 'auto', 11646 'margin-left': rtl ? margin : '', 11647 'margin-right': rtl ? '' : margin 11648 }; 11649 11650 !grid && this.$stage.children().css(css); 11651 11652 cache.css = css; 11653 } 11654 }, { 11655 filter: ['width', 'items', 'settings'], 11656 run: function (cache) { 11657 var width = (this.width() / this.settings.items).toFixed(3) - this.settings.margin, 11658 merge = null, 11659 iterator = this._items.length, 11660 grid = !this.settings.autoWidth, 11661 widths = []; 11662 11663 cache.items = { 11664 merge: false, 11665 width: width 11666 }; 11667 11668 while (iterator--) { 11669 merge = this._mergers[iterator]; 11670 merge = this.settings.mergeFit && Math.min(merge, this.settings.items) || merge; 11671 11672 cache.items.merge = merge > 1 || cache.items.merge; 11673 11674 widths[iterator] = !grid ? this._items[iterator].width() : width * merge; 11675 } 11676 11677 this._widths = widths; 11678 } 11679 }, { 11680 filter: ['items', 'settings'], 11681 run: function () { 11682 var clones = [], 11683 items = this._items, 11684 settings = this.settings, 11685 view = Math.max(settings.items * 2, 4), 11686 size = Math.ceil(items.length / 2) * 2, 11687 repeat = settings.loop && items.length ? settings.rewind ? view : Math.max(view, size) : 0, 11688 append = '', 11689 prepend = ''; 11690 11691 repeat /= 2; 11692 11693 while (repeat--) { 11694 clones.push(this.normalize(clones.length / 2, true)); 11695 append = append + items[clones[clones.length - 1]][0].outerHTML; 11696 clones.push(this.normalize(items.length - 1 - (clones.length - 1) / 2, true)); 11697 prepend = items[clones[clones.length - 1]][0].outerHTML + prepend; 11698 } 11699 11700 this._clones = clones; 11701 11702 $(append).addClass('cloned').appendTo(this.$stage); 11703 $(prepend).addClass('cloned').prependTo(this.$stage); 11704 } 11705 }, { 11706 filter: ['width', 'items', 'settings'], 11707 run: function () { 11708 var rtl = this.settings.rtl ? 1 : -1, 11709 size = this._clones.length + this._items.length, 11710 iterator = -1, 11711 previous = 0, 11712 current = 0, 11713 coordinates = []; 11714 11715 while (++iterator < size) { 11716 previous = coordinates[iterator - 1] || 0; 11717 current = this._widths[this.relative(iterator)] + this.settings.margin; 11718 coordinates.push(previous + current * rtl); 11719 } 11720 11721 this._coordinates = coordinates; 11722 } 11723 }, { 11724 filter: ['width', 'items', 'settings'], 11725 run: function () { 11726 var padding = this.settings.stagePadding, 11727 coordinates = this._coordinates, 11728 css = { 11729 'width': Math.ceil(Math.abs(coordinates[coordinates.length - 1])) + padding * 2, 11730 'padding-left': padding || '', 11731 'padding-right': padding || '' 11732 }; 11733 11734 this.$stage.css(css); 11735 } 11736 }, { 11737 filter: ['width', 'items', 'settings'], 11738 run: function (cache) { 11739 var iterator = this._coordinates.length, 11740 grid = !this.settings.autoWidth, 11741 items = this.$stage.children(); 11742 11743 if (grid && cache.items.merge) { 11744 while (iterator--) { 11745 cache.css.width = this._widths[this.relative(iterator)]; 11746 items.eq(iterator).css(cache.css); 11747 } 11748 } else if (grid) { 11749 cache.css.width = cache.items.width; 11750 items.css(cache.css); 11751 } 11752 } 11753 }, { 11754 filter: ['items'], 11755 run: function () { 11756 this._coordinates.length < 1 && this.$stage.removeAttr('style'); 11757 } 11758 }, { 11759 filter: ['width', 'items', 'settings'], 11760 run: function (cache) { 11761 cache.current = cache.current ? this.$stage.children().index(cache.current) : 0; 11762 cache.current = Math.max(this.minimum(), Math.min(this.maximum(), cache.current)); 11763 this.reset(cache.current); 11764 } 11765 }, { 11766 filter: ['position'], 11767 run: function () { 11768 this.animate(this.coordinates(this._current)); 11769 } 11770 }, { 11771 filter: ['width', 'position', 'items', 'settings'], 11772 run: function () { 11773 var rtl = this.settings.rtl ? 1 : -1, 11774 padding = this.settings.stagePadding * 2, 11775 begin = this.coordinates(this.current()) + padding, 11776 end = begin + this.width() * rtl, 11777 inner, 11778 outer, 11779 matches = [], 11780 i, 11781 n; 11782 11783 for (i = 0, n = this._coordinates.length; i < n; i++) { 11784 inner = this._coordinates[i - 1] || 0; 11785 outer = Math.abs(this._coordinates[i]) + padding * rtl; 11786 11787 if (this.op(inner, '<=', begin) && this.op(inner, '>', end) || this.op(outer, '<', begin) && this.op(outer, '>', end)) { 11788 matches.push(i); 11789 } 11790 } 11791 11792 this.$stage.children('.active').removeClass('active'); 11793 this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass('active'); 11794 11795 if (this.settings.center) { 11796 this.$stage.children('.center').removeClass('center'); 11797 this.$stage.children().eq(this.current()).addClass('center'); 11798 } 11799 } 11800 }]; 11801 11802 /** 11803 * Initializes the carousel. 11804 * @protected 11805 */ 11806 Owl.prototype.initialize = function () { 11807 this.enter('initializing'); 11808 this.trigger('initialize'); 11809 11810 this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl); 11811 11812 if (this.settings.autoWidth && !this.is('pre-loading')) { 11813 var imgs, nestedSelector, width; 11814 imgs = this.$element.find('img'); 11815 nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined; 11816 width = this.$element.children(nestedSelector).width(); 11817 11818 if (imgs.length && width <= 0) { 11819 this.preloadAutoWidthImages(imgs); 11820 } 11821 } 11822 11823 this.$element.addClass(this.options.loadingClass); 11824 11825 // create stage 11826 this.$stage = $('<' + this.settings.stageElement + ' class="' + this.settings.stageClass + '"/>').wrap('<div class="' + this.settings.stageOuterClass + '"/>'); 11827 11828 // append stage 11829 this.$element.append(this.$stage.parent()); 11830 11831 // append content 11832 this.replace(this.$element.children().not(this.$stage.parent())); 11833 11834 // check visibility 11835 if (this.$element.is(':visible')) { 11836 // update view 11837 this.refresh(); 11838 } else { 11839 // invalidate width 11840 this.invalidate('width'); 11841 } 11842 11843 this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass); 11844 11845 // register event handlers 11846 this.registerEventHandlers(); 11847 11848 this.leave('initializing'); 11849 this.trigger('initialized'); 11850 }; 11851 11852 /** 11853 * Setups the current settings. 11854 * @todo Remove responsive classes. Why should adaptive designs be brought into IE8? 11855 * @todo Support for media queries by using `matchMedia` would be nice. 11856 * @public 11857 */ 11858 Owl.prototype.setup = function () { 11859 var viewport = this.viewport(), 11860 overwrites = this.options.responsive, 11861 match = -1, 11862 settings = null; 11863 11864 if (!overwrites) { 11865 settings = $.extend({}, this.options); 11866 } else { 11867 $.each(overwrites, function (breakpoint) { 11868 if (breakpoint <= viewport && breakpoint > match) { 11869 match = Number(breakpoint); 11870 } 11871 }); 11872 11873 settings = $.extend({}, this.options, overwrites[match]); 11874 if (typeof settings.stagePadding === 'function') { 11875 settings.stagePadding = settings.stagePadding(); 11876 } 11877 delete settings.responsive; 11878 11879 // responsive class 11880 if (settings.responsiveClass) { 11881 this.$element.attr('class', this.$element.attr('class').replace(new RegExp('(' + this.options.responsiveClass + '-)\\S+\\s', 'g'), '$1' + match)); 11882 } 11883 } 11884 11885 this.trigger('change', { property: { name: 'settings', value: settings } }); 11886 this._breakpoint = match; 11887 this.settings = settings; 11888 this.invalidate('settings'); 11889 this.trigger('changed', { property: { name: 'settings', value: this.settings } }); 11890 }; 11891 11892 /** 11893 * Updates option logic if necessery. 11894 * @protected 11895 */ 11896 Owl.prototype.optionsLogic = function () { 11897 if (this.settings.autoWidth) { 11898 this.settings.stagePadding = false; 11899 this.settings.merge = false; 11900 } 11901 }; 11902 11903 /** 11904 * Prepares an item before add. 11905 * @todo Rename event parameter `content` to `item`. 11906 * @protected 11907 * @returns {jQuery|HTMLElement} - The item container. 11908 */ 11909 Owl.prototype.prepare = function (item) { 11910 var event = this.trigger('prepare', { content: item }); 11911 11912 if (!event.data) { 11913 event.data = $('<' + this.settings.itemElement + '/>').addClass(this.options.itemClass).append(item); 11914 } 11915 11916 this.trigger('prepared', { content: event.data }); 11917 11918 return event.data; 11919 }; 11920 11921 /** 11922 * Updates the view. 11923 * @public 11924 */ 11925 Owl.prototype.update = function () { 11926 var i = 0, 11927 n = this._pipe.length, 11928 filter = $.proxy(function (p) { 11929 return this[p]; 11930 }, this._invalidated), 11931 cache = {}; 11932 11933 while (i < n) { 11934 if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) { 11935 this._pipe[i].run(cache); 11936 } 11937 i++; 11938 } 11939 11940 this._invalidated = {}; 11941 11942 !this.is('valid') && this.enter('valid'); 11943 }; 11944 11945 /** 11946 * Gets the width of the view. 11947 * @public 11948 * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return. 11949 * @returns {Number} - The width of the view in pixel. 11950 */ 11951 Owl.prototype.width = function (dimension) { 11952 dimension = dimension || Owl.Width.Default; 11953 switch (dimension) { 11954 case Owl.Width.Inner: 11955 case Owl.Width.Outer: 11956 return this._width; 11957 default: 11958 return this._width - this.settings.stagePadding * 2 + this.settings.margin; 11959 } 11960 }; 11961 11962 /** 11963 * Refreshes the carousel primarily for adaptive purposes. 11964 * @public 11965 */ 11966 Owl.prototype.refresh = function () { 11967 this.enter('refreshing'); 11968 this.trigger('refresh'); 11969 11970 this.setup(); 11971 11972 this.optionsLogic(); 11973 11974 this.$element.addClass(this.options.refreshClass); 11975 11976 this.update(); 11977 11978 this.$element.removeClass(this.options.refreshClass); 11979 11980 this.leave('refreshing'); 11981 this.trigger('refreshed'); 11982 }; 11983 11984 /** 11985 * Checks window `resize` event. 11986 * @protected 11987 */ 11988 Owl.prototype.onThrottledResize = function () { 11989 window.clearTimeout(this.resizeTimer); 11990 this.resizeTimer = window.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate); 11991 }; 11992 11993 /** 11994 * Checks window `resize` event. 11995 * @protected 11996 */ 11997 Owl.prototype.onResize = function () { 11998 if (!this._items.length) { 11999 return false; 12000 } 12001 12002 if (this._width === this.$element.width()) { 12003 return false; 12004 } 12005 12006 if (!this.$element.is(':visible')) { 12007 return false; 12008 } 12009 12010 this.enter('resizing'); 12011 12012 if (this.trigger('resize').isDefaultPrevented()) { 12013 this.leave('resizing'); 12014 return false; 12015 } 12016 12017 this.invalidate('width'); 12018 12019 this.refresh(); 12020 12021 this.leave('resizing'); 12022 this.trigger('resized'); 12023 }; 12024 12025 /** 12026 * Registers event handlers. 12027 * @todo Check `msPointerEnabled` 12028 * @todo #261 12029 * @protected 12030 */ 12031 Owl.prototype.registerEventHandlers = function () { 12032 if ($.support.transition) { 12033 this.$stage.on($.support.transition.end + '.owl.core', $.proxy(this.onTransitionEnd, this)); 12034 } 12035 12036 if (this.settings.responsive !== false) { 12037 this.on(window, 'resize', this._handlers.onThrottledResize); 12038 } 12039 12040 if (this.settings.mouseDrag) { 12041 this.$element.addClass(this.options.dragClass); 12042 this.$stage.on('mousedown.owl.core', $.proxy(this.onDragStart, this)); 12043 this.$stage.on('dragstart.owl.core selectstart.owl.core', function () { 12044 return false; 12045 }); 12046 } 12047 12048 if (this.settings.touchDrag) { 12049 this.$stage.on('touchstart.owl.core', $.proxy(this.onDragStart, this)); 12050 this.$stage.on('touchcancel.owl.core', $.proxy(this.onDragEnd, this)); 12051 } 12052 }; 12053 12054 /** 12055 * Handles `touchstart` and `mousedown` events. 12056 * @todo Horizontal swipe threshold as option 12057 * @todo #261 12058 * @protected 12059 * @param {Event} event - The event arguments. 12060 */ 12061 Owl.prototype.onDragStart = function (event) { 12062 var stage = null; 12063 12064 if (event.which === 3) { 12065 return; 12066 } 12067 12068 if ($.support.transform) { 12069 stage = this.$stage.css('transform').replace(/.*\(|\)| /g, '').split(','); 12070 stage = { 12071 x: stage[stage.length === 16 ? 12 : 4], 12072 y: stage[stage.length === 16 ? 13 : 5] 12073 }; 12074 } else { 12075 stage = this.$stage.position(); 12076 stage = { 12077 x: this.settings.rtl ? stage.left + this.$stage.width() - this.width() + this.settings.margin : stage.left, 12078 y: stage.top 12079 }; 12080 } 12081 12082 if (this.is('animating')) { 12083 $.support.transform ? this.animate(stage.x) : this.$stage.stop(); 12084 this.invalidate('position'); 12085 } 12086 12087 this.$element.toggleClass(this.options.grabClass, event.type === 'mousedown'); 12088 12089 this.speed(0); 12090 12091 this._drag.time = new Date().getTime(); 12092 this._drag.target = $(event.target); 12093 this._drag.stage.start = stage; 12094 this._drag.stage.current = stage; 12095 this._drag.pointer = this.pointer(event); 12096 12097 $(document).on('mouseup.owl.core touchend.owl.core', $.proxy(this.onDragEnd, this)); 12098 12099 $(document).one('mousemove.owl.core touchmove.owl.core', $.proxy(function (event) { 12100 var delta = this.difference(this._drag.pointer, this.pointer(event)); 12101 12102 $(document).on('mousemove.owl.core touchmove.owl.core', $.proxy(this.onDragMove, this)); 12103 12104 if (Math.abs(delta.x) < Math.abs(delta.y) && this.is('valid')) { 12105 return; 12106 } 12107 12108 event.preventDefault(); 12109 12110 this.enter('dragging'); 12111 this.trigger('drag'); 12112 }, this)); 12113 }; 12114 12115 /** 12116 * Handles the `touchmove` and `mousemove` events. 12117 * @todo #261 12118 * @protected 12119 * @param {Event} event - The event arguments. 12120 */ 12121 Owl.prototype.onDragMove = function (event) { 12122 var minimum = null, 12123 maximum = null, 12124 pull = null, 12125 delta = this.difference(this._drag.pointer, this.pointer(event)), 12126 stage = this.difference(this._drag.stage.start, delta); 12127 12128 if (!this.is('dragging')) { 12129 return; 12130 } 12131 12132 event.preventDefault(); 12133 12134 if (this.settings.loop) { 12135 minimum = this.coordinates(this.minimum()); 12136 maximum = this.coordinates(this.maximum() + 1) - minimum; 12137 stage.x = ((stage.x - minimum) % maximum + maximum) % maximum + minimum; 12138 } else { 12139 minimum = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()); 12140 maximum = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()); 12141 pull = this.settings.pullDrag ? -1 * delta.x / 5 : 0; 12142 stage.x = Math.max(Math.min(stage.x, minimum + pull), maximum + pull); 12143 } 12144 12145 this._drag.stage.current = stage; 12146 12147 this.animate(stage.x); 12148 }; 12149 12150 /** 12151 * Handles the `touchend` and `mouseup` events. 12152 * @todo #261 12153 * @todo Threshold for click event 12154 * @protected 12155 * @param {Event} event - The event arguments. 12156 */ 12157 Owl.prototype.onDragEnd = function (event) { 12158 var delta = this.difference(this._drag.pointer, this.pointer(event)), 12159 stage = this._drag.stage.current, 12160 direction = delta.x > 0 ^ this.settings.rtl ? 'left' : 'right'; 12161 12162 $(document).off('.owl.core'); 12163 12164 this.$element.removeClass(this.options.grabClass); 12165 12166 if (delta.x !== 0 && this.is('dragging') || !this.is('valid')) { 12167 this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed); 12168 this.current(this.closest(stage.x, delta.x !== 0 ? direction : this._drag.direction)); 12169 this.invalidate('position'); 12170 this.update(); 12171 12172 this._drag.direction = direction; 12173 12174 if (Math.abs(delta.x) > 3 || new Date().getTime() - this._drag.time > 300) { 12175 this._drag.target.one('click.owl.core', function () { 12176 return false; 12177 }); 12178 } 12179 } 12180 12181 if (!this.is('dragging')) { 12182 return; 12183 } 12184 12185 this.leave('dragging'); 12186 this.trigger('dragged'); 12187 }; 12188 12189 /** 12190 * Gets absolute position of the closest item for a coordinate. 12191 * @todo Setting `freeDrag` makes `closest` not reusable. See #165. 12192 * @protected 12193 * @param {Number} coordinate - The coordinate in pixel. 12194 * @param {String} direction - The direction to check for the closest item. Ether `left` or `right`. 12195 * @return {Number} - The absolute position of the closest item. 12196 */ 12197 Owl.prototype.closest = function (coordinate, direction) { 12198 var position = -1, 12199 pull = 30, 12200 width = this.width(), 12201 coordinates = this.coordinates(); 12202 12203 if (!this.settings.freeDrag) { 12204 // check closest item 12205 $.each(coordinates, $.proxy(function (index, value) { 12206 // on a left pull, check on current index 12207 if (direction === 'left' && coordinate > value - pull && coordinate < value + pull) { 12208 position = index; 12209 // on a right pull, check on previous index 12210 // to do so, subtract width from value and set position = index + 1 12211 } else if (direction === 'right' && coordinate > value - width - pull && coordinate < value - width + pull) { 12212 position = index + 1; 12213 } else if (this.op(coordinate, '<', value) && this.op(coordinate, '>', coordinates[index + 1] || value - width)) { 12214 position = direction === 'left' ? index + 1 : index; 12215 } 12216 return position === -1; 12217 }, this)); 12218 } 12219 12220 if (!this.settings.loop) { 12221 // non loop boundries 12222 if (this.op(coordinate, '>', coordinates[this.minimum()])) { 12223 position = coordinate = this.minimum(); 12224 } else if (this.op(coordinate, '<', coordinates[this.maximum()])) { 12225 position = coordinate = this.maximum(); 12226 } 12227 } 12228 12229 return position; 12230 }; 12231 12232 /** 12233 * Animates the stage. 12234 * @todo #270 12235 * @public 12236 * @param {Number} coordinate - The coordinate in pixels. 12237 */ 12238 Owl.prototype.animate = function (coordinate) { 12239 var animate = this.speed() > 0; 12240 12241 this.is('animating') && this.onTransitionEnd(); 12242 12243 if (animate) { 12244 this.enter('animating'); 12245 this.trigger('translate'); 12246 } 12247 12248 if ($.support.transform3d && $.support.transition) { 12249 this.$stage.css({ 12250 transform: 'translate3d(' + coordinate + 'px,0px,0px)', 12251 transition: this.speed() / 1000 + 's' 12252 }); 12253 } else if (animate) { 12254 this.$stage.animate({ 12255 left: coordinate + 'px' 12256 }, this.speed(), this.settings.fallbackEasing, $.proxy(this.onTransitionEnd, this)); 12257 } else { 12258 this.$stage.css({ 12259 left: coordinate + 'px' 12260 }); 12261 } 12262 }; 12263 12264 /** 12265 * Checks whether the carousel is in a specific state or not. 12266 * @param {String} state - The state to check. 12267 * @returns {Boolean} - The flag which indicates if the carousel is busy. 12268 */ 12269 Owl.prototype.is = function (state) { 12270 return this._states.current[state] && this._states.current[state] > 0; 12271 }; 12272 12273 /** 12274 * Sets the absolute position of the current item. 12275 * @public 12276 * @param {Number} [position] - The new absolute position or nothing to leave it unchanged. 12277 * @returns {Number} - The absolute position of the current item. 12278 */ 12279 Owl.prototype.current = function (position) { 12280 if (position === undefined) { 12281 return this._current; 12282 } 12283 12284 if (this._items.length === 0) { 12285 return undefined; 12286 } 12287 12288 position = this.normalize(position); 12289 12290 if (this._current !== position) { 12291 var event = this.trigger('change', { property: { name: 'position', value: position } }); 12292 12293 if (event.data !== undefined) { 12294 position = this.normalize(event.data); 12295 } 12296 12297 this._current = position; 12298 12299 this.invalidate('position'); 12300 12301 this.trigger('changed', { property: { name: 'position', value: this._current } }); 12302 } 12303 12304 return this._current; 12305 }; 12306 12307 /** 12308 * Invalidates the given part of the update routine. 12309 * @param {String} [part] - The part to invalidate. 12310 * @returns {Array.<String>} - The invalidated parts. 12311 */ 12312 Owl.prototype.invalidate = function (part) { 12313 if ($.type(part) === 'string') { 12314 this._invalidated[part] = true; 12315 this.is('valid') && this.leave('valid'); 12316 } 12317 return $.map(this._invalidated, function (v, i) { 12318 return i; 12319 }); 12320 }; 12321 12322 /** 12323 * Resets the absolute position of the current item. 12324 * @public 12325 * @param {Number} position - The absolute position of the new item. 12326 */ 12327 Owl.prototype.reset = function (position) { 12328 position = this.normalize(position); 12329 12330 if (position === undefined) { 12331 return; 12332 } 12333 12334 this._speed = 0; 12335 this._current = position; 12336 12337 this.suppress(['translate', 'translated']); 12338 12339 this.animate(this.coordinates(position)); 12340 12341 this.release(['translate', 'translated']); 12342 }; 12343 12344 /** 12345 * Normalizes an absolute or a relative position of an item. 12346 * @public 12347 * @param {Number} position - The absolute or relative position to normalize. 12348 * @param {Boolean} [relative=false] - Whether the given position is relative or not. 12349 * @returns {Number} - The normalized position. 12350 */ 12351 Owl.prototype.normalize = function (position, relative) { 12352 var n = this._items.length, 12353 m = relative ? 0 : this._clones.length; 12354 12355 if (!this.isNumeric(position) || n < 1) { 12356 position = undefined; 12357 } else if (position < 0 || position >= n + m) { 12358 position = ((position - m / 2) % n + n) % n + m / 2; 12359 } 12360 12361 return position; 12362 }; 12363 12364 /** 12365 * Converts an absolute position of an item into a relative one. 12366 * @public 12367 * @param {Number} position - The absolute position to convert. 12368 * @returns {Number} - The converted position. 12369 */ 12370 Owl.prototype.relative = function (position) { 12371 position -= this._clones.length / 2; 12372 return this.normalize(position, true); 12373 }; 12374 12375 /** 12376 * Gets the maximum position for the current item. 12377 * @public 12378 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position. 12379 * @returns {Number} 12380 */ 12381 Owl.prototype.maximum = function (relative) { 12382 var settings = this.settings, 12383 maximum = this._coordinates.length, 12384 iterator, 12385 reciprocalItemsWidth, 12386 elementWidth; 12387 12388 if (settings.loop) { 12389 maximum = this._clones.length / 2 + this._items.length - 1; 12390 } else if (settings.autoWidth || settings.merge) { 12391 iterator = this._items.length; 12392 reciprocalItemsWidth = this._items[--iterator].width(); 12393 elementWidth = this.$element.width(); 12394 while (iterator--) { 12395 reciprocalItemsWidth += this._items[iterator].width() + this.settings.margin; 12396 if (reciprocalItemsWidth > elementWidth) { 12397 break; 12398 } 12399 } 12400 maximum = iterator + 1; 12401 } else if (settings.center) { 12402 maximum = this._items.length - 1; 12403 } else { 12404 maximum = this._items.length - settings.items; 12405 } 12406 12407 if (relative) { 12408 maximum -= this._clones.length / 2; 12409 } 12410 12411 return Math.max(maximum, 0); 12412 }; 12413 12414 /** 12415 * Gets the minimum position for the current item. 12416 * @public 12417 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position. 12418 * @returns {Number} 12419 */ 12420 Owl.prototype.minimum = function (relative) { 12421 return relative ? 0 : this._clones.length / 2; 12422 }; 12423 12424 /** 12425 * Gets an item at the specified relative position. 12426 * @public 12427 * @param {Number} [position] - The relative position of the item. 12428 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given. 12429 */ 12430 Owl.prototype.items = function (position) { 12431 if (position === undefined) { 12432 return this._items.slice(); 12433 } 12434 12435 position = this.normalize(position, true); 12436 return this._items[position]; 12437 }; 12438 12439 /** 12440 * Gets an item at the specified relative position. 12441 * @public 12442 * @param {Number} [position] - The relative position of the item. 12443 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given. 12444 */ 12445 Owl.prototype.mergers = function (position) { 12446 if (position === undefined) { 12447 return this._mergers.slice(); 12448 } 12449 12450 position = this.normalize(position, true); 12451 return this._mergers[position]; 12452 }; 12453 12454 /** 12455 * Gets the absolute positions of clones for an item. 12456 * @public 12457 * @param {Number} [position] - The relative position of the item. 12458 * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given. 12459 */ 12460 Owl.prototype.clones = function (position) { 12461 var odd = this._clones.length / 2, 12462 even = odd + this._items.length, 12463 map = function (index) { 12464 return index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2; 12465 }; 12466 12467 if (position === undefined) { 12468 return $.map(this._clones, function (v, i) { 12469 return map(i); 12470 }); 12471 } 12472 12473 return $.map(this._clones, function (v, i) { 12474 return v === position ? map(i) : null; 12475 }); 12476 }; 12477 12478 /** 12479 * Sets the current animation speed. 12480 * @public 12481 * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged. 12482 * @returns {Number} - The current animation speed in milliseconds. 12483 */ 12484 Owl.prototype.speed = function (speed) { 12485 if (speed !== undefined) { 12486 this._speed = speed; 12487 } 12488 12489 return this._speed; 12490 }; 12491 12492 /** 12493 * Gets the coordinate of an item. 12494 * @todo The name of this method is missleanding. 12495 * @public 12496 * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`. 12497 * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates. 12498 */ 12499 Owl.prototype.coordinates = function (position) { 12500 var multiplier = 1, 12501 newPosition = position - 1, 12502 coordinate; 12503 12504 if (position === undefined) { 12505 return $.map(this._coordinates, $.proxy(function (coordinate, index) { 12506 return this.coordinates(index); 12507 }, this)); 12508 } 12509 12510 if (this.settings.center) { 12511 if (this.settings.rtl) { 12512 multiplier = -1; 12513 newPosition = position + 1; 12514 } 12515 12516 coordinate = this._coordinates[position]; 12517 coordinate += (this.width() - coordinate + (this._coordinates[newPosition] || 0)) / 2 * multiplier; 12518 } else { 12519 coordinate = this._coordinates[newPosition] || 0; 12520 } 12521 12522 coordinate = Math.ceil(coordinate); 12523 12524 return coordinate; 12525 }; 12526 12527 /** 12528 * Calculates the speed for a translation. 12529 * @protected 12530 * @param {Number} from - The absolute position of the start item. 12531 * @param {Number} to - The absolute position of the target item. 12532 * @param {Number} [factor=undefined] - The time factor in milliseconds. 12533 * @returns {Number} - The time in milliseconds for the translation. 12534 */ 12535 Owl.prototype.duration = function (from, to, factor) { 12536 if (factor === 0) { 12537 return 0; 12538 } 12539 12540 return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs(factor || this.settings.smartSpeed); 12541 }; 12542 12543 /** 12544 * Slides to the specified item. 12545 * @public 12546 * @param {Number} position - The position of the item. 12547 * @param {Number} [speed] - The time in milliseconds for the transition. 12548 */ 12549 Owl.prototype.to = function (position, speed) { 12550 var current = this.current(), 12551 revert = null, 12552 distance = position - this.relative(current), 12553 direction = (distance > 0) - (distance < 0), 12554 items = this._items.length, 12555 minimum = this.minimum(), 12556 maximum = this.maximum(); 12557 12558 if (this.settings.loop) { 12559 if (!this.settings.rewind && Math.abs(distance) > items / 2) { 12560 distance += direction * -1 * items; 12561 } 12562 12563 position = current + distance; 12564 revert = ((position - minimum) % items + items) % items + minimum; 12565 12566 if (revert !== position && revert - distance <= maximum && revert - distance > 0) { 12567 current = revert - distance; 12568 position = revert; 12569 this.reset(current); 12570 } 12571 } else if (this.settings.rewind) { 12572 maximum += 1; 12573 position = (position % maximum + maximum) % maximum; 12574 } else { 12575 position = Math.max(minimum, Math.min(maximum, position)); 12576 } 12577 12578 this.speed(this.duration(current, position, speed)); 12579 this.current(position); 12580 12581 if (this.$element.is(':visible')) { 12582 this.update(); 12583 } 12584 }; 12585 12586 /** 12587 * Slides to the next item. 12588 * @public 12589 * @param {Number} [speed] - The time in milliseconds for the transition. 12590 */ 12591 Owl.prototype.next = function (speed) { 12592 speed = speed || false; 12593 this.to(this.relative(this.current()) + 1, speed); 12594 }; 12595 12596 /** 12597 * Slides to the previous item. 12598 * @public 12599 * @param {Number} [speed] - The time in milliseconds for the transition. 12600 */ 12601 Owl.prototype.prev = function (speed) { 12602 speed = speed || false; 12603 this.to(this.relative(this.current()) - 1, speed); 12604 }; 12605 12606 /** 12607 * Handles the end of an animation. 12608 * @protected 12609 * @param {Event} event - The event arguments. 12610 */ 12611 Owl.prototype.onTransitionEnd = function (event) { 12612 12613 // if css2 animation then event object is undefined 12614 if (event !== undefined) { 12615 event.stopPropagation(); 12616 12617 // Catch only owl-stage transitionEnd event 12618 if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) { 12619 return false;
vendor: 11,744 bytes, lines 12620-13006
12620 } 12621 } 12622 12623 this.leave('animating'); 12624 this.trigger('translated'); 12625 }; 12626 12627 /** 12628 * Gets viewport width. 12629 * @protected 12630 * @return {Number} - The width in pixel. 12631 */ 12632 Owl.prototype.viewport = function () { 12633 var width; 12634 if (this.options.responsiveBaseElement !== window) { 12635 width = $(this.options.responsiveBaseElement).width(); 12636 } else if (window.innerWidth) { 12637 width = window.innerWidth; 12638 } else if (document.documentElement && document.documentElement.clientWidth) { 12639 width = document.documentElement.clientWidth; 12640 } else { 12641 throw 'Can not detect viewport width.'; 12642 } 12643 return width; 12644 }; 12645 12646 /** 12647 * Replaces the current content. 12648 * @public 12649 * @param {HTMLElement|jQuery|String} content - The new content. 12650 */ 12651 Owl.prototype.replace = function (content) { 12652 this.$stage.empty(); 12653 this._items = []; 12654 12655 if (content) { 12656 content = content instanceof jQuery ? content : $(content); 12657 } 12658 12659 if (this.settings.nestedItemSelector) { 12660 content = content.find('.' + this.settings.nestedItemSelector); 12661 } 12662 12663 content.filter(function () { 12664 return this.nodeType === 1; 12665 }).each($.proxy(function (index, item) { 12666 item = this.prepare(item); 12667 this.$stage.append(item); 12668 this._items.push(item); 12669 this._mergers.push(item.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 12670 }, this)); 12671 12672 this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0); 12673 12674 this.invalidate('items'); 12675 }; 12676 12677 /** 12678 * Adds an item. 12679 * @todo Use `item` instead of `content` for the event arguments. 12680 * @public 12681 * @param {HTMLElement|jQuery|String} content - The item content to add. 12682 * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end. 12683 */ 12684 Owl.prototype.add = function (content, position) { 12685 var current = this.relative(this._current); 12686 12687 position = position === undefined ? this._items.length : this.normalize(position, true); 12688 content = content instanceof jQuery ? content : $(content); 12689 12690 this.trigger('add', { content: content, position: position }); 12691 12692 content = this.prepare(content); 12693 12694 if (this._items.length === 0 || position === this._items.length) { 12695 this._items.length === 0 && this.$stage.append(content); 12696 this._items.length !== 0 && this._items[position - 1].after(content); 12697 this._items.push(content); 12698 this._mergers.push(content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 12699 } else { 12700 this._items[position].before(content); 12701 this._items.splice(position, 0, content); 12702 this._mergers.splice(position, 0, content.find('[data-merge]').addBack('[data-merge]').attr('data-merge') * 1 || 1); 12703 } 12704 12705 this._items[current] && this.reset(this._items[current].index()); 12706 12707 this.invalidate('items'); 12708 12709 this.trigger('added', { content: content, position: position }); 12710 }; 12711 12712 /** 12713 * Removes an item by its position. 12714 * @todo Use `item` instead of `content` for the event arguments. 12715 * @public 12716 * @param {Number} position - The relative position of the item to remove. 12717 */ 12718 Owl.prototype.remove = function (position) { 12719 position = this.normalize(position, true); 12720 12721 if (position === undefined) { 12722 return; 12723 } 12724 12725 this.trigger('remove', { content: this._items[position], position: position }); 12726 12727 this._items[position].remove(); 12728 this._items.splice(position, 1); 12729 this._mergers.splice(position, 1); 12730 12731 this.invalidate('items'); 12732 12733 this.trigger('removed', { content: null, position: position }); 12734 }; 12735 12736 /** 12737 * Preloads images with auto width. 12738 * @todo Replace by a more generic approach 12739 * @protected 12740 */ 12741 Owl.prototype.preloadAutoWidthImages = function (images) { 12742 images.each($.proxy(function (i, element) { 12743 this.enter('pre-loading'); 12744 element = $(element); 12745 $(new Image()).one('load', $.proxy(function (e) { 12746 element.attr('src', e.target.src); 12747 element.css('opacity', 1); 12748 this.leave('pre-loading'); 12749 !this.is('pre-loading') && !this.is('initializing') && this.refresh(); 12750 }, this)).attr('src', element.attr('src') || element.attr('data-src') || element.attr('data-src-retina')); 12751 }, this)); 12752 }; 12753 12754 /** 12755 * Destroys the carousel. 12756 * @public 12757 */ 12758 Owl.prototype.destroy = function () { 12759 12760 this.$element.off('.owl.core'); 12761 this.$stage.off('.owl.core'); 12762 $(document).off('.owl.core'); 12763 12764 if (this.settings.responsive !== false) { 12765 window.clearTimeout(this.resizeTimer); 12766 this.off(window, 'resize', this._handlers.onThrottledResize); 12767 } 12768 12769 for (var i in this._plugins) { 12770 this._plugins[i].destroy(); 12771 } 12772 12773 this.$stage.children('.cloned').remove(); 12774 12775 this.$stage.unwrap(); 12776 this.$stage.children().contents().unwrap(); 12777 this.$stage.children().unwrap(); 12778 12779 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'); 12780 }; 12781 12782 /** 12783 * Operators to calculate right-to-left and left-to-right. 12784 * @protected 12785 * @param {Number} [a] - The left side operand. 12786 * @param {String} [o] - The operator. 12787 * @param {Number} [b] - The right side operand. 12788 */ 12789 Owl.prototype.op = function (a, o, b) { 12790 var rtl = this.settings.rtl; 12791 switch (o) { 12792 case '<': 12793 return rtl ? a > b : a < b; 12794 case '>': 12795 return rtl ? a < b : a > b; 12796 case '>=': 12797 return rtl ? a <= b : a >= b; 12798 case '<=': 12799 return rtl ? a >= b : a <= b; 12800 default: 12801 break; 12802 } 12803 }; 12804 12805 /** 12806 * Attaches to an internal event. 12807 * @protected 12808 * @param {HTMLElement} element - The event source. 12809 * @param {String} event - The event name. 12810 * @param {Function} listener - The event handler to attach. 12811 * @param {Boolean} capture - Wether the event should be handled at the capturing phase or not. 12812 */ 12813 Owl.prototype.on = function (element, event, listener, capture) { 12814 if (element.addEventListener) { 12815 element.addEventListener(event, listener, capture); 12816 } else if (element.attachEvent) { 12817 element.attachEvent('on' + event, listener); 12818 } 12819 }; 12820 12821 /** 12822 * Detaches from an internal event. 12823 * @protected 12824 * @param {HTMLElement} element - The event source. 12825 * @param {String} event - The event name. 12826 * @param {Function} listener - The attached event handler to detach. 12827 * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not. 12828 */ 12829 Owl.prototype.off = function (element, event, listener, capture) { 12830 if (element.removeEventListener) { 12831 element.removeEventListener(event, listener, capture); 12832 } else if (element.detachEvent) { 12833 element.detachEvent('on' + event, listener); 12834 } 12835 }; 12836 12837 /** 12838 * Triggers a public event. 12839 * @todo Remove `status`, `relatedTarget` should be used instead. 12840 * @protected 12841 * @param {String} name - The event name. 12842 * @param {*} [data=null] - The event data. 12843 * @param {String} [namespace=carousel] - The event namespace. 12844 * @param {String} [state] - The state which is associated with the event. 12845 * @param {Boolean} [enter=false] - Indicates if the call enters the specified state or not. 12846 * @returns {Event} - The event arguments. 12847 */ 12848 Owl.prototype.trigger = function (name, data, namespace, state, enter) { 12849 var status = { 12850 item: { count: this._items.length, index: this.current() } 12851 }, 12852 handler = $.camelCase($.grep(['on', name, namespace], function (v) { 12853 return v; 12854 }).join('-').toLowerCase()), 12855 event = $.Event([name, 'owl', namespace || 'carousel'].join('.').toLowerCase(), $.extend({ relatedTarget: this }, status, data)); 12856 12857 if (!this._supress[name]) { 12858 $.each(this._plugins, function (name, plugin) { 12859 if (plugin.onTrigger) { 12860 plugin.onTrigger(event); 12861 } 12862 }); 12863 12864 this.register({ type: Owl.Type.Event, name: name }); 12865 this.$element.trigger(event); 12866 12867 if (this.settings && typeof this.settings[handler] === 'function') { 12868 this.settings[handler].call(this, event); 12869 } 12870 } 12871 12872 return event; 12873 }; 12874 12875 /** 12876 * Enters a state. 12877 * @param name - The state name. 12878 */ 12879 Owl.prototype.enter = function (name) { 12880 $.each([name].concat(this._states.tags[name] || []), $.proxy(function (i, name) { 12881 if (this._states.current[name] === undefined) { 12882 this._states.current[name] = 0; 12883 } 12884 12885 this._states.current[name]++; 12886 }, this)); 12887 }; 12888 12889 /** 12890 * Leaves a state. 12891 * @param name - The state name. 12892 */ 12893 Owl.prototype.leave = function (name) { 12894 $.each([name].concat(this._states.tags[name] || []), $.proxy(function (i, name) { 12895 this._states.current[name]--; 12896 }, this)); 12897 }; 12898 12899 /** 12900 * Registers an event or state. 12901 * @public 12902 * @param {Object} object - The event or state to register. 12903 */ 12904 Owl.prototype.register = function (object) { 12905 if (object.type === Owl.Type.Event) { 12906 if (!$.event.special[object.name]) { 12907 $.event.special[object.name] = {}; 12908 } 12909 12910 if (!$.event.special[object.name].owl) { 12911 var _default = $.event.special[object.name]._default; 12912 $.event.special[object.name]._default = function (e) { 12913 if (_default && _default.apply && (!e.namespace || e.namespace.indexOf('owl') === -1)) { 12914 return _default.apply(this, arguments); 12915 } 12916 return e.namespace && e.namespace.indexOf('owl') > -1; 12917 }; 12918 $.event.special[object.name].owl = true; 12919 } 12920 } else if (object.type === Owl.Type.State) { 12921 if (!this._states.tags[object.name]) { 12922 this._states.tags[object.name] = object.tags; 12923 } else { 12924 this._states.tags[object.name] = this._states.tags[object.name].concat(object.tags); 12925 } 12926 12927 this._states.tags[object.name] = $.grep(this._states.tags[object.name], $.proxy(function (tag, i) { 12928 return $.inArray(tag, this._states.tags[object.name]) === i; 12929 }, this)); 12930 } 12931 }; 12932 12933 /** 12934 * Suppresses events. 12935 * @protected 12936 * @param {Array.<String>} events - The events to suppress. 12937 */ 12938 Owl.prototype.suppress = function (events) { 12939 $.each(events, $.proxy(function (index, event) { 12940 this._supress[event] = true; 12941 }, this)); 12942 }; 12943 12944 /** 12945 * Releases suppressed events. 12946 * @protected 12947 * @param {Array.<String>} events - The events to release. 12948 */ 12949 Owl.prototype.release = function (events) { 12950 $.each(events, $.proxy(function (index, event) { 12951 delete this._supress[event]; 12952 }, this)); 12953 }; 12954 12955 /** 12956 * Gets unified pointer coordinates from event. 12957 * @todo #261 12958 * @protected 12959 * @param {Event} - The `mousedown` or `touchstart` event. 12960 * @returns {Object} - Contains `x` and `y` coordinates of current pointer position. 12961 */ 12962 Owl.prototype.pointer = function (event) { 12963 var result = { x: null, y: null }; 12964 12965 event = event.originalEvent || event || window.event; 12966 12967 event = event.touches && event.touches.length ? event.touches[0] : event.changedTouches && event.changedTouches.length ? event.changedTouches[0] : event; 12968 12969 if (event.pageX) { 12970 result.x = event.pageX; 12971 result.y = event.pageY; 12972 } else { 12973 result.x = event.clientX; 12974 result.y = event.clientY; 12975 } 12976 12977 return result; 12978 }; 12979 12980 /** 12981 * Determines if the input is a Number or something that can be coerced to a Number 12982 * @protected 12983 * @param {Number|String|Object|Array|Boolean|RegExp|Function|Symbol} - The input to be tested 12984 * @returns {Boolean} - An indication if the input is a Number or can be coerced to a Number 12985 */ 12986 Owl.prototype.isNumeric = function (number) { 12987 return !isNaN(parseFloat(number)); 12988 }; 12989 12990 /** 12991 * Gets the difference of two vectors. 12992 * @todo #261 12993 * @protected 12994 * @param {Object} - The first vector. 12995 * @param {Object} - The second vector. 12996 * @returns {Object} - The difference. 12997 */ 12998 Owl.prototype.difference = function (first, second) { 12999 return { 13000 x: first.x - second.x, 13001 y: first.y - second.y 13002 }; 13003 }; 13004 13005 /** 13006 * The jQuery Plugin for the Owl Carousel
vendor: 34,247 bytes, lines 13007-14302
13007 * @todo Navigation plugin `next` and `prev` 13008 * @public 13009 */ 13010 $.fn.owlCarousel = function (option) { 13011 var args = Array.prototype.slice.call(arguments, 1); 13012 13013 return this.each(function () { 13014 var $this = $(this), 13015 data = $this.data('owl.carousel'); 13016 13017 if (!data) { 13018 data = new Owl(this, typeof option == 'object' && option); 13019 $this.data('owl.carousel', data); 13020 13021 $.each(['next', 'prev', 'to', 'destroy', 'refresh', 'replace', 'add', 'remove'], function (i, event) { 13022 data.register({ type: Owl.Type.Event, name: event }); 13023 data.$element.on(event + '.owl.carousel.core', $.proxy(function (e) { 13024 if (e.namespace && e.relatedTarget !== this) { 13025 this.suppress([event]); 13026 data[event].apply(this, [].slice.call(arguments, 1)); 13027 this.release([event]); 13028 } 13029 }, data)); 13030 }); 13031 } 13032 13033 if (typeof option == 'string' && option.charAt(0) !== '_') { 13034 data[option].apply(data, args); 13035 } 13036 }); 13037 }; 13038 13039 /** 13040 * The constructor for the jQuery Plugin 13041 * @public 13042 */ 13043 $.fn.owlCarousel.Constructor = Owl; 13044})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 13045 13046/** 13047 * AutoRefresh Plugin 13048 * @version 2.1.0 13049 * @author Artus Kolanowski 13050 * @author David Deutsch 13051 * @license The MIT License (MIT) 13052 */ 13053;(function ($, window, document, undefined) { 13054 13055 /** 13056 * Creates the auto refresh plugin. 13057 * @class The Auto Refresh Plugin 13058 * @param {Owl} carousel - The Owl Carousel 13059 */ 13060 var AutoRefresh = function (carousel) { 13061 /** 13062 * Reference to the core. 13063 * @protected 13064 * @type {Owl} 13065 */ 13066 this._core = carousel; 13067 13068 /** 13069 * Refresh interval. 13070 * @protected 13071 * @type {number} 13072 */ 13073 this._interval = null; 13074 13075 /** 13076 * Whether the element is currently visible or not. 13077 * @protected 13078 * @type {Boolean} 13079 */ 13080 this._visible = null; 13081 13082 /** 13083 * All event handlers. 13084 * @protected 13085 * @type {Object} 13086 */ 13087 this._handlers = { 13088 'initialized.owl.carousel': $.proxy(function (e) { 13089 if (e.namespace && this._core.settings.autoRefresh) { 13090 this.watch(); 13091 } 13092 }, this) 13093 }; 13094 13095 // set default options 13096 this._core.options = $.extend({}, AutoRefresh.Defaults, this._core.options); 13097 13098 // register event handlers 13099 this._core.$element.on(this._handlers); 13100 }; 13101 13102 /** 13103 * Default options. 13104 * @public 13105 */ 13106 AutoRefresh.Defaults = { 13107 autoRefresh: true, 13108 autoRefreshInterval: 500 13109 }; 13110 13111 /** 13112 * Watches the element. 13113 */ 13114 AutoRefresh.prototype.watch = function () { 13115 if (this._interval) { 13116 return; 13117 } 13118 13119 this._visible = this._core.$element.is(':visible'); 13120 this._interval = window.setInterval($.proxy(this.refresh, this), this._core.settings.autoRefreshInterval); 13121 }; 13122 13123 /** 13124 * Refreshes the element. 13125 */ 13126 AutoRefresh.prototype.refresh = function () { 13127 if (this._core.$element.is(':visible') === this._visible) { 13128 return; 13129 } 13130 13131 this._visible = !this._visible; 13132 13133 this._core.$element.toggleClass('owl-hidden', !this._visible); 13134 13135 this._visible && this._core.invalidate('width') && this._core.refresh(); 13136 }; 13137 13138 /** 13139 * Destroys the plugin. 13140 */ 13141 AutoRefresh.prototype.destroy = function () { 13142 var handler, property; 13143 13144 window.clearInterval(this._interval); 13145 13146 for (handler in this._handlers) { 13147 this._core.$element.off(handler, this._handlers[handler]); 13148 } 13149 for (property in Object.getOwnPropertyNames(this)) { 13150 typeof this[property] != 'function' && (this[property] = null); 13151 } 13152 }; 13153 13154 $.fn.owlCarousel.Constructor.Plugins.AutoRefresh = AutoRefresh; 13155})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 13156 13157/** 13158 * Lazy Plugin 13159 * @version 2.1.0 13160 * @author Bartosz Wojciechowski 13161 * @author David Deutsch 13162 * @license The MIT License (MIT) 13163 */ 13164;(function ($, window, document, undefined) { 13165 13166 /** 13167 * Creates the lazy plugin. 13168 * @class The Lazy Plugin 13169 * @param {Owl} carousel - The Owl Carousel 13170 */ 13171 var Lazy = function (carousel) { 13172 13173 /** 13174 * Reference to the core. 13175 * @protected 13176 * @type {Owl} 13177 */ 13178 this._core = carousel; 13179 13180 /** 13181 * Already loaded items. 13182 * @protected 13183 * @type {Array.<jQuery>} 13184 */ 13185 this._loaded = []; 13186 13187 /** 13188 * Event handlers. 13189 * @protected 13190 * @type {Object} 13191 */ 13192 this._handlers = { 13193 'initialized.owl.carousel change.owl.carousel resized.owl.carousel': $.proxy(function (e) { 13194 if (!e.namespace) { 13195 return; 13196 } 13197 13198 if (!this._core.settings || !this._core.settings.lazyLoad) { 13199 return; 13200 } 13201 13202 if (e.property && e.property.name == 'position' || e.type == 'initialized') { 13203 var settings = this._core.settings, 13204 n = settings.center && Math.ceil(settings.items / 2) || settings.items, 13205 i = settings.center && n * -1 || 0, 13206 position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i, 13207 clones = this._core.clones().length, 13208 load = $.proxy(function (i, v) { 13209 this.load(v); 13210 }, this); 13211 13212 while (i++ < n) { 13213 this.load(clones / 2 + this._core.relative(position)); 13214 clones && $.each(this._core.clones(this._core.relative(position)), load); 13215 position++; 13216 } 13217 } 13218 }, this) 13219 }; 13220 13221 // set the default options 13222 this._core.options = $.extend({}, Lazy.Defaults, this._core.options); 13223 13224 // register event handler 13225 this._core.$element.on(this._handlers); 13226 }; 13227 13228 /** 13229 * Default options. 13230 * @public 13231 */ 13232 Lazy.Defaults = { 13233 lazyLoad: false 13234 }; 13235 13236 /** 13237 * Loads all resources of an item at the specified position. 13238 * @param {Number} position - The absolute position of the item. 13239 * @protected 13240 */ 13241 Lazy.prototype.load = function (position) { 13242 var $item = this._core.$stage.children().eq(position), 13243 $elements = $item && $item.find('.owl-lazy'); 13244 13245 if (!$elements || $.inArray($item.get(0), this._loaded) > -1) { 13246 return; 13247 } 13248 13249 $elements.each($.proxy(function (index, element) { 13250 var $element = $(element), 13251 image, 13252 url = window.devicePixelRatio > 1 && $element.attr('data-src-retina') || $element.attr('data-src'); 13253 13254 this._core.trigger('load', { element: $element, url: url }, 'lazy'); 13255 13256 if ($element.is('img')) { 13257 $element.one('load.owl.lazy', $.proxy(function () { 13258 $element.css('opacity', 1); 13259 this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 13260 }, this)).attr('src', url); 13261 } else { 13262 image = new Image(); 13263 image.onload = $.proxy(function () { 13264 $element.css({ 13265 'background-image': 'url(' + url + ')', 13266 'opacity': '1' 13267 }); 13268 this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 13269 }, this); 13270 image.src = url; 13271 } 13272 }, this)); 13273 13274 this._loaded.push($item.get(0)); 13275 }; 13276 13277 /** 13278 * Destroys the plugin. 13279 * @public 13280 */ 13281 Lazy.prototype.destroy = function () { 13282 var handler, property; 13283 13284 for (handler in this.handlers) { 13285 this._core.$element.off(handler, this.handlers[handler]); 13286 } 13287 for (property in Object.getOwnPropertyNames(this)) { 13288 typeof this[property] != 'function' && (this[property] = null); 13289 } 13290 }; 13291 13292 $.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy; 13293})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 13294 13295/** 13296 * AutoHeight Plugin 13297 * @version 2.1.0 13298 * @author Bartosz Wojciechowski 13299 * @author David Deutsch 13300 * @license The MIT License (MIT) 13301 */ 13302;(function ($, window, document, undefined) { 13303 13304 /** 13305 * Creates the auto height plugin. 13306 * @class The Auto Height Plugin 13307 * @param {Owl} carousel - The Owl Carousel 13308 */ 13309 var AutoHeight = function (carousel) { 13310 /** 13311 * Reference to the core. 13312 * @protected 13313 * @type {Owl} 13314 */ 13315 this._core = carousel; 13316 13317 /** 13318 * All event handlers. 13319 * @protected 13320 * @type {Object} 13321 */ 13322 this._handlers = { 13323 'initialized.owl.carousel refreshed.owl.carousel': $.proxy(function (e) { 13324 if (e.namespace && this._core.settings.autoHeight) { 13325 this.update(); 13326 } 13327 }, this), 13328 'changed.owl.carousel': $.proxy(function (e) { 13329 if (e.namespace && this._core.settings.autoHeight && e.property.name == 'position') { 13330 this.update(); 13331 } 13332 }, this), 13333 'loaded.owl.lazy': $.proxy(function (e) { 13334 if (e.namespace && this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass).index() === this._core.current()) { 13335 this.update(); 13336 } 13337 }, this) 13338 }; 13339 13340 // set default options 13341 this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options); 13342 13343 // register event handlers 13344 this._core.$element.on(this._handlers); 13345 }; 13346 13347 /** 13348 * Default options. 13349 * @public 13350 */ 13351 AutoHeight.Defaults = { 13352 autoHeight: false, 13353 autoHeightClass: 'owl-height' 13354 }; 13355 13356 /** 13357 * Updates the view. 13358 */ 13359 AutoHeight.prototype.update = function () { 13360 var start = this._core._current, 13361 end = start + this._core.settings.items, 13362 visible = this._core.$stage.children().toArray().slice(start, end), 13363 heights = [], 13364 maxheight = 0; 13365 13366 $.each(visible, function (index, item) { 13367 heights.push($(item).height()); 13368 }); 13369 13370 maxheight = Math.max.apply(null, heights); 13371 13372 this._core.$stage.parent().height(maxheight).addClass(this._core.settings.autoHeightClass); 13373 }; 13374 13375 AutoHeight.prototype.destroy = function () { 13376 var handler, property; 13377 13378 for (handler in this._handlers) { 13379 this._core.$element.off(handler, this._handlers[handler]); 13380 } 13381 for (property in Object.getOwnPropertyNames(this)) { 13382 typeof this[property] != 'function' && (this[property] = null); 13383 } 13384 }; 13385 13386 $.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight; 13387})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 13388 13389/** 13390 * Video Plugin 13391 * @version 2.1.0 13392 * @author Bartosz Wojciechowski 13393 * @author David Deutsch 13394 * @license The MIT License (MIT) 13395 */ 13396;(function ($, window, document, undefined) { 13397 13398 /** 13399 * Creates the video plugin. 13400 * @class The Video Plugin 13401 * @param {Owl} carousel - The Owl Carousel 13402 */ 13403 var Video = function (carousel) { 13404 /** 13405 * Reference to the core. 13406 * @protected 13407 * @type {Owl} 13408 */ 13409 this._core = carousel; 13410 13411 /** 13412 * Cache all video URLs. 13413 * @protected 13414 * @type {Object} 13415 */ 13416 this._videos = {}; 13417 13418 /** 13419 * Current playing item. 13420 * @protected 13421 * @type {jQuery} 13422 */ 13423 this._playing = null; 13424 13425 /** 13426 * All event handlers. 13427 * @todo The cloned content removale is too late 13428 * @protected 13429 * @type {Object} 13430 */ 13431 this._handlers = { 13432 'initialized.owl.carousel': $.proxy(function (e) { 13433 if (e.namespace) { 13434 this._core.register({ type: 'state', name: 'playing', tags: ['interacting'] }); 13435 } 13436 }, this), 13437 'resize.owl.carousel': $.proxy(function (e) { 13438 if (e.namespace && this._core.settings.video && this.isInFullScreen()) { 13439 e.preventDefault(); 13440 } 13441 }, this), 13442 'refreshed.owl.carousel': $.proxy(function (e) { 13443 if (e.namespace && this._core.is('resizing')) { 13444 this._core.$stage.find('.cloned .owl-video-frame').remove(); 13445 } 13446 }, this), 13447 'changed.owl.carousel': $.proxy(function (e) { 13448 if (e.namespace && e.property.name === 'position' && this._playing) { 13449 this.stop(); 13450 } 13451 }, this), 13452 'prepared.owl.carousel': $.proxy(function (e) { 13453 if (!e.namespace) { 13454 return; 13455 } 13456 13457 var $element = $(e.content).find('.owl-video'); 13458 13459 if ($element.length) { 13460 $element.css('display', 'none'); 13461 this.fetch($element, $(e.content)); 13462 } 13463 }, this) 13464 }; 13465 13466 // set default options 13467 this._core.options = $.extend({}, Video.Defaults, this._core.options); 13468 13469 // register event handlers 13470 this._core.$element.on(this._handlers); 13471 13472 this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function (e) { 13473 this.play(e); 13474 }, this)); 13475 }; 13476 13477 /** 13478 * Default options. 13479 * @public 13480 */ 13481 Video.Defaults = { 13482 video: false, 13483 videoHeight: false, 13484 videoWidth: false 13485 }; 13486 13487 /** 13488 * Gets the video ID and the type (YouTube/Vimeo/vzaar only). 13489 * @protected 13490 * @param {jQuery} target - The target containing the video data. 13491 * @param {jQuery} item - The item containing the video. 13492 */ 13493 Video.prototype.fetch = function (target, item) { 13494 var type = function () { 13495 if (target.attr('data-vimeo-id')) { 13496 return 'vimeo'; 13497 } else if (target.attr('data-vzaar-id')) { 13498 return 'vzaar'; 13499 } else { 13500 return 'youtube'; 13501 } 13502 }(), 13503 id = target.attr('data-vimeo-id') || target.attr('data-youtube-id') || target.attr('data-vzaar-id'), 13504 width = target.attr('data-width') || this._core.settings.videoWidth, 13505 height = target.attr('data-height') || this._core.settings.videoHeight, 13506 url = target.attr('href'); 13507 13508 if (url) { 13509 13510 /* 13511 Parses the id's out of the following urls (and probably more): 13512 https://www.youtube.com/watch?v=:id 13513 https://youtu.be/:id 13514 https://vimeo.com/:id 13515 https://vimeo.com/channels/:channel/:id 13516 https://vimeo.com/groups/:group/videos/:id 13517 https://app.vzaar.com/videos/:id 13518 Visual example: https://regexper.com/#(http%3A%7Chttps%3A%7C)%5C%2F%5C%2F(player.%7Cwww.%7Capp.)%3F(vimeo%5C.com%7Cyoutu(be%5C.com%7C%5C.be%7Cbe%5C.googleapis%5C.com)%7Cvzaar%5C.com)%5C%2F(video%5C%2F%7Cvideos%5C%2F%7Cembed%5C%2F%7Cchannels%5C%2F.%2B%5C%2F%7Cgroups%5C%2F.%2B%5C%2F%7Cwatch%5C%3Fv%3D%7Cv%5C%2F)%3F(%5BA-Za-z0-9._%25-%5D*)(%5C%26%5CS%2B)%3F 13519 */ 13520 13521 id = url.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); 13522 13523 if (id[3].indexOf('youtu') > -1) { 13524 type = 'youtube'; 13525 } else if (id[3].indexOf('vimeo') > -1) { 13526 type = 'vimeo'; 13527 } else if (id[3].indexOf('vzaar') > -1) { 13528 type = 'vzaar'; 13529 } else { 13530 throw new Error('Video URL not supported.'); 13531 } 13532 id = id[6]; 13533 } else { 13534 throw new Error('Missing video URL.'); 13535 } 13536 13537 this._videos[url] = { 13538 type: type, 13539 id: id, 13540 width: width, 13541 height: height 13542 }; 13543 13544 item.attr('data-video', url); 13545 13546 this.thumbnail(target, this._videos[url]); 13547 }; 13548 13549 /** 13550 * Creates video thumbnail. 13551 * @protected 13552 * @param {jQuery} target - The target containing the video data. 13553 * @param {Object} info - The video info object. 13554 * @see `fetch` 13555 */ 13556 Video.prototype.thumbnail = function (target, video) { 13557 var tnLink, 13558 icon, 13559 path, 13560 dimensions = video.width && video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"' : '', 13561 customTn = target.find('img'), 13562 srcType = 'src', 13563 lazyClass = '', 13564 settings = this._core.settings, 13565 create = function (path) { 13566 icon = '<div class="owl-video-play-icon"></div>'; 13567 13568 if (settings.lazyLoad) { 13569 tnLink = '<div class="owl-video-tn ' + lazyClass + '" ' + srcType + '="' + path + '"></div>'; 13570 } else { 13571 tnLink = '<div class="owl-video-tn" style="opacity:1;background-image:url(' + path + ')"></div>'; 13572 } 13573 target.after(tnLink); 13574 target.after(icon); 13575 }; 13576 13577 // wrap video content into owl-video-wrapper div 13578 target.wrap('<div class="owl-video-wrapper"' + dimensions + '></div>'); 13579 13580 if (this._core.settings.lazyLoad) { 13581 srcType = 'data-src'; 13582 lazyClass = 'owl-lazy'; 13583 } 13584 13585 // custom thumbnail 13586 if (customTn.length) { 13587 create(customTn.attr(srcType)); 13588 customTn.remove(); 13589 return false; 13590 } 13591 13592 if (video.type === 'youtube') { 13593 path = "//img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; 13594 create(path); 13595 } else if (video.type === 'vimeo') { 13596 $.ajax({ 13597 type: 'GET', 13598 url: '//vimeo.com/api/v2/video/' + video.id + '.json', 13599 jsonp: 'callback', 13600 dataType: 'jsonp', 13601 success: function (data) { 13602 path = data[0].thumbnail_large; 13603 create(path); 13604 } 13605 }); 13606 } else if (video.type === 'vzaar') { 13607 $.ajax({ 13608 type: 'GET', 13609 url: '//vzaar.com/api/videos/' + video.id + '.json', 13610 jsonp: 'callback', 13611 dataType: 'jsonp', 13612 success: function (data) { 13613 path = data.framegrab_url; 13614 create(path); 13615 } 13616 }); 13617 } 13618 }; 13619 13620 /** 13621 * Stops the current video. 13622 * @public 13623 */ 13624 Video.prototype.stop = function () { 13625 this._core.trigger('stop', null, 'video'); 13626 this._playing.find('.owl-video-frame').remove(); 13627 this._playing.removeClass('owl-video-playing'); 13628 this._playing = null; 13629 this._core.leave('playing'); 13630 this._core.trigger('stopped', null, 'video'); 13631 }; 13632 13633 /** 13634 * Starts the current video. 13635 * @public 13636 * @param {Event} event - The event arguments. 13637 */ 13638 Video.prototype.play = function (event) { 13639 var target = $(event.target), 13640 item = target.closest('.' + this._core.settings.itemClass), 13641 video = this._videos[item.attr('data-video')], 13642 width = video.width || '100%', 13643 height = video.height || this._core.$stage.height(), 13644 html; 13645 13646 if (this._playing) { 13647 return; 13648 } 13649 13650 this._core.enter('playing'); 13651 this._core.trigger('play', null, 'video'); 13652 13653 item = this._core.items(this._core.relative(item.index())); 13654 13655 this._core.reset(item.index()); 13656 13657 if (video.type === 'youtube') { 13658 html = '<iframe width="' + width + '" height="' + height + '" src="//www.youtube.com/embed/' + video.id + '?autoplay=1&v=' + video.id + '" frameborder="0" allowfullscreen></iframe>'; 13659 } else if (video.type === 'vimeo') { 13660 html = '<iframe src="//player.vimeo.com/video/' + video.id + '?autoplay=1" width="' + width + '" height="' + height + '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'; 13661 } else if (video.type === 'vzaar') { 13662 html = '<iframe frameborder="0"' + 'height="' + height + '"' + 'width="' + width + '" allowfullscreen mozallowfullscreen webkitAllowFullScreen ' + 'src="//view.vzaar.com/' + video.id + '/player?autoplay=true"></iframe>'; 13663 } 13664 13665 $('<div class="owl-video-frame">' + html + '</div>').insertAfter(item.find('.owl-video')); 13666 13667 this._playing = item.addClass('owl-video-playing'); 13668 }; 13669 13670 /** 13671 * Checks whether an video is currently in full screen mode or not. 13672 * @todo Bad style because looks like a readonly method but changes members. 13673 * @protected 13674 * @returns {Boolean} 13675 */ 13676 Video.prototype.isInFullScreen = function () { 13677 var element = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; 13678 13679 return element && $(element).parent().hasClass('owl-video-frame'); 13680 }; 13681 13682 /** 13683 * Destroys the plugin. 13684 */ 13685 Video.prototype.destroy = function () { 13686 var handler, property; 13687 13688 this._core.$element.off('click.owl.video'); 13689 13690 for (handler in this._handlers) { 13691 this._core.$element.off(handler, this._handlers[handler]); 13692 } 13693 for (property in Object.getOwnPropertyNames(this)) { 13694 typeof this[property] != 'function' && (this[property] = null); 13695 } 13696 }; 13697 13698 $.fn.owlCarousel.Constructor.Plugins.Video = Video; 13699})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 13700 13701/** 13702 * Animate Plugin 13703 * @version 2.1.0 13704 * @author Bartosz Wojciechowski 13705 * @author David Deutsch 13706 * @license The MIT License (MIT) 13707 */ 13708;(function ($, window, document, undefined) { 13709 13710 /** 13711 * Creates the animate plugin. 13712 * @class The Navigation Plugin 13713 * @param {Owl} scope - The Owl Carousel 13714 */ 13715 var Animate = function (scope) { 13716 this.core = scope; 13717 this.core.options = $.extend({}, Animate.Defaults, this.core.options); 13718 this.swapping = true; 13719 this.previous = undefined; 13720 this.next = undefined; 13721 13722 this.handlers = { 13723 'change.owl.carousel': $.proxy(function (e) { 13724 if (e.namespace && e.property.name == 'position') { 13725 this.previous = this.core.current(); 13726 this.next = e.property.value; 13727 } 13728 }, this), 13729 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function (e) { 13730 if (e.namespace) { 13731 this.swapping = e.type == 'translated'; 13732 } 13733 }, this), 13734 'translate.owl.carousel': $.proxy(function (e) { 13735 if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) { 13736 this.swap(); 13737 } 13738 }, this) 13739 }; 13740 13741 this.core.$element.on(this.handlers); 13742 }; 13743 13744 /** 13745 * Default options. 13746 * @public 13747 */ 13748 Animate.Defaults = { 13749 animateOut: false, 13750 animateIn: false 13751 }; 13752 13753 /** 13754 * Toggles the animation classes whenever an translations starts. 13755 * @protected 13756 * @returns {Boolean|undefined} 13757 */ 13758 Animate.prototype.swap = function () { 13759 13760 if (this.core.settings.items !== 1) { 13761 return; 13762 } 13763 13764 if (!$.support.animation || !$.support.transition) { 13765 return; 13766 } 13767 13768 this.core.speed(0); 13769 13770 var left, 13771 clear = $.proxy(this.clear, this), 13772 previous = this.core.$stage.children().eq(this.previous), 13773 next = this.core.$stage.children().eq(this.next), 13774 incoming = this.core.settings.animateIn, 13775 outgoing = this.core.settings.animateOut; 13776 13777 if (this.core.current() === this.previous) { 13778 return; 13779 } 13780 13781 if (outgoing) { 13782 left = this.core.coordinates(this.previous) - this.core.coordinates(this.next); 13783 previous.one($.support.animation.end, clear).css({ 'left': left + 'px' }).addClass('animated owl-animated-out').addClass(outgoing); 13784 } 13785 13786 if (incoming) { 13787 next.one($.support.animation.end, clear).addClass('animated owl-animated-in').addClass(incoming); 13788 } 13789 }; 13790 13791 Animate.prototype.clear = function (e) { 13792 $(e.target).css({ 'left': '' }).removeClass('animated owl-animated-out owl-animated-in').removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut); 13793 this.core.onTransitionEnd(); 13794 }; 13795 13796 /** 13797 * Destroys the plugin. 13798 * @public 13799 */ 13800 Animate.prototype.destroy = function () { 13801 var handler, property; 13802 13803 for (handler in this.handlers) { 13804 this.core.$element.off(handler, this.handlers[handler]); 13805 } 13806 for (property in Object.getOwnPropertyNames(this)) { 13807 typeof this[property] != 'function' && (this[property] = null); 13808 } 13809 }; 13810 13811 $.fn.owlCarousel.Constructor.Plugins.Animate = Animate; 13812})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 13813 13814/** 13815 * Autoplay Plugin 13816 * @version 2.1.0 13817 * @author Bartosz Wojciechowski 13818 * @author Artus Kolanowski 13819 * @author David Deutsch 13820 * @license The MIT License (MIT) 13821 */ 13822;(function ($, window, document, undefined) { 13823 13824 /** 13825 * Creates the autoplay plugin. 13826 * @class The Autoplay Plugin 13827 * @param {Owl} scope - The Owl Carousel 13828 */ 13829 var Autoplay = function (carousel) { 13830 /** 13831 * Reference to the core. 13832 * @protected 13833 * @type {Owl} 13834 */ 13835 this._core = carousel; 13836 13837 /** 13838 * The autoplay timeout. 13839 * @type {Timeout} 13840 */ 13841 this._timeout = null; 13842 13843 /** 13844 * Indicates whenever the autoplay is paused. 13845 * @type {Boolean} 13846 */ 13847 this._paused = false; 13848 13849 /** 13850 * All event handlers. 13851 * @protected 13852 * @type {Object} 13853 */ 13854 this._handlers = { 13855 'changed.owl.carousel': $.proxy(function (e) { 13856 if (e.namespace && e.property.name === 'settings') { 13857 if (this._core.settings.autoplay) { 13858 this.play(); 13859 } else { 13860 this.stop(); 13861 } 13862 } else if (e.namespace && e.property.name === 'position') { 13863 //console.log('play?', e); 13864 if (this._core.settings.autoplay) { 13865 this._setAutoPlayInterval(); 13866 } 13867 } 13868 }, this), 13869 'initialized.owl.carousel': $.proxy(function (e) { 13870 if (e.namespace && this._core.settings.autoplay) { 13871 this.play(); 13872 } 13873 }, this), 13874 'play.owl.autoplay': $.proxy(function (e, t, s) { 13875 if (e.namespace) { 13876 this.play(t, s); 13877 } 13878 }, this), 13879 'stop.owl.autoplay': $.proxy(function (e) { 13880 if (e.namespace) { 13881 this.stop(); 13882 } 13883 }, this), 13884 'mouseover.owl.autoplay': $.proxy(function () { 13885 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 13886 this.pause(); 13887 } 13888 }, this), 13889 'mouseleave.owl.autoplay': $.proxy(function () { 13890 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 13891 this.play(); 13892 } 13893 }, this), 13894 'touchstart.owl.core': $.proxy(function () { 13895 if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { 13896 this.pause(); 13897 } 13898 }, this), 13899 'touchend.owl.core': $.proxy(function () { 13900 if (this._core.settings.autoplayHoverPause) { 13901 this.play(); 13902 } 13903 }, this) 13904 }; 13905 13906 // register event handlers 13907 this._core.$element.on(this._handlers); 13908 13909 // set default options 13910 this._core.options = $.extend({}, Autoplay.Defaults, this._core.options); 13911 }; 13912 13913 /** 13914 * Default options. 13915 * @public 13916 */ 13917 Autoplay.Defaults = { 13918 autoplay: false, 13919 autoplayTimeout: 5000, 13920 autoplayHoverPause: false, 13921 autoplaySpeed: false 13922 }; 13923 13924 /** 13925 * Starts the autoplay. 13926 * @public 13927 * @param {Number} [timeout] - The interval before the next animation starts. 13928 * @param {Number} [speed] - The animation speed for the animations. 13929 */ 13930 Autoplay.prototype.play = function (timeout, speed) { 13931 this._paused = false; 13932 13933 if (this._core.is('rotating')) { 13934 return; 13935 } 13936 13937 this._core.enter('rotating'); 13938 13939 this._setAutoPlayInterval(); 13940 }; 13941 13942 /** 13943 * Gets a new timeout 13944 * @private 13945 * @param {Number} [timeout] - The interval before the next animation starts. 13946 * @param {Number} [speed] - The animation speed for the animations. 13947 * @return {Timeout} 13948 */ 13949 Autoplay.prototype._getNextTimeout = function (timeout, speed) { 13950 if (this._timeout) { 13951 window.clearTimeout(this._timeout); 13952 } 13953 return window.setTimeout($.proxy(function () { 13954 if (this._paused || this._core.is('busy') || this._core.is('interacting') || document.hidden) { 13955 return; 13956 } 13957 this._core.next(speed || this._core.settings.autoplaySpeed); 13958 }, this), timeout || this._core.settings.autoplayTimeout); 13959 }; 13960 13961 /** 13962 * Sets autoplay in motion. 13963 * @private 13964 */ 13965 Autoplay.prototype._setAutoPlayInterval = function () { 13966 this._timeout = this._getNextTimeout(); 13967 }; 13968 13969 /** 13970 * Stops the autoplay. 13971 * @public 13972 */ 13973 Autoplay.prototype.stop = function () { 13974 if (!this._core.is('rotating')) { 13975 return; 13976 } 13977 13978 window.clearTimeout(this._timeout); 13979 this._core.leave('rotating'); 13980 }; 13981 13982 /** 13983 * Stops the autoplay. 13984 * @public 13985 */ 13986 Autoplay.prototype.pause = function () { 13987 if (!this._core.is('rotating')) { 13988 return; 13989 } 13990 13991 this._paused = true; 13992 }; 13993 13994 /** 13995 * Destroys the plugin. 13996 */ 13997 Autoplay.prototype.destroy = function () { 13998 var handler, property; 13999 14000 this.stop(); 14001 14002 for (handler in this._handlers) { 14003 this._core.$element.off(handler, this._handlers[handler]); 14004 } 14005 for (property in Object.getOwnPropertyNames(this)) { 14006 typeof this[property] != 'function' && (this[property] = null); 14007 } 14008 }; 14009 14010 $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay; 14011})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 14012 14013/** 14014 * Navigation Plugin 14015 * @version 2.1.0 14016 * @author Artus Kolanowski 14017 * @author David Deutsch 14018 * @license The MIT License (MIT) 14019 */ 14020;(function ($, window, document, undefined) { 14021 'use strict'; 14022 14023 /** 14024 * Creates the navigation plugin. 14025 * @class The Navigation Plugin 14026 * @param {Owl} carousel - The Owl Carousel. 14027 */ 14028 14029 var Navigation = function (carousel) { 14030 /** 14031 * Reference to the core. 14032 * @protected 14033 * @type {Owl} 14034 */ 14035 this._core = carousel; 14036 14037 /** 14038 * Indicates whether the plugin is initialized or not. 14039 * @protected 14040 * @type {Boolean} 14041 */ 14042 this._initialized = false; 14043 14044 /** 14045 * The current paging indexes. 14046 * @protected 14047 * @type {Array} 14048 */ 14049 this._pages = []; 14050 14051 /** 14052 * All DOM elements of the user interface. 14053 * @protected 14054 * @type {Object} 14055 */ 14056 this._controls = {}; 14057 14058 /** 14059 * Markup for an indicator. 14060 * @protected 14061 * @type {Array.<String>} 14062 */ 14063 this._templates = []; 14064 14065 /** 14066 * The carousel element. 14067 * @type {jQuery} 14068 */ 14069 this.$element = this._core.$element; 14070 14071 /** 14072 * Overridden methods of the carousel. 14073 * @protected 14074 * @type {Object} 14075 */ 14076 this._overrides = { 14077 next: this._core.next, 14078 prev: this._core.prev, 14079 to: this._core.to 14080 }; 14081 14082 /** 14083 * All event handlers. 14084 * @protected 14085 * @type {Object} 14086 */ 14087 this._handlers = { 14088 'prepared.owl.carousel': $.proxy(function (e) { 14089 if (e.namespace && this._core.settings.dotsData) { 14090 this._templates.push('<div class="' + this._core.settings.dotClass + '">' + $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '</div>'); 14091 } 14092 }, this), 14093 'added.owl.carousel': $.proxy(function (e) { 14094 if (e.namespace && this._core.settings.dotsData) { 14095 this._templates.splice(e.position, 0, this._templates.pop()); 14096 } 14097 }, this), 14098 'remove.owl.carousel': $.proxy(function (e) { 14099 if (e.namespace && this._core.settings.dotsData) { 14100 this._templates.splice(e.position, 1); 14101 } 14102 }, this), 14103 'changed.owl.carousel': $.proxy(function (e) { 14104 if (e.namespace && e.property.name == 'position') { 14105 this.draw(); 14106 } 14107 }, this), 14108 'initialized.owl.carousel': $.proxy(function (e) { 14109 if (e.namespace && !this._initialized) { 14110 this._core.trigger('initialize', null, 'navigation'); 14111 this.initialize(); 14112 this.update(); 14113 this.draw(); 14114 this._initialized = true; 14115 this._core.trigger('initialized', null, 'navigation'); 14116 } 14117 }, this), 14118 'refreshed.owl.carousel': $.proxy(function (e) { 14119 if (e.namespace && this._initialized) { 14120 this._core.trigger('refresh', null, 'navigation'); 14121 this.update(); 14122 this.draw(); 14123 this._core.trigger('refreshed', null, 'navigation'); 14124 } 14125 }, this) 14126 }; 14127 14128 // set default options 14129 this._core.options = $.extend({}, Navigation.Defaults, this._core.options); 14130 14131 // register event handlers 14132 this.$element.on(this._handlers); 14133 }; 14134 14135 /** 14136 * Default options. 14137 * @public 14138 * @todo Rename `slideBy` to `navBy` 14139 */ 14140 Navigation.Defaults = { 14141 nav: false, 14142 navText: ['<i class="icon-arrow-left"></i>', '<i class="icon-arrow-right"></i>'], 14143 navSpeed: false, 14144 navElement: 'div', 14145 navContainer: false, 14146 navContainerClass: 'owl-nav', 14147 navClass: ['owl-prev', 'owl-next'], 14148 slideBy: 1, 14149 dotClass: 'owl-dot', 14150 dotsClass: 'owl-dots', 14151 dots: true, 14152 dotsEach: false, 14153 dotsData: false, 14154 dotsSpeed: false, 14155 dotsContainer: false 14156 }; 14157 14158 /** 14159 * Initializes the layout of the plugin and extends the carousel. 14160 * @protected 14161 */ 14162 Navigation.prototype.initialize = function () { 14163 var override, 14164 settings = this._core.settings; 14165 14166 // create DOM structure for relative navigation 14167 this._controls.$relative = (settings.navContainer ? $(settings.navContainer) : $('<div>').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); 14168 14169 this._controls.$previous = $('<' + settings.navElement + '>').addClass(settings.navClass[0]).html(settings.navText[0]).prependTo(this._controls.$relative).on('click', $.proxy(function (e) { 14170 this.prev(settings.navSpeed); 14171 }, this)); 14172 this._controls.$next = $('<' + settings.navElement + '>').addClass(settings.navClass[1]).html(settings.navText[1]).appendTo(this._controls.$relative).on('click', $.proxy(function (e) { 14173 this.next(settings.navSpeed); 14174 }, this)); 14175 14176 // create DOM structure for absolute navigation 14177 if (!settings.dotsData) { 14178 this._templates = [$('<div>').addClass(settings.dotClass).append($('<span>')).prop('outerHTML')]; 14179 } 14180 14181 this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer) : $('<div>').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled'); 14182 14183 this._controls.$absolute.on('click', 'div', $.proxy(function (e) { 14184 var index = $(e.target).parent().is(this._controls.$absolute) ? $(e.target).index() : $(e.target).parent().index(); 14185 14186 e.preventDefault(); 14187 14188 this.to(index, settings.dotsSpeed); 14189 }, this)); 14190 14191 // override public methods of the carousel 14192 for (override in this._overrides) { 14193 this._core[override] = $.proxy(this[override], this); 14194 } 14195 }; 14196 14197 /** 14198 * Destroys the plugin. 14199 * @protected 14200 */ 14201 Navigation.prototype.destroy = function () { 14202 var handler, control, property, override; 14203 14204 for (handler in this._handlers) { 14205 this.$element.off(handler, this._handlers[handler]); 14206 } 14207 for (control in this._controls) { 14208 this._controls[control].remove(); 14209 } 14210 for (override in this.overides) { 14211 this._core[override] = this._overrides[override]; 14212 } 14213 for (property in Object.getOwnPropertyNames(this)) { 14214 typeof this[property] != 'function' && (this[property] = null); 14215 } 14216 }; 14217 14218 /** 14219 * Updates the internal state. 14220 * @protected 14221 */ 14222 Navigation.prototype.update = function () { 14223 var i, 14224 j, 14225 k, 14226 lower = this._core.clones().length / 2, 14227 upper = lower + this._core.items().length, 14228 maximum = this._core.maximum(true), 14229 settings = this._core.settings, 14230 size = settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items; 14231 14232 if (settings.slideBy !== 'page') { 14233 settings.slideBy = Math.min(settings.slideBy, settings.items); 14234 } 14235 14236 if (settings.dots || settings.slideBy == 'page') { 14237 this._pages = []; 14238 14239 for (i = lower, j = 0, k = 0; i < upper; i++) { 14240 if (j >= size || j === 0) { 14241 this._pages.push({ 14242 start: Math.min(maximum, i - lower), 14243 end: i - lower + size - 1 14244 }); 14245 if (Math.min(maximum, i - lower) === maximum) { 14246 break; 14247 } 14248 j = 0, ++k; 14249 } 14250 j += this._core.mergers(this._core.relative(i)); 14251 } 14252 } 14253 }; 14254 14255 /** 14256 * Draws the user interface. 14257 * @todo The option `dotsData` wont work. 14258 * @protected 14259 */ 14260 Navigation.prototype.draw = function () { 14261 var difference, 14262 settings = this._core.settings, 14263 disabled = this._core.items().length <= settings.items, 14264 index = this._core.relative(this._core.current()), 14265 loop = settings.loop || settings.rewind; 14266 14267 this._controls.$relative.toggleClass('disabled', !settings.nav || disabled); 14268 14269 if (settings.nav) { 14270 this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(true)); 14271 this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(true)); 14272 } 14273 14274 this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled); 14275 14276 if (settings.dots) { 14277 difference = this._pages.length - this._controls.$absolute.children().length; 14278 14279 if (settings.dotsData && difference !== 0) { 14280 this._controls.$absolute.html(this._templates.join('')); 14281 } else if (difference > 0) { 14282 this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0])); 14283 } else if (difference < 0) { 14284 this._controls.$absolute.children().slice(difference).remove(); 14285 } 14286 14287 this._controls.$absolute.find('.active').removeClass('active'); 14288 this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active'); 14289 } 14290 }; 14291 14292 /** 14293 * Extends event data. 14294 * @protected 14295 * @param {Event} event - The event object which gets thrown. 14296 */ 14297 Navigation.prototype.onTrigger = function (event) { 14298 var settings = this._core.settings; 14299 14300 event.page = { 14301 index: $.inArray(this.current(), this._pages), 14302 count: this._pages.length,
vendor: 6,644 bytes, lines 14303-14558
14303 size: settings && (settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items) 14304 }; 14305 }; 14306 14307 /** 14308 * Gets the current page position of the carousel. 14309 * @protected 14310 * @returns {Number} 14311 */ 14312 Navigation.prototype.current = function () { 14313 var current = this._core.relative(this._core.current()); 14314 return $.grep(this._pages, $.proxy(function (page, index) { 14315 return page.start <= current && page.end >= current; 14316 }, this)).pop(); 14317 }; 14318 14319 /** 14320 * Gets the current succesor/predecessor position. 14321 * @protected 14322 * @returns {Number} 14323 */ 14324 Navigation.prototype.getPosition = function (successor) { 14325 var position, 14326 length, 14327 settings = this._core.settings; 14328 14329 if (settings.slideBy == 'page') { 14330 position = $.inArray(this.current(), this._pages); 14331 length = this._pages.length; 14332 successor ? ++position : --position; 14333 position = this._pages[(position % length + length) % length].start; 14334 } else { 14335 position = this._core.relative(this._core.current()); 14336 length = this._core.items().length; 14337 successor ? position += settings.slideBy : position -= settings.slideBy; 14338 } 14339 14340 return position; 14341 }; 14342 14343 /** 14344 * Slides to the next item or page. 14345 * @public 14346 * @param {Number} [speed=false] - The time in milliseconds for the transition. 14347 */ 14348 Navigation.prototype.next = function (speed) { 14349 $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); 14350 }; 14351 14352 /** 14353 * Slides to the previous item or page. 14354 * @public 14355 * @param {Number} [speed=false] - The time in milliseconds for the transition. 14356 */ 14357 Navigation.prototype.prev = function (speed) { 14358 $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); 14359 }; 14360 14361 /** 14362 * Slides to the specified item or page. 14363 * @public 14364 * @param {Number} position - The position of the item or page. 14365 * @param {Number} [speed] - The time in milliseconds for the transition. 14366 * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not. 14367 */ 14368 Navigation.prototype.to = function (position, speed, standard) { 14369 var length; 14370 14371 if (!standard && this._pages.length) { 14372 length = this._pages.length; 14373 $.proxy(this._overrides.to, this._core)(this._pages[(position % length + length) % length].start, speed); 14374 } else { 14375 $.proxy(this._overrides.to, this._core)(position, speed); 14376 } 14377 }; 14378 14379 $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation; 14380})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 14381 14382/** 14383 * Hash Plugin 14384 * @version 2.1.0 14385 * @author Artus Kolanowski 14386 * @author David Deutsch 14387 * @license The MIT License (MIT) 14388 */ 14389;(function ($, window, document, undefined) { 14390 'use strict'; 14391 14392 /** 14393 * Creates the hash plugin. 14394 * @class The Hash Plugin 14395 * @param {Owl} carousel - The Owl Carousel 14396 */ 14397 14398 var Hash = function (carousel) { 14399 /** 14400 * Reference to the core. 14401 * @protected 14402 * @type {Owl} 14403 */ 14404 this._core = carousel; 14405 14406 /** 14407 * Hash index for the items. 14408 * @protected 14409 * @type {Object} 14410 */ 14411 this._hashes = {}; 14412 14413 /** 14414 * The carousel element. 14415 * @type {jQuery} 14416 */ 14417 this.$element = this._core.$element; 14418 14419 /** 14420 * All event handlers. 14421 * @protected 14422 * @type {Object} 14423 */ 14424 this._handlers = { 14425 'initialized.owl.carousel': $.proxy(function (e) { 14426 if (e.namespace && this._core.settings.startPosition === 'URLHash') { 14427 $(window).trigger('hashchange.owl.navigation'); 14428 } 14429 }, this), 14430 'prepared.owl.carousel': $.proxy(function (e) { 14431 if (e.namespace) { 14432 var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash'); 14433 14434 if (!hash) { 14435 return; 14436 } 14437 14438 this._hashes[hash] = e.content; 14439 } 14440 }, this), 14441 'changed.owl.carousel': $.proxy(function (e) { 14442 if (e.namespace && e.property.name === 'position') { 14443 var current = this._core.items(this._core.relative(this._core.current())), 14444 hash = $.map(this._hashes, function (item, hash) { 14445 return item === current ? hash : null; 14446 }).join(); 14447 14448 if (!hash || window.location.hash.slice(1) === hash) { 14449 return; 14450 } 14451 14452 window.location.hash = hash; 14453 } 14454 }, this) 14455 }; 14456 14457 // set default options 14458 this._core.options = $.extend({}, Hash.Defaults, this._core.options); 14459 14460 // register the event handlers 14461 this.$element.on(this._handlers); 14462 14463 // register event listener for hash navigation 14464 $(window).on('hashchange.owl.navigation', $.proxy(function (e) { 14465 var hash = window.location.hash.substring(1), 14466 items = this._core.$stage.children(), 14467 position = this._hashes[hash] && items.index(this._hashes[hash]); 14468 14469 if (position === undefined || position === this._core.current()) { 14470 return; 14471 } 14472 14473 this._core.to(this._core.relative(position), false, true); 14474 }, this)); 14475 }; 14476 14477 /** 14478 * Default options. 14479 * @public 14480 */ 14481 Hash.Defaults = { 14482 URLhashListener: false 14483 }; 14484 14485 /** 14486 * Destroys the plugin. 14487 * @public 14488 */ 14489 Hash.prototype.destroy = function () { 14490 var handler, property; 14491 14492 $(window).off('hashchange.owl.navigation'); 14493 14494 for (handler in this._handlers) { 14495 this._core.$element.off(handler, this._handlers[handler]); 14496 } 14497 for (property in Object.getOwnPropertyNames(this)) { 14498 typeof this[property] != 'function' && (this[property] = null); 14499 } 14500 }; 14501 14502 $.fn.owlCarousel.Constructor.Plugins.Hash = Hash; 14503})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 14504 14505/** 14506 * Support Plugin 14507 * 14508 * @version 2.1.0 14509 * @author Vivid Planet Software GmbH 14510 * @author Artus Kolanowski 14511 * @author David Deutsch 14512 * @license The MIT License (MIT) 14513 */ 14514;(function ($, window, document, undefined) { 14515 14516 var style = $('<support>').get(0).style, 14517 prefixes = 'Webkit Moz O ms'.split(' '), 14518 events = { 14519 transition: { 14520 end: { 14521 WebkitTransition: 'webkitTransitionEnd', 14522 MozTransition: 'transitionend', 14523 OTransition: 'oTransitionEnd', 14524 transition: 'transitionend' 14525 } 14526 }, 14527 animation: { 14528 end: { 14529 WebkitAnimation: 'webkitAnimationEnd', 14530 MozAnimation: 'animationend', 14531 OAnimation: 'oAnimationEnd', 14532 animation: 'animationend' 14533 } 14534 } 14535 }, 14536 tests = { 14537 csstransforms: function () { 14538 return !!test('transform'); 14539 }, 14540 csstransforms3d: function () { 14541 return !!test('perspective'); 14542 }, 14543 csstransitions: function () { 14544 return !!test('transition'); 14545 }, 14546 cssanimations: function () { 14547 return !!test('animation'); 14548 } 14549 }; 14550 14551 function test(property, prefixed) { 14552 var result = false, 14553 upper = property.charAt(0).toUpperCase() + property.slice(1); 14554 14555 $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function (i, property) { 14556 if (style[property] !== undefined) { 14557 result = prefixed ? property : true; 14558 return false;
14559 } 14560 }); 14561 14562 return result; 14563 } 14564 14565 function prefixed(property) { 14566 return test(property, true); 14567 } 14568 14569 if (tests.csstransitions()) { 14570 /* jshint -W053 */ 14571 $.support.transition = new String(prefixed('transition')); 14572 $.support.transition.end = events.transition.end[$.support.transition]; 14573 } 14574 14575 if (tests.cssanimations()) { 14576 /* jshint -W053 */ 14577 $.support.animation = new String(prefixed('animation')); 14578 $.support.animation.end = events.animation.end[$.support.animation]; 14579 } 14580 14581 if (tests.csstransforms()) { 14582 /* jshint -W053 */ 14583 $.support.transform = new String(prefixed('transform')); 14584 $.support.transform3d = tests.csstransforms3d(); 14585 } 14586})(window.Zepto || __webpack_provided_window_dot_jQuery, window, document); 14587/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(0))) 14588 14589/***/ }), 14590/* 13 */ 14591/***/ (function(module, __webpack_exports__, __webpack_require__) { 14592 14593"use strict"; 14594/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 14595/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 14596/* eslint no-unused-vars: 0 */ 14597/* eslint max-len: ["off", { "code": 250 }] */ 14598/* eslint no-undef: "off" */ 14599/* eslint func-names: ["error", "never"] */ 14600/* eslint class-methods-use-this: "off" */ 14601/* eslint no-loop-func: 0 */ 14602/* eslint no-bitwise: "off" */ 14603/* eslint no-restricted-globals: ["off", "isNaN"] */ 14604/* eslint consistent-return: "off" */ 14605/** 14606 * ------------------------------------------------------------------ 14607 * 模ç»- 14608 * ------------------------------------------------------------------ 14609 */ 14610 14611/** 14612* 彿°åè½ç®è¿°: ajax å¼å«èµæ api 14613* å ·ä½æè¿°ä¸äºç»è: 14614* @date 14615* @author æ²å¤§å¥ 14616*/ 14617 14618 14619 14620const poplockme = function () { 14621 localStorage.setItem('re_lockpage', $(window).scrollTop()); 14622 $('html, body').css({ 14623 overflow: 'hidden', 14624 height: '100%' 14625 }); 14626}; 14627/* unused harmony export poplockme */ 14628 14629const contactpop = function (x, y) { 14630 $('#pop').remove(); 14631 out = ''; 14632 out += " <div id='pop' >"; 14633 out += " <img src='img/close2.png' style='position:fixed;top:3%;right:3%;z-index:9;' class='popclose'>"; 14634 out += " <div id='popin'>"; 14635 out += " <div id='poptitle'>ä¸ç§æ¹å¼å ³æ³¨</div>"; 14636 out += " <div class='popline'>1.è¥å¨å¾®ä¿¡æå¼ç°æé¡µé¢ï¼å¯é¿æè¯å«å¾ä¸äºç»´ç å ³æ³¨å¾®ä¿¡</div>"; 14637 out += " <div class='popline'>2.ä¿åäºç»´ç å¾è³ç¸åï¼ä½¿ç¨å¾®ä¿¡æ«ä¸æ«å¼å¯</div>"; 14638 out += ` <div class='popline'>3.å¨å¾®ä¿¡ä¸æç´¢ï¼<span id='popinsert'>${x}</span></div>`; 14639 out += ` <img src='img/${y}' id='popqrimg'>`; 14640 out += ' </div>'; 14641 out += ' </div>'; 14642 $('body').prepend(out); 14643 $('#pop').stop().fadeIn(500); 14644 poplockme(); 14645}; 14646/* unused harmony export contactpop */ 14647 14648const productpop = function (x, y, z, k) { 14649 $('#pop').remove(); 14650 out = ''; 14651 out += " <div id='pop'>"; 14652 out += " <img src='img/close2.png' style='position:fixed;top:3%;right:3%;z-index:9;' class='popclose'>"; 14653 out += " <div id='popin' style='background:#f3f3f3;padding:0;width:100%;height:100%;'>"; 14654 out += ` <div id='ppoptop'><img src='img/brand/product${x}m.png'></div>`; 14655 out += " <div id='ppopbody'>"; 14656 out += ` <p>${y}</P>${z}`; 14657 out += ' </div>'; 14658 out += " <div id='ppopfoot'>"; 14659 out += ` <a href='${k}'><img src='img/gobuy.jpg'></a>`; 14660 out += ' </div>'; 14661 out += ' </div>'; 14662 out += ' </div>'; 14663 $('body').prepend(out); 14664 $('#pop').stop().fadeIn(500); 14665 poplockme(); 14666}; 14667/* unused harmony export productpop */ 14668 14669const admpop = function (x, y, z, id, mtype) { 14670 $('#pop').remove(); 14671 let out = ''; 14672 out += " <div id='pop'>"; 14673 // out+=" <div style='position:absolute;z-index:998;top:0;left:0;width:100%;height:100%;' class='popclose btn' ></div>"; 14674 out += " <div id='popin' class='shadow' style='background:#fff;width:100%;max-width:900px;height:94%;margin:1% auto;z-index:999;overflow:hidden;'>"; 14675 out += " <img src='../../img/close2.png' style='position:absolute;top:3%;right:3%;z-index:9;' class='popclose btn'>"; 14676 out += " <div style='position:absolute;width:100%;height:100%;z-index:1;overflow-x:hidden;overflow-y:auto;'>"; 14677 out += " <div style='padding:10px 20px;'>"; 14678 out += " <div id='ppoptop'>"; 14679 if (typeof id !== 'undefined') { 14680 out += " <div class='onoffwarp'>"; 14681 out += ` <div class='switch btn switchclick ${z === 1 ? 'on' : ''}' data-type='${mtype}' data-val='1' data-id='${id}'>`; 14682 out += ' On'; 14683 out += ' </div>'; 14684 out += ` <div class='switch btn switchclick ${z === 1 ? '' : 'on'}' data-type='${mtype}' data-val='2' data-id='${id}'>`; 14685 out += ' Off'; 14686 out += ' </div>'; 14687 out += ' </div>'; 14688 } 14689 out += `${x}</div>`; 14690 out += " <div id='ppopbody'>"; 14691 out += y; 14692 out += ' </div>'; 14693 out += ' </div>'; 14694 out += ' </div>'; 14695 out += ' </div>';
14696 out += ' </div>'; 14697 $('body').prepend(out); 14698 $('#pop').stop().fadeIn(300); 14699 poplockme(); 14700}; 14701/* unused harmony export admpop */ 14702 14703// AJAX JASON 14704const ajaxarr = function (x, y, z) { 14705 // 两个项ç®ç ajax x=ç¨åºåé y1,y2=ç½é¡µåé ..åå¤ array..第ä¸ä¸ªæ¯é¡µé¢ 14706 const temp = $.ajax({ 14707 type: 'GET', 14708 dataType: 'json', 14709 url: z, 14710 data: { job: x, val: y, timtess: $.now() } 14711 }); 14712 return temp.success(data => { 14713 if (data[0] === 'ERRX') { 14714 window.location.replace('/adm'); 14715 } else { 14716 return temp; 14717 } 14718 }); 14719}; 14720/* harmony export (immutable) */ __webpack_exports__["a"] = ajaxarr; 14721 14722const ajaxarrschool = function (x, y, z) { 14723 // 两个项ç®ç ajax x=ç¨åºåé y1,y2=ç½é¡µåé ..åå¤ array..第ä¸ä¸ªæ¯é¡µé¢ 14724 return $.ajax({ 14725 type: 'GET', 14726 dataType: 'json', 14727 url: 'https://api.hirede.com/v1/campus/jobs/', 14728 data: { fields: 'all', take: '10', appkey: '31829dabdced' } 14729 }); 14730}; 14731/* unused harmony export ajaxarrschool */ 14732 14733const ajaxarrpost = function (x, y, z) { 14734 // 两个项ç®ç ajax x=ç¨åºåé y1,y2=ç½é¡µåé ..åå¤ array..第ä¸ä¸ªæ¯é¡µé¢ 14735 const temp = $.ajax({ 14736 type: 'POST', 14737 dataType: 'json', 14738 url: z, 14739 data: { job: x, val: y, timtess: $.now() } 14740 }); 14741 return temp.success(data => { 14742 if (data[0] === 'ERRX') { 14743 window.location.replace('/adm'); 14744 } else { 14745 return temp; 14746 } 14747 }); 14748}; 14749/* unused harmony export ajaxarrpost */ 14750 14751const cleanhref = function (x) { 14752 temp = x; 14753 if (temp.indexOf('/') >= 0) { 14754 temp = temp.substring(temp.lastIndexOf('/') + 1); 14755 } 14756 return temp; 14757}; 14758/* unused harmony export cleanhref */ 14759 14760 14761const popfreeme = function () { 14762 $('html, body').css({ 14763 overflow: 'auto', 14764 height: 'auto' 14765 }); 14766 $(window).scrollTop(localStorage.getItem('re_lockpage')); 14767}; 14768/* unused harmony export popfreeme */ 14769 14770// FUNCTIONS 14771const scrollTop = ''; 14772/* unused harmony export scrollTop */ 14773 14774const popclose = function () { 14775 $('#popin').stop().fadeOut(200).remove(); 14776 $('#pop').delay(100).stop().fadeOut(200).remove(); 14777 popfreeme(); 14778}; 14779const popclosex = function () { 14780 $('#popin').stop().hide().remove(); 14781 $('#pop').stop().fadeOut(100).remove(); 14782}; 14783// form validation 14784// æ¾ç¤ºäºå ±äº«éè¯¯åº 14785const vemail = function (x, z) { 14786 const a = x.val(); 14787 const filter = /^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/; 14788 if (filter.test(a)) { 14789 // $(".error").text(""); 14790 x.removeClass('forminput'); 14791 return true; 14792 } 14793 x.addClass('forminput'); 14794 if ($('.error').text()) { 14795 const g = $('.error').eq(0).text(); 14796 $('.error').text(`${g},${z}`); 14797 } else { 14798 $('.error').text(z); 14799 } 14800 return false; 14801}; 14802/* unused harmony export vemail */ 14803 14804// 计ç®å符串宽度(䏿=2) 14805const stringBytes = function (c) { 14806 const n = c.length; 14807 let s; 14808 let len = 0; 14809 for (let i = 0; i < n; i += 1) { 14810 s = c.charCodeAt(i); 14811 while (s > 0) { 14812 len += 1; 14813 s >>= 8; 14814 } 14815 } 14816 return len; 14817}; 14818/* unused harmony export stringBytes */ 14819 14820const vtext = function (x, y, z, mx) { 14821 const ln = stringBytes(x.val()) / 2; 14822 if (ln === 0) { 14823 x.addClass('forminput'); 14824 if ($('.error').text()) { 14825 const g = $('.error').eq(0).text(); 14826 $('.error').text(`${g},请填å${z}`); 14827 } else { 14828 $('.error').text(`请填å${z}`); 14829 } 14830 return false; 14831 } else if (ln > mx) { 14832 x.addClass('forminput'); 14833 // $(".error").text(z); 14834 if ($('.error').text()) { 14835 const g = $('.error').eq(0).text(); 14836 $('.error').text(`${g},${z}æåè¿é¿`); 14837 } else { 14838 $('.error').text(`${z}æåè¿é¿`); 14839 } 14840 return false; 14841 } else if (ln < y) { 14842 x.addClass('forminput'); 14843 // $(".error").text(z); 14844 if ($('.error').text()) { 14845 const g = $('.error').eq(0).text(); 14846 $('.error').text(`${g},${z}æå太ç`); 14847 } else { 14848 $('.error').text(`${z}æå太ç`); 14849 } 14850 return false; 14851 } 14852 // $(".error").text(""); 14853 x.removeClass('forminput'); 14854 return true; 14855}; 14856/* unused harmony export vtext */ 14857 14858const vselect = function (x, z) { 14859 let ln; 14860 if (x.val()) { 14861 ln = x.val().length; 14862 } else { 14863 ln = 0; 14864 } 14865 if (ln === 0) { 14866 x.addClass('forminput'); 14867 if ($('.error').text()) { 14868 const g = $('.error').eq(0).text(); 14869 $('.error').text(`${g},${z}`); 14870 } else { 14871 $('.error').text(z); 14872 } 14873 return false;
14874 } 14875 x.removeClass('forminput'); 14876 return true; 14877}; 14878/* unused harmony export vselect */ 14879 14880const vtext2 = function (x, y, z, mx) { 14881 const ln = stringBytes(x.val()) / 2; 14882 if (ln > mx) { 14883 x.addClass('forminput'); 14884 // $(".error").text(z); 14885 if ($('.error').text()) { 14886 const g = $('.error').eq(0).text(); 14887 $('.error').text(`${g},${z}`); 14888 } else { 14889 $('.error').text(z); 14890 } 14891 return false; 14892 } else if (ln < y) { 14893 x.addClass('forminput'); 14894 // $(".error").text(z); 14895 if ($('.error').text()) { 14896 const g = $('.error').eq(0).text(); 14897 $('.error').text(`${g},${z}`); 14898 } else { 14899 $('.error').text(z); 14900 } 14901 return false; 14902 } 14903 // $(".error").text(""); 14904 x.removeClass('forminput'); 14905 return true; 14906}; 14907/* unused harmony export vtext2 */ 14908 14909const vtext3 = function (x, y, z, mx) { 14910 // å¯å®¹è®¸0çæ¬ 14911 const ln = stringBytes(x.val()) / 2; 14912 if (ln > mx) { 14913 x.addClass('forminput'); 14914 // $(".error").text(z); 14915 if ($('.error').text()) { 14916 const g = $('.error').eq(0).text(); 14917 $('.error').text(`${g},${z}æåè¿é¿`); 14918 } else { 14919 $('.error').text(`${z}æåè¿é¿`); 14920 } 14921 return false; 14922 } else if (ln < y) { 14923 x.addClass('forminput'); 14924 // $(".error").text(z); 14925 if ($('.error').text()) { 14926 const g = $('.error').eq(0).text(); 14927 $('.error').text(`${g},${z}æå太ç`); 14928 } else { 14929 $('.error').text(`${z}æå太ç`); 14930 } 14931 return false; 14932 } 14933 // $(".error").text(""); 14934 x.removeClass('forminput'); 14935 return true; 14936}; 14937/* unused harmony export vtext3 */ 14938 14939const vnum = function (x, y, z, mx) { 14940 // var numbers = /^[-+]?[0-9]+$/; 14941 const numbers = /^[-+]?[0-9.]+$/; 14942 if (x.val().match(numbers) && x.val() >= y && x.val() <= mx) { 14943 // $(".error").text(""); 14944 x.removeClass('forminput'); 14945 return true; 14946 } 14947 x.addClass('forminput'); 14948 // $(".error").text(z); 14949 if ($('.error').text()) { 14950 const g = $('.error').eq(0).text(); 14951 $('.error').text(`${g},${z}`); 14952 } else { 14953 $('.error').text(z); 14954 } 14955 return false; 14956}; 14957/* unused harmony export vnum */ 14958 14959const vdate = function (x, z) { 14960 const t = Date.parse(x.val()); 14961 if (isNaN(t)) { 14962 x.addClass('forminput'); 14963 // x.parent(".formitem").siblings(".formerr").html(z); 14964 // $(".error").text(z); 14965 if ($('.error').text()) { 14966 const g = $('.error').eq(0).text(); 14967 $('.error').text(`${g},${z}`); 14968 } else { 14969 $('.error').text(z); 14970 } 14971 return false; 14972 } 14973 // $(".error").text(""); 14974 // x.parent(".formitem").siblings(".formerr").html(''); 14975 x.removeClass('forminput'); 14976 return true; 14977}; 14978/* unused harmony export vdate */ 14979 14980const vcheck = function (x, z) { 14981 const numbers = /^[-+]?[0-9]+$/; 14982 if (x.is(':checked')) { 14983 // x.parent(".formitem").siblings(".formerr").html(''); 14984 // $(".error").text(""); 14985 x.removeClass('forminput'); 14986 return true; 14987 } 14988 x.addClass('forminput'); 14989 // x.parent(".formitem").siblings(".formerr").html(z); 14990 // $(".error").text(z); 14991 if ($('.error').text()) { 14992 const g = $('.error').eq(0).text(); 14993 $('.error').text(`${g},${z}`); 14994 } else { 14995 $('.error').text(z); 14996 } 14997 return false; 14998}; 14999/* unused harmony export vcheck */ 15000 15001// æè¡ 15002const nl2brs = function (x) { 15003 const xa = x; 15004 const xx2 = ''; 15005 let x2 = ''; 15006 if (xa) { 15007 x2 = xa.replace(/\n/g, '<BR>'); 15008 } 15009 return x2; 15010}; 15011/* unused harmony export nl2brs */ 15012 15013 15014// æ£æ¥ææå¾çè¯»å® 15015const chkallimg = function () { 15016 $('#preloaderwrap').show(); 15017 const ximglist = $('img'); 15018 let imgload = ximglist.length; 15019 const tepimg = []; 15020 for (let a = 0; a < ximglist.length; a += 1) { 15021 tepimg[a] = new Image(); 15022 tepimg[a].onload = function () { 15023 imgload -= 1; 15024 }; 15025 tepimg[a].src = ximglist.eq(a).attr('src'); 15026 } 15027 const chkload = setInterval(() => { 15028 if (imgload <= 0) { 15029 clearInterval(chkload); 15030 $('#preloaderwrap').fadeOut(500); 15031 } 15032 }, 500); 15033}; 15034/* unused harmony export chkallimg */ 15035 15036 15037// SITE SETTING 15038 15039$(document).ready(() => { 15040 let ismobile = 0; 15041 // POP50 CLOSE 15042 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 15043 ismobile = 1; 15044 } 15045 if (ismobile === 1) { 15046 // .. 15047 } 15048 $('body').delegate('.popclose', 'click', e => { 15049 e.preventDefault(); 15050 popclose(); 15051 }); 15052 $('body').delegate('.btn', 'click', e => { 15053 e.preventDefault(); 15054 }); 15055 // è·³åºæ¡æ 15056 $('body').delegate('.popclick', 'click', e => { 15057 popagree(); 15058 }); 15059 // äºæ¢ IMAGE ç HOVER å ±äº« 15060 $('.hoverimg').hover(function () { 15061 if ($(this).parents('a').hasClass('selected')) { 15062 // .. 15063 } else { 15064 changeimg($(this)); 15065 } 15066 }, function () { 15067 if ($(this).parents('a').hasClass('selected')) { 15068 // .. 15069 } else if ($(this).hasClass('selected')) { 15070 // .. 15071 } else { 15072 changeimg($(this)); 15073 } 15074 }); 15075 // 确认 nav 15076}); 15077/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) 15078 15079/***/ }), 15080/* 14 */ 15081/***/ (function(module, exports, __webpack_require__) { 15082 15083// style-loader: Adds some css to the DOM by adding a <style> tag 15084 15085// load the styles
15086var content = __webpack_require__(15); 15087if(typeof content === 'string') content = [[module.i, content, '']]; 15088// Prepare cssTransformation 15089var transform; 15090 15091var options = {} 15092options.transform = transform 15093// add the styles to the DOM 15094var update = __webpack_require__(4)(content, options); 15095if(content.locals) module.exports = content.locals; 15096// Hot Module Replacement 15097if(false) { 15098 // When the styles change, update the <style> tags 15099 if(!content.locals) { 15100 module.hot.accept("!!../../../../node_modules/css-loader/index.js!./owl.carousel.min.css", function() { 15101 var newContent = require("!!../../../../node_modules/css-loader/index.js!./owl.carousel.min.css"); 15102 if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; 15103 update(newContent); 15104 }); 15105 } 15106 // When the module is disposed, remove the <style> tags 15107 module.hot.dispose(function() { update(); }); 15108} 15109 15110/***/ }), 15111/* 15 */ 15112/***/ (function(module, exports, __webpack_require__) { 15113 15114exports = module.exports = __webpack_require__(3)(undefined); 15115// imports 15116 15117 15118// module 15119exports.push([module.i, ".owl-carousel{display:none;width:100%;-webkit-tap-highlight-color:transparent;position:relative;z-index:1}.owl-carousel .owl-stage{position:relative;-ms-touch-action:pan-Y}.owl-carousel .owl-stage:after{content:\".\";display:block;clear:both;visibility:hidden;line-height:0;height:0}.owl-carousel .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0px, 0px, 0px)}.owl-carousel .owl-item{position:relative;min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.owl-carousel .owl-item img{display:block;width:100%;-webkit-transform-style:preserve-3d}.owl-carousel .owl-nav.disabled,.owl-carousel .owl-dots.disabled{display:none}.owl-carousel .owl-nav .owl-prev,.owl-carousel .owl-nav .owl-next,.owl-carousel .owl-dot{cursor:pointer;cursor:hand;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-loaded{display:block}.owl-carousel.owl-loading{opacity:0;display:block}.owl-carousel.owl-hidden{opacity:0}
15119.owl-carousel.owl-refresh .owl-item{visibility:hidden}.owl-carousel.owl-drag .owl-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-grab{cursor:move;cursor:grab}.owl-carousel.owl-rtl{direction:rtl}.owl-carousel.owl-rtl .owl-item{float:right}.no-js .owl-carousel{display:block}.owl-carousel .animated{animation-duration:1000ms;animation-fill-mode:both}.owl-carousel .owl-animated-in{z-index:0}.owl-carousel .owl-animated-out{z-index:1}.owl-carousel .fadeOut{animation-name:fadeOut}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{transition:height 500ms ease-in-out}.owl-carousel .owl-item .owl-lazy{opacity:0;transition:opacity 400ms ease}.owl-carousel .owl-item img.owl-lazy{transform-style:preserve-3d}.owl-carousel .owl-video-wrapper{position:relative;height:100%;background:#000}.owl-carousel .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url(" + __webpack_require__(16) + ") no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;transition:transform 100ms ease}.owl-carousel .owl-video-play-icon:hover{transform:scale(1.3, 1.3)}.owl-carousel .owl-video-playing .owl-video-tn,.owl-carousel .owl-video-playing .owl-video-play-icon{display:none}.owl-carousel .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;transition:opacity 400ms ease}.owl-carousel .owl-video-frame{position:relative;z-index:1;height:100%;width:100%}", ""]); 15120 15121// exports 15122 15123 15124/***/ }), 15125/* 16 */ 15126/***/ (function(module, exports, __webpack_require__) { 15127 15128module.exports = __webpack_require__.p + "4a37f8008959c75f619bf0a3a4e2d7a2.png"; 15129 15130/***/ }), 15131/* 17 */ 15132/***/ (function(module, exports, __webpack_require__) { 15133 15134// style-loader: Adds some css to the DOM by adding a <style> tag 15135 15136// load the styles 15137var content = __webpack_require__(18); 15138if(typeof content === 'string') content = [[module.i, content, '']]; 15139// Prepare cssTransformation 15140var transform; 15141 15142var options = {} 15143options.transform = transform 15144// add the styles to the DOM 15145var update = __webpack_require__(4)(content, options); 15146if(content.locals) module.exports = content.locals; 15147// Hot Module Replacement 15148if(false) { 15149 // When the styles change, update the <style> tags 15150 if(!content.locals) { 15151 module.hot.accept("!!../../../../node_modules/css-loader/index.js!./owl.theme.default.min.css", function() { 15152 var newContent = require("!!../../../../node_modules/css-loader/index.js!./owl.theme.default.min.css"); 15153 if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; 15154 update(newContent); 15155 }); 15156 } 15157 // When the module is disposed, remove the <style> tags 15158 module.hot.dispose(function() { update(); }); 15159} 15160 15161/***/ }), 15162/* 18 */ 15163/***/ (function(module, exports, __webpack_require__) { 15164 15165exports = module.exports = __webpack_require__(3)(undefined); 15166// imports 15167 15168 15169// module 15170exports.push([module.i, ".owl-theme .owl-nav{text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-nav [class*='owl-']{position:absolute;color:#FFF;font-size:22px;margin:0;padding:8px;background:rgba(0,0,0,0.3);background:url(/img/mask-30.png) \\9;display:inline-block;cursor:pointer;height:34px;width:34px;border-radius:50%;top:50%;margin-top:-34px}.owl-theme .owl-nav [class*='owl-']:hover{background:rgba(0,0,0,0.2);background:url(/img/mask-20.png) \\9;color:#FFF;text-decoration:none}.owl-theme .owl-nav .owl-prev{left:30px}.owl-theme .owl-nav .owl-next{right:30px}.owl-theme .owl-nav .disabled{opacity:.5;cursor:default}.owl-theme .owl-nav.disabled+.owl-dots{margin-top:10px}.owl-theme .owl-dots{margin-top:25px;text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-dots .owl-dot{display:inline-block;zoom:1;*display:inline}.owl-theme .owl-dots .owl-dot span{width:10px;height:10px;margin:5px 7px;background:#ebebeb;display:block;-webkit-backface-visibility:visible;transition:opacity 200ms ease;border-radius:30px}.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{background:#ef4632}.owl-theme.status-nav-outside .owl-nav .owl-prev{left:-80px}.owl-theme.status-nav-outside .owl-nav .owl-next{right:-80px}", ""]); 15171
15172// exports 15173 15174 15175/***/ }), 15176/* 19 */ 15177/***/ (function(module, exports, __webpack_require__) { 15178 15179// style-loader: Adds some css to the DOM by adding a <style> tag 15180 15181// load the styles 15182var content = __webpack_require__(20); 15183if(typeof content === 'string') content = [[module.i, content, '']]; 15184// Prepare cssTransformation 15185var transform; 15186 15187var options = {} 15188options.transform = transform 15189// add the styles to the DOM 15190var update = __webpack_require__(4)(content, options); 15191if(content.locals) module.exports = content.locals; 15192// Hot Module Replacement 15193if(false) { 15194 // When the styles change, update the <style> tags 15195 if(!content.locals) { 15196 module.hot.accept("!!../../../../node_modules/css-loader/index.js!./animate.css", function() { 15197 var newContent = require("!!../../../../node_modules/css-loader/index.js!./animate.css"); 15198 if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; 15199 update(newContent); 15200 }); 15201 } 15202 // When the module is disposed, remove the <style> tags 15203 module.hot.dispose(function() { update(); }); 15204} 15205 15206/***/ }), 15207/* 20 */ 15208/***/ (function(module, exports, __webpack_require__) { 15209 15210exports = module.exports = __webpack_require__(3)(undefined); 15211// imports 15212 15213 15214// module 15215exports.push([module.i, "@charset \"UTF-8\";/*!\r\n * animate.css -http://daneden.me/animate\r\n * Version - 3.5.2\r\n * Licensed under the MIT license - http://opensource.org/licenses/MIT\r\n *\r\n * Copyright (c) 2017 Daniel Eden\r\n */.animated{animation-duration:1s;animation-fill-mode:both}.animated.infinite{animation-iteration-count:infinite}.animated.hinge{animation-duration:2s}.animated.flipOutX,.animated.flipOutY,.animated.bounceIn,.animated.bounceOut{animation-duration:.75s}@keyframes bounce{from,20%,53%,80%,to{animation-timing-function:cubic-bezier(0.215, .610, .355, 1.000);transform:translate3d(0,0,0)}40%,43%{animation-timing-function:cubic-bezier(0.755, .050, .855, .060);transform:translate3d(0, -30px, 0)}70%{animation-timing-function:cubic-bezier(0.755, .050, .855, .060);transform:translate3d(0, -15px, 0)}90%{transform:translate3d(0,-4px,0)}}.bounce{animation-name:bounce;transform-origin:center bottom}@keyframes flash{from,50%,to{opacity:1}25%,75%{opacity:0}}.flash{animation-name:flash}@keyframes pulse{from{transform:scale3d(1, 1, 1)}50%{transform:scale3d(1.05, 1.05, 1.05)}to{transform:scale3d(1, 1, 1)}}.pulse{animation-name:pulse}@keyframes rubberBand{from{transform:scale3d(1, 1, 1)}30%{transform:scale3d(1.25, .75, 1)}40%{transform:scale3d(0.75, 1.25, 1)}50%{transform:scale3d(1.15, .85, 1)}65%{transform:scale3d(.95, 1.05, 1)}75%{transform:scale3d(1.05, .95, 1)}to{transform:scale3d(1, 1, 1)}}.rubberBand{animation-name:rubberBand}@keyframes shake{from,to{transform:translate3d(0, 0, 0)}10%,30%,50%,70%,90%{transform:translate3d(-10px, 0, 0)}20%,40%,60%,80%{transform:translate3d(10px, 0, 0)}}.shake{animation-name:shake}@keyframes headShake{0%{transform:translateX(0)}6.5%{transform:translateX(-6px) rotateY(-9deg)}18.5%{transform:translateX(5px) rotateY(7deg)}31.5%{transform:translateX(-3px) rotateY(-5deg)}43.5%{transform:translateX(2px) rotateY(3deg)}50%{transform:translateX(0)}}.headShake{animation-timing-function:ease-in-out;animation-name:headShake}@keyframes swing{20%{transform:rotate3d(0, 0, 1, 15deg)}40%{transform:rotate3d(0, 0, 1, -10deg)}60%{transform:rotate3d(0, 0, 1, 5deg)}80%{transform:rotate3d(0, 0, 1, -5deg)}to{transform:rotate3d(0, 0, 1, 0deg)}}.swing{transform-origin:top center;animation-name:swing}@keyframes tada{from{transform:scale3d(1, 1, 1)}10%,20%{transform:scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg)}30%,50%,70%,90%{transform:scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)}40%,60%,80%{transform:scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)}to{transform:scale3d(1, 1, 1)}}.tada{animation-name:tada}@keyframes wobble{from{transform:none}15%{transform:translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg)}30%{transform:translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg)}45%{transform:translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg)}60%{transform:translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg)}75%{transform:translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg)}to{transform:none}}.wobble{animation-name:wobble}@keyframes jello{from,11.1%,to{transform:none}22.2%{transform:skewX(-12.5deg) skewY(-12.5deg)}33.3%{transform:skewX(6.25deg) skewY(6.25deg)}44.4%{transform:skewX(-3.125deg) skewY(-3.125deg)}55.5%{transform:skewX(1.5625deg) skewY(1.5625deg)}66.6%{transform:skewX(-0.78125deg) skewY(-0.78125deg)}77.7%{transform:skewX(0.390625deg) skewY(0.390625deg)}88.8%{transform:skewX(-0.1953125deg) skewY(-0.1953125deg)}}.jello{animation-name:jello;transform-origin:center}@keyframes bounceIn{from,20%,40%,60%,80%,to{animation-timing-function:cubic-bezier(0.215, .610, .355, 1.000)}0%{opacity:0;transform:scale3d(.3, .3, .3)}20%{transform:scale3d(1.1, 1.1, 1.1)}40%{transform:scale3d(.9, .9, .9)}60%{opacity:1;transform:scale3d(1.03, 1.03, 1.03)}80%{transform:scale3d(.97, .97, .97)}to{opacity:1;transform:scale3d(1, 1, 1)}}.bounceIn{animation-name:bounceIn}@keyframes bounceInDown{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215, .610, .355, 1.000)}0%{opacity:0;transform:translate3d(0, -3000px, 0)}60%{opacity:1;transform:translate3d(0, 25px, 0)}75%{transform:translate3d(0, -10px, 0)}90%{transform:translate3d(0, 5px, 0)}to{transform:none}}.bounceInDown{animation-name:bounceInDown}@keyframes bounceInLeft{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215, .610, .355, 1.000)}0%{opacity:0;transform:translate3d(-3000px, 0, 0)}60%{opacity:1;transform:translate3d(25px, 0, 0)}75%{transform:translate3d(-10px, 0, 0)}90%{transform:translate3d(5px, 0, 0)}to{transform:none}}.bounceInLeft{animation-name:bounceInLeft}@keyframes bounceInRight{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215, .610, .355, 1.000)}from{opacity:0;transform:translate3d(3000px, 0, 0)}60%{opacity:1;transform:translate3d(-25px, 0, 0)}75%{transform:translate3d(10px, 0, 0)}90%{transform:translate3d(-5px, 0, 0)}to{transform:none}}.bounceInRight{animation-name:bounceInRight}@keyframes bounceInUp{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215, .610, .355, 1.000)}from{opacity:0;transform:translate3d(0, 3000px, 0)}60%{opacity:1;
15215transform:translate3d(0, -20px, 0)}75%{transform:translate3d(0, 10px, 0)}90%{transform:translate3d(0, -5px, 0)}to{transform:translate3d(0, 0, 0)}}.bounceInUp{animation-name:bounceInUp}@keyframes bounceOut{20%{transform:scale3d(.9, .9, .9)}50%,55%{opacity:1;transform:scale3d(1.1, 1.1, 1.1)}to{opacity:0;transform:scale3d(.3, .3, .3)}}.bounceOut{animation-name:bounceOut}@keyframes bounceOutDown{20%{transform:translate3d(0, 10px, 0)}40%,45%{opacity:1;transform:translate3d(0, -20px, 0)}to{opacity:0;transform:translate3d(0, 2000px, 0)}}.bounceOutDown{animation-name:bounceOutDown}@keyframes bounceOutLeft{20%{opacity:1;transform:translate3d(20px, 0, 0)}to{opacity:0;transform:translate3d(-2000px, 0, 0)}}.bounceOutLeft{animation-name:bounceOutLeft}@keyframes bounceOutRight{20%{opacity:1;transform:translate3d(-20px, 0, 0)}to{opacity:0;transform:translate3d(2000px, 0, 0)}}.bounceOutRight{animation-name:bounceOutRight}@keyframes bounceOutUp{20%{transform:translate3d(0, -10px, 0)}40%,45%{opacity:1;transform:translate3d(0, 20px, 0)}to{opacity:0;transform:translate3d(0, -2000px, 0)}}.bounceOutUp{animation-name:bounceOutUp}@keyframes fadeIn{from{opacity:0}to{opacity:1}}.fadeIn{animation-name:fadeIn}@keyframes fadeInDown{from{opacity:0;transform:translate3d(0, -100%, 0)}to{opacity:1;transform:none}}.fadeInDown{animation-name:fadeInDown}@keyframes fadeInDownBig{from{opacity:0;transform:translate3d(0, -2000px, 0)}to{opacity:1;transform:none}}.fadeInDownBig{animation-name:fadeInDownBig}@keyframes fadeInLeft{from{opacity:0;transform:translate3d(-100%, 0, 0)}to{opacity:1;transform:none}}.fadeInLeft{animation-name:fadeInLeft}@keyframes fadeInLeftBig{from{opacity:0;transform:translate3d(-2000px, 0, 0)}to{opacity:1;transform:none}}.fadeInLeftBig{animation-name:fadeInLeftBig}@keyframes fadeInRight{from{opacity:0;transform:translate3d(100%, 0, 0)}to{opacity:1;transform:none}}.fadeInRight{animation-name:fadeInRight}@keyframes fadeInRightBig{from{opacity:0;transform:translate3d(2000px, 0, 0)}to{opacity:1;transform:none}}.fadeInRightBig{animation-name:fadeInRightBig}@keyframes fadeInUp{from{opacity:0;transform:translate3d(0, 100%, 0)}to{opacity:1;transform:none}}.fadeInUp{animation-name:fadeInUp}@keyframes fadeInUpBig{from{opacity:0;transform:translate3d(0, 2000px, 0)}to{opacity:1;transform:none}}.fadeInUpBig{animation-name:fadeInUpBig}@keyframes fadeOut{from{opacity:1}to{opacity:0}}.fadeOut{animation-name:fadeOut}@keyframes fadeOutDown{from{opacity:1}to{opacity:0;transform:translate3d(0, 100%, 0)}}.fadeOutDown{animation-name:fadeOutDown}@keyframes fadeOutDownBig{from{opacity:1}to{opacity:0;transform:translate3d(0, 2000px, 0)}}.fadeOutDownBig{animation-name:fadeOutDownBig}@keyframes fadeOutLeft{from{opacity:1}to{opacity:0;transform:translate3d(-100%, 0, 0)}}.fadeOutLeft{animation-name:fadeOutLeft}@keyframes fadeOutLeftBig{from{opacity:1}\r\nto{opacity:0;transform:translate3d(-2000px, 0, 0)}}.fadeOutLeftBig{animation-name:fadeOutLeftBig}@keyframes fadeOutRight{from{opacity:1}to{opacity:0;transform:translate3d(100%, 0, 0)}}.fadeOutRight{animation-name:fadeOutRight}@keyframes fadeOutRightBig{from{opacity:1}to{opacity:0;transform:translate3d(2000px, 0, 0)}}.fadeOutRightBig{animation-name:fadeOutRightBig}@keyframes fadeOutUp{from{opacity:1}to{opacity:0;transform:translate3d(0, -100%, 0)}}.fadeOutUp{animation-name:fadeOutUp}@keyframes fadeOutUpBig{from{opacity:1}to{opacity:0;transform:translate3d(0, -2000px, 0)}}.fadeOutUpBig{animation-name:fadeOutUpBig}@keyframes flip{from{transform:perspective(400px) rotate3d(0, 1, 0, -360deg);animation-timing-function:ease-out}40%{transform:perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -190deg);animation-timing-function:ease-out}50%{transform:perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -170deg);animation-timing-function:ease-in}80%{transform:perspective(400px) scale3d(.95, .95, .95);animation-timing-function:ease-in}to{transform:perspective(400px);animation-timing-function:ease-in}}.animated.flip{-webkit-backface-visibility:visible;backface-visibility:visible;animation-name:flip}@keyframes flipInX{from{transform:perspective(400px) rotate3d(1, 0, 0, 90deg);animation-timing-function:ease-in;opacity:0}
1521540%{transform:perspective(400px) rotate3d(1, 0, 0, -20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotate3d(1, 0, 0, 10deg);opacity:1}80%{transform:perspective(400px) rotate3d(1, 0, 0, -5deg)}to{transform:perspective(400px)}}.flipInX{-webkit-backface-visibility:visible !important;backface-visibility:visible !important;animation-name:flipInX}@keyframes flipInY{from{transform:perspective(400px) rotate3d(0, 1, 0, 90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotate3d(0, 1, 0, -20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotate3d(0, 1, 0, 10deg);opacity:1}80%{transform:perspective(400px) rotate3d(0, 1, 0, -5deg)}to{transform:perspective(400px)}}.flipInY{-webkit-backface-visibility:visible !important;backface-visibility:visible !important;animation-name:flipInY}@keyframes flipOutX{from{transform:perspective(400px)}30%{transform:perspective(400px) rotate3d(1, 0, 0, -20deg);opacity:1}to{transform:perspective(400px) rotate3d(1, 0, 0, 90deg);opacity:0}
15215}.flipOutX{animation-name:flipOutX;-webkit-backface-visibility:visible !important;backface-visibility:visible !important}@keyframes flipOutY{from{transform:perspective(400px)}30%{transform:perspective(400px) rotate3d(0, 1, 0, -15deg);opacity:1}to{transform:perspective(400px) rotate3d(0, 1, 0, 90deg);opacity:0}}.flipOutY{-webkit-backface-visibility:visible !important;backface-visibility:visible !important;animation-name:flipOutY}@keyframes lightSpeedIn{from{transform:translate3d(100%, 0, 0) skewX(-30deg);opacity:0}60%{transform:skewX(20deg);opacity:1}80%{transform:skewX(-5deg);opacity:1}to{transform:none;opacity:1}}.lightSpeedIn{animation-name:lightSpeedIn;animation-timing-function:ease-out}@keyframes lightSpeedOut{from{opacity:1}to{transform:translate3d(100%, 0, 0) skewX(30deg);opacity:0}}.lightSpeedOut{animation-name:lightSpeedOut;animation-timing-function:ease-in}@keyframes rotateIn{from{transform-origin:center;transform:rotate3d(0, 0, 1, -200deg);opacity:0}to{transform-origin:center;transform:none;opacity:1}}.rotateIn{animation-name:rotateIn}@keyframes rotateInDownLeft{from{transform-origin:left bottom;transform:rotate3d(0, 0, 1, -45deg);opacity:0}
15215to{transform-origin:left bottom;transform:none;opacity:1}}.rotateInDownLeft{animation-name:rotateInDownLeft}@keyframes rotateInDownRight{from{transform-origin:right bottom;transform:rotate3d(0, 0, 1, 45deg);opacity:0}to{transform-origin:right bottom;transform:none;opacity:1}}.rotateInDownRight{animation-name:rotateInDownRight}@keyframes rotateInUpLeft{from{transform-origin:left bottom;transform:rotate3d(0, 0, 1, 45deg);opacity:0}to{transform-origin:left bottom;transform:none;opacity:1}}.rotateInUpLeft{animation-name:rotateInUpLeft}@keyframes rotateInUpRight{from{transform-origin:right bottom;transform:rotate3d(0, 0, 1, -90deg);opacity:0}to{transform-origin:right bottom;transform:none;opacity:1}}.rotateInUpRight{animation-name:rotateInUpRight}@keyframes rotateOut{from{transform-origin:center;opacity:1}to{transform-origin:center;transform:rotate3d(0, 0, 1, 200deg);opacity:0}}.rotateOut{animation-name:rotateOut}@keyframes rotateOutDownLeft{from{transform-origin:left bottom;opacity:1}to{transform-origin:left bottom;transform:rotate3d(0, 0, 1, 45deg);opacity:0}
15215}.rotateOutDownLeft{animation-name:rotateOutDownLeft}@keyframes rotateOutDownRight{from{transform-origin:right bottom;opacity:1}to{transform-origin:right bottom;transform:rotate3d(0, 0, 1, -45deg);opacity:0}}.rotateOutDownRight{animation-name:rotateOutDownRight}@keyframes rotateOutUpLeft{from{transform-origin:left bottom;opacity:1}to{transform-origin:left bottom;transform:rotate3d(0, 0, 1, -45deg);opacity:0}}.rotateOutUpLeft{animation-name:rotateOutUpLeft}@keyframes rotateOutUpRight{from{transform-origin:right bottom;opacity:1}to{transform-origin:right bottom;transform:rotate3d(0, 0, 1, 90deg);opacity:0}}.rotateOutUpRight{animation-name:rotateOutUpRight}@keyframes hinge{0%{transform-origin:top left;animation-timing-function:ease-in-out}20%,60%{transform:rotate3d(0, 0, 1, 80deg);transform-origin:top left;animation-timing-function:ease-in-out}40%,80%{transform:rotate3d(0, 0, 1, 60deg);transform-origin:top left;animation-timing-function:ease-in-out;opacity:1}to{transform:translate3d(0, 700px, 0);opacity:0}}.hinge{animation-name:hinge}@keyframes jackInTheBox{from{opacity:0;transform:scale(0.1) rotate(30deg);transform-origin:center bottom}50%{transform:rotate(-10deg)}70%{transform:rotate(3deg)}to{opacity:1;transform:scale(1)}}.jackInTheBox{animation-name:jackInTheBox}@keyframes rollIn{from{opacity:0;transform:translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg)}to{opacity:1;transform:none}}.rollIn{animation-name:rollIn}@keyframes rollOut{from{opacity:1}to{opacity:0;transform:translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg)}}.rollOut{animation-name:rollOut}@keyframes zoomIn{from{opacity:0;transform:scale3d(.3, .3, .3)}50%{opacity:1}}.zoomIn{animation-name:zoomIn}@keyframes zoomInDown{from{opacity:0;transform:scale3d(.1, .1, .1) translate3d(0, -1000px, 0);animation-timing-function:cubic-bezier(0.550, .055, .675, .190)}60%{opacity:1;transform:scale3d(.475, .475, .475) translate3d(0, 60px, 0);animation-timing-function:cubic-bezier(0.175, .885, .320, 1)}}.zoomInDown{animation-name:zoomInDown}@keyframes zoomInLeft{from{opacity:0;transform:scale3d(.1, .1, .1) translate3d(-1000px, 0, 0);animation-timing-function:cubic-bezier(0.550, .055, .675, .190)}60%{opacity:1;transform:scale3d(.475, .475, .475) translate3d(10px, 0, 0);animation-timing-function:cubic-bezier(0.175, .885, .320, 1)}}.zoomInLeft{animation-name:zoomInLeft}@keyframes zoomInRight{from{opacity:0;transform:scale3d(.1, .1, .1) translate3d(1000px, 0, 0);animation-timing-function:cubic-bezier(0.550, .055, .675, .190)}60%{opacity:1;transform:scale3d(.475, .475, .475) translate3d(-10px, 0, 0);animation-timing-function:cubic-bezier(0.175, .885, .320, 1)}}.zoomInRight{animation-name:zoomInRight}@keyframes zoomInUp{from{opacity:0;transform:scale3d(.1, .1, .1) translate3d(0, 1000px, 0);animation-timing-function:cubic-bezier(0.550, .055, .675, .190)}60%{opacity:1;transform:scale3d(.475, .475, .475) translate3d(0, -60px, 0);animation-timing-function:cubic-bezier(0.175, .885, .320, 1)}}.zoomInUp{animation-name:zoomInUp}@keyframes zoomOut{from{opacity:1}50%{opacity:0;transform:scale3d(.3, .3, .3)}to{opacity:0}}.zoomOut{animation-name:zoomOut}@keyframes zoomOutDown{40%{opacity:1;transform:scale3d(.475, .475, .475) translate3d(0, -60px, 0);animation-timing-function:cubic-bezier(0.550, .055, .675, .190)}\r\nto{opacity:0;transform:scale3d(.1, .1, .1) translate3d(0, 2000px, 0);transform-origin:center bottom;animation-timing-function:cubic-bezier(0.175, .885, .320, 1)}}.zoomOutDown{animation-name:zoomOutDown}@keyframes zoomOutLeft{40%{opacity:1;transform:scale3d(.475, .475, .475) translate3d(42px, 0, 0)}to{opacity:0;transform:scale(.1) translate3d(-2000px, 0, 0);transform-origin:left center}}.zoomOutLeft{animation-name:zoomOutLeft}@keyframes zoomOutRight{40%{opacity:1;transform:scale3d(.475, .475, .475) translate3d(-42px, 0, 0)}to{opacity:0;transform:scale(.1) translate3d(2000px, 0, 0);transform-origin:right center}}.zoomOutRight{animation-name:zoomOutRight}@keyframes zoomOutUp{40%{opacity:1;transform:scale3d(.475, .475, .475) translate3d(0, 60px, 0);animation-timing-function:cubic-bezier(0.550, .055, .675, .190)}to{opacity:0;transform:scale3d(.1, .1, .1) translate3d(0, -2000px, 0);transform-origin:center bottom;animation-timing-function:cubic-bezier(0.175, .885, .320, 1)}}.zoomOutUp{animation-name:zoomOutUp}@keyframes slideInDown{from{transform:translate3d(0, -100%, 0);visibility:visible}to{transform:translate3d(0, 0, 0)}}.slideInDown{animation-name:slideInDown}@keyframes slideInLeft{from{transform:translate3d(-100%, 0, 0);visibility:visible}to{transform:translate3d(0, 0, 0)}}.slideInLeft{animation-name:slideInLeft}@keyframes slideInRight{from{transform:translate3d(100%, 0, 0);visibility:visible}to{transform:translate3d(0, 0, 0)}}.slideInRight{animation-name:slideInRight}@keyframes slideInUp{from{transform:translate3d(0, 100%, 0);visibility:visible}to{transform:translate3d(0, 0, 0)}}.slideInUp{animation-name:slideInUp}@keyframes slideOutDown{from{transform:translate3d(0, 0, 0)}to{visibility:hidden;transform:translate3d(0, 100%, 0)}}.slideOutDown{animation-name:slideOutDown}@keyframes slideOutLeft{from{transform:translate3d(0, 0, 0)}to{visibility:hidden;transform:translate3d(-100%, 0, 0)}}.slideOutLeft{animation-name:slideOutLeft}@keyframes slideOutRight{from{transform:translate3d(0, 0, 0)}to{visibility:hidden;transform:translate3d(100%, 0, 0)}}.slideOutRight{animation-name:slideOutRight}@keyframes slideOutUp{from{transform:translate3d(0, 0, 0)}to{visibility:hidden;transform:translate3d(0, -100%, 0)}}.slideOutUp{animation-name:slideOutUp}", ""]); 15216
vendor: 9,034 bytes, lines 15217-15541
15217// exports 15218 15219 15220/***/ }), 15221/* 21 */, 15222/* 22 */, 15223/* 23 */, 15224/* 24 */, 15225/* 25 */ 15226/***/ (function(module, exports, __webpack_require__) { 15227 15228var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 15229 * imagesLoaded v4.1.4 15230 * JavaScript is all like "You images are done yet or what?" 15231 * MIT License 15232 */ 15233 15234(function (window, factory) { 15235 'use strict'; 15236 // universal module definition 15237 15238 /*global define: false, module: false, require: false */ 15239 15240 if (true) { 15241 // AMD 15242 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(26)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (EvEmitter) { 15243 return factory(window, EvEmitter); 15244 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 15245 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 15246 } else if (typeof module == 'object' && module.exports) { 15247 // CommonJS 15248 module.exports = factory(window, require('ev-emitter')); 15249 } else { 15250 // browser global 15251 window.imagesLoaded = factory(window, window.EvEmitter); 15252 } 15253})(typeof window !== 'undefined' ? window : this, 15254 15255// -------------------------- factory -------------------------- // 15256 15257function factory(window, EvEmitter) { 15258 15259 'use strict'; 15260 15261 var $ = window.jQuery; 15262 var console = window.console; 15263 15264 // -------------------------- helpers -------------------------- // 15265 15266 // extend objects 15267 function extend(a, b) { 15268 for (var prop in b) { 15269 a[prop] = b[prop]; 15270 } 15271 return a; 15272 } 15273 15274 var arraySlice = Array.prototype.slice; 15275 15276 // turn element or nodeList into an array 15277 function makeArray(obj) { 15278 if (Array.isArray(obj)) { 15279 // use object if already an array 15280 return obj; 15281 } 15282 15283 var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; 15284 if (isArrayLike) { 15285 // convert nodeList to array 15286 return arraySlice.call(obj); 15287 } 15288 15289 // array of single index 15290 return [obj]; 15291 } 15292 15293 // -------------------------- imagesLoaded -------------------------- // 15294 15295 /** 15296 * @param {Array, Element, NodeList, String} elem 15297 * @param {Object or Function} options - if function, use as callback 15298 * @param {Function} onAlways - callback function 15299 */ 15300 function ImagesLoaded(elem, options, onAlways) { 15301 // coerce ImagesLoaded() without new, to be new ImagesLoaded() 15302 if (!(this instanceof ImagesLoaded)) { 15303 return new ImagesLoaded(elem, options, onAlways); 15304 } 15305 // use elem as selector string 15306 var queryElem = elem; 15307 if (typeof elem == 'string') { 15308 queryElem = document.querySelectorAll(elem); 15309 } 15310 // bail if bad element 15311 if (!queryElem) { 15312 console.error('Bad element for imagesLoaded ' + (queryElem || elem)); 15313 return; 15314 } 15315 15316 this.elements = makeArray(queryElem); 15317 this.options = extend({}, this.options); 15318 // shift arguments if no options set 15319 if (typeof options == 'function') { 15320 onAlways = options; 15321 } else { 15322 extend(this.options, options); 15323 } 15324 15325 if (onAlways) { 15326 this.on('always', onAlways); 15327 } 15328 15329 this.getImages(); 15330 15331 if ($) { 15332 // add jQuery Deferred object 15333 this.jqDeferred = new $.Deferred(); 15334 } 15335 15336 // HACK check async to allow time to bind listeners 15337 setTimeout(this.check.bind(this)); 15338 } 15339 15340 ImagesLoaded.prototype = Object.create(EvEmitter.prototype); 15341 15342 ImagesLoaded.prototype.options = {}; 15343 15344 ImagesLoaded.prototype.getImages = function () { 15345 this.images = []; 15346 15347 // filter & find items if we have an item selector 15348 this.elements.forEach(this.addElementImages, this); 15349 }; 15350 15351 /** 15352 * @param {Node} element 15353 */ 15354 ImagesLoaded.prototype.addElementImages = function (elem) { 15355 // filter siblings 15356 if (elem.nodeName == 'IMG') { 15357 this.addImage(elem); 15358 } 15359 // get background image on element 15360 if (this.options.background === true) { 15361 this.addElementBackgroundImages(elem); 15362 } 15363 15364 // find children 15365 // no non-element nodes, #143 15366 var nodeType = elem.nodeType; 15367 if (!nodeType || !elementNodeTypes[nodeType]) { 15368 return; 15369 } 15370 var childImgs = elem.querySelectorAll('img'); 15371 // concat childElems to filterFound array 15372 for (var i = 0; i < childImgs.length; i++) { 15373 var img = childImgs[i]; 15374 this.addImage(img); 15375 } 15376 15377 // get child background images 15378 if (typeof this.options.background == 'string') { 15379 var children = elem.querySelectorAll(this.options.background); 15380 for (i = 0; i < children.length; i++) { 15381 var child = children[i]; 15382 this.addElementBackgroundImages(child); 15383 } 15384 } 15385 }; 15386 15387 var elementNodeTypes = { 15388 1: true, 15389 9: true, 15390 11: true 15391 }; 15392 15393 ImagesLoaded.prototype.addElementBackgroundImages = function (elem) { 15394 var style = getComputedStyle(elem); 15395 if (!style) { 15396 // Firefox returns null if in a hidden iframe https://bugzil.la/548397 15397 return; 15398 } 15399 // get url inside url("...") 15400 var reURL = /url\((['"])?(.*?)\1\)/gi; 15401 var matches = reURL.exec(style.backgroundImage); 15402 while (matches !== null) { 15403 var url = matches && matches[2]; 15404 if (url) { 15405 this.addBackground(url, elem); 15406 } 15407 matches = reURL.exec(style.backgroundImage); 15408 } 15409 }; 15410 15411 /** 15412 * @param {Image} img 15413 */ 15414 ImagesLoaded.prototype.addImage = function (img) { 15415 var loadingImage = new LoadingImage(img); 15416 this.images.push(loadingImage); 15417 }; 15418 15419 ImagesLoaded.prototype.addBackground = function (url, elem) { 15420 var background = new Background(url, elem); 15421 this.images.push(background); 15422 }; 15423 15424 ImagesLoaded.prototype.check = function () { 15425 var _this = this; 15426 this.progressedCount = 0; 15427 this.hasAnyBroken = false; 15428 // complete if no images 15429 if (!this.images.length) { 15430 this.complete(); 15431 return; 15432 } 15433 15434 function onProgress(image, elem, message) { 15435 // HACK - Chrome triggers event before object properties have changed. #83 15436 setTimeout(function () { 15437 _this.progress(image, elem, message); 15438 }); 15439 } 15440 15441 this.images.forEach(function (loadingImage) { 15442 loadingImage.once('progress', onProgress); 15443 loadingImage.check(); 15444 }); 15445 }; 15446 15447 ImagesLoaded.prototype.progress = function (image, elem, message) { 15448 this.progressedCount++; 15449 this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; 15450 // progress event 15451 this.emitEvent('progress', [this, image, elem]); 15452 if (this.jqDeferred && this.jqDeferred.notify) { 15453 this.jqDeferred.notify(this, image); 15454 } 15455 // check if completed 15456 if (this.progressedCount == this.images.length) { 15457 this.complete(); 15458 } 15459 15460 if (this.options.debug && console) { 15461 console.log('progress: ' + message, image, elem); 15462 } 15463 }; 15464 15465 ImagesLoaded.prototype.complete = function () { 15466 var eventName = this.hasAnyBroken ? 'fail' : 'done'; 15467 this.isComplete = true; 15468 this.emitEvent(eventName, [this]); 15469 this.emitEvent('always', [this]); 15470 if (this.jqDeferred) { 15471 var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; 15472 this.jqDeferred[jqMethod](this); 15473 } 15474 }; 15475 15476 // -------------------------- -------------------------- // 15477 15478 function LoadingImage(img) { 15479 this.img = img; 15480 } 15481 15482 LoadingImage.prototype = Object.create(EvEmitter.prototype); 15483 15484 LoadingImage.prototype.check = function () { 15485 // If complete is true and browser supports natural sizes, 15486 // try to check for image status manually. 15487 var isComplete = this.getIsImageComplete(); 15488 if (isComplete) { 15489 // report based on naturalWidth 15490 this.confirm(this.img.naturalWidth !== 0, 'naturalWidth'); 15491 return; 15492 } 15493 15494 // If none of the checks above matched, simulate loading on detached element. 15495 this.proxyImage = new Image(); 15496 this.proxyImage.addEventListener('load', this); 15497 this.proxyImage.addEventListener('error', this); 15498 // bind to image as well for Firefox. #191 15499 this.img.addEventListener('load', this); 15500 this.img.addEventListener('error', this); 15501 this.proxyImage.src = this.img.src; 15502 }; 15503 15504 LoadingImage.prototype.getIsImageComplete = function () { 15505 // check for non-zero, non-undefined naturalWidth 15506 // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671 15507 return this.img.complete && this.img.naturalWidth; 15508 }; 15509 15510 LoadingImage.prototype.confirm = function (isLoaded, message) { 15511 this.isLoaded = isLoaded; 15512 this.emitEvent('progress', [this, this.img, message]); 15513 }; 15514 15515 // ----- events ----- // 15516 15517 // trigger specified handler for event type 15518 LoadingImage.prototype.handleEvent = function (event) { 15519 var method = 'on' + event.type; 15520 if (this[method]) { 15521 this[method](event); 15522 } 15523 }; 15524 15525 LoadingImage.prototype.onload = function () { 15526 this.confirm(true, 'onload'); 15527 this.unbindEvents(); 15528 }; 15529 15530 LoadingImage.prototype.onerror = function () { 15531 this.confirm(false, 'onerror'); 15532 this.unbindEvents(); 15533 }; 15534 15535 LoadingImage.prototype.unbindEvents = function () { 15536 this.proxyImage.removeEventListener('load', this); 15537 this.proxyImage.removeEventListener('error', this); 15538 this.img.removeEventListener('load', this); 15539 this.img.removeEventListener('error', this); 15540 }; 15541
vendor: 7,714 bytes, lines 15542-15776
15542 // -------------------------- Background -------------------------- // 15543 15544 function Background(url, element) { 15545 this.url = url; 15546 this.element = element; 15547 this.img = new Image(); 15548 } 15549 15550 // inherit LoadingImage prototype 15551 Background.prototype = Object.create(LoadingImage.prototype); 15552 15553 Background.prototype.check = function () { 15554 this.img.addEventListener('load', this); 15555 this.img.addEventListener('error', this); 15556 this.img.src = this.url; 15557 // check if image is already complete 15558 var isComplete = this.getIsImageComplete(); 15559 if (isComplete) { 15560 this.confirm(this.img.naturalWidth !== 0, 'naturalWidth'); 15561 this.unbindEvents(); 15562 } 15563 }; 15564 15565 Background.prototype.unbindEvents = function () { 15566 this.img.removeEventListener('load', this); 15567 this.img.removeEventListener('error', this); 15568 }; 15569 15570 Background.prototype.confirm = function (isLoaded, message) { 15571 this.isLoaded = isLoaded; 15572 this.emitEvent('progress', [this, this.element, message]); 15573 }; 15574 15575 // -------------------------- jQuery -------------------------- // 15576 15577 ImagesLoaded.makeJQueryPlugin = function (jQuery) { 15578 jQuery = jQuery || window.jQuery; 15579 if (!jQuery) { 15580 return; 15581 } 15582 // set local variable 15583 $ = jQuery; 15584 // $().imagesLoaded() 15585 $.fn.imagesLoaded = function (options, callback) { 15586 var instance = new ImagesLoaded(this, options, callback); 15587 return instance.jqDeferred.promise($(this)); 15588 }; 15589 }; 15590 // try making plugin 15591 ImagesLoaded.makeJQueryPlugin(); 15592 15593 // -------------------------- -------------------------- // 15594 15595 return ImagesLoaded; 15596}); 15597 15598/***/ }), 15599/* 26 */ 15600/***/ (function(module, exports, __webpack_require__) { 15601 15602var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 15603 * EvEmitter v1.1.0 15604 * Lil' event emitter 15605 * MIT License 15606 */ 15607 15608/* jshint unused: true, undef: true, strict: true */ 15609 15610(function (global, factory) { 15611 // universal module definition 15612 /* jshint strict: false */ /* globals define, module, window */ 15613 if (true) { 15614 // AMD - RequireJS 15615 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 15616 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 15617 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 15618 __WEBPACK_AMD_DEFINE_FACTORY__), 15619 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 15620 } else if (typeof module == 'object' && module.exports) { 15621 // CommonJS - Browserify, Webpack 15622 module.exports = factory(); 15623 } else { 15624 // Browser globals 15625 global.EvEmitter = factory(); 15626 } 15627})(typeof window != 'undefined' ? window : this, function () { 15628 15629 "use strict"; 15630 15631 function EvEmitter() {} 15632 15633 var proto = EvEmitter.prototype; 15634 15635 proto.on = function (eventName, listener) { 15636 if (!eventName || !listener) { 15637 return; 15638 } 15639 // set events hash 15640 var events = this._events = this._events || {}; 15641 // set listeners array 15642 var listeners = events[eventName] = events[eventName] || []; 15643 // only add once 15644 if (listeners.indexOf(listener) == -1) { 15645 listeners.push(listener); 15646 } 15647 15648 return this; 15649 }; 15650 15651 proto.once = function (eventName, listener) { 15652 if (!eventName || !listener) { 15653 return; 15654 } 15655 // add event 15656 this.on(eventName, listener); 15657 // set once flag 15658 // set onceEvents hash 15659 var onceEvents = this._onceEvents = this._onceEvents || {}; 15660 // set onceListeners object 15661 var onceListeners = onceEvents[eventName] = onceEvents[eventName] || {}; 15662 // set flag 15663 onceListeners[listener] = true; 15664 15665 return this; 15666 }; 15667 15668 proto.off = function (eventName, listener) { 15669 var listeners = this._events && this._events[eventName]; 15670 if (!listeners || !listeners.length) { 15671 return; 15672 } 15673 var index = listeners.indexOf(listener); 15674 if (index != -1) { 15675 listeners.splice(index, 1); 15676 } 15677 15678 return this; 15679 }; 15680 15681 proto.emitEvent = function (eventName, args) { 15682 var listeners = this._events && this._events[eventName]; 15683 if (!listeners || !listeners.length) { 15684 return; 15685 } 15686 // copy over to avoid interference if .off() in listener 15687 listeners = listeners.slice(0); 15688 args = args || []; 15689 // once stuff 15690 var onceListeners = this._onceEvents && this._onceEvents[eventName]; 15691 15692 for (var i = 0; i < listeners.length; i++) { 15693 var listener = listeners[i]; 15694 var isOnce = onceListeners && onceListeners[listener]; 15695 if (isOnce) { 15696 // remove listener 15697 // remove before trigger to prevent recursion 15698 this.off(eventName, listener); 15699 // unset once flag 15700 delete onceListeners[listener]; 15701 } 15702 // trigger listener 15703 listener.apply(this, args); 15704 } 15705 15706 return this; 15707 }; 15708 15709 proto.allOff = function () { 15710 delete this._events; 15711 delete this._onceEvents; 15712 }; 15713 15714 return EvEmitter; 15715}); 15716 15717/***/ }), 15718/* 27 */, 15719/* 28 */, 15720/* 29 */, 15721/* 30 */, 15722/* 31 */, 15723/* 32 */, 15724/* 33 */, 15725/* 34 */, 15726/* 35 */, 15727/* 36 */, 15728/* 37 */, 15729/* 38 */, 15730/* 39 */, 15731/* 40 */, 15732/* 41 */, 15733/* 42 */, 15734/* 43 */, 15735/* 44 */, 15736/* 45 */, 15737/* 46 */, 15738/* 47 */, 15739/* 48 */, 15740/* 49 */, 15741/* 50 */, 15742/* 51 */, 15743/* 52 */, 15744/* 53 */, 15745/* 54 */, 15746/* 55 */, 15747/* 56 */, 15748/* 57 */, 15749/* 58 */ 15750/***/ (function(module, __webpack_exports__, __webpack_require__) { 15751 15752"use strict"; 15753Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 15754/* WEBPACK VAR INJECTION */(function(jQuery) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(0); 15755/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__); 15756/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_imagesloaded__ = __webpack_require__(25); 15757/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_imagesloaded___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_imagesloaded__); 15758/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_carousel__ = __webpack_require__(12); 15759/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_carousel___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_carousel__); 15760/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__lib_owlcarousel_assets_owl_carousel_min_css__ = __webpack_require__(14); 15761/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__lib_owlcarousel_assets_owl_carousel_min_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__lib_owlcarousel_assets_owl_carousel_min_css__); 15762/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__lib_owlcarousel_assets_owl_theme_default_min_css__ = __webpack_require__(17); 15763/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__lib_owlcarousel_assets_owl_theme_default_min_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__lib_owlcarousel_assets_owl_theme_default_min_css__); 15764/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__lib_owlcarousel_assets_animate_css__ = __webpack_require__(19); 15765/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__lib_owlcarousel_assets_animate_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__lib_owlcarousel_assets_animate_css__); 15766/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__maxin__ = __webpack_require__(9); 15767/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__browser__ = __webpack_require__(6); 15768/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__base__ = __webpack_require__(10); 15769/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__share_es6__ = __webpack_require__(13); 15770/* eslint no-loop-func: 0 */ 15771/* eslint no-unused-vars: 0 */ 15772/* eslint prefer-destructuring: ["off", {VariableDeclarator: {object: false}}] */ 15773/* eslint no-lonely-if: "off" */ 15774/* eslint max-len: ["off", { "code": 250 }] */ 15775/* eslint no-undef: "off" */ 15776/* eslint func-names: ["error", "never"] */
15777/* eslint no-use-before-define: "off" */ 15778/* eslint no-restricted-globals: ["off", "location"] */ 15779 15780/** 15781 * ------------------------------------------------------------------ 15782 * æ°é»æè¿°è¯´æ 15783 * ------------------------------------------------------------------ 15784 */ 15785 15786 15787 15788 15789 15790 15791 15792 15793 15794 15795 15796 15797__WEBPACK_IMPORTED_MODULE_0_jquery___default()(() => { 15798 const $targetSectionAppendElement = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#newslist-list'); // åºåå®¹å¨ 15799 const $searchBtn = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-search-btn'); // æå¯»æé® 15800 // const $searchBar = $('.newslist-subtitle-aside'); 15801 const $searchInput = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-search-input'); // æå¯»è¾å ¥æ¡ 15802 // let inputDefaultWords; //æ¾ç½®åå è¾å ¥æ¡æ¡æç¤ºæå 15803 const $searchToActionBtn = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-search-submit-btn'); // éåºæå¯»æé® 15804 // let hotSearchKeyWord = "红é è¹ä " //æå¯»æ¡å ççé¨å ³é®åæç¤º 15805 const $targetSectionNotice = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-notice'); // æå¯»ç»æè¯´æåºå 15806 const $searchInputBtn = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-search-input-box'); 15807 const $recipelistTotalnumNote = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-totalnum b'); // æ¾ç¤ºå ç¬ä½ç½® 15808 15809 const barndId = ''; 15810 let searchRespons; // array è£ è½½ JSON èµæ 15811 15812 // å 载使ç¨åæ° 15813 const defaultNum = 10; // å¼å§æ¶é¢è®¾å¼ 15814 let totalNum = 0; // æææ°é»æ»åæ° 15815 let nowPage = 1; // ç¶åè¦è·³è½çé æ¸ 15816 let maxPage; // ææé æ¸ 15817 let loading = false; 15818 let countPage; // å è½½è§å使ç¨,夿æ¯å¦å¥ç¨å è½½è§å 15819 let statusRulePage = false; // æ¯å¦å¥ç¨ f4-b5 è§å 15820 let keyWords = ''; 15821 let statusFinishAppendElement = false; // append element æ¯å¦å è½½å®æ 15822 let statusSearchResult = false; // æ¯å¦æå¯»ç»æç¶æ 15823 let statusInputKeyword = false; // 夿æå¯»è¾å ¥ 15824 let statusLoadElement; // èªå¨å è½½ç¶æ 15825 15826 const $cates = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#news-selector-cates'); // select æ°é»å¨æåç±»éå 15827 const $brand = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#news-selector-brand'); // select æ°é»å¨æåçéå 15828 15829 const brandObject = {}; // åçæ¸ å 15830 const brandRevertObject = {}; // åçæ¸ å 15831 const brandNum = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#news-selector-brand option').size(); 15832 for (let i = 0; i < brandNum; i += 1) { 15833 brandObject[__WEBPACK_IMPORTED_MODULE_0_jquery___default()(`#news-selector-brand option:eq(${i})`).text()] = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(`#news-selector-brand option:eq(${i})`).val(); 15834 brandRevertObject[__WEBPACK_IMPORTED_MODULE_0_jquery___default()(`#news-selector-brand option:eq(${i})`).val()] = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(`#news-selector-brand option:eq(${i})`).text(); 15835 } 15836 15837 const styleObject = {}; // å¨æç±»åæ¸ å 15838 const stylerRevertObject = {}; // å¨æç±»åæ¸ å 15839 const styleNum = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#news-selector-cates option').size(); 15840 for (let i = 0; i < styleNum; i += 1) { 15841 styleObject[__WEBPACK_IMPORTED_MODULE_0_jquery___default()(`#news-selector-cates option:eq(${i})`).text()] = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(`#news-selector-cates option:eq(${i})`).val(); 15842 stylerRevertObject[__WEBPACK_IMPORTED_MODULE_0_jquery___default()(`#news-selector-cates option:eq(${i})`).val()] = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(`#news-selector-cates option:eq(${i})`).text(); 15843 } 15844 15845 let resizeTimer; 15846 let brandNeme = ''; 15847 15848 // $searchBtn.on('click', () => { 15849 // $searchBar.addClass('status-search-on'); // å±å¼è¾å ¥æ¡ 15850 // $searchInputBtn.fadeIn(600); 15851 // return false; 15852 // }); 15853 15854 $searchInput.on('focus', () => { 15855 statusInputKeyword = false; // æ¯å¦æè¾å ¥æå 15856 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).on('keydown', event => { 15857 if (event.keyCode === 13) { 15858 // ç»å®å车 15859 // 妿䏿¯ç©ºå¼ææ§è¡ 15860 if ($searchInput.val() !== '') { 15861 statusInputKeyword = true; // æ¯å¦æè¾å ¥æå 15862 } 15863 $searchToActionBtn.click(); 15864 return false;
15865 } 15866 return true; 15867 }); 15868 $searchInput.one('blur', function () { 15869 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).val() === '') { 15870 // åå¤è¾å ¥ç¶æ 15871 // $searchInputBtn.fadeOut(300, () => { 15872 // $searchBar.removeClass('status-search-on'); 15873 // }); 15874 15875 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-more-btn').remove(); 15876 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).unbind('scroll', scrollSearch); // é¤å»å·å¨ä¾¦å¬ 15877 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).unbind('scroll', scrollDefault); // é¤å»å·å¨ä¾¦å¬ 15878 keyWords = ''; 15879 statusSearchResult = true; 15880 nowPage = 1; 15881 countPage = 1; 15882 $targetSectionNotice.hide(); 15883 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeIn(300); 15884 $targetSectionAppendElement.fadeOut(300, () => { 15885 $targetSectionAppendElement.html(''); 15886 $cates.val(''); 15887 $brand.val(''); 15888 15889 searchActionFn(false, nowPage, '', '', keyWords); 15890 15891 $targetSectionAppendElement.fadeIn(300); 15892 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeOut(300); 15893 }); 15894 } else { 15895 statusInputKeyword = true; 15896 } 15897 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).off('keydown', null); 15898 }); 15899 }); 15900 // ç¹å»æå¯»æé®éåºæå¯» 15901 $searchToActionBtn.on('click', () => { 15902 if (statusInputKeyword === true) { 15903 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-more-btn').remove(); 15904 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).unbind('scroll', scrollSearch); // é¤å»å·å¨ä¾¦å¬ 15905 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).unbind('scroll', scrollDefault); // é¤å»å·å¨ä¾¦å¬ 15906 statusLoadElement = false; 15907 keyWords = jQuery.trim(__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-search-input').val()); 15908 if (keyWords !== '') { 15909 statusSearchResult = true; 15910 nowPage = 1; 15911 countPage = 1; 15912 $targetSectionNotice.hide(); 15913 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeIn(300); 15914 $targetSectionAppendElement.fadeOut(300, () => { 15915 $targetSectionAppendElement.html(''); 15916 $cates.val(''); 15917 $brand.val(''); 15918 const cat = $cates.val(); 15919 15920 searchActionFn(false, nowPage, '', '', keyWords); 15921 $targetSectionAppendElement.fadeIn(300); 15922 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeOut(300); 15923 }); 15924 } else { 15925 nowPage = 0; 15926 countPage = 0; 15927 $targetSectionAppendElement.find('li').fadeOut(300).delay(300); 15928 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-item').remove(); // æ¸ ç©ºæå¯»ç»æ 15929 $targetSectionNotice.show(); 15930 $targetSectionNotice.text('请æ¨è¾å ¥æç´¢å ³é®åã'); 15931 } 15932 } 15933 return false; 15934 }); 15935 15936 $cates.change(() => { 15937 const cat = $cates.val(); 15938 const brand = $brand.val(); 15939 // $brand.val(0); 15940 $searchInput.val(''); 15941 keyWords = ''; 15942 nowPage = 1; 15943 countPage = 1; 15944 15945 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeIn(300); 15946 $targetSectionNotice.hide(); 15947 $targetSectionAppendElement.fadeOut(300, () => { 15948 $targetSectionAppendElement.html(''); 15949 searchActionFn(false, nowPage, brand, cat, keyWords); 15950 $targetSectionAppendElement.fadeIn(300); 15951 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeOut(300); 15952 }); 15953 }); 15954 15955 $brand.change(() => { 15956 const cat = $cates.val(); 15957 // $cates.val(0); 15958 const brand = $brand.val(); 15959 brandNeme = brand; 15960 $searchInput.val(''); 15961 keyWords = ''; 15962 nowPage = 1; 15963 countPage = 1; 15964 15965 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeIn(300); 15966 $targetSectionNotice.hide(); 15967 $targetSectionAppendElement.fadeOut(300, () => { 15968 $targetSectionAppendElement.html(''); 15969 searchActionFn(false, nowPage, brand, cat, keyWords); 15970 $targetSectionAppendElement.fadeIn(300); 15971 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeOut(300); 15972 }); 15973 }); 15974 15975 let scrollSearch = () => { 15976 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scrollTop() >= __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#newslist-list').offset().top + __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#newslist-list').height() * 0.3) { 15977 statusLoadElement = true; 15978 } else { 15979 statusLoadElement = false;
15980 } 15981 15982 if (statusLoadElement === true && statusFinishAppendElement === true) { 15983 const scrollTop = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scrollTop(); 15984 const scrollHeight = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).height(); 15985 const windowHeight = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).height(); 15986 const footerPosition = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('footer').offset().top; 15987 15988 // å°ä¸æé忏 空 15989 $cates.val(''); 15990 const cat = $cates.val(); 15991 const newKeyWords = $searchInput.val(); 15992 15993 if (scrollTop + windowHeight >= footerPosition) { 15994 if (loading === false && nowPage < maxPage) { 15995 loading = true; // åç¥ç®å load èµæä¸ 15996 statusFinishAppendElement = false; 15997 nowPage += 1; 15998 countPage += 1; 15999 if (countPage > 1 && countPage < 4) { 16000 searchActionFn(true, nowPage, barndId, cat, newKeyWords); 16001 } else if (countPage === 4) { 16002 searchActionFn(true, nowPage, barndId, cat, newKeyWords); 16003 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).unbind('scroll', scrollSearch); // é¤å»å·å¨ä¾¦å¬ 16004 16005 // $(document).unbind('click'); 16006 // ç¹å»æ´å¤æé® 16007 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).on('click', '.newslist-more-btn', function () { 16008 countPage -= 1; // ä¿®æ£å¤å 1é®é¢ 16009 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeIn(300); 16010 loading = true; // åç¥ç®å load èµæä¸ 16011 if (nowPage < maxPage) { 16012 nowPage += 1; 16013 } 16014 countPage += 1; 16015 16016 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-page-btns').fadeIn(300); 16017 16018 searchActionFn(true, nowPage, barndId, cat, newKeyWords); 16019 // [æ´å¤]æé®æ¶å¤± 16020 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).fadeOut(300).remove(); 16021 statusLoadElement = false; 16022 statusFinishAppendElement = false; 16023 }); 16024 } 16025 } 16026 } 16027 } 16028 }; 16029 16030 const loadRuleBySearch = () => { 16031 if (maxPage > 1) { 16032 // å¯å¨ä¾¦æµå·è½´å è½½ 16033 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scroll(scrollSearch); 16034 } 16035 }; 16036 16037 let titleString; 16038 const changeURL = (page, keyword) => { 16039 const cat = $cates.val() || ''; 16040 const brand = $brand.val() || ''; 16041 16042 if (document.title.indexOf('æç´¢ç»æ') === -1) { 16043 __WEBPACK_IMPORTED_MODULE_0_jquery___default()("meta[name='apple-mobile-web-app-title']").attr('content', `${document.title.split(' ï½')[0]}æç´¢ç»æ ï½${document.title.split(' ï½')[1]}`); 16044 __WEBPACK_IMPORTED_MODULE_0_jquery___default()("meta[property='og:title']").attr('content', `${document.title.split(' ï½')[0]}æç´¢ç»æ ï½${document.title.split(' ï½')[1]}`); 16045 __WEBPACK_IMPORTED_MODULE_0_jquery___default()("meta[name='title']").attr('content', `${document.title.split(' ï½')[0]}æç´¢ç»æ ï½${document.title.split(' ï½')[1]}`); 16046 16047 if (keyword === '') { 16048 History.pushState({}, `${document.title.split(' ï½')[0]}æç´¢ç»æ ï½${document.title.split(' ï½')[1]}`, `${page}-${brand}-${cat}-`); 16049 } else { 16050 History.pushState({}, `${document.title.split(' ï½')[0]}æç´¢ç»æ ï½${document.title.split(' ï½')[1]}`, `${page}-${brand}-${cat}-${keyword}`); 16051 // history.pushState({}, "卿æ°é»", page + "-" + brand + "-" + cat + "-" + encodeURI(keyword)); 16052 } 16053 } else { 16054 if (keyword === '') { 16055 History.pushState({}, document.title, `${page}-${brand}-${cat}-`); 16056 } else { 16057 History.pushState({}, document.title, `${page}-${brand}-${cat}-${keyword}`); 16058 // history.pushState({}, "卿æ°é»", page + "-" + brand + "-" + cat + "-" + encodeURI(keyword)); 16059 } 16060 } 16061 16062 if (keyword === '') { 16063 __WEBPACK_IMPORTED_MODULE_0_jquery___default()("meta[name='description']").attr('content', `æ¨æç´¢çæ¯ ${stylerRevertObject[cat]} / ${brandRevertObject[brand]} æ¹é¢ç欣åèµè®¯ï¼å ³æ³¨æ´å¤ ${stylerRevertObject[cat]} / ${brandRevertObject[brand]} æ¹é¢ç欣åèµè®¯ï¼è¯·å ³æ³¨æ¬£åå®ç½ã`); 16064 __WEBPACK_IMPORTED_MODULE_0_jquery___default()("meta[property='og:description']").attr('content', `æ¨æç´¢çæ¯ ${stylerRevertObject[cat]} / ${brandRevertObject[brand]} æ¹é¢ç欣åèµè®¯ï¼å ³æ³¨æ´å¤ ${stylerRevertObject[cat]} / ${brandRevertObject[brand]} æ¹é¢ç欣åèµè®¯ï¼è¯·å ³æ³¨æ¬£åå®ç½ã`); 16065 } else { 16066 __WEBPACK_IMPORTED_MODULE_0_jquery___default()("meta[name='description']").attr('content', `æ¨æç´¢çæ¯ ${stylerRevertObject[cat]} / ${brandRevertObject[brand]} / ${keyword} æ¹é¢ç欣åèµè®¯ï¼å ³æ³¨æ´å¤ ${stylerRevertObject[cat]} / ${brandRevertObject[brand]} / ${keyword} æ¹é¢ç欣åèµè®¯ï¼è¯·å ³æ³¨æ¬£åå®ç½ã`); 16067 __WEBPACK_IMPORTED_MODULE_0_jquery___default()("meta[property='og:description']").attr('content', `æ¨æç´¢çæ¯ ${stylerRevertObject[cat]} / ${brandRevertObject[brand]} / ${keyword} æ¹é¢ç欣åèµè®¯ï¼å ³æ³¨æ´å¤ ${stylerRevertObject[cat]} / ${brandRevertObject[brand]} / ${keyword} æ¹é¢ç欣åèµè®¯ï¼è¯·å ³æ³¨æ¬£åå®ç½ã`); 16068 } 16069 16070 __WEBPACK_IMPORTED_MODULE_0_jquery___default()("meta[property='og:url']").attr('content', location.href); 16071 }; 16072 16073 // ç¹å»å è½½æ´å¤ 16074 const addnItemElementToContainerFn = (targetElement, searchResponsF) => { 16075 let ifIE8 = false;
16076 16077 // IE 8 issue 16078 if (Object(__WEBPACK_IMPORTED_MODULE_7__browser__["a" /* default */])() === 'IE8') { 16079 ifIE8 = true; 16080 } 16081 // if (BREWSER.browser.type.toString() == "Internet Explorer" && BREWSER.browser.version == "8") { 16082 // ifIE8 = true; 16083 // } 16084 16085 let content = ''; 16086 const array = searchResponsF; 16087 16088 content += `<ul class="newslist-list" style="display:none" data-currentpage="${nowPage}">`; 16089 __WEBPACK_IMPORTED_MODULE_0_jquery___default.a.each(array, (i, n) => { 16090 let descTitle; 16091 let descContent; 16092 // æ é¢è¶ è¿åæ°çå...å¤ç 25å 16093 if (array[i].newsListName.length > 26) { 16094 descTitle = `${array[i].newsListName.substr(0, 25)}...`; 16095 } else { 16096 descTitle = array[i].newsListName; 16097 } 16098 // å æè¶ è¿åæ°çå...å¤ç 30å 16099 if (array[i].newsListDes.length > 31) { 16100 descContent = `${array[i].newsListDes.substr(0, 30)}...`; 16101 } else { 16102 descContent = array[i].newsListDes; 16103 } 16104 16105 content += '<li class="newslist-item" vocab="http://schema.org/" typeof="WebPageElement">'; 16106 content += `<a href="${n.newsListUrl}" title="${n.newsListBrandId}" property="url">`; 16107 content += '<figure class="newslist-img">'; 16108 content += `<img src="/img/up/${n.newsListImg}" alt="${n.newsListName}" property="image">`; 16109 content += '</figure>'; 16110 content += '</a>'; 16111 content += '<div class="newslist-item-content">'; 16112 content += '<div class="news-latest-item-tags">'; 16113 content += `<a href="/news/1--${styleObject[n.newsListTypeId]}" data-type="${styleObject[n.newsListTypeId]}" class="newslist-item-tag styleTarget" title="${n.newsListTypeId}" property="associatedMedia">${n.newsListTypeId}</a>`; 16114 if (brandObject[n.newsListBrandId] !== undefined) { 16115 content += `<a href="/news/1-${brandObject[n.newsListBrandId]}-" data-brandeng="${brandObject[n.newsListBrandId]}" class="newslist-item-tag brandTarget" title="${n.newsListBrandId}" property="creator">${n.newsListBrandId}</a>`; 16116 } 16117 content += '</div>'; 16118 content += `<a href="${n.newsListUrl}" title="${n.newsListBrandId}" class="newslist-item-intro" property="url">`; 16119 content += `<time class="newslist-item-posttime" datetime="${n.newsListTime.split(' ')[0]}" property="datePublished">${n.newsListTime.split(' ')[0]}</time>`; 16120 content += `<h2 class="newslist-item-title" property="headline">${descTitle}</h2>`; 16121 content += `<p property="description">${descContent}</p>`; 16122 content += '</a>'; 16123 content += '</div>'; 16124 content += '</li>'; 16125 }); 16126 content += '</ul>'; 16127 16128 targetElement.append(content); 16129 targetElement.find('.newslist-list').eq(countPage - 1).fadeIn(800, () => { 16130 addChangePageBtn(nowPage, maxPage, statusRulePage, countPage); 16131 changeURL(nowPage, keyWords); 16132 16133 if (ifIE8) { 16134 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-item:nth-child(3n)').addClass('status-last'); 16135 } 16136 16137 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeOut(300); 16138 // $(window).scrollTop($(this).scrollTop()); // ç±äºåé¢ä¸ºäºæ¾ç¤ºâå è½½ä¸â让ç½é¡µä¸æ»äºï¼è¿éè¦å¤åï¼å¦å妿éå°å è½½çå 容é«åº¦ < âå è½½ä¸âé«åº¦ï¼å°±ä¼å¯¼è´åè§¦åæ»å¨å è½½ã 16139 loading = false; // loading åä½çµæ 16140 statusLoadElement = false; // append åä½çµæ 16141 statusFinishAppendElement = true; 16142 if (statusSearchResult === true) { 16143 loadRuleBySearch(); 16144 } 16145 }); 16146 }; 16147 16148 // ajax æåèµæ 16149 let searchActionFn = (ifDefault, page, barndIdF, catesVal, keywords) => { 16150 const tempvals = [page, barndIdF, catesVal, keywords]; 16151 let result; // ç»æ 16152 const tempitem = __WEBPACK_IMPORTED_MODULE_9__share_es6__["a" /* ajaxarr */]('newslist', tempvals, '/ajax'); 16153 tempitem.success(data => { 16154 if (data[0] === 'ERR') { 16155 result = 'ERR'; 16156 } else { 16157 result = 'SUCCESS'; 16158 searchRespons = data[1]; 16159 totalNum = Number(data[2]); // ææçæ¸ 16160 if (ifDefault === false) { 16161 // ç¹å»æé®æå¯»æ¶æ§è¡
16162 maxPage = Math.ceil(totalNum / defaultNum); // ææèµæé¡µæ° 16163 } 16164 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-totalnum').attr('data-count', totalNum); // data-count æ¹åç¬æ°èµæ 16165 $recipelistTotalnumNote.text(totalNum); // ç»æèµæç¬æ° 16166 // ajax append çµæ 16167 } 16168 }); 16169 tempitem.error((xhr, ajaxOptions, thrownError) => {}); 16170 tempitem.complete(() => { 16171 if (result === 'SUCCESS') { 16172 if (totalNum !== 0) { 16173 $targetSectionNotice.fadeOut(300); 16174 addnItemElementToContainerFn($targetSectionAppendElement, searchRespons); 16175 } else { 16176 $targetSectionNotice.fadeIn(300); 16177 } 16178 } 16179 }); 16180 }; 16181 // 侦æµé¢è®¾å·è½´å è½½ 16182 let scrollDefault = () => { 16183 if (__WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scrollTop() >= __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#newslist-list').offset().top + __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#newslist-list').height() * 0.3) { 16184 statusLoadElement = true; // æ¯å¦è¿å ¥å·å¨è§¦å 16185 } else { 16186 statusLoadElement = false; // æ¯å¦è¿å ¥å·å¨è§¦å 16187 } 16188 16189 if (statusLoadElement === true && statusFinishAppendElement === true) { 16190 const scrollTop = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scrollTop(); 16191 const scrollHeight = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).height(); 16192 const windowHeight = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).height(); 16193 const footerPosition = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('footer').offset().top; 16194 16195 if (scrollTop + windowHeight >= footerPosition) { 16196 if (loading === false && nowPage < maxPage) { 16197 loading = true; // åç¥ç®å load èµæä¸ 16198 statusFinishAppendElement = false; 16199 nowPage += 1; 16200 countPage += 1; 16201 16202 if (countPage > 1 && countPage < 4) { 16203 searchActionFn(true, nowPage, '', '', ''); 16204 16205 if (nowPage === maxPage) { 16206 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).unbind('scroll', scrollDefault); // é¤å»å·å¨ä¾¦å¬ 16207 } 16208 } else if (countPage === 4) { 16209 searchActionFn(true, nowPage, '', '', ''); 16210 statusLoadElement = false; // æ¯å¦è¿å ¥å·å¨è§¦å (å ³éå·å¨å¼å ³) 16211 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).unbind('scroll', scrollDefault); // é¤å»å·å¨ä¾¦å¬ 16212 16213 // $(document).unbind('click'); 16214 // ç¹å»æ´å¤æé® 16215 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).on('click', '.newslist-more-btn', function () { 16216 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeIn(300); 16217 loading = true; // åç¥ç®å load èµæä¸ 16218 if (nowPage < maxPage) { 16219 nowPage += 1; 16220 } 16221 countPage += 1; 16222 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-page-btns').fadeIn(300); 16223 searchActionFn(true, nowPage, '', '', ''); 16224 // [æ´å¤]æé®æ¶å¤± 16225 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).fadeOut(300).remove(); 16226 16227 statusFinishAppendElement = false; 16228 }); 16229 } 16230 } 16231 } 16232 } 16233 }; 16234 16235 // èªç¶éå页é¢å¾çäºåå¨ä½ 16236 const defaultActioninit = () => { 16237 totalNum = Number(__WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-totalnum').data('count')); // ç± data-count 屬æ§è·å¾èµæçæ¸ 16238 maxPage = Math.ceil(totalNum / defaultNum); // ææèµæé¡µæ° 16239 16240 countPage = 1; 16241 statusFinishAppendElement = true; 16242 statusLoadElement = false; 16243 16244 nowPage = Number(document.location.pathname.match(/[^/]+$/)[0].split('-')[0]); // (*option*)ç±ç½åè·ç¥å½åèµææ¯ page å 16245 if (document.location.pathname.match(/[^/]+$/)[0].split('-')[3]) { 16246 // æ¥çç½åæ¯å¦æå ³é®å 16247 keyWords = decodeURI(document.location.pathname.match(/[^/]+$/)[0].split('-')[3]); 16248 } 16249 16250 // è¥å¸¦å ¥ page ç¬æ¸è¥è¶ éçµæå¼ï¼æ¾ç¤ºæç¤º 16251 if (maxPage < nowPage) { 16252 $targetSectionNotice.show(); 16253 $targetSectionNotice.text('ç®åè¿æ²¡æè¯¥åççæ°å¨æï¼æ¬è¯·æå¾ ã'); 16254 $recipelistTotalnumNote.text('0'); 16255 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeOut(300); 16256 return; 16257 } 16258 16259 // 夿æç¤ºåºåæ¯å¦æ¾ç¤º 16260 if (totalNum !== 0) { 16261 $targetSectionNotice.hide(); 16262 } else { 16263 $targetSectionNotice.show(); 16264 } 16265 16266 // æ¯å¦å¥å ¥f4-load-b5-ç¹å» å è½½è§å 16267 if (maxPage - nowPage >= 4) { 16268 statusRulePage = true; 16269 } else { 16270 statusRulePage = false;
16271 } 16272 16273 // é±èloadingå示 16274 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#loading').fadeOut(300); 16275 16276 if (maxPage > 1) { 16277 // å¥ç¨å è½½æé®æ¾ç¤ºåè½ 16278 addChangePageBtn(nowPage, maxPage, statusRulePage, countPage); 16279 // å¯å¨ä¾¦æµé¢è®¾å·è½´å è½½ 16280 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scroll(scrollDefault); 16281 } 16282 }; 16283 16284 // ç¹å»[ä¸ä¸é¡µ]æé® 16285 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).on('click', '.newslist-prev-btn', function (e) { 16286 goPage(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('gotopage')); 16287 }); 16288 16289 // ç¹å»[ä¸ä¸é¡µ]æé® 16290 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(document).on('click', '.newslist-next-btn', function (e) { 16291 goPage(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).data('gotopage')); 16292 }); 16293 16294 // (*option*)ç¹å»[ä¸ä¸é¡µ]æé®åå¾é¡µé¢å¨ä½ 16295 const goPage = function (who) { 16296 const urlStr = document.location.pathname.match(/[^/]+$/)[0]; 16297 const urlStrArray = urlStr.split('-'); 16298 16299 const urlArrayLen = urlStrArray.length; 16300 if (urlArrayLen === 1) { 16301 urlStrArray[1] = ''; 16302 urlStrArray[2] = ''; 16303 urlStrArray[3] = ''; 16304 } else if (urlArrayLen === 2) { 16305 urlStrArray[2] = ''; 16306 urlStrArray[3] = ''; 16307 } else if (urlArrayLen === 3) { 16308 urlStrArray[3] = ''; 16309 } 16310 16311 let url = ''; 16312 url += location.href.substr(0, location.href.indexOf(`/${urlStr}`)); 16313 16314 if (urlStrArray[3] !== '') { 16315 // ç½åæ¯å¦éè¦å¸¦å ¥å ³é®å 16316 location.href = `${url}/${who}-${urlStrArray[1]}-${urlStrArray[2]}-${urlStrArray[3]}`; 16317 } else { 16318 location.href = `${url}/${who}-${urlStrArray[1]}-${urlStrArray[2]}-`; 16319 } 16320 }; 16321 16322 // append åæ[ä¸ä¸é ]æéææ´å¤æé 16323 let addChangePageBtn = (nowPageF, maxPageF, statusRulePageF, countPageF) => { 16324 if (totalNum === 0) { 16325 return; 16326 } 16327 16328 if (nowPageF === 1 && maxPageF === 1) { 16329 return; 16330 } 16331 if (statusRulePageF === false) { 16332 if (nowPageF === 1) { 16333 $targetSectionAppendElement.append(`<div class="newslist-page-btns" style="display:none"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}" style="display:none"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}"><i class="icon-arrow-right"></i></button></div>`); 16334 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-page-btns').fadeIn(300); 16335 } else if (nowPageF === maxPageF) { 16336 $targetSectionAppendElement.append(`<div class="newslist-page-btns"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}" style="display:none"><i class="icon-arrow-right"></i></button></div>`); 16337 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-page-btns').fadeIn(300); 16338 } else { 16339 $targetSectionAppendElement.append(`<div class="newslist-page-btns"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}"><i class="icon-arrow-right"></i></button></div>`); 16340 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-page-btns').fadeIn(300); 16341 } 16342 } else if (nowPageF === countPageF) { 16343 if (nowPageF === 1) { 16344 $targetSectionAppendElement.append(`<div class="newslist-page-btns" style="display:none"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}" style="display:none"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}"><i class="icon-arrow-right"></i></button></div>`); 16345 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-page-btns').fadeIn(300); 16346 } else if (nowPageF === maxPageF) { 16347 $targetSectionAppendElement.append(`<div class="newslist-page-btns"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}" style="display:none"><i class="icon-arrow-right"></i></button></div>`); 16348 } else if (nowPageF < 4 && nowPageF > 1) { 16349 $targetSectionAppendElement.append(`<div class="newslist-page-btns"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}"><i class="icon-arrow-right"></i></button></div>`); 16350 } else if (nowPageF >= 4 && nowPageF < maxPageF) { 16351 $targetSectionAppendElement.append(`<div class="newslist-page-btns" style="display:none"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}"><i class="icon-arrow-right"></i></button></div>`); 16352 $targetSectionAppendElement.append(`<button class="newslist-more-btn" data-gotopage="${nowPageF + 1}">å è½½æ´å¤</button>`); 16353 } 16354 } else if (countPageF < 4) { 16355 $targetSectionAppendElement.append(`<div class="newslist-page-btns"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}"><i class="icon-arrow-right"></i></button></div>`); 16356 } else { 16357 if (nowPageF === maxPageF) { 16358 $targetSectionAppendElement.append(`<div class="newslist-page-btns"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}" style="display:none"><i class="icon-arrow-right"></i></button></div>`); 16359 } else { 16360 $targetSectionAppendElement.append(`<div class="newslist-page-btns" style="display:none"><button class="newslist-prev-btn" data-gotopage="${nowPageF - 1}"><i class="icon-arrow-left"></i></button><button class="newslist-next-btn" data-gotopage="${nowPageF + 1}"><i class="icon-arrow-right"></i></button></div>`); 16361 $targetSectionAppendElement.append(`<button class="newslist-more-btn" data-gotopage="${nowPageF + 1}">å è½½æ´å¤</button>`); 16362 } 16363 } 16364 }; 16365 16366 function BrowserType() { 16367 const userAgent = navigator.userAgent; // å徿µè§å¨çuserAgentå符串 16368 const isOpera = userAgent.indexOf('Opera') > -1; // 夿æ¯å¦Operaæµè§å¨ 16369 // var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //夿æ¯å¦IEæµè§å¨ 16370 const isIE = window.ActiveXObject || 'ActiveXObject' in window; 16371 // var isEdge = userAgent.indexOf("Windows NT 6.1; Trident/7.0;") > -1 && !isIE; //夿æ¯å¦IEçEdgeæµè§å¨ 16372 const isEdge = userAgent.indexOf('Edge') > -1; // 夿æ¯å¦IEçEdgeæµè§å¨ 16373 const isFF = userAgent.indexOf('Firefox') > -1; // 夿æ¯å¦Firefoxæµè§å¨ 16374 const isSafari = userAgent.indexOf('Safari') > -1 && userAgent.indexOf('Chrome') === -1; // 夿æ¯å¦Safariæµè§å¨ 16375 const isChrome = userAgent.indexOf('Chrome') > -1 && userAgent.indexOf('Safari') > -1 && !isEdge; // 夿Chromeæµè§å¨ 16376 16377 if (isIE) { 16378 const reIE = new RegExp('MSIE (\\d+\\.\\d+);'); 16379 reIE.test(userAgent); 16380 const fIEVersion = parseFloat(RegExp.$1); 16381 return 'IE'; 16382 // if (userAgent.indexOf('MSIE 6.0') != -1) { 16383 // return "IE6"; 16384 // } else if (fIEVersion == 7) { return "IE7"; } else if (fIEVersion == 8) { return "IE8"; } else if (fIEVersion == 9) { return "IE9"; } else if (fIEVersion == 10) { return "IE10"; } else if (userAgent.toLowerCase().match(/rv:([\d.]+)\) like gecko/)) { 16385 // return "IE11"; 16386 // } else { return "0" } //IEçæ¬è¿ä½ 16387 } // isIE end 16388 16389 if (isFF) { 16390 return 'FF'; 16391 } 16392 if (isOpera) { 16393 return 'Opera'; 16394 } 16395 if (isSafari) { 16396 return 'Safari'; 16397 } 16398 if (isChrome) { 16399 return 'Chrome'; 16400 } 16401 if (isEdge) { 16402 return 'Edge'; 16403 } 16404 } 16405 16406 // 鏿åç䏿é¸å®ï¼é¸æå¾æ¹è® selector 寬度 16407 function selectedBrandWidthChanger() { 16408 const selectedBrand = $brand.find(':selected').text(); 16409 let str = encodeURIComponent(selectedBrand); 16410 str = str.replace(/%[A-F\d]{2}/g, 'U').length; 16411 16412 if (str > 12) { 16413 if (BrowserType() === 'IE') { 16414 $cates.outerWidth(135); 16415 $brand.outerWidth((str - 12) * 5 + 125); 16416 } else { 16417 $brand.outerWidth((str - 12) * 5 + 105); 16418 } 16419 // console.log("str å¤§æ¼ 12"); 16420 } else { 16421 if (BrowserType() === 'IE') { 16422 $cates.outerWidth(135); 16423 $brand.outerWidth(135); 16424 } else { 16425 $brand.outerWidth(105); 16426 } 16427 // console.log("str å°æ¼çæ¼ 12"); 16428 } 16429 } 16430 16431 // å¨ Pad 寬度以ä¸çæ¬ éå selectedBrandWidthChanger() 16432 function selectedBrandWidthSwitch() { 16433 if (__WEBPACK_IMPORTED_MODULE_8__base__["a" /* default */].viewport(Object(__WEBPACK_IMPORTED_MODULE_6__maxin__["a" /* default */])()) === 'max' || __WEBPACK_IMPORTED_MODULE_8__base__["a" /* default */].viewport(Object(__WEBPACK_IMPORTED_MODULE_6__maxin__["a" /* default */])()) === 'desktop' || __WEBPACK_IMPORTED_MODULE_8__base__["a" /* default */].viewport(Object(__WEBPACK_IMPORTED_MODULE_6__maxin__["a" /* default */])()) === 'tablet') { 16434 // $brand.on('change', selectedBrandWidthChanger); 16435 16436 if (brandNeme === '') { 16437 if (BrowserType() === 'IE') { 16438 $cates.outerWidth(135); 16439 $brand.outerWidth(135); 16440 } else { 16441 $brand.outerWidth(105); 16442 } 16443 } else { 16444 const barndCNameListArray = Object.keys(brandObject); // 䏿åçå Array 16445 const barndENameListArray = Object.keys(brandRevertObject); // è±æåçå Array 16446 16447 for (let i = 0; i < brandNum; i += 1) { 16448 if (barndENameListArray[i] === brandNeme) { 16449 let str = encodeURIComponent(barndCNameListArray[i]); 16450 str = str.replace(/%[A-F\d]{2}/g, 'U').length; 16451 16452 if (str > 12) { 16453 if (BrowserType() === 'IE') { 16454 $cates.outerWidth(135); 16455 $brand.outerWidth((str - 12) * 5 + 125); 16456 } else { 16457 $brand.outerWidth((str - 12) * 5 + 105); 16458 } 16459 } else if (BrowserType() === 'IE') { 16460 $cates.outerWidth(135); 16461 $brand.outerWidth(135); 16462 } else { 16463 $brand.outerWidth(105); 16464 } 16465 } 16466 } 16467 } 16468 } else { 16469 // $brand.off('change', selectedBrandWidthChanger); 16470 16471 if (BrowserType() === 'IE') { 16472 $cates.outerWidth(135); 16473 $brand.outerWidth(135); 16474 } else { 16475 $brand.outerWidth(105); 16476 } 16477 } 16478 } 16479 16480 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).resize(() => { 16481 window.clearTimeout(resizeTimer); 16482 resizeTimer = window.setTimeout(() => { 16483 // Resize å¾éæ°åµæ¸¬è¼å ·å¯¬åº¦ 夿·æ¯å¦éå selectedBrandWidthChanger() 16484 // selectedBrandWidthSwitch(); 16485 }, 300); 16486 }); 16487 16488 // åå§å½æ° 16489 const init = function () { 16490 // keyvisial è½®æ¨ js å¥ç¨ 16491 16492 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.news-highlight-slide').owlCarousel({ 16493 loop: true, 16494 items: 1, 16495 responsiveClass: true, 16496 startPosition: 0, 16497 nav: true, 16498 dots: true, 16499 autoplay: true, 16500 autoplayTimeout: 5000, 16501 autoplayHoverPause: true, 16502 mouseDrag: true, 16503 touchDrag: true, 16504 responsive: { 16505 0: { 16506 nav: false 16507 }, 16508 960: { 16509 nav: true 16510 } 16511 } 16512 }); 16513 16514 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.owl-stage').css('padding-left', '0'); 16515 $targetSectionNotice.text('没æä¸ºæ¨æ¾å°æ¨éè¦ç卿æ°é»ï¼è¯·å°è¯æç´¢å ¶ä»å ³é®è¯ã'); 16516 $targetSectionNotice.hide(); 16517 // ä¸è¿æ¥æ§è¡çåå§è®¾å® 16518 defaultActioninit(); 16519 // å¤çç½åè¿æ¥å¾å¯¹åºåå 16520 const script_name = document.location.pathname.match(/[^/]+$/)[0]; 16521 const urlArray = script_name.split('-');
16522 const urlArrayLen = urlArray.length; 16523 if (urlArrayLen === 1) { 16524 urlArray[1] = ''; 16525 urlArray[2] = ''; 16526 urlArray[3] = ''; 16527 } else if (urlArrayLen === 2) { 16528 urlArray[2] = ''; 16529 urlArray[3] = ''; 16530 } else if (urlArrayLen === 3) { 16531 urlArray[3] = ''; 16532 } 16533 if ($cates) { 16534 $cates.val(urlArray[2]); 16535 } 16536 if ($brand) { 16537 $brand.val(decodeURI(urlArray[1])); 16538 brandNeme = decodeURI(urlArray[1]); 16539 } 16540 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-list').attr('data-currentpage', nowPage); 16541 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-search-input').val(decodeURI(urlArray[3])); 16542 16543 // selectedBrandWidthSwitch(); 16544 16545 // æ£æ¥ä¸å¼å§è¿æ¥çå¾çæ¯å¦æ£å¸¸ 16546 __WEBPACK_IMPORTED_MODULE_1_imagesloaded___default.a.makeJQueryPlugin(__WEBPACK_IMPORTED_MODULE_0_jquery___default.a); 16547 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#newslist-list').imagesLoaded().always(instance => { 16548 // console.log('all images loaded'); 16549 }).done(instance => { 16550 // console.log('all images successfully loaded'); 16551 }).fail(() => { 16552 // console.log('all images loaded, at least one is broken'); 16553 }).progress((instance, image) => { 16554 const imageTarget = image; 16555 const result = imageTarget.isLoaded ? 'loaded' : 'broken'; 16556 // console.log('image is ' + result + ' for ' + image.img.src); 16557 if (result === 'broken') { 16558 imageTarget.img.src = '/img/backupimage_469x312.png'; 16559 } 16560 }); 16561 16562 // å¾çç ´ææ¶æ´æ¢æå«æ¡£å¾ 16563 document.addEventListener('error', e => { 16564 __WEBPACK_IMPORTED_MODULE_0_jquery___default()('.newslist-img img').error(function () { 16565 __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).attr('src', '/img/backupimage_469x312.png'); 16566 }); 16567 }, true); 16568 }; 16569 // æ§è¡åå§ 16570 init(); 16571}); 16572/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0))) 16573 16574/***/ }) 16575/******/ ]); 16576//# sourceMappingURL=../../src/map/lyt-cn-news-list.js.map
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.