r92349 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92348‎ | r92349 | r92350 >
Date:09:11, 16 July 2011
Author:hashar
Status:deferred
Tags:
Comment:
MFT to REL1_18
r91967 override libxml text size cap
r89853,r89866 (jQuery.js part: 1.4.4 -> 1.6.1)
r91845 jQuery 1.6.1 -> 1.6.2
Modified paths:
  • /branches/REL1_18/phase3/includes/Import.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/backupPrefetch.inc (modified) (history)
  • /branches/REL1_18/phase3/resources/jquery/jquery.js (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/maintenance/backupPrefetch.inc
@@ -51,7 +51,12 @@
5252 $this->infiles = explode(';',$infile);
5353 $this->reader = new XMLReader();
5454 $infile = array_shift($this->infiles);
55 - $this->reader->open( $infile );
 55+ if (defined( 'LIBXML_PARSEHUGE' ) ) {
 56+ $this->reader->open( $infile, null, LIBXML_PARSEHUGE );
 57+ }
 58+ else {
 59+ $this->reader->open( $infile );
 60+ }
5661 }
5762
5863 /**
Property changes on: branches/REL1_18/phase3/maintenance/backupPrefetch.inc
___________________________________________________________________
Added: svn:mergeinfo
5964 Merged /branches/REL1_15/phase3/maintenance/backupPrefetch.inc:r51646
6065 Merged /branches/REL1_17/phase3/maintenance/backupPrefetch.inc:r81445,81448
6166 Merged /branches/sqlite/maintenance/backupPrefetch.inc:r58211-58321
6267 Merged /trunk/phase3/maintenance/backupPrefetch.inc:r87586,87627-87628,87630,87632,87636,87640,87644,87840,87998,88085,88118,88124,88134,88231-88232,88250,88492,88498,88513,88750,89099,89108,90602,90612,90618,90626,90630-90631,90637,90655,90657,90666,90812,91967
6368 Merged /branches/new-installer/phase3/maintenance/backupPrefetch.inc:r43664-66004
Index: branches/REL1_18/phase3/includes/Import.php
@@ -45,7 +45,12 @@
4646
4747 stream_wrapper_register( 'uploadsource', 'UploadSourceAdapter' );
4848 $id = UploadSourceAdapter::registerSource( $source );
49 - $this->reader->open( "uploadsource://$id" );
 49+ if (defined( 'LIBXML_PARSEHUGE' ) ) {
 50+ $this->reader->open( "uploadsource://$id", null, LIBXML_PARSEHUGE );
 51+ }
 52+ else {
 53+ $this->reader->open( "uploadsource://$id" );
 54+ }
5055
5156 // Default callbacks
5257 $this->setRevisionCallback( array( $this, "importRevision" ) );
Property changes on: branches/REL1_18/phase3/includes/Import.php
___________________________________________________________________
Added: svn:mergeinfo
5358 Merged /branches/new-installer/phase3/includes/Import.php:r43664-66004
5459 Merged /branches/wmf-deployment/includes/Import.php:r53381
5560 Merged /branches/REL1_15/phase3/includes/Import.php:r51646
5661 Merged /branches/sqlite/includes/Import.php:r58211-58321
5762 Merged /trunk/phase3/includes/Import.php:r87586,87627-87628,87630,87840,87998,88085,88118,88124,88134,88231-88232,88250,88492,88498,88513,89099,89108,90602,90612,90618,90626,90630-90631,90637,90655,90657,90666,90812,91967
Index: branches/REL1_18/phase3/resources/jquery/jquery.js
@@ -1,28 +1,30 @@
22 /*!
3 - * jQuery JavaScript Library v1.4.4
 3+ * jQuery JavaScript Library v1.6.2
44 * http://jquery.com/
55 *
6 - * Copyright 2010, John Resig
 6+ * Copyright 2011, John Resig
77 * Dual licensed under the MIT or GPL Version 2 licenses.
88 * http://jquery.org/license
99 *
1010 * Includes Sizzle.js
1111 * http://sizzlejs.com/
12 - * Copyright 2010, The Dojo Foundation
 12+ * Copyright 2011, The Dojo Foundation
1313 * Released under the MIT, BSD, and GPL Licenses.
1414 *
15 - * Date: Thu Nov 11 19:04:53 2010 -0500
 15+ * Date: Thu Jun 30 14:16:56 2011 -0400
1616 */
1717 (function( window, undefined ) {
1818
1919 // Use the correct document accordingly with window argument (sandbox)
20 -var document = window.document;
 20+var document = window.document,
 21+ navigator = window.navigator,
 22+ location = window.location;
2123 var jQuery = (function() {
2224
2325 // Define a local copy of jQuery
2426 var jQuery = function( selector, context ) {
2527 // The jQuery object is actually just the init constructor 'enhanced'
26 - return new jQuery.fn.init( selector, context );
 28+ return new jQuery.fn.init( selector, context, rootjQuery );
2729 },
2830
2931 // Map over jQuery in case of overwrite
@@ -36,22 +38,15 @@
3739
3840 // A simple way to check for HTML strings or ID strings
3941 // (both of which we optimize for)
40 - quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
 42+ quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
4143
42 - // Is it a simple selector
43 - isSimple = /^.[^:#\[\.,]*$/,
44 -
4544 // Check if a string has a non-whitespace character in it
4645 rnotwhite = /\S/,
47 - rwhite = /\s/,
4846
4947 // Used for trimming whitespace
5048 trimLeft = /^\s+/,
5149 trimRight = /\s+$/,
5250
53 - // Check for non-word characters
54 - rnonword = /\W/,
55 -
5651 // Check for digits
5752 rdigit = /\d/,
5853
@@ -70,18 +65,23 @@
7166 rmsie = /(msie) ([\w.]+)/,
7267 rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
7368
 69+ // Matches dashed string for camelizing
 70+ rdashAlpha = /-([a-z])/ig,
 71+
 72+ // Used by jQuery.camelCase as callback to replace()
 73+ fcamelCase = function( all, letter ) {
 74+ return letter.toUpperCase();
 75+ },
 76+
7477 // Keep a UserAgent string for use with jQuery.browser
7578 userAgent = navigator.userAgent,
7679
7780 // For matching the engine and version of the browser
7881 browserMatch,
79 -
80 - // Has the ready events already been bound?
81 - readyBound = false,
82 -
83 - // The functions to execute on DOM ready
84 - readyList = [],
8582
 83+ // The deferred used on DOM ready
 84+ readyList,
 85+
8686 // The ready event handler
8787 DOMContentLoaded,
8888
@@ -92,12 +92,13 @@
9393 slice = Array.prototype.slice,
9494 trim = String.prototype.trim,
9595 indexOf = Array.prototype.indexOf,
96 -
 96+
9797 // [[Class]] -> type pairs
9898 class2type = {};
9999
100100 jQuery.fn = jQuery.prototype = {
101 - init: function( selector, context ) {
 101+ constructor: jQuery,
 102+ init: function( selector, context, rootjQuery ) {
102103 var match, elem, ret, doc;
103104
104105 // Handle $(""), $(null), or $(undefined)
@@ -111,12 +112,12 @@
112113 this.length = 1;
113114 return this;
114115 }
115 -
 116+
116117 // The body element only exists once, optimize finding it
117118 if ( selector === "body" && !context && document.body ) {
118119 this.context = document;
119120 this[0] = document.body;
120 - this.selector = "body";
 121+ this.selector = selector;
121122 this.length = 1;
122123 return this;
123124 }
@@ -124,13 +125,20 @@
125126 // Handle HTML strings
126127 if ( typeof selector === "string" ) {
127128 // Are we dealing with HTML string or an ID?
128 - match = quickExpr.exec( selector );
 129+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
 130+ // Assume that strings that start and end with <> are HTML and skip the regex check
 131+ match = [ null, selector, null ];
129132
 133+ } else {
 134+ match = quickExpr.exec( selector );
 135+ }
 136+
130137 // Verify a match, and that no context was specified for #id
131138 if ( match && (match[1] || !context) ) {
132139
133140 // HANDLE: $(html) -> $(array)
134141 if ( match[1] ) {
 142+ context = context instanceof jQuery ? context[0] : context;
135143 doc = (context ? context.ownerDocument || context : document);
136144
137145 // If a single string is passed in and it's a single tag
@@ -148,11 +156,11 @@
149157
150158 } else {
151159 ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
152 - selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
 160+ selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
153161 }
154 -
 162+
155163 return jQuery.merge( this, selector );
156 -
 164+
157165 // HANDLE: $("#id")
158166 } else {
159167 elem = document.getElementById( match[2] );
@@ -176,13 +184,6 @@
177185 return this;
178186 }
179187
180 - // HANDLE: $("TAG")
181 - } else if ( !context && !rnonword.test( selector ) ) {
182 - this.selector = selector;
183 - this.context = document;
184 - selector = document.getElementsByTagName( selector );
185 - return jQuery.merge( this, selector );
186 -
187188 // HANDLE: $(expr, $(...))
188189 } else if ( !context || context.jquery ) {
189190 return (context || rootjQuery).find( selector );
@@ -190,7 +191,7 @@
191192 // HANDLE: $(expr, context)
192193 // (which is just equivalent to: $(context).find(expr)
193194 } else {
194 - return jQuery( context ).find( selector );
 195+ return this.constructor( context ).find( selector );
195196 }
196197
197198 // HANDLE: $(function)
@@ -211,7 +212,7 @@
212213 selector: "",
213214
214215 // The current version of jQuery being used
215 - jquery: "1.4.4",
 216+ jquery: "1.6.2",
216217
217218 // The default length of a jQuery object is 0
218219 length: 0,
@@ -234,18 +235,18 @@
235236 this.toArray() :
236237
237238 // Return just the object
238 - ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
 239+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
239240 },
240241
241242 // Take an array of elements and push it onto the stack
242243 // (returning the new matched element set)
243244 pushStack: function( elems, name, selector ) {
244245 // Build a new jQuery matched element set
245 - var ret = jQuery();
 246+ var ret = this.constructor();
246247
247248 if ( jQuery.isArray( elems ) ) {
248249 push.apply( ret, elems );
249 -
 250+
250251 } else {
251252 jQuery.merge( ret, elems );
252253 }
@@ -271,25 +272,17 @@
272273 each: function( callback, args ) {
273274 return jQuery.each( this, callback, args );
274275 },
275 -
 276+
276277 ready: function( fn ) {
277278 // Attach the listeners
278279 jQuery.bindReady();
279280
280 - // If the DOM is already ready
281 - if ( jQuery.isReady ) {
282 - // Execute the function immediately
283 - fn.call( document, jQuery );
 281+ // Add the callback
 282+ readyList.done( fn );
284283
285 - // Otherwise, remember the function for later
286 - } else if ( readyList ) {
287 - // Add the function to the wait list
288 - readyList.push( fn );
289 - }
290 -
291284 return this;
292285 },
293 -
 286+
294287 eq: function( i ) {
295288 return i === -1 ?
296289 this.slice( i ) :
@@ -314,9 +307,9 @@
315308 return callback.call( elem, i, elem );
316309 }));
317310 },
318 -
 311+
319312 end: function() {
320 - return this.prevObject || jQuery(null);
 313+ return this.prevObject || this.constructor(null);
321314 },
322315
323316 // For internal use only.
@@ -330,7 +323,7 @@
331324 jQuery.fn.init.prototype = jQuery.fn;
332325
333326 jQuery.extend = jQuery.fn.extend = function() {
334 - var options, name, src, copy, copyIsArray, clone,
 327+ var options, name, src, copy, copyIsArray, clone,
335328 target = arguments[0] || {},
336329 i = 1,
337330 length = arguments.length,
@@ -395,31 +388,37 @@
396389
397390 jQuery.extend({
398391 noConflict: function( deep ) {
399 - window.$ = _$;
 392+ if ( window.$ === jQuery ) {
 393+ window.$ = _$;
 394+ }
400395
401 - if ( deep ) {
 396+ if ( deep && window.jQuery === jQuery ) {
402397 window.jQuery = _jQuery;
403398 }
404399
405400 return jQuery;
406401 },
407 -
 402+
408403 // Is the DOM ready to be used? Set to true once it occurs.
409404 isReady: false,
410405
411406 // A counter to track how many items to wait for before
412407 // the ready event fires. See #6781
413408 readyWait: 1,
414 -
 409+
 410+ // Hold (or release) the ready event
 411+ holdReady: function( hold ) {
 412+ if ( hold ) {
 413+ jQuery.readyWait++;
 414+ } else {
 415+ jQuery.ready( true );
 416+ }
 417+ },
 418+
415419 // Handle when the DOM is ready
416420 ready: function( wait ) {
417 - // A third-party is pushing the ready event forwards
418 - if ( wait === true ) {
419 - jQuery.readyWait--;
420 - }
421 -
422 - // Make sure that the DOM is not already loaded
423 - if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
 421+ // Either a released hold or an DOMready/load event and not yet ready
 422+ if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
424423 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
425424 if ( !document.body ) {
426425 return setTimeout( jQuery.ready, 1 );
@@ -434,33 +433,21 @@
435434 }
436435
437436 // If there are functions bound, to execute
438 - if ( readyList ) {
439 - // Execute all of them
440 - var fn,
441 - i = 0,
442 - ready = readyList;
 437+ readyList.resolveWith( document, [ jQuery ] );
443438
444 - // Reset the list of functions
445 - readyList = null;
446 -
447 - while ( (fn = ready[ i++ ]) ) {
448 - fn.call( document, jQuery );
449 - }
450 -
451 - // Trigger any bound ready events
452 - if ( jQuery.fn.trigger ) {
453 - jQuery( document ).trigger( "ready" ).unbind( "ready" );
454 - }
 439+ // Trigger any bound ready events
 440+ if ( jQuery.fn.trigger ) {
 441+ jQuery( document ).trigger( "ready" ).unbind( "ready" );
455442 }
456443 }
457444 },
458 -
 445+
459446 bindReady: function() {
460 - if ( readyBound ) {
 447+ if ( readyList ) {
461448 return;
462449 }
463450
464 - readyBound = true;
 451+ readyList = jQuery._Deferred();
465452
466453 // Catch cases where $(document).ready() is called after the
467454 // browser event has already occurred.
@@ -473,7 +460,7 @@
474461 if ( document.addEventListener ) {
475462 // Use the handy event callback
476463 document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
477 -
 464+
478465 // A fallback to window.onload, that will always work
479466 window.addEventListener( "load", jQuery.ready, false );
480467
@@ -481,8 +468,8 @@
482469 } else if ( document.attachEvent ) {
483470 // ensure firing before onload,
484471 // maybe late but safe also for iframes
485 - document.attachEvent("onreadystatechange", DOMContentLoaded);
486 -
 472+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
 473+
487474 // A fallback to window.onload, that will always work
488475 window.attachEvent( "onload", jQuery.ready );
489476
@@ -533,20 +520,20 @@
534521 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
535522 return false;
536523 }
537 -
 524+
538525 // Not own constructor property must be Object
539526 if ( obj.constructor &&
540527 !hasOwn.call(obj, "constructor") &&
541528 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
542529 return false;
543530 }
544 -
 531+
545532 // Own properties are enumerated firstly, so to speed up,
546533 // if last one is own, then all properties are own.
547 -
 534+
548535 var key;
549536 for ( key in obj ) {}
550 -
 537+
551538 return key === undefined || hasOwn.call( obj, key );
552539 },
553540
@@ -556,11 +543,11 @@
557544 }
558545 return true;
559546 },
560 -
 547+
561548 error: function( msg ) {
562549 throw msg;
563550 },
564 -
 551+
565552 parseJSON: function( data ) {
566553 if ( typeof data !== "string" || !data ) {
567554 return null;
@@ -568,48 +555,68 @@
569556
570557 // Make sure leading/trailing whitespace is removed (IE can't handle it)
571558 data = jQuery.trim( data );
572 -
 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+
573565 // Make sure the incoming data is actual JSON
574566 // Logic borrowed from http://json.org/json2.js
575 - if ( rvalidchars.test(data.replace(rvalidescape, "@")
576 - .replace(rvalidtokens, "]")
577 - .replace(rvalidbraces, "")) ) {
 567+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
 568+ .replace( rvalidtokens, "]" )
 569+ .replace( rvalidbraces, "")) ) {
578570
579 - // Try to use the native JSON parser first
580 - return window.JSON && window.JSON.parse ?
581 - window.JSON.parse( data ) :
582 - (new Function("return " + data))();
 571+ return (new Function( "return " + data ))();
583572
584 - } else {
585 - jQuery.error( "Invalid JSON: " + data );
586573 }
 574+ jQuery.error( "Invalid JSON: " + data );
587575 },
588576
589 - noop: function() {},
 577+ // Cross-browser xml parsing
 578+ // (xml & tmp used internally)
 579+ parseXML: function( data , xml , tmp ) {
590580
591 - // Evalulates a script in a global context
592 - globalEval: function( data ) {
593 - if ( data && rnotwhite.test(data) ) {
594 - // Inspired by code by Andrea Giammarchi
595 - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
596 - var head = document.getElementsByTagName("head")[0] || document.documentElement,
597 - script = document.createElement("script");
 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+ }
598589
599 - script.type = "text/javascript";
 590+ tmp = xml.documentElement;
600591
601 - if ( jQuery.support.scriptEval ) {
602 - script.appendChild( document.createTextNode( data ) );
603 - } else {
604 - script.text = data;
605 - }
 592+ if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
 593+ jQuery.error( "Invalid XML: " + data );
 594+ }
606595
607 - // Use insertBefore instead of appendChild to circumvent an IE6 bug.
608 - // This arises when a base node is used (#2709).
609 - head.insertBefore( script, head.firstChild );
610 - head.removeChild( script );
 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 );
611612 }
612613 },
613614
 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+
614621 nodeName: function( elem, name ) {
615622 return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
616623 },
@@ -618,7 +625,7 @@
619626 each: function( object, callback, args ) {
620627 var name, i = 0,
621628 length = object.length,
622 - isObj = length === undefined || jQuery.isFunction(object);
 629+ isObj = length === undefined || jQuery.isFunction( object );
623630
624631 if ( args ) {
625632 if ( isObj ) {
@@ -644,8 +651,11 @@
645652 }
646653 }
647654 } else {
648 - for ( var value = object[0];
649 - i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
 655+ for ( ; i < length; ) {
 656+ if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
 657+ break;
 658+ }
 659+ }
650660 }
651661 }
652662
@@ -676,7 +686,7 @@
677687 // The extra typeof function check is to prevent crashes
678688 // in Safari 2 (See: #3039)
679689 // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
680 - var type = jQuery.type(array);
 690+ var type = jQuery.type( array );
681691
682692 if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
683693 push.call( ret, array );
@@ -689,8 +699,9 @@
690700 },
691701
692702 inArray: function( elem, array ) {
693 - if ( array.indexOf ) {
694 - return array.indexOf( elem );
 703+
 704+ if ( indexOf ) {
 705+ return indexOf.call( array, elem );
695706 }
696707
697708 for ( var i = 0, length = array.length; i < length; i++ ) {
@@ -710,7 +721,7 @@
711722 for ( var l = second.length; j < l; j++ ) {
712723 first[ i++ ] = second[ j ];
713724 }
714 -
 725+
715726 } else {
716727 while ( second[j] !== undefined ) {
717728 first[ i++ ] = second[ j++ ];
@@ -740,57 +751,72 @@
741752
742753 // arg is for internal usage only
743754 map: function( elems, callback, arg ) {
744 - var ret = [], value;
 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 ) ) ;
745760
746761 // Go through the array, translating each of the items to their
747 - // new value (or values).
748 - for ( var i = 0, length = elems.length; i < length; i++ ) {
749 - value = callback( elems[ i ], i, arg );
 762+ if ( isArray ) {
 763+ for ( ; i < length; i++ ) {
 764+ value = callback( elems[ i ], i, arg );
750765
751 - if ( value != null ) {
752 - ret[ ret.length ] = value;
 766+ if ( value != null ) {
 767+ ret[ ret.length ] = value;
 768+ }
753769 }
 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+ }
754780 }
755781
 782+ // Flatten any nested arrays
756783 return ret.concat.apply( [], ret );
757784 },
758785
759786 // A global GUID counter for objects
760787 guid: 1,
761788
762 - proxy: function( fn, proxy, thisObject ) {
763 - if ( arguments.length === 2 ) {
764 - if ( typeof proxy === "string" ) {
765 - thisObject = fn;
766 - fn = thisObject[ proxy ];
767 - proxy = undefined;
 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+ }
768797
769 - } else if ( proxy && !jQuery.isFunction( proxy ) ) {
770 - thisObject = proxy;
771 - proxy = undefined;
772 - }
 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;
773802 }
774803
775 - if ( !proxy && fn ) {
 804+ // Simulated bind
 805+ var args = slice.call( arguments, 2 ),
776806 proxy = function() {
777 - return fn.apply( thisObject || this, arguments );
 807+ return fn.apply( context, args.concat( slice.call( arguments ) ) );
778808 };
779 - }
780809
781810 // Set the guid of unique handler to the same of original handler, so it can be removed
782 - if ( fn ) {
783 - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
784 - }
 811+ proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
785812
786 - // So proxy can be declared as an argument
787813 return proxy;
788814 },
789815
790816 // Mutifunctional method to get and set values to a collection
791 - // The value/s can be optionally by executed if its a function
 817+ // The value/s can optionally be executed if it's a function
792818 access: function( elems, key, value, exec, fn, pass ) {
793819 var length = elems.length;
794 -
 820+
795821 // Setting many attributes
796822 if ( typeof key === "object" ) {
797823 for ( var k in key ) {
@@ -798,19 +824,19 @@
799825 }
800826 return elems;
801827 }
802 -
 828+
803829 // Setting one attribute
804830 if ( value !== undefined ) {
805831 // Optionally, function values get executed if exec is true
806832 exec = !pass && exec && jQuery.isFunction(value);
807 -
 833+
808834 for ( var i = 0; i < length; i++ ) {
809835 fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
810836 }
811 -
 837+
812838 return elems;
813839 }
814 -
 840+
815841 // Getting an attribute
816842 return length ? fn( elems[0], key ) : undefined;
817843 },
@@ -833,6 +859,27 @@
834860 return { browser: match[1] || "", version: match[2] || "0" };
835861 },
836862
 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+
837884 browser: {}
838885 });
839886
@@ -852,15 +899,8 @@
853900 jQuery.browser.safari = true;
854901 }
855902
856 -if ( indexOf ) {
857 - jQuery.inArray = function( elem, array ) {
858 - return indexOf.call( array, elem );
859 - };
860 -}
861 -
862 -// Verify that \s matches non-breaking spaces
863 -// (IE fails on this test)
864 -if ( !rwhite.test( "\xA0" ) ) {
 903+// IE doesn't match non-breaking spaces with \s
 904+if ( rnotwhite.test( "\xA0" ) ) {
865905 trimLeft = /^[\s\xA0]+/;
866906 trimRight = /[\s\xA0]+$/;
867907 }
@@ -904,53 +944,267 @@
905945 jQuery.ready();
906946 }
907947
908 -// Expose jQuery to the global object
909 -return (window.jQuery = window.$ = jQuery);
 948+return jQuery;
910949
911950 })();
912951
913952
914 -(function() {
 953+var // Promise methods
 954+ promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
 955+ // Static reference to slice
 956+ sliceDeferred = [].slice;
915957
916 - jQuery.support = {};
 958+jQuery.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 = {
917971
918 - var root = document.documentElement,
919 - script = document.createElement("script"),
920 - div = document.createElement("div"),
921 - id = "script" + jQuery.now();
 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+ },
9221000
923 - div.style.display = "none";
924 - div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
 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+ },
9251019
926 - var all = div.getElementsByTagName("*"),
927 - a = div.getElementsByTagName("a")[0],
928 - select = document.createElement("select"),
929 - opt = select.appendChild( document.createElement("option") );
 1020+ // resolve with this as context and given arguments
 1021+ resolve: function() {
 1022+ deferred.resolveWith( this, arguments );
 1023+ return this;
 1024+ },
9301025
 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+
 1151+jQuery.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+
9311180 // Can't get basic test support
9321181 if ( !all || !all.length || !a ) {
933 - return;
 1182+ return {};
9341183 }
9351184
936 - jQuery.support = {
 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 = {
9371191 // IE strips leading whitespace when .innerHTML is used
938 - leadingWhitespace: div.firstChild.nodeType === 3,
 1192+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
9391193
9401194 // Make sure that tbody elements aren't automatically inserted
9411195 // IE will insert them into empty tables
942 - tbody: !div.getElementsByTagName("tbody").length,
 1196+ tbody: !div.getElementsByTagName( "tbody" ).length,
9431197
9441198 // Make sure that link elements get serialized correctly by innerHTML
9451199 // This requires a wrapper element in IE
946 - htmlSerialize: !!div.getElementsByTagName("link").length,
 1200+ htmlSerialize: !!div.getElementsByTagName( "link" ).length,
9471201
9481202 // Get the style information from getAttribute
949 - // (IE uses .cssText insted)
950 - style: /red/.test( a.getAttribute("style") ),
 1203+ // (IE uses .cssText instead)
 1204+ style: /top/.test( a.getAttribute("style") ),
9511205
9521206 // Make sure that URLs aren't manipulated
9531207 // (IE normalizes it by default)
954 - hrefNormalized: a.getAttribute("href") === "/a",
 1208+ hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
9551209
9561210 // Make sure that element opacity exists
9571211 // (IE uses filter instead)
@@ -964,159 +1218,203 @@
9651219 // Make sure that if no value is specified for a checkbox
9661220 // that it defaults to "on".
9671221 // (WebKit defaults to "" instead)
968 - checkOn: div.getElementsByTagName("input")[0].value === "on",
 1222+ checkOn: ( input.value === "on" ),
9691223
9701224 // Make sure that a selected-by-default option has a working selected property.
9711225 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
9721226 optSelected: opt.selected,
9731227
 1228+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
 1229+ getSetAttribute: div.className !== "t",
 1230+
9741231 // Will be defined later
 1232+ submitBubbles: true,
 1233+ changeBubbles: true,
 1234+ focusinBubbles: false,
9751235 deleteExpando: true,
976 - optDisabled: false,
977 - checkClone: false,
978 - scriptEval: false,
9791236 noCloneEvent: true,
980 - boxModel: null,
9811237 inlineBlockNeedsLayout: false,
9821238 shrinkWrapBlocks: false,
983 - reliableHiddenOffsets: true
 1239+ reliableMarginRight: true
9841240 };
9851241
 1242+ // Make sure checked status is properly cloned
 1243+ input.checked = true;
 1244+ support.noCloneChecked = input.cloneNode( true ).checked;
 1245+
9861246 // Make sure that the options inside disabled selects aren't marked as disabled
987 - // (WebKit marks them as diabled)
 1247+ // (WebKit marks them as disabled)
9881248 select.disabled = true;
989 - jQuery.support.optDisabled = !opt.disabled;
 1249+ support.optDisabled = !opt.disabled;
9901250
991 - script.type = "text/javascript";
992 - try {
993 - script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
994 - } catch(e) {}
995 -
996 - root.insertBefore( script, root.firstChild );
997 -
998 - // Make sure that the execution of code works by injecting a script
999 - // tag with appendChild/createTextNode
1000 - // (IE doesn't support this, fails, and uses .text instead)
1001 - if ( window[ id ] ) {
1002 - jQuery.support.scriptEval = true;
1003 - delete window[ id ];
1004 - }
1005 -
10061251 // Test to see if it's possible to delete an expando from an element
10071252 // Fails in Internet Explorer
10081253 try {
1009 - delete script.test;
1010 -
1011 - } catch(e) {
1012 - jQuery.support.deleteExpando = false;
 1254+ delete div.test;
 1255+ } catch( e ) {
 1256+ support.deleteExpando = false;
10131257 }
10141258
1015 - root.removeChild( script );
1016 -
1017 - if ( div.attachEvent && div.fireEvent ) {
1018 - div.attachEvent("onclick", function click() {
 1259+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
 1260+ div.attachEvent( "onclick", function() {
10191261 // Cloning a node shouldn't copy over any
10201262 // bound event handlers (IE does this)
1021 - jQuery.support.noCloneEvent = false;
1022 - div.detachEvent("onclick", click);
 1263+ support.noCloneEvent = false;
10231264 });
1024 - div.cloneNode(true).fireEvent("onclick");
 1265+ div.cloneNode( true ).fireEvent( "onclick" );
10251266 }
10261267
1027 - div = document.createElement("div");
1028 - div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
 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";
10291274
1030 - var fragment = document.createDocumentFragment();
 1275+ input.setAttribute("checked", "checked");
 1276+ div.appendChild( input );
 1277+ fragment = document.createDocumentFragment();
10311278 fragment.appendChild( div.firstChild );
10321279
10331280 // WebKit doesn't clone checked state correctly in fragments
1034 - jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
 1281+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
10351282
 1283+ div.innerHTML = "";
 1284+
10361285 // Figure out if the W3C box model works as expected
1037 - // document.body must exist before we can do this
1038 - jQuery(function() {
1039 - var div = document.createElement("div");
1040 - div.style.width = div.style.paddingLeft = "1px";
 1286+ div.style.width = div.style.paddingLeft = "1px";
10411287
1042 - document.body.appendChild( div );
1043 - jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
 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 );
10441312
1045 - if ( "zoom" in div.style ) {
1046 - // Check if natively block-level elements act like inline-block
1047 - // elements when setting their display to 'inline' and giving
1048 - // them layout
1049 - // (IE < 8 does this)
1050 - div.style.display = "inline";
1051 - div.style.zoom = 1;
1052 - jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
 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;
10531316
1054 - // Check if elements with layout shrink-wrap their children
1055 - // (IE 6 does this)
1056 - div.style.display = "";
1057 - div.innerHTML = "<div style='width:4px;'></div>";
1058 - jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
1059 - }
 1317+ support.boxModel = div.offsetWidth === 2;
10601318
1061 - div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
1062 - var tds = div.getElementsByTagName("td");
 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 );
10631327
1064 - // Check if table cells still have offsetWidth/Height when they are set
1065 - // to display:none and there are still other visible table cells in a
1066 - // table row; if so, offsetWidth/Height are not reliable for use when
1067 - // determining if an element has been hidden directly using
1068 - // display:none (it is still safe to use offsets if a parent element is
1069 - // hidden; don safety goggles and see bug #4512 for more information).
1070 - // (only IE 8 fails this test)
1071 - jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
 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+ }
10721334
1073 - tds[0].style.display = "";
1074 - tds[1].style.display = "none";
 1335+ div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
 1336+ tds = div.getElementsByTagName( "td" );
10751337
1076 - // Check if empty table cells still have offsetWidth/Height
1077 - // (IE < 8 fail this test)
1078 - jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
1079 - div.innerHTML = "";
 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 );
10801346
1081 - document.body.removeChild( div ).style.display = "none";
1082 - div = tds = null;
1083 - });
 1347+ tds[ 0 ].style.display = "";
 1348+ tds[ 1 ].style.display = "none";
10841349
 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+
10851373 // Technique from Juriy Zaytsev
10861374 // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
1087 - var eventSupported = function( eventName ) {
1088 - var el = document.createElement("div");
1089 - eventName = "on" + eventName;
1090 -
1091 - var isSupported = (eventName in el);
1092 - if ( !isSupported ) {
1093 - el.setAttribute(eventName, "return;");
1094 - isSupported = typeof el[eventName] === "function";
 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;
10951392 }
1096 - el = null;
 1393+ }
10971394
1098 - return isSupported;
1099 - };
 1395+ // Null connected elements to avoid leaks in IE
 1396+ testElement = fragment = select = opt = body = marginDiv = div = input = null;
11001397
1101 - jQuery.support.submitBubbles = eventSupported("submit");
1102 - jQuery.support.changeBubbles = eventSupported("change");
1103 -
1104 - // release memory in IE
1105 - root = script = div = all = a = null;
 1398+ return support;
11061399 })();
11071400
 1401+// Keep track of boxModel
 1402+jQuery.boxModel = jQuery.support.boxModel;
11081403
11091404
1110 -var windowData = {},
1111 - rbrace = /^(?:\{.*\}|\[.*\])$/;
11121405
 1406+
 1407+var rbrace = /^(?:\{.*\}|\[.*\])$/,
 1408+ rmultiDash = /([a-z])([A-Z])/g;
 1409+
11131410 jQuery.extend({
11141411 cache: {},
11151412
11161413 // Please use with caution
11171414 uuid: 0,
11181415
1119 - // Unique for each copy of jQuery on the page
1120 - expando: "jQuery" + jQuery.now(),
 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, "" ),
11211419
11221420 // The following elements throw uncatchable exceptions if you
11231421 // attempt to add expando properties to them.
@@ -1127,103 +1425,188 @@
11281426 "applet": true
11291427 },
11301428
1131 - data: function( elem, name, data ) {
 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 */ ) {
11321436 if ( !jQuery.acceptData( elem ) ) {
11331437 return;
11341438 }
11351439
1136 - elem = elem == window ?
1137 - windowData :
1138 - elem;
 1440+ var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
11391441
1140 - var isNode = elem.nodeType,
1141 - id = isNode ? elem[ jQuery.expando ] : null,
1142 - cache = jQuery.cache, thisCache;
 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,
11431445
1144 - if ( isNode && !id && typeof name === "string" && data === undefined ) {
 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 ) {
11451457 return;
11461458 }
11471459
1148 - // Get the data from the object directly
1149 - if ( !isNode ) {
1150 - cache = elem;
 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+ } else {
 1466+ id = jQuery.expando;
 1467+ }
 1468+ }
11511469
1152 - // Compute a unique ID for the element
1153 - } else if ( !id ) {
1154 - elem[ jQuery.expando ] = id = ++jQuery.uuid;
 1470+ if ( !cache[ id ] ) {
 1471+ cache[ id ] = {};
 1472+
 1473+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
 1474+ // metadata on plain JS objects when the object is serialized using
 1475+ // JSON.stringify
 1476+ if ( !isNode ) {
 1477+ cache[ id ].toJSON = jQuery.noop;
 1478+ }
11551479 }
11561480
1157 - // Avoid generating a new cache unless none exists and we
1158 - // want to manipulate it.
1159 - if ( typeof name === "object" ) {
1160 - if ( isNode ) {
 1481+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
 1482+ // shallow copied over onto the existing cache
 1483+ if ( typeof name === "object" || typeof name === "function" ) {
 1484+ if ( pvt ) {
 1485+ cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
 1486+ } else {
11611487 cache[ id ] = jQuery.extend(cache[ id ], name);
 1488+ }
 1489+ }
11621490
1163 - } else {
1164 - jQuery.extend( cache, name );
 1491+ thisCache = cache[ id ];
 1492+
 1493+ // Internal jQuery data is stored in a separate object inside the object's data
 1494+ // cache in order to avoid key collisions between internal data and user-defined
 1495+ // data
 1496+ if ( pvt ) {
 1497+ if ( !thisCache[ internalKey ] ) {
 1498+ thisCache[ internalKey ] = {};
11651499 }
11661500
1167 - } else if ( isNode && !cache[ id ] ) {
1168 - cache[ id ] = {};
 1501+ thisCache = thisCache[ internalKey ];
11691502 }
11701503
1171 - thisCache = isNode ? cache[ id ] : cache;
1172 -
1173 - // Prevent overriding the named cache with undefined values
11741504 if ( data !== undefined ) {
1175 - thisCache[ name ] = data;
 1505+ thisCache[ jQuery.camelCase( name ) ] = data;
11761506 }
11771507
1178 - return typeof name === "string" ? thisCache[ name ] : thisCache;
 1508+ // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
 1509+ // not attempt to inspect the internal events object using jQuery.data, as this
 1510+ // internal data object is undocumented and subject to change.
 1511+ if ( name === "events" && !thisCache[name] ) {
 1512+ return thisCache[ internalKey ] && thisCache[ internalKey ].events;
 1513+ }
 1514+
 1515+ return getByName ?
 1516+ // Check for both converted-to-camel and non-converted data property names
 1517+ thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] :
 1518+ thisCache;
11791519 },
11801520
1181 - removeData: function( elem, name ) {
 1521+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
11821522 if ( !jQuery.acceptData( elem ) ) {
11831523 return;
11841524 }
11851525
1186 - elem = elem == window ?
1187 - windowData :
1188 - elem;
 1526+ var internalKey = jQuery.expando, isNode = elem.nodeType,
11891527
1190 - var isNode = elem.nodeType,
1191 - id = isNode ? elem[ jQuery.expando ] : elem,
1192 - cache = jQuery.cache,
1193 - thisCache = isNode ? cache[ id ] : id;
 1528+ // See jQuery.data for more information
 1529+ cache = isNode ? jQuery.cache : elem,
11941530
1195 - // If we want to remove a specific section of the element's data
 1531+ // See jQuery.data for more information
 1532+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
 1533+
 1534+ // If there is already no cache entry for this object, there is no
 1535+ // purpose in continuing
 1536+ if ( !cache[ id ] ) {
 1537+ return;
 1538+ }
 1539+
11961540 if ( name ) {
 1541+ var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
 1542+
11971543 if ( thisCache ) {
1198 - // Remove the section of cache data
11991544 delete thisCache[ name ];
12001545
1201 - // If we've removed all the data, remove the element's cache
1202 - if ( isNode && jQuery.isEmptyObject(thisCache) ) {
1203 - jQuery.removeData( elem );
 1546+ // If there is no data left in the cache, we want to continue
 1547+ // and let the cache object itself get destroyed
 1548+ if ( !isEmptyDataObject(thisCache) ) {
 1549+ return;
12041550 }
12051551 }
 1552+ }
12061553
1207 - // Otherwise, we want to remove all of the element's data
 1554+ // See jQuery.data for more information
 1555+ if ( pvt ) {
 1556+ delete cache[ id ][ internalKey ];
 1557+
 1558+ // Don't destroy the parent cache unless the internal data object
 1559+ // had been the only thing left in it
 1560+ if ( !isEmptyDataObject(cache[ id ]) ) {
 1561+ return;
 1562+ }
 1563+ }
 1564+
 1565+ var internalCache = cache[ id ][ internalKey ];
 1566+
 1567+ // Browsers that fail expando deletion also refuse to delete expandos on
 1568+ // the window, but it will allow it on all other JS objects; other browsers
 1569+ // don't care
 1570+ if ( jQuery.support.deleteExpando || cache != window ) {
 1571+ delete cache[ id ];
12081572 } else {
1209 - if ( isNode && jQuery.support.deleteExpando ) {
 1573+ cache[ id ] = null;
 1574+ }
 1575+
 1576+ // We destroyed the entire user cache at once because it's faster than
 1577+ // iterating through each key, but we need to continue to persist internal
 1578+ // data if it existed
 1579+ if ( internalCache ) {
 1580+ cache[ id ] = {};
 1581+ // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
 1582+ // metadata on plain JS objects when the object is serialized using
 1583+ // JSON.stringify
 1584+ if ( !isNode ) {
 1585+ cache[ id ].toJSON = jQuery.noop;
 1586+ }
 1587+
 1588+ cache[ id ][ internalKey ] = internalCache;
 1589+
 1590+ // Otherwise, we need to eliminate the expando on the node to avoid
 1591+ // false lookups in the cache for entries that no longer exist
 1592+ } else if ( isNode ) {
 1593+ // IE does not allow us to delete expando properties from nodes,
 1594+ // nor does it have a removeAttribute function on Document nodes;
 1595+ // we must handle all of these cases
 1596+ if ( jQuery.support.deleteExpando ) {
12101597 delete elem[ jQuery.expando ];
1211 -
12121598 } else if ( elem.removeAttribute ) {
12131599 elem.removeAttribute( jQuery.expando );
1214 -
1215 - // Completely remove the data cache
1216 - } else if ( isNode ) {
1217 - delete cache[ id ];
1218 -
1219 - // Remove all fields from the object
12201600 } else {
1221 - for ( var n in elem ) {
1222 - delete elem[ n ];
1223 - }
 1601+ elem[ jQuery.expando ] = null;
12241602 }
12251603 }
12261604 },
12271605
 1606+ // For internal use only.
 1607+ _data: function( elem, name, data ) {
 1608+ return jQuery.data( elem, name, data, true );
 1609+ },
 1610+
12281611 // A method for determining if a DOM node can handle the data expando
12291612 acceptData: function( elem ) {
12301613 if ( elem.nodeName ) {
@@ -1244,15 +1627,18 @@
12451628
12461629 if ( typeof key === "undefined" ) {
12471630 if ( this.length ) {
1248 - var attr = this[0].attributes, name;
12491631 data = jQuery.data( this[0] );
12501632
1251 - for ( var i = 0, l = attr.length; i < l; i++ ) {
1252 - name = attr[i].name;
 1633+ if ( this[0].nodeType === 1 ) {
 1634+ var attr = this[0].attributes, name;
 1635+ for ( var i = 0, l = attr.length; i < l; i++ ) {
 1636+ name = attr[i].name;
12531637
1254 - if ( name.indexOf( "data-" ) === 0 ) {
1255 - name = name.substr( 5 );
1256 - dataAttr( this[0], name, data[ name ] );
 1638+ if ( name.indexOf( "data-" ) === 0 ) {
 1639+ name = jQuery.camelCase( name.substring(5) );
 1640+
 1641+ dataAttr( this[0], name, data[ name ] );
 1642+ }
12571643 }
12581644 }
12591645 }
@@ -1304,8 +1690,10 @@
13051691 // If nothing was found internally, try to fetch any
13061692 // data from the HTML5 data-* attribute
13071693 if ( data === undefined && elem.nodeType === 1 ) {
1308 - data = elem.getAttribute( "data-" + key );
 1694+ var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
13091695
 1696+ data = elem.getAttribute( name );
 1697+
13101698 if ( typeof data === "string" ) {
13111699 try {
13121700 data = data === "true" ? true :
@@ -1327,38 +1715,92 @@
13281716 return data;
13291717 }
13301718
 1719+// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
 1720+// property to be considered empty objects; this property always exists in
 1721+// order to make sure JSON.stringify does not expose internal metadata
 1722+function isEmptyDataObject( obj ) {
 1723+ for ( var name in obj ) {
 1724+ if ( name !== "toJSON" ) {
 1725+ return false;
 1726+ }
 1727+ }
13311728
 1729+ return true;
 1730+}
13321731
13331732
1334 -jQuery.extend({
1335 - queue: function( elem, type, data ) {
1336 - if ( !elem ) {
1337 - return;
1338 - }
13391733
1340 - type = (type || "fx") + "queue";
1341 - var q = jQuery.data( elem, type );
13421734
1343 - // Speed up dequeue by getting out quickly if this is just a lookup
1344 - if ( !data ) {
1345 - return q || [];
1346 - }
 1735+function handleQueueMarkDefer( elem, type, src ) {
 1736+ var deferDataKey = type + "defer",
 1737+ queueDataKey = type + "queue",
 1738+ markDataKey = type + "mark",
 1739+ defer = jQuery.data( elem, deferDataKey, undefined, true );
 1740+ if ( defer &&
 1741+ ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
 1742+ ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
 1743+ // Give room for hard-coded callbacks to fire first
 1744+ // and eventually mark/queue something else on the element
 1745+ setTimeout( function() {
 1746+ if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
 1747+ !jQuery.data( elem, markDataKey, undefined, true ) ) {
 1748+ jQuery.removeData( elem, deferDataKey, true );
 1749+ defer.resolve();
 1750+ }
 1751+ }, 0 );
 1752+ }
 1753+}
13471754
1348 - if ( !q || jQuery.isArray(data) ) {
1349 - q = jQuery.data( elem, type, jQuery.makeArray(data) );
 1755+jQuery.extend({
13501756
1351 - } else {
1352 - q.push( data );
 1757+ _mark: function( elem, type ) {
 1758+ if ( elem ) {
 1759+ type = (type || "fx") + "mark";
 1760+ jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
13531761 }
 1762+ },
13541763
1355 - return q;
 1764+ _unmark: function( force, elem, type ) {
 1765+ if ( force !== true ) {
 1766+ type = elem;
 1767+ elem = force;
 1768+ force = false;
 1769+ }
 1770+ if ( elem ) {
 1771+ type = type || "fx";
 1772+ var key = type + "mark",
 1773+ count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
 1774+ if ( count ) {
 1775+ jQuery.data( elem, key, count, true );
 1776+ } else {
 1777+ jQuery.removeData( elem, key, true );
 1778+ handleQueueMarkDefer( elem, type, "mark" );
 1779+ }
 1780+ }
13561781 },
13571782
 1783+ queue: function( elem, type, data ) {
 1784+ if ( elem ) {
 1785+ type = (type || "fx") + "queue";
 1786+ var q = jQuery.data( elem, type, undefined, true );
 1787+ // Speed up dequeue by getting out quickly if this is just a lookup
 1788+ if ( data ) {
 1789+ if ( !q || jQuery.isArray(data) ) {
 1790+ q = jQuery.data( elem, type, jQuery.makeArray(data), true );
 1791+ } else {
 1792+ q.push( data );
 1793+ }
 1794+ }
 1795+ return q || [];
 1796+ }
 1797+ },
 1798+
13581799 dequeue: function( elem, type ) {
13591800 type = type || "fx";
13601801
13611802 var queue = jQuery.queue( elem, type ),
1362 - fn = queue.shift();
 1803+ fn = queue.shift(),
 1804+ defer;
13631805
13641806 // If the fx queue is dequeued, always remove the progress sentinel
13651807 if ( fn === "inprogress" ) {
@@ -1376,6 +1818,11 @@
13771819 jQuery.dequeue(elem, type);
13781820 });
13791821 }
 1822+
 1823+ if ( !queue.length ) {
 1824+ jQuery.removeData( elem, type + "queue", true );
 1825+ handleQueueMarkDefer( elem, type, "queue" );
 1826+ }
13801827 }
13811828 });
13821829
@@ -1389,7 +1836,7 @@
13901837 if ( data === undefined ) {
13911838 return jQuery.queue( this[0], type );
13921839 }
1393 - return this.each(function( i ) {
 1840+ return this.each(function() {
13941841 var queue = jQuery.queue( this, type, data );
13951842
13961843 if ( type === "fx" && queue[0] !== "inprogress" ) {
@@ -1402,7 +1849,6 @@
14031850 jQuery.dequeue( this, type );
14041851 });
14051852 },
1406 -
14071853 // Based off of the plugin by Clint Helfers, with permission.
14081854 // http://blindsignals.com/index.php/2009/07/jquery-delay/
14091855 delay: function( time, type ) {
@@ -1416,76 +1862,109 @@
14171863 }, time );
14181864 });
14191865 },
1420 -
14211866 clearQueue: function( type ) {
14221867 return this.queue( type || "fx", [] );
 1868+ },
 1869+ // Get a promise resolved when queues of a certain type
 1870+ // are emptied (fx is the type by default)
 1871+ promise: function( type, object ) {
 1872+ if ( typeof type !== "string" ) {
 1873+ object = type;
 1874+ type = undefined;
 1875+ }
 1876+ type = type || "fx";
 1877+ var defer = jQuery.Deferred(),
 1878+ elements = this,
 1879+ i = elements.length,
 1880+ count = 1,
 1881+ deferDataKey = type + "defer",
 1882+ queueDataKey = type + "queue",
 1883+ markDataKey = type + "mark",
 1884+ tmp;
 1885+ function resolve() {
 1886+ if ( !( --count ) ) {
 1887+ defer.resolveWith( elements, [ elements ] );
 1888+ }
 1889+ }
 1890+ while( i-- ) {
 1891+ if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
 1892+ ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
 1893+ jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
 1894+ jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
 1895+ count++;
 1896+ tmp.done( resolve );
 1897+ }
 1898+ }
 1899+ resolve();
 1900+ return defer.promise();
14231901 }
14241902 });
14251903
14261904
14271905
14281906
1429 -var rclass = /[\n\t]/g,
1430 - rspaces = /\s+/,
 1907+var rclass = /[\n\t\r]/g,
 1908+ rspace = /\s+/,
14311909 rreturn = /\r/g,
1432 - rspecialurl = /^(?:href|src|style)$/,
14331910 rtype = /^(?:button|input)$/i,
14341911 rfocusable = /^(?:button|input|object|select|textarea)$/i,
14351912 rclickable = /^a(?:rea)?$/i,
1436 - rradiocheck = /^(?:radio|checkbox)$/i;
 1913+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
 1914+ rinvalidChar = /\:|^on/,
 1915+ formHook, boolHook;
14371916
1438 -jQuery.props = {
1439 - "for": "htmlFor",
1440 - "class": "className",
1441 - readonly: "readOnly",
1442 - maxlength: "maxLength",
1443 - cellspacing: "cellSpacing",
1444 - rowspan: "rowSpan",
1445 - colspan: "colSpan",
1446 - tabindex: "tabIndex",
1447 - usemap: "useMap",
1448 - frameborder: "frameBorder"
1449 -};
1450 -
14511917 jQuery.fn.extend({
14521918 attr: function( name, value ) {
14531919 return jQuery.access( this, name, value, true, jQuery.attr );
14541920 },
14551921
1456 - removeAttr: function( name, fn ) {
1457 - return this.each(function(){
1458 - jQuery.attr( this, name, "" );
1459 - if ( this.nodeType === 1 ) {
1460 - this.removeAttribute( name );
1461 - }
 1922+ removeAttr: function( name ) {
 1923+ return this.each(function() {
 1924+ jQuery.removeAttr( this, name );
14621925 });
14631926 },
 1927+
 1928+ prop: function( name, value ) {
 1929+ return jQuery.access( this, name, value, true, jQuery.prop );
 1930+ },
 1931+
 1932+ removeProp: function( name ) {
 1933+ name = jQuery.propFix[ name ] || name;
 1934+ return this.each(function() {
 1935+ // try/catch handles cases where IE balks (such as removing a property on window)
 1936+ try {
 1937+ this[ name ] = undefined;
 1938+ delete this[ name ];
 1939+ } catch( e ) {}
 1940+ });
 1941+ },
14641942
14651943 addClass: function( value ) {
1466 - if ( jQuery.isFunction(value) ) {
1467 - return this.each(function(i) {
1468 - var self = jQuery(this);
1469 - self.addClass( value.call(this, i, self.attr("class")) );
 1944+ var classNames, i, l, elem,
 1945+ setClass, c, cl;
 1946+
 1947+ if ( jQuery.isFunction( value ) ) {
 1948+ return this.each(function( j ) {
 1949+ jQuery( this ).addClass( value.call(this, j, this.className) );
14701950 });
14711951 }
14721952
14731953 if ( value && typeof value === "string" ) {
1474 - var classNames = (value || "").split( rspaces );
 1954+ classNames = value.split( rspace );
14751955
1476 - for ( var i = 0, l = this.length; i < l; i++ ) {
1477 - var elem = this[i];
 1956+ for ( i = 0, l = this.length; i < l; i++ ) {
 1957+ elem = this[ i ];
14781958
14791959 if ( elem.nodeType === 1 ) {
1480 - if ( !elem.className ) {
 1960+ if ( !elem.className && classNames.length === 1 ) {
14811961 elem.className = value;
14821962
14831963 } else {
1484 - var className = " " + elem.className + " ",
1485 - setClass = elem.className;
 1964+ setClass = " " + elem.className + " ";
14861965
1487 - for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1488 - if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
1489 - setClass += " " + classNames[c];
 1966+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
 1967+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
 1968+ setClass += classNames[ c ] + " ";
14901969 }
14911970 }
14921971 elem.className = jQuery.trim( setClass );
@@ -1498,24 +1977,25 @@
14991978 },
15001979
15011980 removeClass: function( value ) {
1502 - if ( jQuery.isFunction(value) ) {
1503 - return this.each(function(i) {
1504 - var self = jQuery(this);
1505 - self.removeClass( value.call(this, i, self.attr("class")) );
 1981+ var classNames, i, l, elem, className, c, cl;
 1982+
 1983+ if ( jQuery.isFunction( value ) ) {
 1984+ return this.each(function( j ) {
 1985+ jQuery( this ).removeClass( value.call(this, j, this.className) );
15061986 });
15071987 }
15081988
15091989 if ( (value && typeof value === "string") || value === undefined ) {
1510 - var classNames = (value || "").split( rspaces );
 1990+ classNames = (value || "").split( rspace );
15111991
1512 - for ( var i = 0, l = this.length; i < l; i++ ) {
1513 - var elem = this[i];
 1992+ for ( i = 0, l = this.length; i < l; i++ ) {
 1993+ elem = this[ i ];
15141994
15151995 if ( elem.nodeType === 1 && elem.className ) {
15161996 if ( value ) {
1517 - var className = (" " + elem.className + " ").replace(rclass, " ");
1518 - for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
1519 - className = className.replace(" " + classNames[c] + " ", " ");
 1997+ className = (" " + elem.className + " ").replace( rclass, " " );
 1998+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
 1999+ className = className.replace(" " + classNames[ c ] + " ", " ");
15202000 }
15212001 elem.className = jQuery.trim( className );
15222002
@@ -1534,9 +2014,8 @@
15352015 isBool = typeof stateVal === "boolean";
15362016
15372017 if ( jQuery.isFunction( value ) ) {
1538 - return this.each(function(i) {
1539 - var self = jQuery(this);
1540 - self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
 2018+ return this.each(function( i ) {
 2019+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
15412020 });
15422021 }
15432022
@@ -1547,7 +2026,7 @@
15482027 i = 0,
15492028 self = jQuery( this ),
15502029 state = stateVal,
1551 - classNames = value.split( rspaces );
 2030+ classNames = value.split( rspace );
15522031
15532032 while ( (className = classNames[ i++ ]) ) {
15542033 // check each className given, space seperated list
@@ -1558,11 +2037,11 @@
15592038 } else if ( type === "undefined" || type === "boolean" ) {
15602039 if ( this.className ) {
15612040 // store className if set
1562 - jQuery.data( this, "__className__", this.className );
 2041+ jQuery._data( this, "__className__", this.className );
15632042 }
15642043
15652044 // toggle whole className
1566 - this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
 2045+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
15672046 }
15682047 });
15692048 },
@@ -1579,78 +2058,42 @@
15802059 },
15812060
15822061 val: function( value ) {
 2062+ var hooks, ret,
 2063+ elem = this[0];
 2064+
15832065 if ( !arguments.length ) {
1584 - var elem = this[0];
1585 -
15862066 if ( elem ) {
1587 - if ( jQuery.nodeName( elem, "option" ) ) {
1588 - // attributes.value is undefined in Blackberry 4.7 but
1589 - // uses .value. See #6932
1590 - var val = elem.attributes.value;
1591 - return !val || val.specified ? elem.value : elem.text;
1592 - }
 2067+ hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
15932068
1594 - // We need to handle select boxes special
1595 - if ( jQuery.nodeName( elem, "select" ) ) {
1596 - var index = elem.selectedIndex,
1597 - values = [],
1598 - options = elem.options,
1599 - one = elem.type === "select-one";
1600 -
1601 - // Nothing was selected
1602 - if ( index < 0 ) {
1603 - return null;
1604 - }
1605 -
1606 - // Loop through all the selected options
1607 - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
1608 - var option = options[ i ];
1609 -
1610 - // Don't return options that are disabled or in a disabled optgroup
1611 - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
1612 - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
1613 -
1614 - // Get the specific value for the option
1615 - value = jQuery(option).val();
1616 -
1617 - // We don't need an array for one selects
1618 - if ( one ) {
1619 - return value;
1620 - }
1621 -
1622 - // Multi-Selects return an array
1623 - values.push( value );
1624 - }
1625 - }
1626 -
1627 - return values;
 2069+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
 2070+ return ret;
16282071 }
16292072
1630 - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
1631 - if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
1632 - return elem.getAttribute("value") === null ? "on" : elem.value;
1633 - }
1634 -
 2073+ ret = elem.value;
16352074
1636 - // Everything else, we just grab the value
1637 - return (elem.value || "").replace(rreturn, "");
1638 -
 2075+ return typeof ret === "string" ?
 2076+ // handle most common string cases
 2077+ ret.replace(rreturn, "") :
 2078+ // handle cases where value is null/undef or number
 2079+ ret == null ? "" : ret;
16392080 }
16402081
16412082 return undefined;
16422083 }
16432084
1644 - var isFunction = jQuery.isFunction(value);
 2085+ var isFunction = jQuery.isFunction( value );
16452086
1646 - return this.each(function(i) {
1647 - var self = jQuery(this), val = value;
 2087+ return this.each(function( i ) {
 2088+ var self = jQuery(this), val;
16482089
16492090 if ( this.nodeType !== 1 ) {
16502091 return;
16512092 }
16522093
16532094 if ( isFunction ) {
1654 - val = value.call(this, i, self.val());
 2095+ val = value.call( this, i, self.val() );
 2096+ } else {
 2097+ val = value;
16552098 }
16562099
16572100 // Treat null/undefined as ""; convert numbers to string
@@ -1658,34 +2101,89 @@
16592102 val = "";
16602103 } else if ( typeof val === "number" ) {
16612104 val += "";
1662 - } else if ( jQuery.isArray(val) ) {
1663 - val = jQuery.map(val, function (value) {
 2105+ } else if ( jQuery.isArray( val ) ) {
 2106+ val = jQuery.map(val, function ( value ) {
16642107 return value == null ? "" : value + "";
16652108 });
16662109 }
16672110
1668 - if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
1669 - this.checked = jQuery.inArray( self.val(), val ) >= 0;
 2111+ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
16702112
1671 - } else if ( jQuery.nodeName( this, "select" ) ) {
1672 - var values = jQuery.makeArray(val);
 2113+ // If set returns undefined, fall back to normal setting
 2114+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
 2115+ this.value = val;
 2116+ }
 2117+ });
 2118+ }
 2119+});
16732120
1674 - jQuery( "option", this ).each(function() {
 2121+jQuery.extend({
 2122+ valHooks: {
 2123+ option: {
 2124+ get: function( elem ) {
 2125+ // attributes.value is undefined in Blackberry 4.7 but
 2126+ // uses .value. See #6932
 2127+ var val = elem.attributes.value;
 2128+ return !val || val.specified ? elem.value : elem.text;
 2129+ }
 2130+ },
 2131+ select: {
 2132+ get: function( elem ) {
 2133+ var value,
 2134+ index = elem.selectedIndex,
 2135+ values = [],
 2136+ options = elem.options,
 2137+ one = elem.type === "select-one";
 2138+
 2139+ // Nothing was selected
 2140+ if ( index < 0 ) {
 2141+ return null;
 2142+ }
 2143+
 2144+ // Loop through all the selected options
 2145+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
 2146+ var option = options[ i ];
 2147+
 2148+ // Don't return options that are disabled or in a disabled optgroup
 2149+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
 2150+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
 2151+
 2152+ // Get the specific value for the option
 2153+ value = jQuery( option ).val();
 2154+
 2155+ // We don't need an array for one selects
 2156+ if ( one ) {
 2157+ return value;
 2158+ }
 2159+
 2160+ // Multi-Selects return an array
 2161+ values.push( value );
 2162+ }
 2163+ }
 2164+
 2165+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
 2166+ if ( one && !values.length && options.length ) {
 2167+ return jQuery( options[ index ] ).val();
 2168+ }
 2169+
 2170+ return values;
 2171+ },
 2172+
 2173+ set: function( elem, value ) {
 2174+ var values = jQuery.makeArray( value );
 2175+
 2176+ jQuery(elem).find("option").each(function() {
16752177 this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
16762178 });
16772179
16782180 if ( !values.length ) {
1679 - this.selectedIndex = -1;
 2181+ elem.selectedIndex = -1;
16802182 }
1681 -
1682 - } else {
1683 - this.value = val;
 2183+ return values;
16842184 }
1685 - });
1686 - }
1687 -});
 2185+ }
 2186+ },
16882187
1689 -jQuery.extend({
16902188 attrFn: {
16912189 val: true,
16922190 css: true,
@@ -1696,107 +2194,340 @@
16972195 height: true,
16982196 offset: true
16992197 },
 2198+
 2199+ attrFix: {
 2200+ // Always normalize to ensure hook usage
 2201+ tabindex: "tabIndex"
 2202+ },
 2203+
 2204+ attr: function( elem, name, value, pass ) {
 2205+ var nType = elem.nodeType;
17002206
1701 - attr: function( elem, name, value, pass ) {
1702 - // don't set attributes on text and comment nodes
1703 - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
 2207+ // don't get/set attributes on text, comment and attribute nodes
 2208+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
17042209 return undefined;
17052210 }
17062211
17072212 if ( pass && name in jQuery.attrFn ) {
1708 - return jQuery(elem)[name](value);
 2213+ return jQuery( elem )[ name ]( value );
17092214 }
17102215
1711 - var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
1712 - // Whether we are setting (or getting)
1713 - set = value !== undefined;
 2216+ // Fallback to prop when attributes are not supported
 2217+ if ( !("getAttribute" in elem) ) {
 2218+ return jQuery.prop( elem, name, value );
 2219+ }
17142220
1715 - // Try to normalize/fix the name
1716 - name = notxml && jQuery.props[ name ] || name;
 2221+ var ret, hooks,
 2222+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
17172223
1718 - // These attributes require special treatment
1719 - var special = rspecialurl.test( name );
 2224+ // Normalize the name if needed
 2225+ if ( notxml ) {
 2226+ name = jQuery.attrFix[ name ] || name;
17202227
1721 - // Safari mis-reports the default selected property of an option
1722 - // Accessing the parent's selectedIndex property fixes it
1723 - if ( name === "selected" && !jQuery.support.optSelected ) {
1724 - var parent = elem.parentNode;
1725 - if ( parent ) {
1726 - parent.selectedIndex;
 2228+ hooks = jQuery.attrHooks[ name ];
17272229
1728 - // Make sure that it also works with optgroups, see #5701
1729 - if ( parent.parentNode ) {
1730 - parent.parentNode.selectedIndex;
 2230+ if ( !hooks ) {
 2231+ // Use boolHook for boolean attributes
 2232+ if ( rboolean.test( name ) ) {
 2233+
 2234+ hooks = boolHook;
 2235+
 2236+ // Use formHook for forms and if the name contains certain characters
 2237+ } else if ( formHook && name !== "className" &&
 2238+ (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
 2239+
 2240+ hooks = formHook;
17312241 }
17322242 }
17332243 }
17342244
1735 - // If applicable, access the attribute via the DOM 0 way
1736 - // 'in' checks fail in Blackberry 4.7 #6931
1737 - if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
1738 - if ( set ) {
1739 - // We can't allow the type property to be changed (since it causes problems in IE)
1740 - if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
1741 - jQuery.error( "type property can't be changed" );
1742 - }
 2245+ if ( value !== undefined ) {
17432246
1744 - if ( value === null ) {
1745 - if ( elem.nodeType === 1 ) {
1746 - elem.removeAttribute( name );
1747 - }
 2247+ if ( value === null ) {
 2248+ jQuery.removeAttr( elem, name );
 2249+ return undefined;
17482250
1749 - } else {
1750 - elem[ name ] = value;
1751 - }
 2251+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
 2252+ return ret;
 2253+
 2254+ } else {
 2255+ elem.setAttribute( name, "" + value );
 2256+ return value;
17522257 }
17532258
1754 - // browsers index elements by id/name on forms, give priority to attributes.
1755 - if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
1756 - return elem.getAttributeNode( name ).nodeValue;
 2259+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
 2260+ return ret;
 2261+
 2262+ } else {
 2263+
 2264+ ret = elem.getAttribute( name );
 2265+
 2266+ // Non-existent attributes return null, we normalize to undefined
 2267+ return ret === null ?
 2268+ undefined :
 2269+ ret;
 2270+ }
 2271+ },
 2272+
 2273+ removeAttr: function( elem, name ) {
 2274+ var propName;
 2275+ if ( elem.nodeType === 1 ) {
 2276+ name = jQuery.attrFix[ name ] || name;
 2277+
 2278+ if ( jQuery.support.getSetAttribute ) {
 2279+ // Use removeAttribute in browsers that support it
 2280+ elem.removeAttribute( name );
 2281+ } else {
 2282+ jQuery.attr( elem, name, "" );
 2283+ elem.removeAttributeNode( elem.getAttributeNode( name ) );
17572284 }
17582285
1759 - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
1760 - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
1761 - if ( name === "tabIndex" ) {
1762 - var attributeNode = elem.getAttributeNode( "tabIndex" );
 2286+ // Set corresponding property to false for boolean attributes
 2287+ if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
 2288+ elem[ propName ] = false;
 2289+ }
 2290+ }
 2291+ },
17632292
 2293+ attrHooks: {
 2294+ type: {
 2295+ set: function( elem, value ) {
 2296+ // We can't allow the type property to be changed (since it causes problems in IE)
 2297+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
 2298+ jQuery.error( "type property can't be changed" );
 2299+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
 2300+ // Setting the type on a radio button after the value resets the value in IE6-9
 2301+ // Reset value to it's default in case type is set after value
 2302+ // This is for element creation
 2303+ var val = elem.value;
 2304+ elem.setAttribute( "type", value );
 2305+ if ( val ) {
 2306+ elem.value = val;
 2307+ }
 2308+ return value;
 2309+ }
 2310+ }
 2311+ },
 2312+ tabIndex: {
 2313+ get: function( elem ) {
 2314+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
 2315+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
 2316+ var attributeNode = elem.getAttributeNode("tabIndex");
 2317+
17642318 return attributeNode && attributeNode.specified ?
1765 - attributeNode.value :
 2319+ parseInt( attributeNode.value, 10 ) :
17662320 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
17672321 0 :
17682322 undefined;
17692323 }
 2324+ },
 2325+ // Use the value property for back compat
 2326+ // Use the formHook for button elements in IE6/7 (#1954)
 2327+ value: {
 2328+ get: function( elem, name ) {
 2329+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
 2330+ return formHook.get( elem, name );
 2331+ }
 2332+ return name in elem ?
 2333+ elem.value :
 2334+ null;
 2335+ },
 2336+ set: function( elem, value, name ) {
 2337+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
 2338+ return formHook.set( elem, value, name );
 2339+ }
 2340+ // Does not return so that setAttribute is also used
 2341+ elem.value = value;
 2342+ }
 2343+ }
 2344+ },
17702345
1771 - return elem[ name ];
 2346+ propFix: {
 2347+ tabindex: "tabIndex",
 2348+ readonly: "readOnly",
 2349+ "for": "htmlFor",
 2350+ "class": "className",
 2351+ maxlength: "maxLength",
 2352+ cellspacing: "cellSpacing",
 2353+ cellpadding: "cellPadding",
 2354+ rowspan: "rowSpan",
 2355+ colspan: "colSpan",
 2356+ usemap: "useMap",
 2357+ frameborder: "frameBorder",
 2358+ contenteditable: "contentEditable"
 2359+ },
 2360+
 2361+ prop: function( elem, name, value ) {
 2362+ var nType = elem.nodeType;
 2363+
 2364+ // don't get/set properties on text, comment and attribute nodes
 2365+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
 2366+ return undefined;
17722367 }
17732368
1774 - if ( !jQuery.support.style && notxml && name === "style" ) {
1775 - if ( set ) {
1776 - elem.style.cssText = "" + value;
 2369+ var ret, hooks,
 2370+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
 2371+
 2372+ if ( notxml ) {
 2373+ // Fix name and attach hooks
 2374+ name = jQuery.propFix[ name ] || name;
 2375+ hooks = jQuery.propHooks[ name ];
 2376+ }
 2377+
 2378+ if ( value !== undefined ) {
 2379+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
 2380+ return ret;
 2381+
 2382+ } else {
 2383+ return (elem[ name ] = value);
17772384 }
17782385
1779 - return elem.style.cssText;
 2386+ } else {
 2387+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
 2388+ return ret;
 2389+
 2390+ } else {
 2391+ return elem[ name ];
 2392+ }
17802393 }
 2394+ },
 2395+
 2396+ propHooks: {}
 2397+});
17812398
1782 - if ( set ) {
1783 - // convert the value to a string (all browsers do this but IE) see #1070
1784 - elem.setAttribute( name, "" + value );
 2399+// Hook for boolean attributes
 2400+boolHook = {
 2401+ get: function( elem, name ) {
 2402+ // Align boolean attributes with corresponding properties
 2403+ return jQuery.prop( elem, name ) ?
 2404+ name.toLowerCase() :
 2405+ undefined;
 2406+ },
 2407+ set: function( elem, value, name ) {
 2408+ var propName;
 2409+ if ( value === false ) {
 2410+ // Remove boolean attributes when set to false
 2411+ jQuery.removeAttr( elem, name );
 2412+ } else {
 2413+ // value is true since we know at this point it's type boolean and not false
 2414+ // Set boolean attributes to the same name and set the DOM property
 2415+ propName = jQuery.propFix[ name ] || name;
 2416+ if ( propName in elem ) {
 2417+ // Only set the IDL specifically if it already exists on the element
 2418+ elem[ propName ] = true;
 2419+ }
 2420+
 2421+ elem.setAttribute( name, name.toLowerCase() );
17852422 }
 2423+ return name;
 2424+ }
 2425+};
17862426
1787 - // Ensure that missing attributes return undefined
1788 - // Blackberry 4.7 returns "" from getAttribute #6938
1789 - if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
1790 - return undefined;
 2427+// IE6/7 do not support getting/setting some attributes with get/setAttribute
 2428+if ( !jQuery.support.getSetAttribute ) {
 2429+
 2430+ // propFix is more comprehensive and contains all fixes
 2431+ jQuery.attrFix = jQuery.propFix;
 2432+
 2433+ // Use this for any attribute on a form in IE6/7
 2434+ formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = {
 2435+ get: function( elem, name ) {
 2436+ var ret;
 2437+ ret = elem.getAttributeNode( name );
 2438+ // Return undefined if nodeValue is empty string
 2439+ return ret && ret.nodeValue !== "" ?
 2440+ ret.nodeValue :
 2441+ undefined;
 2442+ },
 2443+ set: function( elem, value, name ) {
 2444+ // Check form objects in IE (multiple bugs related)
 2445+ // Only use nodeValue if the attribute node exists on the form
 2446+ var ret = elem.getAttributeNode( name );
 2447+ if ( ret ) {
 2448+ ret.nodeValue = value;
 2449+ return value;
 2450+ }
17912451 }
 2452+ };
17922453
1793 - var attr = !jQuery.support.hrefNormalized && notxml && special ?
1794 - // Some attributes require a special call on IE
1795 - elem.getAttribute( name, 2 ) :
1796 - elem.getAttribute( name );
 2454+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
 2455+ // This is for removals
 2456+ jQuery.each([ "width", "height" ], function( i, name ) {
 2457+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
 2458+ set: function( elem, value ) {
 2459+ if ( value === "" ) {
 2460+ elem.setAttribute( name, "auto" );
 2461+ return value;
 2462+ }
 2463+ }
 2464+ });
 2465+ });
 2466+}
17972467
1798 - // Non-existent attributes return null, we normalize to undefined
1799 - return attr === null ? undefined : attr;
1800 - }
 2468+
 2469+// Some attributes require a special call on IE
 2470+if ( !jQuery.support.hrefNormalized ) {
 2471+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
 2472+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
 2473+ get: function( elem ) {
 2474+ var ret = elem.getAttribute( name, 2 );
 2475+ return ret === null ? undefined : ret;
 2476+ }
 2477+ });
 2478+ });
 2479+}
 2480+
 2481+if ( !jQuery.support.style ) {
 2482+ jQuery.attrHooks.style = {
 2483+ get: function( elem ) {
 2484+ // Return undefined in the case of empty string
 2485+ // Normalize to lowercase since IE uppercases css property names
 2486+ return elem.style.cssText.toLowerCase() || undefined;
 2487+ },
 2488+ set: function( elem, value ) {
 2489+ return (elem.style.cssText = "" + value);
 2490+ }
 2491+ };
 2492+}
 2493+
 2494+// Safari mis-reports the default selected property of an option
 2495+// Accessing the parent's selectedIndex property fixes it
 2496+if ( !jQuery.support.optSelected ) {
 2497+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
 2498+ get: function( elem ) {
 2499+ var parent = elem.parentNode;
 2500+
 2501+ if ( parent ) {
 2502+ parent.selectedIndex;
 2503+
 2504+ // Make sure that it also works with optgroups, see #5701
 2505+ if ( parent.parentNode ) {
 2506+ parent.parentNode.selectedIndex;
 2507+ }
 2508+ }
 2509+ }
 2510+ });
 2511+}
 2512+
 2513+// Radios and checkboxes getter/setter
 2514+if ( !jQuery.support.checkOn ) {
 2515+ jQuery.each([ "radio", "checkbox" ], function() {
 2516+ jQuery.valHooks[ this ] = {
 2517+ get: function( elem ) {
 2518+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
 2519+ return elem.getAttribute("value") === null ? "on" : elem.value;
 2520+ }
 2521+ };
 2522+ });
 2523+}
 2524+jQuery.each([ "radio", "checkbox" ], function() {
 2525+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
 2526+ set: function( elem, value ) {
 2527+ if ( jQuery.isArray( value ) ) {
 2528+ return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
 2529+ }
 2530+ }
 2531+ });
18012532 });
18022533
18032534
@@ -1805,12 +2536,11 @@
18062537 var rnamespaces = /\.(.*)$/,
18072538 rformElems = /^(?:textarea|input|select)$/i,
18082539 rperiod = /\./g,
1809 - rspace = / /g,
 2540+ rspaces = / /g,
18102541 rescape = /[^\w\s.|`]/g,
18112542 fcleanup = function( nm ) {
18122543 return nm.replace(rescape, "\\$&");
1813 - },
1814 - focusCounts = { focusin: 0, focusout: 0 };
 2544+ };
18152545
18162546 /*
18172547 * A number of helper functions used for managing events.
@@ -1826,17 +2556,11 @@
18272557 return;
18282558 }
18292559
1830 - // For whatever reason, IE has trouble passing the window object
1831 - // around, causing it to be cloned in the process
1832 - if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
1833 - elem = window;
1834 - }
1835 -
18362560 if ( handler === false ) {
18372561 handler = returnFalse;
18382562 } else if ( !handler ) {
18392563 // Fixes bug #7229. Fix recommended by jdalton
1840 - return;
 2564+ return;
18412565 }
18422566
18432567 var handleObjIn, handleObj;
@@ -1852,7 +2576,7 @@
18532577 }
18542578
18552579 // Init the element's event structure
1856 - var elemData = jQuery.data( elem );
 2580+ var elemData = jQuery._data( elem );
18572581
18582582 // If no elemData is found then we must be trying to bind to one of the
18592583 // banned noData elements
@@ -1860,34 +2584,18 @@
18612585 return;
18622586 }
18632587
1864 - // Use a key less likely to result in collisions for plain JS objects.
1865 - // Fixes bug #7150.
1866 - var eventKey = elem.nodeType ? "events" : "__events__",
1867 - events = elemData[ eventKey ],
 2588+ var events = elemData.events,
18682589 eventHandle = elemData.handle;
1869 -
1870 - if ( typeof events === "function" ) {
1871 - // On plain objects events is a fn that holds the the data
1872 - // which prevents this data from being JSON serialized
1873 - // the function does not need to be called, it just contains the data
1874 - eventHandle = events.handle;
1875 - events = events.events;
18762590
1877 - } else if ( !events ) {
1878 - if ( !elem.nodeType ) {
1879 - // On plain objects, create a fn that acts as the holder
1880 - // of the values to avoid JSON serialization of event data
1881 - elemData[ eventKey ] = elemData = function(){};
1882 - }
1883 -
 2591+ if ( !events ) {
18842592 elemData.events = events = {};
18852593 }
18862594
18872595 if ( !eventHandle ) {
1888 - elemData.handle = eventHandle = function() {
1889 - // Handle the second event of a trigger and when
1890 - // an event is called after a page has unloaded
1891 - return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
 2596+ elemData.handle = eventHandle = function( e ) {
 2597+ // Discard the second event of a jQuery.event.trigger() and
 2598+ // when an event is called after a page has unloaded
 2599+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
18922600 jQuery.event.handle.apply( eventHandle.elem, arguments ) :
18932601 undefined;
18942602 };
@@ -1945,10 +2653,10 @@
19462654 }
19472655 }
19482656 }
1949 -
1950 - if ( special.add ) {
1951 - special.add.call( elem, handleObj );
19522657
 2658+ if ( special.add ) {
 2659+ special.add.call( elem, handleObj );
 2660+
19532661 if ( !handleObj.handler.guid ) {
19542662 handleObj.handler.guid = handler.guid;
19552663 }
@@ -1957,7 +2665,7 @@
19582666 // Add the function to the element's handler list
19592667 handlers.push( handleObj );
19602668
1961 - // Keep track of which events have been used, for global triggering
 2669+ // Keep track of which events have been used, for event optimization
19622670 jQuery.event.global[ type ] = true;
19632671 }
19642672
@@ -1979,18 +2687,12 @@
19802688 }
19812689
19822690 var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
1983 - eventKey = elem.nodeType ? "events" : "__events__",
1984 - elemData = jQuery.data( elem ),
1985 - events = elemData && elemData[ eventKey ];
 2691+ elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
 2692+ events = elemData && elemData.events;
19862693
19872694 if ( !elemData || !events ) {
19882695 return;
19892696 }
1990 -
1991 - if ( typeof events === "function" ) {
1992 - elemData = events;
1993 - events = events.events;
1994 - }
19952697
19962698 // types is actually an event object here
19972699 if ( types && types.type ) {
@@ -2024,7 +2726,7 @@
20252727 namespaces = type.split(".");
20262728 type = namespaces.shift();
20272729
2028 - namespace = new RegExp("(^|\\.)" +
 2730+ namespace = new RegExp("(^|\\.)" +
20292731 jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
20302732 }
20312733
@@ -2091,189 +2793,190 @@
20922794 delete elemData.events;
20932795 delete elemData.handle;
20942796
2095 - if ( typeof elemData === "function" ) {
2096 - jQuery.removeData( elem, eventKey );
2097 -
2098 - } else if ( jQuery.isEmptyObject( elemData ) ) {
2099 - jQuery.removeData( elem );
 2797+ if ( jQuery.isEmptyObject( elemData ) ) {
 2798+ jQuery.removeData( elem, undefined, true );
21002799 }
21012800 }
21022801 },
 2802+
 2803+ // Events that are safe to short-circuit if no handlers are attached.
 2804+ // Native DOM events should not be added, they may have inline handlers.
 2805+ customEvent: {
 2806+ "getData": true,
 2807+ "setData": true,
 2808+ "changeData": true
 2809+ },
21032810
2104 - // bubbling is internal
2105 - trigger: function( event, data, elem /*, bubbling */ ) {
 2811+ trigger: function( event, data, elem, onlyHandlers ) {
21062812 // Event object or event type
21072813 var type = event.type || event,
2108 - bubbling = arguments[3];
 2814+ namespaces = [],
 2815+ exclusive;
21092816
2110 - if ( !bubbling ) {
2111 - event = typeof event === "object" ?
2112 - // jQuery.Event object
2113 - event[ jQuery.expando ] ? event :
2114 - // Object literal
2115 - jQuery.extend( jQuery.Event(type), event ) :
2116 - // Just the event type (string)
2117 - jQuery.Event(type);
 2817+ if ( type.indexOf("!") >= 0 ) {
 2818+ // Exclusive events trigger only for the exact event (no namespaces)
 2819+ type = type.slice(0, -1);
 2820+ exclusive = true;
 2821+ }
21182822
2119 - if ( type.indexOf("!") >= 0 ) {
2120 - event.type = type = type.slice(0, -1);
2121 - event.exclusive = true;
2122 - }
 2823+ if ( type.indexOf(".") >= 0 ) {
 2824+ // Namespaced trigger; create a regexp to match event type in handle()
 2825+ namespaces = type.split(".");
 2826+ type = namespaces.shift();
 2827+ namespaces.sort();
 2828+ }
21232829
2124 - // Handle a global trigger
2125 - if ( !elem ) {
2126 - // Don't bubble custom events when global (to avoid too much overhead)
2127 - event.stopPropagation();
 2830+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
 2831+ // No jQuery handlers for this event type, and it can't have inline handlers
 2832+ return;
 2833+ }
21282834
2129 - // Only trigger if we've ever bound an event for it
2130 - if ( jQuery.event.global[ type ] ) {
2131 - jQuery.each( jQuery.cache, function() {
2132 - if ( this.events && this.events[type] ) {
2133 - jQuery.event.trigger( event, data, this.handle.elem );
2134 - }
2135 - });
2136 - }
2137 - }
 2835+ // Caller can pass in an Event, Object, or just an event type string
 2836+ event = typeof event === "object" ?
 2837+ // jQuery.Event object
 2838+ event[ jQuery.expando ] ? event :
 2839+ // Object literal
 2840+ new jQuery.Event( type, event ) :
 2841+ // Just the event type (string)
 2842+ new jQuery.Event( type );
21382843
2139 - // Handle triggering a single element
 2844+ event.type = type;
 2845+ event.exclusive = exclusive;
 2846+ event.namespace = namespaces.join(".");
 2847+ event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
 2848+
 2849+ // triggerHandler() and global events don't bubble or run the default action
 2850+ if ( onlyHandlers || !elem ) {
 2851+ event.preventDefault();
 2852+ event.stopPropagation();
 2853+ }
21402854
2141 - // don't do events on text and comment nodes
2142 - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
2143 - return undefined;
2144 - }
 2855+ // Handle a global trigger
 2856+ if ( !elem ) {
 2857+ // TODO: Stop taunting the data cache; remove global events and always attach to document
 2858+ jQuery.each( jQuery.cache, function() {
 2859+ // internalKey variable is just used to make it easier to find
 2860+ // and potentially change this stuff later; currently it just
 2861+ // points to jQuery.expando
 2862+ var internalKey = jQuery.expando,
 2863+ internalCache = this[ internalKey ];
 2864+ if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
 2865+ jQuery.event.trigger( event, data, internalCache.handle.elem );
 2866+ }
 2867+ });
 2868+ return;
 2869+ }
21452870
2146 - // Clean up in case it is reused
2147 - event.result = undefined;
2148 - event.target = elem;
2149 -
2150 - // Clone the incoming data, if any
2151 - data = jQuery.makeArray( data );
2152 - data.unshift( event );
 2871+ // Don't do events on text and comment nodes
 2872+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
 2873+ return;
21532874 }
21542875
2155 - event.currentTarget = elem;
 2876+ // Clean up the event in case it is being reused
 2877+ event.result = undefined;
 2878+ event.target = elem;
21562879
2157 - // Trigger the event, it is assumed that "handle" is a function
2158 - var handle = elem.nodeType ?
2159 - jQuery.data( elem, "handle" ) :
2160 - (jQuery.data( elem, "__events__" ) || {}).handle;
 2880+ // Clone any incoming data and prepend the event, creating the handler arg list
 2881+ data = data != null ? jQuery.makeArray( data ) : [];
 2882+ data.unshift( event );
21612883
2162 - if ( handle ) {
2163 - handle.apply( elem, data );
2164 - }
 2884+ var cur = elem,
 2885+ // IE doesn't like method names with a colon (#3533, #8272)
 2886+ ontype = type.indexOf(":") < 0 ? "on" + type : "";
21652887
2166 - var parent = elem.parentNode || elem.ownerDocument;
 2888+ // Fire event on the current element, then bubble up the DOM tree
 2889+ do {
 2890+ var handle = jQuery._data( cur, "handle" );
21672891
2168 - // Trigger an inline bound script
2169 - try {
2170 - if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
2171 - if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
2172 - event.result = false;
2173 - event.preventDefault();
2174 - }
 2892+ event.currentTarget = cur;
 2893+ if ( handle ) {
 2894+ handle.apply( cur, data );
21752895 }
21762896
2177 - // prevent IE from throwing an error for some elements with some event types, see #3533
2178 - } catch (inlineError) {}
 2897+ // Trigger an inline bound script
 2898+ if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
 2899+ event.result = false;
 2900+ event.preventDefault();
 2901+ }
21792902
2180 - if ( !event.isPropagationStopped() && parent ) {
2181 - jQuery.event.trigger( event, data, parent, true );
 2903+ // Bubble up to document, then to window
 2904+ cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
 2905+ } while ( cur && !event.isPropagationStopped() );
21822906
2183 - } else if ( !event.isDefaultPrevented() ) {
 2907+ // If nobody prevented the default action, do it now
 2908+ if ( !event.isDefaultPrevented() ) {
21842909 var old,
2185 - target = event.target,
2186 - targetType = type.replace( rnamespaces, "" ),
2187 - isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
2188 - special = jQuery.event.special[ targetType ] || {};
 2910+ special = jQuery.event.special[ type ] || {};
21892911
2190 - if ( (!special._default || special._default.call( elem, event ) === false) &&
2191 - !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
 2912+ if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
 2913+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
21922914
 2915+ // Call a native DOM method on the target with the same name name as the event.
 2916+ // Can't use an .isFunction)() check here because IE6/7 fails that test.
 2917+ // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
21932918 try {
2194 - if ( target[ targetType ] ) {
2195 - // Make sure that we don't accidentally re-trigger the onFOO events
2196 - old = target[ "on" + targetType ];
 2919+ if ( ontype && elem[ type ] ) {
 2920+ // Don't re-trigger an onFOO event when we call its FOO() method
 2921+ old = elem[ ontype ];
21972922
21982923 if ( old ) {
2199 - target[ "on" + targetType ] = null;
 2924+ elem[ ontype ] = null;
22002925 }
22012926
2202 - jQuery.event.triggered = true;
2203 - target[ targetType ]();
 2927+ jQuery.event.triggered = type;
 2928+ elem[ type ]();
22042929 }
 2930+ } catch ( ieError ) {}
22052931
2206 - // prevent IE from throwing an error for some elements with some event types, see #3533
2207 - } catch (triggerError) {}
2208 -
22092932 if ( old ) {
2210 - target[ "on" + targetType ] = old;
 2933+ elem[ ontype ] = old;
22112934 }
22122935
2213 - jQuery.event.triggered = false;
 2936+ jQuery.event.triggered = undefined;
22142937 }
22152938 }
 2939+
 2940+ return event.result;
22162941 },
22172942
22182943 handle: function( event ) {
2219 - var all, handlers, namespaces, namespace_re, events,
2220 - namespace_sort = [],
2221 - args = jQuery.makeArray( arguments );
 2944+ event = jQuery.event.fix( event || window.event );
 2945+ // Snapshot the handlers list since a called handler may add/remove events.
 2946+ var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
 2947+ run_all = !event.exclusive && !event.namespace,
 2948+ args = Array.prototype.slice.call( arguments, 0 );
22222949
2223 - event = args[0] = jQuery.event.fix( event || window.event );
 2950+ // Use the fix-ed Event rather than the (read-only) native event
 2951+ args[0] = event;
22242952 event.currentTarget = this;
22252953
2226 - // Namespaced event handlers
2227 - all = event.type.indexOf(".") < 0 && !event.exclusive;
 2954+ for ( var j = 0, l = handlers.length; j < l; j++ ) {
 2955+ var handleObj = handlers[ j ];
22282956
2229 - if ( !all ) {
2230 - namespaces = event.type.split(".");
2231 - event.type = namespaces.shift();
2232 - namespace_sort = namespaces.slice(0).sort();
2233 - namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
2234 - }
 2957+ // Triggered event must 1) be non-exclusive and have no namespace, or
 2958+ // 2) have namespace(s) a subset or equal to those in the bound event.
 2959+ if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
 2960+ // Pass in a reference to the handler function itself
 2961+ // So that we can later remove it
 2962+ event.handler = handleObj.handler;
 2963+ event.data = handleObj.data;
 2964+ event.handleObj = handleObj;
22352965
2236 - event.namespace = event.namespace || namespace_sort.join(".");
 2966+ var ret = handleObj.handler.apply( this, args );
22372967
2238 - events = jQuery.data(this, this.nodeType ? "events" : "__events__");
2239 -
2240 - if ( typeof events === "function" ) {
2241 - events = events.events;
2242 - }
2243 -
2244 - handlers = (events || {})[ event.type ];
2245 -
2246 - if ( events && handlers ) {
2247 - // Clone the handlers to prevent manipulation
2248 - handlers = handlers.slice(0);
2249 -
2250 - for ( var j = 0, l = handlers.length; j < l; j++ ) {
2251 - var handleObj = handlers[ j ];
2252 -
2253 - // Filter the functions by class
2254 - if ( all || namespace_re.test( handleObj.namespace ) ) {
2255 - // Pass in a reference to the handler function itself
2256 - // So that we can later remove it
2257 - event.handler = handleObj.handler;
2258 - event.data = handleObj.data;
2259 - event.handleObj = handleObj;
2260 -
2261 - var ret = handleObj.handler.apply( this, args );
2262 -
2263 - if ( ret !== undefined ) {
2264 - event.result = ret;
2265 - if ( ret === false ) {
2266 - event.preventDefault();
2267 - event.stopPropagation();
2268 - }
 2968+ if ( ret !== undefined ) {
 2969+ event.result = ret;
 2970+ if ( ret === false ) {
 2971+ event.preventDefault();
 2972+ event.stopPropagation();
22692973 }
 2974+ }
22702975
2271 - if ( event.isImmediatePropagationStopped() ) {
2272 - break;
2273 - }
 2976+ if ( event.isImmediatePropagationStopped() ) {
 2977+ break;
22742978 }
22752979 }
22762980 }
2277 -
22782981 return event.result;
22792982 },
22802983
@@ -2312,8 +3015,9 @@
23133016
23143017 // Calculate pageX/Y if missing and clientX/Y available
23153018 if ( event.pageX == null && event.clientX != null ) {
2316 - var doc = document.documentElement,
2317 - body = document.body;
 3019+ var eventDocument = event.target.ownerDocument || document,
 3020+ doc = eventDocument.documentElement,
 3021+ body = eventDocument.body;
23183022
23193023 event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
23203024 event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
@@ -2355,7 +3059,7 @@
23563060 add: function( handleObj ) {
23573061 jQuery.event.add( this,
23583062 liveConvert( handleObj.origType, handleObj.selector ),
2359 - jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
 3063+ jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
23603064 },
23613065
23623066 remove: function( handleObj ) {
@@ -2385,28 +3089,39 @@
23863090 if ( elem.removeEventListener ) {
23873091 elem.removeEventListener( type, handle, false );
23883092 }
2389 - } :
 3093+ } :
23903094 function( elem, type, handle ) {
23913095 if ( elem.detachEvent ) {
23923096 elem.detachEvent( "on" + type, handle );
23933097 }
23943098 };
23953099
2396 -jQuery.Event = function( src ) {
 3100+jQuery.Event = function( src, props ) {
23973101 // Allow instantiation without the 'new' keyword
23983102 if ( !this.preventDefault ) {
2399 - return new jQuery.Event( src );
 3103+ return new jQuery.Event( src, props );
24003104 }
24013105
24023106 // Event object
24033107 if ( src && src.type ) {
24043108 this.originalEvent = src;
24053109 this.type = src.type;
 3110+
 3111+ // Events bubbling up the document may have been marked as prevented
 3112+ // by a handler lower down the tree; reflect the correct value.
 3113+ this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
 3114+ src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
 3115+
24063116 // Event type
24073117 } else {
24083118 this.type = src;
24093119 }
24103120
 3121+ // Put explicitly provided properties onto the event object
 3122+ if ( props ) {
 3123+ jQuery.extend( this, props );
 3124+ }
 3125+
24113126 // timeStamp is buggy for some events on Firefox(#3843)
24123127 // So we won't rely on the native value
24133128 this.timeStamp = jQuery.now();
@@ -2432,7 +3147,7 @@
24333148 if ( !e ) {
24343149 return;
24353150 }
2436 -
 3151+
24373152 // if preventDefault exists run it on the original event
24383153 if ( e.preventDefault ) {
24393154 e.preventDefault();
@@ -2468,27 +3183,27 @@
24693184 // Checks if an event happened on an element within another element
24703185 // Used in jQuery.event.special.mouseenter and mouseleave handlers
24713186 var withinElement = function( event ) {
 3187+
24723188 // Check if mouse(over|out) are still within the same parent element
2473 - var parent = event.relatedTarget;
 3189+ var related = event.relatedTarget,
 3190+ inside = false,
 3191+ eventType = event.type;
24743192
2475 - // Firefox sometimes assigns relatedTarget a XUL element
2476 - // which we cannot access the parentNode property of
2477 - try {
2478 - // Traverse up the tree
2479 - while ( parent && parent !== this ) {
2480 - parent = parent.parentNode;
 3193+ event.type = event.data;
 3194+
 3195+ if ( related !== this ) {
 3196+
 3197+ if ( related ) {
 3198+ inside = jQuery.contains( this, related );
24813199 }
24823200
2483 - if ( parent !== this ) {
2484 - // set the correct event type
2485 - event.type = event.data;
 3201+ if ( !inside ) {
24863202
2487 - // handle event if we actually just moused on to a non sub-element
24883203 jQuery.event.handle.apply( this, arguments );
 3204+
 3205+ event.type = eventType;
24893206 }
2490 -
2491 - // assuming we've left the element since we most likely mousedover a xul element
2492 - } catch(e) { }
 3207+ }
24933208 },
24943209
24953210 // In case of event delegation, we only need to rename the event.type,
@@ -2518,24 +3233,22 @@
25193234
25203235 jQuery.event.special.submit = {
25213236 setup: function( data, namespaces ) {
2522 - if ( this.nodeName.toLowerCase() !== "form" ) {
 3237+ if ( !jQuery.nodeName( this, "form" ) ) {
25233238 jQuery.event.add(this, "click.specialSubmit", function( e ) {
25243239 var elem = e.target,
25253240 type = elem.type;
25263241
25273242 if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
2528 - e.liveFired = undefined;
2529 - return trigger( "submit", this, arguments );
 3243+ trigger( "submit", this, arguments );
25303244 }
25313245 });
2532 -
 3246+
25333247 jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
25343248 var elem = e.target,
25353249 type = elem.type;
25363250
25373251 if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
2538 - e.liveFired = undefined;
2539 - return trigger( "submit", this, arguments );
 3252+ trigger( "submit", this, arguments );
25403253 }
25413254 });
25423255
@@ -2569,7 +3282,7 @@
25703283 }).join("-") :
25713284 "";
25723285
2573 - } else if ( elem.nodeName.toLowerCase() === "select" ) {
 3286+ } else if ( jQuery.nodeName( elem, "select" ) ) {
25743287 val = elem.selectedIndex;
25753288 }
25763289
@@ -2583,14 +3296,14 @@
25843297 return;
25853298 }
25863299
2587 - data = jQuery.data( elem, "_change_data" );
 3300+ data = jQuery._data( elem, "_change_data" );
25883301 val = getVal(elem);
25893302
25903303 // the current data will be also retrieved by beforeactivate
25913304 if ( e.type !== "focusout" || elem.type !== "radio" ) {
2592 - jQuery.data( elem, "_change_data", val );
 3305+ jQuery._data( elem, "_change_data", val );
25933306 }
2594 -
 3307+
25953308 if ( data === undefined || val === data ) {
25963309 return;
25973310 }
@@ -2598,33 +3311,33 @@
25993312 if ( data != null || val ) {
26003313 e.type = "change";
26013314 e.liveFired = undefined;
2602 - return jQuery.event.trigger( e, arguments[1], elem );
 3315+ jQuery.event.trigger( e, arguments[1], elem );
26033316 }
26043317 };
26053318
26063319 jQuery.event.special.change = {
26073320 filters: {
2608 - focusout: testChange,
 3321+ focusout: testChange,
26093322
26103323 beforedeactivate: testChange,
26113324
26123325 click: function( e ) {
2613 - var elem = e.target, type = elem.type;
 3326+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
26143327
2615 - if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
2616 - return testChange.call( this, e );
 3328+ if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
 3329+ testChange.call( this, e );
26173330 }
26183331 },
26193332
26203333 // Change has to be called before submit
26213334 // Keydown will be called before keypress, which is used in submit-event delegation
26223335 keydown: function( e ) {
2623 - var elem = e.target, type = elem.type;
 3336+ var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
26243337
2625 - if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
 3338+ if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
26263339 (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
26273340 type === "select-multiple" ) {
2628 - return testChange.call( this, e );
 3341+ testChange.call( this, e );
26293342 }
26303343 },
26313344
@@ -2633,7 +3346,7 @@
26343347 // information
26353348 beforeactivate: function( e ) {
26363349 var elem = e.target;
2637 - jQuery.data( elem, "_change_data", getVal(elem) );
 3350+ jQuery._data( elem, "_change_data", getVal(elem) );
26383351 }
26393352 },
26403353
@@ -2663,36 +3376,58 @@
26643377 }
26653378
26663379 function trigger( type, elem, args ) {
2667 - args[0].type = type;
2668 - return jQuery.event.handle.apply( elem, args );
 3380+ // Piggyback on a donor event to simulate a different one.
 3381+ // Fake originalEvent to avoid donor's stopPropagation, but if the
 3382+ // simulated event prevents default then we do the same on the donor.
 3383+ // Don't pass args or remember liveFired; they apply to the donor event.
 3384+ var event = jQuery.extend( {}, args[ 0 ] );
 3385+ event.type = type;
 3386+ event.originalEvent = {};
 3387+ event.liveFired = undefined;
 3388+ jQuery.event.handle.call( elem, event );
 3389+ if ( event.isDefaultPrevented() ) {
 3390+ args[ 0 ].preventDefault();
 3391+ }
26693392 }
26703393
26713394 // Create "bubbling" focus and blur events
2672 -if ( document.addEventListener ) {
 3395+if ( !jQuery.support.focusinBubbles ) {
26733396 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
 3397+
 3398+ // Attach a single capturing handler while someone wants focusin/focusout
 3399+ var attaches = 0;
 3400+
26743401 jQuery.event.special[ fix ] = {
26753402 setup: function() {
2676 - if ( focusCounts[fix]++ === 0 ) {
 3403+ if ( attaches++ === 0 ) {
26773404 document.addEventListener( orig, handler, true );
26783405 }
2679 - },
2680 - teardown: function() {
2681 - if ( --focusCounts[fix] === 0 ) {
 3406+ },
 3407+ teardown: function() {
 3408+ if ( --attaches === 0 ) {
26823409 document.removeEventListener( orig, handler, true );
26833410 }
26843411 }
26853412 };
26863413
2687 - function handler( e ) {
2688 - e = jQuery.event.fix( e );
 3414+ function handler( donor ) {
 3415+ // Donor event is always a native one; fix it and switch its type.
 3416+ // Let focusin/out handler cancel the donor focus/blur event.
 3417+ var e = jQuery.event.fix( donor );
26893418 e.type = fix;
2690 - return jQuery.event.trigger( e, null, e.target );
 3419+ e.originalEvent = {};
 3420+ jQuery.event.trigger( e, null, e.target );
 3421+ if ( e.isDefaultPrevented() ) {
 3422+ donor.preventDefault();
 3423+ }
26913424 }
26923425 });
26933426 }
26943427
26953428 jQuery.each(["bind", "one"], function( i, name ) {
26963429 jQuery.fn[ name ] = function( type, data, fn ) {
 3430+ var handler;
 3431+
26973432 // Handle object literals
26983433 if ( typeof type === "object" ) {
26993434 for ( var key in type ) {
@@ -2700,16 +3435,21 @@
27013436 }
27023437 return this;
27033438 }
2704 -
2705 - if ( jQuery.isFunction( data ) || data === false ) {
 3439+
 3440+ if ( arguments.length === 2 || data === false ) {
27063441 fn = data;
27073442 data = undefined;
27083443 }
27093444
2710 - var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
2711 - jQuery( this ).unbind( event, handler );
2712 - return fn.apply( this, arguments );
2713 - }) : fn;
 3445+ if ( name === "one" ) {
 3446+ handler = function( event ) {
 3447+ jQuery( this ).unbind( event, handler );
 3448+ return fn.apply( this, arguments );
 3449+ };
 3450+ handler.guid = fn.guid || jQuery.guid++;
 3451+ } else {
 3452+ handler = fn;
 3453+ }
27143454
27153455 if ( type === "unload" && name !== "one" ) {
27163456 this.one( type, data, fn );
@@ -2740,20 +3480,20 @@
27413481
27423482 return this;
27433483 },
2744 -
 3484+
27453485 delegate: function( selector, types, data, fn ) {
27463486 return this.live( types, data, fn, selector );
27473487 },
2748 -
 3488+
27493489 undelegate: function( selector, types, fn ) {
27503490 if ( arguments.length === 0 ) {
2751 - return this.unbind( "live" );
2752 -
 3491+ return this.unbind( "live" );
 3492+
27533493 } else {
27543494 return this.die( types, null, fn, selector );
27553495 }
27563496 },
2757 -
 3497+
27583498 trigger: function( type, data ) {
27593499 return this.each(function() {
27603500 jQuery.event.trigger( type, data, this );
@@ -2762,35 +3502,34 @@
27633503
27643504 triggerHandler: function( type, data ) {
27653505 if ( this[0] ) {
2766 - var event = jQuery.Event( type );
2767 - event.preventDefault();
2768 - event.stopPropagation();
2769 - jQuery.event.trigger( event, data, this[0] );
2770 - return event.result;
 3506+ return jQuery.event.trigger( type, data, this[0], true );
27713507 }
27723508 },
27733509
27743510 toggle: function( fn ) {
27753511 // Save reference to arguments for access in closure
27763512 var args = arguments,
2777 - i = 1;
 3513+ guid = fn.guid || jQuery.guid++,
 3514+ i = 0,
 3515+ toggler = function( event ) {
 3516+ // Figure out which function to execute
 3517+ var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
 3518+ jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
27783519
 3520+ // Make sure that clicks stop
 3521+ event.preventDefault();
 3522+
 3523+ // and execute the function
 3524+ return args[ lastToggle ].apply( this, arguments ) || false;
 3525+ };
 3526+
27793527 // link all the functions, so any of them can unbind this click handler
 3528+ toggler.guid = guid;
27803529 while ( i < args.length ) {
2781 - jQuery.proxy( fn, args[ i++ ] );
 3530+ args[ i++ ].guid = guid;
27823531 }
27833532
2784 - return this.click( jQuery.proxy( fn, function( event ) {
2785 - // Figure out which function to execute
2786 - var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
2787 - jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
2788 -
2789 - // Make sure that clicks stop
2790 - event.preventDefault();
2791 -
2792 - // and execute the function
2793 - return args[ lastToggle ].apply( this, arguments ) || false;
2794 - }));
 3533+ return this.click( toggler );
27953534 },
27963535
27973536 hover: function( fnOver, fnOut ) {
@@ -2810,17 +3549,25 @@
28113550 var type, i = 0, match, namespaces, preType,
28123551 selector = origSelector || this.selector,
28133552 context = origSelector ? this : jQuery( this.context );
2814 -
 3553+
28153554 if ( typeof types === "object" && !types.preventDefault ) {
28163555 for ( var key in types ) {
28173556 context[ name ]( key, data, types[key], selector );
28183557 }
2819 -
 3558+
28203559 return this;
28213560 }
28223561
2823 - if ( jQuery.isFunction( data ) ) {
2824 - fn = data;
 3562+ if ( name === "die" && !types &&
 3563+ origSelector && origSelector.charAt(0) === "." ) {
 3564+
 3565+ context.unbind( origSelector );
 3566+
 3567+ return this;
 3568+ }
 3569+
 3570+ if ( data === false || jQuery.isFunction( data ) ) {
 3571+ fn = data || returnFalse;
28253572 data = undefined;
28263573 }
28273574
@@ -2842,7 +3589,7 @@
28433590
28443591 preType = type;
28453592
2846 - if ( type === "focus" || type === "blur" ) {
 3593+ if ( liveMap[ type ] ) {
28473594 types.push( liveMap[ type ] + namespaces );
28483595 type = type + namespaces;
28493596
@@ -2862,7 +3609,7 @@
28633610 context.unbind( "live." + liveConvert( type, selector ), fn );
28643611 }
28653612 }
2866 -
 3613+
28673614 return this;
28683615 };
28693616 });
@@ -2871,17 +3618,13 @@
28723619 var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
28733620 elems = [],
28743621 selectors = [],
2875 - events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
 3622+ events = jQuery._data( this, "events" );
28763623
2877 - if ( typeof events === "function" ) {
2878 - events = events.events;
 3624+ // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
 3625+ if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
 3626+ return;
28793627 }
28803628
2881 - // Make sure we avoid non-left-click bubbling in Firefox (#3861)
2882 - if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
2883 - return;
2884 - }
2885 -
28863629 if ( event.namespace ) {
28873630 namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
28883631 }
@@ -2909,7 +3652,7 @@
29103653 for ( j = 0; j < live.length; j++ ) {
29113654 handleObj = live[j];
29123655
2913 - if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
 3656+ if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
29143657 elem = close.elem;
29153658 related = null;
29163659
@@ -2917,6 +3660,11 @@
29183661 if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
29193662 event.type = handleObj.preType;
29203663 related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
 3664+
 3665+ // Make sure not to accidentally match a child element with the same selector
 3666+ if ( related && jQuery.contains( elem, related ) ) {
 3667+ related = elem;
 3668+ }
29213669 }
29223670
29233671 if ( !related || related !== elem ) {
@@ -2955,7 +3703,7 @@
29563704 }
29573705
29583706 function liveConvert( type, selector ) {
2959 - return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
 3707+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
29603708 }
29613709
29623710 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
@@ -2979,27 +3727,11 @@
29803728 }
29813729 });
29823730
2983 -// Prevent memory leaks in IE
2984 -// Window isn't included so as not to unbind existing unload events
2985 -// More info:
2986 -// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
2987 -if ( window.attachEvent && !window.addEventListener ) {
2988 - jQuery(window).bind("unload", function() {
2989 - for ( var id in jQuery.cache ) {
2990 - if ( jQuery.cache[ id ].handle ) {
2991 - // Try/Catch is to handle iframes being unloaded, see #4280
2992 - try {
2993 - jQuery.event.remove( jQuery.cache[ id ].handle.elem );
2994 - } catch(e) {}
2995 - }
2996 - }
2997 - });
2998 -}
29993731
30003732
30013733 /*!
3002 - * Sizzle CSS Selector Engine - v1.0
3003 - * Copyright 2009, The Dojo Foundation
 3734+ * Sizzle CSS Selector Engine
 3735+ * Copyright 2011, The Dojo Foundation
30043736 * Released under the MIT, BSD, and GPL Licenses.
30053737 * More information: http://sizzlejs.com/
30063738 */
@@ -3009,7 +3741,9 @@
30103742 done = 0,
30113743 toString = Object.prototype.toString,
30123744 hasDuplicate = false,
3013 - baseHasDuplicate = true;
 3745+ baseHasDuplicate = true,
 3746+ rBackslash = /\\/g,
 3747+ rNonWord = /\W/;
30143748
30153749 // Here we check if the JavaScript engine is using some sort of
30163750 // optimization where it does not always call our comparision
@@ -3208,7 +3942,7 @@
32093943 match.splice( 1, 1 );
32103944
32113945 if ( left.substr( left.length - 1 ) !== "\\" ) {
3212 - match[1] = (match[1] || "").replace(/\\/g, "");
 3946+ match[1] = (match[1] || "").replace( rBackslash, "" );
32133947 set = Expr.find[ type ]( match, context, isXML );
32143948
32153949 if ( set != null ) {
@@ -3220,7 +3954,9 @@
32213955 }
32223956
32233957 if ( !set ) {
3224 - set = context.getElementsByTagName( "*" );
 3958+ set = typeof context.getElementsByTagName !== "undefined" ?
 3959+ context.getElementsByTagName( "*" ) :
 3960+ [];
32253961 }
32263962
32273963 return { set: set, expr: expr };
@@ -3328,9 +4064,9 @@
33294065 ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
33304066 CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
33314067 NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
3332 - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
 4068+ ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
33334069 TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
3334 - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
 4070+ CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
33354071 POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
33364072 PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
33374073 },
@@ -3345,13 +4081,16 @@
33464082 attrHandle: {
33474083 href: function( elem ) {
33484084 return elem.getAttribute( "href" );
 4085+ },
 4086+ type: function( elem ) {
 4087+ return elem.getAttribute( "type" );
33494088 }
33504089 },
33514090
33524091 relative: {
33534092 "+": function(checkSet, part){
33544093 var isPartStr = typeof part === "string",
3355 - isTag = isPartStr && !/\W/.test( part ),
 4094+ isTag = isPartStr && !rNonWord.test( part ),
33564095 isPartStrNotTag = isPartStr && !isTag;
33574096
33584097 if ( isTag ) {
@@ -3379,7 +4118,7 @@
33804119 i = 0,
33814120 l = checkSet.length;
33824121
3383 - if ( isPartStr && !/\W/.test( part ) ) {
 4122+ if ( isPartStr && !rNonWord.test( part ) ) {
33844123 part = part.toLowerCase();
33854124
33864125 for ( ; i < l; i++ ) {
@@ -3413,7 +4152,7 @@
34144153 doneName = done++,
34154154 checkFn = dirCheck;
34164155
3417 - if ( typeof part === "string" && !/\W/.test(part) ) {
 4156+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
34184157 part = part.toLowerCase();
34194158 nodeCheck = part;
34204159 checkFn = dirNodeCheck;
@@ -3427,7 +4166,7 @@
34284167 doneName = done++,
34294168 checkFn = dirCheck;
34304169
3431 - if ( typeof part === "string" && !/\W/.test( part ) ) {
 4170+ if ( typeof part === "string" && !rNonWord.test( part ) ) {
34324171 part = part.toLowerCase();
34334172 nodeCheck = part;
34344173 checkFn = dirNodeCheck;
@@ -3463,12 +4202,14 @@
34644203 },
34654204
34664205 TAG: function( match, context ) {
3467 - return context.getElementsByTagName( match[1] );
 4206+ if ( typeof context.getElementsByTagName !== "undefined" ) {
 4207+ return context.getElementsByTagName( match[1] );
 4208+ }
34684209 }
34694210 },
34704211 preFilter: {
34714212 CLASS: function( match, curLoop, inplace, result, not, isXML ) {
3472 - match = " " + match[1].replace(/\\/g, "") + " ";
 4213+ match = " " + match[1].replace( rBackslash, "" ) + " ";
34734214
34744215 if ( isXML ) {
34754216 return match;
@@ -3476,7 +4217,7 @@
34774218
34784219 for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
34794220 if ( elem ) {
3480 - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
 4221+ if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
34814222 if ( !inplace ) {
34824223 result.push( elem );
34834224 }
@@ -3491,17 +4232,23 @@
34924233 },
34934234
34944235 ID: function( match ) {
3495 - return match[1].replace(/\\/g, "");
 4236+ return match[1].replace( rBackslash, "" );
34964237 },
34974238
34984239 TAG: function( match, curLoop ) {
3499 - return match[1].toLowerCase();
 4240+ return match[1].replace( rBackslash, "" ).toLowerCase();
35004241 },
35014242
35024243 CHILD: function( match ) {
35034244 if ( match[1] === "nth" ) {
 4245+ if ( !match[2] ) {
 4246+ Sizzle.error( match[0] );
 4247+ }
 4248+
 4249+ match[2] = match[2].replace(/^\+|\s*/g, '');
 4250+
35044251 // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
3505 - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
 4252+ var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
35064253 match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
35074254 !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
35084255
@@ -3509,6 +4256,9 @@
35104257 match[2] = (test[1] + (test[2] || 1)) - 0;
35114258 match[3] = test[3] - 0;
35124259 }
 4260+ else if ( match[2] ) {
 4261+ Sizzle.error( match[0] );
 4262+ }
35134263
35144264 // TODO: Move to normal caching system
35154265 match[0] = done++;
@@ -3517,12 +4267,15 @@
35184268 },
35194269
35204270 ATTR: function( match, curLoop, inplace, result, not, isXML ) {
3521 - var name = match[1].replace(/\\/g, "");
 4271+ var name = match[1] = match[1].replace( rBackslash, "" );
35224272
35234273 if ( !isXML && Expr.attrMap[name] ) {
35244274 match[1] = Expr.attrMap[name];
35254275 }
35264276
 4277+ // Handle if an un-quoted value was used
 4278+ match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
 4279+
35274280 if ( match[2] === "~=" ) {
35284281 match[4] = " " + match[4] + " ";
35294282 }
@@ -3576,7 +4329,9 @@
35774330 selected: function( elem ) {
35784331 // Accessing this property makes selected-by-default
35794332 // options in Safari work properly
3580 - elem.parentNode.selectedIndex;
 4333+ if ( elem.parentNode ) {
 4334+ elem.parentNode.selectedIndex;
 4335+ }
35814336
35824337 return elem.selected === true;
35834338 },
@@ -3598,41 +4353,53 @@
35994354 },
36004355
36014356 text: function( elem ) {
3602 - return "text" === elem.type;
 4357+ var attr = elem.getAttribute( "type" ), type = elem.type;
 4358+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
 4359+ // use getAttribute instead to test this case
 4360+ return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
36034361 },
 4362+
36044363 radio: function( elem ) {
3605 - return "radio" === elem.type;
 4364+ return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
36064365 },
36074366
36084367 checkbox: function( elem ) {
3609 - return "checkbox" === elem.type;
 4368+ return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
36104369 },
36114370
36124371 file: function( elem ) {
3613 - return "file" === elem.type;
 4372+ return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
36144373 },
 4374+
36154375 password: function( elem ) {
3616 - return "password" === elem.type;
 4376+ return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
36174377 },
36184378
36194379 submit: function( elem ) {
3620 - return "submit" === elem.type;
 4380+ var name = elem.nodeName.toLowerCase();
 4381+ return (name === "input" || name === "button") && "submit" === elem.type;
36214382 },
36224383
36234384 image: function( elem ) {
3624 - return "image" === elem.type;
 4385+ return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
36254386 },
36264387
36274388 reset: function( elem ) {
3628 - return "reset" === elem.type;
 4389+ var name = elem.nodeName.toLowerCase();
 4390+ return (name === "input" || name === "button") && "reset" === elem.type;
36294391 },
36304392
36314393 button: function( elem ) {
3632 - return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
 4394+ var name = elem.nodeName.toLowerCase();
 4395+ return name === "input" && "button" === elem.type || name === "button";
36334396 },
36344397
36354398 input: function( elem ) {
36364399 return (/input|select|textarea|button/i).test( elem.nodeName );
 4400+ },
 4401+
 4402+ focus: function( elem ) {
 4403+ return elem === elem.ownerDocument.activeElement;
36374404 }
36384405 },
36394406 setFilters: {
@@ -3691,7 +4458,7 @@
36924459 return true;
36934460
36944461 } else {
3695 - Sizzle.error( "Syntax error, unrecognized expression: " + name );
 4462+ Sizzle.error( name );
36964463 }
36974464 },
36984465
@@ -3885,6 +4652,16 @@
38864653
38874654 } else {
38884655 sortOrder = function( a, b ) {
 4656+ // The nodes are identical, we can exit early
 4657+ if ( a === b ) {
 4658+ hasDuplicate = true;
 4659+ return 0;
 4660+
 4661+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
 4662+ } else if ( a.sourceIndex && b.sourceIndex ) {
 4663+ return a.sourceIndex - b.sourceIndex;
 4664+ }
 4665+
38894666 var al, bl,
38904667 ap = [],
38914668 bp = [],
@@ -3892,13 +4669,8 @@
38934670 bup = b.parentNode,
38944671 cur = aup;
38954672
3896 - // The nodes are identical, we can exit early
3897 - if ( a === b ) {
3898 - hasDuplicate = true;
3899 - return 0;
3900 -
39014673 // If the nodes are siblings (or identical) we can do a quick check
3902 - } else if ( aup === bup ) {
 4674+ if ( aup === bup ) {
39034675 return siblingCheck( a, b );
39044676
39054677 // If no parents were found then the nodes are disconnected
@@ -4081,13 +4853,47 @@
40824854 Sizzle = function( query, context, extra, seed ) {
40834855 context = context || document;
40844856
4085 - // Make sure that attribute selectors are quoted
4086 - query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
4087 -
40884857 // Only use querySelectorAll on non-XML documents
40894858 // (ID selectors don't work in non-HTML documents)
40904859 if ( !seed && !Sizzle.isXML(context) ) {
 4860+ // See if we find a selector to speed up
 4861+ var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
 4862+
 4863+ if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
 4864+ // Speed-up: Sizzle("TAG")
 4865+ if ( match[1] ) {
 4866+ return makeArray( context.getElementsByTagName( query ), extra );
 4867+
 4868+ // Speed-up: Sizzle(".CLASS")
 4869+ } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
 4870+ return makeArray( context.getElementsByClassName( match[2] ), extra );
 4871+ }
 4872+ }
 4873+
40914874 if ( context.nodeType === 9 ) {
 4875+ // Speed-up: Sizzle("body")
 4876+ // The body element only exists once, optimize finding it
 4877+ if ( query === "body" && context.body ) {
 4878+ return makeArray( [ context.body ], extra );
 4879+
 4880+ // Speed-up: Sizzle("#ID")
 4881+ } else if ( match && match[3] ) {
 4882+ var elem = context.getElementById( match[3] );
 4883+
 4884+ // Check parentNode to catch when Blackberry 4.6 returns
 4885+ // nodes that are no longer in the document #6963
 4886+ if ( elem && elem.parentNode ) {
 4887+ // Handle the case where IE and Opera return items
 4888+ // by name instead of ID
 4889+ if ( elem.id === match[3] ) {
 4890+ return makeArray( [ elem ], extra );
 4891+ }
 4892+
 4893+ } else {
 4894+ return makeArray( [], extra );
 4895+ }
 4896+ }
 4897+
40924898 try {
40934899 return makeArray( context.querySelectorAll(query), extra );
40944900 } catch(qsaError) {}
@@ -4097,20 +4903,30 @@
40984904 // and working up from there (Thanks to Andrew Dupont for the technique)
40994905 // IE 8 doesn't work on object elements
41004906 } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
4101 - var old = context.getAttribute( "id" ),
4102 - nid = old || id;
 4907+ var oldContext = context,
 4908+ old = context.getAttribute( "id" ),
 4909+ nid = old || id,
 4910+ hasParent = context.parentNode,
 4911+ relativeHierarchySelector = /^\s*[+~]/.test( query );
41034912
41044913 if ( !old ) {
41054914 context.setAttribute( "id", nid );
 4915+ } else {
 4916+ nid = nid.replace( /'/g, "\\$&" );
41064917 }
 4918+ if ( relativeHierarchySelector && hasParent ) {
 4919+ context = context.parentNode;
 4920+ }
41074921
41084922 try {
4109 - return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra );
 4923+ if ( !relativeHierarchySelector || hasParent ) {
 4924+ return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
 4925+ }
41104926
41114927 } catch(pseudoError) {
41124928 } finally {
41134929 if ( !old ) {
4114 - context.removeAttribute( "id" );
 4930+ oldContext.removeAttribute( "id" );
41154931 }
41164932 }
41174933 }
@@ -4130,19 +4946,23 @@
41314947
41324948 (function(){
41334949 var html = document.documentElement,
4134 - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,
4135 - pseudoWorks = false;
 4950+ matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
41364951
4137 - try {
4138 - // This should fail with an exception
4139 - // Gecko does not error, returns false instead
4140 - matches.call( document.documentElement, "[test!='']:sizzle" );
 4952+ if ( matches ) {
 4953+ // Check to see if it's possible to do matchesSelector
 4954+ // on a disconnected node (IE 9 fails this)
 4955+ var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
 4956+ pseudoWorks = false;
 4957+
 4958+ try {
 4959+ // This should fail with an exception
 4960+ // Gecko does not error, returns false instead
 4961+ matches.call( document.documentElement, "[test!='']:sizzle" );
41414962
4142 - } catch( pseudoError ) {
4143 - pseudoWorks = true;
4144 - }
 4963+ } catch( pseudoError ) {
 4964+ pseudoWorks = true;
 4965+ }
41454966
4146 - if ( matches ) {
41474967 Sizzle.matchesSelector = function( node, expr ) {
41484968 // Make sure that attribute selectors are quoted
41494969 expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
@@ -4150,7 +4970,15 @@
41514971 if ( !Sizzle.isXML( node ) ) {
41524972 try {
41534973 if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
4154 - return matches.call( node, expr );
 4974+ var ret = matches.call( node, expr );
 4975+
 4976+ // IE 9's matchesSelector returns false on disconnected nodes
 4977+ if ( ret || !disconnectedMatch ||
 4978+ // As well, disconnected nodes are said to be in a document
 4979+ // fragment in IE 9, so check for that
 4980+ node.document && node.document.nodeType !== 11 ) {
 4981+ return ret;
 4982+ }
41554983 }
41564984 } catch(e) {}
41574985 }
@@ -4328,21 +5156,41 @@
43295157 rmultiselector = /,/,
43305158 isSimple = /^.[^:#\[\.,]*$/,
43315159 slice = Array.prototype.slice,
4332 - POS = jQuery.expr.match.POS;
 5160+ POS = jQuery.expr.match.POS,
 5161+ // methods guaranteed to produce a unique set when starting from a unique set
 5162+ guaranteedUnique = {
 5163+ children: true,
 5164+ contents: true,
 5165+ next: true,
 5166+ prev: true
 5167+ };
43335168
43345169 jQuery.fn.extend({
43355170 find: function( selector ) {
 5171+ var self = this,
 5172+ i, l;
 5173+
 5174+ if ( typeof selector !== "string" ) {
 5175+ return jQuery( selector ).filter(function() {
 5176+ for ( i = 0, l = self.length; i < l; i++ ) {
 5177+ if ( jQuery.contains( self[ i ], this ) ) {
 5178+ return true;
 5179+ }
 5180+ }
 5181+ });
 5182+ }
 5183+
43365184 var ret = this.pushStack( "", "find", selector ),
4337 - length = 0;
 5185+ length, n, r;
43385186
4339 - for ( var i = 0, l = this.length; i < l; i++ ) {
 5187+ for ( i = 0, l = this.length; i < l; i++ ) {
43405188 length = ret.length;
43415189 jQuery.find( selector, this[i], ret );
43425190
43435191 if ( i > 0 ) {
43445192 // Make sure that the results are unique
4345 - for ( var n = length; n < ret.length; n++ ) {
4346 - for ( var r = 0; r < length; r++ ) {
 5193+ for ( n = length; n < ret.length; n++ ) {
 5194+ for ( r = 0; r < length; r++ ) {
43475195 if ( ret[r] === ret[n] ) {
43485196 ret.splice(n--, 1);
43495197 break;
@@ -4373,14 +5221,17 @@
43745222 filter: function( selector ) {
43755223 return this.pushStack( winnow(this, selector, true), "filter", selector );
43765224 },
4377 -
 5225+
43785226 is: function( selector ) {
4379 - return !!selector && jQuery.filter( selector, this ).length > 0;
 5227+ return !!selector && ( typeof selector === "string" ?
 5228+ jQuery.filter( selector, this ).length > 0 :
 5229+ this.filter( selector ).length > 0 );
43805230 },
43815231
43825232 closest: function( selectors, context ) {
43835233 var ret = [], i, l, cur = this[0];
4384 -
 5234+
 5235+ // Array
43855236 if ( jQuery.isArray( selectors ) ) {
43865237 var match, selector,
43875238 matches = {},
@@ -4390,8 +5241,8 @@
43915242 for ( i = 0, l = selectors.length; i < l; i++ ) {
43925243 selector = selectors[i];
43935244
4394 - if ( !matches[selector] ) {
4395 - matches[selector] = jQuery.expr.match.POS.test( selector ) ?
 5245+ if ( !matches[ selector ] ) {
 5246+ matches[ selector ] = POS.test( selector ) ?
43965247 jQuery( selector, context || this.context ) :
43975248 selector;
43985249 }
@@ -4399,9 +5250,9 @@
44005251
44015252 while ( cur && cur.ownerDocument && cur !== context ) {
44025253 for ( selector in matches ) {
4403 - match = matches[selector];
 5254+ match = matches[ selector ];
44045255
4405 - if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
 5256+ if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
44065257 ret.push({ selector: selector, elem: cur, level: level });
44075258 }
44085259 }
@@ -4414,8 +5265,10 @@
44155266 return ret;
44165267 }
44175268
4418 - var pos = POS.test( selectors ) ?
4419 - jQuery( selectors, context || this.context ) : null;
 5269+ // String
 5270+ var pos = POS.test( selectors ) || typeof selectors !== "string" ?
 5271+ jQuery( selectors, context || this.context ) :
 5272+ 0;
44205273
44215274 for ( i = 0, l = this.length; i < l; i++ ) {
44225275 cur = this[i];
@@ -4427,18 +5280,18 @@
44285281
44295282 } else {
44305283 cur = cur.parentNode;
4431 - if ( !cur || !cur.ownerDocument || cur === context ) {
 5284+ if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
44325285 break;
44335286 }
44345287 }
44355288 }
44365289 }
44375290
4438 - ret = ret.length > 1 ? jQuery.unique(ret) : ret;
4439 -
 5291+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
 5292+
44405293 return this.pushStack( ret, "closest", selectors );
44415294 },
4442 -
 5295+
44435296 // Determine the position of an element within
44445297 // the matched set of elements
44455298 index: function( elem ) {
@@ -4456,8 +5309,8 @@
44575310
44585311 add: function( selector, context ) {
44595312 var set = typeof selector === "string" ?
4460 - jQuery( selector, context || this.context ) :
4461 - jQuery.makeArray( selector ),
 5313+ jQuery( selector, context ) :
 5314+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
44625315 all = jQuery.merge( this.get(), set );
44635316
44645317 return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
@@ -4518,8 +5371,13 @@
45195372 }
45205373 }, function( name, fn ) {
45215374 jQuery.fn[ name ] = function( until, selector ) {
4522 - var ret = jQuery.map( this, fn, until );
4523 -
 5375+ var ret = jQuery.map( this, fn, until ),
 5376+ // The variable 'args' was introduced in
 5377+ // https://github.com/jquery/jquery/commit/52a0238
 5378+ // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
 5379+ // http://code.google.com/p/v8/issues/detail?id=1050
 5380+ args = slice.call(arguments);
 5381+
45245382 if ( !runtil.test( name ) ) {
45255383 selector = until;
45265384 }
@@ -4528,13 +5386,13 @@
45295387 ret = jQuery.filter( selector, ret );
45305388 }
45315389
4532 - ret = this.length > 1 ? jQuery.unique( ret ) : ret;
 5390+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
45335391
45345392 if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
45355393 ret = ret.reverse();
45365394 }
45375395
4538 - return this.pushStack( ret, name, slice.call(arguments).join(",") );
 5396+ return this.pushStack( ret, name, args.join(",") );
45395397 };
45405398 });
45415399
@@ -4548,7 +5406,7 @@
45495407 jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
45505408 jQuery.find.matches(expr, elems);
45515409 },
4552 -
 5410+
45535411 dir: function( elem, dir, until ) {
45545412 var matched = [],
45555413 cur = elem[ dir ];
@@ -4590,6 +5448,11 @@
45915449
45925450 // Implement the identical functionality for filter and not
45935451 function winnow( elements, qualifier, keep ) {
 5452+
 5453+ // Can't pass null or undefined to indexOf in Firefox 4
 5454+ // Set to 0 to skip string check
 5455+ qualifier = qualifier || 0;
 5456+
45945457 if ( jQuery.isFunction( qualifier ) ) {
45955458 return jQuery.grep(elements, function( elem, i ) {
45965459 var retVal = !!qualifier.call( elem, i, elem );
@@ -4628,9 +5491,10 @@
46295492 rtbody = /<tbody/i,
46305493 rhtml = /<|&#?\w+;/,
46315494 rnocache = /<(?:script|object|embed|option|style)/i,
4632 - // checked="checked" or checked (html5)
 5495+ // checked="checked" or checked
46335496 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
4634 - raction = /\=([^="'>\s]+\/)>/g,
 5497+ rscriptType = /\/(java|ecma)script/i,
 5498+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
46355499 wrapMap = {
46365500 option: [ 1, "<select multiple='multiple'>", "</select>" ],
46375501 legend: [ 1, "<fieldset>", "</fieldset>" ],
@@ -4691,7 +5555,7 @@
46925556 }
46935557
46945558 return elem;
4695 - }).append(this);
 5559+ }).append( this );
46965560 }
46975561
46985562 return this;
@@ -4770,7 +5634,7 @@
47715635 return set;
47725636 }
47735637 },
4774 -
 5638+
47755639 // keepData is for internal use only--do not document
47765640 remove: function( selector, keepData ) {
47775641 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
@@ -4781,11 +5645,11 @@
47825646 }
47835647
47845648 if ( elem.parentNode ) {
4785 - elem.parentNode.removeChild( elem );
 5649+ elem.parentNode.removeChild( elem );
47865650 }
47875651 }
47885652 }
4789 -
 5653+
47905654 return this;
47915655 },
47925656
@@ -4801,48 +5665,17 @@
48025666 elem.removeChild( elem.firstChild );
48035667 }
48045668 }
4805 -
 5669+
48065670 return this;
48075671 },
48085672
4809 - clone: function( events ) {
4810 - // Do the clone
4811 - var ret = this.map(function() {
4812 - if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
4813 - // IE copies events bound via attachEvent when
4814 - // using cloneNode. Calling detachEvent on the
4815 - // clone will also remove the events from the orignal
4816 - // In order to get around this, we use innerHTML.
4817 - // Unfortunately, this means some modifications to
4818 - // attributes in IE that are actually only stored
4819 - // as properties will not be copied (such as the
4820 - // the name attribute on an input).
4821 - var html = this.outerHTML,
4822 - ownerDocument = this.ownerDocument;
 5673+ clone: function( dataAndEvents, deepDataAndEvents ) {
 5674+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
 5675+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
48235676
4824 - if ( !html ) {
4825 - var div = ownerDocument.createElement("div");
4826 - div.appendChild( this.cloneNode(true) );
4827 - html = div.innerHTML;
4828 - }
4829 -
4830 - return jQuery.clean([html.replace(rinlinejQuery, "")
4831 - // Handle the case in IE 8 where action=/test/> self-closes a tag
4832 - .replace(raction, '="$1">')
4833 - .replace(rleadingWhitespace, "")], ownerDocument)[0];
4834 - } else {
4835 - return this.cloneNode(true);
4836 - }
 5677+ return this.map( function () {
 5678+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
48375679 });
4838 -
4839 - // Copy the events from the original to the clone
4840 - if ( events === true ) {
4841 - cloneCopyEvent( this, ret );
4842 - cloneCopyEvent( this.find("*"), ret.find("*") );
4843 - }
4844 -
4845 - // Return the cloned set
4846 - return ret;
48475680 },
48485681
48495682 html: function( value ) {
@@ -4914,7 +5747,9 @@
49155748 }
49165749 });
49175750 } else {
4918 - return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
 5751+ return this.length ?
 5752+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
 5753+ this;
49195754 }
49205755 },
49215756
@@ -4952,9 +5787,9 @@
49535788 } else {
49545789 results = jQuery.buildFragment( args, this, scripts );
49555790 }
4956 -
 5791+
49575792 fragment = results.fragment;
4958 -
 5793+
49595794 if ( fragment.childNodes.length === 1 ) {
49605795 first = fragment = fragment.firstChild;
49615796 } else {
@@ -4964,13 +5799,20 @@
49655800 if ( first ) {
49665801 table = table && jQuery.nodeName( first, "tr" );
49675802
4968 - for ( var i = 0, l = this.length; i < l; i++ ) {
 5803+ for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
49695804 callback.call(
49705805 table ?
49715806 root(this[i], first) :
49725807 this[i],
4973 - i > 0 || results.cacheable || this.length > 1 ?
4974 - fragment.cloneNode(true) :
 5808+ // Make sure that we do not leak memory by inadvertently discarding
 5809+ // the original fragment (which might have attached data) instead of
 5810+ // using it; in addition, use the original fragment object for the last
 5811+ // item instead of first because it can end up being emptied incorrectly
 5812+ // in certain situations (Bug #8070).
 5813+ // Fragments from the fragment cache must always be cloned and never used
 5814+ // in place.
 5815+ results.cacheable || (l > 1 && i < lastIndex) ?
 5816+ jQuery.clone( fragment, true, true ) :
49755817 fragment
49765818 );
49775819 }
@@ -4992,48 +5834,122 @@
49935835 elem;
49945836 }
49955837
4996 -function cloneCopyEvent(orig, ret) {
4997 - var i = 0;
 5838+function cloneCopyEvent( src, dest ) {
49985839
4999 - ret.each(function() {
5000 - if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
5001 - return;
5002 - }
 5840+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
 5841+ return;
 5842+ }
50035843
5004 - var oldData = jQuery.data( orig[i++] ),
5005 - curData = jQuery.data( this, oldData ),
5006 - events = oldData && oldData.events;
 5844+ var internalKey = jQuery.expando,
 5845+ oldData = jQuery.data( src ),
 5846+ curData = jQuery.data( dest, oldData );
50075847
 5848+ // Switch to use the internal data object, if it exists, for the next
 5849+ // stage of data copying
 5850+ if ( (oldData = oldData[ internalKey ]) ) {
 5851+ var events = oldData.events;
 5852+ curData = curData[ internalKey ] = jQuery.extend({}, oldData);
 5853+
50085854 if ( events ) {
50095855 delete curData.handle;
50105856 curData.events = {};
50115857
50125858 for ( var type in events ) {
5013 - for ( var handler in events[ type ] ) {
5014 - jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
 5859+ for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
 5860+ jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
50155861 }
50165862 }
50175863 }
5018 - });
 5864+ }
50195865 }
50205866
 5867+function cloneFixAttributes( src, dest ) {
 5868+ var nodeName;
 5869+
 5870+ // We do not need to do anything for non-Elements
 5871+ if ( dest.nodeType !== 1 ) {
 5872+ return;
 5873+ }
 5874+
 5875+ // clearAttributes removes the attributes, which we don't want,
 5876+ // but also removes the attachEvent events, which we *do* want
 5877+ if ( dest.clearAttributes ) {
 5878+ dest.clearAttributes();
 5879+ }
 5880+
 5881+ // mergeAttributes, in contrast, only merges back on the
 5882+ // original attributes, not the events
 5883+ if ( dest.mergeAttributes ) {
 5884+ dest.mergeAttributes( src );
 5885+ }
 5886+
 5887+ nodeName = dest.nodeName.toLowerCase();
 5888+
 5889+ // IE6-8 fail to clone children inside object elements that use
 5890+ // the proprietary classid attribute value (rather than the type
 5891+ // attribute) to identify the type of content to display
 5892+ if ( nodeName === "object" ) {
 5893+ dest.outerHTML = src.outerHTML;
 5894+
 5895+ } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
 5896+ // IE6-8 fails to persist the checked state of a cloned checkbox
 5897+ // or radio button. Worse, IE6-7 fail to give the cloned element
 5898+ // a checked appearance if the defaultChecked value isn't also set
 5899+ if ( src.checked ) {
 5900+ dest.defaultChecked = dest.checked = src.checked;
 5901+ }
 5902+
 5903+ // IE6-7 get confused and end up setting the value of a cloned
 5904+ // checkbox/radio button to an empty string instead of "on"
 5905+ if ( dest.value !== src.value ) {
 5906+ dest.value = src.value;
 5907+ }
 5908+
 5909+ // IE6-8 fails to return the selected option to the default selected
 5910+ // state when cloning options
 5911+ } else if ( nodeName === "option" ) {
 5912+ dest.selected = src.defaultSelected;
 5913+
 5914+ // IE6-8 fails to set the defaultValue to the correct value when
 5915+ // cloning other types of input fields
 5916+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
 5917+ dest.defaultValue = src.defaultValue;
 5918+ }
 5919+
 5920+ // Event data gets referenced instead of copied if the expando
 5921+ // gets copied too
 5922+ dest.removeAttribute( jQuery.expando );
 5923+}
 5924+
50215925 jQuery.buildFragment = function( args, nodes, scripts ) {
5022 - var fragment, cacheable, cacheresults,
5023 - doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
 5926+ var fragment, cacheable, cacheresults, doc;
50245927
5025 - // Only cache "small" (1/2 KB) strings that are associated with the main document
 5928+ // nodes may contain either an explicit document object,
 5929+ // a jQuery collection or context object.
 5930+ // If nodes[0] contains a valid object to assign to doc
 5931+ if ( nodes && nodes[0] ) {
 5932+ doc = nodes[0].ownerDocument || nodes[0];
 5933+ }
 5934+
 5935+ // Ensure that an attr object doesn't incorrectly stand in as a document object
 5936+ // Chrome and Firefox seem to allow this to occur and will throw exception
 5937+ // Fixes #8950
 5938+ if ( !doc.createDocumentFragment ) {
 5939+ doc = document;
 5940+ }
 5941+
 5942+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
50265943 // Cloning options loses the selected state, so don't cache them
50275944 // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
50285945 // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
50295946 if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
5030 - !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
 5947+ args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
50315948
50325949 cacheable = true;
 5950+
50335951 cacheresults = jQuery.fragments[ args[0] ];
5034 - if ( cacheresults ) {
5035 - if ( cacheresults !== 1 ) {
5036 - fragment = cacheresults;
5037 - }
 5952+ if ( cacheresults && cacheresults !== 1 ) {
 5953+ fragment = cacheresults;
50385954 }
50395955 }
50405956
@@ -5062,25 +5978,103 @@
50635979 var ret = [],
50645980 insert = jQuery( selector ),
50655981 parent = this.length === 1 && this[0].parentNode;
5066 -
 5982+
50675983 if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
50685984 insert[ original ]( this[0] );
50695985 return this;
5070 -
 5986+
50715987 } else {
50725988 for ( var i = 0, l = insert.length; i < l; i++ ) {
50735989 var elems = (i > 0 ? this.clone(true) : this).get();
50745990 jQuery( insert[i] )[ original ]( elems );
50755991 ret = ret.concat( elems );
50765992 }
5077 -
 5993+
50785994 return this.pushStack( ret, name, insert.selector );
50795995 }
50805996 };
50815997 });
50825998
 5999+function getAll( elem ) {
 6000+ if ( "getElementsByTagName" in elem ) {
 6001+ return elem.getElementsByTagName( "*" );
 6002+
 6003+ } else if ( "querySelectorAll" in elem ) {
 6004+ return elem.querySelectorAll( "*" );
 6005+
 6006+ } else {
 6007+ return [];
 6008+ }
 6009+}
 6010+
 6011+// Used in clean, fixes the defaultChecked property
 6012+function fixDefaultChecked( elem ) {
 6013+ if ( elem.type === "checkbox" || elem.type === "radio" ) {
 6014+ elem.defaultChecked = elem.checked;
 6015+ }
 6016+}
 6017+// Finds all inputs and passes them to fixDefaultChecked
 6018+function findInputs( elem ) {
 6019+ if ( jQuery.nodeName( elem, "input" ) ) {
 6020+ fixDefaultChecked( elem );
 6021+ } else if ( "getElementsByTagName" in elem ) {
 6022+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
 6023+ }
 6024+}
 6025+
50836026 jQuery.extend({
 6027+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
 6028+ var clone = elem.cloneNode(true),
 6029+ srcElements,
 6030+ destElements,
 6031+ i;
 6032+
 6033+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
 6034+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
 6035+ // IE copies events bound via attachEvent when using cloneNode.
 6036+ // Calling detachEvent on the clone will also remove the events
 6037+ // from the original. In order to get around this, we use some
 6038+ // proprietary methods to clear the events. Thanks to MooTools
 6039+ // guys for this hotness.
 6040+
 6041+ cloneFixAttributes( elem, clone );
 6042+
 6043+ // Using Sizzle here is crazy slow, so we use getElementsByTagName
 6044+ // instead
 6045+ srcElements = getAll( elem );
 6046+ destElements = getAll( clone );
 6047+
 6048+ // Weird iteration because IE will replace the length property
 6049+ // with an element if you are cloning the body and one of the
 6050+ // elements on the page has a name or id of "length"
 6051+ for ( i = 0; srcElements[i]; ++i ) {
 6052+ cloneFixAttributes( srcElements[i], destElements[i] );
 6053+ }
 6054+ }
 6055+
 6056+ // Copy the events from the original to the clone
 6057+ if ( dataAndEvents ) {
 6058+ cloneCopyEvent( elem, clone );
 6059+
 6060+ if ( deepDataAndEvents ) {
 6061+ srcElements = getAll( elem );
 6062+ destElements = getAll( clone );
 6063+
 6064+ for ( i = 0; srcElements[i]; ++i ) {
 6065+ cloneCopyEvent( srcElements[i], destElements[i] );
 6066+ }
 6067+ }
 6068+ }
 6069+
 6070+ srcElements = destElements = null;
 6071+
 6072+ // Return the cloned set
 6073+ return clone;
 6074+ },
 6075+
50846076 clean: function( elems, context, fragment, scripts ) {
 6077+ var checkScriptType;
 6078+
50856079 context = context || document;
50866080
50876081 // !context.createElement fails in IE with an error but returns typeof 'object'
@@ -5088,7 +6082,7 @@
50896083 context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
50906084 }
50916085
5092 - var ret = [];
 6086+ var ret = [], j;
50936087
50946088 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
50956089 if ( typeof elem === "number" ) {
@@ -5100,54 +6094,67 @@
51016095 }
51026096
51036097 // Convert html string into DOM nodes
5104 - if ( typeof elem === "string" && !rhtml.test( elem ) ) {
5105 - elem = context.createTextNode( elem );
 6098+ if ( typeof elem === "string" ) {
 6099+ if ( !rhtml.test( elem ) ) {
 6100+ elem = context.createTextNode( elem );
 6101+ } else {
 6102+ // Fix "XHTML"-style tags in all browsers
 6103+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
51066104
5107 - } else if ( typeof elem === "string" ) {
5108 - // Fix "XHTML"-style tags in all browsers
5109 - elem = elem.replace(rxhtmlTag, "<$1></$2>");
 6105+ // Trim whitespace, otherwise indexOf won't work as expected
 6106+ var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
 6107+ wrap = wrapMap[ tag ] || wrapMap._default,
 6108+ depth = wrap[0],
 6109+ div = context.createElement("div");
51106110
5111 - // Trim whitespace, otherwise indexOf won't work as expected
5112 - var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
5113 - wrap = wrapMap[ tag ] || wrapMap._default,
5114 - depth = wrap[0],
5115 - div = context.createElement("div");
 6111+ // Go to html and back, then peel off extra wrappers
 6112+ div.innerHTML = wrap[1] + elem + wrap[2];
51166113
5117 - // Go to html and back, then peel off extra wrappers
5118 - div.innerHTML = wrap[1] + elem + wrap[2];
 6114+ // Move to the right depth
 6115+ while ( depth-- ) {
 6116+ div = div.lastChild;
 6117+ }
51196118
5120 - // Move to the right depth
5121 - while ( depth-- ) {
5122 - div = div.lastChild;
5123 - }
 6119+ // Remove IE's autoinserted <tbody> from table fragments
 6120+ if ( !jQuery.support.tbody ) {
51246121
5125 - // Remove IE's autoinserted <tbody> from table fragments
5126 - if ( !jQuery.support.tbody ) {
 6122+ // String was a <table>, *may* have spurious <tbody>
 6123+ var hasBody = rtbody.test(elem),
 6124+ tbody = tag === "table" && !hasBody ?
 6125+ div.firstChild && div.firstChild.childNodes :
51276126
5128 - // String was a <table>, *may* have spurious <tbody>
5129 - var hasBody = rtbody.test(elem),
5130 - tbody = tag === "table" && !hasBody ?
5131 - div.firstChild && div.firstChild.childNodes :
 6127+ // String was a bare <thead> or <tfoot>
 6128+ wrap[1] === "<table>" && !hasBody ?
 6129+ div.childNodes :
 6130+ [];
51326131
5133 - // String was a bare <thead> or <tfoot>
5134 - wrap[1] === "<table>" && !hasBody ?
5135 - div.childNodes :
5136 - [];
5137 -
5138 - for ( var j = tbody.length - 1; j >= 0 ; --j ) {
5139 - if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
5140 - tbody[ j ].parentNode.removeChild( tbody[ j ] );
 6132+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
 6133+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
 6134+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
 6135+ }
51416136 }
51426137 }
51436138
 6139+ // IE completely kills leading whitespace when innerHTML is used
 6140+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
 6141+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
 6142+ }
 6143+
 6144+ elem = div.childNodes;
51446145 }
 6146+ }
51456147
5146 - // IE completely kills leading whitespace when innerHTML is used
5147 - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5148 - div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
 6148+ // Resets defaultChecked for any radios and checkboxes
 6149+ // about to be appended to the DOM in IE 6/7 (#8060)
 6150+ var len;
 6151+ if ( !jQuery.support.appendChecked ) {
 6152+ if ( elem[0] && typeof (len = elem.length) === "number" ) {
 6153+ for ( j = 0; j < len; j++ ) {
 6154+ findInputs( elem[j] );
 6155+ }
 6156+ } else {
 6157+ findInputs( elem );
51496158 }
5150 -
5151 - elem = div.childNodes;
51526159 }
51536160
51546161 if ( elem.nodeType ) {
@@ -5158,13 +6165,18 @@
51596166 }
51606167
51616168 if ( fragment ) {
 6169+ checkScriptType = function( elem ) {
 6170+ return !elem.type || rscriptType.test( elem.type );
 6171+ };
51626172 for ( i = 0; ret[i]; i++ ) {
51636173 if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
51646174 scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
5165 -
 6175+
51666176 } else {
51676177 if ( ret[i].nodeType === 1 ) {
5168 - ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
 6178+ var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
 6179+
 6180+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
51696181 }
51706182 fragment.appendChild( ret[i] );
51716183 }
@@ -5173,40 +6185,45 @@
51746186
51756187 return ret;
51766188 },
5177 -
 6189+
51786190 cleanData: function( elems ) {
5179 - var data, id, cache = jQuery.cache,
5180 - special = jQuery.event.special,
 6191+ var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
51816192 deleteExpando = jQuery.support.deleteExpando;
5182 -
 6193+
51836194 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
51846195 if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
51856196 continue;
51866197 }
51876198
51886199 id = elem[ jQuery.expando ];
5189 -
 6200+
51906201 if ( id ) {
5191 - data = cache[ id ];
5192 -
 6202+ data = cache[ id ] && cache[ id ][ internalKey ];
 6203+
51936204 if ( data && data.events ) {
51946205 for ( var type in data.events ) {
51956206 if ( special[ type ] ) {
51966207 jQuery.event.remove( elem, type );
51976208
 6209+ // This is a shortcut to avoid jQuery.event.remove's overhead
51986210 } else {
51996211 jQuery.removeEvent( elem, type, data.handle );
52006212 }
52016213 }
 6214+
 6215+ // Null the DOM reference to avoid IE6/7/8 leak (#7054)
 6216+ if ( data.handle ) {
 6217+ data.handle.elem = null;
 6218+ }
52026219 }
5203 -
 6220+
52046221 if ( deleteExpando ) {
52056222 delete elem[ jQuery.expando ];
52066223
52076224 } else if ( elem.removeAttribute ) {
52086225 elem.removeAttribute( jQuery.expando );
52096226 }
5210 -
 6227+
52116228 delete cache[ id ];
52126229 }
52136230 }
@@ -5221,7 +6238,7 @@
52226239 dataType: "script"
52236240 });
52246241 } else {
5225 - jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
 6242+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
52266243 }
52276244
52286245 if ( elem.parentNode ) {
@@ -5231,13 +6248,14 @@
52326249
52336250
52346251
5235 -
52366252 var ralpha = /alpha\([^)]*\)/i,
52376253 ropacity = /opacity=([^)]*)/,
5238 - rdashAlpha = /-([a-z])/ig,
5239 - rupper = /([A-Z])/g,
 6254+ // fixed for IE9, see #8346
 6255+ rupper = /([A-Z]|^ms)/g,
52406256 rnumpx = /^-?\d+(?:px)?$/i,
52416257 rnum = /^-?\d/,
 6258+ rrelNum = /^[+\-]=/,
 6259+ rrelNumFilter = /[^+\-\.\de]+/g,
52426260
52436261 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
52446262 cssWidth = [ "Left", "Right" ],
@@ -5245,12 +6263,8 @@
52466264 curCSS,
52476265
52486266 getComputedStyle,
5249 - currentStyle,
 6267+ currentStyle;
52506268
5251 - fcamelCase = function( all, letter ) {
5252 - return letter.toUpperCase();
5253 - };
5254 -
52556269 jQuery.fn.css = function( name, value ) {
52566270 // Setting 'undefined' is a no-op
52576271 if ( arguments.length === 2 && value === undefined ) {
@@ -5284,11 +6298,14 @@
52856299
52866300 // Exclude the following css properties to add px
52876301 cssNumber: {
5288 - "zIndex": true,
 6302+ "fillOpacity": true,
52896303 "fontWeight": true,
 6304+ "lineHeight": true,
52906305 "opacity": true,
5291 - "zoom": true,
5292 - "lineHeight": true
 6306+ "orphans": true,
 6307+ "widows": true,
 6308+ "zIndex": true,
 6309+ "zoom": true
52936310 },
52946311
52956312 // Add in properties whose names you wish to fix before
@@ -5306,20 +6323,29 @@
53076324 }
53086325
53096326 // Make sure that we're working with the right name
5310 - var ret, origName = jQuery.camelCase( name ),
 6327+ var ret, type, origName = jQuery.camelCase( name ),
53116328 style = elem.style, hooks = jQuery.cssHooks[ origName ];
53126329
53136330 name = jQuery.cssProps[ origName ] || origName;
53146331
53156332 // Check if we're setting a value
53166333 if ( value !== undefined ) {
 6334+ type = typeof value;
 6335+
53176336 // Make sure that NaN and null values aren't set. See: #7116
5318 - if ( typeof value === "number" && isNaN( value ) || value == null ) {
 6337+ if ( type === "number" && isNaN( value ) || value == null ) {
53196338 return;
53206339 }
53216340
 6341+ // convert relative number strings (+= or -=) to relative numbers. #7345
 6342+ if ( type === "string" && rrelNum.test( value ) ) {
 6343+ value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
 6344+ // Fixes bug #9237
 6345+ type = "number";
 6346+ }
 6347+
53226348 // If a number was passed in, add 'px' to the (except for certain CSS properties)
5323 - if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {
 6349+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
53246350 value += "px";
53256351 }
53266352
@@ -5344,11 +6370,17 @@
53456371 },
53466372
53476373 css: function( elem, name, extra ) {
 6374+ var ret, hooks;
 6375+
53486376 // Make sure that we're working with the right name
5349 - var ret, origName = jQuery.camelCase( name ),
5350 - hooks = jQuery.cssHooks[ origName ];
 6377+ name = jQuery.camelCase( name );
 6378+ hooks = jQuery.cssHooks[ name ];
 6379+ name = jQuery.cssProps[ name ] || name;
53516380
5352 - name = jQuery.cssProps[ origName ] || origName;
 6381+ // cssFloat needs a special treatment
 6382+ if ( name === "cssFloat" ) {
 6383+ name = "float";
 6384+ }
53536385
53546386 // If a hook was provided get the computed value from there
53556387 if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
@@ -5356,7 +6388,7 @@
53576389
53586390 // Otherwise, if a way to get the computed value exists, use that
53596391 } else if ( curCSS ) {
5360 - return curCSS( elem, name, origName );
 6392+ return curCSS( elem, name );
53616393 }
53626394 },
53636395
@@ -5376,10 +6408,6 @@
53776409 for ( name in options ) {
53786410 elem.style[ name ] = old[ name ];
53796411 }
5380 - },
5381 -
5382 - camelCase: function( string ) {
5383 - return string.replace( rdashAlpha, fcamelCase );
53846412 }
53856413 });
53866414
@@ -5393,44 +6421,21 @@
53946422
53956423 if ( computed ) {
53966424 if ( elem.offsetWidth !== 0 ) {
5397 - val = getWH( elem, name, extra );
5398 -
 6425+ return getWH( elem, name, extra );
53996426 } else {
54006427 jQuery.swap( elem, cssShow, function() {
54016428 val = getWH( elem, name, extra );
54026429 });
54036430 }
54046431
5405 - if ( val <= 0 ) {
5406 - val = curCSS( elem, name, name );
5407 -
5408 - if ( val === "0px" && currentStyle ) {
5409 - val = currentStyle( elem, name, name );
5410 - }
5411 -
5412 - if ( val != null ) {
5413 - // Should return "auto" instead of 0, use 0 for
5414 - // temporary backwards-compat
5415 - return val === "" || val === "auto" ? "0px" : val;
5416 - }
5417 - }
5418 -
5419 - if ( val < 0 || val == null ) {
5420 - val = elem.style[ name ];
5421 -
5422 - // Should return "auto" instead of 0, use 0 for
5423 - // temporary backwards-compat
5424 - return val === "" || val === "auto" ? "0px" : val;
5425 - }
5426 -
5427 - return typeof val === "string" ? val : val + "px";
 6432+ return val;
54286433 }
54296434 },
54306435
54316436 set: function( elem, value ) {
54326437 if ( rnumpx.test( value ) ) {
54336438 // ignore negative width and height values #1599
5434 - value = parseFloat(value);
 6439+ value = parseFloat( value );
54356440
54366441 if ( value >= 0 ) {
54376442 return value + "px";
@@ -5447,33 +6452,56 @@
54486453 jQuery.cssHooks.opacity = {
54496454 get: function( elem, computed ) {
54506455 // IE uses filters for opacity
5451 - return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
5452 - (parseFloat(RegExp.$1) / 100) + "" :
 6456+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
 6457+ ( parseFloat( RegExp.$1 ) / 100 ) + "" :
54536458 computed ? "1" : "";
54546459 },
54556460
54566461 set: function( elem, value ) {
5457 - var style = elem.style;
 6462+ var style = elem.style,
 6463+ currentStyle = elem.currentStyle;
54586464
54596465 // IE has trouble with opacity if it does not have layout
54606466 // Force it by setting the zoom level
54616467 style.zoom = 1;
54626468
54636469 // Set the alpha filter to set the opacity
5464 - var opacity = jQuery.isNaN(value) ?
 6470+ var opacity = jQuery.isNaN( value ) ?
54656471 "" :
54666472 "alpha(opacity=" + value * 100 + ")",
5467 - filter = style.filter || "";
 6473+ filter = currentStyle && currentStyle.filter || style.filter || "";
54686474
5469 - style.filter = ralpha.test(filter) ?
5470 - filter.replace(ralpha, opacity) :
5471 - style.filter + ' ' + opacity;
 6475+ style.filter = ralpha.test( filter ) ?
 6476+ filter.replace( ralpha, opacity ) :
 6477+ filter + " " + opacity;
54726478 }
54736479 };
54746480 }
54756481
 6482+jQuery(function() {
 6483+ // This hook cannot be added until DOM ready because the support test
 6484+ // for it is not run until after DOM ready
 6485+ if ( !jQuery.support.reliableMarginRight ) {
 6486+ jQuery.cssHooks.marginRight = {
 6487+ get: function( elem, computed ) {
 6488+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
 6489+ // Work around by temporarily setting element display to inline-block
 6490+ var ret;
 6491+ jQuery.swap( elem, { "display": "inline-block" }, function() {
 6492+ if ( computed ) {
 6493+ ret = curCSS( elem, "margin-right", "marginRight" );
 6494+ } else {
 6495+ ret = elem.style.marginRight;
 6496+ }
 6497+ });
 6498+ return ret;
 6499+ }
 6500+ };
 6501+ }
 6502+});
 6503+
54766504 if ( document.defaultView && document.defaultView.getComputedStyle ) {
5477 - getComputedStyle = function( elem, newName, name ) {
 6505+ getComputedStyle = function( elem, name ) {
54786506 var ret, defaultView, computedStyle;
54796507
54806508 name = name.replace( rupper, "-$1" ).toLowerCase();
@@ -5495,8 +6523,9 @@
54966524
54976525 if ( document.documentElement.currentStyle ) {
54986526 currentStyle = function( elem, name ) {
5499 - var left, rsLeft,
 6527+ var left,
55006528 ret = elem.currentStyle && elem.currentStyle[ name ],
 6529+ rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
55016530 style = elem.style;
55026531
55036532 // From the awesome hack by Dean Edwards
@@ -5507,16 +6536,19 @@
55086537 if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
55096538 // Remember the original values
55106539 left = style.left;
5511 - rsLeft = elem.runtimeStyle.left;
55126540
55136541 // Put in the new values to get a computed value out
5514 - elem.runtimeStyle.left = elem.currentStyle.left;
 6542+ if ( rsLeft ) {
 6543+ elem.runtimeStyle.left = elem.currentStyle.left;
 6544+ }
55156545 style.left = name === "fontSize" ? "1em" : (ret || 0);
55166546 ret = style.pixelLeft + "px";
55176547
55186548 // Revert the changed values
55196549 style.left = left;
5520 - elem.runtimeStyle.left = rsLeft;
 6550+ if ( rsLeft ) {
 6551+ elem.runtimeStyle.left = rsLeft;
 6552+ }
55216553 }
55226554
55236555 return ret === "" ? "auto" : ret;
@@ -5526,27 +6558,50 @@
55276559 curCSS = getComputedStyle || currentStyle;
55286560
55296561 function getWH( elem, name, extra ) {
5530 - var which = name === "width" ? cssWidth : cssHeight,
5531 - val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
55326562
5533 - if ( extra === "border" ) {
5534 - return val;
5535 - }
 6563+ // Start with offset property
 6564+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
 6565+ which = name === "width" ? cssWidth : cssHeight;
55366566
5537 - jQuery.each( which, function() {
5538 - if ( !extra ) {
5539 - val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
 6567+ if ( val > 0 ) {
 6568+ if ( extra !== "border" ) {
 6569+ jQuery.each( which, function() {
 6570+ if ( !extra ) {
 6571+ val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
 6572+ }
 6573+ if ( extra === "margin" ) {
 6574+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
 6575+ } else {
 6576+ val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
 6577+ }
 6578+ });
55406579 }
55416580
5542 - if ( extra === "margin" ) {
5543 - val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
 6581+ return val + "px";
 6582+ }
55446583
5545 - } else {
5546 - val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
5547 - }
5548 - });
 6584+ // Fall back to computed then uncomputed css if necessary
 6585+ val = curCSS( elem, name, name );
 6586+ if ( val < 0 || val == null ) {
 6587+ val = elem.style[ name ] || 0;
 6588+ }
 6589+ // Normalize "", auto, and prepare for extra
 6590+ val = parseFloat( val ) || 0;
55496591
5550 - return val;
 6592+ // Add padding, border, margin
 6593+ if ( extra ) {
 6594+ jQuery.each( which, function() {
 6595+ val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
 6596+ if ( extra !== "padding" ) {
 6597+ val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
 6598+ }
 6599+ if ( extra === "margin" ) {
 6600+ val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
 6601+ }
 6602+ });
 6603+ }
 6604+
 6605+ return val + "px";
55516606 }
55526607
55536608 if ( jQuery.expr && jQuery.expr.filters ) {
@@ -5565,22 +6620,141 @@
55666621
55676622
55686623
5569 -var jsc = jQuery.now(),
5570 - rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
5571 - rselectTextarea = /^(?:select|textarea)/i,
 6624+var r20 = /%20/g,
 6625+ rbracket = /\[\]$/,
 6626+ rCRLF = /\r?\n/g,
 6627+ rhash = /#.*$/,
 6628+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
55726629 rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
 6630+ // #7653, #8125, #8152: local protocol detection
 6631+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
55736632 rnoContent = /^(?:GET|HEAD)$/,
5574 - rbracket = /\[\]$/,
5575 - jsre = /\=\?(&|$)/,
 6633+ rprotocol = /^\/\//,
55766634 rquery = /\?/,
 6635+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
 6636+ rselectTextarea = /^(?:select|textarea)/i,
 6637+ rspacesAjax = /\s+/,
55776638 rts = /([?&])_=[^&]*/,
5578 - rurl = /^(\w+:)?\/\/([^\/?#]+)/,
5579 - r20 = /%20/g,
5580 - rhash = /#.*$/,
 6639+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
55816640
55826641 // Keep a copy of the old load method
5583 - _load = jQuery.fn.load;
 6642+ _load = jQuery.fn.load,
55846643
 6644+ /* Prefilters
 6645+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
 6646+ * 2) These are called:
 6647+ * - BEFORE asking for a transport
 6648+ * - AFTER param serialization (s.data is a string if s.processData is true)
 6649+ * 3) key is the dataType
 6650+ * 4) the catchall symbol "*" can be used
 6651+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
 6652+ */
 6653+ prefilters = {},
 6654+
 6655+ /* Transports bindings
 6656+ * 1) key is the dataType
 6657+ * 2) the catchall symbol "*" can be used
 6658+ * 3) selection will start with transport dataType and THEN go to "*" if needed
 6659+ */
 6660+ transports = {},
 6661+
 6662+ // Document location
 6663+ ajaxLocation,
 6664+
 6665+ // Document location segments
 6666+ ajaxLocParts;
 6667+
 6668+// #8138, IE may throw an exception when accessing
 6669+// a field from window.location if document.domain has been set
 6670+try {
 6671+ ajaxLocation = location.href;
 6672+} catch( e ) {
 6673+ // Use the href attribute of an A element
 6674+ // since IE will modify it given document.location
 6675+ ajaxLocation = document.createElement( "a" );
 6676+ ajaxLocation.href = "";
 6677+ ajaxLocation = ajaxLocation.href;
 6678+}
 6679+
 6680+// Segment location into parts
 6681+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
 6682+
 6683+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
 6684+function addToPrefiltersOrTransports( structure ) {
 6685+
 6686+ // dataTypeExpression is optional and defaults to "*"
 6687+ return function( dataTypeExpression, func ) {
 6688+
 6689+ if ( typeof dataTypeExpression !== "string" ) {
 6690+ func = dataTypeExpression;
 6691+ dataTypeExpression = "*";
 6692+ }
 6693+
 6694+ if ( jQuery.isFunction( func ) ) {
 6695+ var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
 6696+ i = 0,
 6697+ length = dataTypes.length,
 6698+ dataType,
 6699+ list,
 6700+ placeBefore;
 6701+
 6702+ // For each dataType in the dataTypeExpression
 6703+ for(; i < length; i++ ) {
 6704+ dataType = dataTypes[ i ];
 6705+ // We control if we're asked to add before
 6706+ // any existing element
 6707+ placeBefore = /^\+/.test( dataType );
 6708+ if ( placeBefore ) {
 6709+ dataType = dataType.substr( 1 ) || "*";
 6710+ }
 6711+ list = structure[ dataType ] = structure[ dataType ] || [];
 6712+ // then we add to the structure accordingly
 6713+ list[ placeBefore ? "unshift" : "push" ]( func );
 6714+ }
 6715+ }
 6716+ };
 6717+}
 6718+
 6719+// Base inspection function for prefilters and transports
 6720+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
 6721+ dataType /* internal */, inspected /* internal */ ) {
 6722+
 6723+ dataType = dataType || options.dataTypes[ 0 ];
 6724+ inspected = inspected || {};
 6725+
 6726+ inspected[ dataType ] = true;
 6727+
 6728+ var list = structure[ dataType ],
 6729+ i = 0,
 6730+ length = list ? list.length : 0,
 6731+ executeOnly = ( structure === prefilters ),
 6732+ selection;
 6733+
 6734+ for(; i < length && ( executeOnly || !selection ); i++ ) {
 6735+ selection = list[ i ]( options, originalOptions, jqXHR );
 6736+ // If we got redirected to another dataType
 6737+ // we try there if executing only and not done already
 6738+ if ( typeof selection === "string" ) {
 6739+ if ( !executeOnly || inspected[ selection ] ) {
 6740+ selection = undefined;
 6741+ } else {
 6742+ options.dataTypes.unshift( selection );
 6743+ selection = inspectPrefiltersOrTransports(
 6744+ structure, options, originalOptions, jqXHR, selection, inspected );
 6745+ }
 6746+ }
 6747+ }
 6748+ // If we're only executing or nothing was selected
 6749+ // we try the catchall dataType if not done already
 6750+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
 6751+ selection = inspectPrefiltersOrTransports(
 6752+ structure, options, originalOptions, jqXHR, "*", inspected );
 6753+ }
 6754+ // unnecessary when only executing (prefilters)
 6755+ // but it'll be ignored by the caller in that case
 6756+ return selection;
 6757+}
 6758+
55856759 jQuery.fn.extend({
55866760 load: function( url, params, callback ) {
55876761 if ( typeof url !== "string" && _load ) {
@@ -5591,10 +6765,10 @@
55926766 return this;
55936767 }
55946768
5595 - var off = url.indexOf(" ");
 6769+ var off = url.indexOf( " " );
55966770 if ( off >= 0 ) {
5597 - var selector = url.slice(off, url.length);
5598 - url = url.slice(0, off);
 6771+ var selector = url.slice( off, url.length );
 6772+ url = url.slice( 0, off );
55996773 }
56006774
56016775 // Default to a GET request
@@ -5606,7 +6780,7 @@
56076781 if ( jQuery.isFunction( params ) ) {
56086782 // We assume that it's the callback
56096783 callback = params;
5610 - params = null;
 6784+ params = undefined;
56116785
56126786 // Otherwise, build a param string
56136787 } else if ( typeof params === "object" ) {
@@ -5623,26 +6797,34 @@
56246798 type: type,
56256799 dataType: "html",
56266800 data: params,
5627 - complete: function( res, status ) {
 6801+ // Complete callback (responseText is used internally)
 6802+ complete: function( jqXHR, status, responseText ) {
 6803+ // Store the response as specified by the jqXHR object
 6804+ responseText = jqXHR.responseText;
56286805 // If successful, inject the HTML into all the matched elements
5629 - if ( status === "success" || status === "notmodified" ) {
 6806+ if ( jqXHR.isResolved() ) {
 6807+ // #4825: Get the actual response in case
 6808+ // a dataFilter is present in ajaxSettings
 6809+ jqXHR.done(function( r ) {
 6810+ responseText = r;
 6811+ });
56306812 // See if a selector was specified
56316813 self.html( selector ?
56326814 // Create a dummy div to hold the results
56336815 jQuery("<div>")
56346816 // inject the contents of the document in, removing the scripts
56356817 // to avoid any 'Permission Denied' errors in IE
5636 - .append(res.responseText.replace(rscript, ""))
 6818+ .append(responseText.replace(rscript, ""))
56376819
56386820 // Locate the specified elements
56396821 .find(selector) :
56406822
56416823 // If not, just inject the full result
5642 - res.responseText );
 6824+ responseText );
56436825 }
56446826
56456827 if ( callback ) {
5646 - self.each( callback, [res.responseText, status, res] );
 6828+ self.each( callback, [ responseText, status, jqXHR ] );
56476829 }
56486830 }
56496831 });
@@ -5651,88 +6833,94 @@
56526834 },
56536835
56546836 serialize: function() {
5655 - return jQuery.param(this.serializeArray());
 6837+ return jQuery.param( this.serializeArray() );
56566838 },
56576839
56586840 serializeArray: function() {
5659 - return this.map(function() {
5660 - return this.elements ? jQuery.makeArray(this.elements) : this;
 6841+ return this.map(function(){
 6842+ return this.elements ? jQuery.makeArray( this.elements ) : this;
56616843 })
5662 - .filter(function() {
 6844+ .filter(function(){
56636845 return this.name && !this.disabled &&
5664 - (this.checked || rselectTextarea.test(this.nodeName) ||
5665 - rinput.test(this.type));
 6846+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
 6847+ rinput.test( this.type ) );
56666848 })
5667 - .map(function( i, elem ) {
5668 - var val = jQuery(this).val();
 6849+ .map(function( i, elem ){
 6850+ var val = jQuery( this ).val();
56696851
56706852 return val == null ?
56716853 null :
5672 - jQuery.isArray(val) ?
5673 - jQuery.map( val, function( val, i ) {
5674 - return { name: elem.name, value: val };
 6854+ jQuery.isArray( val ) ?
 6855+ jQuery.map( val, function( val, i ){
 6856+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
56756857 }) :
5676 - { name: elem.name, value: val };
 6858+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
56776859 }).get();
56786860 }
56796861 });
56806862
56816863 // Attach a bunch of functions for handling common AJAX events
5682 -jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
5683 - jQuery.fn[o] = function( f ) {
5684 - return this.bind(o, f);
 6864+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
 6865+ jQuery.fn[ o ] = function( f ){
 6866+ return this.bind( o, f );
56856867 };
56866868 });
56876869
5688 -jQuery.extend({
5689 - get: function( url, data, callback, type ) {
5690 - // shift arguments if data argument was omited
 6870+jQuery.each( [ "get", "post" ], function( i, method ) {
 6871+ jQuery[ method ] = function( url, data, callback, type ) {
 6872+ // shift arguments if data argument was omitted
56916873 if ( jQuery.isFunction( data ) ) {
56926874 type = type || callback;
56936875 callback = data;
5694 - data = null;
 6876+ data = undefined;
56956877 }
56966878
56976879 return jQuery.ajax({
5698 - type: "GET",
 6880+ type: method,
56996881 url: url,
57006882 data: data,
57016883 success: callback,
57026884 dataType: type
57036885 });
5704 - },
 6886+ };
 6887+});
57056888
 6889+jQuery.extend({
 6890+
57066891 getScript: function( url, callback ) {
5707 - return jQuery.get(url, null, callback, "script");
 6892+ return jQuery.get( url, undefined, callback, "script" );
57086893 },
57096894
57106895 getJSON: function( url, data, callback ) {
5711 - return jQuery.get(url, data, callback, "json");
 6896+ return jQuery.get( url, data, callback, "json" );
57126897 },
57136898
5714 - post: function( url, data, callback, type ) {
5715 - // shift arguments if data argument was omited
5716 - if ( jQuery.isFunction( data ) ) {
5717 - type = type || callback;
5718 - callback = data;
5719 - data = {};
 6899+ // Creates a full fledged settings object into target
 6900+ // with both ajaxSettings and settings fields.
 6901+ // If target is omitted, writes into ajaxSettings.
 6902+ ajaxSetup: function ( target, settings ) {
 6903+ if ( !settings ) {
 6904+ // Only one parameter, we extend ajaxSettings
 6905+ settings = target;
 6906+ target = jQuery.extend( true, jQuery.ajaxSettings, settings );
 6907+ } else {
 6908+ // target was provided, we extend into it
 6909+ jQuery.extend( true, target, jQuery.ajaxSettings, settings );
57206910 }
5721 -
5722 - return jQuery.ajax({
5723 - type: "POST",
5724 - url: url,
5725 - data: data,
5726 - success: callback,
5727 - dataType: type
5728 - });
 6911+ // Flatten fields we don't want deep extended
 6912+ for( var field in { context: 1, url: 1 } ) {
 6913+ if ( field in settings ) {
 6914+ target[ field ] = settings[ field ];
 6915+ } else if( field in jQuery.ajaxSettings ) {
 6916+ target[ field ] = jQuery.ajaxSettings[ field ];
 6917+ }
 6918+ }
 6919+ return target;
57296920 },
57306921
5731 - ajaxSetup: function( settings ) {
5732 - jQuery.extend( jQuery.ajaxSettings, settings );
5733 - },
5734 -
57356922 ajaxSettings: {
5736 - url: location.href,
 6923+ url: ajaxLocation,
 6924+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
57376925 global: true,
57386926 type: "GET",
57396927 contentType: "application/x-www-form-urlencoded",
@@ -5741,332 +6929,434 @@
57426930 /*
57436931 timeout: 0,
57446932 data: null,
 6933+ dataType: null,
57456934 username: null,
57466935 password: null,
 6936+ cache: null,
57476937 traditional: false,
 6938+ headers: {},
57486939 */
5749 - // This function can be overriden by calling jQuery.ajaxSetup
5750 - xhr: function() {
5751 - return new window.XMLHttpRequest();
5752 - },
 6940+
57536941 accepts: {
57546942 xml: "application/xml, text/xml",
57556943 html: "text/html",
5756 - script: "text/javascript, application/javascript",
 6944+ text: "text/plain",
57576945 json: "application/json, text/javascript",
5758 - text: "text/plain",
5759 - _default: "*/*"
5760 - }
5761 - },
 6946+ "*": "*/*"
 6947+ },
57626948
5763 - ajax: function( origSettings ) {
5764 - var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
5765 - jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
 6949+ contents: {
 6950+ xml: /xml/,
 6951+ html: /html/,
 6952+ json: /json/
 6953+ },
57666954
5767 - s.url = s.url.replace( rhash, "" );
 6955+ responseFields: {
 6956+ xml: "responseXML",
 6957+ text: "responseText"
 6958+ },
57686959
5769 - // Use original (not extended) context object if it was provided
5770 - s.context = origSettings && origSettings.context != null ? origSettings.context : s;
 6960+ // List of data converters
 6961+ // 1) key format is "source_type destination_type" (a single space in-between)
 6962+ // 2) the catchall symbol "*" can be used for source_type
 6963+ converters: {
57716964
5772 - // convert data if not already a string
5773 - if ( s.data && s.processData && typeof s.data !== "string" ) {
5774 - s.data = jQuery.param( s.data, s.traditional );
 6965+ // Convert anything to text
 6966+ "* text": window.String,
 6967+
 6968+ // Text to html (true = no transformation)
 6969+ "text html": true,
 6970+
 6971+ // Evaluate text as a json expression
 6972+ "text json": jQuery.parseJSON,
 6973+
 6974+ // Parse text as xml
 6975+ "text xml": jQuery.parseXML
57756976 }
 6977+ },
57766978
5777 - // Handle JSONP Parameter Callbacks
5778 - if ( s.dataType === "jsonp" ) {
5779 - if ( type === "GET" ) {
5780 - if ( !jsre.test( s.url ) ) {
5781 - s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
5782 - }
5783 - } else if ( !s.data || !jsre.test(s.data) ) {
5784 - s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
5785 - }
5786 - s.dataType = "json";
 6979+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
 6980+ ajaxTransport: addToPrefiltersOrTransports( transports ),
 6981+
 6982+ // Main method
 6983+ ajax: function( url, options ) {
 6984+
 6985+ // If url is an object, simulate pre-1.5 signature
 6986+ if ( typeof url === "object" ) {
 6987+ options = url;
 6988+ url = undefined;
57876989 }
57886990
5789 - // Build temporary JSONP function
5790 - if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
5791 - jsonp = s.jsonpCallback || ("jsonp" + jsc++);
 6991+ // Force options to be an object
 6992+ options = options || {};
57926993
5793 - // Replace the =? sequence both in the query string and the data
5794 - if ( s.data ) {
5795 - s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
5796 - }
 6994+ var // Create the final options object
 6995+ s = jQuery.ajaxSetup( {}, options ),
 6996+ // Callbacks context
 6997+ callbackContext = s.context || s,
 6998+ // Context for global events
 6999+ // It's the callbackContext if one was provided in the options
 7000+ // and if it's a DOM node or a jQuery collection
 7001+ globalEventContext = callbackContext !== s &&
 7002+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
 7003+ jQuery( callbackContext ) : jQuery.event,
 7004+ // Deferreds
 7005+ deferred = jQuery.Deferred(),
 7006+ completeDeferred = jQuery._Deferred(),
 7007+ // Status-dependent callbacks
 7008+ statusCode = s.statusCode || {},
 7009+ // ifModified key
 7010+ ifModifiedKey,
 7011+ // Headers (they are sent all at once)
 7012+ requestHeaders = {},
 7013+ requestHeadersNames = {},
 7014+ // Response headers
 7015+ responseHeadersString,
 7016+ responseHeaders,
 7017+ // transport
 7018+ transport,
 7019+ // timeout handle
 7020+ timeoutTimer,
 7021+ // Cross-domain detection vars
 7022+ parts,
 7023+ // The jqXHR state
 7024+ state = 0,
 7025+ // To know if global events are to be dispatched
 7026+ fireGlobals,
 7027+ // Loop variable
 7028+ i,
 7029+ // Fake xhr
 7030+ jqXHR = {
57977031
5798 - s.url = s.url.replace(jsre, "=" + jsonp + "$1");
 7032+ readyState: 0,
57997033
5800 - // We need to make sure
5801 - // that a JSONP style response is executed properly
5802 - s.dataType = "script";
 7034+ // Caches the header
 7035+ setRequestHeader: function( name, value ) {
 7036+ if ( !state ) {
 7037+ var lname = name.toLowerCase();
 7038+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
 7039+ requestHeaders[ name ] = value;
 7040+ }
 7041+ return this;
 7042+ },
58037043
5804 - // Handle JSONP-style loading
5805 - var customJsonp = window[ jsonp ];
 7044+ // Raw string
 7045+ getAllResponseHeaders: function() {
 7046+ return state === 2 ? responseHeadersString : null;
 7047+ },
58067048
5807 - window[ jsonp ] = function( tmp ) {
5808 - if ( jQuery.isFunction( customJsonp ) ) {
5809 - customJsonp( tmp );
 7049+ // Builds headers hashtable if needed
 7050+ getResponseHeader: function( key ) {
 7051+ var match;
 7052+ if ( state === 2 ) {
 7053+ if ( !responseHeaders ) {
 7054+ responseHeaders = {};
 7055+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
 7056+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
 7057+ }
 7058+ }
 7059+ match = responseHeaders[ key.toLowerCase() ];
 7060+ }
 7061+ return match === undefined ? null : match;
 7062+ },
58107063
5811 - } else {
5812 - // Garbage collect
5813 - window[ jsonp ] = undefined;
 7064+ // Overrides response content-type header
 7065+ overrideMimeType: function( type ) {
 7066+ if ( !state ) {
 7067+ s.mimeType = type;
 7068+ }
 7069+ return this;
 7070+ },
58147071
5815 - try {
5816 - delete window[ jsonp ];
5817 - } catch( jsonpError ) {}
 7072+ // Cancel the request
 7073+ abort: function( statusText ) {
 7074+ statusText = statusText || "abort";
 7075+ if ( transport ) {
 7076+ transport.abort( statusText );
 7077+ }
 7078+ done( 0, statusText );
 7079+ return this;
58187080 }
5819 -
5820 - data = tmp;
5821 - jQuery.handleSuccess( s, xhr, status, data );
5822 - jQuery.handleComplete( s, xhr, status, data );
5823 -
5824 - if ( head ) {
5825 - head.removeChild( script );
5826 - }
58277081 };
5828 - }
58297082
5830 - if ( s.dataType === "script" && s.cache === null ) {
5831 - s.cache = false;
5832 - }
 7083+ // Callback for when everything is done
 7084+ // It is defined here because jslint complains if it is declared
 7085+ // at the end of the function (which would be more logical and readable)
 7086+ function done( status, statusText, responses, headers ) {
58337087
5834 - if ( s.cache === false && noContent ) {
5835 - var ts = jQuery.now();
 7088+ // Called once
 7089+ if ( state === 2 ) {
 7090+ return;
 7091+ }
58367092
5837 - // try replacing _= if it is there
5838 - var ret = s.url.replace(rts, "$1_=" + ts);
 7093+ // State is "done" now
 7094+ state = 2;
58397095
5840 - // if nothing was replaced, add timestamp to the end
5841 - s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
5842 - }
 7096+ // Clear timeout if it exists
 7097+ if ( timeoutTimer ) {
 7098+ clearTimeout( timeoutTimer );
 7099+ }
58437100
5844 - // If data is available, append data to url for GET/HEAD requests
5845 - if ( s.data && noContent ) {
5846 - s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
5847 - }
 7101+ // Dereference transport for early garbage collection
 7102+ // (no matter how long the jqXHR object will be used)
 7103+ transport = undefined;
58487104
5849 - // Watch for a new set of requests
5850 - if ( s.global && jQuery.active++ === 0 ) {
5851 - jQuery.event.trigger( "ajaxStart" );
5852 - }
 7105+ // Cache response headers
 7106+ responseHeadersString = headers || "";
58537107
5854 - // Matches an absolute URL, and saves the domain
5855 - var parts = rurl.exec( s.url ),
5856 - remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host);
 7108+ // Set readyState
 7109+ jqXHR.readyState = status ? 4 : 0;
58577110
5858 - // If we're requesting a remote document
5859 - // and trying to load JSON or Script with a GET
5860 - if ( s.dataType === "script" && type === "GET" && remote ) {
5861 - var head = document.getElementsByTagName("head")[0] || document.documentElement;
5862 - var script = document.createElement("script");
5863 - if ( s.scriptCharset ) {
5864 - script.charset = s.scriptCharset;
5865 - }
5866 - script.src = s.url;
 7111+ var isSuccess,
 7112+ success,
 7113+ error,
 7114+ response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
 7115+ lastModified,
 7116+ etag;
58677117
5868 - // Handle Script loading
5869 - if ( !jsonp ) {
5870 - var done = false;
 7118+ // If successful, handle type chaining
 7119+ if ( status >= 200 && status < 300 || status === 304 ) {
58717120
5872 - // Attach handlers for all browsers
5873 - script.onload = script.onreadystatechange = function() {
5874 - if ( !done && (!this.readyState ||
5875 - this.readyState === "loaded" || this.readyState === "complete") ) {
5876 - done = true;
5877 - jQuery.handleSuccess( s, xhr, status, data );
5878 - jQuery.handleComplete( s, xhr, status, data );
 7121+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
 7122+ if ( s.ifModified ) {
58797123
5880 - // Handle memory leak in IE
5881 - script.onload = script.onreadystatechange = null;
5882 - if ( head && script.parentNode ) {
5883 - head.removeChild( script );
5884 - }
 7124+ if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
 7125+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
58857126 }
5886 - };
5887 - }
 7127+ if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
 7128+ jQuery.etag[ ifModifiedKey ] = etag;
 7129+ }
 7130+ }
58887131
5889 - // Use insertBefore instead of appendChild to circumvent an IE6 bug.
5890 - // This arises when a base node is used (#2709 and #4378).
5891 - head.insertBefore( script, head.firstChild );
 7132+ // If not modified
 7133+ if ( status === 304 ) {
58927134
5893 - // We handle everything using the script element injection
5894 - return undefined;
5895 - }
 7135+ statusText = "notmodified";
 7136+ isSuccess = true;
58967137
5897 - var requestDone = false;
 7138+ // If we have data
 7139+ } else {
58987140
5899 - // Create the request object
5900 - var xhr = s.xhr();
 7141+ try {
 7142+ success = ajaxConvert( s, response );
 7143+ statusText = "success";
 7144+ isSuccess = true;
 7145+ } catch(e) {
 7146+ // We have a parsererror
 7147+ statusText = "parsererror";
 7148+ error = e;
 7149+ }
 7150+ }
 7151+ } else {
 7152+ // We extract error from statusText
 7153+ // then normalize statusText and status for non-aborts
 7154+ error = statusText;
 7155+ if( !statusText || status ) {
 7156+ statusText = "error";
 7157+ if ( status < 0 ) {
 7158+ status = 0;
 7159+ }
 7160+ }
 7161+ }
59017162
5902 - if ( !xhr ) {
5903 - return;
5904 - }
 7163+ // Set data for the fake xhr object
 7164+ jqXHR.status = status;
 7165+ jqXHR.statusText = statusText;
59057166
5906 - // Open the socket
5907 - // Passing null username, generates a login popup on Opera (#2865)
5908 - if ( s.username ) {
5909 - xhr.open(type, s.url, s.async, s.username, s.password);
5910 - } else {
5911 - xhr.open(type, s.url, s.async);
5912 - }
 7167+ // Success/Error
 7168+ if ( isSuccess ) {
 7169+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
 7170+ } else {
 7171+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
 7172+ }
59137173
5914 - // Need an extra try/catch for cross domain requests in Firefox 3
5915 - try {
5916 - // Set content-type if data specified and content-body is valid for this type
5917 - if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) {
5918 - xhr.setRequestHeader("Content-Type", s.contentType);
 7174+ // Status-dependent callbacks
 7175+ jqXHR.statusCode( statusCode );
 7176+ statusCode = undefined;
 7177+
 7178+ if ( fireGlobals ) {
 7179+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
 7180+ [ jqXHR, s, isSuccess ? success : error ] );
59197181 }
59207182
5921 - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
5922 - if ( s.ifModified ) {
5923 - if ( jQuery.lastModified[s.url] ) {
5924 - xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
5925 - }
 7183+ // Complete
 7184+ completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
59267185
5927 - if ( jQuery.etag[s.url] ) {
5928 - xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
 7186+ if ( fireGlobals ) {
 7187+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s] );
 7188+ // Handle the global AJAX counter
 7189+ if ( !( --jQuery.active ) ) {
 7190+ jQuery.event.trigger( "ajaxStop" );
59297191 }
59307192 }
 7193+ }
59317194
5932 - // Set header so the called script knows that it's an XMLHttpRequest
5933 - // Only send the header if it's not a remote XHR
5934 - if ( !remote ) {
5935 - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
 7195+ // Attach deferreds
 7196+ deferred.promise( jqXHR );
 7197+ jqXHR.success = jqXHR.done;
 7198+ jqXHR.error = jqXHR.fail;
 7199+ jqXHR.complete = completeDeferred.done;
 7200+
 7201+ // Status-dependent callbacks
 7202+ jqXHR.statusCode = function( map ) {
 7203+ if ( map ) {
 7204+ var tmp;
 7205+ if ( state < 2 ) {
 7206+ for( tmp in map ) {
 7207+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
 7208+ }
 7209+ } else {
 7210+ tmp = map[ jqXHR.status ];
 7211+ jqXHR.then( tmp, tmp );
 7212+ }
59367213 }
 7214+ return this;
 7215+ };
59377216
5938 - // Set the Accepts header for the server, depending on the dataType
5939 - xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
5940 - s.accepts[ s.dataType ] + ", */*; q=0.01" :
5941 - s.accepts._default );
5942 - } catch( headerError ) {}
 7217+ // Remove hash character (#7531: and string promotion)
 7218+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
 7219+ // We also use the url parameter if available
 7220+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
59437221
5944 - // Allow custom headers/mimetypes and early abort
5945 - if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) {
5946 - // Handle the global AJAX counter
5947 - if ( s.global && jQuery.active-- === 1 ) {
5948 - jQuery.event.trigger( "ajaxStop" );
5949 - }
 7222+ // Extract dataTypes list
 7223+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
59507224
5951 - // close opended socket
5952 - xhr.abort();
5953 - return false;
 7225+ // Determine if a cross-domain request is in order
 7226+ if ( s.crossDomain == null ) {
 7227+ parts = rurl.exec( s.url.toLowerCase() );
 7228+ s.crossDomain = !!( parts &&
 7229+ ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
 7230+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
 7231+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
 7232+ );
59547233 }
59557234
5956 - if ( s.global ) {
5957 - jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] );
 7235+ // Convert data if not already a string
 7236+ if ( s.data && s.processData && typeof s.data !== "string" ) {
 7237+ s.data = jQuery.param( s.data, s.traditional );
59587238 }
59597239
5960 - // Wait for a response to come back
5961 - var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
5962 - // The request was aborted
5963 - if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
5964 - // Opera doesn't call onreadystatechange before this point
5965 - // so we simulate the call
5966 - if ( !requestDone ) {
5967 - jQuery.handleComplete( s, xhr, status, data );
5968 - }
 7240+ // Apply prefilters
 7241+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
59697242
5970 - requestDone = true;
5971 - if ( xhr ) {
5972 - xhr.onreadystatechange = jQuery.noop;
5973 - }
 7243+ // If request was aborted inside a prefiler, stop there
 7244+ if ( state === 2 ) {
 7245+ return false;
 7246+ }
59747247
5975 - // The transfer is complete and the data is available, or the request timed out
5976 - } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
5977 - requestDone = true;
5978 - xhr.onreadystatechange = jQuery.noop;
 7248+ // We can fire global events as of now if asked to
 7249+ fireGlobals = s.global;
59797250
5980 - status = isTimeout === "timeout" ?
5981 - "timeout" :
5982 - !jQuery.httpSuccess( xhr ) ?
5983 - "error" :
5984 - s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
5985 - "notmodified" :
5986 - "success";
 7251+ // Uppercase the type
 7252+ s.type = s.type.toUpperCase();
59877253
5988 - var errMsg;
 7254+ // Determine if request has content
 7255+ s.hasContent = !rnoContent.test( s.type );
59897256
5990 - if ( status === "success" ) {
5991 - // Watch for, and catch, XML document parse errors
5992 - try {
5993 - // process the data (runs the xml through httpData regardless of callback)
5994 - data = jQuery.httpData( xhr, s.dataType, s );
5995 - } catch( parserError ) {
5996 - status = "parsererror";
5997 - errMsg = parserError;
5998 - }
5999 - }
 7257+ // Watch for a new set of requests
 7258+ if ( fireGlobals && jQuery.active++ === 0 ) {
 7259+ jQuery.event.trigger( "ajaxStart" );
 7260+ }
60007261
6001 - // Make sure that the request was successful or notmodified
6002 - if ( status === "success" || status === "notmodified" ) {
6003 - // JSONP handles its own success callback
6004 - if ( !jsonp ) {
6005 - jQuery.handleSuccess( s, xhr, status, data );
6006 - }
6007 - } else {
6008 - jQuery.handleError( s, xhr, status, errMsg );
6009 - }
 7262+ // More options handling for requests with no content
 7263+ if ( !s.hasContent ) {
60107264
6011 - // Fire the complete handlers
6012 - if ( !jsonp ) {
6013 - jQuery.handleComplete( s, xhr, status, data );
6014 - }
 7265+ // If data is available, append data to url
 7266+ if ( s.data ) {
 7267+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
 7268+ }
60157269
6016 - if ( isTimeout === "timeout" ) {
6017 - xhr.abort();
6018 - }
 7270+ // Get ifModifiedKey before adding the anti-cache parameter
 7271+ ifModifiedKey = s.url;
60197272
6020 - // Stop memory leaks
6021 - if ( s.async ) {
6022 - xhr = null;
6023 - }
 7273+ // Add anti-cache in url if needed
 7274+ if ( s.cache === false ) {
 7275+
 7276+ var ts = jQuery.now(),
 7277+ // try replacing _= if it is there
 7278+ ret = s.url.replace( rts, "$1_=" + ts );
 7279+
 7280+ // if nothing was replaced, add timestamp to the end
 7281+ s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
60247282 }
6025 - };
 7283+ }
60267284
6027 - // Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK)
6028 - // Opera doesn't fire onreadystatechange at all on abort
6029 - try {
6030 - var oldAbort = xhr.abort;
6031 - xhr.abort = function() {
6032 - if ( xhr ) {
6033 - // oldAbort has no call property in IE7 so
6034 - // just do it this way, which works in all
6035 - // browsers
6036 - Function.prototype.call.call( oldAbort, xhr );
6037 - }
 7285+ // Set the correct header, if data is being sent
 7286+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
 7287+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
 7288+ }
60387289
6039 - onreadystatechange( "abort" );
6040 - };
6041 - } catch( abortError ) {}
 7290+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
 7291+ if ( s.ifModified ) {
 7292+ ifModifiedKey = ifModifiedKey || s.url;
 7293+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
 7294+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
 7295+ }
 7296+ if ( jQuery.etag[ ifModifiedKey ] ) {
 7297+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
 7298+ }
 7299+ }
60427300
6043 - // Timeout checker
6044 - if ( s.async && s.timeout > 0 ) {
6045 - setTimeout(function() {
6046 - // Check to see if the request is still happening
6047 - if ( xhr && !requestDone ) {
6048 - onreadystatechange( "timeout" );
6049 - }
6050 - }, s.timeout);
 7301+ // Set the Accepts header for the server, depending on the dataType
 7302+ jqXHR.setRequestHeader(
 7303+ "Accept",
 7304+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
 7305+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
 7306+ s.accepts[ "*" ]
 7307+ );
 7308+
 7309+ // Check for headers option
 7310+ for ( i in s.headers ) {
 7311+ jqXHR.setRequestHeader( i, s.headers[ i ] );
60517312 }
60527313
6053 - // Send the data
6054 - try {
6055 - xhr.send( noContent || s.data == null ? null : s.data );
 7314+ // Allow custom headers/mimetypes and early abort
 7315+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
 7316+ // Abort if not done already
 7317+ jqXHR.abort();
 7318+ return false;
60567319
6057 - } catch( sendError ) {
6058 - jQuery.handleError( s, xhr, null, sendError );
 7320+ }
60597321
6060 - // Fire the complete handlers
6061 - jQuery.handleComplete( s, xhr, status, data );
 7322+ // Install callbacks on deferreds
 7323+ for ( i in { success: 1, error: 1, complete: 1 } ) {
 7324+ jqXHR[ i ]( s[ i ] );
60627325 }
60637326
6064 - // firefox 1.5 doesn't fire statechange for sync requests
6065 - if ( !s.async ) {
6066 - onreadystatechange();
 7327+ // Get transport
 7328+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
 7329+
 7330+ // If no transport, we auto-abort
 7331+ if ( !transport ) {
 7332+ done( -1, "No Transport" );
 7333+ } else {
 7334+ jqXHR.readyState = 1;
 7335+ // Send global event
 7336+ if ( fireGlobals ) {
 7337+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
 7338+ }
 7339+ // Timeout
 7340+ if ( s.async && s.timeout > 0 ) {
 7341+ timeoutTimer = setTimeout( function(){
 7342+ jqXHR.abort( "timeout" );
 7343+ }, s.timeout );
 7344+ }
 7345+
 7346+ try {
 7347+ state = 1;
 7348+ transport.send( requestHeaders, done );
 7349+ } catch (e) {
 7350+ // Propagate exception as error if not done
 7351+ if ( status < 2 ) {
 7352+ done( -1, e );
 7353+ // Simply rethrow otherwise
 7354+ } else {
 7355+ jQuery.error( e );
 7356+ }
 7357+ }
60677358 }
60687359
6069 - // return XMLHttpRequest to allow aborting the request etc.
6070 - return xhr;
 7360+ return jqXHR;
60717361 },
60727362
60737363 // Serialize an array of form elements or a set of
@@ -6075,37 +7365,37 @@
60767366 var s = [],
60777367 add = function( key, value ) {
60787368 // If value is a function, invoke it and return its value
6079 - value = jQuery.isFunction(value) ? value() : value;
6080 - s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
 7369+ value = jQuery.isFunction( value ) ? value() : value;
 7370+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
60817371 };
6082 -
 7372+
60837373 // Set traditional to true for jQuery <= 1.3.2 behavior.
60847374 if ( traditional === undefined ) {
60857375 traditional = jQuery.ajaxSettings.traditional;
60867376 }
6087 -
 7377+
60887378 // If an array was passed in, assume that it is an array of form elements.
6089 - if ( jQuery.isArray(a) || a.jquery ) {
 7379+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
60907380 // Serialize the form elements
60917381 jQuery.each( a, function() {
60927382 add( this.name, this.value );
60937383 });
6094 -
 7384+
60957385 } else {
60967386 // If traditional, encode the "old" way (the way 1.3.2 or older
60977387 // did it), otherwise encode params recursively.
60987388 for ( var prefix in a ) {
6099 - buildParams( prefix, a[prefix], traditional, add );
 7389+ buildParams( prefix, a[ prefix ], traditional, add );
61007390 }
61017391 }
61027392
61037393 // Return the resulting serialization
6104 - return s.join("&").replace(r20, "+");
 7394+ return s.join( "&" ).replace( r20, "+" );
61057395 }
61067396 });
61077397
61087398 function buildParams( prefix, obj, traditional, add ) {
6109 - if ( jQuery.isArray(obj) && obj.length ) {
 7399+ if ( jQuery.isArray( obj ) ) {
61107400 // Serialize array item.
61117401 jQuery.each( obj, function( i, v ) {
61127402 if ( traditional || rbracket.test( prefix ) ) {
@@ -6123,18 +7413,13 @@
61247414 buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
61257415 }
61267416 });
6127 -
 7417+
61287418 } else if ( !traditional && obj != null && typeof obj === "object" ) {
6129 - if ( jQuery.isEmptyObject( obj ) ) {
6130 - add( prefix, "" );
6131 -
61327419 // Serialize object item.
6133 - } else {
6134 - jQuery.each( obj, function( k, v ) {
6135 - buildParams( prefix + "[" + k + "]", v, traditional, add );
6136 - });
 7420+ for ( var name in obj ) {
 7421+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
61377422 }
6138 -
 7423+
61397424 } else {
61407425 // Serialize scalar item.
61417426 add( prefix, obj );
@@ -6150,143 +7435,557 @@
61517436
61527437 // Last-Modified header cache for next request
61537438 lastModified: {},
6154 - etag: {},
 7439+ etag: {}
61557440
6156 - handleError: function( s, xhr, status, e ) {
6157 - // If a local callback was specified, fire it
6158 - if ( s.error ) {
6159 - s.error.call( s.context, xhr, status, e );
6160 - }
 7441+});
61617442
6162 - // Fire the global callback
6163 - if ( s.global ) {
6164 - jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] );
6165 - }
6166 - },
 7443+/* Handles responses to an ajax request:
 7444+ * - sets all responseXXX fields accordingly
 7445+ * - finds the right dataType (mediates between content-type and expected dataType)
 7446+ * - returns the corresponding response
 7447+ */
 7448+function ajaxHandleResponses( s, jqXHR, responses ) {
61677449
6168 - handleSuccess: function( s, xhr, status, data ) {
6169 - // If a local callback was specified, fire it and pass it the data
6170 - if ( s.success ) {
6171 - s.success.call( s.context, data, status, xhr );
 7450+ var contents = s.contents,
 7451+ dataTypes = s.dataTypes,
 7452+ responseFields = s.responseFields,
 7453+ ct,
 7454+ type,
 7455+ finalDataType,
 7456+ firstDataType;
 7457+
 7458+ // Fill responseXXX fields
 7459+ for( type in responseFields ) {
 7460+ if ( type in responses ) {
 7461+ jqXHR[ responseFields[type] ] = responses[ type ];
61727462 }
 7463+ }
61737464
6174 - // Fire the global callback
6175 - if ( s.global ) {
6176 - jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] );
 7465+ // Remove auto dataType and get content-type in the process
 7466+ while( dataTypes[ 0 ] === "*" ) {
 7467+ dataTypes.shift();
 7468+ if ( ct === undefined ) {
 7469+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
61777470 }
6178 - },
 7471+ }
61797472
6180 - handleComplete: function( s, xhr, status ) {
6181 - // Process result
6182 - if ( s.complete ) {
6183 - s.complete.call( s.context, xhr, status );
 7473+ // Check if we're dealing with a known content-type
 7474+ if ( ct ) {
 7475+ for ( type in contents ) {
 7476+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
 7477+ dataTypes.unshift( type );
 7478+ break;
 7479+ }
61847480 }
 7481+ }
61857482
6186 - // The request was completed
6187 - if ( s.global ) {
6188 - jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] );
 7483+ // Check to see if we have a response for the expected dataType
 7484+ if ( dataTypes[ 0 ] in responses ) {
 7485+ finalDataType = dataTypes[ 0 ];
 7486+ } else {
 7487+ // Try convertible dataTypes
 7488+ for ( type in responses ) {
 7489+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
 7490+ finalDataType = type;
 7491+ break;
 7492+ }
 7493+ if ( !firstDataType ) {
 7494+ firstDataType = type;
 7495+ }
61897496 }
 7497+ // Or just use first one
 7498+ finalDataType = finalDataType || firstDataType;
 7499+ }
61907500
6191 - // Handle the global AJAX counter
6192 - if ( s.global && jQuery.active-- === 1 ) {
6193 - jQuery.event.trigger( "ajaxStop" );
 7501+ // If we found a dataType
 7502+ // We add the dataType to the list if needed
 7503+ // and return the corresponding response
 7504+ if ( finalDataType ) {
 7505+ if ( finalDataType !== dataTypes[ 0 ] ) {
 7506+ dataTypes.unshift( finalDataType );
61947507 }
6195 - },
6196 -
6197 - triggerGlobal: function( s, type, args ) {
6198 - (s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args);
6199 - },
 7508+ return responses[ finalDataType ];
 7509+ }
 7510+}
62007511
6201 - // Determines if an XMLHttpRequest was successful or not
6202 - httpSuccess: function( xhr ) {
6203 - try {
6204 - // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
6205 - return !xhr.status && location.protocol === "file:" ||
6206 - xhr.status >= 200 && xhr.status < 300 ||
6207 - xhr.status === 304 || xhr.status === 1223;
6208 - } catch(e) {}
 7512+// Chain conversions given the request and the original response
 7513+function ajaxConvert( s, response ) {
62097514
6210 - return false;
6211 - },
 7515+ // Apply the dataFilter if provided
 7516+ if ( s.dataFilter ) {
 7517+ response = s.dataFilter( response, s.dataType );
 7518+ }
62127519
6213 - // Determines if an XMLHttpRequest returns NotModified
6214 - httpNotModified: function( xhr, url ) {
6215 - var lastModified = xhr.getResponseHeader("Last-Modified"),
6216 - etag = xhr.getResponseHeader("Etag");
 7520+ var dataTypes = s.dataTypes,
 7521+ converters = {},
 7522+ i,
 7523+ key,
 7524+ length = dataTypes.length,
 7525+ tmp,
 7526+ // Current and previous dataTypes
 7527+ current = dataTypes[ 0 ],
 7528+ prev,
 7529+ // Conversion expression
 7530+ conversion,
 7531+ // Conversion function
 7532+ conv,
 7533+ // Conversion functions (transitive conversion)
 7534+ conv1,
 7535+ conv2;
62177536
6218 - if ( lastModified ) {
6219 - jQuery.lastModified[url] = lastModified;
6220 - }
 7537+ // For each dataType in the chain
 7538+ for( i = 1; i < length; i++ ) {
62217539
6222 - if ( etag ) {
6223 - jQuery.etag[url] = etag;
 7540+ // Create converters map
 7541+ // with lowercased keys
 7542+ if ( i === 1 ) {
 7543+ for( key in s.converters ) {
 7544+ if( typeof key === "string" ) {
 7545+ converters[ key.toLowerCase() ] = s.converters[ key ];
 7546+ }
 7547+ }
62247548 }
62257549
6226 - return xhr.status === 304;
6227 - },
 7550+ // Get the dataTypes
 7551+ prev = current;
 7552+ current = dataTypes[ i ];
62287553
6229 - httpData: function( xhr, type, s ) {
6230 - var ct = xhr.getResponseHeader("content-type") || "",
6231 - xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
6232 - data = xml ? xhr.responseXML : xhr.responseText;
 7554+ // If current is auto dataType, update it to prev
 7555+ if( current === "*" ) {
 7556+ current = prev;
 7557+ // If no auto and dataTypes are actually different
 7558+ } else if ( prev !== "*" && prev !== current ) {
62337559
6234 - if ( xml && data.documentElement.nodeName === "parsererror" ) {
6235 - jQuery.error( "parsererror" );
 7560+ // Get the converter
 7561+ conversion = prev + " " + current;
 7562+ conv = converters[ conversion ] || converters[ "* " + current ];
 7563+
 7564+ // If there is no direct converter, search transitively
 7565+ if ( !conv ) {
 7566+ conv2 = undefined;
 7567+ for( conv1 in converters ) {
 7568+ tmp = conv1.split( " " );
 7569+ if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
 7570+ conv2 = converters[ tmp[1] + " " + current ];
 7571+ if ( conv2 ) {
 7572+ conv1 = converters[ conv1 ];
 7573+ if ( conv1 === true ) {
 7574+ conv = conv2;
 7575+ } else if ( conv2 === true ) {
 7576+ conv = conv1;
 7577+ }
 7578+ break;
 7579+ }
 7580+ }
 7581+ }
 7582+ }
 7583+ // If we found no converter, dispatch an error
 7584+ if ( !( conv || conv2 ) ) {
 7585+ jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
 7586+ }
 7587+ // If found converter is not an equivalence
 7588+ if ( conv !== true ) {
 7589+ // Convert with 1 or 2 converters accordingly
 7590+ response = conv ? conv( response ) : conv2( conv1(response) );
 7591+ }
62367592 }
 7593+ }
 7594+ return response;
 7595+}
62377596
6238 - // Allow a pre-filtering function to sanitize the response
6239 - // s is checked to keep backwards compatibility
6240 - if ( s && s.dataFilter ) {
6241 - data = s.dataFilter( data, type );
 7597+
 7598+
 7599+
 7600+var jsc = jQuery.now(),
 7601+ jsre = /(\=)\?(&|$)|\?\?/i;
 7602+
 7603+// Default jsonp settings
 7604+jQuery.ajaxSetup({
 7605+ jsonp: "callback",
 7606+ jsonpCallback: function() {
 7607+ return jQuery.expando + "_" + ( jsc++ );
 7608+ }
 7609+});
 7610+
 7611+// Detect, normalize options and install callbacks for jsonp requests
 7612+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
 7613+
 7614+ var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
 7615+ ( typeof s.data === "string" );
 7616+
 7617+ if ( s.dataTypes[ 0 ] === "jsonp" ||
 7618+ s.jsonp !== false && ( jsre.test( s.url ) ||
 7619+ inspectData && jsre.test( s.data ) ) ) {
 7620+
 7621+ var responseContainer,
 7622+ jsonpCallback = s.jsonpCallback =
 7623+ jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
 7624+ previous = window[ jsonpCallback ],
 7625+ url = s.url,
 7626+ data = s.data,
 7627+ replace = "$1" + jsonpCallback + "$2";
 7628+
 7629+ if ( s.jsonp !== false ) {
 7630+ url = url.replace( jsre, replace );
 7631+ if ( s.url === url ) {
 7632+ if ( inspectData ) {
 7633+ data = data.replace( jsre, replace );
 7634+ }
 7635+ if ( s.data === data ) {
 7636+ // Add callback manually
 7637+ url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
 7638+ }
 7639+ }
62427640 }
62437641
6244 - // The filter can actually parse the response
6245 - if ( typeof data === "string" ) {
6246 - // Get the JavaScript object, if JSON is used.
6247 - if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
6248 - data = jQuery.parseJSON( data );
 7642+ s.url = url;
 7643+ s.data = data;
62497644
6250 - // If the type is "script", eval it in global context
6251 - } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
6252 - jQuery.globalEval( data );
 7645+ // Install callback
 7646+ window[ jsonpCallback ] = function( response ) {
 7647+ responseContainer = [ response ];
 7648+ };
 7649+
 7650+ // Clean-up function
 7651+ jqXHR.always(function() {
 7652+ // Set callback back to previous value
 7653+ window[ jsonpCallback ] = previous;
 7654+ // Call if it was a function and we have a response
 7655+ if ( responseContainer && jQuery.isFunction( previous ) ) {
 7656+ window[ jsonpCallback ]( responseContainer[ 0 ] );
62537657 }
 7658+ });
 7659+
 7660+ // Use data converter to retrieve json after script execution
 7661+ s.converters["script json"] = function() {
 7662+ if ( !responseContainer ) {
 7663+ jQuery.error( jsonpCallback + " was not called" );
 7664+ }
 7665+ return responseContainer[ 0 ];
 7666+ };
 7667+
 7668+ // force json dataType
 7669+ s.dataTypes[ 0 ] = "json";
 7670+
 7671+ // Delegate to script
 7672+ return "script";
 7673+ }
 7674+});
 7675+
 7676+
 7677+
 7678+
 7679+// Install script dataType
 7680+jQuery.ajaxSetup({
 7681+ accepts: {
 7682+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
 7683+ },
 7684+ contents: {
 7685+ script: /javascript|ecmascript/
 7686+ },
 7687+ converters: {
 7688+ "text script": function( text ) {
 7689+ jQuery.globalEval( text );
 7690+ return text;
62547691 }
 7692+ }
 7693+});
62557694
6256 - return data;
 7695+// Handle cache's special case and global
 7696+jQuery.ajaxPrefilter( "script", function( s ) {
 7697+ if ( s.cache === undefined ) {
 7698+ s.cache = false;
62577699 }
 7700+ if ( s.crossDomain ) {
 7701+ s.type = "GET";
 7702+ s.global = false;
 7703+ }
 7704+});
62587705
 7706+// Bind script tag hack transport
 7707+jQuery.ajaxTransport( "script", function(s) {
 7708+
 7709+ // This transport only deals with cross domain requests
 7710+ if ( s.crossDomain ) {
 7711+
 7712+ var script,
 7713+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
 7714+
 7715+ return {
 7716+
 7717+ send: function( _, callback ) {
 7718+
 7719+ script = document.createElement( "script" );
 7720+
 7721+ script.async = "async";
 7722+
 7723+ if ( s.scriptCharset ) {
 7724+ script.charset = s.scriptCharset;
 7725+ }
 7726+
 7727+ script.src = s.url;
 7728+
 7729+ // Attach handlers for all browsers
 7730+ script.onload = script.onreadystatechange = function( _, isAbort ) {
 7731+
 7732+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
 7733+
 7734+ // Handle memory leak in IE
 7735+ script.onload = script.onreadystatechange = null;
 7736+
 7737+ // Remove the script
 7738+ if ( head && script.parentNode ) {
 7739+ head.removeChild( script );
 7740+ }
 7741+
 7742+ // Dereference the script
 7743+ script = undefined;
 7744+
 7745+ // Callback if not abort
 7746+ if ( !isAbort ) {
 7747+ callback( 200, "success" );
 7748+ }
 7749+ }
 7750+ };
 7751+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
 7752+ // This arises when a base node is used (#2709 and #4378).
 7753+ head.insertBefore( script, head.firstChild );
 7754+ },
 7755+
 7756+ abort: function() {
 7757+ if ( script ) {
 7758+ script.onload( 0, 1 );
 7759+ }
 7760+ }
 7761+ };
 7762+ }
62597763 });
62607764
6261 -/*
6262 - * Create the request object; Microsoft failed to properly
6263 - * implement the XMLHttpRequest in IE7 (can't request local files),
6264 - * so we use the ActiveXObject when it is available
6265 - * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
6266 - * we need a fallback.
6267 - */
6268 -if ( window.ActiveXObject ) {
6269 - jQuery.ajaxSettings.xhr = function() {
6270 - if ( window.location.protocol !== "file:" ) {
6271 - try {
6272 - return new window.XMLHttpRequest();
6273 - } catch(xhrError) {}
 7765+
 7766+
 7767+
 7768+var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
 7769+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
 7770+ // Abort all pending requests
 7771+ for ( var key in xhrCallbacks ) {
 7772+ xhrCallbacks[ key ]( 0, 1 );
62747773 }
 7774+ } : false,
 7775+ xhrId = 0,
 7776+ xhrCallbacks;
62757777
6276 - try {
6277 - return new window.ActiveXObject("Microsoft.XMLHTTP");
6278 - } catch(activeError) {}
6279 - };
 7778+// Functions to create xhrs
 7779+function createStandardXHR() {
 7780+ try {
 7781+ return new window.XMLHttpRequest();
 7782+ } catch( e ) {}
62807783 }
62817784
6282 -// Does this browser support XHR requests?
6283 -jQuery.support.ajax = !!jQuery.ajaxSettings.xhr();
 7785+function createActiveXHR() {
 7786+ try {
 7787+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
 7788+ } catch( e ) {}
 7789+}
62847790
 7791+// Create the request object
 7792+// (This is still attached to ajaxSettings for backward compatibility)
 7793+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
 7794+ /* Microsoft failed to properly
 7795+ * implement the XMLHttpRequest in IE7 (can't request local files),
 7796+ * so we use the ActiveXObject when it is available
 7797+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
 7798+ * we need a fallback.
 7799+ */
 7800+ function() {
 7801+ return !this.isLocal && createStandardXHR() || createActiveXHR();
 7802+ } :
 7803+ // For all other browsers, use the standard XMLHttpRequest object
 7804+ createStandardXHR;
62857805
 7806+// Determine support properties
 7807+(function( xhr ) {
 7808+ jQuery.extend( jQuery.support, {
 7809+ ajax: !!xhr,
 7810+ cors: !!xhr && ( "withCredentials" in xhr )
 7811+ });
 7812+})( jQuery.ajaxSettings.xhr() );
62867813
 7814+// Create transport if the browser can provide an xhr
 7815+if ( jQuery.support.ajax ) {
62877816
 7817+ jQuery.ajaxTransport(function( s ) {
 7818+ // Cross domain only allowed if supported through XMLHttpRequest
 7819+ if ( !s.crossDomain || jQuery.support.cors ) {
 7820+
 7821+ var callback;
 7822+
 7823+ return {
 7824+ send: function( headers, complete ) {
 7825+
 7826+ // Get a new xhr
 7827+ var xhr = s.xhr(),
 7828+ handle,
 7829+ i;
 7830+
 7831+ // Open the socket
 7832+ // Passing null username, generates a login popup on Opera (#2865)
 7833+ if ( s.username ) {
 7834+ xhr.open( s.type, s.url, s.async, s.username, s.password );
 7835+ } else {
 7836+ xhr.open( s.type, s.url, s.async );
 7837+ }
 7838+
 7839+ // Apply custom fields if provided
 7840+ if ( s.xhrFields ) {
 7841+ for ( i in s.xhrFields ) {
 7842+ xhr[ i ] = s.xhrFields[ i ];
 7843+ }
 7844+ }
 7845+
 7846+ // Override mime type if needed
 7847+ if ( s.mimeType && xhr.overrideMimeType ) {
 7848+ xhr.overrideMimeType( s.mimeType );
 7849+ }
 7850+
 7851+ // X-Requested-With header
 7852+ // For cross-domain requests, seeing as conditions for a preflight are
 7853+ // akin to a jigsaw puzzle, we simply never set it to be sure.
 7854+ // (it can always be set on a per-request basis or even using ajaxSetup)
 7855+ // For same-domain requests, won't change header if already provided.
 7856+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
 7857+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
 7858+ }
 7859+
 7860+ // Need an extra try/catch for cross domain requests in Firefox 3
 7861+ try {
 7862+ for ( i in headers ) {
 7863+ xhr.setRequestHeader( i, headers[ i ] );
 7864+ }
 7865+ } catch( _ ) {}
 7866+
 7867+ // Do send the request
 7868+ // This may raise an exception which is actually
 7869+ // handled in jQuery.ajax (so no try/catch here)
 7870+ xhr.send( ( s.hasContent && s.data ) || null );
 7871+
 7872+ // Listener
 7873+ callback = function( _, isAbort ) {
 7874+
 7875+ var status,
 7876+ statusText,
 7877+ responseHeaders,
 7878+ responses,
 7879+ xml;
 7880+
 7881+ // Firefox throws exceptions when accessing properties
 7882+ // of an xhr when a network error occured
 7883+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
 7884+ try {
 7885+
 7886+ // Was never called and is aborted or complete
 7887+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
 7888+
 7889+ // Only called once
 7890+ callback = undefined;
 7891+
 7892+ // Do not keep as active anymore
 7893+ if ( handle ) {
 7894+ xhr.onreadystatechange = jQuery.noop;
 7895+ if ( xhrOnUnloadAbort ) {
 7896+ delete xhrCallbacks[ handle ];
 7897+ }
 7898+ }
 7899+
 7900+ // If it's an abort
 7901+ if ( isAbort ) {
 7902+ // Abort it manually if needed
 7903+ if ( xhr.readyState !== 4 ) {
 7904+ xhr.abort();
 7905+ }
 7906+ } else {
 7907+ status = xhr.status;
 7908+ responseHeaders = xhr.getAllResponseHeaders();
 7909+ responses = {};
 7910+ xml = xhr.responseXML;
 7911+
 7912+ // Construct response list
 7913+ if ( xml && xml.documentElement /* #4958 */ ) {
 7914+ responses.xml = xml;
 7915+ }
 7916+ responses.text = xhr.responseText;
 7917+
 7918+ // Firefox throws an exception when accessing
 7919+ // statusText for faulty cross-domain requests
 7920+ try {
 7921+ statusText = xhr.statusText;
 7922+ } catch( e ) {
 7923+ // We normalize with Webkit giving an empty statusText
 7924+ statusText = "";
 7925+ }
 7926+
 7927+ // Filter status for non standard behaviors
 7928+
 7929+ // If the request is local and we have data: assume a success
 7930+ // (success with no data won't get notified, that's the best we
 7931+ // can do given current implementations)
 7932+ if ( !status && s.isLocal && !s.crossDomain ) {
 7933+ status = responses.text ? 200 : 404;
 7934+ // IE - #1450: sometimes returns 1223 when it should be 204
 7935+ } else if ( status === 1223 ) {
 7936+ status = 204;
 7937+ }
 7938+ }
 7939+ }
 7940+ } catch( firefoxAccessException ) {
 7941+ if ( !isAbort ) {
 7942+ complete( -1, firefoxAccessException );
 7943+ }
 7944+ }
 7945+
 7946+ // Call complete if needed
 7947+ if ( responses ) {
 7948+ complete( status, statusText, responses, responseHeaders );
 7949+ }
 7950+ };
 7951+
 7952+ // if we're in sync mode or it's in cache
 7953+ // and has been retrieved directly (IE6 & IE7)
 7954+ // we need to manually fire the callback
 7955+ if ( !s.async || xhr.readyState === 4 ) {
 7956+ callback();
 7957+ } else {
 7958+ handle = ++xhrId;
 7959+ if ( xhrOnUnloadAbort ) {
 7960+ // Create the active xhrs callbacks list if needed
 7961+ // and attach the unload handler
 7962+ if ( !xhrCallbacks ) {
 7963+ xhrCallbacks = {};
 7964+ jQuery( window ).unload( xhrOnUnloadAbort );
 7965+ }
 7966+ // Add to list of active xhrs callbacks
 7967+ xhrCallbacks[ handle ] = callback;
 7968+ }
 7969+ xhr.onreadystatechange = callback;
 7970+ }
 7971+ },
 7972+
 7973+ abort: function() {
 7974+ if ( callback ) {
 7975+ callback(0,1);
 7976+ }
 7977+ }
 7978+ };
 7979+ }
 7980+ });
 7981+}
 7982+
 7983+
 7984+
 7985+
62887986 var elemdisplay = {},
 7987+ iframe, iframeDoc,
62897988 rfxtypes = /^(?:toggle|show|hide)$/,
6290 - rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
 7989+ rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
62917990 timerId,
62927991 fxAttrs = [
62937992 // height animations
@@ -6295,7 +7994,11 @@
62967995 [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
62977996 // opacity animations
62987997 [ "opacity" ]
6299 - ];
 7998+ ],
 7999+ fxNow,
 8000+ requestAnimationFrame = window.webkitRequestAnimationFrame ||
 8001+ window.mozRequestAnimationFrame ||
 8002+ window.oRequestAnimationFrame;
63008003
63018004 jQuery.fn.extend({
63028005 show: function( speed, easing, callback ) {
@@ -6307,19 +8010,22 @@
63088011 } else {
63098012 for ( var i = 0, j = this.length; i < j; i++ ) {
63108013 elem = this[i];
6311 - display = elem.style.display;
63128014
6313 - // Reset the inline display of this element to learn if it is
6314 - // being hidden by cascaded rules or not
6315 - if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
6316 - display = elem.style.display = "";
6317 - }
 8015+ if ( elem.style ) {
 8016+ display = elem.style.display;
63188017
6319 - // Set elements which have been overridden with display: none
6320 - // in a stylesheet to whatever the default browser style is
6321 - // for such an element
6322 - if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
6323 - jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName));
 8018+ // Reset the inline display of this element to learn if it is
 8019+ // being hidden by cascaded rules or not
 8020+ if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
 8021+ display = elem.style.display = "";
 8022+ }
 8023+
 8024+ // Set elements which have been overridden with display: none
 8025+ // in a stylesheet to whatever the default browser style is
 8026+ // for such an element
 8027+ if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
 8028+ jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
 8029+ }
63248030 }
63258031 }
63268032
@@ -6327,10 +8033,13 @@
63288034 // to avoid the constant reflow
63298035 for ( i = 0; i < j; i++ ) {
63308036 elem = this[i];
6331 - display = elem.style.display;
63328037
6333 - if ( display === "" || display === "none" ) {
6334 - elem.style.display = jQuery.data(elem, "olddisplay") || "";
 8038+ if ( elem.style ) {
 8039+ display = elem.style.display;
 8040+
 8041+ if ( display === "" || display === "none" ) {
 8042+ elem.style.display = jQuery._data(elem, "olddisplay") || "";
 8043+ }
63358044 }
63368045 }
63378046
@@ -6344,17 +8053,21 @@
63458054
63468055 } else {
63478056 for ( var i = 0, j = this.length; i < j; i++ ) {
6348 - var display = jQuery.css( this[i], "display" );
 8057+ if ( this[i].style ) {
 8058+ var display = jQuery.css( this[i], "display" );
63498059
6350 - if ( display !== "none" ) {
6351 - jQuery.data( this[i], "olddisplay", display );
 8060+ if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
 8061+ jQuery._data( this[i], "olddisplay", display );
 8062+ }
63528063 }
63538064 }
63548065
63558066 // Set the display of the elements in a second loop
63568067 // to avoid the constant reflow
63578068 for ( i = 0; i < j; i++ ) {
6358 - this[i].style.display = "none";
 8069+ if ( this[i].style ) {
 8070+ this[i].style.display = "none";
 8071+ }
63598072 }
63608073
63618074 return this;
@@ -6392,32 +8105,54 @@
63938106 var optall = jQuery.speed(speed, easing, callback);
63948107
63958108 if ( jQuery.isEmptyObject( prop ) ) {
6396 - return this.each( optall.complete );
 8109+ return this.each( optall.complete, [ false ] );
63978110 }
63988111
 8112+ // Do not change referenced properties as per-property easing will be lost
 8113+ prop = jQuery.extend( {}, prop );
 8114+
63998115 return this[ optall.queue === false ? "each" : "queue" ](function() {
64008116 // XXX 'this' does not always have a nodeName when running the
64018117 // test suite
64028118
6403 - var opt = jQuery.extend({}, optall), p,
 8119+ if ( optall.queue === false ) {
 8120+ jQuery._mark( this );
 8121+ }
 8122+
 8123+ var opt = jQuery.extend( {}, optall ),
64048124 isElement = this.nodeType === 1,
64058125 hidden = isElement && jQuery(this).is(":hidden"),
6406 - self = this;
 8126+ name, val, p,
 8127+ display, e,
 8128+ parts, start, end, unit;
64078129
 8130+ // will store per property easing and be used to determine when an animation is complete
 8131+ opt.animatedProperties = {};
 8132+
64088133 for ( p in prop ) {
6409 - var name = jQuery.camelCase( p );
64108134
 8135+ // property name normalization
 8136+ name = jQuery.camelCase( p );
64118137 if ( p !== name ) {
64128138 prop[ name ] = prop[ p ];
64138139 delete prop[ p ];
6414 - p = name;
64158140 }
64168141
6417 - if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
6418 - return opt.complete.call(this);
 8142+ val = prop[ name ];
 8143+
 8144+ // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
 8145+ if ( jQuery.isArray( val ) ) {
 8146+ opt.animatedProperties[ name ] = val[ 1 ];
 8147+ val = prop[ name ] = val[ 0 ];
 8148+ } else {
 8149+ opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
64198150 }
64208151
6421 - if ( isElement && ( p === "height" || p === "width" ) ) {
 8152+ if ( val === "hide" && hidden || val === "show" && !hidden ) {
 8153+ return opt.complete.call( this );
 8154+ }
 8155+
 8156+ if ( isElement && ( name === "height" || name === "width" ) ) {
64228157 // Make sure that nothing sneaks out
64238158 // Record all 3 overflow attributes because IE does not
64248159 // change the overflow attribute when overflowX and
@@ -6433,7 +8168,7 @@
64348169 this.style.display = "inline-block";
64358170
64368171 } else {
6437 - var display = defaultDisplay(this.nodeName);
 8172+ display = defaultDisplay( this.nodeName );
64388173
64398174 // inline-level elements accept inline-block;
64408175 // block-level elements need to be inline with layout
@@ -6447,44 +8182,37 @@
64488183 }
64498184 }
64508185 }
6451 -
6452 - if ( jQuery.isArray( prop[p] ) ) {
6453 - // Create (if needed) and add to specialEasing
6454 - (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
6455 - prop[p] = prop[p][0];
6456 - }
64578186 }
64588187
64598188 if ( opt.overflow != null ) {
64608189 this.style.overflow = "hidden";
64618190 }
64628191
6463 - opt.curAnim = jQuery.extend({}, prop);
 8192+ for ( p in prop ) {
 8193+ e = new jQuery.fx( this, opt, p );
 8194+ val = prop[ p ];
64648195
6465 - jQuery.each( prop, function( name, val ) {
6466 - var e = new jQuery.fx( self, opt, name );
6467 -
64688196 if ( rfxtypes.test(val) ) {
6469 - e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
 8197+ e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
64708198
64718199 } else {
6472 - var parts = rfxnum.exec(val),
6473 - start = e.cur() || 0;
 8200+ parts = rfxnum.exec( val );
 8201+ start = e.cur();
64748202
64758203 if ( parts ) {
6476 - var end = parseFloat( parts[2] ),
6477 - unit = parts[3] || "px";
 8204+ end = parseFloat( parts[2] );
 8205+ unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
64788206
64798207 // We need to compute starting value
64808208 if ( unit !== "px" ) {
6481 - jQuery.style( self, name, (end || 1) + unit);
 8209+ jQuery.style( this, p, (end || 1) + unit);
64828210 start = ((end || 1) / e.cur()) * start;
6483 - jQuery.style( self, name, start + unit);
 8211+ jQuery.style( this, p, start + unit);
64848212 }
64858213
64868214 // If a +=/-= token was provided, we're doing a relative animation
64878215 if ( parts[1] ) {
6488 - end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
 8216+ end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
64898217 }
64908218
64918219 e.custom( start, end, unit );
@@ -6493,7 +8221,7 @@
64948222 e.custom( start, val, "" );
64958223 }
64968224 }
6497 - });
 8225+ }
64988226
64998227 // For JS strict compliance
65008228 return true;
@@ -6501,15 +8229,18 @@
65028230 },
65038231
65048232 stop: function( clearQueue, gotoEnd ) {
6505 - var timers = jQuery.timers;
6506 -
65078233 if ( clearQueue ) {
65088234 this.queue([]);
65098235 }
65108236
65118237 this.each(function() {
6512 - // go in reverse order so anything added to the queue during the loop is ignored
6513 - for ( var i = timers.length - 1; i >= 0; i-- ) {
 8238+ var timers = jQuery.timers,
 8239+ i = timers.length;
 8240+ // clear marker counters if we know they won't be
 8241+ if ( !gotoEnd ) {
 8242+ jQuery._unmark( true, this );
 8243+ }
 8244+ while ( i-- ) {
65148245 if ( timers[i].elem === this ) {
65158246 if (gotoEnd) {
65168247 // force the next step to be the last
@@ -6531,6 +8262,17 @@
65328263
65338264 });
65348265
 8266+// Animations created synchronously will run synchronously
 8267+function createFxNow() {
 8268+ setTimeout( clearFxNow, 0 );
 8269+ return ( fxNow = jQuery.now() );
 8270+}
 8271+
 8272+function clearFxNow() {
 8273+ fxNow = undefined;
 8274+}
 8275+
 8276+// Generate parameters to create a standard animation
65358277 function genFx( type, num ) {
65368278 var obj = {};
65378279
@@ -6569,13 +8311,16 @@
65708312
65718313 // Queueing
65728314 opt.old = opt.complete;
6573 - opt.complete = function() {
6574 - if ( opt.queue !== false ) {
6575 - jQuery(this).dequeue();
6576 - }
 8315+ opt.complete = function( noUnmark ) {
65778316 if ( jQuery.isFunction( opt.old ) ) {
65788317 opt.old.call( this );
65798318 }
 8319+
 8320+ if ( opt.queue !== false ) {
 8321+ jQuery.dequeue( this );
 8322+ } else if ( noUnmark !== false ) {
 8323+ jQuery._unmark( this );
 8324+ }
65808325 };
65818326
65828327 return opt;
@@ -6597,9 +8342,7 @@
65988343 this.elem = elem;
65998344 this.prop = prop;
66008345
6601 - if ( !options.orig ) {
6602 - options.orig = {};
6603 - }
 8346+ options.orig = options.orig || {};
66048347 }
66058348
66068349 });
@@ -6620,19 +8363,24 @@
66218364 return this.elem[ this.prop ];
66228365 }
66238366
6624 - var r = parseFloat( jQuery.css( this.elem, this.prop ) );
6625 - return r && r > -10000 ? r : 0;
 8367+ var parsed,
 8368+ r = jQuery.css( this.elem, this.prop );
 8369+ // Empty strings, null, undefined and "auto" are converted to 0,
 8370+ // complex values such as "rotate(1rad)" are returned as is,
 8371+ // simple values such as "10px" are parsed to Float.
 8372+ return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
66268373 },
66278374
66288375 // Start an animation from one number to another
66298376 custom: function( from, to, unit ) {
66308377 var self = this,
6631 - fx = jQuery.fx;
 8378+ fx = jQuery.fx,
 8379+ raf;
66328380
6633 - this.startTime = jQuery.now();
 8381+ this.startTime = fxNow || createFxNow();
66348382 this.start = from;
66358383 this.end = to;
6636 - this.unit = unit || this.unit || "px";
 8384+ this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
66378385 this.now = this.start;
66388386 this.pos = this.state = 0;
66398387
@@ -6643,7 +8391,20 @@
66448392 t.elem = this.elem;
66458393
66468394 if ( t() && jQuery.timers.push(t) && !timerId ) {
6647 - timerId = setInterval(fx.tick, fx.interval);
 8395+ // Use requestAnimationFrame instead of setInterval if available
 8396+ if ( requestAnimationFrame ) {
 8397+ timerId = true;
 8398+ raf = function() {
 8399+ // When timerId gets set to null at any point, this stops
 8400+ if ( timerId ) {
 8401+ requestAnimationFrame( raf );
 8402+ fx.tick();
 8403+ }
 8404+ };
 8405+ requestAnimationFrame( raf );
 8406+ } else {
 8407+ timerId = setInterval( fx.tick, fx.interval );
 8408+ }
66488409 }
66498410 },
66508411
@@ -6674,60 +8435,64 @@
66758436
66768437 // Each step of an animation
66778438 step: function( gotoEnd ) {
6678 - var t = jQuery.now(), done = true;
 8439+ var t = fxNow || createFxNow(),
 8440+ done = true,
 8441+ elem = this.elem,
 8442+ options = this.options,
 8443+ i, n;
66798444
6680 - if ( gotoEnd || t >= this.options.duration + this.startTime ) {
 8445+ if ( gotoEnd || t >= options.duration + this.startTime ) {
66818446 this.now = this.end;
66828447 this.pos = this.state = 1;
66838448 this.update();
66848449
6685 - this.options.curAnim[ this.prop ] = true;
 8450+ options.animatedProperties[ this.prop ] = true;
66868451
6687 - for ( var i in this.options.curAnim ) {
6688 - if ( this.options.curAnim[i] !== true ) {
 8452+ for ( i in options.animatedProperties ) {
 8453+ if ( options.animatedProperties[i] !== true ) {
66898454 done = false;
66908455 }
66918456 }
66928457
66938458 if ( done ) {
66948459 // Reset the overflow
6695 - if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
6696 - var elem = this.elem,
6697 - options = this.options;
 8460+ if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
66988461
66998462 jQuery.each( [ "", "X", "Y" ], function (index, value) {
67008463 elem.style[ "overflow" + value ] = options.overflow[index];
6701 - } );
 8464+ });
67028465 }
67038466
67048467 // Hide the element if the "hide" operation was done
6705 - if ( this.options.hide ) {
6706 - jQuery(this.elem).hide();
 8468+ if ( options.hide ) {
 8469+ jQuery(elem).hide();
67078470 }
67088471
67098472 // Reset the properties, if the item has been hidden or shown
6710 - if ( this.options.hide || this.options.show ) {
6711 - for ( var p in this.options.curAnim ) {
6712 - jQuery.style( this.elem, p, this.options.orig[p] );
 8473+ if ( options.hide || options.show ) {
 8474+ for ( var p in options.animatedProperties ) {
 8475+ jQuery.style( elem, p, options.orig[p] );
67138476 }
67148477 }
67158478
67168479 // Execute the complete function
6717 - this.options.complete.call( this.elem );
 8480+ options.complete.call( elem );
67188481 }
67198482
67208483 return false;
67218484
67228485 } else {
6723 - var n = t - this.startTime;
6724 - this.state = n / this.options.duration;
 8486+ // classical easing cannot be used with an Infinity duration
 8487+ if ( options.duration == Infinity ) {
 8488+ this.now = t;
 8489+ } else {
 8490+ n = t - this.startTime;
 8491+ this.state = n / options.duration;
67258492
6726 - // Perform the easing function, defaults to swing
6727 - var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
6728 - var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
6729 - this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
6730 - this.now = this.start + ((this.end - this.start) * this.pos);
6731 -
 8493+ // Perform the easing function, defaults to swing
 8494+ this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
 8495+ this.now = this.start + ((this.end - this.start) * this.pos);
 8496+ }
67328497 // Perform the next step of the animation
67338498 this.update();
67348499 }
@@ -6738,9 +8503,7 @@
67398504
67408505 jQuery.extend( jQuery.fx, {
67418506 tick: function() {
6742 - var timers = jQuery.timers;
6743 -
6744 - for ( var i = 0; i < timers.length; i++ ) {
 8507+ for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
67458508 if ( !timers[i]() ) {
67468509 timers.splice(i--, 1);
67478510 }
@@ -6788,17 +8551,47 @@
67898552 };
67908553 }
67918554
 8555+// Try to restore the default display value of an element
67928556 function defaultDisplay( nodeName ) {
 8557+
67938558 if ( !elemdisplay[ nodeName ] ) {
6794 - var elem = jQuery("<" + nodeName + ">").appendTo("body"),
6795 - display = elem.css("display");
67968559
 8560+ var body = document.body,
 8561+ elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
 8562+ display = elem.css( "display" );
 8563+
67978564 elem.remove();
67988565
 8566+ // If the simple way fails,
 8567+ // get element's real default display by attaching it to a temp iframe
67998568 if ( display === "none" || display === "" ) {
6800 - display = "block";
 8569+ // No iframe to use yet, so create it
 8570+ if ( !iframe ) {
 8571+ iframe = document.createElement( "iframe" );
 8572+ iframe.frameBorder = iframe.width = iframe.height = 0;
 8573+ }
 8574+
 8575+ body.appendChild( iframe );
 8576+
 8577+ // Create a cacheable copy of the iframe document on first call.
 8578+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
 8579+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
 8580+ if ( !iframeDoc || !iframe.createElement ) {
 8581+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
 8582+ iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
 8583+ iframeDoc.close();
 8584+ }
 8585+
 8586+ elem = iframeDoc.createElement( nodeName );
 8587+
 8588+ iframeDoc.body.appendChild( elem );
 8589+
 8590+ display = jQuery.css( elem, "display" );
 8591+
 8592+ body.removeChild( iframe );
68018593 }
68028594
 8595+ // Store the correct default display
68038596 elemdisplay[ nodeName ] = display;
68048597 }
68058598
@@ -6815,7 +8608,7 @@
68168609 jQuery.fn.offset = function( options ) {
68178610 var elem = this[0], box;
68188611
6819 - if ( options ) {
 8612+ if ( options ) {
68208613 return this.each(function( i ) {
68218614 jQuery.offset.setOffset( this, options, i );
68228615 });
@@ -6838,15 +8631,15 @@
68398632
68408633 // Make sure we're not dealing with a disconnected DOM node
68418634 if ( !box || !jQuery.contains( docElem, elem ) ) {
6842 - return box || { top: 0, left: 0 };
 8635+ return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
68438636 }
68448637
68458638 var body = doc.body,
68468639 win = getWindow(doc),
68478640 clientTop = docElem.clientTop || body.clientTop || 0,
68488641 clientLeft = docElem.clientLeft || body.clientLeft || 0,
6849 - scrollTop = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ),
6850 - scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),
 8642+ scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
 8643+ scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
68518644 top = box.top + scrollTop - clientTop,
68528645 left = box.left + scrollLeft - clientLeft;
68538646
@@ -6857,7 +8650,7 @@
68588651 jQuery.fn.offset = function( options ) {
68598652 var elem = this[0];
68608653
6861 - if ( options ) {
 8654+ if ( options ) {
68628655 return this.each(function( i ) {
68638656 jQuery.offset.setOffset( this, options, i );
68648657 });
@@ -6959,7 +8752,6 @@
69608753 this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
69618754
69628755 body.removeChild( container );
6963 - body = container = innerDiv = checkDiv = table = td = null;
69648756 jQuery.offset.initialize = jQuery.noop;
69658757 },
69668758
@@ -6976,7 +8768,7 @@
69778769
69788770 return { top: top, left: left };
69798771 },
6980 -
 8772+
69818773 setOffset: function( elem, options, i ) {
69828774 var position = jQuery.css( elem, "position" );
69838775
@@ -6989,17 +8781,19 @@
69908782 curOffset = curElem.offset(),
69918783 curCSSTop = jQuery.css( elem, "top" ),
69928784 curCSSLeft = jQuery.css( elem, "left" ),
6993 - calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),
 8785+ calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
69948786 props = {}, curPosition = {}, curTop, curLeft;
69958787
6996 - // need to be able to calculate position if either top or left is auto and position is absolute
 8788+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
69978789 if ( calculatePosition ) {
69988790 curPosition = curElem.position();
 8791+ curTop = curPosition.top;
 8792+ curLeft = curPosition.left;
 8793+ } else {
 8794+ curTop = parseFloat( curCSSTop ) || 0;
 8795+ curLeft = parseFloat( curCSSLeft ) || 0;
69998796 }
70008797
7001 - curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0;
7002 - curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
7003 -
70048798 if ( jQuery.isFunction( options ) ) {
70058799 options = options.call( elem, i, curOffset );
70068800 }
@@ -7010,7 +8804,7 @@
70118805 if (options.left != null) {
70128806 props.left = (options.left - curOffset.left) + curLeft;
70138807 }
7014 -
 8808+
70158809 if ( "using" in options ) {
70168810 options.using.call( elem, props );
70178811 } else {
@@ -7068,29 +8862,16 @@
70698863 jQuery.each( ["Left", "Top"], function( i, name ) {
70708864 var method = "scroll" + name;
70718865
7072 - jQuery.fn[ method ] = function(val) {
7073 - var elem = this[0], win;
7074 -
7075 - if ( !elem ) {
7076 - return null;
7077 - }
 8866+ jQuery.fn[ method ] = function( val ) {
 8867+ var elem, win;
70788868
7079 - if ( val !== undefined ) {
7080 - // Set the scroll offset
7081 - return this.each(function() {
7082 - win = getWindow( this );
 8869+ if ( val === undefined ) {
 8870+ elem = this[ 0 ];
70838871
7084 - if ( win ) {
7085 - win.scrollTo(
7086 - !i ? val : jQuery(win).scrollLeft(),
7087 - i ? val : jQuery(win).scrollTop()
7088 - );
 8872+ if ( !elem ) {
 8873+ return null;
 8874+ }
70898875
7090 - } else {
7091 - this[ method ] = val;
7092 - }
7093 - });
7094 - } else {
70958876 win = getWindow( elem );
70968877
70978878 // Return the scroll offset
@@ -7099,6 +8880,21 @@
71008881 win.document.body[ method ] :
71018882 elem[ method ];
71028883 }
 8884+
 8885+ // Set the scroll offset
 8886+ return this.each(function() {
 8887+ win = getWindow( this );
 8888+
 8889+ if ( win ) {
 8890+ win.scrollTo(
 8891+ !i ? val : jQuery( win ).scrollLeft(),
 8892+ i ? val : jQuery( win ).scrollTop()
 8893+ );
 8894+
 8895+ } else {
 8896+ this[ method ] = val;
 8897+ }
 8898+ });
71038899 };
71048900 });
71058901
@@ -7113,22 +8909,24 @@
71148910
71158911
71168912
7117 -// Create innerHeight, innerWidth, outerHeight and outerWidth methods
 8913+// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
71188914 jQuery.each([ "Height", "Width" ], function( i, name ) {
71198915
71208916 var type = name.toLowerCase();
71218917
71228918 // innerHeight and innerWidth
7123 - jQuery.fn["inner" + name] = function() {
7124 - return this[0] ?
7125 - parseFloat( jQuery.css( this[0], type, "padding" ) ) :
 8919+ jQuery.fn[ "inner" + name ] = function() {
 8920+ var elem = this[0];
 8921+ return elem && elem.style ?
 8922+ parseFloat( jQuery.css( elem, type, "padding" ) ) :
71268923 null;
71278924 };
71288925
71298926 // outerHeight and outerWidth
7130 - jQuery.fn["outer" + name] = function( margin ) {
7131 - return this[0] ?
7132 - parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
 8927+ jQuery.fn[ "outer" + name ] = function( margin ) {
 8928+ var elem = this[0];
 8929+ return elem && elem.style ?
 8930+ parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
71338931 null;
71348932 };
71358933
@@ -7138,7 +8936,7 @@
71398937 if ( !elem ) {
71408938 return size == null ? null : this;
71418939 }
7142 -
 8940+
71438941 if ( jQuery.isFunction( size ) ) {
71448942 return this.each(function( i ) {
71458943 var self = jQuery( this );
@@ -7148,8 +8946,10 @@
71498947
71508948 if ( jQuery.isWindow( elem ) ) {
71518949 // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
7152 - return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
7153 - elem.document.body[ "client" + name ];
 8950+ // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
 8951+ var docElemProp = elem.document.documentElement[ "client" + name ];
 8952+ return elem.document.compatMode === "CSS1Compat" && docElemProp ||
 8953+ elem.document.body[ "client" + name ] || docElemProp;
71548954
71558955 // Get document width or height
71568956 } else if ( elem.nodeType === 9 ) {
@@ -7176,4 +8976,6 @@
71778977 });
71788978
71798979
 8980+// Expose jQuery to the global object
 8981+window.jQuery = window.$ = jQuery;
71808982 })(window);
Property changes on: branches/REL1_18/phase3/resources/jquery/jquery.js
___________________________________________________________________
Added: svn:mergeinfo
71818983 Merged /branches/REL1_15/phase3/resources/jquery/jquery.js:r51646
71828984 Merged /branches/REL1_17/phase3/resources/jquery/jquery.js:r81445,81448
71838985 Merged /branches/sqlite/resources/jquery/jquery.js:r58211-58321
71848986 Merged /trunk/phase3/resources/jquery/jquery.js:r87586,87627-87628,87630,87632,87636,87640,87644,87840,87998,88085,88118,88124,88134,88231-88232,88250,88492,88498,88513,88750,89099,89108,89853,90602,90612,90618,90626,90630-90631,90637,90655,90657,90666,90812,91845
71858987 Merged /branches/new-installer/phase3/resources/jquery/jquery.js:r43664-66004

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89853Added jquery.qunit.completenessTest.js (A jQuery/QUnit test coverage utility)...krinkle22:15, 10 June 2011
r89866Upgrade jQuery from 1.4.4 to 1.6.1...krinkle00:25, 11 June 2011
r91845Update jQuery from 1.6.1 to 1.6.2 (maintenance/bugfix release)...krinkle21:17, 10 July 2011
r91967libxml >= 2.7.3 ha a 10mb cap on the size of a text node and the LIBXML_PARSE...ariel15:01, 12 July 2011

Status & tagging log