vendor: 4,592 bytes, lines 1-183
1/*! 2 * jQuery JavaScript Library v1.12.3 3 * http://jquery.com/ 4 * 5 * Includes Sizzle.js 6 * http://sizzlejs.com/ 7 * 8 * Copyright jQuery Foundation and other contributors 9 * Released under the MIT license 10 * http://jquery.org/license 11 * 12 * Date: 2016-04-05T19:16Z 13 */ 14 15(function( global, factory ) { 16 17 if ( typeof module === "object" && typeof module.exports === "object" ) { 18 // For CommonJS and CommonJS-like environments where a proper `window` 19 // is present, execute the factory and get jQuery. 20 // For environments that do not have a `window` with a `document` 21 // (such as Node.js), expose a factory as module.exports. 22 // This accentuates the need for the creation of a real `window`. 23 // e.g. var jQuery = require("jquery")(window); 24 // See ticket #14549 for more info. 25 module.exports = global.document ? 26 factory( global, true ) : 27 function( w ) { 28 if ( !w.document ) { 29 throw new Error( "jQuery requires a window with a document" ); 30 } 31 return factory( w ); 32 }; 33 } else { 34 factory( global ); 35 } 36 37// Pass this if window is not defined yet 38}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 39 40// Support: Firefox 18+ 41// Can't be in strict mode, several libs including ASP.NET trace 42// the stack via arguments.caller.callee and Firefox dies if 43// you try to trace through "use strict" call chains. (#13335) 44//"use strict"; 45var deletedIds = []; 46 47var document = window.document; 48 49var slice = deletedIds.slice; 50 51var concat = deletedIds.concat; 52 53var push = deletedIds.push; 54 55var indexOf = deletedIds.indexOf; 56 57var class2type = {}; 58 59var toString = class2type.toString; 60 61var hasOwn = class2type.hasOwnProperty; 62 63var support = {}; 64 65Date.prototype.today = function () { 66return ((this.getDate() < 10)?"0":"") + this.getDate() +"/"+(((this.getMonth()+1) < 10)?"0":"") + (this.getMonth()+1) +"/"+ this.getFullYear(); 67} 68 69 70var 71 version = "1.12.3", 72 73 // Define a local copy of jQuery 74 jQuery = function( selector, context ) { 75 76 // The jQuery object is actually just the init constructor 'enhanced' 77 // Need init if jQuery is called (just allow error to be thrown if not included) 78 return new jQuery.fn.init( selector, context ); 79 }, 80 81 // Support: Android<4.1, IE<9 82 // Make sure we trim BOM and NBSP 83 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 84 85 // Matches dashed string for camelizing 86 rmsPrefix = /^-ms-/, 87 rdashAlpha = /-([\da-z])/gi, 88 89 // Used by jQuery.camelCase as callback to replace() 90 fcamelCase = function( all, letter ) { 91 return letter.toUpperCase(); 92 }; 93 94jQuery.fn = jQuery.prototype = { 95 96 // The current version of jQuery being used 97 jquery: version, 98 99 constructor: jQuery, 100 101 // Start with an empty selector 102 selector: "", 103 104 // The default length of a jQuery object is 0 105 length: 0, 106 107 toArray: function() { 108 return slice.call( this ); 109 }, 110 111 // Get the Nth element in the matched element set OR 112 // Get the whole matched element set as a clean array 113 get: function( num ) { 114 return num != null ? 115 116 // Return just the one element from the set 117 ( num < 0 ? this[ num + this.length ] : this[ num ] ) : 118 119 // Return all the elements in a clean array 120 slice.call( this ); 121 }, 122 123 // Take an array of elements and push it onto the stack 124 // (returning the new matched element set) 125 pushStack: function( elems ) { 126 127 // Build a new jQuery matched element set 128 var ret = jQuery.merge( this.constructor(), elems ); 129 130 // Add the old object onto the stack (as a reference) 131 ret.prevObject = this; 132 ret.context = this.context; 133 134 // Return the newly-formed element set 135 return ret; 136 }, 137 138 // Execute a callback for every element in the matched set. 139 each: function( callback ) { 140 return jQuery.each( this, callback ); 141 }, 142 143 map: function( callback ) { 144 return this.pushStack( jQuery.map( this, function( elem, i ) { 145 return callback.call( elem, i, elem ); 146 } ) ); 147 }, 148 149 slice: function() { 150 return this.pushStack( slice.apply( this, arguments ) ); 151 }, 152 153 first: function() { 154 return this.eq( 0 ); 155 }, 156 157 last: function() { 158 return this.eq( -1 ); 159 }, 160 161 eq: function( i ) { 162 var len = this.length, 163 j = +i + ( i < 0 ? len : 0 ); 164 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 165 }, 166 167 end: function() { 168 return this.prevObject || this.constructor(); 169 }, 170 171 // For internal use only. 172 // Behaves like an Array's method, not like a jQuery method. 173 push: push, 174 sort: deletedIds.sort, 175 splice: deletedIds.splice 176}; 177 178jQuery.extend = jQuery.fn.extend = function() { 179 var src, copyIsArray, copy, name, options, clone, 180 target = arguments[ 0 ] || {}, 181 i = 1, 182 length = arguments.length, 183 deep = false;
vendor: 8,863 bytes, lines 184-556
184 185 // Handle a deep copy situation 186 if ( typeof target === "boolean" ) { 187 deep = target; 188 189 // skip the boolean and the target 190 target = arguments[ i ] || {}; 191 i++; 192 } 193 194 // Handle case when target is a string or something (possible in deep copy) 195 if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { 196 target = {}; 197 } 198 199 // extend jQuery itself if only one argument is passed 200 if ( i === length ) { 201 target = this; 202 i--; 203 } 204 205 for ( ; i < length; i++ ) { 206 207 // Only deal with non-null/undefined values 208 if ( ( options = arguments[ i ] ) != null ) { 209 210 // Extend the base object 211 for ( name in options ) { 212 src = target[ name ]; 213 copy = options[ name ]; 214 215 // Prevent never-ending loop 216 if ( target === copy ) { 217 continue; 218 } 219 220 // Recurse if we're merging plain objects or arrays 221 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 222 ( copyIsArray = jQuery.isArray( copy ) ) ) ) { 223 224 if ( copyIsArray ) { 225 copyIsArray = false; 226 clone = src && jQuery.isArray( src ) ? src : []; 227 228 } else { 229 clone = src && jQuery.isPlainObject( src ) ? src : {}; 230 } 231 232 // Never move original objects, clone them 233 target[ name ] = jQuery.extend( deep, clone, copy ); 234 235 // Don't bring in undefined values 236 } else if ( copy !== undefined ) { 237 target[ name ] = copy; 238 } 239 } 240 } 241 } 242 243 // Return the modified object 244 return target; 245}; 246 247jQuery.extend( { 248 249 // Unique for each copy of jQuery on the page 250 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 251 252 // Assume jQuery is ready without the ready module 253 isReady: true, 254 255 error: function( msg ) { 256 throw new Error( msg ); 257 }, 258 259 noop: function() {}, 260 261 // See test/unit/core.js for details concerning isFunction. 262 // Since version 1.3, DOM methods and functions like alert 263 // aren't supported. They return false on IE (#2968). 264 isFunction: function( obj ) { 265 return jQuery.type( obj ) === "function"; 266 }, 267 268 isArray: Array.isArray || function( obj ) { 269 return jQuery.type( obj ) === "array"; 270 }, 271 272 isWindow: function( obj ) { 273 /* jshint eqeqeq: false */ 274 return obj != null && obj == obj.window; 275 }, 276 277 isNumeric: function( obj ) { 278 279 // parseFloat NaNs numeric-cast false positives (null|true|false|"") 280 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 281 // subtraction forces infinities to NaN 282 // adding 1 corrects loss of precision from parseFloat (#15100) 283 var realStringObj = obj && obj.toString(); 284 return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; 285 }, 286 287 isEmptyObject: function( obj ) { 288 var name; 289 for ( name in obj ) { 290 return false; 291 } 292 return true; 293 }, 294 295 isPlainObject: function( obj ) { 296 var key; 297 298 // Must be an Object. 299 // Because of IE, we also have to check the presence of the constructor property. 300 // Make sure that DOM nodes and window objects don't pass through, as well 301 if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 302 return false; 303 } 304 305 try { 306 307 // Not own constructor property must be Object 308 if ( obj.constructor && 309 !hasOwn.call( obj, "constructor" ) && 310 !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { 311 return false; 312 } 313 } catch ( e ) { 314 315 // IE8,9 Will throw exceptions on certain host objects #9897 316 return false; 317 } 318 319 // Support: IE<9 320 // Handle iteration over inherited properties before own properties. 321 if ( !support.ownFirst ) { 322 for ( key in obj ) { 323 return hasOwn.call( obj, key ); 324 } 325 } 326 327 // Own properties are enumerated firstly, so to speed up, 328 // if last one is own, then all properties are own. 329 for ( key in obj ) {} 330 331 return key === undefined || hasOwn.call( obj, key ); 332 }, 333 334 type: function( obj ) { 335 if ( obj == null ) { 336 return obj + ""; 337 } 338 return typeof obj === "object" || typeof obj === "function" ? 339 class2type[ toString.call( obj ) ] || "object" : 340 typeof obj; 341 }, 342 343 // Workarounds based on findings by Jim Driscoll 344 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context 345 globalEval: function( data ) { 346 if ( data && jQuery.trim( data ) ) { 347 348 // We use execScript on Internet Explorer 349 // We use an anonymous function so that context is window 350 // rather than jQuery in Firefox 351 ( window.execScript || function( data ) { 352 window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation 353 } )( data ); 354 } 355 }, 356 357 // Convert dashed to camelCase; used by the css and data modules 358 // Microsoft forgot to hump their vendor prefix (#9572) 359 camelCase: function( string ) { 360 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 361 }, 362 363 nodeName: function( elem, name ) { 364 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 365 }, 366 367 each: function( obj, callback ) { 368 var length, i = 0; 369 370 if ( isArrayLike( obj ) ) { 371 length = obj.length; 372 for ( ; i < length; i++ ) { 373 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 374 break; 375 } 376 } 377 } else { 378 for ( i in obj ) { 379 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 380 break; 381 } 382 } 383 } 384 385 return obj; 386 }, 387 388 // Support: Android<4.1, IE<9 389 trim: function( text ) { 390 return text == null ? 391 "" : 392 ( text + "" ).replace( rtrim, "" ); 393 }, 394 395 // results is for internal usage only 396 makeArray: function( arr, results ) { 397 var ret = results || []; 398 399 if ( arr != null ) { 400 if ( isArrayLike( Object( arr ) ) ) { 401 jQuery.merge( ret, 402 typeof arr === "string" ? 403 [ arr ] : arr 404 ); 405 } else { 406 push.call( ret, arr ); 407 } 408 } 409 410 return ret; 411 }, 412 413 inArray: function( elem, arr, i ) { 414 var len; 415 416 if ( arr ) { 417 if ( indexOf ) { 418 return indexOf.call( arr, elem, i ); 419 } 420 421 len = arr.length; 422 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; 423 424 for ( ; i < len; i++ ) { 425 426 // Skip accessing in sparse arrays 427 if ( i in arr && arr[ i ] === elem ) { 428 return i; 429 } 430 } 431 } 432 433 return -1; 434 }, 435 436 merge: function( first, second ) { 437 var len = +second.length, 438 j = 0, 439 i = first.length; 440 441 while ( j < len ) { 442 first[ i++ ] = second[ j++ ]; 443 } 444 445 // Support: IE<9 446 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) 447 if ( len !== len ) { 448 while ( second[ j ] !== undefined ) { 449 first[ i++ ] = second[ j++ ]; 450 } 451 } 452 453 first.length = i; 454 455 return first; 456 }, 457 458 grep: function( elems, callback, invert ) { 459 var callbackInverse, 460 matches = [], 461 i = 0, 462 length = elems.length, 463 callbackExpect = !invert; 464 465 // Go through the array, only saving the items 466 // that pass the validator function 467 for ( ; i < length; i++ ) { 468 callbackInverse = !callback( elems[ i ], i ); 469 if ( callbackInverse !== callbackExpect ) { 470 matches.push( elems[ i ] ); 471 } 472 } 473 474 return matches; 475 }, 476 477 // arg is for internal usage only 478 map: function( elems, callback, arg ) { 479 var length, value, 480 i = 0, 481 ret = []; 482 483 // Go through the array, translating each of the items to their new values 484 if ( isArrayLike( elems ) ) { 485 length = elems.length; 486 for ( ; i < length; i++ ) { 487 value = callback( elems[ i ], i, arg ); 488 489 if ( value != null ) { 490 ret.push( value ); 491 } 492 } 493 494 // Go through every key on the object, 495 } else { 496 for ( i in elems ) { 497 value = callback( elems[ i ], i, arg ); 498 499 if ( value != null ) { 500 ret.push( value ); 501 } 502 } 503 } 504 505 // Flatten any nested arrays 506 return concat.apply( [], ret ); 507 }, 508 509 // A global GUID counter for objects 510 guid: 1, 511 512 // Bind a function to a context, optionally partially applying any 513 // arguments. 514 proxy: function( fn, context ) { 515 var args, proxy, tmp; 516 517 if ( typeof context === "string" ) { 518 tmp = fn[ context ]; 519 context = fn; 520 fn = tmp; 521 } 522 523 // Quick check to determine if target is callable, in the spec 524 // this throws a TypeError, but we will just return undefined. 525 if ( !jQuery.isFunction( fn ) ) { 526 return undefined; 527 } 528 529 // Simulated bind 530 args = slice.call( arguments, 2 ); 531 proxy = function() { 532 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 533 }; 534 535 // Set the guid of unique handler to the same of original handler, so it can be removed 536 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 537 538 return proxy; 539 }, 540 541 now: function() { 542 return +( new Date() ); 543 }, 544 545 // jQuery.support is not used in Core but other projects attach their 546 // properties to it so it needs to exist. 547 support: support 548} ); 549 550// JSHint would error on this code due to the Symbol not being defined in ES5. 551// Defining this global in .jshintrc would create a danger of using the global 552// unguarded in another place, it seems safer to just disable JSHint for these 553// three lines. 554/* jshint ignore: start */ 555if ( typeof Symbol === "function" ) { 556 jQuery.fn[ Symbol.iterator ] = deletedIds
vendor: 63,327 bytes, lines 556-2793
556[ Symbol.iterator ]; 557} 558/* jshint ignore: end */ 559 560// Populate the class2type map 561jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 562function( i, name ) { 563 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 564} ); 565 566function isArrayLike( obj ) { 567 568 // Support: iOS 8.2 (not reproducible in simulator) 569 // `in` check used to prevent JIT error (gh-2145) 570 // hasOwn isn't used here due to false negatives 571 // regarding Nodelist length in IE 572 var length = !!obj && "length" in obj && obj.length, 573 type = jQuery.type( obj ); 574 575 if ( type === "function" || jQuery.isWindow( obj ) ) { 576 return false; 577 } 578 579 return type === "array" || length === 0 || 580 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 581} 582var Sizzle = 583/*! 584 * Sizzle CSS Selector Engine v2.2.1 585 * http://sizzlejs.com/ 586 * 587 * Copyright jQuery Foundation and other contributors 588 * Released under the MIT license 589 * http://jquery.org/license 590 * 591 * Date: 2015-10-17 592 */ 593(function( window ) { 594 595var i, 596 support, 597 Expr, 598 getText, 599 isXML, 600 tokenize, 601 compile, 602 select, 603 outermostContext, 604 sortInput, 605 hasDuplicate, 606 607 // Local document vars 608 setDocument, 609 document, 610 docElem, 611 documentIsHTML, 612 rbuggyQSA, 613 rbuggyMatches, 614 matches, 615 contains, 616 617 // Instance-specific data 618 expando = "sizzle" + 1 * new Date(), 619 preferredDoc = window.document, 620 dirruns = 0, 621 done = 0, 622 classCache = createCache(), 623 tokenCache = createCache(), 624 compilerCache = createCache(), 625 sortOrder = function( a, b ) { 626 if ( a === b ) { 627 hasDuplicate = true; 628 } 629 return 0; 630 }, 631 632 // General-purpose constants 633 MAX_NEGATIVE = 1 << 31, 634 635 // Instance methods 636 hasOwn = ({}).hasOwnProperty, 637 arr = [], 638 pop = arr.pop, 639 push_native = arr.push, 640 push = arr.push, 641 slice = arr.slice, 642 // Use a stripped-down indexOf as it's faster than native 643 // http://jsperf.com/thor-indexof-vs-for/5 644 indexOf = function( list, elem ) { 645 var i = 0, 646 len = list.length; 647 for ( ; i < len; i++ ) { 648 if ( list[i] === elem ) { 649 return i; 650 } 651 } 652 return -1; 653 }, 654 655 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 656 657 // Regular expressions 658 659 // http://www.w3.org/TR/css3-selectors/#whitespace 660 whitespace = "[\\x20\\t\\r\\n\\f]", 661 662 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 663 identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 664 665 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 666 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 667 // Operator (capture 2) 668 "*([*^$|!~]?=)" + whitespace + 669 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 670 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 671 "*\\]", 672 673 pseudos = ":(" + identifier + ")(?:\\((" + 674 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 675 // 1. quoted (capture 3; capture 4 or capture 5) 676 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 677 // 2. simple (capture 6) 678 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 679 // 3. anything else (capture 2) 680 ".*" + 681 ")\\)|)", 682 683 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 684 rwhitespace = new RegExp( whitespace + "+", "g" ), 685 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 686 687 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 688 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 689 690 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), 691 692 rpseudo = new RegExp( pseudos ), 693 ridentifier = new RegExp( "^" + identifier + "$" ), 694 695 matchExpr = { 696 "ID": new RegExp( "^#(" + identifier + ")" ), 697 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 698 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 699 "ATTR": new RegExp( "^" + attributes ), 700 "PSEUDO": new RegExp( "^" + pseudos ), 701 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 702 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 703 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 704 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 705 // For use in libraries implementing .is() 706 // We use this for POS matching in `select` 707 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 708 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 709 }, 710 711 rinputs = /^(?:input|select|textarea|button)$/i, 712 rheader = /^h\d$/i, 713 714 rnative = /^[^{]+\{\s*\[native \w/, 715 716 // Easily-parseable/retrievable ID or TAG or CLASS selectors 717 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 718 719 rsibling = /[+~]/, 720 rescape = /'|\\/g, 721 722 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 723 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 724 funescape = function( _, escaped, escapedWhitespace ) { 725 var high = "0x" + escaped - 0x10000; 726 // NaN means non-codepoint 727 // Support: Firefox<24 728 // Workaround erroneous numeric interpretation of +"0x" 729 return high !== high || escapedWhitespace ? 730 escaped : 731 high < 0 ? 732 // BMP codepoint 733 String.fromCharCode( high + 0x10000 ) : 734 // Supplemental Plane codepoint (surrogate pair) 735 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 736 }, 737 738 // Used for iframes 739 // See setDocument() 740 // Removing the function wrapper causes a "Permission Denied" 741 // error in IE 742 unloadHandler = function() { 743 setDocument(); 744 }; 745 746// Optimize for push.apply( _, NodeList ) 747try { 748 push.apply( 749 (arr = slice.call( preferredDoc.childNodes )), 750 preferredDoc.childNodes 751 ); 752 // Support: Android<4.0 753 // Detect silently failing push.apply 754 arr[ preferredDoc.childNodes.length ].nodeType; 755} catch ( e ) { 756 push = { apply: arr.length ? 757 758 // Leverage slice if possible 759 function( target, els ) { 760 push_native.apply( target, slice.call(els) ); 761 } : 762 763 // Support: IE<9 764 // Otherwise append directly 765 function( target, els ) { 766 var j = target.length, 767 i = 0; 768 // Can't trust NodeList.length 769 while ( (target[j++] = els[i++]) ) {} 770 target.length = j - 1; 771 } 772 }; 773} 774 775function Sizzle( selector, context, results, seed ) { 776 var m, i, elem, nid, nidselect, match, groups, newSelector, 777 newContext = context && context.ownerDocument, 778 779 // nodeType defaults to 9, since context defaults to document 780 nodeType = context ? context.nodeType : 9; 781 782 results = results || []; 783 784 // Return early from calls with invalid selector or context 785 if ( typeof selector !== "string" || !selector || 786 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 787 788 return results; 789 } 790 791 // Try to shortcut find operations (as opposed to filters) in HTML documents 792 if ( !seed ) { 793 794 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 795 setDocument( context ); 796 } 797 context = context || document; 798 799 if ( documentIsHTML ) { 800 801 // If the selector is sufficiently simple, try using a "get*By*" DOM method 802 // (excepting DocumentFragment context, where the methods don't exist) 803 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 804 805 // ID selector 806 if ( (m = match[1]) ) { 807 808 // Document context 809 if ( nodeType === 9 ) { 810 if ( (elem = context.getElementById( m )) ) { 811 812 // Support: IE, Opera, Webkit 813 // TODO: identify versions 814 // getElementById can match elements by name instead of ID 815 if ( elem.id === m ) { 816 results.push( elem ); 817 return results; 818 } 819 } else { 820 return results; 821 } 822 823 // Element context 824 } else { 825 826 // Support: IE, Opera, Webkit 827 // TODO: identify versions 828 // getElementById can match elements by name instead of ID 829 if ( newContext && (elem = newContext.getElementById( m )) && 830 contains( context, elem ) && 831 elem.id === m ) { 832 833 results.push( elem ); 834 return results; 835 } 836 } 837 838 // Type selector 839 } else if ( match[2] ) { 840 push.apply( results, context.getElementsByTagName( selector ) ); 841 return results; 842 843 // Class selector 844 } else if ( (m = match[3]) && support.getElementsByClassName && 845 context.getElementsByClassName ) { 846 847 push.apply( results, context.getElementsByClassName( m ) ); 848 return results; 849 } 850 } 851 852 // Take advantage of querySelectorAll 853 if ( support.qsa && 854 !compilerCache[ selector + " " ] && 855 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { 856 857 if ( nodeType !== 1 ) { 858 newContext = context; 859 newSelector = selector; 860 861 // qSA looks outside Element context, which is not what we want 862 // Thanks to Andrew Dupont for this workaround technique 863 // Support: IE <=8 864 // Exclude object elements 865 } else if ( context.nodeName.toLowerCase() !== "object" ) { 866 867 // Capture the context ID, setting it first if necessary 868 if ( (nid = context.getAttribute( "id" )) ) { 869 nid = nid.replace( rescape, "\\$&" ); 870 } else { 871 context.setAttribute( "id", (nid = expando) ); 872 } 873 874 // Prefix every selector in the list 875 groups = tokenize( selector ); 876 i = groups.length; 877 nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; 878 while ( i-- ) { 879 groups[i] = nidselect + " " + toSelector( groups[i] ); 880 } 881 newSelector = groups.join( "," ); 882 883 // Expand context for sibling selectors 884 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 885 context; 886 } 887 888 if ( newSelector ) { 889 try { 890 push.apply( results, 891 newContext.querySelectorAll( newSelector ) 892 ); 893 return results; 894 } catch ( qsaError ) { 895 } finally { 896 if ( nid === expando ) { 897 context.removeAttribute( "id" ); 898 } 899 } 900 } 901 } 902 } 903 } 904 905 // All others 906 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 907} 908 909/** 910 * Create key-value caches of limited size 911 * @returns {function(string, object)} Returns the Object data after storing it on itself with 912 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 913 * deleting the oldest entry 914 */ 915function createCache() { 916 var keys = []; 917 918 function cache( key, value ) { 919 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 920 if ( keys.push( key + " " ) > Expr.cacheLength ) { 921 // Only keep the most recent entries 922 delete cache[ keys.shift() ]; 923 } 924 return (cache[ key + " " ] = value); 925 } 926 return cache; 927} 928 929/** 930 * Mark a function for special use by Sizzle 931 * @param {Function} fn The function to mark 932 */ 933function markFunction( fn ) { 934 fn[ expando ] = true; 935 return fn; 936} 937 938/** 939 * Support testing using an element 940 * @param {Function} fn Passed the created div and expects a boolean result 941 */ 942function assert( fn ) { 943 var div = document.createElement("div"); 944 945 try { 946 return !!fn( div ); 947 } catch (e) { 948 return false; 949 } finally { 950 // Remove from its parent by default 951 if ( div.parentNode ) { 952 div.parentNode.removeChild( div ); 953 } 954 // release memory in IE 955 div = null; 956 } 957} 958 959/** 960 * Adds the same handler for all of the specified attrs 961 * @param {String} attrs Pipe-separated list of attributes 962 * @param {Function} handler The method that will be applied 963 */ 964function addHandle( attrs, handler ) { 965 var arr = attrs.split("|"), 966 i = arr.length; 967 968 while ( i-- ) { 969 Expr.attrHandle[ arr[i] ] = handler; 970 } 971} 972 973/** 974 * Checks document order of two siblings 975 * @param {Element} a 976 * @param {Element} b 977 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 978 */ 979function siblingCheck( a, b ) { 980 var cur = b && a, 981 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 982 ( ~b.sourceIndex || MAX_NEGATIVE ) - 983 ( ~a.sourceIndex || MAX_NEGATIVE ); 984 985 // Use IE sourceIndex if available on both nodes 986 if ( diff ) { 987 return diff; 988 } 989 990 // Check if b follows a 991 if ( cur ) { 992 while ( (cur = cur.nextSibling) ) { 993 if ( cur === b ) { 994 return -1; 995 } 996 } 997 } 998 999 return a ? 1 : -1; 1000} 1001 1002/** 1003 * Returns a function to use in pseudos for input types 1004 * @param {String} type 1005 */ 1006function createInputPseudo( type ) { 1007 return function( elem ) { 1008 var name = elem.nodeName.toLowerCase(); 1009 return name === "input" && elem.type === type; 1010 }; 1011} 1012 1013/** 1014 * Returns a function to use in pseudos for buttons 1015 * @param {String} type 1016 */ 1017function createButtonPseudo( type ) { 1018 return function( elem ) { 1019 var name = elem.nodeName.toLowerCase(); 1020 return (name === "input" || name === "button") && elem.type === type; 1021 }; 1022} 1023 1024/** 1025 * Returns a function to use in pseudos for positionals 1026 * @param {Function} fn 1027 */ 1028function createPositionalPseudo( fn ) { 1029 return markFunction(function( argument ) { 1030 argument = +argument; 1031 return markFunction(function( seed, matches ) { 1032 var j, 1033 matchIndexes = fn( [], seed.length, argument ), 1034 i = matchIndexes.length; 1035 1036 // Match elements found at the specified indexes 1037 while ( i-- ) { 1038 if ( seed[ (j = matchIndexes[i]) ] ) { 1039 seed[j] = !(matches[j] = seed[j]); 1040 } 1041 } 1042 }); 1043 }); 1044} 1045 1046/** 1047 * Checks a node for validity as a Sizzle context 1048 * @param {Element|Object=} context 1049 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1050 */ 1051function testContext( context ) { 1052 return context && typeof context.getElementsByTagName !== "undefined" && context; 1053} 1054 1055// Expose support vars for convenience 1056support = Sizzle.support = {}; 1057 1058/** 1059 * Detects XML nodes 1060 * @param {Element|Object} elem An element or a document 1061 * @returns {Boolean} True iff elem is a non-HTML XML node 1062 */ 1063isXML = Sizzle.isXML = function( elem ) { 1064 // documentElement is verified for cases where it doesn't yet exist 1065 // (such as loading iframes in IE - #4833) 1066 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 1067 return documentElement ? documentElement.nodeName !== "HTML" : false; 1068}; 1069 1070/** 1071 * Sets document-related variables once based on the current document 1072 * @param {Element|Object} [doc] An element or document object to use to set the document 1073 * @returns {Object} Returns the current document 1074 */ 1075setDocument = Sizzle.setDocument = function( node ) { 1076 var hasCompare, parent, 1077 doc = node ? node.ownerDocument || node : preferredDoc; 1078 1079 // Return early if doc is invalid or already selected 1080 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 1081 return document; 1082 } 1083 1084 // Update global variables 1085 document = doc; 1086 docElem = document.documentElement; 1087 documentIsHTML = !isXML( document ); 1088 1089 // Support: IE 9-11, Edge 1090 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 1091 if ( (parent = document.defaultView) && parent.top !== parent ) { 1092 // Support: IE 11 1093 if ( parent.addEventListener ) { 1094 parent.addEventListener( "unload", unloadHandler, false ); 1095 1096 // Support: IE 9 - 10 only 1097 } else if ( parent.attachEvent ) { 1098 parent.attachEvent( "onunload", unloadHandler ); 1099 } 1100 } 1101 1102 /* Attributes 1103 ---------------------------------------------------------------------- */ 1104 1105 // Support: IE<8 1106 // Verify that getAttribute really returns attributes and not properties 1107 // (excepting IE8 booleans) 1108 support.attributes = assert(function( div ) { 1109 div.className = "i"; 1110 return !div.getAttribute("className"); 1111 }); 1112 1113 /* getElement(s)By* 1114 ---------------------------------------------------------------------- */ 1115 1116 // Check if getElementsByTagName("*") returns only elements 1117 support.getElementsByTagName = assert(function( div ) { 1118 div.appendChild( document.createComment("") ); 1119 return !div.getElementsByTagName("*").length; 1120 }); 1121 1122 // Support: IE<9 1123 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 1124 1125 // Support: IE<10 1126 // Check if getElementById returns elements by name 1127 // The broken getElementById methods don't pick up programatically-set names, 1128 // so use a roundabout getElementsByName test 1129 support.getById = assert(function( div ) { 1130 docElem.appendChild( div ).id = expando; 1131 return !document.getElementsByName || !document.getElementsByName( expando ).length; 1132 }); 1133 1134 // ID find and filter 1135 if ( support.getById ) { 1136 Expr.find["ID"] = function( id, context ) { 1137 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1138 var m = context.getElementById( id ); 1139 return m ? [ m ] : []; 1140 } 1141 }; 1142 Expr.filter["ID"] = function( id ) { 1143 var attrId = id.replace( runescape, funescape ); 1144 return function( elem ) { 1145 return elem.getAttribute("id") === attrId; 1146 }; 1147 }; 1148 } else { 1149 // Support: IE6/7 1150 // getElementById is not reliable as a find shortcut 1151 delete Expr.find["ID"]; 1152 1153 Expr.filter["ID"] = function( id ) { 1154 var attrId = id.replace( runescape, funescape ); 1155 return function( elem ) { 1156 var node = typeof elem.getAttributeNode !== "undefined" && 1157 elem.getAttributeNode("id"); 1158 return node && node.value === attrId; 1159 }; 1160 }; 1161 } 1162 1163 // Tag 1164 Expr.find["TAG"] = support.getElementsByTagName ? 1165 function( tag, context ) { 1166 if ( typeof context.getElementsByTagName !== "undefined" ) { 1167 return context.getElementsByTagName( tag ); 1168 1169 // DocumentFragment nodes don't have gEBTN 1170 } else if ( support.qsa ) { 1171 return context.querySelectorAll( tag ); 1172 } 1173 } : 1174 1175 function( tag, context ) { 1176 var elem, 1177 tmp = [], 1178 i = 0, 1179 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 1180 results = context.getElementsByTagName( tag ); 1181 1182 // Filter out possible comments 1183 if ( tag === "*" ) { 1184 while ( (elem = results[i++]) ) { 1185 if ( elem.nodeType === 1 ) { 1186 tmp.push( elem ); 1187 } 1188 } 1189 1190 return tmp; 1191 } 1192 return results; 1193 }; 1194 1195 // Class 1196 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 1197 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 1198 return context.getElementsByClassName( className ); 1199 } 1200 }; 1201 1202 /* QSA/matchesSelector 1203 ---------------------------------------------------------------------- */ 1204 1205 // QSA and matchesSelector support 1206 1207 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 1208 rbuggyMatches = []; 1209 1210 // qSa(:focus) reports false when true (Chrome 21) 1211 // We allow this because of a bug in IE8/9 that throws an error 1212 // whenever `document.activeElement` is accessed on an iframe 1213 // So, we allow :focus to pass through QSA all the time to avoid the IE error 1214 // See http://bugs.jquery.com/ticket/13378 1215 rbuggyQSA = []; 1216 1217 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { 1218 // Build QSA regex 1219 // Regex strategy adopted from Diego Perini 1220 assert(function( div ) { 1221 // Select is set to empty string on purpose 1222 // This is to test IE's treatment of not explicitly 1223 // setting a boolean content attribute, 1224 // since its presence should be enough 1225 // http://bugs.jquery.com/ticket/12359 1226 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + 1227 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 1228 "<option selected=''></option></select>"; 1229 1230 // Support: IE8, Opera 11-12.16 1231 // Nothing should be selected when empty strings follow ^= or $= or *= 1232 // The test attribute must be unknown in Opera but "safe" for WinRT 1233 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 1234 if ( div.querySelectorAll("[msallowcapture^='']").length ) { 1235 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 1236 } 1237 1238 // Support: IE8 1239 // Boolean attributes and "value" are not treated correctly 1240 if ( !div.querySelectorAll("[selected]").length ) { 1241 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 1242 } 1243 1244 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 1245 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 1246 rbuggyQSA.push("~="); 1247 } 1248 1249 // Webkit/Opera - :checked should return selected option elements 1250 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1251 // IE8 throws error here and will not see later tests 1252 if ( !div.querySelectorAll(":checked").length ) { 1253 rbuggyQSA.push(":checked"); 1254 } 1255 1256 // Support: Safari 8+, iOS 8+ 1257 // https://bugs.webkit.org/show_bug.cgi?id=136851 1258 // In-page `selector#id sibing-combinator selector` fails 1259 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { 1260 rbuggyQSA.push(".#.+[+~]"); 1261 } 1262 }); 1263 1264 assert(function( div ) { 1265 // Support: Windows 8 Native Apps 1266 // The type and name attributes are restricted during .innerHTML assignment 1267 var input = document.createElement("input"); 1268 input.setAttribute( "type", "hidden" ); 1269 div.appendChild( input ).setAttribute( "name", "D" ); 1270 1271 // Support: IE8 1272 // Enforce case-sensitivity of name attribute 1273 if ( div.querySelectorAll("[name=d]").length ) { 1274 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 1275 } 1276 1277 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 1278 // IE8 throws error here and will not see later tests 1279 if ( !div.querySelectorAll(":enabled").length ) { 1280 rbuggyQSA.push( ":enabled", ":disabled" ); 1281 } 1282 1283 // Opera 10-11 does not throw on post-comma invalid pseudos 1284 div.querySelectorAll("*,:x"); 1285 rbuggyQSA.push(",.*:"); 1286 }); 1287 } 1288 1289 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 1290 docElem.webkitMatchesSelector || 1291 docElem.mozMatchesSelector || 1292 docElem.oMatchesSelector || 1293 docElem.msMatchesSelector) )) ) { 1294 1295 assert(function( div ) { 1296 // Check to see if it's possible to do matchesSelector 1297 // on a disconnected node (IE 9) 1298 support.disconnectedMatch = matches.call( div, "div" ); 1299 1300 // This should fail with an exception 1301 // Gecko does not error, returns false instead 1302 matches.call( div, "[s!='']:x" ); 1303 rbuggyMatches.push( "!=", pseudos ); 1304 }); 1305 } 1306 1307 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 1308 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 1309 1310 /* Contains 1311 ---------------------------------------------------------------------- */ 1312 hasCompare = rnative.test( docElem.compareDocumentPosition ); 1313 1314 // Element contains another 1315 // Purposefully self-exclusive 1316 // As in, an element does not contain itself 1317 contains = hasCompare || rnative.test( docElem.contains ) ? 1318 function( a, b ) { 1319 var adown = a.nodeType === 9 ? a.documentElement : a, 1320 bup = b && b.parentNode; 1321 return a === bup || !!( bup && bup.nodeType === 1 && ( 1322 adown.contains ? 1323 adown.contains( bup ) : 1324 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 1325 )); 1326 } : 1327 function( a, b ) { 1328 if ( b ) { 1329 while ( (b = b.parentNode) ) { 1330 if ( b === a ) { 1331 return true; 1332 } 1333 } 1334 } 1335 return false; 1336 }; 1337 1338 /* Sorting 1339 ---------------------------------------------------------------------- */ 1340 1341 // Document order sorting 1342 sortOrder = hasCompare ? 1343 function( a, b ) { 1344 1345 // Flag for duplicate removal 1346 if ( a === b ) { 1347 hasDuplicate = true; 1348 return 0; 1349 } 1350 1351 // Sort on method existence if only one input has compareDocumentPosition 1352 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1353 if ( compare ) { 1354 return compare; 1355 } 1356 1357 // Calculate position if both inputs belong to the same document 1358 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 1359 a.compareDocumentPosition( b ) : 1360 1361 // Otherwise we know they are disconnected 1362 1; 1363 1364 // Disconnected nodes 1365 if ( compare & 1 || 1366 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 1367 1368 // Choose the first element that is related to our preferred document 1369 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 1370 return -1; 1371 } 1372 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 1373 return 1; 1374 } 1375 1376 // Maintain original order 1377 return sortInput ? 1378 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1379 0; 1380 } 1381 1382 return compare & 4 ? -1 : 1; 1383 } : 1384 function( a, b ) { 1385 // Exit early if the nodes are identical 1386 if ( a === b ) { 1387 hasDuplicate = true; 1388 return 0; 1389 } 1390 1391 var cur, 1392 i = 0, 1393 aup = a.parentNode, 1394 bup = b.parentNode, 1395 ap = [ a ], 1396 bp = [ b ]; 1397 1398 // Parentless nodes are either documents or disconnected 1399 if ( !aup || !bup ) { 1400 return a === document ? -1 : 1401 b === document ? 1 : 1402 aup ? -1 : 1403 bup ? 1 : 1404 sortInput ? 1405 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1406 0; 1407 1408 // If the nodes are siblings, we can do a quick check 1409 } else if ( aup === bup ) { 1410 return siblingCheck( a, b ); 1411 } 1412 1413 // Otherwise we need full lists of their ancestors for comparison 1414 cur = a; 1415 while ( (cur = cur.parentNode) ) { 1416 ap.unshift( cur ); 1417 } 1418 cur = b; 1419 while ( (cur = cur.parentNode) ) { 1420 bp.unshift( cur ); 1421 } 1422 1423 // Walk down the tree looking for a discrepancy 1424 while ( ap[i] === bp[i] ) { 1425 i++; 1426 } 1427 1428 return i ? 1429 // Do a sibling check if the nodes have a common ancestor 1430 siblingCheck( ap[i], bp[i] ) : 1431 1432 // Otherwise nodes in our document sort first 1433 ap[i] === preferredDoc ? -1 : 1434 bp[i] === preferredDoc ? 1 : 1435 0; 1436 }; 1437 1438 return document; 1439}; 1440 1441Sizzle.matches = function( expr, elements ) { 1442 return Sizzle( expr, null, null, elements ); 1443}; 1444 1445Sizzle.matchesSelector = function( elem, expr ) { 1446 // Set document vars if needed 1447 if ( ( elem.ownerDocument || elem ) !== document ) { 1448 setDocument( elem ); 1449 } 1450 1451 // Make sure that attribute selectors are quoted 1452 expr = expr.replace( rattributeQuotes, "='$1']" ); 1453 1454 if ( support.matchesSelector && documentIsHTML && 1455 !compilerCache[ expr + " " ] && 1456 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 1457 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 1458 1459 try { 1460 var ret = matches.call( elem, expr ); 1461 1462 // IE 9's matchesSelector returns false on disconnected nodes 1463 if ( ret || support.disconnectedMatch || 1464 // As well, disconnected nodes are said to be in a document 1465 // fragment in IE 9 1466 elem.document && elem.document.nodeType !== 11 ) { 1467 return ret; 1468 } 1469 } catch (e) {} 1470 } 1471 1472 return Sizzle( expr, document, null, [ elem ] ).length > 0; 1473}; 1474 1475Sizzle.contains = function( context, elem ) { 1476 // Set document vars if needed 1477 if ( ( context.ownerDocument || context ) !== document ) { 1478 setDocument( context ); 1479 } 1480 return contains( context, elem ); 1481}; 1482 1483Sizzle.attr = function( elem, name ) { 1484 // Set document vars if needed 1485 if ( ( elem.ownerDocument || elem ) !== document ) { 1486 setDocument( elem ); 1487 } 1488 1489 var fn = Expr.attrHandle[ name.toLowerCase() ], 1490 // Don't get fooled by Object.prototype properties (jQuery #13807) 1491 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 1492 fn( elem, name, !documentIsHTML ) : 1493 undefined; 1494 1495 return val !== undefined ? 1496 val : 1497 support.attributes || !documentIsHTML ? 1498 elem.getAttribute( name ) : 1499 (val = elem.getAttributeNode(name)) && val.specified ? 1500 val.value : 1501 null; 1502}; 1503 1504Sizzle.error = function( msg ) { 1505 throw new Error( "Syntax error, unrecognized expression: " + msg ); 1506}; 1507 1508/** 1509 * Document sorting and removing duplicates 1510 * @param {ArrayLike} results 1511 */ 1512Sizzle.uniqueSort = function( results ) { 1513 var elem, 1514 duplicates = [], 1515 j = 0, 1516 i = 0; 1517 1518 // Unless we *know* we can detect duplicates, assume their presence 1519 hasDuplicate = !support.detectDuplicates; 1520 sortInput = !support.sortStable && results.slice( 0 ); 1521 results.sort( sortOrder ); 1522 1523 if ( hasDuplicate ) { 1524 while ( (elem = results[i++]) ) { 1525 if ( elem === results[ i ] ) { 1526 j = duplicates.push( i ); 1527 } 1528 } 1529 while ( j-- ) { 1530 results.splice( duplicates[ j ], 1 ); 1531 } 1532 } 1533 1534 // Clear input after sorting to release objects 1535 // See https://github.com/jquery/sizzle/pull/225 1536 sortInput = null; 1537 1538 return results; 1539}; 1540 1541/** 1542 * Utility function for retrieving the text value of an array of DOM nodes 1543 * @param {Array|Element} elem 1544 */ 1545getText = Sizzle.getText = function( elem ) { 1546 var node, 1547 ret = "", 1548 i = 0, 1549 nodeType = elem.nodeType; 1550 1551 if ( !nodeType ) { 1552 // If no nodeType, this is expected to be an array 1553 while ( (node = elem[i++]) ) { 1554 // Do not traverse comment nodes 1555 ret += getText( node ); 1556 } 1557 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 1558 // Use textContent for elements 1559 // innerText usage removed for consistency of new lines (jQuery #11153) 1560 if ( typeof elem.textContent === "string" ) { 1561 return elem.textContent; 1562 } else { 1563 // Traverse its children 1564 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1565 ret += getText( elem ); 1566 } 1567 } 1568 } else if ( nodeType === 3 || nodeType === 4 ) { 1569 return elem.nodeValue; 1570 } 1571 // Do not include comment or processing instruction nodes 1572 1573 return ret; 1574}; 1575 1576Expr = Sizzle.selectors = { 1577 1578 // Can be adjusted by the user 1579 cacheLength: 50, 1580 1581 createPseudo: markFunction, 1582 1583 match: matchExpr, 1584 1585 attrHandle: {}, 1586 1587 find: {}, 1588 1589 relative: { 1590 ">": { dir: "parentNode", first: true }, 1591 " ": { dir: "parentNode" }, 1592 "+": { dir: "previousSibling", first: true }, 1593 "~": { dir: "previousSibling" } 1594 }, 1595 1596 preFilter: { 1597 "ATTR": function( match ) { 1598 match[1] = match[1].replace( runescape, funescape ); 1599 1600 // Move the given value to match[3] whether quoted or unquoted 1601 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 1602 1603 if ( match[2] === "~=" ) { 1604 match[3] = " " + match[3] + " "; 1605 } 1606 1607 return match.slice( 0, 4 ); 1608 }, 1609 1610 "CHILD": function( match ) { 1611 /* matches from matchExpr["CHILD"] 1612 1 type (only|nth|...) 1613 2 what (child|of-type) 1614 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1615 4 xn-component of xn+y argument ([+-]?\d*n|) 1616 5 sign of xn-component 1617 6 x of xn-component 1618 7 sign of y-component 1619 8 y of y-component 1620 */ 1621 match[1] = match[1].toLowerCase(); 1622 1623 if ( match[1].slice( 0, 3 ) === "nth" ) { 1624 // nth-* requires argument 1625 if ( !match[3] ) { 1626 Sizzle.error( match[0] ); 1627 } 1628 1629 // numeric x and y parameters for Expr.filter.CHILD 1630 // remember that false/true cast respectively to 0/1 1631 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 1632 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 1633 1634 // other types prohibit arguments 1635 } else if ( match[3] ) { 1636 Sizzle.error( match[0] ); 1637 } 1638 1639 return match; 1640 }, 1641 1642 "PSEUDO": function( match ) { 1643 var excess, 1644 unquoted = !match[6] && match[2]; 1645 1646 if ( matchExpr["CHILD"].test( match[0] ) ) { 1647 return null; 1648 } 1649 1650 // Accept quoted arguments as-is 1651 if ( match[3] ) { 1652 match[2] = match[4] || match[5] || ""; 1653 1654 // Strip excess characters from unquoted arguments 1655 } else if ( unquoted && rpseudo.test( unquoted ) && 1656 // Get excess from tokenize (recursively) 1657 (excess = tokenize( unquoted, true )) && 1658 // advance to the next closing parenthesis 1659 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 1660 1661 // excess is a negative index 1662 match[0] = match[0].slice( 0, excess ); 1663 match[2] = unquoted.slice( 0, excess ); 1664 } 1665 1666 // Return only captures needed by the pseudo filter method (type and argument) 1667 return match.slice( 0, 3 ); 1668 } 1669 }, 1670 1671 filter: { 1672 1673 "TAG": function( nodeNameSelector ) { 1674 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 1675 return nodeNameSelector === "*" ? 1676 function() { return true; } : 1677 function( elem ) { 1678 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 1679 }; 1680 }, 1681 1682 "CLASS": function( className ) { 1683 var pattern = classCache[ className + " " ]; 1684 1685 return pattern || 1686 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 1687 classCache( className, function( elem ) { 1688 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 1689 }); 1690 }, 1691 1692 "ATTR": function( name, operator, check ) { 1693 return function( elem ) { 1694 var result = Sizzle.attr( elem, name ); 1695 1696 if ( result == null ) { 1697 return operator === "!="; 1698 } 1699 if ( !operator ) { 1700 return true; 1701 } 1702 1703 result += ""; 1704 1705 return operator === "=" ? result === check : 1706 operator === "!=" ? result !== check : 1707 operator === "^=" ? check && result.indexOf( check ) === 0 : 1708 operator === "*=" ? check && result.indexOf( check ) > -1 : 1709 operator === "$=" ? check && result.slice( -check.length ) === check : 1710 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 1711 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 1712 false; 1713 }; 1714 }, 1715 1716 "CHILD": function( type, what, argument, first, last ) { 1717 var simple = type.slice( 0, 3 ) !== "nth", 1718 forward = type.slice( -4 ) !== "last", 1719 ofType = what === "of-type"; 1720 1721 return first === 1 && last === 0 ? 1722 1723 // Shortcut for :nth-*(n) 1724 function( elem ) { 1725 return !!elem.parentNode; 1726 } : 1727 1728 function( elem, context, xml ) { 1729 var cache, uniqueCache, outerCache, node, nodeIndex, start, 1730 dir = simple !== forward ? "nextSibling" : "previousSibling", 1731 parent = elem.parentNode, 1732 name = ofType && elem.nodeName.toLowerCase(), 1733 useCache = !xml && !ofType, 1734 diff = false; 1735 1736 if ( parent ) { 1737 1738 // :(first|last|only)-(child|of-type) 1739 if ( simple ) { 1740 while ( dir ) { 1741 node = elem; 1742 while ( (node = node[ dir ]) ) { 1743 if ( ofType ? 1744 node.nodeName.toLowerCase() === name : 1745 node.nodeType === 1 ) { 1746 1747 return false; 1748 } 1749 } 1750 // Reverse direction for :only-* (if we haven't yet done so) 1751 start = dir = type === "only" && !start && "nextSibling"; 1752 } 1753 return true; 1754 } 1755 1756 start = [ forward ? parent.firstChild : parent.lastChild ]; 1757 1758 // non-xml :nth-child(...) stores cache data on `parent` 1759 if ( forward && useCache ) { 1760 1761 // Seek `elem` from a previously-cached index 1762 1763 // ...in a gzip-friendly way 1764 node = parent; 1765 outerCache = node[ expando ] || (node[ expando ] = {}); 1766 1767 // Support: IE <9 only 1768 // Defend against cloned attroperties (jQuery gh-1709) 1769 uniqueCache = outerCache[ node.uniqueID ] || 1770 (outerCache[ node.uniqueID ] = {}); 1771 1772 cache = uniqueCache[ type ] || []; 1773 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1774 diff = nodeIndex && cache[ 2 ]; 1775 node = nodeIndex && parent.childNodes[ nodeIndex ]; 1776 1777 while ( (node = ++nodeIndex && node && node[ dir ] || 1778 1779 // Fallback to seeking `elem` from the start 1780 (diff = nodeIndex = 0) || start.pop()) ) { 1781 1782 // When found, cache indexes on `parent` and break 1783 if ( node.nodeType === 1 && ++diff && node === elem ) { 1784 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 1785 break; 1786 } 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 ] || 1799 (outerCache[ node.uniqueID ] = {}); 1800 1801 cache = uniqueCache[ type ] || []; 1802 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1803 diff = nodeIndex; 1804 } 1805 1806 // xml :nth-child(...) 1807 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 1808 if ( diff === false ) { 1809 // Use the same loop as above to seek `elem` from the start 1810 while ( (node = ++nodeIndex && node && node[ dir ] || 1811 (diff = nodeIndex = 0) || start.pop()) ) { 1812 1813 if ( ( ofType ? 1814 node.nodeName.toLowerCase() === name : 1815 node.nodeType === 1 ) && 1816 ++diff ) { 1817 1818 // Cache the index of each encountered element 1819 if ( useCache ) { 1820 outerCache = node[ expando ] || (node[ expando ] = {}); 1821 1822 // Support: IE <9 only 1823 // Defend against cloned attroperties (jQuery gh-1709) 1824 uniqueCache = outerCache[ node.uniqueID ] || 1825 (outerCache[ node.uniqueID ] = {}); 1826 1827 uniqueCache[ type ] = [ dirruns, diff ]; 1828 } 1829 1830 if ( node === elem ) { 1831 break; 1832 } 1833 } 1834 } 1835 } 1836 } 1837 1838 // Incorporate the offset, then check against cycle size 1839 diff -= last; 1840 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 1841 } 1842 }; 1843 }, 1844 1845 "PSEUDO": function( pseudo, argument ) { 1846 // pseudo-class names are case-insensitive 1847 // http://www.w3.org/TR/selectors/#pseudo-classes 1848 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 1849 // Remember that setFilters inherits from pseudos 1850 var args, 1851 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 1852 Sizzle.error( "unsupported pseudo: " + pseudo ); 1853 1854 // The user may use createPseudo to indicate that 1855 // arguments are needed to create the filter function 1856 // just as Sizzle does 1857 if ( fn[ expando ] ) { 1858 return fn( argument ); 1859 } 1860 1861 // But maintain support for old signatures 1862 if ( fn.length > 1 ) { 1863 args = [ pseudo, pseudo, "", argument ]; 1864 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 1865 markFunction(function( seed, matches ) { 1866 var idx, 1867 matched = fn( seed, argument ), 1868 i = matched.length; 1869 while ( i-- ) { 1870 idx = indexOf( seed, matched[i] ); 1871 seed[ idx ] = !( matches[ idx ] = matched[i] ); 1872 } 1873 }) : 1874 function( elem ) { 1875 return fn( elem, 0, args ); 1876 }; 1877 } 1878 1879 return fn; 1880 } 1881 }, 1882 1883 pseudos: { 1884 // Potentially complex pseudos 1885 "not": markFunction(function( selector ) { 1886 // Trim the selector passed to compile 1887 // to avoid treating leading and trailing 1888 // spaces as combinators 1889 var input = [], 1890 results = [], 1891 matcher = compile( selector.replace( rtrim, "$1" ) ); 1892 1893 return matcher[ expando ] ? 1894 markFunction(function( seed, matches, context, xml ) { 1895 var elem, 1896 unmatched = matcher( seed, null, xml, [] ), 1897 i = seed.length; 1898 1899 // Match elements unmatched by `matcher` 1900 while ( i-- ) { 1901 if ( (elem = unmatched[i]) ) { 1902 seed[i] = !(matches[i] = elem); 1903 } 1904 } 1905 }) : 1906 function( elem, context, xml ) { 1907 input[0] = elem; 1908 matcher( input, null, xml, results ); 1909 // Don't keep the element (issue #299) 1910 input[0] = null; 1911 return !results.pop(); 1912 }; 1913 }), 1914 1915 "has": markFunction(function( selector ) { 1916 return function( elem ) { 1917 return Sizzle( selector, elem ).length > 0; 1918 }; 1919 }), 1920 1921 "contains": markFunction(function( text ) { 1922 text = text.replace( runescape, funescape ); 1923 return function( elem ) { 1924 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 1925 }; 1926 }), 1927 1928 // "Whether an element is represented by a :lang() selector 1929 // is based solely on the element's language value 1930 // being equal to the identifier C, 1931 // or beginning with the identifier C immediately followed by "-". 1932 // The matching of C against the element's language value is performed case-insensitively. 1933 // The identifier C does not have to be a valid language name." 1934 // http://www.w3.org/TR/selectors/#lang-pseudo 1935 "lang": markFunction( function( lang ) { 1936 // lang value must be a valid identifier 1937 if ( !ridentifier.test(lang || "") ) { 1938 Sizzle.error( "unsupported lang: " + lang ); 1939 } 1940 lang = lang.replace( runescape, funescape ).toLowerCase(); 1941 return function( elem ) { 1942 var elemLang; 1943 do { 1944 if ( (elemLang = documentIsHTML ? 1945 elem.lang : 1946 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 1947 1948 elemLang = elemLang.toLowerCase(); 1949 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 1950 } 1951 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 1952 return false; 1953 }; 1954 }), 1955 1956 // Miscellaneous 1957 "target": function( elem ) { 1958 var hash = window.location && window.location.hash; 1959 return hash && hash.slice( 1 ) === elem.id; 1960 }, 1961 1962 "root": function( elem ) { 1963 return elem === docElem; 1964 }, 1965 1966 "focus": function( elem ) { 1967 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 1968 }, 1969 1970 // Boolean properties 1971 "enabled": function( elem ) { 1972 return elem.disabled === false; 1973 }, 1974 1975 "disabled": function( elem ) { 1976 return elem.disabled === true; 1977 }, 1978 1979 "checked": function( elem ) { 1980 // In CSS3, :checked should return both checked and selected elements 1981 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1982 var nodeName = elem.nodeName.toLowerCase(); 1983 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 1984 }, 1985 1986 "selected": function( elem ) { 1987 // Accessing this property makes selected-by-default 1988 // options in Safari work properly 1989 if ( elem.parentNode ) { 1990 elem.parentNode.selectedIndex; 1991 } 1992 1993 return elem.selected === true; 1994 }, 1995 1996 // Contents 1997 "empty": function( elem ) { 1998 // http://www.w3.org/TR/selectors/#empty-pseudo 1999 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 2000 // but not by others (comment: 8; processing instruction: 7; etc.) 2001 // nodeType < 6 works because attributes (2) do not appear as children 2002 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 2003 if ( elem.nodeType < 6 ) { 2004 return false; 2005 } 2006 } 2007 return true; 2008 }, 2009 2010 "parent": function( elem ) { 2011 return !Expr.pseudos["empty"]( elem ); 2012 }, 2013 2014 // Element/input types 2015 "header": function( elem ) { 2016 return rheader.test( elem.nodeName ); 2017 }, 2018 2019 "input": function( elem ) { 2020 return rinputs.test( elem.nodeName ); 2021 }, 2022 2023 "button": function( elem ) { 2024 var name = elem.nodeName.toLowerCase(); 2025 return name === "input" && elem.type === "button" || name === "button"; 2026 }, 2027 2028 "text": function( elem ) { 2029 var attr; 2030 return elem.nodeName.toLowerCase() === "input" && 2031 elem.type === "text" && 2032 2033 // Support: IE<8 2034 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 2035 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 2036 }, 2037 2038 // Position-in-collection 2039 "first": createPositionalPseudo(function() { 2040 return [ 0 ]; 2041 }), 2042 2043 "last": createPositionalPseudo(function( matchIndexes, length ) { 2044 return [ length - 1 ]; 2045 }), 2046 2047 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 2048 return [ argument < 0 ? argument + length : argument ]; 2049 }), 2050 2051 "even": createPositionalPseudo(function( matchIndexes, length ) { 2052 var i = 0; 2053 for ( ; i < length; i += 2 ) { 2054 matchIndexes.push( i ); 2055 } 2056 return matchIndexes; 2057 }), 2058 2059 "odd": createPositionalPseudo(function( matchIndexes, length ) { 2060 var i = 1; 2061 for ( ; i < length; i += 2 ) { 2062 matchIndexes.push( i ); 2063 } 2064 return matchIndexes; 2065 }), 2066 2067 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2068 var i = argument < 0 ? argument + length : argument; 2069 for ( ; --i >= 0; ) { 2070 matchIndexes.push( i ); 2071 } 2072 return matchIndexes; 2073 }), 2074 2075 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2076 var i = argument < 0 ? argument + length : argument; 2077 for ( ; ++i < length; ) { 2078 matchIndexes.push( i ); 2079 } 2080 return matchIndexes; 2081 }) 2082 } 2083}; 2084 2085Expr.pseudos["nth"] = Expr.pseudos["eq"]; 2086 2087// Add button/input type pseudos 2088for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 2089 Expr.pseudos[ i ] = createInputPseudo( i ); 2090} 2091for ( i in { submit: true, reset: true } ) { 2092 Expr.pseudos[ i ] = createButtonPseudo( i ); 2093} 2094 2095// Easy API for creating new setFilters 2096function setFilters() {} 2097setFilters.prototype = Expr.filters = Expr.pseudos; 2098Expr.setFilters = new setFilters(); 2099 2100tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 2101 var matched, match, tokens, type, 2102 soFar, groups, preFilters, 2103 cached = tokenCache[ selector + " " ]; 2104 2105 if ( cached ) { 2106 return parseOnly ? 0 : cached.slice( 0 ); 2107 } 2108 2109 soFar = selector; 2110 groups = []; 2111 preFilters = Expr.preFilter; 2112 2113 while ( soFar ) { 2114 2115 // Comma and first run 2116 if ( !matched || (match = rcomma.exec( soFar )) ) { 2117 if ( match ) { 2118 // Don't consume trailing commas as valid 2119 soFar = soFar.slice( match[0].length ) || soFar; 2120 } 2121 groups.push( (tokens = []) ); 2122 } 2123 2124 matched = false; 2125 2126 // Combinators 2127 if ( (match = rcombinators.exec( soFar )) ) { 2128 matched = match.shift(); 2129 tokens.push({ 2130 value: matched, 2131 // Cast descendant combinators to space 2132 type: match[0].replace( rtrim, " " ) 2133 }); 2134 soFar = soFar.slice( matched.length ); 2135 } 2136 2137 // Filters 2138 for ( type in Expr.filter ) { 2139 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 2140 (match = preFilters[ type ]( match ))) ) { 2141 matched = match.shift(); 2142 tokens.push({ 2143 value: matched, 2144 type: type, 2145 matches: match 2146 }); 2147 soFar = soFar.slice( matched.length ); 2148 } 2149 } 2150 2151 if ( !matched ) { 2152 break; 2153 } 2154 } 2155 2156 // Return the length of the invalid excess 2157 // if we're just parsing 2158 // Otherwise, throw an error or return tokens 2159 return parseOnly ? 2160 soFar.length : 2161 soFar ? 2162 Sizzle.error( selector ) : 2163 // Cache the tokens 2164 tokenCache( selector, groups ).slice( 0 ); 2165}; 2166 2167function toSelector( tokens ) { 2168 var i = 0, 2169 len = tokens.length, 2170 selector = ""; 2171 for ( ; i < len; i++ ) { 2172 selector += tokens[i].value; 2173 } 2174 return selector; 2175} 2176 2177function addCombinator( matcher, combinator, base ) { 2178 var dir = combinator.dir, 2179 checkNonElements = base && dir === "parentNode", 2180 doneName = done++; 2181 2182 return combinator.first ? 2183 // Check against closest ancestor/preceding element 2184 function( elem, context, xml ) { 2185 while ( (elem = elem[ dir ]) ) { 2186 if ( elem.nodeType === 1 || checkNonElements ) { 2187 return matcher( elem, context, xml ); 2188 } 2189 } 2190 } : 2191 2192 // Check against all ancestor/preceding elements 2193 function( elem, context, xml ) { 2194 var oldCache, uniqueCache, outerCache, 2195 newCache = [ dirruns, doneName ]; 2196 2197 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 2198 if ( xml ) { 2199 while ( (elem = elem[ dir ]) ) { 2200 if ( elem.nodeType === 1 || checkNonElements ) { 2201 if ( matcher( elem, context, xml ) ) { 2202 return true; 2203 } 2204 } 2205 } 2206 } else { 2207 while ( (elem = elem[ dir ]) ) { 2208 if ( elem.nodeType === 1 || checkNonElements ) { 2209 outerCache = elem[ expando ] || (elem[ expando ] = {}); 2210 2211 // Support: IE <9 only 2212 // Defend against cloned attroperties (jQuery gh-1709) 2213 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); 2214 2215 if ( (oldCache = uniqueCache[ dir ]) && 2216 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 2217 2218 // Assign to newCache so results back-propagate to previous elements 2219 return (newCache[ 2 ] = oldCache[ 2 ]); 2220 } else { 2221 // Reuse newcache so results back-propagate to previous elements 2222 uniqueCache[ dir ] = newCache; 2223 2224 // A match means we're done; a fail means we have to keep checking 2225 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 2226 return true; 2227 } 2228 } 2229 } 2230 } 2231 } 2232 }; 2233} 2234 2235function elementMatcher( matchers ) { 2236 return matchers.length > 1 ? 2237 function( elem, context, xml ) { 2238 var i = matchers.length; 2239 while ( i-- ) { 2240 if ( !matchers[i]( elem, context, xml ) ) { 2241 return false; 2242 } 2243 } 2244 return true; 2245 } : 2246 matchers[0]; 2247} 2248 2249function multipleContexts( selector, contexts, results ) { 2250 var i = 0, 2251 len = contexts.length; 2252 for ( ; i < len; i++ ) { 2253 Sizzle( selector, contexts[i], results ); 2254 } 2255 return results; 2256} 2257 2258function condense( unmatched, map, filter, context, xml ) { 2259 var elem, 2260 newUnmatched = [], 2261 i = 0, 2262 len = unmatched.length, 2263 mapped = map != null; 2264 2265 for ( ; i < len; i++ ) { 2266 if ( (elem = unmatched[i]) ) { 2267 if ( !filter || filter( elem, context, xml ) ) { 2268 newUnmatched.push( elem ); 2269 if ( mapped ) { 2270 map.push( i ); 2271 } 2272 } 2273 } 2274 } 2275 2276 return newUnmatched; 2277} 2278 2279function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 2280 if ( postFilter && !postFilter[ expando ] ) { 2281 postFilter = setMatcher( postFilter ); 2282 } 2283 if ( postFinder && !postFinder[ expando ] ) { 2284 postFinder = setMatcher( postFinder, postSelector ); 2285 } 2286 return markFunction(function( seed, results, context, xml ) { 2287 var temp, i, elem, 2288 preMap = [], 2289 postMap = [], 2290 preexisting = results.length, 2291 2292 // Get initial elements from seed or context 2293 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 2294 2295 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2296 matcherIn = preFilter && ( seed || !selector ) ? 2297 condense( elems, preMap, preFilter, context, xml ) : 2298 elems, 2299 2300 matcherOut = matcher ? 2301 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 2302 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 2303 2304 // ...intermediate processing is necessary 2305 [] : 2306 2307 // ...otherwise use results directly 2308 results : 2309 matcherIn; 2310 2311 // Find primary matches 2312 if ( matcher ) { 2313 matcher( matcherIn, matcherOut, context, xml ); 2314 } 2315 2316 // Apply postFilter 2317 if ( postFilter ) { 2318 temp = condense( matcherOut, postMap ); 2319 postFilter( temp, [], context, xml ); 2320 2321 // Un-match failing elements by moving them back to matcherIn 2322 i = temp.length; 2323 while ( i-- ) { 2324 if ( (elem = temp[i]) ) { 2325 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 2326 } 2327 } 2328 } 2329 2330 if ( seed ) { 2331 if ( postFinder || preFilter ) { 2332 if ( postFinder ) { 2333 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2334 temp = []; 2335 i = matcherOut.length; 2336 while ( i-- ) { 2337 if ( (elem = matcherOut[i]) ) { 2338 // Restore matcherIn since elem is not yet a final match 2339 temp.push( (matcherIn[i] = elem) ); 2340 } 2341 } 2342 postFinder( null, (matcherOut = []), temp, xml ); 2343 } 2344 2345 // Move matched elements from seed to results to keep them synchronized 2346 i = matcherOut.length; 2347 while ( i-- ) { 2348 if ( (elem = matcherOut[i]) && 2349 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 2350 2351 seed[temp] = !(results[temp] = elem); 2352 } 2353 } 2354 } 2355 2356 // Add elements to results, through postFinder if defined 2357 } else { 2358 matcherOut = condense( 2359 matcherOut === results ? 2360 matcherOut.splice( preexisting, matcherOut.length ) : 2361 matcherOut 2362 ); 2363 if ( postFinder ) { 2364 postFinder( null, results, matcherOut, xml ); 2365 } else { 2366 push.apply( results, matcherOut ); 2367 } 2368 } 2369 }); 2370} 2371 2372function matcherFromTokens( tokens ) { 2373 var checkContext, matcher, j, 2374 len = tokens.length, 2375 leadingRelative = Expr.relative[ tokens[0].type ], 2376 implicitRelative = leadingRelative || Expr.relative[" "], 2377 i = leadingRelative ? 1 : 0, 2378 2379 // The foundational matcher ensures that elements are reachable from top-level context(s) 2380 matchContext = addCombinator( function( elem ) { 2381 return elem === checkContext; 2382 }, implicitRelative, true ), 2383 matchAnyContext = addCombinator( function( elem ) { 2384 return indexOf( checkContext, elem ) > -1; 2385 }, implicitRelative, true ), 2386 matchers = [ function( elem, context, xml ) { 2387 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 2388 (checkContext = context).nodeType ? 2389 matchContext( elem, context, xml ) : 2390 matchAnyContext( elem, context, xml ) ); 2391 // Avoid hanging onto element (issue #299) 2392 checkContext = null; 2393 return ret; 2394 } ]; 2395 2396 for ( ; i < len; i++ ) { 2397 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 2398 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 2399 } else { 2400 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 2401 2402 // Return special upon seeing a positional matcher 2403 if ( matcher[ expando ] ) { 2404 // Find the next relative operator (if any) for proper handling 2405 j = ++i; 2406 for ( ; j < len; j++ ) { 2407 if ( Expr.relative[ tokens[j].type ] ) { 2408 break; 2409 } 2410 } 2411 return setMatcher( 2412 i > 1 && elementMatcher( matchers ), 2413 i > 1 && toSelector( 2414 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2415 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 2416 ).replace( rtrim, "$1" ), 2417 matcher, 2418 i < j && matcherFromTokens( tokens.slice( i, j ) ), 2419 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 2420 j < len && toSelector( tokens ) 2421 ); 2422 } 2423 matchers.push( matcher ); 2424 } 2425 } 2426 2427 return elementMatcher( matchers ); 2428} 2429 2430function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 2431 var bySet = setMatchers.length > 0, 2432 byElement = elementMatchers.length > 0, 2433 superMatcher = function( seed, context, xml, results, outermost ) { 2434 var elem, j, matcher, 2435 matchedCount = 0, 2436 i = "0", 2437 unmatched = seed && [], 2438 setMatched = [], 2439 contextBackup = outermostContext, 2440 // We must always have either seed elements or outermost context 2441 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 2442 // Use integer dirruns iff this is the outermost matcher 2443 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 2444 len = elems.length; 2445 2446 if ( outermost ) { 2447 outermostContext = context === document || context || outermost; 2448 } 2449 2450 // Add elements passing elementMatchers directly to results 2451 // Support: IE<9, Safari 2452 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 2453 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 2454 if ( byElement && elem ) { 2455 j = 0; 2456 if ( !context && elem.ownerDocument !== document ) { 2457 setDocument( elem ); 2458 xml = !documentIsHTML; 2459 } 2460 while ( (matcher = elementMatchers[j++]) ) { 2461 if ( matcher( elem, context || document, xml) ) { 2462 results.push( elem ); 2463 break; 2464 } 2465 } 2466 if ( outermost ) { 2467 dirruns = dirrunsUnique; 2468 } 2469 } 2470 2471 // Track unmatched elements for set filters 2472 if ( bySet ) { 2473 // They will have gone through all possible matchers 2474 if ( (elem = !matcher && elem) ) { 2475 matchedCount--; 2476 } 2477 2478 // Lengthen the array for every element, matched or not 2479 if ( seed ) { 2480 unmatched.push( elem ); 2481 } 2482 } 2483 } 2484 2485 // `i` is now the count of elements visited above, and adding it to `matchedCount` 2486 // makes the latter nonnegative. 2487 matchedCount += i; 2488 2489 // Apply set filters to unmatched elements 2490 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 2491 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 2492 // no element matchers and no seed. 2493 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 2494 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 2495 // numerically zero. 2496 if ( bySet && i !== matchedCount ) { 2497 j = 0; 2498 while ( (matcher = setMatchers[j++]) ) { 2499 matcher( unmatched, setMatched, context, xml ); 2500 } 2501 2502 if ( seed ) { 2503 // Reintegrate element matches to eliminate the need for sorting 2504 if ( matchedCount > 0 ) { 2505 while ( i-- ) { 2506 if ( !(unmatched[i] || setMatched[i]) ) { 2507 setMatched[i] = pop.call( results ); 2508 } 2509 } 2510 } 2511 2512 // Discard index placeholder values to get only actual matches 2513 setMatched = condense( setMatched ); 2514 } 2515 2516 // Add matches to results 2517 push.apply( results, setMatched ); 2518 2519 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2520 if ( outermost && !seed && setMatched.length > 0 && 2521 ( matchedCount + setMatchers.length ) > 1 ) { 2522 2523 Sizzle.uniqueSort( results ); 2524 } 2525 } 2526 2527 // Override manipulation of globals by nested matchers 2528 if ( outermost ) { 2529 dirruns = dirrunsUnique; 2530 outermostContext = contextBackup; 2531 } 2532 2533 return unmatched; 2534 }; 2535 2536 return bySet ? 2537 markFunction( superMatcher ) : 2538 superMatcher; 2539} 2540 2541compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 2542 var i, 2543 setMatchers = [], 2544 elementMatchers = [], 2545 cached = compilerCache[ selector + " " ]; 2546 2547 if ( !cached ) { 2548 // Generate a function of recursive functions that can be used to check each element 2549 if ( !match ) { 2550 match = tokenize( selector ); 2551 } 2552 i = match.length; 2553 while ( i-- ) { 2554 cached = matcherFromTokens( match[i] ); 2555 if ( cached[ expando ] ) { 2556 setMatchers.push( cached ); 2557 } else { 2558 elementMatchers.push( cached ); 2559 } 2560 } 2561 2562 // Cache the compiled function 2563 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 2564 2565 // Save selector and tokenization 2566 cached.selector = selector; 2567 } 2568 return cached; 2569}; 2570 2571/** 2572 * A low-level selection function that works with Sizzle's compiled 2573 * selector functions 2574 * @param {String|Function} selector A selector or a pre-compiled 2575 * selector function built with Sizzle.compile 2576 * @param {Element} context 2577 * @param {Array} [results] 2578 * @param {Array} [seed] A set of elements to match against 2579 */ 2580select = Sizzle.select = function( selector, context, results, seed ) { 2581 var i, tokens, token, type, find, 2582 compiled = typeof selector === "function" && selector, 2583 match = !seed && tokenize( (selector = compiled.selector || selector) ); 2584 2585 results = results || []; 2586 2587 // Try to minimize operations if there is only one selector in the list and no seed 2588 // (the latter of which guarantees us context) 2589 if ( match.length === 1 ) { 2590 2591 // Reduce context if the leading compound selector is an ID 2592 tokens = match[0] = match[0].slice( 0 ); 2593 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 2594 support.getById && context.nodeType === 9 && documentIsHTML && 2595 Expr.relative[ tokens[1].type ] ) { 2596 2597 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 2598 if ( !context ) { 2599 return results; 2600 2601 // Precompiled matchers will still verify ancestry, so step up a level 2602 } else if ( compiled ) { 2603 context = context.parentNode; 2604 } 2605 2606 selector = selector.slice( tokens.shift().value.length ); 2607 } 2608 2609 // Fetch a seed set for right-to-left matching 2610 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 2611 while ( i-- ) { 2612 token = tokens[i]; 2613 2614 // Abort if we hit a combinator 2615 if ( Expr.relative[ (type = token.type) ] ) { 2616 break; 2617 } 2618 if ( (find = Expr.find[ type ]) ) { 2619 // Search, expanding context for leading sibling combinators 2620 if ( (seed = find( 2621 token.matches[0].replace( runescape, funescape ), 2622 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 2623 )) ) { 2624 2625 // If seed is empty or no tokens remain, we can return early 2626 tokens.splice( i, 1 ); 2627 selector = seed.length && toSelector( tokens ); 2628 if ( !selector ) { 2629 push.apply( results, seed ); 2630 return results; 2631 } 2632 2633 break; 2634 } 2635 } 2636 } 2637 } 2638 2639 // Compile and execute a filtering function if one is not provided 2640 // Provide `match` to avoid retokenization if we modified the selector above 2641 ( compiled || compile( selector, match ) )( 2642 seed, 2643 context, 2644 !documentIsHTML, 2645 results, 2646 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 2647 ); 2648 return results; 2649}; 2650 2651// One-time assignments 2652 2653// Sort stability 2654support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 2655 2656// Support: Chrome 14-35+ 2657// Always assume duplicates if they aren't passed to the comparison function 2658support.detectDuplicates = !!hasDuplicate; 2659 2660// Initialize against the default document 2661setDocument(); 2662 2663// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 2664// Detached nodes confoundingly follow *each other* 2665support.sortDetached = assert(function( div1 ) { 2666 // Should return 1, but returns 4 (following) 2667 return div1.compareDocumentPosition( document.createElement("div") ) & 1; 2668}); 2669 2670// Support: IE<8 2671// Prevent attribute/property "interpolation" 2672// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 2673if ( !assert(function( div ) { 2674 div.innerHTML = "<a href='#'></a>"; 2675 return div.firstChild.getAttribute("href") === "#" ; 2676}) ) { 2677 addHandle( "type|href|height|width", function( elem, name, isXML ) { 2678 if ( !isXML ) { 2679 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 2680 } 2681 }); 2682} 2683 2684// Support: IE<9 2685// Use defaultValue in place of getAttribute("value") 2686if ( !support.attributes || !assert(function( div ) { 2687 div.innerHTML = "<input/>"; 2688 div.firstChild.setAttribute( "value", "" ); 2689 return div.firstChild.getAttribute( "value" ) === ""; 2690}) ) { 2691 addHandle( "value", function( elem, name, isXML ) { 2692 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 2693 return elem.defaultValue; 2694 } 2695 }); 2696} 2697 2698// Support: IE<9 2699// Use getAttributeNode to fetch booleans when getAttribute lies 2700if ( !assert(function( div ) { 2701 return div.getAttribute("disabled") == null; 2702}) ) { 2703 addHandle( booleans, function( elem, name, isXML ) { 2704 var val; 2705 if ( !isXML ) { 2706 return elem[ name ] === true ? name.toLowerCase() : 2707 (val = elem.getAttributeNode( name )) && val.specified ? 2708 val.value : 2709 null; 2710 } 2711 }); 2712} 2713 2714return Sizzle; 2715 2716})( window ); 2717 2718 2719 2720jQuery.find = Sizzle; 2721jQuery.expr = Sizzle.selectors; 2722jQuery.expr[ ":" ] = jQuery.expr.pseudos; 2723jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 2724jQuery.text = Sizzle.getText; 2725jQuery.isXMLDoc = Sizzle.isXML; 2726jQuery.contains = Sizzle.contains; 2727 2728 2729 2730var dir = function( elem, dir, until ) { 2731 var matched = [], 2732 truncate = until !== undefined; 2733 2734 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 2735 if ( elem.nodeType === 1 ) { 2736 if ( truncate && jQuery( elem ).is( until ) ) { 2737 break; 2738 } 2739 matched.push( elem ); 2740 } 2741 } 2742 return matched; 2743}; 2744 2745 2746var siblings = function( n, elem ) { 2747 var matched = []; 2748 2749 for ( ; n; n = n.nextSibling ) { 2750 if ( n.nodeType === 1 && n !== elem ) { 2751 matched.push( n ); 2752 } 2753 } 2754 2755 return matched; 2756}; 2757 2758 2759var rneedsContext = jQuery.expr.match.needsContext; 2760 2761var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); 2762 2763 2764 2765var risSimple = /^.[^:#\[\.,]*$/; 2766 2767// Implement the identical functionality for filter and not 2768function winnow( elements, qualifier, not ) { 2769 if ( jQuery.isFunction( qualifier ) ) { 2770 return jQuery.grep( elements, function( elem, i ) { 2771 /* jshint -W018 */ 2772 return !!qualifier.call( elem, i, elem ) !== not; 2773 } ); 2774 2775 } 2776 2777 if ( qualifier.nodeType ) { 2778 return jQuery.grep( elements, function( elem ) { 2779 return ( elem === qualifier ) !== not; 2780 } ); 2781 2782 } 2783 2784 if ( typeof qualifier === "string" ) { 2785 if ( risSimple.test( qualifier ) ) { 2786 return jQuery.filter( qualifier, elements, not ); 2787 } 2788 2789 qualifier = jQuery.filter( qualifier, elements ); 2790 } 2791 2792 return jQuery.grep( elements, function( elem ) { 2793 return (
2793jQuery.inArray( elem, qualifier ) > -1 ) !== not; 2794 } ); 2795} 2796 2797jQuery.filter = function( expr, elems, not ) { 2798 var elem = elems[ 0 ]; 2799 2800 if ( not ) { 2801 expr = ":not(" + expr + ")"; 2802 } 2803 2804 return elems.length === 1 && elem.nodeType === 1 ? 2805 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : 2806 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 2807 return elem.nodeType === 1; 2808 } ) ); 2809}; 2810 2811jQuery.fn.extend( { 2812 find: function( selector ) { 2813 var i, 2814 ret = [], 2815 self = this, 2816 len = self.length; 2817 2818 if ( typeof selector !== "string" ) {
vendor: 5,394 bytes, lines 2819-3021
2819 return this.pushStack( jQuery( selector ).filter( function() { 2820 for ( i = 0; i < len; i++ ) { 2821 if ( jQuery.contains( self[ i ], this ) ) { 2822 return true; 2823 } 2824 } 2825 } ) ); 2826 } 2827 2828 for ( i = 0; i < len; i++ ) { 2829 jQuery.find( selector, self[ i ], ret ); 2830 } 2831 2832 // Needed because $( selector, context ) becomes $( context ).find( selector ) 2833 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); 2834 ret.selector = this.selector ? this.selector + " " + selector : selector; 2835 return ret; 2836 }, 2837 filter: function( selector ) { 2838 return this.pushStack( winnow( this, selector || [], false ) ); 2839 }, 2840 not: function( selector ) { 2841 return this.pushStack( winnow( this, selector || [], true ) ); 2842 }, 2843 is: function( selector ) { 2844 return !!winnow( 2845 this, 2846 2847 // If this is a positional/relative selector, check membership in the returned set 2848 // so $("p:first").is("p:last") won't return true for a doc with two "p". 2849 typeof selector === "string" && rneedsContext.test( selector ) ? 2850 jQuery( selector ) : 2851 selector || [], 2852 false 2853 ).length; 2854 } 2855} ); 2856 2857 2858// Initialize a jQuery object 2859 2860 2861// A central reference to the root jQuery(document) 2862var rootjQuery, 2863 2864 // A simple way to check for HTML strings 2865 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 2866 // Strict HTML recognition (#11290: must start with <) 2867 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 2868 2869 init = jQuery.fn.init = function( selector, context, root ) { 2870 var match, elem; 2871 2872 // HANDLE: $(""), $(null), $(undefined), $(false) 2873 if ( !selector ) { 2874 return this; 2875 } 2876 2877 // init accepts an alternate rootjQuery 2878 // so migrate can support jQuery.sub (gh-2101) 2879 root = root || rootjQuery; 2880 2881 // Handle HTML strings 2882 if ( typeof selector === "string" ) { 2883 if ( selector.charAt( 0 ) === "<" && 2884 selector.charAt( selector.length - 1 ) === ">" && 2885 selector.length >= 3 ) { 2886 2887 // Assume that strings that start and end with <> are HTML and skip the regex check 2888 match = [ null, selector, null ]; 2889 2890 } else { 2891 match = rquickExpr.exec( selector ); 2892 } 2893 2894 // Match html or make sure no context is specified for #id 2895 if ( match && ( match[ 1 ] || !context ) ) { 2896 2897 // HANDLE: $(html) -> $(array) 2898 if ( match[ 1 ] ) { 2899 context = context instanceof jQuery ? context[ 0 ] : context; 2900 2901 // scripts is true for back-compat 2902 // Intentionally let the error be thrown if parseHTML is not present 2903 jQuery.merge( this, jQuery.parseHTML( 2904 match[ 1 ], 2905 context && context.nodeType ? context.ownerDocument || context : document, 2906 true 2907 ) ); 2908 2909 // HANDLE: $(html, props) 2910 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 2911 for ( match in context ) { 2912 2913 // Properties of context are called as methods if possible 2914 if ( jQuery.isFunction( this[ match ] ) ) { 2915 this[ match ]( context[ match ] ); 2916 2917 // ...and otherwise set as attributes 2918 } else { 2919 this.attr( match, context[ match ] ); 2920 } 2921 } 2922 } 2923 2924 return this; 2925 2926 // HANDLE: $(#id) 2927 } else { 2928 elem = document.getElementById( match[ 2 ] ); 2929 2930 // Check parentNode to catch when Blackberry 4.6 returns 2931 // nodes that are no longer in the document #6963 2932 if ( elem && elem.parentNode ) { 2933 2934 // Handle the case where IE and Opera return items 2935 // by name instead of ID 2936 if ( elem.id !== match[ 2 ] ) { 2937 return rootjQuery.find( selector ); 2938 } 2939 2940 // Otherwise, we inject the element directly into the jQuery object 2941 this.length = 1; 2942 this[ 0 ] = elem; 2943 } 2944 2945 this.context = document; 2946 this.selector = selector; 2947 return this; 2948 } 2949 2950 // HANDLE: $(expr, $(...)) 2951 } else if ( !context || context.jquery ) { 2952 return ( context || root ).find( selector ); 2953 2954 // HANDLE: $(expr, context) 2955 // (which is just equivalent to: $(context).find(expr) 2956 } else { 2957 return this.constructor( context ).find( selector ); 2958 } 2959 2960 // HANDLE: $(DOMElement) 2961 } else if ( selector.nodeType ) { 2962 this.context = this[ 0 ] = selector; 2963 this.length = 1; 2964 return this; 2965 2966 // HANDLE: $(function) 2967 // Shortcut for document ready 2968 } else if ( jQuery.isFunction( selector ) ) { 2969 return typeof root.ready !== "undefined" ? 2970 root.ready( selector ) : 2971 2972 // Execute immediately if ready is not present 2973 selector( jQuery ); 2974 } 2975 2976 if ( selector.selector !== undefined ) { 2977 this.selector = selector.selector; 2978 this.context = selector.context; 2979 } 2980 2981 return jQuery.makeArray( selector, this ); 2982 }; 2983 2984// Give the init function the jQuery prototype for later instantiation 2985init.prototype = jQuery.fn; 2986 2987// Initialize central reference 2988rootjQuery = jQuery( document ); 2989 2990 2991var rparentsprev = /^(?:parents|prev(?:Until|All))/, 2992 2993 // methods guaranteed to produce a unique set when starting from a unique set 2994 guaranteedUnique = { 2995 children: true, 2996 contents: true, 2997 next: true, 2998 prev: true 2999 }; 3000 3001jQuery.fn.extend( { 3002 has: function( target ) { 3003 var i, 3004 targets = jQuery( target, this ), 3005 len = targets.length; 3006 3007 return this.filter( function() { 3008 for ( i = 0; i < len; i++ ) { 3009 if ( jQuery.contains( this, targets[ i ] ) ) { 3010 return true; 3011 } 3012 } 3013 } ); 3014 }, 3015 3016 closest: function( selectors, context ) { 3017 var cur, 3018 i = 0, 3019 l = this.length, 3020 matched = [], 3021 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
vendor: 12,881 bytes, lines 3022-3530
3022 jQuery( selectors, context || this.context ) : 3023 0; 3024 3025 for ( ; i < l; i++ ) { 3026 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 3027 3028 // Always skip document fragments 3029 if ( cur.nodeType < 11 && ( pos ? 3030 pos.index( cur ) > -1 : 3031 3032 // Don't pass non-elements to Sizzle 3033 cur.nodeType === 1 && 3034 jQuery.find.matchesSelector( cur, selectors ) ) ) { 3035 3036 matched.push( cur ); 3037 break; 3038 } 3039 } 3040 } 3041 3042 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 3043 }, 3044 3045 // Determine the position of an element within 3046 // the matched set of elements 3047 index: function( elem ) { 3048 3049 // No argument, return index in parent 3050 if ( !elem ) { 3051 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 3052 } 3053 3054 // index in selector 3055 if ( typeof elem === "string" ) { 3056 return jQuery.inArray( this[ 0 ], jQuery( elem ) ); 3057 } 3058 3059 // Locate the position of the desired element 3060 return jQuery.inArray( 3061 3062 // If it receives a jQuery object, the first element is used 3063 elem.jquery ? elem[ 0 ] : elem, this ); 3064 }, 3065 3066 add: function( selector, context ) { 3067 return this.pushStack( 3068 jQuery.uniqueSort( 3069 jQuery.merge( this.get(), jQuery( selector, context ) ) 3070 ) 3071 ); 3072 }, 3073 3074 addBack: function( selector ) { 3075 return this.add( selector == null ? 3076 this.prevObject : this.prevObject.filter( selector ) 3077 ); 3078 } 3079} ); 3080 3081function sibling( cur, dir ) { 3082 do { 3083 cur = cur[ dir ]; 3084 } while ( cur && cur.nodeType !== 1 ); 3085 3086 return cur; 3087} 3088 3089jQuery.each( { 3090 parent: function( elem ) { 3091 var parent = elem.parentNode; 3092 return parent && parent.nodeType !== 11 ? parent : null; 3093 }, 3094 parents: function( elem ) { 3095 return dir( elem, "parentNode" ); 3096 }, 3097 parentsUntil: function( elem, i, until ) { 3098 return dir( elem, "parentNode", until ); 3099 }, 3100 next: function( elem ) { 3101 return sibling( elem, "nextSibling" ); 3102 }, 3103 prev: function( elem ) { 3104 return sibling( elem, "previousSibling" ); 3105 }, 3106 nextAll: function( elem ) { 3107 return dir( elem, "nextSibling" ); 3108 }, 3109 prevAll: function( elem ) { 3110 return dir( elem, "previousSibling" ); 3111 }, 3112 nextUntil: function( elem, i, until ) { 3113 return dir( elem, "nextSibling", until ); 3114 }, 3115 prevUntil: function( elem, i, until ) { 3116 return dir( elem, "previousSibling", until ); 3117 }, 3118 siblings: function( elem ) { 3119 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 3120 }, 3121 children: function( elem ) { 3122 return siblings( elem.firstChild ); 3123 }, 3124 contents: function( elem ) { 3125 return jQuery.nodeName( elem, "iframe" ) ? 3126 elem.contentDocument || elem.contentWindow.document : 3127 jQuery.merge( [], elem.childNodes ); 3128 } 3129}, function( name, fn ) { 3130 jQuery.fn[ name ] = function( until, selector ) { 3131 var ret = jQuery.map( this, fn, until ); 3132 3133 if ( name.slice( -5 ) !== "Until" ) { 3134 selector = until; 3135 } 3136 3137 if ( selector && typeof selector === "string" ) { 3138 ret = jQuery.filter( selector, ret ); 3139 } 3140 3141 if ( this.length > 1 ) { 3142 3143 // Remove duplicates 3144 if ( !guaranteedUnique[ name ] ) { 3145 ret = jQuery.uniqueSort( ret ); 3146 } 3147 3148 // Reverse order for parents* and prev-derivatives 3149 if ( rparentsprev.test( name ) ) { 3150 ret = ret.reverse(); 3151 } 3152 } 3153 3154 return this.pushStack( ret ); 3155 }; 3156} ); 3157var rnotwhite = ( /\S+/g ); 3158 3159 3160 3161// Convert String-formatted options into Object-formatted ones 3162function createOptions( options ) { 3163 var object = {}; 3164 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { 3165 object[ flag ] = true; 3166 } ); 3167 return object; 3168} 3169 3170/* 3171 * Create a callback list using the following parameters: 3172 * 3173 * options: an optional list of space-separated options that will change how 3174 * the callback list behaves or a more traditional option object 3175 * 3176 * By default a callback list will act like an event callback list and can be 3177 * "fired" multiple times. 3178 * 3179 * Possible options: 3180 * 3181 * once: will ensure the callback list can only be fired once (like a Deferred) 3182 * 3183 * memory: will keep track of previous values and will call any callback added 3184 * after the list has been fired right away with the latest "memorized" 3185 * values (like a Deferred) 3186 * 3187 * unique: will ensure a callback can only be added once (no duplicate in the list) 3188 * 3189 * stopOnFalse: interrupt callings when a callback returns false 3190 * 3191 */ 3192jQuery.Callbacks = function( options ) { 3193 3194 // Convert options from String-formatted to Object-formatted if needed 3195 // (we check in cache first) 3196 options = typeof options === "string" ? 3197 createOptions( options ) : 3198 jQuery.extend( {}, options ); 3199 3200 var // Flag to know if list is currently firing 3201 firing, 3202 3203 // Last fire value for non-forgettable lists 3204 memory, 3205 3206 // Flag to know if list was already fired 3207 fired, 3208 3209 // Flag to prevent firing 3210 locked, 3211 3212 // Actual callback list 3213 list = [], 3214 3215 // Queue of execution data for repeatable lists 3216 queue = [], 3217 3218 // Index of currently firing callback (modified by add/remove as needed) 3219 firingIndex = -1, 3220 3221 // Fire callbacks 3222 fire = function() { 3223 3224 // Enforce single-firing 3225 locked = options.once; 3226 3227 // Execute callbacks for all pending executions, 3228 // respecting firingIndex overrides and runtime changes 3229 fired = firing = true; 3230 for ( ; queue.length; firingIndex = -1 ) { 3231 memory = queue.shift(); 3232 while ( ++firingIndex < list.length ) { 3233 3234 // Run callback and check for early termination 3235 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 3236 options.stopOnFalse ) { 3237 3238 // Jump to end and forget the data so .add doesn't re-fire 3239 firingIndex = list.length; 3240 memory = false; 3241 } 3242 } 3243 } 3244 3245 // Forget the data if we're done with it 3246 if ( !options.memory ) { 3247 memory = false; 3248 } 3249 3250 firing = false; 3251 3252 // Clean up if we're done firing for good 3253 if ( locked ) { 3254 3255 // Keep an empty list if we have data for future add calls 3256 if ( memory ) { 3257 list = []; 3258 3259 // Otherwise, this object is spent 3260 } else { 3261 list = ""; 3262 } 3263 } 3264 }, 3265 3266 // Actual Callbacks object 3267 self = { 3268 3269 // Add a callback or a collection of callbacks to the list 3270 add: function() { 3271 if ( list ) { 3272 3273 // If we have memory from a past run, we should fire after adding 3274 if ( memory && !firing ) { 3275 firingIndex = list.length - 1; 3276 queue.push( memory ); 3277 } 3278 3279 ( function add( args ) { 3280 jQuery.each( args, function( _, arg ) { 3281 if ( jQuery.isFunction( arg ) ) { 3282 if ( !options.unique || !self.has( arg ) ) { 3283 list.push( arg ); 3284 } 3285 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { 3286 3287 // Inspect recursively 3288 add( arg ); 3289 } 3290 } ); 3291 } )( arguments ); 3292 3293 if ( memory && !firing ) { 3294 fire(); 3295 } 3296 } 3297 return this; 3298 }, 3299 3300 // Remove a callback from the list 3301 remove: function() { 3302 jQuery.each( arguments, function( _, arg ) { 3303 var index; 3304 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 3305 list.splice( index, 1 ); 3306 3307 // Handle firing indexes 3308 if ( index <= firingIndex ) { 3309 firingIndex--; 3310 } 3311 } 3312 } ); 3313 return this; 3314 }, 3315 3316 // Check if a given callback is in the list. 3317 // If no argument is given, return whether or not list has callbacks attached. 3318 has: function( fn ) { 3319 return fn ? 3320 jQuery.inArray( fn, list ) > -1 : 3321 list.length > 0; 3322 }, 3323 3324 // Remove all callbacks from the list 3325 empty: function() { 3326 if ( list ) { 3327 list = []; 3328 } 3329 return this; 3330 }, 3331 3332 // Disable .fire and .add 3333 // Abort any current/pending executions 3334 // Clear all callbacks and values 3335 disable: function() { 3336 locked = queue = []; 3337 list = memory = ""; 3338 return this; 3339 }, 3340 disabled: function() { 3341 return !list; 3342 }, 3343 3344 // Disable .fire 3345 // Also disable .add unless we have memory (since it would have no effect) 3346 // Abort any pending executions 3347 lock: function() { 3348 locked = true; 3349 if ( !memory ) { 3350 self.disable(); 3351 } 3352 return this; 3353 }, 3354 locked: function() { 3355 return !!locked; 3356 }, 3357 3358 // Call all callbacks with the given context and arguments 3359 fireWith: function( context, args ) { 3360 if ( !locked ) { 3361 args = args || []; 3362 args = [ context, args.slice ? args.slice() : args ]; 3363 queue.push( args ); 3364 if ( !firing ) { 3365 fire(); 3366 } 3367 } 3368 return this; 3369 }, 3370 3371 // Call all the callbacks with the given arguments 3372 fire: function() { 3373 self.fireWith( this, arguments ); 3374 return this; 3375 }, 3376 3377 // To know if the callbacks have already been called at least once 3378 fired: function() { 3379 return !!fired; 3380 } 3381 }; 3382 3383 return self; 3384}; 3385 3386 3387jQuery.extend( { 3388 3389 Deferred: function( func ) { 3390 var tuples = [ 3391 3392 // action, add listener, listener list, final state 3393 [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], 3394 [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], 3395 [ "notify", "progress", jQuery.Callbacks( "memory" ) ] 3396 ], 3397 state = "pending", 3398 promise = { 3399 state: function() { 3400 return state; 3401 }, 3402 always: function() { 3403 deferred.done( arguments ).fail( arguments ); 3404 return this; 3405 }, 3406 then: function( /* fnDone, fnFail, fnProgress */ ) { 3407 var fns = arguments; 3408 return jQuery.Deferred( function( newDefer ) { 3409 jQuery.each( tuples, function( i, tuple ) { 3410 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 3411 3412 // deferred[ done | fail | progress ] for forwarding actions to newDefer 3413 deferred[ tuple[ 1 ] ]( function() { 3414 var returned = fn && fn.apply( this, arguments ); 3415 if ( returned && jQuery.isFunction( returned.promise ) ) { 3416 returned.promise() 3417 .progress( newDefer.notify ) 3418 .done( newDefer.resolve ) 3419 .fail( newDefer.reject ); 3420 } else { 3421 newDefer[ tuple[ 0 ] + "With" ]( 3422 this === promise ? newDefer.promise() : this, 3423 fn ? [ returned ] : arguments 3424 ); 3425 } 3426 } ); 3427 } ); 3428 fns = null; 3429 } ).promise(); 3430 }, 3431 3432 // Get a promise for this deferred 3433 // If obj is provided, the promise aspect is added to the object 3434 promise: function( obj ) { 3435 return obj != null ? jQuery.extend( obj, promise ) : promise; 3436 } 3437 }, 3438 deferred = {}; 3439 3440 // Keep pipe for back-compat 3441 promise.pipe = promise.then; 3442 3443 // Add list-specific methods 3444 jQuery.each( tuples, function( i, tuple ) { 3445 var list = tuple[ 2 ], 3446 stateString = tuple[ 3 ]; 3447 3448 // promise[ done | fail | progress ] = list.add 3449 promise[ tuple[ 1 ] ] = list.add; 3450 3451 // Handle state 3452 if ( stateString ) { 3453 list.add( function() { 3454 3455 // state = [ resolved | rejected ] 3456 state = stateString; 3457 3458 // [ reject_list | resolve_list ].disable; progress_list.lock 3459 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 3460 } 3461 3462 // deferred[ resolve | reject | notify ] 3463 deferred[ tuple[ 0 ] ] = function() { 3464 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); 3465 return this; 3466 }; 3467 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 3468 } ); 3469 3470 // Make the deferred a promise 3471 promise.promise( deferred ); 3472 3473 // Call given func if any 3474 if ( func ) { 3475 func.call( deferred, deferred ); 3476 } 3477 3478 // All done! 3479 return deferred; 3480 }, 3481 3482 // Deferred helper 3483 when: function( subordinate /* , ..., subordinateN */ ) { 3484 var i = 0, 3485 resolveValues = slice.call( arguments ), 3486 length = resolveValues.length, 3487 3488 // the count of uncompleted subordinates 3489 remaining = length !== 1 || 3490 ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, 3491 3492 // the master Deferred. 3493 // If resolveValues consist of only a single Deferred, just use that. 3494 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 3495 3496 // Update function for both resolve and progress values 3497 updateFunc = function( i, contexts, values ) { 3498 return function( value ) { 3499 contexts[ i ] = this; 3500 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 3501 if ( values === progressValues ) { 3502 deferred.notifyWith( contexts, values ); 3503 3504 } else if ( !( --remaining ) ) { 3505 deferred.resolveWith( contexts, values ); 3506 } 3507 }; 3508 }, 3509 3510 progressValues, progressContexts, resolveContexts; 3511 3512 // add listeners to Deferred subordinates; treat others as resolved 3513 if ( length > 1 ) { 3514 progressValues = new Array( length ); 3515 progressContexts = new Array( length ); 3516 resolveContexts = new Array( length ); 3517 for ( ; i < length; i++ ) { 3518 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { 3519 resolveValues[ i ].promise() 3520 .progress( updateFunc( i, progressContexts, progressValues ) ) 3521 .done( updateFunc( i, resolveContexts, resolveValues ) ) 3522 .fail( deferred.reject ); 3523 } else { 3524 --remaining; 3525 } 3526 } 3527 } 3528 3529 // if we're not waiting on anything, resolve the master 3530 if ( !remaining ) {
vendor: 17,620 bytes, lines 3531-4259
3531 deferred.resolveWith( resolveContexts, resolveValues ); 3532 } 3533 3534 return deferred.promise(); 3535 } 3536} ); 3537 3538 3539// The deferred used on DOM ready 3540var readyList; 3541 3542jQuery.fn.ready = function( fn ) { 3543 3544 // Add the callback 3545 jQuery.ready.promise().done( fn ); 3546 3547 return this; 3548}; 3549 3550jQuery.extend( { 3551 3552 // Is the DOM ready to be used? Set to true once it occurs. 3553 isReady: false, 3554 3555 // A counter to track how many items to wait for before 3556 // the ready event fires. See #6781 3557 readyWait: 1, 3558 3559 // Hold (or release) the ready event 3560 holdReady: function( hold ) { 3561 if ( hold ) { 3562 jQuery.readyWait++; 3563 } else { 3564 jQuery.ready( true ); 3565 } 3566 }, 3567 3568 // Handle when the DOM is ready 3569 ready: function( wait ) { 3570 3571 // Abort if there are pending holds or we're already ready 3572 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 3573 return; 3574 } 3575 3576 // Remember that the DOM is ready 3577 jQuery.isReady = true; 3578 3579 // If a normal DOM Ready event fired, decrement, and wait if need be 3580 if ( wait !== true && --jQuery.readyWait > 0 ) { 3581 return; 3582 } 3583 3584 // If there are functions bound, to execute 3585 readyList.resolveWith( document, [ jQuery ] ); 3586 3587 // Trigger any bound ready events 3588 if ( jQuery.fn.triggerHandler ) { 3589 jQuery( document ).triggerHandler( "ready" ); 3590 jQuery( document ).off( "ready" ); 3591 } 3592 } 3593} ); 3594 3595/** 3596 * Clean-up method for dom ready events 3597 */ 3598function detach() { 3599 if ( document.addEventListener ) { 3600 document.removeEventListener( "DOMContentLoaded", completed ); 3601 window.removeEventListener( "load", completed ); 3602 3603 } else { 3604 document.detachEvent( "onreadystatechange", completed ); 3605 window.detachEvent( "onload", completed ); 3606 } 3607} 3608 3609/** 3610 * The ready event handler and self cleanup method 3611 */ 3612function completed() { 3613 3614 // readyState === "complete" is good enough for us to call the dom ready in oldIE 3615 if ( document.addEventListener || 3616 window.event.type === "load" || 3617 document.readyState === "complete" ) { 3618 3619 detach(); 3620 jQuery.ready(); 3621 } 3622} 3623 3624jQuery.ready.promise = function( obj ) { 3625 if ( !readyList ) { 3626 3627 readyList = jQuery.Deferred(); 3628 3629 // Catch cases where $(document).ready() is called 3630 // after the browser event has already occurred. 3631 // Support: IE6-10 3632 // Older IE sometimes signals "interactive" too soon 3633 if ( document.readyState === "complete" || 3634 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 3635 3636 // Handle it asynchronously to allow scripts the opportunity to delay ready 3637 window.setTimeout( jQuery.ready ); 3638 3639 // Standards-based browsers support DOMContentLoaded 3640 } else if ( document.addEventListener ) { 3641 3642 // Use the handy event callback 3643 document.addEventListener( "DOMContentLoaded", completed ); 3644 3645 // A fallback to window.onload, that will always work 3646 window.addEventListener( "load", completed ); 3647 3648 // If IE event model is used 3649 } else { 3650 3651 // Ensure firing before onload, maybe late but safe also for iframes 3652 document.attachEvent( "onreadystatechange", completed ); 3653 3654 // A fallback to window.onload, that will always work 3655 window.attachEvent( "onload", completed ); 3656 3657 // If IE and not a frame 3658 // continually check to see if the document is ready 3659 var top = false; 3660 3661 try { 3662 top = window.frameElement == null && document.documentElement; 3663 } catch ( e ) {} 3664 3665 if ( top && top.doScroll ) { 3666 ( function doScrollCheck() { 3667 if ( !jQuery.isReady ) { 3668 3669 try { 3670 3671 // Use the trick by Diego Perini 3672 // http://javascript.nwbox.com/IEContentLoaded/ 3673 top.doScroll( "left" ); 3674 } catch ( e ) { 3675 return window.setTimeout( doScrollCheck, 50 ); 3676 } 3677 3678 // detach all dom ready events 3679 detach(); 3680 3681 // and execute any waiting functions 3682 jQuery.ready(); 3683 } 3684 } )(); 3685 } 3686 } 3687 } 3688 return readyList.promise( obj ); 3689}; 3690 3691// Kick off the DOM ready check even if the user does not 3692jQuery.ready.promise(); 3693 3694 3695 3696 3697// Support: IE<9 3698// Iteration over object's inherited properties before its own 3699var i; 3700for ( i in jQuery( support ) ) { 3701 break; 3702} 3703support.ownFirst = i === "0"; 3704 3705// Note: most support tests are defined in their respective modules. 3706// false until the test is run 3707support.inlineBlockNeedsLayout = false; 3708 3709// Execute ASAP in case we need to set body.style.zoom 3710jQuery( function() { 3711 3712 // Minified: var a,b,c,d 3713 var val, div, body, container; 3714 3715 body = document.getElementsByTagName( "body" )[ 0 ]; 3716 if ( !body || !body.style ) { 3717 3718 // Return for frameset docs that don't have a body 3719 return; 3720 } 3721 3722 // Setup 3723 div = document.createElement( "div" ); 3724 container = document.createElement( "div" ); 3725 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 3726 body.appendChild( container ).appendChild( div ); 3727 3728 if ( typeof div.style.zoom !== "undefined" ) { 3729 3730 // Support: IE<8 3731 // Check if natively block-level elements act like inline-block 3732 // elements when setting their display to 'inline' and giving 3733 // them layout 3734 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; 3735 3736 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; 3737 if ( val ) { 3738 3739 // Prevent IE 6 from affecting layout for positioned elements #11048 3740 // Prevent IE from shrinking the body in IE 7 mode #12869 3741 // Support: IE<8 3742 body.style.zoom = 1; 3743 } 3744 } 3745 3746 body.removeChild( container ); 3747} ); 3748 3749 3750( function() { 3751 var div = document.createElement( "div" ); 3752 3753 // Support: IE<9 3754 support.deleteExpando = true; 3755 try { 3756 delete div.test; 3757 } catch ( e ) { 3758 support.deleteExpando = false; 3759 } 3760 3761 // Null elements to avoid leaks in IE. 3762 div = null; 3763} )(); 3764var acceptData = function( elem ) { 3765 var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], 3766 nodeType = +elem.nodeType || 1; 3767 3768 // Do not set data on non-element DOM nodes because it will not be cleared (#8335). 3769 return nodeType !== 1 && nodeType !== 9 ? 3770 false : 3771 3772 // Nodes accept data unless otherwise specified; rejection can be conditional 3773 !noData || noData !== true && elem.getAttribute( "classid" ) === noData; 3774}; 3775 3776 3777 3778 3779var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 3780 rmultiDash = /([A-Z])/g; 3781 3782function dataAttr( elem, key, data ) { 3783 3784 // If nothing was found internally, try to fetch any 3785 // data from the HTML5 data-* attribute 3786 if ( data === undefined && elem.nodeType === 1 ) { 3787 3788 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 3789 3790 data = elem.getAttribute( name ); 3791 3792 if ( typeof data === "string" ) { 3793 try { 3794 data = data === "true" ? true : 3795 data === "false" ? false : 3796 data === "null" ? null : 3797 3798 // Only convert to a number if it doesn't change the string 3799 +data + "" === data ? +data : 3800 rbrace.test( data ) ? jQuery.parseJSON( data ) : 3801 data; 3802 } catch ( e ) {} 3803 3804 // Make sure we set the data so it isn't changed later 3805 jQuery.data( elem, key, data ); 3806 3807 } else { 3808 data = undefined; 3809 } 3810 } 3811 3812 return data; 3813} 3814 3815// checks a cache object for emptiness 3816function isEmptyDataObject( obj ) { 3817 var name; 3818 for ( name in obj ) { 3819 3820 // if the public data object is empty, the private is still empty 3821 if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { 3822 continue; 3823 } 3824 if ( name !== "toJSON" ) { 3825 return false; 3826 } 3827 } 3828 3829 return true; 3830} 3831 3832function internalData( elem, name, data, pvt /* Internal Use Only */ ) { 3833 if ( !acceptData( elem ) ) { 3834 return; 3835 } 3836 3837 var ret, thisCache, 3838 internalKey = jQuery.expando, 3839 3840 // We have to handle DOM nodes and JS objects differently because IE6-7 3841 // can't GC object references properly across the DOM-JS boundary 3842 isNode = elem.nodeType, 3843 3844 // Only DOM nodes need the global jQuery cache; JS object data is 3845 // attached directly to the object so GC can occur automatically 3846 cache = isNode ? jQuery.cache : elem, 3847 3848 // Only defining an ID for JS objects if its cache already exists allows 3849 // the code to shortcut on the same path as a DOM node with no cache 3850 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; 3851 3852 // Avoid doing any more work than we need to when trying to get data on an 3853 // object that has no data at all 3854 if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && 3855 data === undefined && typeof name === "string" ) { 3856 return; 3857 } 3858 3859 if ( !id ) { 3860 3861 // Only DOM nodes need a new unique ID for each element since their data 3862 // ends up in the global cache 3863 if ( isNode ) { 3864 id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; 3865 } else { 3866 id = internalKey; 3867 } 3868 } 3869 3870 if ( !cache[ id ] ) { 3871 3872 // Avoid exposing jQuery metadata on plain JS objects when the object 3873 // is serialized using JSON.stringify 3874 cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; 3875 } 3876 3877 // An object can be passed to jQuery.data instead of a key/value pair; this gets 3878 // shallow copied over onto the existing cache 3879 if ( typeof name === "object" || typeof name === "function" ) { 3880 if ( pvt ) { 3881 cache[ id ] = jQuery.extend( cache[ id ], name ); 3882 } else { 3883 cache[ id ].data = jQuery.extend( cache[ id ].data, name ); 3884 } 3885 } 3886 3887 thisCache = cache[ id ]; 3888 3889 // jQuery data() is stored in a separate object inside the object's internal data 3890 // cache in order to avoid key collisions between internal data and user-defined 3891 // data. 3892 if ( !pvt ) { 3893 if ( !thisCache.data ) { 3894 thisCache.data = {}; 3895 } 3896 3897 thisCache = thisCache.data; 3898 } 3899 3900 if ( data !== undefined ) { 3901 thisCache[ jQuery.camelCase( name ) ] = data; 3902 } 3903 3904 // Check for both converted-to-camel and non-converted data property names 3905 // If a data property was specified 3906 if ( typeof name === "string" ) { 3907 3908 // First Try to find as-is property data 3909 ret = thisCache[ name ]; 3910 3911 // Test for null|undefined property data 3912 if ( ret == null ) { 3913 3914 // Try to find the camelCased property 3915 ret = thisCache[ jQuery.camelCase( name ) ]; 3916 } 3917 } else { 3918 ret = thisCache; 3919 } 3920 3921 return ret; 3922} 3923 3924function internalRemoveData( elem, name, pvt ) { 3925 if ( !acceptData( elem ) ) { 3926 return; 3927 } 3928 3929 var thisCache, i, 3930 isNode = elem.nodeType, 3931 3932 // See jQuery.data for more information 3933 cache = isNode ? jQuery.cache : elem, 3934 id = isNode ? elem[ jQuery.expando ] : jQuery.expando; 3935 3936 // If there is already no cache entry for this object, there is no 3937 // purpose in continuing 3938 if ( !cache[ id ] ) { 3939 return; 3940 } 3941 3942 if ( name ) { 3943 3944 thisCache = pvt ? cache[ id ] : cache[ id ].data; 3945 3946 if ( thisCache ) { 3947 3948 // Support array or space separated string names for data keys 3949 if ( !jQuery.isArray( name ) ) { 3950 3951 // try the string as a key before any manipulation 3952 if ( name in thisCache ) { 3953 name = [ name ]; 3954 } else { 3955 3956 // split the camel cased version by spaces unless a key with the spaces exists 3957 name = jQuery.camelCase( name ); 3958 if ( name in thisCache ) { 3959 name = [ name ]; 3960 } else { 3961 name = name.split( " " ); 3962 } 3963 } 3964 } else { 3965 3966 // If "name" is an array of keys... 3967 // When data is initially created, via ("key", "val") signature, 3968 // keys will be converted to camelCase. 3969 // Since there is no way to tell _how_ a key was added, remove 3970 // both plain key and camelCase key. #12786 3971 // This will only penalize the array argument path. 3972 name = name.concat( jQuery.map( name, jQuery.camelCase ) ); 3973 } 3974 3975 i = name.length; 3976 while ( i-- ) { 3977 delete thisCache[ name[ i ] ]; 3978 } 3979 3980 // If there is no data left in the cache, we want to continue 3981 // and let the cache object itself get destroyed 3982 if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { 3983 return; 3984 } 3985 } 3986 } 3987 3988 // See jQuery.data for more information 3989 if ( !pvt ) { 3990 delete cache[ id ].data; 3991 3992 // Don't destroy the parent cache unless the internal data object 3993 // had been the only thing left in it 3994 if ( !isEmptyDataObject( cache[ id ] ) ) { 3995 return; 3996 } 3997 } 3998 3999 // Destroy the cache 4000 if ( isNode ) { 4001 jQuery.cleanData( [ elem ], true ); 4002 4003 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) 4004 /* jshint eqeqeq: false */ 4005 } else if ( support.deleteExpando || cache != cache.window ) { 4006 /* jshint eqeqeq: true */ 4007 delete cache[ id ]; 4008 4009 // When all else fails, undefined 4010 } else { 4011 cache[ id ] = undefined; 4012 } 4013} 4014 4015jQuery.extend( { 4016 cache: {}, 4017 4018 // The following elements (space-suffixed to avoid Object.prototype collisions) 4019 // throw uncatchable exceptions if you attempt to set expando properties 4020 noData: { 4021 "applet ": true, 4022 "embed ": true, 4023 4024 // ...but Flash objects (which have this classid) *can* handle expandos 4025 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 4026 }, 4027 4028 hasData: function( elem ) { 4029 elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; 4030 return !!elem && !isEmptyDataObject( elem ); 4031 }, 4032 4033 data: function( elem, name, data ) { 4034 return internalData( elem, name, data ); 4035 }, 4036 4037 removeData: function( elem, name ) { 4038 return internalRemoveData( elem, name ); 4039 }, 4040 4041 // For internal use only. 4042 _data: function( elem, name, data ) { 4043 return internalData( elem, name, data, true ); 4044 }, 4045 4046 _removeData: function( elem, name ) { 4047 return internalRemoveData( elem, name, true ); 4048 } 4049} ); 4050 4051jQuery.fn.extend( { 4052 data: function( key, value ) { 4053 var i, name, data, 4054 elem = this[ 0 ], 4055 attrs = elem && elem.attributes; 4056 4057 // Special expections of .data basically thwart jQuery.access, 4058 // so implement the relevant behavior ourselves 4059 4060 // Gets all values 4061 if ( key === undefined ) { 4062 if ( this.length ) { 4063 data = jQuery.data( elem ); 4064 4065 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { 4066 i = attrs.length; 4067 while ( i-- ) { 4068 4069 // Support: IE11+ 4070 // The attrs elements can be null (#14894) 4071 if ( attrs[ i ] ) { 4072 name = attrs[ i ].name; 4073 if ( name.indexOf( "data-" ) === 0 ) { 4074 name = jQuery.camelCase( name.slice( 5 ) ); 4075 dataAttr( elem, name, data[ name ] ); 4076 } 4077 } 4078 } 4079 jQuery._data( elem, "parsedAttrs", true ); 4080 } 4081 } 4082 4083 return data; 4084 } 4085 4086 // Sets multiple values 4087 if ( typeof key === "object" ) { 4088 return this.each( function() { 4089 jQuery.data( this, key ); 4090 } ); 4091 } 4092 4093 return arguments.length > 1 ? 4094 4095 // Sets one value 4096 this.each( function() { 4097 jQuery.data( this, key, value ); 4098 } ) : 4099 4100 // Gets one value 4101 // Try to fetch any internally stored data first 4102 elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; 4103 }, 4104 4105 removeData: function( key ) { 4106 return this.each( function() { 4107 jQuery.removeData( this, key ); 4108 } ); 4109 } 4110} ); 4111 4112 4113jQuery.extend( { 4114 queue: function( elem, type, data ) { 4115 var queue; 4116 4117 if ( elem ) { 4118 type = ( type || "fx" ) + "queue"; 4119 queue = jQuery._data( elem, type ); 4120 4121 // Speed up dequeue by getting out quickly if this is just a lookup 4122 if ( data ) { 4123 if ( !queue || jQuery.isArray( data ) ) { 4124 queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); 4125 } else { 4126 queue.push( data ); 4127 } 4128 } 4129 return queue || []; 4130 } 4131 }, 4132 4133 dequeue: function( elem, type ) { 4134 type = type || "fx"; 4135 4136 var queue = jQuery.queue( elem, type ), 4137 startLength = queue.length, 4138 fn = queue.shift(), 4139 hooks = jQuery._queueHooks( elem, type ), 4140 next = function() { 4141 jQuery.dequeue( elem, type ); 4142 }; 4143 4144 // If the fx queue is dequeued, always remove the progress sentinel 4145 if ( fn === "inprogress" ) { 4146 fn = queue.shift(); 4147 startLength--; 4148 } 4149 4150 if ( fn ) { 4151 4152 // Add a progress sentinel to prevent the fx queue from being 4153 // automatically dequeued 4154 if ( type === "fx" ) { 4155 queue.unshift( "inprogress" ); 4156 } 4157 4158 // clear up the last queue stop function 4159 delete hooks.stop; 4160 fn.call( elem, next, hooks ); 4161 } 4162 4163 if ( !startLength && hooks ) { 4164 hooks.empty.fire(); 4165 } 4166 }, 4167 4168 // not intended for public consumption - generates a queueHooks object, 4169 // or returns the current one 4170 _queueHooks: function( elem, type ) { 4171 var key = type + "queueHooks"; 4172 return jQuery._data( elem, key ) || jQuery._data( elem, key, { 4173 empty: jQuery.Callbacks( "once memory" ).add( function() { 4174 jQuery._removeData( elem, type + "queue" ); 4175 jQuery._removeData( elem, key ); 4176 } ) 4177 } ); 4178 } 4179} ); 4180 4181jQuery.fn.extend( { 4182 queue: function( type, data ) { 4183 var setter = 2; 4184 4185 if ( typeof type !== "string" ) { 4186 data = type; 4187 type = "fx"; 4188 setter--; 4189 } 4190 4191 if ( arguments.length < setter ) { 4192 return jQuery.queue( this[ 0 ], type ); 4193 } 4194 4195 return data === undefined ? 4196 this : 4197 this.each( function() { 4198 var queue = jQuery.queue( this, type, data ); 4199 4200 // ensure a hooks for this queue 4201 jQuery._queueHooks( this, type ); 4202 4203 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 4204 jQuery.dequeue( this, type ); 4205 } 4206 } ); 4207 }, 4208 dequeue: function( type ) { 4209 return this.each( function() { 4210 jQuery.dequeue( this, type ); 4211 } ); 4212 }, 4213 clearQueue: function( type ) { 4214 return this.queue( type || "fx", [] ); 4215 }, 4216 4217 // Get a promise resolved when queues of a certain type 4218 // are emptied (fx is the type by default) 4219 promise: function( type, obj ) { 4220 var tmp, 4221 count = 1, 4222 defer = jQuery.Deferred(), 4223 elements = this, 4224 i = this.length, 4225 resolve = function() { 4226 if ( !( --count ) ) { 4227 defer.resolveWith( elements, [ elements ] ); 4228 } 4229 }; 4230 4231 if ( typeof type !== "string" ) { 4232 obj = type; 4233 type = undefined; 4234 } 4235 type = type || "fx"; 4236 4237 while ( i-- ) { 4238 tmp = jQuery._data( elements[ i ], type + "queueHooks" ); 4239 if ( tmp && tmp.empty ) { 4240 count++; 4241 tmp.empty.add( resolve ); 4242 } 4243 } 4244 resolve(); 4245 return defer.promise( obj ); 4246 } 4247} ); 4248 4249 4250( function() { 4251 var shrinkWrapBlocksVal; 4252 4253 support.shrinkWrapBlocks = function() { 4254 if ( shrinkWrapBlocksVal != null ) { 4255 return shrinkWrapBlocksVal; 4256 } 4257 4258 // Will be changed later if needed. 4259 shrinkWrapBlocksVal = false;
vendor: 4,171 bytes, lines 4260-4408
4260 4261 // Minified: var b,c,d 4262 var div, body, container; 4263 4264 body = document.getElementsByTagName( "body" )[ 0 ]; 4265 if ( !body || !body.style ) { 4266 4267 // Test fired too early or in an unsupported environment, exit. 4268 return; 4269 } 4270 4271 // Setup 4272 div = document.createElement( "div" ); 4273 container = document.createElement( "div" ); 4274 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 4275 body.appendChild( container ).appendChild( div ); 4276 4277 // Support: IE6 4278 // Check if elements with layout shrink-wrap their children 4279 if ( typeof div.style.zoom !== "undefined" ) { 4280 4281 // Reset CSS: box-sizing; display; margin; border 4282 div.style.cssText = 4283 4284 // Support: Firefox<29, Android 2.3 4285 // Vendor-prefix box-sizing 4286 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 4287 "box-sizing:content-box;display:block;margin:0;border:0;" + 4288 "padding:1px;width:1px;zoom:1"; 4289 div.appendChild( document.createElement( "div" ) ).style.width = "5px"; 4290 shrinkWrapBlocksVal = div.offsetWidth !== 3; 4291 } 4292 4293 body.removeChild( container ); 4294 4295 return shrinkWrapBlocksVal; 4296 }; 4297 4298} )(); 4299var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 4300 4301var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 4302 4303 4304var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 4305 4306var isHidden = function( elem, el ) { 4307 4308 // isHidden might be called from jQuery#filter function; 4309 // in that case, element will be second argument 4310 elem = el || elem; 4311 return jQuery.css( elem, "display" ) === "none" || 4312 !jQuery.contains( elem.ownerDocument, elem ); 4313 }; 4314 4315 4316 4317function adjustCSS( elem, prop, valueParts, tween ) { 4318 var adjusted, 4319 scale = 1, 4320 maxIterations = 20, 4321 currentValue = tween ? 4322 function() { return tween.cur(); } : 4323 function() { return jQuery.css( elem, prop, "" ); }, 4324 initial = currentValue(), 4325 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 4326 4327 // Starting value computation is required for potential unit mismatches 4328 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 4329 rcssNum.exec( jQuery.css( elem, prop ) ); 4330 4331 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 4332 4333 // Trust units reported by jQuery.css 4334 unit = unit || initialInUnit[ 3 ]; 4335 4336 // Make sure we update the tween properties later on 4337 valueParts = valueParts || []; 4338 4339 // Iteratively approximate from a nonzero starting point 4340 initialInUnit = +initial || 1; 4341 4342 do { 4343 4344 // If previous iteration zeroed out, double until we get *something*. 4345 // Use string for doubling so we don't accidentally see scale as unchanged below 4346 scale = scale || ".5"; 4347 4348 // Adjust and apply 4349 initialInUnit = initialInUnit / scale; 4350 jQuery.style( elem, prop, initialInUnit + unit ); 4351 4352 // Update scale, tolerating zero or NaN from tween.cur() 4353 // Break the loop if scale is unchanged or perfect, or if we've just had enough. 4354 } while ( 4355 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations 4356 ); 4357 } 4358 4359 if ( valueParts ) { 4360 initialInUnit = +initialInUnit || +initial || 0; 4361 4362 // Apply relative offset (+=/-=) if specified 4363 adjusted = valueParts[ 1 ] ? 4364 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 4365 +valueParts[ 2 ]; 4366 if ( tween ) { 4367 tween.unit = unit; 4368 tween.start = initialInUnit; 4369 tween.end = adjusted; 4370 } 4371 } 4372 return adjusted; 4373} 4374 4375 4376// Multifunctional method to get and set values of a collection 4377// The value/s can optionally be executed if it's a function 4378var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 4379 var i = 0, 4380 length = elems.length, 4381 bulk = key == null; 4382 4383 // Sets many values 4384 if ( jQuery.type( key ) === "object" ) { 4385 chainable = true; 4386 for ( i in key ) { 4387 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 4388 } 4389 4390 // Sets one value 4391 } else if ( value !== undefined ) { 4392 chainable = true; 4393 4394 if ( !jQuery.isFunction( value ) ) { 4395 raw = true; 4396 } 4397 4398 if ( bulk ) { 4399 4400 // Bulk operations run against the entire set 4401 if ( raw ) { 4402 fn.call( elems, value ); 4403 fn = null; 4404 4405 // ...except when executing function values 4406 } else { 4407 bulk = fn; 4408 fn = function( elem, key, value ) {
vendor: 50,800 bytes, lines 4409-6225
4409 return bulk.call( jQuery( elem ), value ); 4410 }; 4411 } 4412 } 4413 4414 if ( fn ) { 4415 for ( ; i < length; i++ ) { 4416 fn( 4417 elems[ i ], 4418 key, 4419 raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) 4420 ); 4421 } 4422 } 4423 } 4424 4425 return chainable ? 4426 elems : 4427 4428 // Gets 4429 bulk ? 4430 fn.call( elems ) : 4431 length ? fn( elems[ 0 ], key ) : emptyGet; 4432}; 4433var rcheckableType = ( /^(?:checkbox|radio)$/i ); 4434 4435var rtagName = ( /<([\w:-]+)/ ); 4436 4437var rscriptType = ( /^$|\/(?:java|ecma)script/i ); 4438 4439var rleadingWhitespace = ( /^\s+/ ); 4440 4441var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + 4442 "details|dialog|figcaption|figure|footer|header|hgroup|main|" + 4443 "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; 4444 4445 4446 4447function createSafeFragment( document ) { 4448 var list = nodeNames.split( "|" ), 4449 safeFrag = document.createDocumentFragment(); 4450 4451 if ( safeFrag.createElement ) { 4452 while ( list.length ) { 4453 safeFrag.createElement( 4454 list.pop() 4455 ); 4456 } 4457 } 4458 return safeFrag; 4459} 4460 4461 4462( function() { 4463 var div = document.createElement( "div" ), 4464 fragment = document.createDocumentFragment(), 4465 input = document.createElement( "input" ); 4466 4467 // Setup 4468 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 4469 4470 // IE strips leading whitespace when .innerHTML is used 4471 support.leadingWhitespace = div.firstChild.nodeType === 3; 4472 4473 // Make sure that tbody elements aren't automatically inserted 4474 // IE will insert them into empty tables 4475 support.tbody = !div.getElementsByTagName( "tbody" ).length; 4476 4477 // Make sure that link elements get serialized correctly by innerHTML 4478 // This requires a wrapper element in IE 4479 support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; 4480 4481 // Makes sure cloning an html5 element does not cause problems 4482 // Where outerHTML is undefined, this still works 4483 support.html5Clone = 4484 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; 4485 4486 // Check if a disconnected checkbox will retain its checked 4487 // value of true after appended to the DOM (IE6/7) 4488 input.type = "checkbox"; 4489 input.checked = true; 4490 fragment.appendChild( input ); 4491 support.appendChecked = input.checked; 4492 4493 // Make sure textarea (and checkbox) defaultValue is properly cloned 4494 // Support: IE6-IE11+ 4495 div.innerHTML = "<textarea>x</textarea>"; 4496 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 4497 4498 // #11217 - WebKit loses check when the name is after the checked attribute 4499 fragment.appendChild( div ); 4500 4501 // Support: Windows Web Apps (WWA) 4502 // `name` and `type` must use .setAttribute for WWA (#14901) 4503 input = document.createElement( "input" ); 4504 input.setAttribute( "type", "radio" ); 4505 input.setAttribute( "checked", "checked" ); 4506 input.setAttribute( "name", "t" ); 4507 4508 div.appendChild( input ); 4509 4510 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 4511 // old WebKit doesn't clone checked state correctly in fragments 4512 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 4513 4514 // Support: IE<9 4515 // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ 4516 support.noCloneEvent = !!div.addEventListener; 4517 4518 // Support: IE<9 4519 // Since attributes and properties are the same in IE, 4520 // cleanData must set properties to undefined rather than use removeAttribute 4521 div[ jQuery.expando ] = 1; 4522 support.attributes = !div.getAttribute( jQuery.expando ); 4523} )(); 4524 4525 4526// We have to close these tags to support XHTML (#13200) 4527var wrapMap = { 4528 option: [ 1, "<select multiple='multiple'>", "</select>" ], 4529 legend: [ 1, "<fieldset>", "</fieldset>" ], 4530 area: [ 1, "<map>", "</map>" ], 4531 4532 // Support: IE8 4533 param: [ 1, "<object>", "</object>" ], 4534 thead: [ 1, "<table>", "</table>" ], 4535 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4536 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], 4537 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4538 4539 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, 4540 // unless wrapped in a div with non-breaking characters in front of it. 4541 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] 4542}; 4543 4544// Support: IE8-IE9 4545wrapMap.optgroup = wrapMap.option; 4546 4547wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4548wrapMap.th = wrapMap.td; 4549 4550 4551function getAll( context, tag ) { 4552 var elems, elem, 4553 i = 0, 4554 found = typeof context.getElementsByTagName !== "undefined" ? 4555 context.getElementsByTagName( tag || "*" ) : 4556 typeof context.querySelectorAll !== "undefined" ? 4557 context.querySelectorAll( tag || "*" ) : 4558 undefined; 4559 4560 if ( !found ) { 4561 for ( found = [], elems = context.childNodes || context; 4562 ( elem = elems[ i ] ) != null; 4563 i++ 4564 ) { 4565 if ( !tag || jQuery.nodeName( elem, tag ) ) { 4566 found.push( elem ); 4567 } else { 4568 jQuery.merge( found, getAll( elem, tag ) ); 4569 } 4570 } 4571 } 4572 4573 return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 4574 jQuery.merge( [ context ], found ) : 4575 found; 4576} 4577 4578 4579// Mark scripts as having already been evaluated 4580function setGlobalEval( elems, refElements ) { 4581 var elem, 4582 i = 0; 4583 for ( ; ( elem = elems[ i ] ) != null; i++ ) { 4584 jQuery._data( 4585 elem, 4586 "globalEval", 4587 !refElements || jQuery._data( refElements[ i ], "globalEval" ) 4588 ); 4589 } 4590} 4591 4592 4593var rhtml = /<|&#?\w+;/, 4594 rtbody = /<tbody/i; 4595 4596function fixDefaultChecked( elem ) { 4597 if ( rcheckableType.test( elem.type ) ) { 4598 elem.defaultChecked = elem.checked; 4599 } 4600} 4601 4602function buildFragment( elems, context, scripts, selection, ignored ) { 4603 var j, elem, contains, 4604 tmp, tag, tbody, wrap, 4605 l = elems.length, 4606 4607 // Ensure a safe fragment 4608 safe = createSafeFragment( context ), 4609 4610 nodes = [], 4611 i = 0; 4612 4613 for ( ; i < l; i++ ) { 4614 elem = elems[ i ]; 4615 4616 if ( elem || elem === 0 ) { 4617 4618 // Add nodes directly 4619 if ( jQuery.type( elem ) === "object" ) { 4620 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 4621 4622 // Convert non-html into a text node 4623 } else if ( !rhtml.test( elem ) ) { 4624 nodes.push( context.createTextNode( elem ) ); 4625 4626 // Convert html into DOM nodes 4627 } else { 4628 tmp = tmp || safe.appendChild( context.createElement( "div" ) ); 4629 4630 // Deserialize a standard representation 4631 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 4632 wrap = wrapMap[ tag ] || wrapMap._default; 4633 4634 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 4635 4636 // Descend through wrappers to the right content 4637 j = wrap[ 0 ]; 4638 while ( j-- ) { 4639 tmp = tmp.lastChild; 4640 } 4641 4642 // Manually add leading whitespace removed by IE 4643 if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { 4644 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) ); 4645 } 4646 4647 // Remove IE's autoinserted <tbody> from table fragments 4648 if ( !support.tbody ) { 4649 4650 // String was a <table>, *may* have spurious <tbody> 4651 elem = tag === "table" && !rtbody.test( elem ) ? 4652 tmp.firstChild : 4653 4654 // String was a bare <thead> or <tfoot> 4655 wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ? 4656 tmp : 4657 0; 4658 4659 j = elem && elem.childNodes.length; 4660 while ( j-- ) { 4661 if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && 4662 !tbody.childNodes.length ) { 4663 4664 elem.removeChild( tbody ); 4665 } 4666 } 4667 } 4668 4669 jQuery.merge( nodes, tmp.childNodes ); 4670 4671 // Fix #12392 for WebKit and IE > 9 4672 tmp.textContent = ""; 4673 4674 // Fix #12392 for oldIE 4675 while ( tmp.firstChild ) { 4676 tmp.removeChild( tmp.firstChild ); 4677 } 4678 4679 // Remember the top-level container for proper cleanup 4680 tmp = safe.lastChild; 4681 } 4682 } 4683 } 4684 4685 // Fix #11356: Clear elements from fragment 4686 if ( tmp ) { 4687 safe.removeChild( tmp ); 4688 } 4689 4690 // Reset defaultChecked for any radios and checkboxes 4691 // about to be appended to the DOM in IE 6/7 (#8060) 4692 if ( !support.appendChecked ) { 4693 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); 4694 } 4695 4696 i = 0; 4697 while ( ( elem = nodes[ i++ ] ) ) { 4698 4699 // Skip elements already in the context collection (trac-4087) 4700 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 4701 if ( ignored ) { 4702 ignored.push( elem ); 4703 } 4704 4705 continue; 4706 } 4707 4708 contains = jQuery.contains( elem.ownerDocument, elem ); 4709 4710 // Append to fragment 4711 tmp = getAll( safe.appendChild( elem ), "script" ); 4712 4713 // Preserve script evaluation history 4714 if ( contains ) { 4715 setGlobalEval( tmp ); 4716 } 4717 4718 // Capture executables 4719 if ( scripts ) { 4720 j = 0; 4721 while ( ( elem = tmp[ j++ ] ) ) { 4722 if ( rscriptType.test( elem.type || "" ) ) { 4723 scripts.push( elem ); 4724 } 4725 } 4726 } 4727 } 4728 4729 tmp = null; 4730 4731 return safe; 4732} 4733 4734 4735( function() { 4736 var i, eventName, 4737 div = document.createElement( "div" ); 4738 4739 // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) 4740 for ( i in { submit: true, change: true, focusin: true } ) { 4741 eventName = "on" + i; 4742 4743 if ( !( support[ i ] = eventName in window ) ) { 4744 4745 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) 4746 div.setAttribute( eventName, "t" ); 4747 support[ i ] = div.attributes[ eventName ].expando === false; 4748 } 4749 } 4750 4751 // Null elements to avoid leaks in IE. 4752 div = null; 4753} )(); 4754 4755 4756var rformElems = /^(?:input|select|textarea)$/i, 4757 rkeyEvent = /^key/, 4758 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 4759 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 4760 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 4761 4762function returnTrue() { 4763 return true; 4764} 4765 4766function returnFalse() { 4767 return false; 4768} 4769 4770// Support: IE9 4771// See #13393 for more info 4772function safeActiveElement() { 4773 try { 4774 return document.activeElement; 4775 } catch ( err ) { } 4776} 4777 4778function on( elem, types, selector, data, fn, one ) { 4779 var origFn, type; 4780 4781 // Types can be a map of types/handlers 4782 if ( typeof types === "object" ) { 4783 4784 // ( types-Object, selector, data ) 4785 if ( typeof selector !== "string" ) { 4786 4787 // ( types-Object, data ) 4788 data = data || selector; 4789 selector = undefined; 4790 } 4791 for ( type in types ) { 4792 on( elem, type, selector, data, types[ type ], one ); 4793 } 4794 return elem; 4795 } 4796 4797 if ( data == null && fn == null ) { 4798 4799 // ( types, fn ) 4800 fn = selector; 4801 data = selector = undefined; 4802 } else if ( fn == null ) { 4803 if ( typeof selector === "string" ) { 4804 4805 // ( types, selector, fn ) 4806 fn = data; 4807 data = undefined; 4808 } else { 4809 4810 // ( types, data, fn ) 4811 fn = data; 4812 data = selector; 4813 selector = undefined; 4814 } 4815 } 4816 if ( fn === false ) { 4817 fn = returnFalse; 4818 } else if ( !fn ) { 4819 return elem; 4820 } 4821 4822 if ( one === 1 ) { 4823 origFn = fn; 4824 fn = function( event ) { 4825 4826 // Can use an empty set, since event contains the info 4827 jQuery().off( event ); 4828 return origFn.apply( this, arguments ); 4829 }; 4830 4831 // Use same guid so caller can remove using origFn 4832 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 4833 } 4834 return elem.each( function() { 4835 jQuery.event.add( this, types, fn, data, selector ); 4836 } ); 4837} 4838 4839/* 4840 * Helper functions for managing events -- not part of the public interface. 4841 * Props to Dean Edwards' addEvent library for many of the ideas. 4842 */ 4843jQuery.event = { 4844 4845 global: {}, 4846 4847 add: function( elem, types, handler, data, selector ) { 4848 var tmp, events, t, handleObjIn, 4849 special, eventHandle, handleObj, 4850 handlers, type, namespaces, origType, 4851 elemData = jQuery._data( elem ); 4852 4853 // Don't attach events to noData or text/comment nodes (but allow plain objects) 4854 if ( !elemData ) { 4855 return; 4856 } 4857 4858 // Caller can pass in an object of custom data in lieu of the handler 4859 if ( handler.handler ) { 4860 handleObjIn = handler; 4861 handler = handleObjIn.handler; 4862 selector = handleObjIn.selector; 4863 } 4864 4865 // Make sure that the handler has a unique ID, used to find/remove it later 4866 if ( !handler.guid ) { 4867 handler.guid = jQuery.guid++; 4868 } 4869 4870 // Init the element's event structure and main handler, if this is the first 4871 if ( !( events = elemData.events ) ) { 4872 events = elemData.events = {}; 4873 } 4874 if ( !( eventHandle = elemData.handle ) ) { 4875 eventHandle = elemData.handle = function( e ) { 4876 4877 // Discard the second event of a jQuery.event.trigger() and 4878 // when an event is called after a page has unloaded 4879 return typeof jQuery !== "undefined" && 4880 ( !e || jQuery.event.triggered !== e.type ) ? 4881 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : 4882 undefined; 4883 }; 4884 4885 // Add elem as a property of the handle fn to prevent a memory leak 4886 // with IE non-native events 4887 eventHandle.elem = elem; 4888 } 4889 4890 // Handle multiple events separated by a space 4891 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4892 t = types.length; 4893 while ( t-- ) { 4894 tmp = rtypenamespace.exec( types[ t ] ) || []; 4895 type = origType = tmp[ 1 ]; 4896 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4897 4898 // There *must* be a type, no attaching namespace-only handlers 4899 if ( !type ) { 4900 continue; 4901 } 4902 4903 // If event changes its type, use the special event handlers for the changed type 4904 special = jQuery.event.special[ type ] || {}; 4905 4906 // If selector defined, determine special event api type, otherwise given type 4907 type = ( selector ? special.delegateType : special.bindType ) || type; 4908 4909 // Update special based on newly reset type 4910 special = jQuery.event.special[ type ] || {}; 4911 4912 // handleObj is passed to all event handlers 4913 handleObj = jQuery.extend( { 4914 type: type, 4915 origType: origType, 4916 data: data, 4917 handler: handler, 4918 guid: handler.guid, 4919 selector: selector, 4920 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 4921 namespace: namespaces.join( "." ) 4922 }, handleObjIn ); 4923 4924 // Init the event handler queue if we're the first 4925 if ( !( handlers = events[ type ] ) ) { 4926 handlers = events[ type ] = []; 4927 handlers.delegateCount = 0; 4928 4929 // Only use addEventListener/attachEvent if the special events handler returns false 4930 if ( !special.setup || 4931 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 4932 4933 // Bind the global event handler to the element 4934 if ( elem.addEventListener ) { 4935 elem.addEventListener( type, eventHandle, false ); 4936 4937 } else if ( elem.attachEvent ) { 4938 elem.attachEvent( "on" + type, eventHandle ); 4939 } 4940 } 4941 } 4942 4943 if ( special.add ) { 4944 special.add.call( elem, handleObj ); 4945 4946 if ( !handleObj.handler.guid ) { 4947 handleObj.handler.guid = handler.guid; 4948 } 4949 } 4950 4951 // Add to the element's handler list, delegates in front 4952 if ( selector ) { 4953 handlers.splice( handlers.delegateCount++, 0, handleObj ); 4954 } else { 4955 handlers.push( handleObj ); 4956 } 4957 4958 // Keep track of which events have ever been used, for event optimization 4959 jQuery.event.global[ type ] = true; 4960 } 4961 4962 // Nullify elem to prevent memory leaks in IE 4963 elem = null; 4964 }, 4965 4966 // Detach an event or set of events from an element 4967 remove: function( elem, types, handler, selector, mappedTypes ) { 4968 var j, handleObj, tmp, 4969 origCount, t, events, 4970 special, handlers, type, 4971 namespaces, origType, 4972 elemData = jQuery.hasData( elem ) && jQuery._data( elem ); 4973 4974 if ( !elemData || !( events = elemData.events ) ) { 4975 return; 4976 } 4977 4978 // Once for each type.namespace in types; type may be omitted 4979 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4980 t = types.length; 4981 while ( t-- ) { 4982 tmp = rtypenamespace.exec( types[ t ] ) || []; 4983 type = origType = tmp[ 1 ]; 4984 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4985 4986 // Unbind all events (on this namespace, if provided) for the element 4987 if ( !type ) { 4988 for ( type in events ) { 4989 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 4990 } 4991 continue; 4992 } 4993 4994 special = jQuery.event.special[ type ] || {}; 4995 type = ( selector ? special.delegateType : special.bindType ) || type; 4996 handlers = events[ type ] || []; 4997 tmp = tmp[ 2 ] && 4998 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 4999 5000 // Remove matching events 5001 origCount = j = handlers.length; 5002 while ( j-- ) { 5003 handleObj = handlers[ j ]; 5004 5005 if ( ( mappedTypes || origType === handleObj.origType ) && 5006 ( !handler || handler.guid === handleObj.guid ) && 5007 ( !tmp || tmp.test( handleObj.namespace ) ) && 5008 ( !selector || selector === handleObj.selector || 5009 selector === "**" && handleObj.selector ) ) { 5010 handlers.splice( j, 1 ); 5011 5012 if ( handleObj.selector ) { 5013 handlers.delegateCount--; 5014 } 5015 if ( special.remove ) { 5016 special.remove.call( elem, handleObj ); 5017 } 5018 } 5019 } 5020 5021 // Remove generic event handler if we removed something and no more handlers exist 5022 // (avoids potential for endless recursion during removal of special event handlers) 5023 if ( origCount && !handlers.length ) { 5024 if ( !special.teardown || 5025 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 5026 5027 jQuery.removeEvent( elem, type, elemData.handle ); 5028 } 5029 5030 delete events[ type ]; 5031 } 5032 } 5033 5034 // Remove the expando if it's no longer used 5035 if ( jQuery.isEmptyObject( events ) ) { 5036 delete elemData.handle; 5037 5038 // removeData also checks for emptiness and clears the expando if empty 5039 // so use it instead of delete 5040 jQuery._removeData( elem, "events" ); 5041 } 5042 }, 5043 5044 trigger: function( event, data, elem, onlyHandlers ) { 5045 var handle, ontype, cur, 5046 bubbleType, special, tmp, i, 5047 eventPath = [ elem || document ], 5048 type = hasOwn.call( event, "type" ) ? event.type : event, 5049 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 5050 5051 cur = tmp = elem = elem || document; 5052 5053 // Don't do events on text and comment nodes 5054 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 5055 return; 5056 } 5057 5058 // focus/blur morphs to focusin/out; ensure we're not firing them right now 5059 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 5060 return; 5061 } 5062 5063 if ( type.indexOf( "." ) > -1 ) { 5064 5065 // Namespaced trigger; create a regexp to match event type in handle() 5066 namespaces = type.split( "." ); 5067 type = namespaces.shift(); 5068 namespaces.sort(); 5069 } 5070 ontype = type.indexOf( ":" ) < 0 && "on" + type; 5071 5072 // Caller can pass in a jQuery.Event object, Object, or just an event type string 5073 event = event[ jQuery.expando ] ? 5074 event : 5075 new jQuery.Event( type, typeof event === "object" && event ); 5076 5077 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 5078 event.isTrigger = onlyHandlers ? 2 : 3; 5079 event.namespace = namespaces.join( "." ); 5080 event.rnamespace = event.namespace ? 5081 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 5082 null; 5083 5084 // Clean up the event in case it is being reused 5085 event.result = undefined; 5086 if ( !event.target ) { 5087 event.target = elem; 5088 } 5089 5090 // Clone any incoming data and prepend the event, creating the handler arg list 5091 data = data == null ? 5092 [ event ] : 5093 jQuery.makeArray( data, [ event ] ); 5094 5095 // Allow special events to draw outside the lines 5096 special = jQuery.event.special[ type ] || {}; 5097 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 5098 return; 5099 } 5100 5101 // Determine event propagation path in advance, per W3C events spec (#9951) 5102 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 5103 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 5104 5105 bubbleType = special.delegateType || type; 5106 if ( !rfocusMorph.test( bubbleType + type ) ) { 5107 cur = cur.parentNode; 5108 } 5109 for ( ; cur; cur = cur.parentNode ) { 5110 eventPath.push( cur ); 5111 tmp = cur; 5112 } 5113 5114 // Only add window if we got to document (e.g., not plain obj or detached DOM) 5115 if ( tmp === ( elem.ownerDocument || document ) ) { 5116 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 5117 } 5118 } 5119 5120 // Fire handlers on the event path 5121 i = 0; 5122 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 5123 5124 event.type = i > 1 ? 5125 bubbleType : 5126 special.bindType || type; 5127 5128 // jQuery handler 5129 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && 5130 jQuery._data( cur, "handle" ); 5131 5132 if ( handle ) { 5133 handle.apply( cur, data ); 5134 } 5135 5136 // Native handler 5137 handle = ontype && cur[ ontype ]; 5138 if ( handle && handle.apply && acceptData( cur ) ) { 5139 event.result = handle.apply( cur, data ); 5140 if ( event.result === false ) { 5141 event.preventDefault(); 5142 } 5143 } 5144 } 5145 event.type = type; 5146 5147 // If nobody prevented the default action, do it now 5148 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 5149 5150 if ( 5151 ( !special._default || 5152 special._default.apply( eventPath.pop(), data ) === false 5153 ) && acceptData( elem ) 5154 ) { 5155 5156 // Call a native DOM method on the target with the same name name as the event. 5157 // Can't use an .isFunction() check here because IE6/7 fails that test. 5158 // Don't do default actions on window, that's where global variables be (#6170) 5159 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { 5160 5161 // Don't re-trigger an onFOO event when we call its FOO() method 5162 tmp = elem[ ontype ]; 5163 5164 if ( tmp ) { 5165 elem[ ontype ] = null; 5166 } 5167 5168 // Prevent re-triggering of the same event, since we already bubbled it above 5169 jQuery.event.triggered = type; 5170 try { 5171 elem[ type ](); 5172 } catch ( e ) { 5173 5174 // IE<9 dies on focus/blur to hidden element (#1486,#12518) 5175 // only reproducible on winXP IE8 native, not IE9 in IE8 mode 5176 } 5177 jQuery.event.triggered = undefined; 5178 5179 if ( tmp ) { 5180 elem[ ontype ] = tmp; 5181 } 5182 } 5183 } 5184 } 5185 5186 return event.result; 5187 }, 5188 5189 dispatch: function( event ) { 5190 5191 // Make a writable jQuery.Event from the native event object 5192 event = jQuery.event.fix( event ); 5193 5194 var i, j, ret, matched, handleObj, 5195 handlerQueue = [], 5196 args = slice.call( arguments ), 5197 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], 5198 special = jQuery.event.special[ event.type ] || {}; 5199 5200 // Use the fix-ed jQuery.Event rather than the (read-only) native event 5201 args[ 0 ] = event; 5202 event.delegateTarget = this; 5203 5204 // Call the preDispatch hook for the mapped type, and let it bail if desired 5205 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 5206 return; 5207 } 5208 5209 // Determine handlers 5210 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 5211 5212 // Run delegates first; they may want to stop propagation beneath us 5213 i = 0; 5214 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 5215 event.currentTarget = matched.elem; 5216 5217 j = 0; 5218 while ( ( handleObj = matched.handlers[ j++ ] ) && 5219 !event.isImmediatePropagationStopped() ) { 5220 5221 // Triggered event must either 1) have no namespace, or 2) have namespace(s) 5222 // a subset or equal to those in the bound event (both can have no namespace). 5223 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { 5224 5225 event.handleObj = handleObj; 5226 event.data = handleObj.data; 5227 5228 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 5229 handleObj.handler ).apply( matched.elem, args ); 5230 5231 if ( ret !== undefined ) { 5232 if ( ( event.result = ret ) === false ) { 5233 event.preventDefault(); 5234 event.stopPropagation(); 5235 } 5236 } 5237 } 5238 } 5239 } 5240 5241 // Call the postDispatch hook for the mapped type 5242 if ( special.postDispatch ) { 5243 special.postDispatch.call( this, event ); 5244 } 5245 5246 return event.result; 5247 }, 5248 5249 handlers: function( event, handlers ) { 5250 var i, matches, sel, handleObj, 5251 handlerQueue = [], 5252 delegateCount = handlers.delegateCount, 5253 cur = event.target; 5254 5255 // Support (at least): Chrome, IE9 5256 // Find delegate handlers 5257 // Black-hole SVG <use> instance trees (#13180) 5258 // 5259 // Support: Firefox<=42+ 5260 // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) 5261 if ( delegateCount && cur.nodeType && 5262 ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { 5263 5264 /* jshint eqeqeq: false */ 5265 for ( ; cur != this; cur = cur.parentNode || this ) { 5266 /* jshint eqeqeq: true */ 5267 5268 // Don't check non-elements (#13208) 5269 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 5270 if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { 5271 matches = []; 5272 for ( i = 0; i < delegateCount; i++ ) { 5273 handleObj = handlers[ i ]; 5274 5275 // Don't conflict with Object.prototype properties (#13203) 5276 sel = handleObj.selector + " "; 5277 5278 if ( matches[ sel ] === undefined ) { 5279 matches[ sel ] = handleObj.needsContext ? 5280 jQuery( sel, this ).index( cur ) > -1 : 5281 jQuery.find( sel, this, null, [ cur ] ).length; 5282 } 5283 if ( matches[ sel ] ) { 5284 matches.push( handleObj ); 5285 } 5286 } 5287 if ( matches.length ) { 5288 handlerQueue.push( { elem: cur, handlers: matches } ); 5289 } 5290 } 5291 } 5292 } 5293 5294 // Add the remaining (directly-bound) handlers 5295 if ( delegateCount < handlers.length ) { 5296 handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); 5297 } 5298 5299 return handlerQueue; 5300 }, 5301 5302 fix: function( event ) { 5303 if ( event[ jQuery.expando ] ) { 5304 return event; 5305 } 5306 5307 // Create a writable copy of the event object and normalize some properties 5308 var i, prop, copy, 5309 type = event.type, 5310 originalEvent = event, 5311 fixHook = this.fixHooks[ type ]; 5312 5313 if ( !fixHook ) { 5314 this.fixHooks[ type ] = fixHook = 5315 rmouseEvent.test( type ) ? this.mouseHooks : 5316 rkeyEvent.test( type ) ? this.keyHooks : 5317 {}; 5318 } 5319 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 5320 5321 event = new jQuery.Event( originalEvent ); 5322 5323 i = copy.length; 5324 while ( i-- ) { 5325 prop = copy[ i ]; 5326 event[ prop ] = originalEvent[ prop ]; 5327 } 5328 5329 // Support: IE<9 5330 // Fix target property (#1925) 5331 if ( !event.target ) { 5332 event.target = originalEvent.srcElement || document; 5333 } 5334 5335 // Support: Safari 6-8+ 5336 // Target should not be a text node (#504, #13143) 5337 if ( event.target.nodeType === 3 ) { 5338 event.target = event.target.parentNode; 5339 } 5340 5341 // Support: IE<9 5342 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) 5343 event.metaKey = !!event.metaKey; 5344 5345 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 5346 }, 5347 5348 // Includes some event props shared by KeyEvent and MouseEvent 5349 props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + 5350 "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), 5351 5352 fixHooks: {}, 5353 5354 keyHooks: { 5355 props: "char charCode key keyCode".split( " " ), 5356 filter: function( event, original ) { 5357 5358 // Add which for key events 5359 if ( event.which == null ) { 5360 event.which = original.charCode != null ? original.charCode : original.keyCode; 5361 } 5362 5363 return event; 5364 } 5365 }, 5366 5367 mouseHooks: { 5368 props: ( "button buttons clientX clientY fromElement offsetX offsetY " + 5369 "pageX pageY screenX screenY toElement" ).split( " " ), 5370 filter: function( event, original ) { 5371 var body, eventDoc, doc, 5372 button = original.button, 5373 fromElement = original.fromElement; 5374 5375 // Calculate pageX/Y if missing and clientX/Y available 5376 if ( event.pageX == null && original.clientX != null ) { 5377 eventDoc = event.target.ownerDocument || document; 5378 doc = eventDoc.documentElement; 5379 body = eventDoc.body; 5380 5381 event.pageX = original.clientX + 5382 ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - 5383 ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 5384 event.pageY = original.clientY + 5385 ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - 5386 ( doc && doc.clientTop || body && body.clientTop || 0 ); 5387 } 5388 5389 // Add relatedTarget, if necessary 5390 if ( !event.relatedTarget && fromElement ) { 5391 event.relatedTarget = fromElement === event.target ? 5392 original.toElement : 5393 fromElement; 5394 } 5395 5396 // Add which for click: 1 === left; 2 === middle; 3 === right 5397 // Note: button is not normalized, so don't use it 5398 if ( !event.which && button !== undefined ) { 5399 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 5400 } 5401 5402 return event; 5403 } 5404 }, 5405 5406 special: { 5407 load: { 5408 5409 // Prevent triggered image.load events from bubbling to window.load 5410 noBubble: true 5411 }, 5412 focus: { 5413 5414 // Fire native event if possible so blur/focus sequence is correct 5415 trigger: function() { 5416 if ( this !== safeActiveElement() && this.focus ) { 5417 try { 5418 this.focus(); 5419 return false; 5420 } catch ( e ) { 5421 5422 // Support: IE<9 5423 // If we error on focus to hidden element (#1486, #12518), 5424 // let .trigger() run the handlers 5425 } 5426 } 5427 }, 5428 delegateType: "focusin" 5429 }, 5430 blur: { 5431 trigger: function() { 5432 if ( this === safeActiveElement() && this.blur ) { 5433 this.blur(); 5434 return false; 5435 } 5436 }, 5437 delegateType: "focusout" 5438 }, 5439 click: { 5440 5441 // For checkbox, fire native event so checked state will be right 5442 trigger: function() { 5443 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { 5444 this.click(); 5445 return false; 5446 } 5447 }, 5448 5449 // For cross-browser consistency, don't fire native .click() on links 5450 _default: function( event ) { 5451 return jQuery.nodeName( event.target, "a" ); 5452 } 5453 }, 5454 5455 beforeunload: { 5456 postDispatch: function( event ) { 5457 5458 // Support: Firefox 20+ 5459 // Firefox doesn't alert if the returnValue field is not set. 5460 if ( event.result !== undefined && event.originalEvent ) { 5461 event.originalEvent.returnValue = event.result; 5462 } 5463 } 5464 } 5465 }, 5466 5467 // Piggyback on a donor event to simulate a different one 5468 simulate: function( type, elem, event ) { 5469 var e = jQuery.extend( 5470 new jQuery.Event(), 5471 event, 5472 { 5473 type: type, 5474 isSimulated: true 5475 5476 // Previously, `originalEvent: {}` was set here, so stopPropagation call 5477 // would not be triggered on donor event, since in our own 5478 // jQuery.event.stopPropagation function we had a check for existence of 5479 // originalEvent.stopPropagation method, so, consequently it would be a noop. 5480 // 5481 // Guard for simulated events was moved to jQuery.event.stopPropagation function 5482 // since `originalEvent` should point to the original event for the 5483 // constancy with other events and for more focused logic 5484 } 5485 ); 5486 5487 jQuery.event.trigger( e, null, elem ); 5488 5489 if ( e.isDefaultPrevented() ) { 5490 event.preventDefault(); 5491 } 5492 } 5493}; 5494 5495jQuery.removeEvent = document.removeEventListener ? 5496 function( elem, type, handle ) { 5497 5498 // This "if" is needed for plain objects 5499 if ( elem.removeEventListener ) { 5500 elem.removeEventListener( type, handle ); 5501 } 5502 } : 5503 function( elem, type, handle ) { 5504 var name = "on" + type; 5505 5506 if ( elem.detachEvent ) { 5507 5508 // #8545, #7054, preventing memory leaks for custom events in IE6-8 5509 // detachEvent needed property on element, by name of that event, 5510 // to properly expose it to GC 5511 if ( typeof elem[ name ] === "undefined" ) { 5512 elem[ name ] = null; 5513 } 5514 5515 elem.detachEvent( name, handle ); 5516 } 5517 }; 5518 5519jQuery.Event = function( src, props ) { 5520 5521 // Allow instantiation without the 'new' keyword 5522 if ( !( this instanceof jQuery.Event ) ) { 5523 return new jQuery.Event( src, props ); 5524 } 5525 5526 // Event object 5527 if ( src && src.type ) { 5528 this.originalEvent = src; 5529 this.type = src.type; 5530 5531 // Events bubbling up the document may have been marked as prevented 5532 // by a handler lower down the tree; reflect the correct value. 5533 this.isDefaultPrevented = src.defaultPrevented || 5534 src.defaultPrevented === undefined && 5535 5536 // Support: IE < 9, Android < 4.0 5537 src.returnValue === false ? 5538 returnTrue : 5539 returnFalse; 5540 5541 // Event type 5542 } else { 5543 this.type = src; 5544 } 5545 5546 // Put explicitly provided properties onto the event object 5547 if ( props ) { 5548 jQuery.extend( this, props ); 5549 } 5550 5551 // Create a timestamp if incoming event doesn't have one 5552 this.timeStamp = src && src.timeStamp || jQuery.now(); 5553 5554 // Mark it as fixed 5555 this[ jQuery.expando ] = true; 5556}; 5557 5558// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 5559// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 5560jQuery.Event.prototype = { 5561 constructor: jQuery.Event, 5562 isDefaultPrevented: returnFalse, 5563 isPropagationStopped: returnFalse, 5564 isImmediatePropagationStopped: returnFalse, 5565 5566 preventDefault: function() { 5567 var e = this.originalEvent; 5568 5569 this.isDefaultPrevented = returnTrue; 5570 if ( !e ) { 5571 return; 5572 } 5573 5574 // If preventDefault exists, run it on the original event 5575 if ( e.preventDefault ) { 5576 e.preventDefault(); 5577 5578 // Support: IE 5579 // Otherwise set the returnValue property of the original event to false 5580 } else { 5581 e.returnValue = false; 5582 } 5583 }, 5584 stopPropagation: function() { 5585 var e = this.originalEvent; 5586 5587 this.isPropagationStopped = returnTrue; 5588 5589 if ( !e || this.isSimulated ) { 5590 return; 5591 } 5592 5593 // If stopPropagation exists, run it on the original event 5594 if ( e.stopPropagation ) { 5595 e.stopPropagation(); 5596 } 5597 5598 // Support: IE 5599 // Set the cancelBubble property of the original event to true 5600 e.cancelBubble = true; 5601 }, 5602 stopImmediatePropagation: function() { 5603 var e = this.originalEvent; 5604 5605 this.isImmediatePropagationStopped = returnTrue; 5606 5607 if ( e && e.stopImmediatePropagation ) { 5608 e.stopImmediatePropagation(); 5609 } 5610 5611 this.stopPropagation(); 5612 } 5613}; 5614 5615// Create mouseenter/leave events using mouseover/out and event-time checks 5616// so that event delegation works in jQuery. 5617// Do the same for pointerenter/pointerleave and pointerover/pointerout 5618// 5619// Support: Safari 7 only 5620// Safari sends mouseenter too often; see: 5621// https://code.google.com/p/chromium/issues/detail?id=470258 5622// for the description of the bug (it existed in older Chrome versions as well). 5623jQuery.each( { 5624 mouseenter: "mouseover", 5625 mouseleave: "mouseout", 5626 pointerenter: "pointerover", 5627 pointerleave: "pointerout" 5628}, function( orig, fix ) { 5629 jQuery.event.special[ orig ] = { 5630 delegateType: fix, 5631 bindType: fix, 5632 5633 handle: function( event ) { 5634 var ret, 5635 target = this, 5636 related = event.relatedTarget, 5637 handleObj = event.handleObj; 5638 5639 // For mouseenter/leave call the handler if related is outside the target. 5640 // NB: No relatedTarget if the mouse left/entered the browser window 5641 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 5642 event.type = handleObj.origType; 5643 ret = handleObj.handler.apply( this, arguments ); 5644 event.type = fix; 5645 } 5646 return ret; 5647 } 5648 }; 5649} ); 5650 5651// IE submit delegation 5652if ( !support.submit ) { 5653 5654 jQuery.event.special.submit = { 5655 setup: function() { 5656 5657 // Only need this for delegated form submit events 5658 if ( jQuery.nodeName( this, "form" ) ) { 5659 return false; 5660 } 5661 5662 // Lazy-add a submit handler when a descendant form may potentially be submitted 5663 jQuery.event.add( this, "click._submit keypress._submit", function( e ) { 5664 5665 // Node name check avoids a VML-related crash in IE (#9807) 5666 var elem = e.target, 5667 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? 5668 5669 // Support: IE <=8 5670 // We use jQuery.prop instead of elem.form 5671 // to allow fixing the IE8 delegated submit issue (gh-2332) 5672 // by 3rd party polyfills/workarounds. 5673 jQuery.prop( elem, "form" ) : 5674 undefined; 5675 5676 if ( form && !jQuery._data( form, "submit" ) ) { 5677 jQuery.event.add( form, "submit._submit", function( event ) { 5678 event._submitBubble = true; 5679 } ); 5680 jQuery._data( form, "submit", true ); 5681 } 5682 } ); 5683 5684 // return undefined since we don't need an event listener 5685 }, 5686 5687 postDispatch: function( event ) { 5688 5689 // If form was submitted by the user, bubble the event up the tree 5690 if ( event._submitBubble ) { 5691 delete event._submitBubble; 5692 if ( this.parentNode && !event.isTrigger ) { 5693 jQuery.event.simulate( "submit", this.parentNode, event ); 5694 } 5695 } 5696 }, 5697 5698 teardown: function() { 5699 5700 // Only need this for delegated form submit events 5701 if ( jQuery.nodeName( this, "form" ) ) { 5702 return false; 5703 } 5704 5705 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above 5706 jQuery.event.remove( this, "._submit" ); 5707 } 5708 }; 5709} 5710 5711// IE change delegation and checkbox/radio fix 5712if ( !support.change ) { 5713 5714 jQuery.event.special.change = { 5715 5716 setup: function() { 5717 5718 if ( rformElems.test( this.nodeName ) ) { 5719 5720 // IE doesn't fire change on a check/radio until blur; trigger it on click 5721 // after a propertychange. Eat the blur-change in special.change.handle. 5722 // This still fires onchange a second time for check/radio after blur. 5723 if ( this.type === "checkbox" || this.type === "radio" ) { 5724 jQuery.event.add( this, "propertychange._change", function( event ) { 5725 if ( event.originalEvent.propertyName === "checked" ) { 5726 this._justChanged = true; 5727 } 5728 } ); 5729 jQuery.event.add( this, "click._change", function( event ) { 5730 if ( this._justChanged && !event.isTrigger ) { 5731 this._justChanged = false; 5732 } 5733 5734 // Allow triggered, simulated change events (#11500) 5735 jQuery.event.simulate( "change", this, event ); 5736 } ); 5737 } 5738 return false; 5739 } 5740 5741 // Delegated event; lazy-add a change handler on descendant inputs 5742 jQuery.event.add( this, "beforeactivate._change", function( e ) { 5743 var elem = e.target; 5744 5745 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { 5746 jQuery.event.add( elem, "change._change", function( event ) { 5747 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { 5748 jQuery.event.simulate( "change", this.parentNode, event ); 5749 } 5750 } ); 5751 jQuery._data( elem, "change", true ); 5752 } 5753 } ); 5754 }, 5755 5756 handle: function( event ) { 5757 var elem = event.target; 5758 5759 // Swallow native change events from checkbox/radio, we already triggered them above 5760 if ( this !== elem || event.isSimulated || event.isTrigger || 5761 ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { 5762 5763 return event.handleObj.handler.apply( this, arguments ); 5764 } 5765 }, 5766 5767 teardown: function() { 5768 jQuery.event.remove( this, "._change" ); 5769 5770 return !rformElems.test( this.nodeName ); 5771 } 5772 }; 5773} 5774 5775// Support: Firefox 5776// Firefox doesn't have focus(in | out) events 5777// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 5778// 5779// Support: Chrome, Safari 5780// focus(in | out) events fire after focus & blur events, 5781// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 5782// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 5783if ( !support.focusin ) { 5784 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 5785 5786 // Attach a single capturing handler on the document while someone wants focusin/focusout 5787 var handler = function( event ) { 5788 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 5789 }; 5790 5791 jQuery.event.special[ fix ] = { 5792 setup: function() { 5793 var doc = this.ownerDocument || this, 5794 attaches = jQuery._data( doc, fix ); 5795 5796 if ( !attaches ) { 5797 doc.addEventListener( orig, handler, true ); 5798 } 5799 jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); 5800 }, 5801 teardown: function() { 5802 var doc = this.ownerDocument || this, 5803 attaches = jQuery._data( doc, fix ) - 1; 5804 5805 if ( !attaches ) { 5806 doc.removeEventListener( orig, handler, true ); 5807 jQuery._removeData( doc, fix ); 5808 } else { 5809 jQuery._data( doc, fix, attaches ); 5810 } 5811 } 5812 }; 5813 } ); 5814} 5815 5816jQuery.fn.extend( { 5817 5818 on: function( types, selector, data, fn ) { 5819 return on( this, types, selector, data, fn ); 5820 }, 5821 one: function( types, selector, data, fn ) { 5822 return on( this, types, selector, data, fn, 1 ); 5823 }, 5824 off: function( types, selector, fn ) { 5825 var handleObj, type; 5826 if ( types && types.preventDefault && types.handleObj ) { 5827 5828 // ( event ) dispatched jQuery.Event 5829 handleObj = types.handleObj; 5830 jQuery( types.delegateTarget ).off( 5831 handleObj.namespace ? 5832 handleObj.origType + "." + handleObj.namespace : 5833 handleObj.origType, 5834 handleObj.selector, 5835 handleObj.handler 5836 ); 5837 return this; 5838 } 5839 if ( typeof types === "object" ) { 5840 5841 // ( types-object [, selector] ) 5842 for ( type in types ) { 5843 this.off( type, selector, types[ type ] ); 5844 } 5845 return this; 5846 } 5847 if ( selector === false || typeof selector === "function" ) { 5848 5849 // ( types [, fn] ) 5850 fn = selector; 5851 selector = undefined; 5852 } 5853 if ( fn === false ) { 5854 fn = returnFalse; 5855 } 5856 return this.each( function() { 5857 jQuery.event.remove( this, types, fn, selector ); 5858 } ); 5859 }, 5860 5861 trigger: function( type, data ) { 5862 return this.each( function() { 5863 jQuery.event.trigger( type, data, this ); 5864 } ); 5865 }, 5866 triggerHandler: function( type, data ) { 5867 var elem = this[ 0 ]; 5868 if ( elem ) { 5869 return jQuery.event.trigger( type, data, elem, true ); 5870 } 5871 } 5872} ); 5873 5874 5875var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, 5876 rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), 5877 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, 5878 5879 // Support: IE 10-11, Edge 10240+ 5880 // In IE/Edge using regex groups here causes severe slowdowns. 5881 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 5882 rnoInnerhtml = /<script|<style|<link/i, 5883 5884 // checked="checked" or checked 5885 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5886 rscriptTypeMasked = /^true\/(.*)/, 5887 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, 5888 safeFragment = createSafeFragment( document ), 5889 fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); 5890 5891// Support: IE<8 5892// Manipulating tables requires a tbody 5893function manipulationTarget( elem, content ) { 5894 return jQuery.nodeName( elem, "table" ) && 5895 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? 5896 5897 elem.getElementsByTagName( "tbody" )[ 0 ] || 5898 elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : 5899 elem; 5900} 5901 5902// Replace/restore the type attribute of script elements for safe DOM manipulation 5903function disableScript( elem ) { 5904 elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; 5905 return elem; 5906} 5907function restoreScript( elem ) { 5908 var match = rscriptTypeMasked.exec( elem.type ); 5909 if ( match ) { 5910 elem.type = match[ 1 ]; 5911 } else { 5912 elem.removeAttribute( "type" ); 5913 } 5914 return elem; 5915} 5916 5917function cloneCopyEvent( src, dest ) { 5918 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { 5919 return; 5920 } 5921 5922 var type, i, l, 5923 oldData = jQuery._data( src ), 5924 curData = jQuery._data( dest, oldData ), 5925 events = oldData.events; 5926 5927 if ( events ) { 5928 delete curData.handle; 5929 curData.events = {}; 5930 5931 for ( type in events ) { 5932 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 5933 jQuery.event.add( dest, type, events[ type ][ i ] ); 5934 } 5935 } 5936 } 5937 5938 // make the cloned public data object a copy from the original 5939 if ( curData.data ) { 5940 curData.data = jQuery.extend( {}, curData.data ); 5941 } 5942} 5943 5944function fixCloneNodeIssues( src, dest ) { 5945 var nodeName, e, data; 5946 5947 // We do not need to do anything for non-Elements 5948 if ( dest.nodeType !== 1 ) { 5949 return; 5950 } 5951 5952 nodeName = dest.nodeName.toLowerCase(); 5953 5954 // IE6-8 copies events bound via attachEvent when using cloneNode. 5955 if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { 5956 data = jQuery._data( dest ); 5957 5958 for ( e in data.events ) { 5959 jQuery.removeEvent( dest, e, data.handle ); 5960 } 5961 5962 // Event data gets referenced instead of copied if the expando gets copied too 5963 dest.removeAttribute( jQuery.expando ); 5964 } 5965 5966 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text 5967 if ( nodeName === "script" && dest.text !== src.text ) { 5968 disableScript( dest ).text = src.text; 5969 restoreScript( dest ); 5970 5971 // IE6-10 improperly clones children of object elements using classid. 5972 // IE10 throws NoModificationAllowedError if parent is null, #12132. 5973 } else if ( nodeName === "object" ) { 5974 if ( dest.parentNode ) { 5975 dest.outerHTML = src.outerHTML; 5976 } 5977 5978 // This path appears unavoidable for IE9. When cloning an object 5979 // element in IE9, the outerHTML strategy above is not sufficient. 5980 // If the src has innerHTML and the destination does not, 5981 // copy the src.innerHTML into the dest.innerHTML. #10324 5982 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { 5983 dest.innerHTML = src.innerHTML; 5984 } 5985 5986 } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 5987 5988 // IE6-8 fails to persist the checked state of a cloned checkbox 5989 // or radio button. Worse, IE6-7 fail to give the cloned element 5990 // a checked appearance if the defaultChecked value isn't also set 5991 5992 dest.defaultChecked = dest.checked = src.checked; 5993 5994 // IE6-7 get confused and end up setting the value of a cloned 5995 // checkbox/radio button to an empty string instead of "on" 5996 if ( dest.value !== src.value ) { 5997 dest.value = src.value; 5998 } 5999 6000 // IE6-8 fails to return the selected option to the default selected 6001 // state when cloning options 6002 } else if ( nodeName === "option" ) { 6003 dest.defaultSelected = dest.selected = src.defaultSelected; 6004 6005 // IE6-8 fails to set the defaultValue to the correct value when 6006 // cloning other types of input fields 6007 } else if ( nodeName === "input" || nodeName === "textarea" ) { 6008 dest.defaultValue = src.defaultValue; 6009 } 6010} 6011 6012function domManip( collection, args, callback, ignored ) { 6013 6014 // Flatten any nested arrays 6015 args = concat.apply( [], args ); 6016 6017 var first, node, hasScripts, 6018 scripts, doc, fragment, 6019 i = 0, 6020 l = collection.length, 6021 iNoClone = l - 1, 6022 value = args[ 0 ], 6023 isFunction = jQuery.isFunction( value ); 6024 6025 // We can't cloneNode fragments that contain checked, in WebKit 6026 if ( isFunction || 6027 ( l > 1 && typeof value === "string" && 6028 !support.checkClone && rchecked.test( value ) ) ) { 6029 return collection.each( function( index ) { 6030 var self = collection.eq( index ); 6031 if ( isFunction ) { 6032 args[ 0 ] = value.call( this, index, self.html() ); 6033 } 6034 domManip( self, args, callback, ignored ); 6035 } ); 6036 } 6037 6038 if ( l ) { 6039 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 6040 first = fragment.firstChild; 6041 6042 if ( fragment.childNodes.length === 1 ) { 6043 fragment = first; 6044 } 6045 6046 // Require either new content or an interest in ignored elements to invoke the callback 6047 if ( first || ignored ) { 6048 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 6049 hasScripts = scripts.length; 6050 6051 // Use the original fragment for the last item 6052 // instead of the first because it can end up 6053 // being emptied incorrectly in certain situations (#8070). 6054 for ( ; i < l; i++ ) { 6055 node = fragment; 6056 6057 if ( i !== iNoClone ) { 6058 node = jQuery.clone( node, true, true ); 6059 6060 // Keep references to cloned scripts for later restoration 6061 if ( hasScripts ) { 6062 6063 // Support: Android<4.1, PhantomJS<2 6064 // push.apply(_, arraylike) throws on ancient WebKit 6065 jQuery.merge( scripts, getAll( node, "script" ) ); 6066 } 6067 } 6068 6069 callback.call( collection[ i ], node, i ); 6070 } 6071 6072 if ( hasScripts ) { 6073 doc = scripts[ scripts.length - 1 ].ownerDocument; 6074 6075 // Reenable scripts 6076 jQuery.map( scripts, restoreScript ); 6077 6078 // Evaluate executable scripts on first document insertion 6079 for ( i = 0; i < hasScripts; i++ ) { 6080 node = scripts[ i ]; 6081 if ( rscriptType.test( node.type || "" ) && 6082 !jQuery._data( node, "globalEval" ) && 6083 jQuery.contains( doc, node ) ) { 6084 6085 if ( node.src ) { 6086 6087 // Optional AJAX dependency, but won't run scripts if not present 6088 if ( jQuery._evalUrl ) { 6089 jQuery._evalUrl( node.src ); 6090 } 6091 } else { 6092 jQuery.globalEval( 6093 ( node.text || node.textContent || node.innerHTML || "" ) 6094 .replace( rcleanScript, "" ) 6095 ); 6096 } 6097 } 6098 } 6099 } 6100 6101 // Fix #11809: Avoid leaking memory 6102 fragment = first = null; 6103 } 6104 } 6105 6106 return collection; 6107} 6108 6109function remove( elem, selector, keepData ) { 6110 var node, 6111 elems = selector ? jQuery.filter( selector, elem ) : elem, 6112 i = 0; 6113 6114 for ( ; ( node = elems[ i ] ) != null; i++ ) { 6115 6116 if ( !keepData && node.nodeType === 1 ) { 6117 jQuery.cleanData( getAll( node ) ); 6118 } 6119 6120 if ( node.parentNode ) { 6121 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { 6122 setGlobalEval( getAll( node, "script" ) ); 6123 } 6124 node.parentNode.removeChild( node ); 6125 } 6126 } 6127 6128 return elem; 6129} 6130 6131jQuery.extend( { 6132 htmlPrefilter: function( html ) { 6133 return html.replace( rxhtmlTag, "<$1></$2>" ); 6134 }, 6135 6136 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 6137 var destElements, node, clone, i, srcElements, 6138 inPage = jQuery.contains( elem.ownerDocument, elem ); 6139 6140 if ( support.html5Clone || jQuery.isXMLDoc( elem ) || 6141 !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { 6142 6143 clone = elem.cloneNode( true ); 6144 6145 // IE<=8 does not properly clone detached, unknown element nodes 6146 } else { 6147 fragmentDiv.innerHTML = elem.outerHTML; 6148 fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); 6149 } 6150 6151 if ( ( !support.noCloneEvent || !support.noCloneChecked ) && 6152 ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { 6153 6154 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 6155 destElements = getAll( clone ); 6156 srcElements = getAll( elem ); 6157 6158 // Fix all IE cloning issues 6159 for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { 6160 6161 // Ensure that the destination node is not null; Fixes #9587 6162 if ( destElements[ i ] ) { 6163 fixCloneNodeIssues( node, destElements[ i ] ); 6164 } 6165 } 6166 } 6167 6168 // Copy the events from the original to the clone 6169 if ( dataAndEvents ) { 6170 if ( deepDataAndEvents ) { 6171 srcElements = srcElements || getAll( elem ); 6172 destElements = destElements || getAll( clone ); 6173 6174 for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { 6175 cloneCopyEvent( node, destElements[ i ] ); 6176 } 6177 } else { 6178 cloneCopyEvent( elem, clone ); 6179 } 6180 } 6181 6182 // Preserve script evaluation history 6183 destElements = getAll( clone, "script" ); 6184 if ( destElements.length > 0 ) { 6185 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 6186 } 6187 6188 destElements = srcElements = node = null; 6189 6190 // Return the cloned set 6191 return clone; 6192 }, 6193 6194 cleanData: function( elems, /* internal */ forceAcceptData ) { 6195 var elem, type, id, data, 6196 i = 0, 6197 internalKey = jQuery.expando, 6198 cache = jQuery.cache, 6199 attributes = support.attributes, 6200 special = jQuery.event.special; 6201 6202 for ( ; ( elem = elems[ i ] ) != null; i++ ) { 6203 if ( forceAcceptData || acceptData( elem ) ) { 6204 6205 id = elem[ internalKey ]; 6206 data = id && cache[ id ]; 6207 6208 if ( data ) { 6209 if ( data.events ) { 6210 for ( type in data.events ) { 6211 if ( special[ type ] ) { 6212 jQuery.event.remove( elem, type ); 6213 6214 // This is a shortcut to avoid jQuery.event.remove's overhead 6215 } else { 6216 jQuery.removeEvent( elem, type, data.handle ); 6217 } 6218 } 6219 } 6220 6221 // Remove cache only if it was not already removed by jQuery.event.remove 6222 if ( cache[ id ] ) { 6223 6224 delete cache[ id ]; 6225
6226 // Support: IE<9 6227 // IE does not allow us to delete expando properties from nodes 6228 // IE creates expando attributes along with the property 6229 // IE does not have a removeAttribute function on Document nodes 6230 if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { 6231 elem.removeAttribute( internalKey ); 6232 6233 // Webkit & Blink performance suffers when deleting properties 6234 // from DOM nodes, so set to undefined instead 6235 // https://code.google.com/p/chromium/issues/detail?id=378607 6236 } else { 6237 elem[ internalKey ] = undefined; 6238 } 6239 6240 deletedIds.push( id ); 6241 } 6242 } 6243 } 6244 } 6245 } 6246} ); 6247 6248jQuery.fn.extend( { 6249 6250 // Keep domManip exposed until 3.0 (gh-2225) 6251 domManip: domManip, 6252 6253 detach: function( selector ) { 6254 return remove( this, selector, true ); 6255 }, 6256 6257 remove: function( selector ) { 6258 return remove( this, selector ); 6259 }, 6260 6261 text: function( value ) { 6262 return access( this, function( value ) { 6263 return value === undefined ? 6264 jQuery.text( this ) : 6265 this.empty().append( 6266 ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) 6267 ); 6268 }, null, value, arguments.length ); 6269 }, 6270 6271 append: function() { 6272 return domManip( this, arguments, function( elem ) { 6273 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6274 var target = manipulationTarget( this, elem ); 6275 target.appendChild( elem ); 6276 } 6277 } ); 6278 }, 6279
vendor: 4,288 bytes, lines 6280-6453
6280 prepend: function() { 6281 return domManip( this, arguments, function( elem ) { 6282 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 6283 var target = manipulationTarget( this, elem ); 6284 target.insertBefore( elem, target.firstChild ); 6285 } 6286 } ); 6287 }, 6288 6289 before: function() { 6290 return domManip( this, arguments, function( elem ) { 6291 if ( this.parentNode ) { 6292 this.parentNode.insertBefore( elem, this ); 6293 } 6294 } ); 6295 }, 6296 6297 after: function() { 6298 return domManip( this, arguments, function( elem ) { 6299 if ( this.parentNode ) { 6300 this.parentNode.insertBefore( elem, this.nextSibling ); 6301 } 6302 } ); 6303 }, 6304 6305 empty: function() { 6306 var elem, 6307 i = 0; 6308 6309 for ( ; ( elem = this[ i ] ) != null; i++ ) { 6310 6311 // Remove element nodes and prevent memory leaks 6312 if ( elem.nodeType === 1 ) { 6313 jQuery.cleanData( getAll( elem, false ) ); 6314 } 6315 6316 // Remove any remaining nodes 6317 while ( elem.firstChild ) { 6318 elem.removeChild( elem.firstChild ); 6319 } 6320 6321 // If this is a select, ensure that it displays empty (#12336) 6322 // Support: IE<9 6323 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { 6324 elem.options.length = 0; 6325 } 6326 } 6327 6328 return this; 6329 }, 6330 6331 clone: function( dataAndEvents, deepDataAndEvents ) { 6332 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 6333 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 6334 6335 return this.map( function() { 6336 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 6337 } ); 6338 }, 6339 6340 html: function( value ) { 6341 return access( this, function( value ) { 6342 var elem = this[ 0 ] || {}, 6343 i = 0, 6344 l = this.length; 6345 6346 if ( value === undefined ) { 6347 return elem.nodeType === 1 ? 6348 elem.innerHTML.replace( rinlinejQuery, "" ) : 6349 undefined; 6350 } 6351 6352 // See if we can take a shortcut and just use innerHTML 6353 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 6354 ( support.htmlSerialize || !rnoshimcache.test( value ) ) && 6355 ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && 6356 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 6357 6358 value = jQuery.htmlPrefilter( value ); 6359 6360 try { 6361 for ( ; i < l; i++ ) { 6362 6363 // Remove element nodes and prevent memory leaks 6364 elem = this[ i ] || {}; 6365 if ( elem.nodeType === 1 ) { 6366 jQuery.cleanData( getAll( elem, false ) ); 6367 elem.innerHTML = value; 6368 } 6369 } 6370 6371 elem = 0; 6372 6373 // If using innerHTML throws an exception, use the fallback method 6374 } catch ( e ) {} 6375 } 6376 6377 if ( elem ) { 6378 this.empty().append( value ); 6379 } 6380 }, null, value, arguments.length ); 6381 }, 6382 6383 replaceWith: function() { 6384 var ignored = []; 6385 6386 // Make the changes, replacing each non-ignored context element with the new content 6387 return domManip( this, arguments, function( elem ) { 6388 var parent = this.parentNode; 6389 6390 if ( jQuery.inArray( this, ignored ) < 0 ) { 6391 jQuery.cleanData( getAll( this ) ); 6392 if ( parent ) { 6393 parent.replaceChild( elem, this ); 6394 } 6395 } 6396 6397 // Force callback invocation 6398 }, ignored ); 6399 } 6400} ); 6401 6402jQuery.each( { 6403 appendTo: "append", 6404 prependTo: "prepend", 6405 insertBefore: "before", 6406 insertAfter: "after", 6407 replaceAll: "replaceWith" 6408}, function( name, original ) { 6409 jQuery.fn[ name ] = function( selector ) { 6410 var elems, 6411 i = 0, 6412 ret = [], 6413 insert = jQuery( selector ), 6414 last = insert.length - 1; 6415 6416 for ( ; i <= last; i++ ) { 6417 elems = i === last ? this : this.clone( true ); 6418 jQuery( insert[ i ] )[ original ]( elems ); 6419 6420 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() 6421 push.apply( ret, elems.get() ); 6422 } 6423 6424 return this.pushStack( ret ); 6425 }; 6426} ); 6427 6428 6429var iframe, 6430 elemdisplay = { 6431 6432 // Support: Firefox 6433 // We have to pre-define these values for FF (#10227) 6434 HTML: "block", 6435 BODY: "block" 6436 }; 6437 6438/** 6439 * Retrieve the actual display of a element 6440 * @param {String} name nodeName of the element 6441 * @param {Object} doc Document object 6442 */ 6443 6444// Called only from within defaultDisplay 6445function actualDisplay( name, doc ) { 6446 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 6447 6448 display = jQuery.css( elem[ 0 ], "display" ); 6449 6450 // We don't have any data stored on the element, 6451 // so use "detach" method as fast way to get rid of the element 6452 elem.detach(); 6453
6454 return display; 6455} 6456 6457/** 6458 * Try to determine the default display value of an element 6459 * @param {String} nodeName 6460 */ 6461function defaultDisplay( nodeName ) { 6462 var doc = document, 6463 display = elemdisplay[ nodeName ]; 6464 6465 if ( !display ) { 6466 display = actualDisplay( nodeName, doc ); 6467 6468 // If the simple way fails, read from inside an iframe 6469 if ( display === "none" || !display ) { 6470 6471 // Use the already-created iframe if possible 6472 iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) 6473 .appendTo( doc.documentElement ); 6474 6475 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 6476 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; 6477 6478 // Support: IE 6479 doc.write(); 6480 doc.close(); 6481 6482 display = actualDisplay( nodeName, doc ); 6483 iframe.detach(); 6484 } 6485 6486 // Store the correct default display 6487 elemdisplay[ nodeName ] = display; 6488 } 6489 6490 return display; 6491} 6492var rmargin = ( /^margin/ ); 6493 6494var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 6495 6496var swap = function( elem, options, callback, args ) { 6497 var ret, name, 6498 old = {}; 6499 6500 // Remember the old values, and insert the new ones 6501 for ( name in options ) { 6502 old[ name ] = elem.style[ name ]; 6503 elem.style[ name ] = options[ name ]; 6504 } 6505 6506 ret = callback.apply( elem, args || [] ); 6507 6508 // Revert the old values 6509 for ( name in options ) { 6510 elem.style[ name ] = old[ name ]; 6511 } 6512 6513 return ret; 6514}; 6515 6516 6517var documentElement = document.documentElement; 6518 6519 6520 6521( function() { 6522 var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal, 6523 reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal, 6524 container = document.createElement( "div" ), 6525 div = document.createElement( "div" ); 6526 6527 // Finish early in limited (non-browser) environments 6528 if ( !div.style ) { 6529 return; 6530 } 6531 6532 div.style.cssText = "float:left;opacity:.5"; 6533 6534 // Support: IE<9 6535 // Make sure that element opacity exists (as opposed to filter) 6536 support.opacity = div.style.opacity === "0.5"; 6537 6538 // Verify style float existence 6539 // (IE uses styleFloat instead of cssFloat) 6540 support.cssFloat = !!div.style.cssFloat; 6541 6542 div.style.backgroundClip = "content-box"; 6543 div.cloneNode( true ).style.backgroundClip = ""; 6544 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 6545 6546 container = document.createElement( "div" ); 6547 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + 6548 "padding:0;margin-top:1px;position:absolute"; 6549 div.innerHTML = ""; 6550 container.appendChild( div ); 6551 6552 // Support: Firefox<29, Android 2.3 6553 // Vendor-prefix box-sizing 6554 support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" || 6555 div.style.WebkitBoxSizing === ""; 6556 6557 jQuery.extend( support, { 6558 reliableHiddenOffsets: function() { 6559 if ( pixelPositionVal == null ) { 6560 computeStyleTests(); 6561 } 6562 return reliableHiddenOffsetsVal; 6563 }, 6564 6565 boxSizingReliable: function() { 6566 6567 // We're checking for pixelPositionVal here instead of boxSizingReliableVal 6568 // since that compresses better and they're computed together anyway. 6569 if ( pixelPositionVal == null ) { 6570 computeStyleTests(); 6571 } 6572 return boxSizingReliableVal; 6573 }, 6574 6575 pixelMarginRight: function() { 6576 6577 // Support: Android 4.0-4.3 6578 if ( pixelPositionVal == null ) { 6579 computeStyleTests(); 6580 } 6581 return pixelMarginRightVal; 6582 }, 6583 6584 pixelPosition: function() { 6585 if ( pixelPositionVal == null ) { 6586 computeStyleTests(); 6587 } 6588 return pixelPositionVal; 6589 }, 6590 6591 reliableMarginRight: function() { 6592 6593 // Support: Android 2.3 6594 if ( pixelPositionVal == null ) { 6595 computeStyleTests(); 6596 } 6597 return reliableMarginRightVal; 6598 }, 6599 6600 reliableMarginLeft: function() { 6601 6602 // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 6603 if ( pixelPositionVal == null ) { 6604 computeStyleTests(); 6605 } 6606 return reliableMarginLeftVal; 6607 } 6608 } ); 6609 6610 function computeStyleTests() { 6611 var contents, divStyle, 6612 documentElement = document.documentElement; 6613 6614 // Setup 6615 documentElement.appendChild( container ); 6616 6617 div.style.cssText = 6618 6619 // Support: Android 2.3 6620 // Vendor-prefix box-sizing 6621 "-webkit-box-sizing:border-box;box-sizing:border-box;" + 6622 "position:relative;display:block;" + 6623 "margin:auto;border:1px;padding:1px;" + 6624 "top:1%;width:50%"; 6625
6626 // Support: IE<9 6627 // Assume reasonable values in the absence of getComputedStyle 6628 pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false; 6629 pixelMarginRightVal = reliableMarginRightVal = true; 6630 6631 // Check for getComputedStyle so that this code is not run in IE<9. 6632 if ( window.getComputedStyle ) { 6633 divStyle = window.getComputedStyle( div ); 6634 pixelPositionVal = ( divStyle || {} ).top !== "1%"; 6635 reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px"; 6636 boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px"; 6637 6638 // Support: Android 4.0 - 4.3 only 6639 // Some styles come back with percentage values, even though they shouldn't 6640 div.style.marginRight = "50%"; 6641 pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px"; 6642 6643 // Support: Android 2.3 only 6644 // Div with explicit width and no margin-right incorrectly 6645 // gets computed margin-right based on width of container (#3333) 6646 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 6647 contents = div.appendChild( document.createElement( "div" ) ); 6648 6649 // Reset CSS: box-sizing; display; margin; border; padding 6650 contents.style.cssText = div.style.cssText = 6651 6652 // Support: Android 2.3 6653 // Vendor-prefix box-sizing 6654 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 6655 "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; 6656 contents.style.marginRight = contents.style.width = "0"; 6657 div.style.width = "1px"; 6658 6659 reliableMarginRightVal = 6660 !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight ); 6661 6662 div.removeChild( contents ); 6663 } 6664 6665 // Support: IE6-8 6666 // First check that getClientRects works as expected 6667 // Check if table cells still have offsetWidth/Height when they are set 6668 // to display:none and there are still other visible table cells in a 6669 // table row; if so, offsetWidth/Height are not reliable for use when 6670 // determining if an element has been hidden directly using 6671 // display:none (it is still safe to use offsets if a parent element is 6672 // hidden; don safety goggles and see bug #4512 for more information). 6673 div.style.display = "none"; 6674 reliableHiddenOffsetsVal = div.getClientRects().length === 0; 6675 if ( reliableHiddenOffsetsVal ) { 6676 div.style.display = ""; 6677 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; 6678 contents = div.getElementsByTagName( "td" ); 6679 contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; 6680 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; 6681 if ( reliableHiddenOffsetsVal ) { 6682 contents[ 0 ].style.display = ""; 6683 contents[ 1 ].style.display = "none"; 6684 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; 6685 } 6686 } 6687 6688 // Teardown 6689 documentElement.removeChild( container ); 6690 } 6691 6692} )(); 6693 6694 6695var getStyles, curCSS, 6696 rposition = /^(top|right|bottom|left)$/; 6697 6698if ( window.getComputedStyle ) { 6699 getStyles = function( elem ) { 6700 6701 // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 6702 // IE throws on elements created in popups 6703 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6704 var view = elem.ownerDocument.defaultView; 6705 6706 if ( !view || !view.opener ) { 6707 view = window; 6708 } 6709 6710 return view.getComputedStyle( elem ); 6711 }; 6712 6713 curCSS = function( elem, name, computed ) { 6714 var width, minWidth, maxWidth, ret, 6715 style = elem.style; 6716 6717 computed = computed || getStyles( elem ); 6718 6719 // getPropertyValue is only needed for .css('filter') in IE9, see #12537 6720 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; 6721 6722 // Support: Opera 12.1x only 6723 // Fall back to style even without computed 6724 // computed is undefined for elems on document fragments 6725 if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { 6726 ret = jQuery.style( elem, name ); 6727 } 6728 6729 if ( computed ) { 6730 6731 // A tribute to the "awesome hack by Dean Edwards" 6732 // Chrome < 17 and Safari 5.0 uses "computed value" 6733 // instead of "used value" for margin-right 6734 // Safari 5.1.7 (at least) returns percentage for a larger set of values, 6735 // but width seems to be reliably pixels 6736 // this is against the CSSOM draft spec: 6737 // http://dev.w3.org/csswg/cssom/#resolved-values 6738 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { 6739 6740 // Remember the original values 6741 width = style.width; 6742 minWidth = style.minWidth; 6743 maxWidth = style.maxWidth; 6744 6745 // Put in the new values to get a computed value out 6746 style.minWidth = style.maxWidth = style.width = ret; 6747 ret = computed.width; 6748 6749 // Revert the changed values 6750 style.width = width; 6751 style.minWidth = minWidth; 6752 style.maxWidth = maxWidth; 6753 } 6754 } 6755
vendor: 4,152 bytes, lines 6756-6918
6756 // Support: IE 6757 // IE returns zIndex value as an integer. 6758 return ret === undefined ? 6759 ret : 6760 ret + ""; 6761 }; 6762} else if ( documentElement.currentStyle ) { 6763 getStyles = function( elem ) { 6764 return elem.currentStyle; 6765 }; 6766 6767 curCSS = function( elem, name, computed ) { 6768 var left, rs, rsLeft, ret, 6769 style = elem.style; 6770 6771 computed = computed || getStyles( elem ); 6772 ret = computed ? computed[ name ] : undefined; 6773 6774 // Avoid setting ret to empty string here 6775 // so we don't default to auto 6776 if ( ret == null && style && style[ name ] ) { 6777 ret = style[ name ]; 6778 } 6779 6780 // From the awesome hack by Dean Edwards 6781 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 6782 6783 // If we're not dealing with a regular pixel number 6784 // but a number that has a weird ending, we need to convert it to pixels 6785 // but not position css attributes, as those are 6786 // proportional to the parent element instead 6787 // and we can't measure the parent instead because it 6788 // might trigger a "stacking dolls" problem 6789 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { 6790 6791 // Remember the original values 6792 left = style.left; 6793 rs = elem.runtimeStyle; 6794 rsLeft = rs && rs.left; 6795 6796 // Put in the new values to get a computed value out 6797 if ( rsLeft ) { 6798 rs.left = elem.currentStyle.left; 6799 } 6800 style.left = name === "fontSize" ? "1em" : ret; 6801 ret = style.pixelLeft + "px"; 6802 6803 // Revert the changed values 6804 style.left = left; 6805 if ( rsLeft ) { 6806 rs.left = rsLeft; 6807 } 6808 } 6809 6810 // Support: IE 6811 // IE returns zIndex value as an integer. 6812 return ret === undefined ? 6813 ret : 6814 ret + "" || "auto"; 6815 }; 6816} 6817 6818 6819 6820 6821function addGetHookIf( conditionFn, hookFn ) { 6822 6823 // Define the hook, we'll check on the first run if it's really needed. 6824 return { 6825 get: function() { 6826 if ( conditionFn() ) { 6827 6828 // Hook not needed (or it's not possible to use it due 6829 // to missing dependency), remove it. 6830 delete this.get; 6831 return; 6832 } 6833 6834 // Hook needed; redefine it so that the support test is not executed again. 6835 return ( this.get = hookFn ).apply( this, arguments ); 6836 } 6837 }; 6838} 6839 6840 6841var 6842 6843 ralpha = /alpha\([^)]*\)/i, 6844 ropacity = /opacity\s*=\s*([^)]*)/i, 6845 6846 // swappable if display is none or starts with table except 6847 // "table", "table-cell", or "table-caption" 6848 // see here for display values: 6849 // https://developer.mozilla.org/en-US/docs/CSS/display 6850 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 6851 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), 6852 6853 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 6854 cssNormalTransform = { 6855 letterSpacing: "0", 6856 fontWeight: "400" 6857 }, 6858 6859 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], 6860 emptyStyle = document.createElement( "div" ).style; 6861 6862 6863// return a css property mapped to a potentially vendor prefixed property 6864function vendorPropName( name ) { 6865 6866 // shortcut for names that are not vendor prefixed 6867 if ( name in emptyStyle ) { 6868 return name; 6869 } 6870 6871 // check for vendor prefixed names 6872 var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ), 6873 i = cssPrefixes.length; 6874 6875 while ( i-- ) { 6876 name = cssPrefixes[ i ] + capName; 6877 if ( name in emptyStyle ) { 6878 return name; 6879 } 6880 } 6881} 6882 6883function showHide( elements, show ) { 6884 var display, elem, hidden, 6885 values = [], 6886 index = 0, 6887 length = elements.length; 6888 6889 for ( ; index < length; index++ ) { 6890 elem = elements[ index ]; 6891 if ( !elem.style ) { 6892 continue; 6893 } 6894 6895 values[ index ] = jQuery._data( elem, "olddisplay" ); 6896 display = elem.style.display; 6897 if ( show ) { 6898 6899 // Reset the inline display of this element to learn if it is 6900 // being hidden by cascaded rules or not 6901 if ( !values[ index ] && display === "none" ) { 6902 elem.style.display = ""; 6903 } 6904 6905 // Set elements which have been overridden with display: none 6906 // in a stylesheet to whatever the default browser style is 6907 // for such an element 6908 if ( elem.style.display === "" && isHidden( elem ) ) { 6909 values[ index ] = 6910 jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) ); 6911 } 6912 } else { 6913 hidden = isHidden( elem ); 6914 6915 if ( display && display !== "none" || !hidden ) { 6916 jQuery._data( 6917 elem, 6918 "olddisplay",
vendor: 6,455 bytes, lines 6919-7143
6919 hidden ? display : jQuery.css( elem, "display" ) 6920 ); 6921 } 6922 } 6923 } 6924 6925 // Set the display of most of the elements in a second loop 6926 // to avoid the constant reflow 6927 for ( index = 0; index < length; index++ ) { 6928 elem = elements[ index ]; 6929 if ( !elem.style ) { 6930 continue; 6931 } 6932 if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 6933 elem.style.display = show ? values[ index ] || "" : "none"; 6934 } 6935 } 6936 6937 return elements; 6938} 6939 6940function setPositiveNumber( elem, value, subtract ) { 6941 var matches = rnumsplit.exec( value ); 6942 return matches ? 6943 6944 // Guard against undefined "subtract", e.g., when used as in cssHooks 6945 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : 6946 value; 6947} 6948 6949function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 6950 var i = extra === ( isBorderBox ? "border" : "content" ) ? 6951 6952 // If we already have the right measurement, avoid augmentation 6953 4 : 6954 6955 // Otherwise initialize for horizontal or vertical properties 6956 name === "width" ? 1 : 0, 6957 6958 val = 0; 6959 6960 for ( ; i < 4; i += 2 ) { 6961 6962 // both box models exclude margin, so add it if we want it 6963 if ( extra === "margin" ) { 6964 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 6965 } 6966 6967 if ( isBorderBox ) { 6968 6969 // border-box includes padding, so remove it if we want content 6970 if ( extra === "content" ) { 6971 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6972 } 6973 6974 // at this point, extra isn't border nor margin, so remove border 6975 if ( extra !== "margin" ) { 6976 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6977 } 6978 } else { 6979 6980 // at this point, extra isn't content, so add padding 6981 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 6982 6983 // at this point, extra isn't content nor padding, so add border 6984 if ( extra !== "padding" ) { 6985 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 6986 } 6987 } 6988 } 6989 6990 return val; 6991} 6992 6993function getWidthOrHeight( elem, name, extra ) { 6994 6995 // Start with offset property, which is equivalent to the border-box value 6996 var valueIsBorderBox = true, 6997 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 6998 styles = getStyles( elem ), 6999 isBorderBox = support.boxSizing && 7000 jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 7001 7002 // Support: IE11 only 7003 // In IE 11 fullscreen elements inside of an iframe have 7004 // 100x too small dimensions (gh-1764). 7005 if ( document.msFullscreenElement && window.top !== window ) { 7006 7007 // Support: IE11 only 7008 // Running getBoundingClientRect on a disconnected node 7009 // in IE throws an error. 7010 if ( elem.getClientRects().length ) { 7011 val = Math.round( elem.getBoundingClientRect()[ name ] * 100 ); 7012 } 7013 } 7014 7015 // some non-html elements return undefined for offsetWidth, so check for null/undefined 7016 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 7017 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 7018 if ( val <= 0 || val == null ) { 7019 7020 // Fall back to computed then uncomputed css if necessary 7021 val = curCSS( elem, name, styles ); 7022 if ( val < 0 || val == null ) { 7023 val = elem.style[ name ]; 7024 } 7025 7026 // Computed unit is not pixels. Stop here and return. 7027 if ( rnumnonpx.test( val ) ) { 7028 return val; 7029 } 7030 7031 // we need the check for style in case a browser which returns unreliable values 7032 // for getComputedStyle silently falls back to the reliable elem.style 7033 valueIsBorderBox = isBorderBox && 7034 ( support.boxSizingReliable() || val === elem.style[ name ] ); 7035 7036 // Normalize "", auto, and prepare for extra 7037 val = parseFloat( val ) || 0; 7038 } 7039 7040 // use the active box-sizing model to add/subtract irrelevant styles 7041 return ( val + 7042 augmentWidthOrHeight( 7043 elem, 7044 name, 7045 extra || ( isBorderBox ? "border" : "content" ), 7046 valueIsBorderBox, 7047 styles 7048 ) 7049 ) + "px"; 7050} 7051 7052jQuery.extend( { 7053 7054 // Add in style property hooks for overriding the default 7055 // behavior of getting and setting a style property 7056 cssHooks: { 7057 opacity: { 7058 get: function( elem, computed ) { 7059 if ( computed ) { 7060 7061 // We should always get a number back from opacity 7062 var ret = curCSS( elem, "opacity" ); 7063 return ret === "" ? "1" : ret; 7064 } 7065 } 7066 } 7067 }, 7068 7069 // Don't automatically add "px" to these possibly-unitless properties 7070 cssNumber: { 7071 "animationIterationCount": true, 7072 "columnCount": true, 7073 "fillOpacity": true, 7074 "flexGrow": true, 7075 "flexShrink": true, 7076 "fontWeight": true, 7077 "lineHeight": true, 7078 "opacity": true, 7079 "order": true, 7080 "orphans": true, 7081 "widows": true, 7082 "zIndex": true, 7083 "zoom": true 7084 }, 7085 7086 // Add in properties whose names you wish to fix before 7087 // setting or getting the value 7088 cssProps: { 7089 7090 // normalize float css property 7091 "float": support.cssFloat ? "cssFloat" : "styleFloat" 7092 }, 7093 7094 // Get and set the style property on a DOM Node 7095 style: function( elem, name, value, extra ) { 7096 7097 // Don't set styles on text and comment nodes 7098 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 7099 return; 7100 } 7101 7102 // Make sure that we're working with the right name 7103 var ret, type, hooks, 7104 origName = jQuery.camelCase( name ), 7105 style = elem.style; 7106 7107 name = jQuery.cssProps[ origName ] || 7108 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 7109 7110 // gets hook for the prefixed version 7111 // followed by the unprefixed version 7112 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 7113 7114 // Check if we're setting a value 7115 if ( value !== undefined ) { 7116 type = typeof value; 7117 7118 // Convert "+=" or "-=" to relative numbers (#7345) 7119 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 7120 value = adjustCSS( elem, name, ret ); 7121 7122 // Fixes bug #9237 7123 type = "number"; 7124 } 7125 7126 // Make sure that null and NaN values aren't set. See: #7116 7127 if ( value == null || value !== value ) { 7128 return; 7129 } 7130 7131 // If a number was passed in, add the unit (except for certain CSS properties) 7132 if ( type === "number" ) { 7133 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 7134 } 7135 7136 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, 7137 // but it would mean to define eight 7138 // (for every problematic property) identical functions 7139 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 7140 style[ name ] = "inherit"; 7141 } 7142 7143 // If a hook was provided, use that value, otherwise just set the specified value
vendor: 4,586 bytes, lines 7144-7299
7144 if ( !hooks || !( "set" in hooks ) || 7145 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 7146 7147 // Support: IE 7148 // Swallow errors from 'invalid' CSS values (#5509) 7149 try { 7150 style[ name ] = value; 7151 } catch ( e ) {} 7152 } 7153 7154 } else { 7155 7156 // If a hook was provided get the non-computed value from there 7157 if ( hooks && "get" in hooks && 7158 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 7159 7160 return ret; 7161 } 7162 7163 // Otherwise just get the value from the style object 7164 return style[ name ]; 7165 } 7166 }, 7167 7168 css: function( elem, name, extra, styles ) { 7169 var num, val, hooks, 7170 origName = jQuery.camelCase( name ); 7171 7172 // Make sure that we're working with the right name 7173 name = jQuery.cssProps[ origName ] || 7174 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 7175 7176 // gets hook for the prefixed version 7177 // followed by the unprefixed version 7178 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 7179 7180 // If a hook was provided get the computed value from there 7181 if ( hooks && "get" in hooks ) { 7182 val = hooks.get( elem, true, extra ); 7183 } 7184 7185 // Otherwise, if a way to get the computed value exists, use that 7186 if ( val === undefined ) { 7187 val = curCSS( elem, name, styles ); 7188 } 7189 7190 //convert "normal" to computed value 7191 if ( val === "normal" && name in cssNormalTransform ) { 7192 val = cssNormalTransform[ name ]; 7193 } 7194 7195 // Return, converting to number if forced or a qualifier was provided and val looks numeric 7196 if ( extra === "" || extra ) { 7197 num = parseFloat( val ); 7198 return extra === true || isFinite( num ) ? num || 0 : val; 7199 } 7200 return val; 7201 } 7202} ); 7203 7204jQuery.each( [ "height", "width" ], function( i, name ) { 7205 jQuery.cssHooks[ name ] = { 7206 get: function( elem, computed, extra ) { 7207 if ( computed ) { 7208 7209 // certain elements can have dimension info if we invisibly show them 7210 // however, it must have a current display style that would benefit from this 7211 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 7212 elem.offsetWidth === 0 ? 7213 swap( elem, cssShow, function() { 7214 return getWidthOrHeight( elem, name, extra ); 7215 } ) : 7216 getWidthOrHeight( elem, name, extra ); 7217 } 7218 }, 7219 7220 set: function( elem, value, extra ) { 7221 var styles = extra && getStyles( elem ); 7222 return setPositiveNumber( elem, value, extra ? 7223 augmentWidthOrHeight( 7224 elem, 7225 name, 7226 extra, 7227 support.boxSizing && 7228 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 7229 styles 7230 ) : 0 7231 ); 7232 } 7233 }; 7234} ); 7235 7236if ( !support.opacity ) { 7237 jQuery.cssHooks.opacity = { 7238 get: function( elem, computed ) { 7239 7240 // IE uses filters for opacity 7241 return ropacity.test( ( computed && elem.currentStyle ? 7242 elem.currentStyle.filter : 7243 elem.style.filter ) || "" ) ? 7244 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : 7245 computed ? "1" : ""; 7246 }, 7247 7248 set: function( elem, value ) { 7249 var style = elem.style, 7250 currentStyle = elem.currentStyle, 7251 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", 7252 filter = currentStyle && currentStyle.filter || style.filter || ""; 7253 7254 // IE has trouble with opacity if it does not have layout 7255 // Force it by setting the zoom level 7256 style.zoom = 1; 7257 7258 // if setting opacity to 1, and no other filters exist - 7259 // attempt to remove filter attribute #6652 7260 // if value === "", then remove inline opacity #12685 7261 if ( ( value >= 1 || value === "" ) && 7262 jQuery.trim( filter.replace( ralpha, "" ) ) === "" && 7263 style.removeAttribute ) { 7264 7265 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText 7266 // if "filter:" is present at all, clearType is disabled, we want to avoid this 7267 // style.removeAttribute is IE Only, but so apparently is this code path... 7268 style.removeAttribute( "filter" ); 7269 7270 // if there is no filter style applied in a css rule 7271 // or unset inline opacity, we are done 7272 if ( value === "" || currentStyle && !currentStyle.filter ) { 7273 return; 7274 } 7275 } 7276 7277 // otherwise, set new filter values 7278 style.filter = ralpha.test( filter ) ? 7279 filter.replace( ralpha, opacity ) : 7280 filter + " " + opacity; 7281 } 7282 }; 7283} 7284 7285jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, 7286 function( elem, computed ) { 7287 if ( computed ) { 7288 return swap( elem, { "display": "inline-block" }, 7289 curCSS, [ elem, "marginRight" ] ); 7290 } 7291 } 7292); 7293 7294jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 7295 function( elem, computed ) { 7296 if ( computed ) { 7297 return ( 7298 parseFloat( curCSS( elem, "marginLeft" ) ) || 7299
vendor: 4,625 bytes, lines 7300-7478
7300 // Support: IE<=11+ 7301 // Running getBoundingClientRect on a disconnected node in IE throws an error 7302 // Support: IE8 only 7303 // getClientRects() errors on disconnected elems 7304 ( jQuery.contains( elem.ownerDocument, elem ) ? 7305 elem.getBoundingClientRect().left - 7306 swap( elem, { marginLeft: 0 }, function() { 7307 return elem.getBoundingClientRect().left; 7308 } ) : 7309 0 7310 ) 7311 ) + "px"; 7312 } 7313 } 7314); 7315 7316// These hooks are used by animate to expand properties 7317jQuery.each( { 7318 margin: "", 7319 padding: "", 7320 border: "Width" 7321}, function( prefix, suffix ) { 7322 jQuery.cssHooks[ prefix + suffix ] = { 7323 expand: function( value ) { 7324 var i = 0, 7325 expanded = {}, 7326 7327 // assumes a single number if not a string 7328 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 7329 7330 for ( ; i < 4; i++ ) { 7331 expanded[ prefix + cssExpand[ i ] + suffix ] = 7332 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 7333 } 7334 7335 return expanded; 7336 } 7337 }; 7338 7339 if ( !rmargin.test( prefix ) ) { 7340 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 7341 } 7342} ); 7343 7344jQuery.fn.extend( { 7345 css: function( name, value ) { 7346 return access( this, function( elem, name, value ) { 7347 var styles, len, 7348 map = {}, 7349 i = 0; 7350 7351 if ( jQuery.isArray( name ) ) { 7352 styles = getStyles( elem ); 7353 len = name.length; 7354 7355 for ( ; i < len; i++ ) { 7356 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 7357 } 7358 7359 return map; 7360 } 7361 7362 return value !== undefined ? 7363 jQuery.style( elem, name, value ) : 7364 jQuery.css( elem, name ); 7365 }, name, value, arguments.length > 1 ); 7366 }, 7367 show: function() { 7368 return showHide( this, true ); 7369 }, 7370 hide: function() { 7371 return showHide( this ); 7372 }, 7373 toggle: function( state ) { 7374 if ( typeof state === "boolean" ) { 7375 return state ? this.show() : this.hide(); 7376 } 7377 7378 return this.each( function() { 7379 if ( isHidden( this ) ) { 7380 jQuery( this ).show(); 7381 } else { 7382 jQuery( this ).hide(); 7383 } 7384 } ); 7385 } 7386} ); 7387 7388 7389function Tween( elem, options, prop, end, easing ) { 7390 return new Tween.prototype.init( elem, options, prop, end, easing ); 7391} 7392jQuery.Tween = Tween; 7393 7394Tween.prototype = { 7395 constructor: Tween, 7396 init: function( elem, options, prop, end, easing, unit ) { 7397 this.elem = elem; 7398 this.prop = prop; 7399 this.easing = easing || jQuery.easing._default; 7400 this.options = options; 7401 this.start = this.now = this.cur(); 7402 this.end = end; 7403 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 7404 }, 7405 cur: function() { 7406 var hooks = Tween.propHooks[ this.prop ]; 7407 7408 return hooks && hooks.get ? 7409 hooks.get( this ) : 7410 Tween.propHooks._default.get( this ); 7411 }, 7412 run: function( percent ) { 7413 var eased, 7414 hooks = Tween.propHooks[ this.prop ]; 7415 7416 if ( this.options.duration ) { 7417 this.pos = eased = jQuery.easing[ this.easing ]( 7418 percent, this.options.duration * percent, 0, 1, this.options.duration 7419 ); 7420 } else { 7421 this.pos = eased = percent; 7422 } 7423 this.now = ( this.end - this.start ) * eased + this.start; 7424 7425 if ( this.options.step ) { 7426 this.options.step.call( this.elem, this.now, this ); 7427 } 7428 7429 if ( hooks && hooks.set ) { 7430 hooks.set( this ); 7431 } else { 7432 Tween.propHooks._default.set( this ); 7433 } 7434 return this; 7435 } 7436}; 7437 7438Tween.prototype.init.prototype = Tween.prototype; 7439 7440Tween.propHooks = { 7441 _default: { 7442 get: function( tween ) { 7443 var result; 7444 7445 // Use a property on the element directly when it is not a DOM element, 7446 // or when there is no matching style property that exists. 7447 if ( tween.elem.nodeType !== 1 || 7448 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 7449 return tween.elem[ tween.prop ]; 7450 } 7451 7452 // passing an empty string as a 3rd parameter to .css will automatically 7453 // attempt a parseFloat and fallback to a string if the parse fails 7454 // so, simple values such as "10px" are parsed to Float. 7455 // complex values such as "rotate(1rad)" are returned as is. 7456 result = jQuery.css( tween.elem, tween.prop, "" ); 7457 7458 // Empty strings, null, undefined and "auto" are converted to 0. 7459 return !result || result === "auto" ? 0 : result; 7460 }, 7461 set: function( tween ) { 7462 7463 // use step hook for back compat - use cssHook if its there - use .style if its 7464 // available and use plain properties where available 7465 if ( jQuery.fx.step[ tween.prop ] ) { 7466 jQuery.fx.step[ tween.prop ]( tween ); 7467 } else if ( tween.elem.nodeType === 1 && 7468 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || 7469 jQuery.cssHooks[ tween.prop ] ) ) { 7470 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 7471 } else { 7472 tween.elem[ tween.prop ] = tween.now; 7473 } 7474 } 7475 } 7476}; 7477 7478// Support: IE <=9
vendor: 5,654 bytes, lines 7479-7695
7479// Panic based approach to setting things on disconnected nodes 7480 7481Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 7482 set: function( tween ) { 7483 if ( tween.elem.nodeType && tween.elem.parentNode ) { 7484 tween.elem[ tween.prop ] = tween.now; 7485 } 7486 } 7487}; 7488 7489jQuery.easing = { 7490 linear: function( p ) { 7491 return p; 7492 }, 7493 swing: function( p ) { 7494 return 0.5 - Math.cos( p * Math.PI ) / 2; 7495 }, 7496 _default: "swing" 7497}; 7498 7499jQuery.fx = Tween.prototype.init; 7500 7501// Back Compat <1.8 extension point 7502jQuery.fx.step = {}; 7503 7504 7505 7506 7507var 7508 fxNow, timerId, 7509 rfxtypes = /^(?:toggle|show|hide)$/, 7510 rrun = /queueHooks$/; 7511 7512// Animations created synchronously will run synchronously 7513function createFxNow() { 7514 window.setTimeout( function() { 7515 fxNow = undefined; 7516 } ); 7517 return ( fxNow = jQuery.now() ); 7518} 7519 7520// Generate parameters to create a standard animation 7521function genFx( type, includeWidth ) { 7522 var which, 7523 attrs = { height: type }, 7524 i = 0; 7525 7526 // if we include width, step value is 1 to do all cssExpand values, 7527 // if we don't include width, step value is 2 to skip over Left and Right 7528 includeWidth = includeWidth ? 1 : 0; 7529 for ( ; i < 4 ; i += 2 - includeWidth ) { 7530 which = cssExpand[ i ]; 7531 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 7532 } 7533 7534 if ( includeWidth ) { 7535 attrs.opacity = attrs.width = type; 7536 } 7537 7538 return attrs; 7539} 7540 7541function createTween( value, prop, animation ) { 7542 var tween, 7543 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 7544 index = 0, 7545 length = collection.length; 7546 for ( ; index < length; index++ ) { 7547 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 7548 7549 // we're done with this property 7550 return tween; 7551 } 7552 } 7553} 7554 7555function defaultPrefilter( elem, props, opts ) { 7556 /* jshint validthis: true */ 7557 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, 7558 anim = this, 7559 orig = {}, 7560 style = elem.style, 7561 hidden = elem.nodeType && isHidden( elem ), 7562 dataShow = jQuery._data( elem, "fxshow" ); 7563 7564 // handle queue: false promises 7565 if ( !opts.queue ) { 7566 hooks = jQuery._queueHooks( elem, "fx" ); 7567 if ( hooks.unqueued == null ) { 7568 hooks.unqueued = 0; 7569 oldfire = hooks.empty.fire; 7570 hooks.empty.fire = function() { 7571 if ( !hooks.unqueued ) { 7572 oldfire(); 7573 } 7574 }; 7575 } 7576 hooks.unqueued++; 7577 7578 anim.always( function() { 7579 7580 // doing this makes sure that the complete handler will be called 7581 // before this completes 7582 anim.always( function() { 7583 hooks.unqueued--; 7584 if ( !jQuery.queue( elem, "fx" ).length ) { 7585 hooks.empty.fire(); 7586 } 7587 } ); 7588 } ); 7589 } 7590 7591 // height/width overflow pass 7592 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { 7593 7594 // Make sure that nothing sneaks out 7595 // Record all 3 overflow attributes because IE does not 7596 // change the overflow attribute when overflowX and 7597 // overflowY are set to the same value 7598 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 7599 7600 // Set display property to inline-block for height/width 7601 // animations on inline elements that are having width/height animated 7602 display = jQuery.css( elem, "display" ); 7603 7604 // Test default display if display is currently "none" 7605 checkDisplay = display === "none" ? 7606 jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; 7607 7608 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { 7609 7610 // inline-level elements accept inline-block; 7611 // block-level elements need to be inline with layout 7612 if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { 7613 style.display = "inline-block"; 7614 } else { 7615 style.zoom = 1; 7616 } 7617 } 7618 } 7619 7620 if ( opts.overflow ) { 7621 style.overflow = "hidden"; 7622 if ( !support.shrinkWrapBlocks() ) { 7623 anim.always( function() { 7624 style.overflow = opts.overflow[ 0 ]; 7625 style.overflowX = opts.overflow[ 1 ]; 7626 style.overflowY = opts.overflow[ 2 ]; 7627 } ); 7628 } 7629 } 7630 7631 // show/hide pass 7632 for ( prop in props ) { 7633 value = props[ prop ]; 7634 if ( rfxtypes.exec( value ) ) { 7635 delete props[ prop ]; 7636 toggle = toggle || value === "toggle"; 7637 if ( value === ( hidden ? "hide" : "show" ) ) { 7638 7639 // If there is dataShow left over from a stopped hide or show 7640 // and we are going to proceed with show, we should pretend to be hidden 7641 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 7642 hidden = true; 7643 } else { 7644 continue; 7645 } 7646 } 7647 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 7648 7649 // Any non-fx value stops us from restoring the original display value 7650 } else { 7651 display = undefined; 7652 } 7653 } 7654 7655 if ( !jQuery.isEmptyObject( orig ) ) { 7656 if ( dataShow ) { 7657 if ( "hidden" in dataShow ) { 7658 hidden = dataShow.hidden; 7659 } 7660 } else { 7661 dataShow = jQuery._data( elem, "fxshow", {} ); 7662 } 7663 7664 // store state if its toggle - enables .stop().toggle() to "reverse" 7665 if ( toggle ) { 7666 dataShow.hidden = !hidden; 7667 } 7668 if ( hidden ) { 7669 jQuery( elem ).show(); 7670 } else { 7671 anim.done( function() { 7672 jQuery( elem ).hide(); 7673 } ); 7674 } 7675 anim.done( function() { 7676 var prop; 7677 jQuery._removeData( elem, "fxshow" ); 7678 for ( prop in orig ) { 7679 jQuery.style( elem, prop, orig[ prop ] ); 7680 } 7681 } ); 7682 for ( prop in orig ) { 7683 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 7684 7685 if ( !( prop in dataShow ) ) { 7686 dataShow[ prop ] = tween.start; 7687 if ( hidden ) { 7688 tween.end = tween.start; 7689 tween.start = prop === "width" || prop === "height" ? 1 : 0; 7690 } 7691 } 7692 } 7693 7694 // If this is a noop like .hide().hide(), restore an overwritten display value 7695 } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : dis
vendor: 10,851 bytes, lines 7695-8127
7695play ) === "inline" ) { 7696 style.display = display; 7697 } 7698} 7699 7700function propFilter( props, specialEasing ) { 7701 var index, name, easing, value, hooks; 7702 7703 // camelCase, specialEasing and expand cssHook pass 7704 for ( index in props ) { 7705 name = jQuery.camelCase( index ); 7706 easing = specialEasing[ name ]; 7707 value = props[ index ]; 7708 if ( jQuery.isArray( value ) ) { 7709 easing = value[ 1 ]; 7710 value = props[ index ] = value[ 0 ]; 7711 } 7712 7713 if ( index !== name ) { 7714 props[ name ] = value; 7715 delete props[ index ]; 7716 } 7717 7718 hooks = jQuery.cssHooks[ name ]; 7719 if ( hooks && "expand" in hooks ) { 7720 value = hooks.expand( value ); 7721 delete props[ name ]; 7722 7723 // not quite $.extend, this wont overwrite keys already present. 7724 // also - reusing 'index' from above because we have the correct "name" 7725 for ( index in value ) { 7726 if ( !( index in props ) ) { 7727 props[ index ] = value[ index ]; 7728 specialEasing[ index ] = easing; 7729 } 7730 } 7731 } else { 7732 specialEasing[ name ] = easing; 7733 } 7734 } 7735} 7736 7737function Animation( elem, properties, options ) { 7738 var result, 7739 stopped, 7740 index = 0, 7741 length = Animation.prefilters.length, 7742 deferred = jQuery.Deferred().always( function() { 7743 7744 // don't match elem in the :animated selector 7745 delete tick.elem; 7746 } ), 7747 tick = function() { 7748 if ( stopped ) { 7749 return false; 7750 } 7751 var currentTime = fxNow || createFxNow(), 7752 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 7753 7754 // Support: Android 2.3 7755 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 7756 temp = remaining / animation.duration || 0, 7757 percent = 1 - temp, 7758 index = 0, 7759 length = animation.tweens.length; 7760 7761 for ( ; index < length ; index++ ) { 7762 animation.tweens[ index ].run( percent ); 7763 } 7764 7765 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 7766 7767 if ( percent < 1 && length ) { 7768 return remaining; 7769 } else { 7770 deferred.resolveWith( elem, [ animation ] ); 7771 return false; 7772 } 7773 }, 7774 animation = deferred.promise( { 7775 elem: elem, 7776 props: jQuery.extend( {}, properties ), 7777 opts: jQuery.extend( true, { 7778 specialEasing: {}, 7779 easing: jQuery.easing._default 7780 }, options ), 7781 originalProperties: properties, 7782 originalOptions: options, 7783 startTime: fxNow || createFxNow(), 7784 duration: options.duration, 7785 tweens: [], 7786 createTween: function( prop, end ) { 7787 var tween = jQuery.Tween( elem, animation.opts, prop, end, 7788 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 7789 animation.tweens.push( tween ); 7790 return tween; 7791 }, 7792 stop: function( gotoEnd ) { 7793 var index = 0, 7794 7795 // if we are going to the end, we want to run all the tweens 7796 // otherwise we skip this part 7797 length = gotoEnd ? animation.tweens.length : 0; 7798 if ( stopped ) { 7799 return this; 7800 } 7801 stopped = true; 7802 for ( ; index < length ; index++ ) { 7803 animation.tweens[ index ].run( 1 ); 7804 } 7805 7806 // resolve when we played the last frame 7807 // otherwise, reject 7808 if ( gotoEnd ) { 7809 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 7810 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 7811 } else { 7812 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 7813 } 7814 return this; 7815 } 7816 } ), 7817 props = animation.props; 7818 7819 propFilter( props, animation.opts.specialEasing ); 7820 7821 for ( ; index < length ; index++ ) { 7822 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 7823 if ( result ) { 7824 if ( jQuery.isFunction( result.stop ) ) { 7825 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 7826 jQuery.proxy( result.stop, result ); 7827 } 7828 return result; 7829 } 7830 } 7831 7832 jQuery.map( props, createTween, animation ); 7833 7834 if ( jQuery.isFunction( animation.opts.start ) ) { 7835 animation.opts.start.call( elem, animation ); 7836 } 7837 7838 jQuery.fx.timer( 7839 jQuery.extend( tick, { 7840 elem: elem, 7841 anim: animation, 7842 queue: animation.opts.queue 7843 } ) 7844 ); 7845 7846 // attach callbacks from options 7847 return animation.progress( animation.opts.progress ) 7848 .done( animation.opts.done, animation.opts.complete ) 7849 .fail( animation.opts.fail ) 7850 .always( animation.opts.always ); 7851} 7852 7853jQuery.Animation = jQuery.extend( Animation, { 7854 7855 tweeners: { 7856 "*": [ function( prop, value ) { 7857 var tween = this.createTween( prop, value ); 7858 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 7859 return tween; 7860 } ] 7861 }, 7862 7863 tweener: function( props, callback ) { 7864 if ( jQuery.isFunction( props ) ) { 7865 callback = props; 7866 props = [ "*" ]; 7867 } else { 7868 props = props.match( rnotwhite ); 7869 } 7870 7871 var prop, 7872 index = 0, 7873 length = props.length; 7874 7875 for ( ; index < length ; index++ ) { 7876 prop = props[ index ]; 7877 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 7878 Animation.tweeners[ prop ].unshift( callback ); 7879 } 7880 }, 7881 7882 prefilters: [ defaultPrefilter ], 7883 7884 prefilter: function( callback, prepend ) { 7885 if ( prepend ) { 7886 Animation.prefilters.unshift( callback ); 7887 } else { 7888 Animation.prefilters.push( callback ); 7889 } 7890 } 7891} ); 7892 7893jQuery.speed = function( speed, easing, fn ) { 7894 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 7895 complete: fn || !fn && easing || 7896 jQuery.isFunction( speed ) && speed, 7897 duration: speed, 7898 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing 7899 }; 7900 7901 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : 7902 opt.duration in jQuery.fx.speeds ? 7903 jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; 7904 7905 // normalize opt.queue - true/undefined/null -> "fx" 7906 if ( opt.queue == null || opt.queue === true ) { 7907 opt.queue = "fx"; 7908 } 7909 7910 // Queueing 7911 opt.old = opt.complete; 7912 7913 opt.complete = function() { 7914 if ( jQuery.isFunction( opt.old ) ) { 7915 opt.old.call( this ); 7916 } 7917 7918 if ( opt.queue ) { 7919 jQuery.dequeue( this, opt.queue ); 7920 } 7921 }; 7922 7923 return opt; 7924}; 7925 7926jQuery.fn.extend( { 7927 fadeTo: function( speed, to, easing, callback ) { 7928 7929 // show any hidden elements after setting opacity to 0 7930 return this.filter( isHidden ).css( "opacity", 0 ).show() 7931 7932 // animate to the value specified 7933 .end().animate( { opacity: to }, speed, easing, callback ); 7934 }, 7935 animate: function( prop, speed, easing, callback ) { 7936 var empty = jQuery.isEmptyObject( prop ), 7937 optall = jQuery.speed( speed, easing, callback ), 7938 doAnimation = function() { 7939 7940 // Operate on a copy of prop so per-property easing won't be lost 7941 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 7942 7943 // Empty animations, or finishing resolves immediately 7944 if ( empty || jQuery._data( this, "finish" ) ) { 7945 anim.stop( true ); 7946 } 7947 }; 7948 doAnimation.finish = doAnimation; 7949 7950 return empty || optall.queue === false ? 7951 this.each( doAnimation ) : 7952 this.queue( optall.queue, doAnimation ); 7953 }, 7954 stop: function( type, clearQueue, gotoEnd ) { 7955 var stopQueue = function( hooks ) { 7956 var stop = hooks.stop; 7957 delete hooks.stop; 7958 stop( gotoEnd ); 7959 }; 7960 7961 if ( typeof type !== "string" ) { 7962 gotoEnd = clearQueue; 7963 clearQueue = type; 7964 type = undefined; 7965 } 7966 if ( clearQueue && type !== false ) { 7967 this.queue( type || "fx", [] ); 7968 } 7969 7970 return this.each( function() { 7971 var dequeue = true, 7972 index = type != null && type + "queueHooks", 7973 timers = jQuery.timers, 7974 data = jQuery._data( this ); 7975 7976 if ( index ) { 7977 if ( data[ index ] && data[ index ].stop ) { 7978 stopQueue( data[ index ] ); 7979 } 7980 } else { 7981 for ( index in data ) { 7982 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 7983 stopQueue( data[ index ] ); 7984 } 7985 } 7986 } 7987 7988 for ( index = timers.length; index--; ) { 7989 if ( timers[ index ].elem === this && 7990 ( type == null || timers[ index ].queue === type ) ) { 7991 7992 timers[ index ].anim.stop( gotoEnd ); 7993 dequeue = false; 7994 timers.splice( index, 1 ); 7995 } 7996 } 7997 7998 // start the next in the queue if the last step wasn't forced 7999 // timers currently will call their complete callbacks, which will dequeue 8000 // but only if they were gotoEnd 8001 if ( dequeue || !gotoEnd ) { 8002 jQuery.dequeue( this, type ); 8003 } 8004 } ); 8005 }, 8006 finish: function( type ) { 8007 if ( type !== false ) { 8008 type = type || "fx"; 8009 } 8010 return this.each( function() { 8011 var index, 8012 data = jQuery._data( this ), 8013 queue = data[ type + "queue" ], 8014 hooks = data[ type + "queueHooks" ], 8015 timers = jQuery.timers, 8016 length = queue ? queue.length : 0; 8017 8018 // enable finishing flag on private data 8019 data.finish = true; 8020 8021 // empty the queue first 8022 jQuery.queue( this, type, [] ); 8023 8024 if ( hooks && hooks.stop ) { 8025 hooks.stop.call( this, true ); 8026 } 8027 8028 // look for any active animations, and finish them 8029 for ( index = timers.length; index--; ) { 8030 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 8031 timers[ index ].anim.stop( true ); 8032 timers.splice( index, 1 ); 8033 } 8034 } 8035 8036 // look for any animations in the old queue and finish them 8037 for ( index = 0; index < length; index++ ) { 8038 if ( queue[ index ] && queue[ index ].finish ) { 8039 queue[ index ].finish.call( this ); 8040 } 8041 } 8042 8043 // turn off finishing flag 8044 delete data.finish; 8045 } ); 8046 } 8047} ); 8048 8049jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { 8050 var cssFn = jQuery.fn[ name ]; 8051 jQuery.fn[ name ] = function( speed, easing, callback ) { 8052 return speed == null || typeof speed === "boolean" ? 8053 cssFn.apply( this, arguments ) : 8054 this.animate( genFx( name, true ), speed, easing, callback ); 8055 }; 8056} ); 8057 8058// Generate shortcuts for custom animations 8059jQuery.each( { 8060 slideDown: genFx( "show" ), 8061 slideUp: genFx( "hide" ), 8062 slideToggle: genFx( "toggle" ), 8063 fadeIn: { opacity: "show" }, 8064 fadeOut: { opacity: "hide" }, 8065 fadeToggle: { opacity: "toggle" } 8066}, function( name, props ) { 8067 jQuery.fn[ name ] = function( speed, easing, callback ) { 8068 return this.animate( props, speed, easing, callback ); 8069 }; 8070} ); 8071 8072jQuery.timers = []; 8073jQuery.fx.tick = function() { 8074 var timer, 8075 timers = jQuery.timers, 8076 i = 0; 8077 8078 fxNow = jQuery.now(); 8079 8080 for ( ; i < timers.length; i++ ) { 8081 timer = timers[ i ]; 8082 8083 // Checks the timer has not already been removed 8084 if ( !timer() && timers[ i ] === timer ) { 8085 timers.splice( i--, 1 ); 8086 } 8087 } 8088 8089 if ( !timers.length ) { 8090 jQuery.fx.stop(); 8091 } 8092 fxNow = undefined; 8093}; 8094 8095jQuery.fx.timer = function( timer ) { 8096 jQuery.timers.push( timer ); 8097 if ( timer() ) { 8098 jQuery.fx.start(); 8099 } else { 8100 jQuery.timers.pop(); 8101 } 8102}; 8103 8104jQuery.fx.interval = 13; 8105 8106jQuery.fx.start = function() { 8107 if ( !timerId ) { 8108 timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); 8109 } 8110}; 8111 8112jQuery.fx.stop = function() { 8113 window.clearInterval( timerId ); 8114 timerId = null; 8115}; 8116 8117jQuery.fx.speeds = { 8118 slow: 600, 8119 fast: 200, 8120 8121 // Default speed 8122 _default: 400 8123}; 8124 8125 8126// Based off of the plugin by Clint Helfers, with permission. 8127// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
8128jQuery.fn.delay = function( time, type ) { 8129 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 8130 type = type || "fx"; 8131 8132 return this.queue( type, function( next, hooks ) { 8133 var timeout = window.setTimeout( next, time ); 8134 hooks.stop = function() { 8135 window.clearTimeout( timeout ); 8136 }; 8137 } ); 8138}; 8139 8140 8141( function() { 8142 var a, 8143 input = document.createElement( "input" ), 8144 div = document.createElement( "div" ), 8145 select = document.createElement( "select" ), 8146 opt = select.appendChild( document.createElement( "option" ) ); 8147 8148 // Setup 8149 div = document.createElement( "div" ); 8150 div.setAttribute( "className", "t" ); 8151 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 8152 a = div.getElementsByTagName( "a" )[ 0 ]; 8153 8154 // Support: Windows Web Apps (WWA) 8155 // `type` must use .setAttribute for WWA (#14901) 8156 input.setAttribute( "type", "checkbox" ); 8157 div.appendChild( input ); 8158 8159 a = div.getElementsByTagName( "a" )[ 0 ]; 8160 8161 // First batch of tests. 8162 a.style.cssText = "top:1px"; 8163 8164 // Test setAttribute on camelCase class. 8165 // If it works, we need attrFixes when doing get/setAttribute (ie6/7)
vendor: 2,696 bytes, lines 8166-8267
8166 support.getSetAttribute = div.className !== "t"; 8167 8168 // Get the style information from getAttribute 8169 // (IE uses .cssText instead) 8170 support.style = /top/.test( a.getAttribute( "style" ) ); 8171 8172 // Make sure that URLs aren't manipulated 8173 // (IE normalizes it by default) 8174 support.hrefNormalized = a.getAttribute( "href" ) === "/a"; 8175 8176 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) 8177 support.checkOn = !!input.value; 8178 8179 // Make sure that a selected-by-default option has a working selected property. 8180 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) 8181 support.optSelected = opt.selected; 8182 8183 // Tests for enctype support on a form (#6743) 8184 support.enctype = !!document.createElement( "form" ).enctype; 8185 8186 // Make sure that the options inside disabled selects aren't marked as disabled 8187 // (WebKit marks them as disabled) 8188 select.disabled = true; 8189 support.optDisabled = !opt.disabled; 8190 8191 // Support: IE8 only 8192 // Check if we can trust getAttribute("value") 8193 input = document.createElement( "input" ); 8194 input.setAttribute( "value", "" ); 8195 support.input = input.getAttribute( "value" ) === ""; 8196 8197 // Check if an input maintains its value after becoming a radio 8198 input.value = "t"; 8199 input.setAttribute( "type", "radio" ); 8200 support.radioValue = input.value === "t"; 8201} )(); 8202 8203 8204var rreturn = /\r/g, 8205 rspaces = /[\x20\t\r\n\f]+/g; 8206 8207jQuery.fn.extend( { 8208 val: function( value ) { 8209 var hooks, ret, isFunction, 8210 elem = this[ 0 ]; 8211 8212 if ( !arguments.length ) { 8213 if ( elem ) { 8214 hooks = jQuery.valHooks[ elem.type ] || 8215 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 8216 8217 if ( 8218 hooks && 8219 "get" in hooks && 8220 ( ret = hooks.get( elem, "value" ) ) !== undefined 8221 ) { 8222 return ret; 8223 } 8224 8225 ret = elem.value; 8226 8227 return typeof ret === "string" ? 8228 8229 // handle most common string cases 8230 ret.replace( rreturn, "" ) : 8231 8232 // handle cases where value is null/undef or number 8233 ret == null ? "" : ret; 8234 } 8235 8236 return; 8237 } 8238 8239 isFunction = jQuery.isFunction( value ); 8240 8241 return this.each( function( i ) { 8242 var val; 8243 8244 if ( this.nodeType !== 1 ) { 8245 return; 8246 } 8247 8248 if ( isFunction ) { 8249 val = value.call( this, i, jQuery( this ).val() ); 8250 } else { 8251 val = value; 8252 } 8253 8254 // Treat null/undefined as ""; convert numbers to string 8255 if ( val == null ) { 8256 val = ""; 8257 } else if ( typeof val === "number" ) { 8258 val += ""; 8259 } else if ( jQuery.isArray( val ) ) { 8260 val = jQuery.map( val, function( value ) { 8261 return value == null ? "" : value + ""; 8262 } ); 8263 } 8264 8265 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 8266 8267 // If set returns undefined, fall back to normal setting
vendor: 4,648 bytes, lines 8268-8458
8268 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 8269 this.value = val; 8270 } 8271 } ); 8272 } 8273} ); 8274 8275jQuery.extend( { 8276 valHooks: { 8277 option: { 8278 get: function( elem ) { 8279 var val = jQuery.find.attr( elem, "value" ); 8280 return val != null ? 8281 val : 8282 8283 // Support: IE10-11+ 8284 // option.text throws exceptions (#14686, #14858) 8285 // Strip and collapse whitespace 8286 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 8287 jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); 8288 } 8289 }, 8290 select: { 8291 get: function( elem ) { 8292 var value, option, 8293 options = elem.options, 8294 index = elem.selectedIndex, 8295 one = elem.type === "select-one" || index < 0, 8296 values = one ? null : [], 8297 max = one ? index + 1 : options.length, 8298 i = index < 0 ? 8299 max : 8300 one ? index : 0; 8301 8302 // Loop through all the selected options 8303 for ( ; i < max; i++ ) { 8304 option = options[ i ]; 8305 8306 // oldIE doesn't update selected after form reset (#2551) 8307 if ( ( option.selected || i === index ) && 8308 8309 // Don't return options that are disabled or in a disabled optgroup 8310 ( support.optDisabled ? 8311 !option.disabled : 8312 option.getAttribute( "disabled" ) === null ) && 8313 ( !option.parentNode.disabled || 8314 !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 8315 8316 // Get the specific value for the option 8317 value = jQuery( option ).val(); 8318 8319 // We don't need an array for one selects 8320 if ( one ) { 8321 return value; 8322 } 8323 8324 // Multi-Selects return an array 8325 values.push( value ); 8326 } 8327 } 8328 8329 return values; 8330 }, 8331 8332 set: function( elem, value ) { 8333 var optionSet, option, 8334 options = elem.options, 8335 values = jQuery.makeArray( value ), 8336 i = options.length; 8337 8338 while ( i-- ) { 8339 option = options[ i ]; 8340 8341 if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { 8342 8343 // Support: IE6 8344 // When new option element is added to select box we need to 8345 // force reflow of newly added node in order to workaround delay 8346 // of initialization properties 8347 try { 8348 option.selected = optionSet = true; 8349 8350 } catch ( _ ) { 8351 8352 // Will be executed only in IE6 8353 option.scrollHeight; 8354 } 8355 8356 } else { 8357 option.selected = false; 8358 } 8359 } 8360 8361 // Force browsers to behave consistently when non-matching value is set 8362 if ( !optionSet ) { 8363 elem.selectedIndex = -1; 8364 } 8365 8366 return options; 8367 } 8368 } 8369 } 8370} ); 8371 8372// Radios and checkboxes getter/setter 8373jQuery.each( [ "radio", "checkbox" ], function() { 8374 jQuery.valHooks[ this ] = { 8375 set: function( elem, value ) { 8376 if ( jQuery.isArray( value ) ) { 8377 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 8378 } 8379 } 8380 }; 8381 if ( !support.checkOn ) { 8382 jQuery.valHooks[ this ].get = function( elem ) { 8383 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 8384 }; 8385 } 8386} ); 8387 8388 8389 8390 8391var nodeHook, boolHook, 8392 attrHandle = jQuery.expr.attrHandle, 8393 ruseDefault = /^(?:checked|selected)$/i, 8394 getSetAttribute = support.getSetAttribute, 8395 getSetInput = support.input; 8396 8397jQuery.fn.extend( { 8398 attr: function( name, value ) { 8399 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 8400 }, 8401 8402 removeAttr: function( name ) { 8403 return this.each( function() { 8404 jQuery.removeAttr( this, name ); 8405 } ); 8406 } 8407} ); 8408 8409jQuery.extend( { 8410 attr: function( elem, name, value ) { 8411 var ret, hooks, 8412 nType = elem.nodeType; 8413 8414 // Don't get/set attributes on text, comment and attribute nodes 8415 if ( nType === 3 || nType === 8 || nType === 2 ) { 8416 return; 8417 } 8418 8419 // Fallback to prop when attributes are not supported 8420 if ( typeof elem.getAttribute === "undefined" ) { 8421 return jQuery.prop( elem, name, value ); 8422 } 8423 8424 // All attributes are lowercase 8425 // Grab necessary hook if one is defined 8426 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 8427 name = name.toLowerCase(); 8428 hooks = jQuery.attrHooks[ name ] || 8429 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); 8430 } 8431 8432 if ( value !== undefined ) { 8433 if ( value === null ) { 8434 jQuery.removeAttr( elem, name ); 8435 return; 8436 } 8437 8438 if ( hooks && "set" in hooks && 8439 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 8440 return ret; 8441 } 8442 8443 elem.setAttribute( name, value + "" ); 8444 return value; 8445 } 8446 8447 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 8448 return ret; 8449 } 8450 8451 ret = jQuery.find.attr( elem, name ); 8452 8453 // Non-existent attributes return null, we normalize to undefined 8454 return ret == null ? undefined : ret; 8455 }, 8456 8457 attrHooks: { 8458 type: {
vendor: 4,457 bytes, lines 8459-8625
8459 set: function( elem, value ) { 8460 if ( !support.radioValue && value === "radio" && 8461 jQuery.nodeName( elem, "input" ) ) { 8462 8463 // Setting the type on a radio button after the value resets the value in IE8-9 8464 // Reset value to default in case type is set after value during creation 8465 var val = elem.value; 8466 elem.setAttribute( "type", value ); 8467 if ( val ) { 8468 elem.value = val; 8469 } 8470 return value; 8471 } 8472 } 8473 } 8474 }, 8475 8476 removeAttr: function( elem, value ) { 8477 var name, propName, 8478 i = 0, 8479 attrNames = value && value.match( rnotwhite ); 8480 8481 if ( attrNames && elem.nodeType === 1 ) { 8482 while ( ( name = attrNames[ i++ ] ) ) { 8483 propName = jQuery.propFix[ name ] || name; 8484 8485 // Boolean attributes get special treatment (#10870) 8486 if ( jQuery.expr.match.bool.test( name ) ) { 8487 8488 // Set corresponding property to false 8489 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 8490 elem[ propName ] = false; 8491 8492 // Support: IE<9 8493 // Also clear defaultChecked/defaultSelected (if appropriate) 8494 } else { 8495 elem[ jQuery.camelCase( "default-" + name ) ] = 8496 elem[ propName ] = false; 8497 } 8498 8499 // See #9699 for explanation of this approach (setting first, then removal) 8500 } else { 8501 jQuery.attr( elem, name, "" ); 8502 } 8503 8504 elem.removeAttribute( getSetAttribute ? name : propName ); 8505 } 8506 } 8507 } 8508} ); 8509 8510// Hooks for boolean attributes 8511boolHook = { 8512 set: function( elem, value, name ) { 8513 if ( value === false ) { 8514 8515 // Remove boolean attributes when set to false 8516 jQuery.removeAttr( elem, name ); 8517 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 8518 8519 // IE<8 needs the *property* name 8520 elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); 8521 8522 } else { 8523 8524 // Support: IE<9 8525 // Use defaultChecked and defaultSelected for oldIE 8526 elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; 8527 } 8528 return name; 8529 } 8530}; 8531 8532jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 8533 var getter = attrHandle[ name ] || jQuery.find.attr; 8534 8535 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 8536 attrHandle[ name ] = function( elem, name, isXML ) { 8537 var ret, handle; 8538 if ( !isXML ) { 8539 8540 // Avoid an infinite loop by temporarily removing this function from the getter 8541 handle = attrHandle[ name ]; 8542 attrHandle[ name ] = ret; 8543 ret = getter( elem, name, isXML ) != null ? 8544 name.toLowerCase() : 8545 null; 8546 attrHandle[ name ] = handle; 8547 } 8548 return ret; 8549 }; 8550 } else { 8551 attrHandle[ name ] = function( elem, name, isXML ) { 8552 if ( !isXML ) { 8553 return elem[ jQuery.camelCase( "default-" + name ) ] ? 8554 name.toLowerCase() : 8555 null; 8556 } 8557 }; 8558 } 8559} ); 8560 8561// fix oldIE attroperties 8562if ( !getSetInput || !getSetAttribute ) { 8563 jQuery.attrHooks.value = { 8564 set: function( elem, value, name ) { 8565 if ( jQuery.nodeName( elem, "input" ) ) { 8566 8567 // Does not return so that setAttribute is also used 8568 elem.defaultValue = value; 8569 } else { 8570 8571 // Use nodeHook if defined (#1954); otherwise setAttribute is fine 8572 return nodeHook && nodeHook.set( elem, value, name ); 8573 } 8574 } 8575 }; 8576} 8577 8578// IE6/7 do not support getting/setting some attributes with get/setAttribute 8579if ( !getSetAttribute ) { 8580 8581 // Use this for any attribute in IE6/7 8582 // This fixes almost every IE6/7 issue 8583 nodeHook = { 8584 set: function( elem, value, name ) { 8585 8586 // Set the existing or create a new attribute node 8587 var ret = elem.getAttributeNode( name ); 8588 if ( !ret ) { 8589 elem.setAttributeNode( 8590 ( ret = elem.ownerDocument.createAttribute( name ) ) 8591 ); 8592 } 8593 8594 ret.value = value += ""; 8595 8596 // Break association with cloned elements by also using setAttribute (#9646) 8597 if ( name === "value" || value === elem.getAttribute( name ) ) { 8598 return value; 8599 } 8600 } 8601 }; 8602 8603 // Some attributes are constructed with empty-string values when not defined 8604 attrHandle.id = attrHandle.name = attrHandle.coords = 8605 function( elem, name, isXML ) { 8606 var ret; 8607 if ( !isXML ) { 8608 return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ? 8609 ret.value : 8610 null; 8611 } 8612 }; 8613 8614 // Fixing value retrieval on a button requires this module 8615 jQuery.valHooks.button = { 8616 get: function( elem, name ) { 8617 var ret = elem.getAttributeNode( name ); 8618 if ( ret && ret.specified ) { 8619 return ret.value; 8620 } 8621 }, 8622 set: nodeHook.set 8623 }; 8624 8625 // Set contenteditable to false on removals(#10429)
vendor: 10,480 bytes, lines 8626-9064
8626 // Setting to empty string throws an error as an invalid value 8627 jQuery.attrHooks.contenteditable = { 8628 set: function( elem, value, name ) { 8629 nodeHook.set( elem, value === "" ? false : value, name ); 8630 } 8631 }; 8632 8633 // Set width and height to auto instead of 0 on empty string( Bug #8150 ) 8634 // This is for removals 8635 jQuery.each( [ "width", "height" ], function( i, name ) { 8636 jQuery.attrHooks[ name ] = { 8637 set: function( elem, value ) { 8638 if ( value === "" ) { 8639 elem.setAttribute( name, "auto" ); 8640 return value; 8641 } 8642 } 8643 }; 8644 } ); 8645} 8646 8647if ( !support.style ) { 8648 jQuery.attrHooks.style = { 8649 get: function( elem ) { 8650 8651 // Return undefined in the case of empty string 8652 // Note: IE uppercases css property names, but if we were to .toLowerCase() 8653 // .cssText, that would destroy case sensitivity in URL's, like in "background" 8654 return elem.style.cssText || undefined; 8655 }, 8656 set: function( elem, value ) { 8657 return ( elem.style.cssText = value + "" ); 8658 } 8659 }; 8660} 8661 8662 8663 8664 8665var rfocusable = /^(?:input|select|textarea|button|object)$/i, 8666 rclickable = /^(?:a|area)$/i; 8667 8668jQuery.fn.extend( { 8669 prop: function( name, value ) { 8670 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 8671 }, 8672 8673 removeProp: function( name ) { 8674 name = jQuery.propFix[ name ] || name; 8675 return this.each( function() { 8676 8677 // try/catch handles cases where IE balks (such as removing a property on window) 8678 try { 8679 this[ name ] = undefined; 8680 delete this[ name ]; 8681 } catch ( e ) {} 8682 } ); 8683 } 8684} ); 8685 8686jQuery.extend( { 8687 prop: function( elem, name, value ) { 8688 var ret, hooks, 8689 nType = elem.nodeType; 8690 8691 // Don't get/set properties on text, comment and attribute nodes 8692 if ( nType === 3 || nType === 8 || nType === 2 ) { 8693 return; 8694 } 8695 8696 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 8697 8698 // Fix name and attach hooks 8699 name = jQuery.propFix[ name ] || name; 8700 hooks = jQuery.propHooks[ name ]; 8701 } 8702 8703 if ( value !== undefined ) { 8704 if ( hooks && "set" in hooks && 8705 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 8706 return ret; 8707 } 8708 8709 return ( elem[ name ] = value ); 8710 } 8711 8712 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 8713 return ret; 8714 } 8715 8716 return elem[ name ]; 8717 }, 8718 8719 propHooks: { 8720 tabIndex: { 8721 get: function( elem ) { 8722 8723 // elem.tabIndex doesn't always return the 8724 // correct value when it hasn't been explicitly set 8725 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 8726 // Use proper attribute retrieval(#12072) 8727 var tabindex = jQuery.find.attr( elem, "tabindex" ); 8728 8729 return tabindex ? 8730 parseInt( tabindex, 10 ) : 8731 rfocusable.test( elem.nodeName ) || 8732 rclickable.test( elem.nodeName ) && elem.href ? 8733 0 : 8734 -1; 8735 } 8736 } 8737 }, 8738 8739 propFix: { 8740 "for": "htmlFor", 8741 "class": "className" 8742 } 8743} ); 8744 8745// Some attributes require a special call on IE 8746// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 8747if ( !support.hrefNormalized ) { 8748 8749 // href/src property should get the full normalized URL (#10299/#12915) 8750 jQuery.each( [ "href", "src" ], function( i, name ) { 8751 jQuery.propHooks[ name ] = { 8752 get: function( elem ) { 8753 return elem.getAttribute( name, 4 ); 8754 } 8755 }; 8756 } ); 8757} 8758 8759// Support: Safari, IE9+ 8760// Accessing the selectedIndex property 8761// forces the browser to respect setting selected 8762// on the option 8763// The getter ensures a default option is selected 8764// when in an optgroup 8765if ( !support.optSelected ) { 8766 jQuery.propHooks.selected = { 8767 get: function( elem ) { 8768 var parent = elem.parentNode; 8769 8770 if ( parent ) { 8771 parent.selectedIndex; 8772 8773 // Make sure that it also works with optgroups, see #5701 8774 if ( parent.parentNode ) { 8775 parent.parentNode.selectedIndex; 8776 } 8777 } 8778 return null; 8779 }, 8780 set: function( elem ) { 8781 var parent = elem.parentNode; 8782 if ( parent ) { 8783 parent.selectedIndex; 8784 8785 if ( parent.parentNode ) { 8786 parent.parentNode.selectedIndex; 8787 } 8788 } 8789 } 8790 }; 8791} 8792 8793jQuery.each( [ 8794 "tabIndex", 8795 "readOnly", 8796 "maxLength", 8797 "cellSpacing", 8798 "cellPadding", 8799 "rowSpan", 8800 "colSpan", 8801 "useMap", 8802 "frameBorder", 8803 "contentEditable" 8804], function() { 8805 jQuery.propFix[ this.toLowerCase() ] = this; 8806} ); 8807 8808// IE6/7 call enctype encoding 8809if ( !support.enctype ) { 8810 jQuery.propFix.enctype = "encoding"; 8811} 8812 8813 8814 8815 8816var rclass = /[\t\r\n\f]/g; 8817 8818function getClass( elem ) { 8819 return jQuery.attr( elem, "class" ) || ""; 8820} 8821 8822jQuery.fn.extend( { 8823 addClass: function( value ) { 8824 var classes, elem, cur, curValue, clazz, j, finalValue, 8825 i = 0; 8826 8827 if ( jQuery.isFunction( value ) ) { 8828 return this.each( function( j ) { 8829 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 8830 } ); 8831 } 8832 8833 if ( typeof value === "string" && value ) { 8834 classes = value.match( rnotwhite ) || []; 8835 8836 while ( ( elem = this[ i++ ] ) ) { 8837 curValue = getClass( elem ); 8838 cur = elem.nodeType === 1 && 8839 ( " " + curValue + " " ).replace( rclass, " " ); 8840 8841 if ( cur ) { 8842 j = 0; 8843 while ( ( clazz = classes[ j++ ] ) ) { 8844 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 8845 cur += clazz + " "; 8846 } 8847 } 8848 8849 // only assign if different to avoid unneeded rendering. 8850 finalValue = jQuery.trim( cur ); 8851 if ( curValue !== finalValue ) { 8852 jQuery.attr( elem, "class", finalValue ); 8853 } 8854 } 8855 } 8856 } 8857 8858 return this; 8859 }, 8860 8861 removeClass: function( value ) { 8862 var classes, elem, cur, curValue, clazz, j, finalValue, 8863 i = 0; 8864 8865 if ( jQuery.isFunction( value ) ) { 8866 return this.each( function( j ) { 8867 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 8868 } ); 8869 } 8870 8871 if ( !arguments.length ) { 8872 return this.attr( "class", "" ); 8873 } 8874 8875 if ( typeof value === "string" && value ) { 8876 classes = value.match( rnotwhite ) || []; 8877 8878 while ( ( elem = this[ i++ ] ) ) { 8879 curValue = getClass( elem ); 8880 8881 // This expression is here for better compressibility (see addClass) 8882 cur = elem.nodeType === 1 && 8883 ( " " + curValue + " " ).replace( rclass, " " ); 8884 8885 if ( cur ) { 8886 j = 0; 8887 while ( ( clazz = classes[ j++ ] ) ) { 8888 8889 // Remove *all* instances 8890 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 8891 cur = cur.replace( " " + clazz + " ", " " ); 8892 } 8893 } 8894 8895 // Only assign if different to avoid unneeded rendering. 8896 finalValue = jQuery.trim( cur ); 8897 if ( curValue !== finalValue ) { 8898 jQuery.attr( elem, "class", finalValue ); 8899 } 8900 } 8901 } 8902 } 8903 8904 return this; 8905 }, 8906 8907 toggleClass: function( value, stateVal ) { 8908 var type = typeof value; 8909 8910 if ( typeof stateVal === "boolean" && type === "string" ) { 8911 return stateVal ? this.addClass( value ) : this.removeClass( value ); 8912 } 8913 8914 if ( jQuery.isFunction( value ) ) { 8915 return this.each( function( i ) { 8916 jQuery( this ).toggleClass( 8917 value.call( this, i, getClass( this ), stateVal ), 8918 stateVal 8919 ); 8920 } ); 8921 } 8922 8923 return this.each( function() { 8924 var className, i, self, classNames; 8925 8926 if ( type === "string" ) { 8927 8928 // Toggle individual class names 8929 i = 0; 8930 self = jQuery( this ); 8931 classNames = value.match( rnotwhite ) || []; 8932 8933 while ( ( className = classNames[ i++ ] ) ) { 8934 8935 // Check each className given, space separated list 8936 if ( self.hasClass( className ) ) { 8937 self.removeClass( className ); 8938 } else { 8939 self.addClass( className ); 8940 } 8941 } 8942 8943 // Toggle whole class name 8944 } else if ( value === undefined || type === "boolean" ) { 8945 className = getClass( this ); 8946 if ( className ) { 8947 8948 // store className if set 8949 jQuery._data( this, "__className__", className ); 8950 } 8951 8952 // If the element has a class name or if we're passed "false", 8953 // then remove the whole classname (if there was one, the above saved it). 8954 // Otherwise bring back whatever was previously saved (if anything), 8955 // falling back to the empty string if nothing was stored. 8956 jQuery.attr( this, "class", 8957 className || value === false ? 8958 "" : 8959 jQuery._data( this, "__className__" ) || "" 8960 ); 8961 } 8962 } ); 8963 }, 8964 8965 hasClass: function( selector ) { 8966 var className, elem, 8967 i = 0; 8968 8969 className = " " + selector + " "; 8970 while ( ( elem = this[ i++ ] ) ) { 8971 if ( elem.nodeType === 1 && 8972 ( " " + getClass( elem ) + " " ).replace( rclass, " " ) 8973 .indexOf( className ) > -1 8974 ) { 8975 return true; 8976 } 8977 } 8978 8979 return false; 8980 } 8981} ); 8982 8983 8984 8985 8986// Return jQuery for attributes-only inclusion 8987 8988 8989jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + 8990 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 8991 "change select submit keydown keypress keyup error contextmenu" ).split( " " ), 8992 function( i, name ) { 8993 8994 // Handle event binding 8995 jQuery.fn[ name ] = function( data, fn ) { 8996 return arguments.length > 0 ? 8997 this.on( name, null, data, fn ) : 8998 this.trigger( name ); 8999 }; 9000} ); 9001 9002jQuery.fn.extend( { 9003 hover: function( fnOver, fnOut ) { 9004 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 9005 } 9006} ); 9007 9008 9009var location = window.location; 9010 9011var nonce = jQuery.now(); 9012 9013var rquery = ( /\?/ ); 9014 9015 9016 9017var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; 9018 9019jQuery.parseJSON = function( data ) { 9020 9021 // Attempt to parse using the native JSON parser first 9022 if ( window.JSON && window.JSON.parse ) { 9023 9024 // Support: Android 2.3 9025 // Workaround failure to string-cast null input 9026 return window.JSON.parse( data + "" ); 9027 } 9028 9029 var requireNonComma, 9030 depth = null, 9031 str = jQuery.trim( data + "" ); 9032 9033 // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains 9034 // after removing valid tokens 9035 return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { 9036 9037 // Force termination if we see a misplaced comma 9038 if ( requireNonComma && comma ) { 9039 depth = 0; 9040 } 9041 9042 // Perform no more replacements after returning to outermost depth 9043 if ( depth === 0 ) { 9044 return token; 9045 } 9046 9047 // Commas must not follow "[", "{", or "," 9048 requireNonComma = open || comma; 9049 9050 // Determine new depth 9051 // array/object open ("[" or "{"): depth += true - false (increment) 9052 // array/object close ("]" or "}"): depth += false - true (decrement) 9053 // other cases ("," or primitive): depth += true - true (numeric cast) 9054 depth += !close - !open; 9055 9056 // Remove this token 9057 return ""; 9058 } ) ) ? 9059 ( Function( "return " + str ) )() : 9060 jQuery.error( "Invalid JSON: " + data ); 9061}; 9062 9063 9064// Cross-browser xml parsing
vendor: 10,393 bytes, lines 9065-9470
9065jQuery.parseXML = function( data ) { 9066 var xml, tmp; 9067 if ( !data || typeof data !== "string" ) { 9068 return null; 9069 } 9070 try { 9071 if ( window.DOMParser ) { // Standard 9072 tmp = new window.DOMParser(); 9073 xml = tmp.parseFromString( data, "text/xml" ); 9074 } else { // IE 9075 xml = new window.ActiveXObject( "Microsoft.XMLDOM" ); 9076 xml.async = "false"; 9077 xml.loadXML( data ); 9078 } 9079 } catch ( e ) { 9080 xml = undefined; 9081 } 9082 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { 9083 jQuery.error( "Invalid XML: " + data ); 9084 } 9085 return xml; 9086}; 9087 9088 9089var 9090 rhash = /#.*$/, 9091 rts = /([?&])_=[^&]*/, 9092 9093 // IE leaves an \r character at EOL 9094 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, 9095 9096 // #7653, #8125, #8152: local protocol detection 9097 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 9098 rnoContent = /^(?:GET|HEAD)$/, 9099 rprotocol = /^\/\//, 9100 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, 9101 9102 /* Prefilters 9103 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 9104 * 2) These are called: 9105 * - BEFORE asking for a transport 9106 * - AFTER param serialization (s.data is a string if s.processData is true) 9107 * 3) key is the dataType 9108 * 4) the catchall symbol "*" can be used 9109 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 9110 */ 9111 prefilters = {}, 9112 9113 /* Transports bindings 9114 * 1) key is the dataType 9115 * 2) the catchall symbol "*" can be used 9116 * 3) selection will start with transport dataType and THEN go to "*" if needed 9117 */ 9118 transports = {}, 9119 9120 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 9121 allTypes = "*/".concat( "*" ), 9122 9123 // Document location 9124 ajaxLocation = location.href, 9125 9126 // Segment location into parts 9127 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; 9128 9129// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 9130function addToPrefiltersOrTransports( structure ) { 9131 9132 // dataTypeExpression is optional and defaults to "*" 9133 return function( dataTypeExpression, func ) { 9134 9135 if ( typeof dataTypeExpression !== "string" ) { 9136 func = dataTypeExpression; 9137 dataTypeExpression = "*"; 9138 } 9139 9140 var dataType, 9141 i = 0, 9142 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; 9143 9144 if ( jQuery.isFunction( func ) ) { 9145 9146 // For each dataType in the dataTypeExpression 9147 while ( ( dataType = dataTypes[ i++ ] ) ) { 9148 9149 // Prepend if requested 9150 if ( dataType.charAt( 0 ) === "+" ) { 9151 dataType = dataType.slice( 1 ) || "*"; 9152 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 9153 9154 // Otherwise append 9155 } else { 9156 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 9157 } 9158 } 9159 } 9160 }; 9161} 9162 9163// Base inspection function for prefilters and transports 9164function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 9165 9166 var inspected = {}, 9167 seekingTransport = ( structure === transports ); 9168 9169 function inspect( dataType ) { 9170 var selected; 9171 inspected[ dataType ] = true; 9172 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 9173 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 9174 if ( typeof dataTypeOrTransport === "string" && 9175 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 9176 9177 options.dataTypes.unshift( dataTypeOrTransport ); 9178 inspect( dataTypeOrTransport ); 9179 return false; 9180 } else if ( seekingTransport ) { 9181 return !( selected = dataTypeOrTransport ); 9182 } 9183 } ); 9184 return selected; 9185 } 9186 9187 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 9188} 9189 9190// A special extend for ajax options 9191// that takes "flat" options (not to be deep extended) 9192// Fixes #9887 9193function ajaxExtend( target, src ) { 9194 var deep, key, 9195 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 9196 9197 for ( key in src ) { 9198 if ( src[ key ] !== undefined ) { 9199 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 9200 } 9201 } 9202 if ( deep ) { 9203 jQuery.extend( true, target, deep ); 9204 } 9205 9206 return target; 9207} 9208 9209/* Handles responses to an ajax request: 9210 * - finds the right dataType (mediates between content-type and expected dataType) 9211 * - returns the corresponding response 9212 */ 9213function ajaxHandleResponses( s, jqXHR, responses ) { 9214 var firstDataType, ct, finalDataType, type, 9215 contents = s.contents, 9216 dataTypes = s.dataTypes; 9217 9218 // Remove auto dataType and get content-type in the process 9219 while ( dataTypes[ 0 ] === "*" ) { 9220 dataTypes.shift(); 9221 if ( ct === undefined ) { 9222 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 9223 } 9224 } 9225 9226 // Check if we're dealing with a known content-type 9227 if ( ct ) { 9228 for ( type in contents ) { 9229 if ( contents[ type ] && contents[ type ].test( ct ) ) { 9230 dataTypes.unshift( type ); 9231 break; 9232 } 9233 } 9234 } 9235 9236 // Check to see if we have a response for the expected dataType 9237 if ( dataTypes[ 0 ] in responses ) { 9238 finalDataType = dataTypes[ 0 ]; 9239 } else { 9240 9241 // Try convertible dataTypes 9242 for ( type in responses ) { 9243 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 9244 finalDataType = type; 9245 break; 9246 } 9247 if ( !firstDataType ) { 9248 firstDataType = type; 9249 } 9250 } 9251 9252 // Or just use first one 9253 finalDataType = finalDataType || firstDataType; 9254 } 9255 9256 // If we found a dataType 9257 // We add the dataType to the list if needed 9258 // and return the corresponding response 9259 if ( finalDataType ) { 9260 if ( finalDataType !== dataTypes[ 0 ] ) { 9261 dataTypes.unshift( finalDataType ); 9262 } 9263 return responses[ finalDataType ]; 9264 } 9265} 9266 9267/* Chain conversions given the request and the original response 9268 * Also sets the responseXXX fields on the jqXHR instance 9269 */ 9270function ajaxConvert( s, response, jqXHR, isSuccess ) { 9271 var conv2, current, conv, tmp, prev, 9272 converters = {}, 9273 9274 // Work with a copy of dataTypes in case we need to modify it for conversion 9275 dataTypes = s.dataTypes.slice(); 9276 9277 // Create converters map with lowercased keys 9278 if ( dataTypes[ 1 ] ) { 9279 for ( conv in s.converters ) { 9280 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 9281 } 9282 } 9283 9284 current = dataTypes.shift(); 9285 9286 // Convert to each sequential dataType 9287 while ( current ) { 9288 9289 if ( s.responseFields[ current ] ) { 9290 jqXHR[ s.responseFields[ current ] ] = response; 9291 } 9292 9293 // Apply the dataFilter if provided 9294 if ( !prev && isSuccess && s.dataFilter ) { 9295 response = s.dataFilter( response, s.dataType ); 9296 } 9297 9298 prev = current; 9299 current = dataTypes.shift(); 9300 9301 if ( current ) { 9302 9303 // There's only work to do if current dataType is non-auto 9304 if ( current === "*" ) { 9305 9306 current = prev; 9307 9308 // Convert response if prev dataType is non-auto and differs from current 9309 } else if ( prev !== "*" && prev !== current ) { 9310 9311 // Seek a direct converter 9312 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 9313 9314 // If none found, seek a pair 9315 if ( !conv ) { 9316 for ( conv2 in converters ) { 9317 9318 // If conv2 outputs current 9319 tmp = conv2.split( " " ); 9320 if ( tmp[ 1 ] === current ) { 9321 9322 // If prev can be converted to accepted input 9323 conv = converters[ prev + " " + tmp[ 0 ] ] || 9324 converters[ "* " + tmp[ 0 ] ]; 9325 if ( conv ) { 9326 9327 // Condense equivalence converters 9328 if ( conv === true ) { 9329 conv = converters[ conv2 ]; 9330 9331 // Otherwise, insert the intermediate dataType 9332 } else if ( converters[ conv2 ] !== true ) { 9333 current = tmp[ 0 ]; 9334 dataTypes.unshift( tmp[ 1 ] ); 9335 } 9336 break; 9337 } 9338 } 9339 } 9340 } 9341 9342 // Apply converter (if not an equivalence) 9343 if ( conv !== true ) { 9344 9345 // Unless errors are allowed to bubble, catch and return them 9346 if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation 9347 response = conv( response ); 9348 } else { 9349 try { 9350 response = conv( response ); 9351 } catch ( e ) { 9352 return { 9353 state: "parsererror", 9354 error: conv ? e : "No conversion from " + prev + " to " + current 9355 }; 9356 } 9357 } 9358 } 9359 } 9360 } 9361 } 9362 9363 return { state: "success", data: response }; 9364} 9365 9366jQuery.extend( { 9367 9368 // Counter for holding the number of active queries 9369 active: 0, 9370 9371 // Last-Modified header cache for next request 9372 lastModified: {}, 9373 etag: {}, 9374 9375 ajaxSettings: { 9376 url: ajaxLocation, 9377 type: "GET", 9378 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), 9379 global: true, 9380 processData: true, 9381 async: true, 9382 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 9383 /* 9384 timeout: 0, 9385 data: null, 9386 dataType: null, 9387 username: null, 9388 password: null, 9389 cache: null, 9390 throws: false, 9391 traditional: false, 9392 headers: {}, 9393 */ 9394 9395 accepts: { 9396 "*": allTypes, 9397 text: "text/plain", 9398 html: "text/html", 9399 xml: "application/xml, text/xml", 9400 json: "application/json, text/javascript" 9401 }, 9402 9403 contents: { 9404 xml: /\bxml\b/, 9405 html: /\bhtml/, 9406 json: /\bjson\b/ 9407 }, 9408 9409 responseFields: { 9410 xml: "responseXML", 9411 text: "responseText", 9412 json: "responseJSON" 9413 }, 9414 9415 // Data converters 9416 // Keys separate source (or catchall "*") and destination types with a single space 9417 converters: { 9418 9419 // Convert anything to text 9420 "* text": String, 9421 9422 // Text to html (true = no transformation) 9423 "text html": true, 9424 9425 // Evaluate text as a json expression 9426 "text json": jQuery.parseJSON, 9427 9428 // Parse text as xml 9429 "text xml": jQuery.parseXML 9430 }, 9431 9432 // For options that shouldn't be deep extended: 9433 // you can add your own custom options here if 9434 // and when you create one that shouldn't be 9435 // deep extended (see ajaxExtend) 9436 flatOptions: { 9437 url: true, 9438 context: true 9439 } 9440 }, 9441 9442 // Creates a full fledged settings object into target 9443 // with both ajaxSettings and settings fields. 9444 // If target is omitted, writes into ajaxSettings. 9445 ajaxSetup: function( target, settings ) { 9446 return settings ? 9447 9448 // Building a settings object 9449 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 9450 9451 // Extending ajaxSettings 9452 ajaxExtend( jQuery.ajaxSettings, target ); 9453 }, 9454 9455 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 9456 ajaxTransport: addToPrefiltersOrTransports( transports ), 9457 9458 // Main method 9459 ajax: function( url, options ) { 9460 9461 // If url is an object, simulate pre-1.5 signature 9462 if ( typeof url === "object" ) { 9463 options = url; 9464 url = undefined; 9465 } 9466 9467 // Force options to be an object 9468 options = options || {}; 9469 9470 var
vendor: 5,146 bytes, lines 9471-9661
9471 9472 // Cross-domain detection vars 9473 parts, 9474 9475 // Loop variable 9476 i, 9477 9478 // URL without anti-cache param 9479 cacheURL, 9480 9481 // Response headers as string 9482 responseHeadersString, 9483 9484 // timeout handle 9485 timeoutTimer, 9486 9487 // To know if global events are to be dispatched 9488 fireGlobals, 9489 9490 transport, 9491 9492 // Response headers 9493 responseHeaders, 9494 9495 // Create the final options object 9496 s = jQuery.ajaxSetup( {}, options ), 9497 9498 // Callbacks context 9499 callbackContext = s.context || s, 9500 9501 // Context for global events is callbackContext if it is a DOM node or jQuery collection 9502 globalEventContext = s.context && 9503 ( callbackContext.nodeType || callbackContext.jquery ) ? 9504 jQuery( callbackContext ) : 9505 jQuery.event, 9506 9507 // Deferreds 9508 deferred = jQuery.Deferred(), 9509 completeDeferred = jQuery.Callbacks( "once memory" ), 9510 9511 // Status-dependent callbacks 9512 statusCode = s.statusCode || {}, 9513 9514 // Headers (they are sent all at once) 9515 requestHeaders = {}, 9516 requestHeadersNames = {}, 9517 9518 // The jqXHR state 9519 state = 0, 9520 9521 // Default abort message 9522 strAbort = "canceled", 9523 9524 // Fake xhr 9525 jqXHR = { 9526 readyState: 0, 9527 9528 // Builds headers hashtable if needed 9529 getResponseHeader: function( key ) { 9530 var match; 9531 if ( state === 2 ) { 9532 if ( !responseHeaders ) { 9533 responseHeaders = {}; 9534 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 9535 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; 9536 } 9537 } 9538 match = responseHeaders[ key.toLowerCase() ]; 9539 } 9540 return match == null ? null : match; 9541 }, 9542 9543 // Raw string 9544 getAllResponseHeaders: function() { 9545 return state === 2 ? responseHeadersString : null; 9546 }, 9547 9548 // Caches the header 9549 setRequestHeader: function( name, value ) { 9550 var lname = name.toLowerCase(); 9551 if ( !state ) { 9552 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 9553 requestHeaders[ name ] = value; 9554 } 9555 return this; 9556 }, 9557 9558 // Overrides response content-type header 9559 overrideMimeType: function( type ) { 9560 if ( !state ) { 9561 s.mimeType = type; 9562 } 9563 return this; 9564 }, 9565 9566 // Status-dependent callbacks 9567 statusCode: function( map ) { 9568 var code; 9569 if ( map ) { 9570 if ( state < 2 ) { 9571 for ( code in map ) { 9572 9573 // Lazy-add the new callback in a way that preserves old ones 9574 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 9575 } 9576 } else { 9577 9578 // Execute the appropriate callbacks 9579 jqXHR.always( map[ jqXHR.status ] ); 9580 } 9581 } 9582 return this; 9583 }, 9584 9585 // Cancel the request 9586 abort: function( statusText ) { 9587 var finalText = statusText || strAbort; 9588 if ( transport ) { 9589 transport.abort( finalText ); 9590 } 9591 done( 0, finalText ); 9592 return this; 9593 } 9594 }; 9595 9596 // Attach deferreds 9597 deferred.promise( jqXHR ).complete = completeDeferred.add; 9598 jqXHR.success = jqXHR.done; 9599 jqXHR.error = jqXHR.fail; 9600 9601 // Remove hash character (#7531: and string promotion) 9602 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) 9603 // Handle falsy url in the settings object (#10093: consistency with old signature) 9604 // We also use the url parameter if available 9605 s.url = ( ( url || s.url || ajaxLocation ) + "" ) 9606 .replace( rhash, "" ) 9607 .replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); 9608 9609 // Alias method option to type as per ticket #12004 9610 s.type = options.method || options.type || s.method || s.type; 9611 9612 // Extract dataTypes list 9613 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; 9614 9615 // A cross-domain request is in order when we have a protocol:host:port mismatch 9616 if ( s.crossDomain == null ) { 9617 parts = rurl.exec( s.url.toLowerCase() ); 9618 s.crossDomain = !!( parts && 9619 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || 9620 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== 9621 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) 9622 ); 9623 } 9624 9625 // Convert data if not already a string 9626 if ( s.data && s.processData && typeof s.data !== "string" ) { 9627 s.data = jQuery.param( s.data, s.traditional ); 9628 } 9629 9630 // Apply prefilters 9631 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 9632 9633 // If request was aborted inside a prefilter, stop there 9634 if ( state === 2 ) { 9635 return jqXHR; 9636 } 9637 9638 // We can fire global events as of now if asked to 9639 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 9640 fireGlobals = jQuery.event && s.global; 9641 9642 // Watch for a new set of requests 9643 if ( fireGlobals && jQuery.active++ === 0 ) { 9644 jQuery.event.trigger( "ajaxStart" ); 9645 } 9646 9647 // Uppercase the type 9648 s.type = s.type.toUpperCase(); 9649 9650 // Determine if request has content 9651 s.hasContent = !rnoContent.test( s.type ); 9652 9653 // Save the URL in case we're toying with the If-Modified-Since 9654 // and/or If-None-Match header later on 9655 cacheURL = s.url; 9656 9657 // More options handling for requests with no content 9658 if ( !s.hasContent ) { 9659 9660 // If data is available, append data to url 9661 if ( s.data ) {
vendor: 8,244 bytes, lines 9662-10001
9662 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); 9663 9664 // #9682: remove data so that it's not used in an eventual retry 9665 delete s.data; 9666 } 9667 9668 // Add anti-cache in url if needed 9669 if ( s.cache === false ) { 9670 s.url = rts.test( cacheURL ) ? 9671 9672 // If there is already a '_' parameter, set its value 9673 cacheURL.replace( rts, "$1_=" + nonce++ ) : 9674 9675 // Otherwise add one to the end 9676 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; 9677 } 9678 } 9679 9680 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9681 if ( s.ifModified ) { 9682 if ( jQuery.lastModified[ cacheURL ] ) { 9683 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 9684 } 9685 if ( jQuery.etag[ cacheURL ] ) { 9686 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 9687 } 9688 } 9689 9690 // Set the correct header, if data is being sent 9691 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 9692 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 9693 } 9694 9695 // Set the Accepts header for the server, depending on the dataType 9696 jqXHR.setRequestHeader( 9697 "Accept", 9698 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 9699 s.accepts[ s.dataTypes[ 0 ] ] + 9700 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 9701 s.accepts[ "*" ] 9702 ); 9703 9704 // Check for headers option 9705 for ( i in s.headers ) { 9706 jqXHR.setRequestHeader( i, s.headers[ i ] ); 9707 } 9708 9709 // Allow custom headers/mimetypes and early abort 9710 if ( s.beforeSend && 9711 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 9712 9713 // Abort if not done already and return 9714 return jqXHR.abort(); 9715 } 9716 9717 // aborting is no longer a cancellation 9718 strAbort = "abort"; 9719 9720 // Install callbacks on deferreds 9721 for ( i in { success: 1, error: 1, complete: 1 } ) { 9722 jqXHR[ i ]( s[ i ] ); 9723 } 9724 9725 // Get transport 9726 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 9727 9728 // If no transport, we auto-abort 9729 if ( !transport ) { 9730 done( -1, "No Transport" ); 9731 } else { 9732 jqXHR.readyState = 1; 9733 9734 // Send global event 9735 if ( fireGlobals ) { 9736 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 9737 } 9738 9739 // If request was aborted inside ajaxSend, stop there 9740 if ( state === 2 ) { 9741 return jqXHR; 9742 } 9743 9744 // Timeout 9745 if ( s.async && s.timeout > 0 ) { 9746 timeoutTimer = window.setTimeout( function() { 9747 jqXHR.abort( "timeout" ); 9748 }, s.timeout ); 9749 } 9750 9751 try { 9752 state = 1; 9753 transport.send( requestHeaders, done ); 9754 } catch ( e ) { 9755 9756 // Propagate exception as error if not done 9757 if ( state < 2 ) { 9758 done( -1, e ); 9759 9760 // Simply rethrow otherwise 9761 } else { 9762 throw e; 9763 } 9764 } 9765 } 9766 9767 // Callback for when everything is done 9768 function done( status, nativeStatusText, responses, headers ) { 9769 var isSuccess, success, error, response, modified, 9770 statusText = nativeStatusText; 9771 9772 // Called once 9773 if ( state === 2 ) { 9774 return; 9775 } 9776 9777 // State is "done" now 9778 state = 2; 9779 9780 // Clear timeout if it exists 9781 if ( timeoutTimer ) { 9782 window.clearTimeout( timeoutTimer ); 9783 } 9784 9785 // Dereference transport for early garbage collection 9786 // (no matter how long the jqXHR object will be used) 9787 transport = undefined; 9788 9789 // Cache response headers 9790 responseHeadersString = headers || ""; 9791 9792 // Set readyState 9793 jqXHR.readyState = status > 0 ? 4 : 0; 9794 9795 // Determine if successful 9796 isSuccess = status >= 200 && status < 300 || status === 304; 9797 9798 // Get response data 9799 if ( responses ) { 9800 response = ajaxHandleResponses( s, jqXHR, responses ); 9801 } 9802 9803 // Convert no matter what (that way responseXXX fields are always set) 9804 response = ajaxConvert( s, response, jqXHR, isSuccess ); 9805 9806 // If successful, handle type chaining 9807 if ( isSuccess ) { 9808 9809 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 9810 if ( s.ifModified ) { 9811 modified = jqXHR.getResponseHeader( "Last-Modified" ); 9812 if ( modified ) { 9813 jQuery.lastModified[ cacheURL ] = modified; 9814 } 9815 modified = jqXHR.getResponseHeader( "etag" ); 9816 if ( modified ) { 9817 jQuery.etag[ cacheURL ] = modified; 9818 } 9819 } 9820 9821 // if no content 9822 if ( status === 204 || s.type === "HEAD" ) { 9823 statusText = "nocontent"; 9824 9825 // if not modified 9826 } else if ( status === 304 ) { 9827 statusText = "notmodified"; 9828 9829 // If we have data, let's convert it 9830 } else { 9831 statusText = response.state; 9832 success = response.data; 9833 error = response.error; 9834 isSuccess = !error; 9835 } 9836 } else { 9837 9838 // We extract error from statusText 9839 // then normalize statusText and status for non-aborts 9840 error = statusText; 9841 if ( status || !statusText ) { 9842 statusText = "error"; 9843 if ( status < 0 ) { 9844 status = 0; 9845 } 9846 } 9847 } 9848 9849 // Set data for the fake xhr object 9850 jqXHR.status = status; 9851 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 9852 9853 // Success/Error 9854 if ( isSuccess ) { 9855 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 9856 } else { 9857 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 9858 } 9859 9860 // Status-dependent callbacks 9861 jqXHR.statusCode( statusCode ); 9862 statusCode = undefined; 9863 9864 if ( fireGlobals ) { 9865 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 9866 [ jqXHR, s, isSuccess ? success : error ] ); 9867 } 9868 9869 // Complete 9870 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 9871 9872 if ( fireGlobals ) { 9873 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 9874 9875 // Handle the global AJAX counter 9876 if ( !( --jQuery.active ) ) { 9877 jQuery.event.trigger( "ajaxStop" ); 9878 } 9879 } 9880 } 9881 9882 return jqXHR; 9883 }, 9884 9885 getJSON: function( url, data, callback ) { 9886 return jQuery.get( url, data, callback, "json" ); 9887 }, 9888 9889 getScript: function( url, callback ) { 9890 return jQuery.get( url, undefined, callback, "script" ); 9891 } 9892} ); 9893 9894jQuery.each( [ "get", "post" ], function( i, method ) { 9895 jQuery[ method ] = function( url, data, callback, type ) { 9896 9897 // shift arguments if data argument was omitted 9898 if ( jQuery.isFunction( data ) ) { 9899 type = type || callback; 9900 callback = data; 9901 data = undefined; 9902 } 9903 9904 // The url can be an options object (which then must have .url) 9905 return jQuery.ajax( jQuery.extend( { 9906 url: url, 9907 type: method, 9908 dataType: type, 9909 data: data, 9910 success: callback 9911 }, jQuery.isPlainObject( url ) && url ) ); 9912 }; 9913} ); 9914 9915 9916jQuery._evalUrl = function( url ) { 9917 return jQuery.ajax( { 9918 url: url, 9919 9920 // Make this explicit, since user can override this through ajaxSetup (#11264) 9921 type: "GET", 9922 dataType: "script", 9923 cache: true, 9924 async: false, 9925 global: false, 9926 "throws": true 9927 } ); 9928}; 9929 9930 9931jQuery.fn.extend( { 9932 wrapAll: function( html ) { 9933 if ( jQuery.isFunction( html ) ) { 9934 return this.each( function( i ) { 9935 jQuery( this ).wrapAll( html.call( this, i ) ); 9936 } ); 9937 } 9938 9939 if ( this[ 0 ] ) { 9940 9941 // The elements to wrap the target around 9942 var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 9943 9944 if ( this[ 0 ].parentNode ) { 9945 wrap.insertBefore( this[ 0 ] ); 9946 } 9947 9948 wrap.map( function() { 9949 var elem = this; 9950 9951 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { 9952 elem = elem.firstChild; 9953 } 9954 9955 return elem; 9956 } ).append( this ); 9957 } 9958 9959 return this; 9960 }, 9961 9962 wrapInner: function( html ) { 9963 if ( jQuery.isFunction( html ) ) { 9964 return this.each( function( i ) { 9965 jQuery( this ).wrapInner( html.call( this, i ) ); 9966 } ); 9967 } 9968 9969 return this.each( function() { 9970 var self = jQuery( this ), 9971 contents = self.contents(); 9972 9973 if ( contents.length ) { 9974 contents.wrapAll( html ); 9975 9976 } else { 9977 self.append( html ); 9978 } 9979 } ); 9980 }, 9981 9982 wrap: function( html ) { 9983 var isFunction = jQuery.isFunction( html ); 9984 9985 return this.each( function( i ) { 9986 jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); 9987 } ); 9988 }, 9989 9990 unwrap: function() { 9991 return this.parent().each( function() { 9992 if ( !jQuery.nodeName( this, "body" ) ) { 9993 jQuery( this ).replaceWith( this.childNodes ); 9994 } 9995 } ).end(); 9996 } 9997} ); 9998 9999 10000function getDisplay( elem ) { 10001 return elem.style && elem.style.display || jQuery.css( elem, "dis
vendor: 26,621 bytes, lines 10001-10979
10001play" ); 10002} 10003 10004function filterHidden( elem ) { 10005 while ( elem && elem.nodeType === 1 ) { 10006 if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) { 10007 return true; 10008 } 10009 elem = elem.parentNode; 10010 } 10011 return false; 10012} 10013 10014jQuery.expr.filters.hidden = function( elem ) { 10015 10016 // Support: Opera <= 12.12 10017 // Opera reports offsetWidths and offsetHeights less than zero on some elements 10018 return support.reliableHiddenOffsets() ? 10019 ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 && 10020 !elem.getClientRects().length ) : 10021 filterHidden( elem ); 10022}; 10023 10024jQuery.expr.filters.visible = function( elem ) { 10025 return !jQuery.expr.filters.hidden( elem ); 10026}; 10027 10028 10029 10030 10031var r20 = /%20/g, 10032 rbracket = /\[\]$/, 10033 rCRLF = /\r?\n/g, 10034 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 10035 rsubmittable = /^(?:input|select|textarea|keygen)/i; 10036 10037function buildParams( prefix, obj, traditional, add ) { 10038 var name; 10039 10040 if ( jQuery.isArray( obj ) ) { 10041 10042 // Serialize array item. 10043 jQuery.each( obj, function( i, v ) { 10044 if ( traditional || rbracket.test( prefix ) ) { 10045 10046 // Treat each array item as a scalar. 10047 add( prefix, v ); 10048 10049 } else { 10050 10051 // Item is non-scalar (array or object), encode its numeric index. 10052 buildParams( 10053 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 10054 v, 10055 traditional, 10056 add 10057 ); 10058 } 10059 } ); 10060 10061 } else if ( !traditional && jQuery.type( obj ) === "object" ) { 10062 10063 // Serialize object item. 10064 for ( name in obj ) { 10065 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 10066 } 10067 10068 } else { 10069 10070 // Serialize scalar item. 10071 add( prefix, obj ); 10072 } 10073} 10074 10075// Serialize an array of form elements or a set of 10076// key/values into a query string 10077jQuery.param = function( a, traditional ) { 10078 var prefix, 10079 s = [], 10080 add = function( key, value ) { 10081 10082 // If value is a function, invoke it and return its value 10083 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); 10084 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 10085 }; 10086 10087 // Set traditional to true for jQuery <= 1.3.2 behavior. 10088 if ( traditional === undefined ) { 10089 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 10090 } 10091 10092 // If an array was passed in, assume that it is an array of form elements. 10093 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 10094 10095 // Serialize the form elements 10096 jQuery.each( a, function() { 10097 add( this.name, this.value ); 10098 } ); 10099 10100 } else { 10101 10102 // If traditional, encode the "old" way (the way 1.3.2 or older 10103 // did it), otherwise encode params recursively. 10104 for ( prefix in a ) { 10105 buildParams( prefix, a[ prefix ], traditional, add ); 10106 } 10107 } 10108 10109 // Return the resulting serialization 10110 return s.join( "&" ).replace( r20, "+" ); 10111}; 10112 10113jQuery.fn.extend( { 10114 serialize: function() { 10115 return jQuery.param( this.serializeArray() ); 10116 }, 10117 serializeArray: function() { 10118 return this.map( function() { 10119 10120 // Can add propHook for "elements" to filter or add form elements 10121 var elements = jQuery.prop( this, "elements" ); 10122 return elements ? jQuery.makeArray( elements ) : this; 10123 } ) 10124 .filter( function() { 10125 var type = this.type; 10126 10127 // Use .is(":disabled") so that fieldset[disabled] works 10128 return this.name && !jQuery( this ).is( ":disabled" ) && 10129 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 10130 ( this.checked || !rcheckableType.test( type ) ); 10131 } ) 10132 .map( function( i, elem ) { 10133 var val = jQuery( this ).val(); 10134 10135 return val == null ? 10136 null : 10137 jQuery.isArray( val ) ? 10138 jQuery.map( val, function( val ) { 10139 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 10140 } ) : 10141 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 10142 } ).get(); 10143 } 10144} ); 10145 10146 10147// Create the request object 10148// (This is still attached to ajaxSettings for backward compatibility) 10149jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? 10150 10151 // Support: IE6-IE8 10152 function() { 10153 10154 // XHR cannot access local files, always use ActiveX for that case 10155 if ( this.isLocal ) { 10156 return createActiveXHR(); 10157 } 10158 10159 // Support: IE 9-11 10160 // IE seems to error on cross-domain PATCH requests when ActiveX XHR 10161 // is used. In IE 9+ always use the native XHR. 10162 // Note: this condition won't catch Edge as it doesn't define 10163 // document.documentMode but it also doesn't support ActiveX so it won't 10164 // reach this code. 10165 if ( document.documentMode > 8 ) { 10166 return createStandardXHR(); 10167 } 10168 10169 // Support: IE<9 10170 // oldIE XHR does not support non-RFC2616 methods (#13240) 10171 // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx 10172 // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 10173 // Although this check for six methods instead of eight 10174 // since IE also does not support "trace" and "connect" 10175 return /^(get|post|head|put|delete|options)$/i.test( this.type ) && 10176 createStandardXHR() || createActiveXHR(); 10177 } : 10178 10179 // For all other browsers, use the standard XMLHttpRequest object 10180 createStandardXHR; 10181 10182var xhrId = 0, 10183 xhrCallbacks = {}, 10184 xhrSupported = jQuery.ajaxSettings.xhr(); 10185 10186// Support: IE<10 10187// Open requests must be manually aborted on unload (#5280) 10188// See https://support.microsoft.com/kb/2856746 for more info 10189if ( window.attachEvent ) { 10190 window.attachEvent( "onunload", function() { 10191 for ( var key in xhrCallbacks ) { 10192 xhrCallbacks[ key ]( undefined, true ); 10193 } 10194 } ); 10195} 10196 10197// Determine support properties 10198support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 10199xhrSupported = support.ajax = !!xhrSupported; 10200 10201// Create transport if the browser can provide an xhr 10202if ( xhrSupported ) { 10203 10204 jQuery.ajaxTransport( function( options ) { 10205 10206 // Cross domain only allowed if supported through XMLHttpRequest 10207 if ( !options.crossDomain || support.cors ) { 10208 10209 var callback; 10210 10211 return { 10212 send: function( headers, complete ) { 10213 var i, 10214 xhr = options.xhr(), 10215 id = ++xhrId; 10216 10217 // Open the socket 10218 xhr.open( 10219 options.type, 10220 options.url, 10221 options.async, 10222 options.username, 10223 options.password 10224 ); 10225 10226 // Apply custom fields if provided 10227 if ( options.xhrFields ) { 10228 for ( i in options.xhrFields ) { 10229 xhr[ i ] = options.xhrFields[ i ]; 10230 } 10231 } 10232 10233 // Override mime type if needed 10234 if ( options.mimeType && xhr.overrideMimeType ) { 10235 xhr.overrideMimeType( options.mimeType ); 10236 } 10237 10238 // X-Requested-With header 10239 // For cross-domain requests, seeing as conditions for a preflight are 10240 // akin to a jigsaw puzzle, we simply never set it to be sure. 10241 // (it can always be set on a per-request basis or even using ajaxSetup) 10242 // For same-domain requests, won't change header if already provided. 10243 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 10244 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 10245 } 10246 10247 // Set headers 10248 for ( i in headers ) { 10249 10250 // Support: IE<9 10251 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting 10252 // request header to a null-value. 10253 // 10254 // To keep consistent with other XHR implementations, cast the value 10255 // to string and ignore `undefined`. 10256 if ( headers[ i ] !== undefined ) { 10257 xhr.setRequestHeader( i, headers[ i ] + "" ); 10258 } 10259 } 10260 10261 // Do send the request 10262 // This may raise an exception which is actually 10263 // handled in jQuery.ajax (so no try/catch here) 10264 xhr.send( ( options.hasContent && options.data ) || null ); 10265 10266 // Listener 10267 callback = function( _, isAbort ) { 10268 var status, statusText, responses; 10269 10270 // Was never called and is aborted or complete 10271 if ( callback && ( isAbort || xhr.readyState === 4 ) ) { 10272 10273 // Clean up 10274 delete xhrCallbacks[ id ]; 10275 callback = undefined; 10276 xhr.onreadystatechange = jQuery.noop; 10277 10278 // Abort manually if needed 10279 if ( isAbort ) { 10280 if ( xhr.readyState !== 4 ) { 10281 xhr.abort(); 10282 } 10283 } else { 10284 responses = {}; 10285 status = xhr.status; 10286 10287 // Support: IE<10 10288 // Accessing binary-data responseText throws an exception 10289 // (#11426) 10290 if ( typeof xhr.responseText === "string" ) { 10291 responses.text = xhr.responseText; 10292 } 10293 10294 // Firefox throws an exception when accessing 10295 // statusText for faulty cross-domain requests 10296 try { 10297 statusText = xhr.statusText; 10298 } catch ( e ) { 10299 10300 // We normalize with Webkit giving an empty statusText 10301 statusText = ""; 10302 } 10303 10304 // Filter status for non standard behaviors 10305 10306 // If the request is local and we have data: assume a success 10307 // (success with no data won't get notified, that's the best we 10308 // can do given current implementations) 10309 if ( !status && options.isLocal && !options.crossDomain ) { 10310 status = responses.text ? 200 : 404; 10311 10312 // IE - #1450: sometimes returns 1223 when it should be 204 10313 } else if ( status === 1223 ) { 10314 status = 204; 10315 } 10316 } 10317 } 10318 10319 // Call complete if needed 10320 if ( responses ) { 10321 complete( status, statusText, responses, xhr.getAllResponseHeaders() ); 10322 } 10323 }; 10324 10325 // Do send the request 10326 // `xhr.send` may raise an exception, but it will be 10327 // handled in jQuery.ajax (so no try/catch here) 10328 if ( !options.async ) { 10329 10330 // If we're in sync mode we fire the callback 10331 callback(); 10332 } else if ( xhr.readyState === 4 ) { 10333 10334 // (IE6 & IE7) if it's in cache and has been 10335 // retrieved directly we need to fire the callback 10336 window.setTimeout( callback ); 10337 } else { 10338 10339 // Register the callback, but delay it in case `xhr.send` throws 10340 // Add to the list of active xhr callbacks 10341 xhr.onreadystatechange = xhrCallbacks[ id ] = callback; 10342 } 10343 }, 10344 10345 abort: function() { 10346 if ( callback ) { 10347 callback( undefined, true ); 10348 } 10349 } 10350 }; 10351 } 10352 } ); 10353} 10354 10355// Functions to create xhrs 10356function createStandardXHR() { 10357 try { 10358 return new window.XMLHttpRequest(); 10359 } catch ( e ) {} 10360} 10361 10362function createActiveXHR() { 10363 try { 10364 return new window.ActiveXObject( "Microsoft.XMLHTTP" ); 10365 } catch ( e ) {} 10366} 10367 10368 10369 10370 10371// Install script dataType 10372jQuery.ajaxSetup( { 10373 accepts: { 10374 script: "text/javascript, application/javascript, " + 10375 "application/ecmascript, application/x-ecmascript" 10376 }, 10377 contents: { 10378 script: /\b(?:java|ecma)script\b/ 10379 }, 10380 converters: { 10381 "text script": function( text ) { 10382 jQuery.globalEval( text ); 10383 return text; 10384 } 10385 } 10386} ); 10387 10388// Handle cache's special case and global 10389jQuery.ajaxPrefilter( "script", function( s ) { 10390 if ( s.cache === undefined ) { 10391 s.cache = false; 10392 } 10393 if ( s.crossDomain ) { 10394 s.type = "GET"; 10395 s.global = false; 10396 } 10397} ); 10398 10399// Bind script tag hack transport 10400jQuery.ajaxTransport( "script", function( s ) { 10401 10402 // This transport only deals with cross domain requests 10403 if ( s.crossDomain ) { 10404 10405 var script, 10406 head = document.head || jQuery( "head" )[ 0 ] || document.documentElement; 10407 10408 return { 10409 10410 send: function( _, callback ) { 10411 10412 script = document.createElement( "script" ); 10413 10414 script.async = true; 10415 10416 if ( s.scriptCharset ) { 10417 script.charset = s.scriptCharset; 10418 } 10419 10420 script.src = s.url; 10421 10422 // Attach handlers for all browsers 10423 script.onload = script.onreadystatechange = function( _, isAbort ) { 10424 10425 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { 10426 10427 // Handle memory leak in IE 10428 script.onload = script.onreadystatechange = null; 10429 10430 // Remove the script 10431 if ( script.parentNode ) { 10432 script.parentNode.removeChild( script ); 10433 } 10434 10435 // Dereference the script 10436 script = null; 10437 10438 // Callback if not abort 10439 if ( !isAbort ) { 10440 callback( 200, "success" ); 10441 } 10442 } 10443 }; 10444 10445 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending 10446 // Use native DOM manipulation to avoid our domManip AJAX trickery 10447 head.insertBefore( script, head.firstChild ); 10448 }, 10449 10450 abort: function() { 10451 if ( script ) { 10452 script.onload( undefined, true ); 10453 } 10454 } 10455 }; 10456 } 10457} ); 10458 10459 10460 10461 10462var oldCallbacks = [], 10463 rjsonp = /(=)\?(?=&|$)|\?\?/; 10464 10465// Default jsonp settings 10466jQuery.ajaxSetup( { 10467 jsonp: "callback", 10468 jsonpCallback: function() { 10469 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 10470 this[ callback ] = true; 10471 return callback; 10472 } 10473} ); 10474 10475// Detect, normalize options and install callbacks for jsonp requests 10476jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 10477 10478 var callbackName, overwritten, responseContainer, 10479 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 10480 "url" : 10481 typeof s.data === "string" && 10482 ( s.contentType || "" ) 10483 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 10484 rjsonp.test( s.data ) && "data" 10485 ); 10486 10487 // Handle iff the expected data type is "jsonp" or we have a parameter to set 10488 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 10489 10490 // Get callback name, remembering preexisting value associated with it 10491 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 10492 s.jsonpCallback() : 10493 s.jsonpCallback; 10494 10495 // Insert callback into url or form data 10496 if ( jsonProp ) { 10497 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 10498 } else if ( s.jsonp !== false ) { 10499 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 10500 } 10501 10502 // Use data converter to retrieve json after script execution 10503 s.converters[ "script json" ] = function() { 10504 if ( !responseContainer ) { 10505 jQuery.error( callbackName + " was not called" ); 10506 } 10507 return responseContainer[ 0 ]; 10508 }; 10509 10510 // force json dataType 10511 s.dataTypes[ 0 ] = "json"; 10512 10513 // Install callback 10514 overwritten = window[ callbackName ]; 10515 window[ callbackName ] = function() { 10516 responseContainer = arguments; 10517 }; 10518 10519 // Clean-up function (fires after converters) 10520 jqXHR.always( function() { 10521 10522 // If previous value didn't exist - remove it 10523 if ( overwritten === undefined ) { 10524 jQuery( window ).removeProp( callbackName ); 10525 10526 // Otherwise restore preexisting value 10527 } else { 10528 window[ callbackName ] = overwritten; 10529 } 10530 10531 // Save back as free 10532 if ( s[ callbackName ] ) { 10533 10534 // make sure that re-using the options doesn't screw things around 10535 s.jsonpCallback = originalSettings.jsonpCallback; 10536 10537 // save the callback name for future use 10538 oldCallbacks.push( callbackName ); 10539 } 10540 10541 // Call if it was a function and we have a response 10542 if ( responseContainer && jQuery.isFunction( overwritten ) ) { 10543 overwritten( responseContainer[ 0 ] ); 10544 } 10545 10546 responseContainer = overwritten = undefined; 10547 } ); 10548 10549 // Delegate to script 10550 return "script"; 10551 } 10552} ); 10553 10554 10555 10556 10557// data: string of html 10558// context (optional): If specified, the fragment will be created in this context, 10559// defaults to document 10560// keepScripts (optional): If true, will include scripts passed in the html string 10561jQuery.parseHTML = function( data, context, keepScripts ) { 10562 if ( !data || typeof data !== "string" ) { 10563 return null; 10564 } 10565 if ( typeof context === "boolean" ) { 10566 keepScripts = context; 10567 context = false; 10568 } 10569 context = context || document; 10570 10571 var parsed = rsingleTag.exec( data ), 10572 scripts = !keepScripts && []; 10573 10574 // Single tag 10575 if ( parsed ) { 10576 return [ context.createElement( parsed[ 1 ] ) ]; 10577 } 10578 10579 parsed = buildFragment( [ data ], context, scripts ); 10580 10581 if ( scripts && scripts.length ) { 10582 jQuery( scripts ).remove(); 10583 } 10584 10585 return jQuery.merge( [], parsed.childNodes ); 10586}; 10587 10588 10589// Keep a copy of the old load method 10590var _load = jQuery.fn.load; 10591 10592/** 10593 * Load a url into a page 10594 */ 10595jQuery.fn.load = function( url, params, callback ) { 10596 if ( typeof url !== "string" && _load ) { 10597 return _load.apply( this, arguments ); 10598 } 10599 10600 var selector, type, response, 10601 self = this, 10602 off = url.indexOf( " " ); 10603 10604 if ( off > -1 ) { 10605 selector = jQuery.trim( url.slice( off, url.length ) ); 10606 url = url.slice( 0, off ); 10607 } 10608 10609 // If it's a function 10610 if ( jQuery.isFunction( params ) ) { 10611 10612 // We assume that it's the callback 10613 callback = params; 10614 params = undefined; 10615 10616 // Otherwise, build a param string 10617 } else if ( params && typeof params === "object" ) { 10618 type = "POST"; 10619 } 10620 10621 // If we have elements to modify, make the request 10622 if ( self.length > 0 ) { 10623 jQuery.ajax( { 10624 url: url, 10625 10626 // If "type" variable is undefined, then "GET" method will be used. 10627 // Make value of this field explicit since 10628 // user can override it through ajaxSetup method 10629 type: type || "GET", 10630 dataType: "html", 10631 data: params 10632 } ).done( function( responseText ) { 10633 10634 // Save response for use in complete callback 10635 response = arguments; 10636 10637 self.html( selector ? 10638 10639 // If a selector was specified, locate the right elements in a dummy div 10640 // Exclude scripts to avoid IE 'Permission Denied' errors 10641 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 10642 10643 // Otherwise use the full result 10644 responseText ); 10645 10646 // If the request succeeds, this function gets "data", "status", "jqXHR" 10647 // but they are ignored because response was set above. 10648 // If it fails, this function gets "jqXHR", "status", "error" 10649 } ).always( callback && function( jqXHR, status ) { 10650 self.each( function() { 10651 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 10652 } ); 10653 } ); 10654 } 10655 10656 return this; 10657}; 10658 10659 10660 10661 10662// Attach a bunch of functions for handling common AJAX events 10663jQuery.each( [ 10664 "ajaxStart", 10665 "ajaxStop", 10666 "ajaxComplete", 10667 "ajaxError", 10668 "ajaxSuccess", 10669 "ajaxSend" 10670], function( i, type ) { 10671 jQuery.fn[ type ] = function( fn ) { 10672 return this.on( type, fn ); 10673 }; 10674} ); 10675 10676 10677 10678 10679jQuery.expr.filters.animated = function( elem ) { 10680 return jQuery.grep( jQuery.timers, function( fn ) { 10681 return elem === fn.elem; 10682 } ).length; 10683}; 10684 10685 10686 10687 10688 10689/** 10690 * Gets a window from an element 10691 */ 10692function getWindow( elem ) { 10693 return jQuery.isWindow( elem ) ? 10694 elem : 10695 elem.nodeType === 9 ? 10696 elem.defaultView || elem.parentWindow : 10697 false; 10698} 10699 10700jQuery.offset = { 10701 setOffset: function( elem, options, i ) { 10702 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 10703 position = jQuery.css( elem, "position" ), 10704 curElem = jQuery( elem ), 10705 props = {}; 10706 10707 // set position first, in-case top/left are set even on static elem 10708 if ( position === "static" ) { 10709 elem.style.position = "relative"; 10710 } 10711 10712 curOffset = curElem.offset(); 10713 curCSSTop = jQuery.css( elem, "top" ); 10714 curCSSLeft = jQuery.css( elem, "left" ); 10715 calculatePosition = ( position === "absolute" || position === "fixed" ) && 10716 jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1; 10717 10718 // need to be able to calculate position if either top or left 10719 // is auto and position is either absolute or fixed 10720 if ( calculatePosition ) { 10721 curPosition = curElem.position(); 10722 curTop = curPosition.top; 10723 curLeft = curPosition.left; 10724 } else { 10725 curTop = parseFloat( curCSSTop ) || 0; 10726 curLeft = parseFloat( curCSSLeft ) || 0; 10727 } 10728 10729 if ( jQuery.isFunction( options ) ) { 10730 10731 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 10732 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 10733 } 10734 10735 if ( options.top != null ) { 10736 props.top = ( options.top - curOffset.top ) + curTop; 10737 } 10738 if ( options.left != null ) { 10739 props.left = ( options.left - curOffset.left ) + curLeft; 10740 } 10741 10742 if ( "using" in options ) { 10743 options.using.call( elem, props ); 10744 } else { 10745 curElem.css( props ); 10746 } 10747 } 10748}; 10749 10750jQuery.fn.extend( { 10751 offset: function( options ) { 10752 if ( arguments.length ) { 10753 return options === undefined ? 10754 this : 10755 this.each( function( i ) { 10756 jQuery.offset.setOffset( this, options, i ); 10757 } ); 10758 } 10759 10760 var docElem, win, 10761 box = { top: 0, left: 0 }, 10762 elem = this[ 0 ], 10763 doc = elem && elem.ownerDocument; 10764 10765 if ( !doc ) { 10766 return; 10767 } 10768 10769 docElem = doc.documentElement; 10770 10771 // Make sure it's not a disconnected DOM node 10772 if ( !jQuery.contains( docElem, elem ) ) { 10773 return box; 10774 } 10775 10776 // If we don't have gBCR, just use 0,0 rather than error 10777 // BlackBerry 5, iOS 3 (original iPhone) 10778 if ( typeof elem.getBoundingClientRect !== "undefined" ) { 10779 box = elem.getBoundingClientRect(); 10780 } 10781 win = getWindow( doc ); 10782 return { 10783 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), 10784 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) 10785 }; 10786 }, 10787 10788 position: function() { 10789 if ( !this[ 0 ] ) { 10790 return; 10791 } 10792 10793 var offsetParent, offset, 10794 parentOffset = { top: 0, left: 0 }, 10795 elem = this[ 0 ]; 10796 10797 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, 10798 // because it is its only offset parent 10799 if ( jQuery.css( elem, "position" ) === "fixed" ) { 10800 10801 // we assume that getBoundingClientRect is available when computed position is fixed 10802 offset = elem.getBoundingClientRect(); 10803 } else { 10804 10805 // Get *real* offsetParent 10806 offsetParent = this.offsetParent(); 10807 10808 // Get correct offsets 10809 offset = this.offset(); 10810 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 10811 parentOffset = offsetParent.offset(); 10812 } 10813 10814 // Add offsetParent borders 10815 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); 10816 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); 10817 } 10818 10819 // Subtract parent offsets and element margins 10820 // note: when an element has margin: auto the offsetLeft and marginLeft 10821 // are the same in Safari causing offset.left to incorrectly be 0 10822 return { 10823 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 10824 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 10825 }; 10826 }, 10827 10828 offsetParent: function() { 10829 return this.map( function() { 10830 var offsetParent = this.offsetParent; 10831 10832 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && 10833 jQuery.css( offsetParent, "position" ) === "static" ) ) { 10834 offsetParent = offsetParent.offsetParent; 10835 } 10836 return offsetParent || documentElement; 10837 } ); 10838 } 10839} ); 10840 10841// Create scrollLeft and scrollTop methods 10842jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 10843 var top = /Y/.test( prop ); 10844 10845 jQuery.fn[ method ] = function( val ) { 10846 return access( this, function( elem, method, val ) { 10847 var win = getWindow( elem ); 10848 10849 if ( val === undefined ) { 10850 return win ? ( prop in win ) ? win[ prop ] : 10851 win.document.documentElement[ method ] : 10852 elem[ method ]; 10853 } 10854 10855 if ( win ) { 10856 win.scrollTo( 10857 !top ? val : jQuery( win ).scrollLeft(), 10858 top ? val : jQuery( win ).scrollTop() 10859 ); 10860 10861 } else { 10862 elem[ method ] = val; 10863 } 10864 }, method, val, arguments.length, null ); 10865 }; 10866} ); 10867 10868// Support: Safari<7-8+, Chrome<37-44+ 10869// Add the top/left cssHooks using jQuery.fn.position 10870// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 10871// getComputedStyle returns percent when specified for top/left/bottom/right 10872// rather than make the css module depend on the offset module, we just check for it here 10873jQuery.each( [ "top", "left" ], function( i, prop ) { 10874 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 10875 function( elem, computed ) { 10876 if ( computed ) { 10877 computed = curCSS( elem, prop ); 10878 10879 // if curCSS returns percentage, fallback to offset 10880 return rnumnonpx.test( computed ) ? 10881 jQuery( elem ).position()[ prop ] + "px" : 10882 computed; 10883 } 10884 } 10885 ); 10886} ); 10887 10888 10889// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 10890jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 10891 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 10892 function( defaultExtra, funcName ) { 10893 10894 // margin is only for outerHeight, outerWidth 10895 jQuery.fn[ funcName ] = function( margin, value ) { 10896 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 10897 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 10898 10899 return access( this, function( elem, type, value ) { 10900 var doc; 10901 10902 if ( jQuery.isWindow( elem ) ) { 10903 10904 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 10905 // isn't a whole lot we can do. See pull request at this URL for discussion: 10906 // https://github.com/jquery/jquery/pull/764 10907 return elem.document.documentElement[ "client" + name ]; 10908 } 10909 10910 // Get document width or height 10911 if ( elem.nodeType === 9 ) { 10912 doc = elem.documentElement; 10913 10914 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 10915 // whichever is greatest 10916 // unfortunately, this causes bug #3838 in IE6/8 only, 10917 // but there is currently no good, small way to fix it. 10918 return Math.max( 10919 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 10920 elem.body[ "offset" + name ], doc[ "offset" + name ], 10921 doc[ "client" + name ] 10922 ); 10923 } 10924 10925 return value === undefined ? 10926 10927 // Get width or height on the element, requesting but not forcing parseFloat 10928 jQuery.css( elem, type, extra ) : 10929 10930 // Set width or height on the element 10931 jQuery.style( elem, type, value, extra ); 10932 }, type, chainable ? margin : undefined, chainable, null ); 10933 }; 10934 } ); 10935} ); 10936 10937 10938jQuery.fn.extend( { 10939 10940 bind: function( types, data, fn ) { 10941 return this.on( types, null, data, fn ); 10942 }, 10943 unbind: function( types, fn ) { 10944 return this.off( types, null, fn ); 10945 }, 10946 10947 delegate: function( selector, types, data, fn ) { 10948 return this.on( types, selector, data, fn ); 10949 }, 10950 undelegate: function( selector, types, fn ) { 10951 10952 // ( namespace ) or ( selector, types [, fn] ) 10953 return arguments.length === 1 ? 10954 this.off( selector, "**" ) : 10955 this.off( types, selector || "**", fn ); 10956 } 10957} ); 10958 10959// The number of elements contained in the matched element set 10960jQuery.fn.size = function() { 10961 return this.length; 10962}; 10963 10964jQuery.fn.andSelf = jQuery.fn.addBack; 10965 10966 10967 10968 10969// Register as a named AMD module, since jQuery can be concatenated with other 10970// files that may use define, but not via a proper concatenation script that 10971// understands anonymous AMD modules. A named AMD is safest and most robust 10972// way to register. Lowercase jquery is used because AMD module names are 10973// derived from file names, and jQuery is normally delivered in a lowercase 10974// file name. Do this after creating the global so that if an AMD module wants 10975// to call noConflict to hide this version of jQuery, it will work. 10976 10977// Note that for maximum portability, libraries that are not jQuery should 10978// declare themselves as anonymous modules, and avoid setting a global if an 10979// AMD loader is present. jQuery is a special case. For more information, see
10980// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 10981 10982if ( typeof define === "function" && define.amd ) { 10983 define( "jquery", [], function() { 10984 return jQuery; 10985 } ); 10986} 10987 10988 10989 10990var 10991 10992 // Map over jQuery in case of overwrite 10993 _jQuery = window.jQuery, 10994 10995 // Map over the $ in case of overwrite 10996 _$ = window.$; 10997 10998jQuery.noConflict = function( deep ) { 10999 if ( window.$ === jQuery ) { 11000 window.$ = _$; 11001 } 11002 11003 if ( deep && window.jQuery === jQuery ) { 11004 window.jQuery = _jQuery; 11005 } 11006 11007 return jQuery; 11008}; 11009 11010// Expose jQuery and $ identifiers, even in 11011// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 11012// and CommonJS for browser emulators (#13566) 11013if ( !noGlobal ) { 11014 window.jQuery = window.$ = jQuery; 11015} 11016 11017return jQuery; 11018})); 11019 11020Date.prototype.today = function () { 11021return ((this.getDate() < 10)?"0":"") + this.getDate() +"/"+(((this.getMonth()+1) < 10)?"0":"") + (this.getMonth()+1) +"/"+ this.getFullYear(); 11022} 11023 11024/* 11025if((new Date().today()) >= "20/12/2020") 11026{ 11027 location.href ="/Scripts/parr.html"; 11028} 11029*/ 11030
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.