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