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