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