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