Changeset 23301
- Timestamp:
- 01/15/2013 05:52:42 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/jquery/jquery-migrate.js
r23182 r23301 1 1 /*! 2 * jQuery Migrate - v1.0.0 pre - 2012-12-172 * jQuery Migrate - v1.0.0 - 2013-01-14 3 3 * https://github.com/jquery/jquery-migrate 4 * Copyright 20 12 jQuery Foundationand other contributors; Licensed MIT4 * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT 5 5 */ 6 7 6 (function( jQuery, window, undefined ) { 8 7 "use strict"; 9 8 10 // Use Uglify to do conditional compilation of warning messages;11 // the minified version will set this to false and remove dead code.12 if ( typeof window.JQMIGRATE_WARN === "undefined" ) {13 window.JQMIGRATE_WARN = true;14 }15 16 9 17 10 var warnedAbout = {}; … … 19 12 // List of warnings already given; public read only 20 13 jQuery.migrateWarnings = []; 14 15 // Set to true to prevent console output; migrateWarnings still maintained 16 // jQuery.migrateMute = false; 21 17 22 18 // Forget any warnings we've already given; public … … 27 23 28 24 function migrateWarn( msg) { 29 if ( window.JQMIGRATE_WARN ) { 30 if ( !warnedAbout[ msg ] ) { 31 warnedAbout[ msg ] = true; 32 jQuery.migrateWarnings.push( msg ); 33 if ( window.console && console.warn ) { 34 console.warn( "JQMIGRATE: " + msg ); 35 } 25 if ( !warnedAbout[ msg ] ) { 26 warnedAbout[ msg ] = true; 27 jQuery.migrateWarnings.push( msg ); 28 if ( window.console && console.warn && !jQuery.migrateMute ) { 29 console.warn( "JQMIGRATE: " + msg ); 36 30 } 37 31 } … … 39 33 40 34 function migrateWarnProp( obj, prop, value, msg ) { 41 if ( window.JQMIGRATE_WARN &&Object.defineProperty ) {35 if ( Object.defineProperty ) { 42 36 // On ES5 browsers (non-oldIE), warn if the code tries to get prop; 43 37 // allow property to be overwritten in case some other plugin wants it … … 66 60 } 67 61 68 if ( window.JQMIGRATE_WARN &&document.compatMode === "BackCompat" ) {62 if ( document.compatMode === "BackCompat" ) { 69 63 // jQuery has never supported or tested Quirks Mode 70 64 migrateWarn( "jQuery is not compatible with Quirks Mode" ); … … 79 73 function() { return undefined; }, 80 74 rnoType = /^(?:input|button)$/i, 81 rnoAttrNodeType = /^[238]$/; 75 rnoAttrNodeType = /^[238]$/, 76 rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, 77 ruseDefault = /^(?:checked|selected)$/i; 82 78 83 79 // jQuery.attrFn … … 85 81 86 82 jQuery.attr = function( elem, name, value, pass ) { 83 var lowerName = name.toLowerCase(), 84 nType = elem && elem.nodeType; 85 87 86 if ( pass ) { 88 87 migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); 89 if ( elem && !rnoAttrNodeType.test( elem.nodeType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {88 if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) { 90 89 return jQuery( elem )[ name ]( value ); 91 90 } … … 97 96 } 98 97 98 // Restore boolHook for boolean property/attribute synchronization 99 if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) { 100 jQuery.attrHooks[ lowerName ] = { 101 get: function( elem, name ) { 102 // Align boolean attributes with corresponding properties 103 // Fall back to attribute presence where some booleans are not supported 104 var attrNode, 105 property = jQuery.prop( elem, name ); 106 return property === true || typeof property !== "boolean" && 107 ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? 108 109 name.toLowerCase() : 110 undefined; 111 }, 112 set: function( elem, value, name ) { 113 var propName; 114 if ( value === false ) { 115 // Remove boolean attributes when set to false 116 jQuery.removeAttr( elem, name ); 117 } else { 118 // value is true since we know at this point it's type boolean and not false 119 // Set boolean attributes to the same name and set the DOM property 120 propName = jQuery.propFix[ name ] || name; 121 if ( propName in elem ) { 122 // Only set the IDL specifically if it already exists on the element 123 elem[ propName ] = true; 124 } 125 126 elem.setAttribute( name, name.toLowerCase() ); 127 } 128 return name; 129 } 130 }; 131 132 // Warn only for attributes that can remain distinct from their properties post-1.9 133 if ( ruseDefault.test( lowerName ) ) { 134 migrateWarn( "jQuery.fn.attr(" + lowerName + ") may use property instead of attribute" ); 135 } 136 } 137 99 138 return attr.call( jQuery, elem, name, value ); 100 139 }; … … 103 142 jQuery.attrHooks.value = { 104 143 get: function( elem, name ) { 105 if ( jQuery.nodeName( elem, "button" ) ) { 144 var nodeName = ( elem.nodeName || "" ).toLowerCase(); 145 if ( nodeName === "button" ) { 106 146 return valueAttrGet.apply( this, arguments ); 107 147 } 108 migrateWarn("property-based jQuery.fn.attr('value') is deprecated"); 148 if ( nodeName !== "input" && nodeName !== "option" ) { 149 migrateWarn("property-based jQuery.fn.attr('value') is deprecated"); 150 } 109 151 return name in elem ? 110 152 elem.value : 111 153 null; 112 154 }, 113 set: function( elem, value, name ) { 114 if ( jQuery.nodeName( elem, "button" ) ) { 155 set: function( elem, value ) { 156 var nodeName = ( elem.nodeName || "" ).toLowerCase(); 157 if ( nodeName === "button" ) { 115 158 return valueAttrSet.apply( this, arguments ); 116 159 } 117 migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated"); 160 if ( nodeName !== "input" && nodeName !== "option" ) { 161 migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated"); 162 } 118 163 // Does not return so that setAttribute is also used 119 164 elem.value = value; … … 123 168 124 169 var matched, browser, 125 oldAccess = jQuery.access,126 170 oldInit = jQuery.fn.init, 127 171 // Note this does NOT include the # XSS fix from 1.7! 128 rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w -]*))$/;172 rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/; 129 173 130 174 // $(html) "looks like html" rule change … … 151 195 }; 152 196 jQuery.fn.init.prototype = jQuery.fn; 153 154 if ( jQuery.fn.jquery >= "1.9" ) {155 // jQuery.access( ..., pass )156 jQuery.access = function( elems, fn, key, value, chainable, emptyGet, pass ) {157 var i = 0,158 length = elems.length;159 160 if ( key && typeof key === "object" && value ) {161 for ( i in key ) {162 jQuery.access( elems, fn, i, key[i], true, emptyGet, value );163 }164 return elems;165 } else if ( pass && key != null && value !== undefined ) {166 for ( ; i < length; i++ ) {167 fn( elems[i], key, value, true );168 }169 return elems;170 }171 return oldAccess.call( jQuery, elems, fn, key, value, chainable, emptyGet );172 };173 }174 197 175 198 jQuery.uaMatch = function( ua ) { … … 251 274 252 275 253 var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack, 276 var rscriptType = /\/(java|ecma)script/i, 277 oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack, 254 278 oldFragment = jQuery.buildFragment; 255 279 … … 259 283 }; 260 284 261 jQuery.buildFragment = function( args, context, scripts ) { 262 var fragment; 263 264 if ( !oldFragment ) { 265 // Set context from what may come in as undefined or a jQuery collection or a node 266 // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 & 267 // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception 285 // Since jQuery.clean is used internally on older versions, we only shim if it's missing 286 if ( !jQuery.clean ) { 287 jQuery.clean = function( elems, context, fragment, scripts ) { 288 // Set context per 1.8 logic 268 289 context = context || document; 269 290 context = !context.nodeType && context[0] || context; 270 291 context = context.ownerDocument || context; 271 292 272 fragment = context.createDocumentFragment(); 273 jQuery.clean( args, context, fragment, scripts ); 274 275 migrateWarn("jQuery.buildFragment() is deprecated"); 276 return { fragment: fragment, cacheable: false }; 277 } 278 // Don't warn if we are in a version where buildFragment is used internally 279 return oldFragment.apply( this, arguments ); 293 migrateWarn("jQuery.clean() is deprecated"); 294 295 var i, elem, handleScript, jsTags, 296 ret = []; 297 298 jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes ); 299 300 // Complex logic lifted directly from jQuery 1.8 301 if ( fragment ) { 302 // Special handling of each script element 303 handleScript = function( elem ) { 304 // Check if we consider it executable 305 if ( !elem.type || rscriptType.test( elem.type ) ) { 306 // Detach the script and store it in the scripts array (if provided) or the fragment 307 // Return truthy to indicate that it has been handled 308 return scripts ? 309 scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) : 310 fragment.appendChild( elem ); 311 } 312 }; 313 314 for ( i = 0; (elem = ret[i]) != null; i++ ) { 315 // Check if we're done after handling an executable script 316 if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) { 317 // Append to fragment and handle embedded scripts 318 fragment.appendChild( elem ); 319 if ( typeof elem.getElementsByTagName !== "undefined" ) { 320 // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration 321 jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript ); 322 323 // Splice the scripts into ret after their former ancestor and advance our index beyond them 324 ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); 325 i += jsTags.length; 326 } 327 } 328 } 329 } 330 331 return ret; 332 }; 333 } 334 335 jQuery.buildFragment = function( elems, context, scripts, selection ) { 336 var ret, 337 warning = "jQuery.buildFragment() is deprecated"; 338 339 // Set context per 1.8 logic 340 context = context || document; 341 context = !context.nodeType && context[0] || context; 342 context = context.ownerDocument || context; 343 344 try { 345 ret = oldFragment.call( jQuery, elems, context, scripts, selection ); 346 347 // jQuery < 1.8 required arrayish context; jQuery 1.9 fails on it 348 } catch( x ) { 349 ret = oldFragment.call( jQuery, elems, context.nodeType ? [ context ] : context[ 0 ], scripts, selection ); 350 351 // Success from tweaking context means buildFragment was called by the user 352 migrateWarn( warning ); 353 } 354 355 // jQuery < 1.9 returned an object instead of the fragment itself 356 if ( !ret.fragment ) { 357 migrateWarnProp( ret, "fragment", ret, warning ); 358 migrateWarnProp( ret, "cacheable", false, warning ); 359 } 360 361 return ret; 280 362 }; 281 363 … … 304 386 } 305 387 388 // Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7 389 migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" ); 390 306 391 // Support for 'hover' pseudo-event and ajax event warnings 307 392 jQuery.event.add = function( elem, types, handler, data, selector ){ … … 315 400 }; 316 401 317 jQuery.fn.error = function( data, fn) {402 jQuery.fn.error = function() { 318 403 var args = Array.prototype.slice.call( arguments, 0); 319 404 migrateWarn("jQuery.fn.error() is deprecated"); … … 388 473 function( _, name ) { 389 474 jQuery.event.special[ name ] = { 390 setup: function( data) {475 setup: function() { 391 476 var elem = this; 392 477 393 478 // The document needs no shimming; must be !== for oldIE 394 479 if ( elem !== document ) { 395 jQuery.event.add( document, name + "." + jQuery.guid, function( event) {480 jQuery.event.add( document, name + "." + jQuery.guid, function() { 396 481 jQuery.event.trigger( name, null, elem, true ); 397 482 }); … … 400 485 return false; 401 486 }, 402 teardown: function( data, handleObj) {487 teardown: function() { 403 488 if ( this !== document ) { 404 489 jQuery.event.remove( document, name + "." + jQuery._data( this, name ) ); … … 406 491 return false; 407 492 } 408 } 493 }; 409 494 } 410 495 ); -
trunk/wp-includes/js/jquery/jquery.js
r23180 r23301 1 1 /*! 2 * jQuery JavaScript Library v1.9.0 b12 * jQuery JavaScript Library v1.9.0 3 3 * http://jquery.com/ 4 4 * … … 6 6 * http://sizzlejs.com/ 7 7 * 8 * Copyright 20 12 jQuery Foundationand other contributors8 * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors 9 9 * Released under the MIT license 10 10 * http://jquery.org/license 11 11 * 12 * Date: 201 2-12-1612 * Date: 2013-1-14 13 13 */ 14 14 (function( window, undefined ) { … … 37 37 core_deletedIds = [], 38 38 39 core_version = "1.9.0 b1",39 core_version = "1.9.0", 40 40 41 41 // Save a reference to some core methods … … 112 112 } 113 113 114 // HANDLE: $(DOMElement)115 if ( selector.nodeType ) {116 this.context = this[0] = selector;117 this.length = 1;118 return this;119 }120 121 114 // Handle HTML strings 122 115 if ( typeof selector === "string" ) { … … 192 185 } 193 186 187 // HANDLE: $(DOMElement) 188 } else if ( selector.nodeType ) { 189 this.context = this[0] = selector; 190 this.length = 1; 191 return this; 192 194 193 // HANDLE: $(function) 195 194 // Shortcut for document ready … … 443 442 444 443 type: function( obj ) { 445 return obj == null ? 446 String( obj ) : 447 class2type[ core_toString.call(obj) ] || "object"; 444 if ( obj == null ) { 445 return String( obj ); 446 } 447 return typeof obj === "object" || typeof obj === "function" ? 448 class2type[ core_toString.call(obj) ] || "object" : 449 typeof obj; 448 450 }, 449 451 … … 510 512 } 511 513 512 parsed = context.createDocumentFragment(); 513 jQuery.clean( [ data ], context, parsed, scripts ); 514 parsed = jQuery.buildFragment( [ data ], context, scripts ); 514 515 if ( scripts ) { 515 516 jQuery( scripts ).remove(); … … 1165 1166 jQuery.each( tuples, function( i, tuple ) { 1166 1167 var action = tuple[ 0 ], 1167 fn = fns[ i ];1168 fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 1168 1169 // deferred[ done | fail | progress ] for forwarding actions to newDefer 1169 deferred[ tuple[1] ]( jQuery.isFunction( fn ) ? 1170 function() { 1171 var returned = fn.apply( this, arguments ); 1172 if ( returned && jQuery.isFunction( returned.promise ) ) { 1173 returned.promise() 1174 .done( newDefer.resolve ) 1175 .fail( newDefer.reject ) 1176 .progress( newDefer.notify ); 1177 } else { 1178 newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, [ returned ] ); 1179 } 1180 } : 1181 newDefer[ action ] 1182 ); 1170 deferred[ tuple[1] ](function() { 1171 var returned = fn && fn.apply( this, arguments ); 1172 if ( returned && jQuery.isFunction( returned.promise ) ) { 1173 returned.promise() 1174 .done( newDefer.resolve ) 1175 .fail( newDefer.reject ) 1176 .progress( newDefer.notify ); 1177 } else { 1178 newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); 1179 } 1180 }); 1183 1181 }); 1184 1182 fns = null; … … 1216 1214 // deferred[ resolve | reject | notify ] 1217 1215 deferred[ tuple[0] ] = function() { 1218 deferred[ tuple[0] + "With" ]( promise, arguments );1216 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); 1219 1217 return this; 1220 1218 }; … … 1288 1286 jQuery.support = (function() { 1289 1287 1290 var support, 1291 all, 1292 a, 1293 select, 1294 opt, 1295 input, 1296 fragment, 1297 eventName, 1298 i, 1299 isSupported, 1300 clickFn, 1288 var support, all, a, select, opt, input, fragment, eventName, isSupported, i, 1301 1289 div = document.createElement("div"); 1302 1290 … … 1368 1356 1369 1357 // Will be defined later 1370 submitBubbles: true,1371 changeBubbles: true,1372 focusinBubbles: false,1373 1358 deleteExpando: true, 1374 1359 noCloneEvent: true, … … 1389 1374 support.optDisabled = !opt.disabled; 1390 1375 1391 // Test to see if it's possible to delete an expando from an element 1392 // Fails in Internet Explorer 1376 // Support: IE<9 1393 1377 try { 1394 1378 delete div.test; … … 1397 1381 } 1398 1382 1399 if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {1400 div.attachEvent( "onclick", clickFn = function() {1401 // Cloning a node shouldn't copy over any1402 // bound event handlers (IE does this)1403 support.noCloneEvent = false;1404 });1405 div.cloneNode( true ).fireEvent("onclick");1406 div.detachEvent( "onclick", clickFn );1407 }1408 1409 1383 // Check if we can trust getAttribute("value") 1410 1384 input = document.createElement("input"); … … 1418 1392 1419 1393 // #11217 - WebKit loses check when the name is after the checked attribute 1420 input.setAttribute( "checked", " checked" );1394 input.setAttribute( "checked", "t" ); 1421 1395 input.setAttribute( "name", "t" ); 1422 1396 1423 div.appendChild( input );1424 1397 fragment = document.createDocumentFragment(); 1425 fragment.appendChild( div.lastChild ); 1426 1427 // WebKit doesn't clone checked state correctly in fragments 1428 support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; 1398 fragment.appendChild( input ); 1429 1399 1430 1400 // Check if a disconnected checkbox will retain its checked … … 1432 1402 support.appendChecked = input.checked; 1433 1403 1434 fragment.removeChild( input ); 1435 fragment.appendChild( div ); 1436 1437 // Technique from Juriy Zaytsev 1438 // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ 1439 // We only care about the case where non-standard event systems 1440 // are used, namely in IE. Short-circuiting here helps us to 1441 // avoid an eval call (in setAttribute) which can cause CSP 1442 // to go haywire. See: https://developer.mozilla.org/en/Security/CSP 1404 // WebKit doesn't clone checked state correctly in fragments 1405 support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; 1406 1407 // Support: IE<9 1408 // Opera does not clone events (and typeof div.attachEvent === undefined). 1409 // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() 1443 1410 if ( div.attachEvent ) { 1444 for ( i in { 1445 submit: true, 1446 change: true, 1447 focusin: true 1448 }) { 1449 eventName = "on" + i; 1450 isSupported = ( eventName in div ); 1451 if ( !isSupported ) { 1452 div.setAttribute( eventName, "return;" ); 1453 isSupported = ( typeof div[ eventName ] === "function" ); 1454 } 1455 support[ i + "Bubbles" ] = isSupported; 1456 } 1457 } 1411 div.attachEvent( "onclick", function() { 1412 support.noCloneEvent = false; 1413 }); 1414 1415 div.cloneNode( true ).click(); 1416 } 1417 1418 // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) 1419 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php 1420 for ( i in { submit: true, change: true, focusin: true }) { 1421 div.setAttribute( eventName = "on" + i, "t" ); 1422 1423 support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; 1424 } 1425 1426 div.style.backgroundClip = "content-box"; 1427 div.cloneNode( true ).style.backgroundClip = ""; 1428 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 1458 1429 1459 1430 // Run tests that need a body at doc ready 1460 1431 jQuery(function() { 1461 var container, div, tds, marginDiv,1462 divReset = "padding:0;margin:0;border:0;display:block; overflow:hidden;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",1432 var container, marginDiv, tds, 1433 divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", 1463 1434 body = document.getElementsByTagName("body")[0]; 1464 1435 … … 1469 1440 1470 1441 container = document.createElement("div"); 1471 container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px"; 1472 body.insertBefore( container, body.firstChild ); 1473 1474 // Construct the test element 1475 div = document.createElement("div"); 1476 container.appendChild( div ); 1477 1442 container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; 1443 1444 body.appendChild( container ).appendChild( div ); 1445 1446 // Support: IE8 1478 1447 // Check if table cells still have offsetWidth/Height when they are set 1479 1448 // to display:none and there are still other visible table cells in a … … 1482 1451 // display:none (it is still safe to use offsets if a parent element is 1483 1452 // hidden; don safety goggles and see bug #4512 for more information). 1484 // (only IE 8 fails this test)1485 1453 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; 1486 1454 tds = div.getElementsByTagName("td"); … … 1491 1459 tds[ 1 ].style.display = "none"; 1492 1460 1461 // Support: IE8 1493 1462 // Check if empty table cells still have offsetWidth/Height 1494 // (IE <= 8 fail this test)1495 1463 support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); 1496 1464 … … 1501 1469 support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); 1502 1470 1503 // NOTE: To any future maintainer, we've window.getComputedStyle 1504 // because jsdom on node.js will break without it. 1471 // Use window.getComputedStyle because jsdom on node.js will break without it. 1505 1472 if ( window.getComputedStyle ) { 1506 1473 support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; … … 1508 1475 1509 1476 // Check if div with explicit width and no margin-right incorrectly 1510 // gets computed margin-right based on width of container. For more 1511 // info see bug #3333 1477 // gets computed margin-right based on width of container. (#3333) 1512 1478 // Fails in WebKit before Feb 2011 nightlies 1513 1479 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 1514 marginDiv = d ocument.createElement("div");1480 marginDiv = div.appendChild( document.createElement("div") ); 1515 1481 marginDiv.style.cssText = div.style.cssText = divReset; 1516 1482 marginDiv.style.marginRight = marginDiv.style.width = "0"; 1517 1483 div.style.width = "1px"; 1518 div.appendChild( marginDiv ); 1484 1519 1485 support.reliableMarginRight = 1520 1486 !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); … … 1522 1488 1523 1489 if ( typeof div.style.zoom !== "undefined" ) { 1490 // Support: IE<8 1524 1491 // Check if natively block-level elements act like inline-block 1525 1492 // elements when setting their display to 'inline' and giving 1526 1493 // them layout 1527 // (IE < 8 does this)1528 1494 div.innerHTML = ""; 1529 1495 div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; 1530 1496 support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); 1531 1497 1498 // Support: IE6 1532 1499 // Check if elements with layout shrink-wrap their children 1533 // (IE 6 does this)1534 1500 div.style.display = "block"; 1535 div.style.overflow = "visible";1536 1501 div.innerHTML = "<div></div>"; 1537 1502 div.firstChild.style.width = "5px"; … … 1543 1508 } 1544 1509 1510 body.removeChild( container ); 1511 1545 1512 // Null elements to avoid leaks in IE 1546 body.removeChild( container );1547 1513 container = div = tds = marginDiv = null; 1548 1514 }); 1549 1515 1550 1516 // Null elements to avoid leaks in IE 1551 fragment.removeChild( div ); 1552 all = a = select = opt = input = fragment = div = null; 1517 all = select = fragment = opt = a = input = null; 1553 1518 1554 1519 return support; 1555 1520 })(); 1521 1556 1522 var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, 1557 1523 rmultiDash = /([A-Z])/g; 1558 1524 1559 1525 function internalData( elem, name, data, pvt /* Internal Use Only */ ){ 1560 1526 if ( !jQuery.acceptData( elem ) ) { … … 1772 1738 return internalData( elem, name, data, true ); 1773 1739 }, 1774 1740 1775 1741 _removeData: function( elem, name ) { 1776 1742 return internalRemoveData( elem, name, true ); … … 1927 1893 } 1928 1894 1895 hooks.cur = fn; 1929 1896 if ( fn ) { 1930 1897 … … 2368 2335 } else { 2369 2336 2370 ret = elem.getAttribute( name ); 2337 // In IE9+, Flash objects don't have .getAttribute (#12945) 2338 // Support: IE9+ 2339 if ( typeof elem.getAttribute !== "undefined" ) { 2340 ret = elem.getAttribute( name ); 2341 } 2371 2342 2372 2343 // Non-existent attributes return null, we normalize to undefined … … 2638 2609 get: function( elem ) { 2639 2610 // Return undefined in the case of empty string 2640 // Normalize to lowercase since IE uppercases css property names 2641 return elem.style.cssText.toLowerCase() || undefined; 2611 // Note: IE uppercases css property names, but if we were to .toLowerCase() 2612 // .cssText, that would destroy case senstitivity in URL's, like in "background" 2613 return elem.style.cssText || undefined; 2642 2614 }, 2643 2615 set: function( elem, value ) { … … 2698 2670 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; 2699 2671 2672 function returnTrue() { 2673 return true; 2674 } 2675 2676 function returnFalse() { 2677 return false; 2678 } 2679 2700 2680 /* 2701 2681 * Helper functions for managing events -- not part of the public interface. … … 2704 2684 jQuery.event = { 2705 2685 2686 global: {}, 2687 2706 2688 add: function( elem, types, handler, data, selector ) { 2707 var elemData, eventHandle, events, 2708 tns, type, namespaces, handleObj, 2709 handleObjIn, handlers, special, 2710 t = 0; 2711 2712 // Don't attach events to noData or text/comment nodes (allow plain objects tho) 2713 if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { 2689 2690 var handleObjIn, eventHandle, tmp, 2691 events, t, handleObj, 2692 special, handlers, type, namespaces, origType, 2693 // Don't attach events to noData or text/comment nodes (but allow plain objects) 2694 elemData = elem.nodeType !== 3 && elem.nodeType !== 8 && jQuery._data( elem ); 2695 2696 if ( !elemData ) { 2714 2697 return; 2715 2698 } … … 2728 2711 2729 2712 // Init the element's event structure and main handler, if this is the first 2730 events = elemData.events; 2731 if ( !events ) { 2732 elemData.events = events = {}; 2733 } 2734 eventHandle = elemData.handle; 2735 if ( !eventHandle ) { 2736 elemData.handle = eventHandle = function( e ) { 2713 if ( !(events = elemData.events) ) { 2714 events = elemData.events = {}; 2715 } 2716 if ( !(eventHandle = elemData.handle) ) { 2717 eventHandle = elemData.handle = function( e ) { 2737 2718 // Discard the second event of a jQuery.event.trigger() and 2738 2719 // when an event is called after a page has unloaded … … 2748 2729 // jQuery(...).bind("mouseover mouseout", fn); 2749 2730 types = ( types || "" ).match( core_rnotwhite ) || [""]; 2750 for ( ; t < types.length; t++ ) {2751 2752 t ns= rtypenamespace.exec( types[t] ) || [];2753 type = tns[1];2754 namespaces = ( t ns[2] || "" ).split( "." ).sort();2731 t = types.length; 2732 while ( t-- ) { 2733 tmp = rtypenamespace.exec( types[t] ) || []; 2734 type = origType = tmp[1]; 2735 namespaces = ( tmp[2] || "" ).split( "." ).sort(); 2755 2736 2756 2737 // If event changes its type, use the special event handlers for the changed type … … 2766 2747 handleObj = jQuery.extend({ 2767 2748 type: type, 2768 origType: tns[1],2749 origType: origType, 2769 2750 data: data, 2770 2751 handler: handler, … … 2776 2757 2777 2758 // Init the event handler queue if we're the first 2778 handlers = events[ type ]; 2779 if ( !handlers ) { 2759 if ( !(handlers = events[ type ]) ) { 2780 2760 handlers = events[ type ] = []; 2781 2761 handlers.delegateCount = 0; … … 2816 2796 }, 2817 2797 2818 global: {},2819 2820 2798 // Detach an event or set of events from an element 2821 2799 remove: function( elem, types, handler, selector, mappedTypes ) { 2822 2800 2823 var tns, type, origType, namespaces, origCount,2824 j, events, special, eventType, handleObj,2825 t = 0,2801 var j, origCount, tmp, 2802 events, t, handleObj, 2803 special, handlers, type, namespaces, origType, 2826 2804 elemData = jQuery.hasData( elem ) && jQuery._data( elem ); 2827 2805 … … 2832 2810 // Once for each type.namespace in types; type may be omitted 2833 2811 types = ( types || "" ).match( core_rnotwhite ) || [""]; 2834 for ( ; t < types.length; t++ ) { 2835 tns = rtypenamespace.exec( types[t] ) || []; 2836 type = origType = tns[1]; 2837 namespaces = tns[2]; 2812 t = types.length; 2813 while ( t-- ) { 2814 tmp = rtypenamespace.exec( types[t] ) || []; 2815 type = origType = tmp[1]; 2816 namespaces = ( tmp[2] || "" ).split( "." ).sort(); 2838 2817 2839 2818 // Unbind all events (on this namespace, if provided) for the element … … 2846 2825 2847 2826 special = jQuery.event.special[ type ] || {}; 2848 type = ( selector? special.delegateType : special.bindType ) || type; 2849 eventType = events[ type ] || []; 2850 origCount = eventType.length; 2851 namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; 2827 type = ( selector ? special.delegateType : special.bindType ) || type; 2828 handlers = events[ type ] || []; 2829 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); 2852 2830 2853 2831 // Remove matching events 2854 for ( j = 0; j < eventType.length; j++ ) { 2855 handleObj = eventType[ j ]; 2832 origCount = j = handlers.length; 2833 while ( j-- ) { 2834 handleObj = handlers[ j ]; 2856 2835 2857 2836 if ( ( mappedTypes || origType === handleObj.origType ) && 2858 2837 ( !handler || handler.guid === handleObj.guid ) && 2859 ( ! namespaces || namespaces.test( handleObj.namespace ) ) &&2838 ( !tmp || tmp.test( handleObj.namespace ) ) && 2860 2839 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { 2861 eventType.splice( j--, 1 );2840 handlers.splice( j, 1 ); 2862 2841 2863 2842 if ( handleObj.selector ) { 2864 eventType.delegateCount--;2843 handlers.delegateCount--; 2865 2844 } 2866 2845 if ( special.remove ) { … … 2872 2851 // Remove generic event handler if we removed something and no more handlers exist 2873 2852 // (avoids potential for endless recursion during removal of special event handlers) 2874 if ( eventType.length === 0 && origCount !== eventType.length ) {2853 if ( origCount && !handlers.length ) { 2875 2854 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 2876 2855 jQuery.removeEvent( elem, type, elemData.handle ); … … 2893 2872 trigger: function( event, data, elem, onlyHandlers ) { 2894 2873 2895 var i, cur, old, ontype, special, handle, eventPath, bubbleType, 2874 var i, cur, tmp, bubbleType, ontype, handle, special, 2875 eventPath = [ elem || document ], 2896 2876 type = event.type || event, 2897 2877 namespaces = event.namespace ? event.namespace.split(".") : []; 2898 2878 2899 elem = elem || document;2879 cur = tmp = elem = elem || document; 2900 2880 2901 2881 // Don't do events on text and comment nodes … … 2915 2895 namespaces.sort(); 2916 2896 } 2917 2918 // Caller can pass in an Event, Object, or just an event type string 2919 event = typeof event === "object" ? 2920 // jQuery.Event object 2921 event[ jQuery.expando ] ? event : 2922 // Object literal 2923 new jQuery.Event( type, event ) : 2924 // Just the event type (string) 2925 new jQuery.Event( type ); 2926 2927 event.type = type; 2897 ontype = type.indexOf(":") < 0 && "on" + type; 2898 2899 // Caller can pass in a jQuery.Event object, Object, or just an event type string 2900 event = event[ jQuery.expando ] ? 2901 event : 2902 new jQuery.Event( type, typeof event === "object" && event ); 2903 2928 2904 event.isTrigger = true; 2929 2905 event.namespace = namespaces.join("."); 2930 event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; 2931 ontype = type.indexOf(":") < 0 ? "on" + type : ""; 2906 event.namespace_re = event.namespace ? 2907 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : 2908 null; 2932 2909 2933 2910 // Clean up the event in case it is being reused … … 2938 2915 2939 2916 // Clone any incoming data and prepend the event, creating the handler arg list 2940 data = data != null ? jQuery.makeArray( data ) : []; 2941 data.unshift( event ); 2917 data = data == null ? 2918 [ event ] : 2919 jQuery.makeArray( data, [ event ] ); 2942 2920 2943 2921 // Allow special events to draw outside the lines … … 2949 2927 // Determine event propagation path in advance, per W3C events spec (#9951) 2950 2928 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 2951 eventPath = [[ elem, special.bindType || type ]];2952 2929 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 2953 2930 2954 2931 bubbleType = special.delegateType || type; 2955 cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; 2956 for ( old = elem; cur; cur = cur.parentNode ) { 2957 eventPath.push([ cur, bubbleType ]); 2958 old = cur; 2932 if ( !rfocusMorph.test( bubbleType + type ) ) { 2933 cur = cur.parentNode; 2934 } 2935 for ( ; cur; cur = cur.parentNode ) { 2936 eventPath.push( cur ); 2937 tmp = cur; 2959 2938 } 2960 2939 2961 2940 // Only add window if we got to document (e.g., not plain obj or detached DOM) 2962 if ( old=== (elem.ownerDocument || document) ) {2963 eventPath.push( [ old.defaultView || old.parentWindow || window, bubbleType ]);2941 if ( tmp === (elem.ownerDocument || document) ) { 2942 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 2964 2943 } 2965 2944 } 2966 2945 2967 2946 // Fire handlers on the event path 2968 for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { 2969 2970 cur = eventPath[i][0]; 2971 event.type = eventPath[i][1]; 2972 2947 i = 0; 2948 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { 2949 2950 event.type = i > 1 ? 2951 bubbleType : 2952 special.bindType || type; 2953 2954 // jQuery handler 2973 2955 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); 2974 2956 if ( handle ) { 2975 2957 handle.apply( cur, data ); 2976 2958 } 2977 // Note that this is a bare JS function and not a jQuery handler 2959 2960 // Native handler 2978 2961 handle = ontype && cur[ ontype ]; 2979 2962 if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { … … 2995 2978 2996 2979 // Don't re-trigger an onFOO event when we call its FOO() method 2997 old= elem[ ontype ];2998 2999 if ( old) {2980 tmp = elem[ ontype ]; 2981 2982 if ( tmp ) { 3000 2983 elem[ ontype ] = null; 3001 2984 } … … 3011 2994 jQuery.event.triggered = undefined; 3012 2995 3013 if ( old) {3014 elem[ ontype ] = old;2996 if ( tmp ) { 2997 elem[ ontype ] = tmp; 3015 2998 } 3016 2999 } … … 3026 3009 event = jQuery.event.fix( event ); 3027 3010 3028 var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, 3029 handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), 3030 delegateCount = handlers.delegateCount, 3011 var i, j, ret, matched, handleObj, 3012 handlerQueue = [], 3031 3013 args = core_slice.call( arguments ), 3032 special = jQuery.event.special[ event.type ] || {},3033 handlerQueue = [];3014 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], 3015 special = jQuery.event.special[ event.type ] || {}; 3034 3016 3035 3017 // Use the fix-ed jQuery.Event rather than the (read-only) native event … … 3042 3024 } 3043 3025 3044 // Determine handlers that should run if there are delegated events 3026 // Determine handlers 3027 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 3028 3029 // Run delegates first; they may want to stop propagation beneath us 3030 i = 0; 3031 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { 3032 event.currentTarget = matched.elem; 3033 3034 j = 0; 3035 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { 3036 3037 // Triggered event must either 1) have no namespace, or 3038 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). 3039 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { 3040 3041 event.handleObj = handleObj; 3042 event.data = handleObj.data; 3043 3044 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) 3045 .apply( matched.elem, args ); 3046 3047 if ( ret !== undefined ) { 3048 if ( (event.result = ret) === false ) { 3049 event.preventDefault(); 3050 event.stopPropagation(); 3051 } 3052 } 3053 } 3054 } 3055 } 3056 3057 // Call the postDispatch hook for the mapped type 3058 if ( special.postDispatch ) { 3059 special.postDispatch.call( this, event ); 3060 } 3061 3062 return event.result; 3063 }, 3064 3065 handlers: function( event, handlers ) { 3066 var i, matches, sel, handleObj, 3067 handlerQueue = [], 3068 delegateCount = handlers.delegateCount, 3069 cur = event.target; 3070 3071 // Find delegate handlers 3072 // Black-hole SVG <use> instance trees (#13180) 3045 3073 // Avoid non-left-click bubbling in Firefox (#3861) 3046 if ( delegateCount && !(event.button && event.type === "click") ) {3047 3048 for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {3049 3050 // Don't process clicks (ONLY)on disabled elements (#6911, #8165, #11382, #11764)3074 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { 3075 3076 for ( ; cur != this; cur = cur.parentNode || this ) { 3077 3078 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 3051 3079 if ( cur.disabled !== true || event.type !== "click" ) { 3052 selMatch = {};3053 3080 matches = []; 3054 3081 for ( i = 0; i < delegateCount; i++ ) { 3055 3082 handleObj = handlers[ i ]; 3056 sel = handleObj.selector; 3057 3058 if ( selMatch[ sel ] === undefined ) { 3059 selMatch[ sel ] = handleObj.needsContext ? 3083 3084 // Don't conflict with Object.prototype properties (#13203) 3085 sel = handleObj.selector + " "; 3086 3087 if ( matches[ sel ] === undefined ) { 3088 matches[ sel ] = handleObj.needsContext ? 3060 3089 jQuery( sel, this ).index( cur ) >= 0 : 3061 3090 jQuery.find( sel, this, null, [ cur ] ).length; 3062 3091 } 3063 if ( selMatch[ sel ] ) {3092 if ( matches[ sel ] ) { 3064 3093 matches.push( handleObj ); 3065 3094 } 3066 3095 } 3067 3096 if ( matches.length ) { 3068 handlerQueue.push({ elem: cur, matches: matches });3097 handlerQueue.push({ elem: cur, handlers: matches }); 3069 3098 } 3070 3099 } … … 3073 3102 3074 3103 // Add the remaining (directly-bound) handlers 3075 if ( handlers.length > delegateCount ) { 3076 handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); 3077 } 3078 3079 // Run delegates first; they may want to stop propagation beneath us 3080 for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { 3081 matched = handlerQueue[ i ]; 3082 event.currentTarget = matched.elem; 3083 3084 for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { 3085 handleObj = matched.matches[ j ]; 3086 3087 // Triggered event must either 1) have no namespace, or 3088 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). 3089 if ( !event.namespace || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { 3090 3091 event.data = handleObj.data; 3092 event.handleObj = handleObj; 3093 3094 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) 3095 .apply( matched.elem, args ); 3096 3097 if ( ret !== undefined ) { 3098 event.result = ret; 3099 if ( ret === false ) { 3100 event.preventDefault(); 3101 event.stopPropagation(); 3102 } 3103 } 3104 } 3105 } 3106 } 3107 3108 // Call the postDispatch hook for the mapped type 3109 if ( special.postDispatch ) { 3110 special.postDispatch.call( this, event ); 3111 } 3112 3113 return event.result; 3104 if ( delegateCount < handlers.length ) { 3105 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); 3106 } 3107 3108 return handlerQueue; 3109 }, 3110 3111 fix: function( event ) { 3112 if ( event[ jQuery.expando ] ) { 3113 return event; 3114 } 3115 3116 // Create a writable copy of the event object and normalize some properties 3117 var i, prop, 3118 originalEvent = event, 3119 fixHook = jQuery.event.fixHooks[ event.type ] || {}, 3120 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 3121 3122 event = new jQuery.Event( originalEvent ); 3123 3124 i = copy.length; 3125 while ( i-- ) { 3126 prop = copy[ i ]; 3127 event[ prop ] = originalEvent[ prop ]; 3128 } 3129 3130 // Support: IE<9 3131 // Fix target property (#1925) 3132 if ( !event.target ) { 3133 event.target = originalEvent.srcElement || document; 3134 } 3135 3136 // Support: Chrome 23+, Safari? 3137 // Target should not be a text node (#504, #13143) 3138 if ( event.target.nodeType === 3 ) { 3139 event.target = event.target.parentNode; 3140 } 3141 3142 // Support: IE<9 3143 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) 3144 event.metaKey = !!event.metaKey; 3145 3146 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 3114 3147 }, 3115 3148 … … 3162 3195 return event; 3163 3196 } 3164 },3165 3166 fix: function( event ) {3167 if ( event[ jQuery.expando ] ) {3168 return event;3169 }3170 3171 // Create a writable copy of the event object and normalize some properties3172 var i, prop,3173 originalEvent = event,3174 fixHook = jQuery.event.fixHooks[ event.type ] || {},3175 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;3176 3177 event = jQuery.Event( originalEvent );3178 3179 for ( i = copy.length; i; ) {3180 prop = copy[ --i ];3181 event[ prop ] = originalEvent[ prop ];3182 }3183 3184 // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)3185 if ( !event.target ) {3186 event.target = originalEvent.srcElement || document;3187 }3188 3189 // Target should not be a text node (#504, Safari)3190 if ( event.target.nodeType === 3 ) {3191 event.target = event.target.parentNode;3192 }3193 3194 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)3195 event.metaKey = !!event.metaKey;3196 3197 return fixHook.filter? fixHook.filter( event, originalEvent ) : event;3198 3197 }, 3199 3198 … … 3220 3219 return false; 3221 3220 } catch ( e ) { 3222 // IE<9 dies on focus to hidden element (#1486,#12518) 3223 // If this happens, let .trigger() run the handlers 3221 // Support: IE<9 3222 // If we error on focus to hidden element (#1486, #12518), 3223 // let .trigger() run the handlers 3224 3224 } 3225 3225 } … … 3271 3271 }; 3272 3272 3273 // Some plugins are using, but it's undocumented/deprecated and will be removed.3274 // The 1.7 special event interface should provide all the hooks needed now.3275 jQuery.event.handle = jQuery.event.dispatch;3276 3277 3273 jQuery.removeEvent = document.removeEventListener ? 3278 3274 function( elem, type, handle ) { … … 3329 3325 }; 3330 3326 3331 function returnFalse() {3332 return false;3333 }3334 function returnTrue() {3335 return true;3336 }3337 3338 3327 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 3339 3328 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 3340 3329 jQuery.Event.prototype = { 3330 isDefaultPrevented: returnFalse, 3331 isPropagationStopped: returnFalse, 3332 isImmediatePropagationStopped: returnFalse, 3333 3341 3334 preventDefault: function() { 3335 var e = this.originalEvent; 3336 3342 3337 this.isDefaultPrevented = returnTrue; 3343 3344 var e = this.originalEvent;3345 3338 if ( !e ) { 3346 3339 return; 3347 3340 } 3348 3341 3349 // if preventDefault existsrun it on the original event3342 // If preventDefault exists, run it on the original event 3350 3343 if ( e.preventDefault ) { 3351 3344 e.preventDefault(); 3352 3345 3353 // otherwise set the returnValue property of the original event to false (IE) 3346 // Support: IE 3347 // Otherwise set the returnValue property of the original event to false 3354 3348 } else { 3355 3349 e.returnValue = false; … … 3357 3351 }, 3358 3352 stopPropagation: function() { 3353 var e = this.originalEvent; 3354 3359 3355 this.isPropagationStopped = returnTrue; 3360 3361 var e = this.originalEvent;3362 3356 if ( !e ) { 3363 3357 return; 3364 3358 } 3365 // if stopPropagation existsrun it on the original event3359 // If stopPropagation exists, run it on the original event 3366 3360 if ( e.stopPropagation ) { 3367 3361 e.stopPropagation(); 3368 3362 } 3369 // otherwise set the cancelBubble property of the original event to true (IE) 3363 3364 // Support: IE 3365 // Set the cancelBubble property of the original event to true 3370 3366 e.cancelBubble = true; 3371 3367 }, … … 3373 3369 this.isImmediatePropagationStopped = returnTrue; 3374 3370 this.stopPropagation(); 3375 }, 3376 isDefaultPrevented: returnFalse, 3377 isPropagationStopped: returnFalse, 3378 isImmediatePropagationStopped: returnFalse 3371 } 3379 3372 }; 3380 3373 … … 3421 3414 var elem = e.target, 3422 3415 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; 3423 if ( form && !jQuery._data( form, " _submit_attached" ) ) {3416 if ( form && !jQuery._data( form, "submitBubbles" ) ) { 3424 3417 jQuery.event.add( form, "submit._submit", function( event ) { 3425 3418 event._submit_bubble = true; 3426 3419 }); 3427 jQuery._data( form, " _submit_attached", true );3420 jQuery._data( form, "submitBubbles", true ); 3428 3421 } 3429 3422 }); … … 3484 3477 var elem = e.target; 3485 3478 3486 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, " _change_attached" ) ) {3479 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { 3487 3480 jQuery.event.add( elem, "change._change", function( event ) { 3488 3481 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { … … 3490 3483 } 3491 3484 }); 3492 jQuery._data( elem, " _change_attached", true );3485 jQuery._data( elem, "changeBubbles", true ); 3493 3486 } 3494 3487 }); … … 3545 3538 if ( typeof types === "object" ) { 3546 3539 // ( types-Object, selector, data ) 3547 if ( typeof selector !== "string" ) { // && selector != null3540 if ( typeof selector !== "string" ) { 3548 3541 // ( types-Object, data ) 3549 3542 data = data || selector; … … 3634 3627 }, 3635 3628 3636 live: function( types, data, fn ) {3637 jQuery( this.context ).on( types, this.selector, data, fn );3638 return this;3639 },3640 die: function( types, fn ) {3641 jQuery( this.context ).off( types, this.selector || "**", fn );3642 return this;3643 },3644 3645 3629 delegate: function( selector, types, data, fn ) { 3646 3630 return this.on( types, selector, data, fn ); … … 3657 3641 }, 3658 3642 triggerHandler: function( type, data ) { 3659 if ( this[0] ) { 3660 return jQuery.event.trigger( type, data, this[0], true ); 3643 var elem = this[0]; 3644 if ( elem ) { 3645 return jQuery.event.trigger( type, data, elem, true ); 3661 3646 } 3662 3647 }, … … 3714 3699 sortOrder, 3715 3700 3701 // Instance-specific data 3716 3702 expando = "sizzle" + -(new Date()), 3717 3718 strundefined = typeof undefined,3719 3720 // Used in sorting3721 MAX_NEGATIVE = 1 << 31,3722 3703 preferredDoc = window.document, 3723 3724 Token = String, 3704 support = {}, 3725 3705 dirruns = 0, 3726 3706 done = 0, 3727 support = {}, 3707 classCache = createCache(), 3708 tokenCache = createCache(), 3709 compilerCache = createCache(), 3710 3711 // General-purpose constants 3712 strundefined = typeof undefined, 3713 MAX_NEGATIVE = 1 << 31, 3728 3714 3729 3715 // Array methods … … 3744 3730 }, 3745 3731 3746 // Augment a function for special use by Sizzle 3747 markFunction = function( fn, value ) { 3748 fn[ expando ] = value == null || value; 3749 return fn; 3750 }, 3751 3752 createCache = function() { 3753 var cache = {}, 3754 keys = []; 3755 3756 return markFunction(function( key, value ) { 3757 // Only keep the most recent entries 3758 if ( keys.push( key ) > Expr.cacheLength ) { 3759 delete cache[ keys.shift() ]; 3760 } 3761 3762 // Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157) 3763 return (cache[ key + " " ] = value); 3764 }, cache ); 3765 }, 3766 3767 classCache = createCache(), 3768 tokenCache = createCache(), 3769 compilerCache = createCache(), 3770 3771 // Regex 3732 3733 // Regular expressions 3772 3734 3773 3735 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace … … 3777 3739 3778 3740 // Loosely modeled on CSS identifier characters 3779 // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)3741 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors 3780 3742 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 3781 3743 identifier = characterEncoding.replace( "w", "w#" ), … … 3800 3762 rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), 3801 3763 rpseudo = new RegExp( pseudos ), 3802 3803 // Easily-parseable/retrievable ID or TAG or CLASS selectors 3804 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 3805 3806 rsibling = /[\x20\t\r\n\f]*[+~]/, 3807 3808 rheader = /h\d/i, 3809 rinputs = /input|select|textarea|button/i, 3810 3811 rnative = /\{\s*\[native code\]\s*\}/, 3812 3813 rbackslash = /\\(?!\\)/g, 3814 3815 rescape = /'|\\/g, 3816 rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, 3764 ridentifier = new RegExp( "^" + identifier + "$" ), 3817 3765 3818 3766 matchExpr = { … … 3832 3780 }, 3833 3781 3834 /** 3835 * For feature detection 3836 * @param {Function} fn The function to test for native support 3837 */ 3838 isNative = function( fn ) { 3839 return rnative.test( fn + "" ); 3840 }, 3841 3842 /** 3843 * Support testing using an element 3844 * @param {Function} fn Passed the created div and expects a boolean result 3845 */ 3846 assert = function( fn ) { 3847 var div = document.createElement("div"); 3848 3849 try { 3850 return fn( div ); 3851 } catch (e) { 3852 return false; 3853 } finally { 3854 // release memory in IE 3855 div = null; 3856 } 3782 rsibling = /[\x20\t\r\n\f]*[+~]/, 3783 3784 rnative = /\{\s*\[native code\]\s*\}/, 3785 3786 // Easily-parseable/retrievable ID or TAG or CLASS selectors 3787 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 3788 3789 rinputs = /^(?:input|select|textarea|button)$/i, 3790 rheader = /^h\d$/i, 3791 3792 rescape = /'|\\/g, 3793 rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, 3794 3795 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 3796 runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, 3797 funescape = function( _, escaped ) { 3798 var high = "0x" + escaped - 0x10000; 3799 // NaN means non-codepoint 3800 return high !== high ? 3801 escaped : 3802 // BMP codepoint 3803 high < 0 ? 3804 String.fromCharCode( high + 0x10000 ) : 3805 // Supplemental Plane codepoint (surrogate pair) 3806 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 3857 3807 }; 3858 3808 … … 3871 3821 } 3872 3822 3823 /** 3824 * For feature detection 3825 * @param {Function} fn The function to test for native support 3826 */ 3827 function isNative( fn ) { 3828 return rnative.test( fn + "" ); 3829 } 3830 3831 /** 3832 * Create key-value caches of limited size 3833 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with 3834 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 3835 * deleting the oldest entry 3836 */ 3837 function createCache() { 3838 var cache, 3839 keys = []; 3840 3841 return (cache = function( key, value ) { 3842 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 3843 if ( keys.push( key += " " ) > Expr.cacheLength ) { 3844 // Only keep the most recent entries 3845 delete cache[ keys.shift() ]; 3846 } 3847 return (cache[ key ] = value); 3848 }); 3849 } 3850 3851 /** 3852 * Mark a function for special use by Sizzle 3853 * @param {Function} fn The function to mark 3854 */ 3855 function markFunction( fn ) { 3856 fn[ expando ] = true; 3857 return fn; 3858 } 3859 3860 /** 3861 * Support testing using an element 3862 * @param {Function} fn Passed the created div and expects a boolean result 3863 */ 3864 function assert( fn ) { 3865 var div = document.createElement("div"); 3866 3867 try { 3868 return fn( div ); 3869 } catch (e) { 3870 return false; 3871 } finally { 3872 // release memory in IE 3873 div = null; 3874 } 3875 } 3876 3873 3877 function Sizzle( selector, context, results, seed ) { 3874 3878 var match, elem, m, nodeType, … … 3876 3880 i, groups, old, nid, newContext, newSelector; 3877 3881 3878 if ( context && (( context.ownerDocument || context ) !== document)) {3882 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 3879 3883 setDocument( context ); 3880 3884 } … … 3955 3959 i = groups.length; 3956 3960 while ( i-- ) { 3957 groups[i] = nid + groups[i].join("");3961 groups[i] = nid + toSelector( groups[i] ); 3958 3962 } 3959 3963 newContext = rsibling.test( selector ) && context.parentNode || context; … … 3997 4001 * @returns {Object} Returns the current document 3998 4002 */ 3999 setDocument = Sizzle.setDocument = function( doc) {4000 doc = doc && doc.ownerDocument || doc || window.document;4003 setDocument = Sizzle.setDocument = function( node ) { 4004 var doc = node ? node.ownerDocument || node : preferredDoc; 4001 4005 4002 4006 // If no document and documentElement is available, return 4003 if ( !doc || doc.nodeType !== 9 || !doc.documentElement || document === doc) {4007 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 4004 4008 return document; 4005 4009 } … … 4088 4092 }; 4089 4093 Expr.filter["ID"] = function( id ) { 4090 var attrId = id.replace( r backslash, "");4094 var attrId = id.replace( runescape, funescape ); 4091 4095 return function( elem ) { 4092 4096 return elem.getAttribute("id") === attrId; … … 4106 4110 }; 4107 4111 Expr.filter["ID"] = function( id ) { 4108 var attrId = id.replace( r backslash, "");4112 var attrId = id.replace( runescape, funescape ); 4109 4113 return function( elem ) { 4110 4114 var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); … … 4190 4194 assert(function( div ) { 4191 4195 4192 // Opera 10-12/IE 9- ^= $= *= and empty values4196 // Opera 10-12/IE8 - ^= $= *= and empty values 4193 4197 // Should not select anything 4194 div.innerHTML = "< p test=''></p>";4195 if ( div.querySelectorAll("[ test^='']").length ) {4198 div.innerHTML = "<input type='hidden' i=''/>"; 4199 if ( div.querySelectorAll("[i^='']").length ) { 4196 4200 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); 4197 4201 } … … 4199 4203 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 4200 4204 // IE8 throws error here and will not see later tests 4201 div.innerHTML = "<input type='hidden'/>";4202 4205 if ( !div.querySelectorAll(":enabled").length ) { 4203 4206 rbuggyQSA.push( ":enabled", ":disabled" ); … … 4223 4226 // This should fail with an exception 4224 4227 // Gecko does not error, returns false instead 4225 matches.call( div, "[ test!='']:x" );4228 matches.call( div, "[s!='']:x" ); 4226 4229 rbuggyMatches.push( "!=", pseudos ); 4227 4230 }); … … 4345 4348 4346 4349 Sizzle.matches = function( expr, elements ) { 4347 return Sizzle( expr, window.document, null, elements );4350 return Sizzle( expr, null, null, elements ); 4348 4351 }; 4349 4352 4350 4353 Sizzle.matchesSelector = function( elem, expr ) { 4351 4354 // Set document vars if needed 4352 if ( elem && (( elem.ownerDocument || elem ) !== document)) {4355 if ( ( elem.ownerDocument || elem ) !== document ) { 4353 4356 setDocument( elem ); 4354 4357 } … … 4377 4380 Sizzle.contains = function( context, elem ) { 4378 4381 // Set document vars if needed 4379 if ( context && (( context.ownerDocument || context ) !== document)) {4382 if ( ( context.ownerDocument || context ) !== document ) { 4380 4383 setDocument( context ); 4381 4384 } … … 4387 4390 4388 4391 // Set document vars if needed 4389 if ( elem && (( elem.ownerDocument || elem ) !== document)) {4392 if ( ( elem.ownerDocument || elem ) !== document ) { 4390 4393 setDocument( elem ); 4391 4394 } … … 4536 4539 preFilter: { 4537 4540 "ATTR": function( match ) { 4538 match[1] = match[1].replace( r backslash, "");4541 match[1] = match[1].replace( runescape, funescape ); 4539 4542 4540 4543 // Move the given value to match[3] whether quoted or unquoted 4541 match[3] = ( match[4] || match[5] || "" ).replace( r backslash, "");4544 match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); 4542 4545 4543 4546 if ( match[2] === "~=" ) { … … 4616 4619 } 4617 4620 4618 nodeName = nodeName.replace( r backslash, "").toLowerCase();4621 nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); 4619 4622 return function( elem ) { 4620 4623 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; … … 4623 4626 4624 4627 "CLASS": function( className ) { 4625 var pattern = classCache[ expando ][className + " " ];4628 var pattern = classCache[ className + " " ]; 4626 4629 4627 4630 return pattern || … … 4825 4828 }), 4826 4829 4830 // "Whether an element is represented by a :lang() selector 4831 // is based solely on the element's language value 4832 // being equal to the identifier C, 4833 // or beginning with the identifier C immediately followed by "-". 4834 // The matching of C against the element's language value is performed case-insensitively. 4835 // The identifier C does not have to be a valid language name." 4836 // http://www.w3.org/TR/selectors/#lang-pseudo 4837 "lang": markFunction( function( lang ) { 4838 // lang value must be a valid identifider 4839 if ( !ridentifier.test(lang || "") ) { 4840 Sizzle.error( "unsupported lang: " + lang ); 4841 } 4842 lang = lang.replace( runescape, funescape ).toLowerCase(); 4843 return function( elem ) { 4844 var elemLang; 4845 do { 4846 if ( (elemLang = documentIsXML ? 4847 elem.getAttribute("xml:lang") || elem.getAttribute("lang") : 4848 elem.lang) ) { 4849 4850 elemLang = elemLang.toLowerCase(); 4851 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 4852 } 4853 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 4854 return false; 4855 }; 4856 }), 4857 4827 4858 // Miscellaneous 4828 4859 "target": function( elem ) { … … 4965 4996 var matched, match, tokens, type, 4966 4997 soFar, groups, preFilters, 4967 cached = tokenCache[ expando ][selector + " " ];4998 cached = tokenCache[ selector + " " ]; 4968 4999 4969 5000 if ( cached ) { … … 4990 5021 // Combinators 4991 5022 if ( (match = rcombinators.exec( soFar )) ) { 4992 tokens.push( matched = new Token( match.shift() ) ); 5023 matched = match.shift(); 5024 tokens.push( { 5025 value: matched, 5026 // Cast descendant combinators to space 5027 type: match[0].replace( rtrim, " " ) 5028 } ); 4993 5029 soFar = soFar.slice( matched.length ); 4994 4995 // Cast descendant combinators to space4996 matched.type = match[0].replace( rtrim, " " );4997 5030 } 4998 5031 … … 5001 5034 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 5002 5035 (match = preFilters[ type ]( match ))) ) { 5003 5004 tokens.push( matched = new Token( match.shift() ) ); 5036 matched = match.shift(); 5037 tokens.push( { 5038 value: matched, 5039 type: type, 5040 matches: match 5041 } ); 5005 5042 soFar = soFar.slice( matched.length ); 5006 matched.type = type;5007 matched.matches = match;5008 5043 } 5009 5044 } … … 5023 5058 // Cache the tokens 5024 5059 tokenCache( selector, groups ).slice( 0 ); 5060 } 5061 5062 function toSelector( tokens ) { 5063 var i = 0, 5064 len = tokens.length, 5065 selector = ""; 5066 for ( ; i < len; i++ ) { 5067 selector += tokens[i].value; 5068 } 5069 return selector; 5025 5070 } 5026 5071 … … 5241 5286 return setMatcher( 5242 5287 i > 1 && elementMatcher( matchers ), 5243 i > 1 && to kens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),5288 i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), 5244 5289 matcher, 5245 5290 i < j && matcherFromTokens( tokens.slice( i, j ) ), 5246 5291 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 5247 j < len && to kens.join("")5292 j < len && toSelector( tokens ) 5248 5293 ); 5249 5294 } … … 5358 5403 setMatchers = [], 5359 5404 elementMatchers = [], 5360 cached = compilerCache[ expando ][selector + " " ];5405 cached = compilerCache[ selector + " " ]; 5361 5406 5362 5407 if ( !cached ) { … … 5404 5449 Expr.relative[ tokens[1].type ] ) { 5405 5450 5406 context = Expr.find["ID"]( token.matches[0].replace( r backslash, ""), context )[0];5451 context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; 5407 5452 if ( !context ) { 5408 5453 return results; 5409 5454 } 5410 5455 5411 selector = selector.slice( tokens.shift(). length );5456 selector = selector.slice( tokens.shift().value.length ); 5412 5457 } 5413 5458 … … 5423 5468 // Search, expanding context for leading sibling combinators 5424 5469 if ( (seed = find( 5425 token.matches[0].replace( r backslash, ""),5470 token.matches[0].replace( runescape, funescape ), 5426 5471 rsibling.test( tokens[0].type ) && context.parentNode || context 5427 5472 )) ) { … … 5429 5474 // If seed is empty or no tokens remain, we can return early 5430 5475 tokens.splice( i, 1 ); 5431 selector = seed.length && to kens.join("");5476 selector = seed.length && toSelector( tokens ); 5432 5477 if ( !selector ) { 5433 5478 push.apply( results, slice.call( seed, 0 ) ); … … 5781 5826 rscriptTypeMasked = /^true\/(.*)/, 5782 5827 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, 5828 5829 // We have to close these tags to support XHTML (#13200) 5783 5830 wrapMap = { 5784 option: [ 1, "<select multiple='multiple'>" ],5785 legend: [ 1, "<fieldset>" ],5786 area: [ 1, "<map>" ],5787 param: [ 1, "<object>" ],5788 thead: [ 1, "<table>" 5789 tr: [ 2, "<table><tbody>" ],5790 col: [ 2, "<table><tbody></tbody><colgroup>", "</ table>" ],5791 td: [ 3, "<table><tbody><tr>" ],5831 option: [ 1, "<select multiple='multiple'>", "</select>" ], 5832 legend: [ 1, "<fieldset>", "</fieldset>" ], 5833 area: [ 1, "<map>", "</map>" ], 5834 param: [ 1, "<object>", "</object>" ], 5835 thead: [ 1, "<table>", "</table>" ], 5836 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 5837 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], 5838 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 5792 5839 5793 5840 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, 5794 5841 // unless wrapped in a div with non-breaking characters in front of it. 5795 _default: jQuery.support.htmlSerialize ? [ 0, "" ] : [ 1, "X<div>" ]5842 _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] 5796 5843 }, 5797 5844 safeFragment = createSafeFragment( document ), … … 5944 5991 while ( elem.firstChild ) { 5945 5992 elem.removeChild( elem.firstChild ); 5993 } 5994 5995 // If this is a select, ensure that it displays empty (#12336) 5996 // Support: IE<9 5997 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { 5998 elem.options.length = 0; 5946 5999 } 5947 6000 } … … 6039 6092 i = 0, 6040 6093 l = this.length, 6094 set = this, 6041 6095 iNoClone = l - 1, 6042 6096 value = args[0], … … 6045 6099 // We can't cloneNode fragments that contain checked, in WebKit 6046 6100 if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { 6047 return this.each(function( ) {6048 var self = jQuery( this);6101 return this.each(function( index ) { 6102 var self = set.eq( index ); 6049 6103 if ( isFunction ) { 6050 args[0] = value.call( this, i , table ? self.html() : undefined );6104 args[0] = value.call( this, index, table ? self.html() : undefined ); 6051 6105 } 6052 6106 self.domManip( args, table, callback ); … … 6054 6108 } 6055 6109 6056 if ( this[0] ) { 6057 doc = this[0].ownerDocument; 6058 fragment = doc.createDocumentFragment(); 6059 jQuery.clean( args, doc, fragment, undefined, this ); 6110 if ( l ) { 6111 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); 6060 6112 first = fragment.firstChild; 6061 6113 … … 6302 6354 } 6303 6355 6304 // Used in clean, fixes the defaultChecked property6356 // Used in buildFragment, fixes the defaultChecked property 6305 6357 function fixDefaultChecked( elem ) { 6306 6358 if ( manipulation_rcheckableType.test( elem.type ) ) { … … 6365 6417 }, 6366 6418 6367 clean: function( elems, context, fragment, scripts, selection ) { 6368 var elem, i, j, tmp, tag, wrap, tbody, 6369 ret = [], 6370 safe = context === document && safeFragment; 6371 6372 // Ensure that context is a document 6373 if ( !context || typeof context.createDocumentFragment === "undefined" ) { 6374 context = document; 6375 } 6376 6377 for ( i = 0; (elem = elems[i]) != null; i++ ) { 6419 buildFragment: function( elems, context, scripts, selection ) { 6420 var contains, elem, tag, tmp, wrap, tbody, j, 6421 l = elems.length, 6422 6423 // Ensure a safe fragment 6424 safe = createSafeFragment( context ), 6425 6426 nodes = [], 6427 i = 0; 6428 6429 for ( ; i < l; i++ ) { 6430 elem = elems[ i ]; 6431 6378 6432 if ( elem || elem === 0 ) { 6433 6379 6434 // Add nodes directly 6380 6435 if ( jQuery.type( elem ) === "object" ) { 6381 jQuery.merge( ret, elem.nodeType ? [ elem ] : elem );6436 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 6382 6437 6383 6438 // Convert non-html into a text node 6384 6439 } else if ( !rhtml.test( elem ) ) { 6385 ret.push( context.createTextNode( elem ) );6440 nodes.push( context.createTextNode( elem ) ); 6386 6441 6387 6442 // Convert html into DOM nodes 6388 6443 } else { 6389 // Ensure a safe container6390 safe = safe || createSafeFragment( context );6391 6444 tmp = tmp || safe.appendChild( context.createElement("div") ); 6392 6445 … … 6394 6447 tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); 6395 6448 wrap = wrapMap[ tag ] || wrapMap._default; 6396 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + ( wrap[2] || "" ); 6449 6450 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; 6397 6451 6398 6452 // Descend through wrappers to the right content … … 6404 6458 // Manually add leading whitespace removed by IE 6405 6459 if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { 6406 ret.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );6460 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); 6407 6461 } 6408 6462 … … 6427 6481 } 6428 6482 6429 jQuery.merge( ret, tmp.childNodes );6483 jQuery.merge( nodes, tmp.childNodes ); 6430 6484 6431 6485 // Fix #12392 for WebKit and IE > 9 … … 6443 6497 } 6444 6498 6445 // Fix #11356: Clear elements from safeFragment6499 // Fix #11356: Clear elements from fragment 6446 6500 if ( tmp ) { 6447 6501 safe.removeChild( tmp ); … … 6451 6505 // about to be appended to the DOM in IE 6/7 (#8060) 6452 6506 if ( !jQuery.support.appendChecked ) { 6453 jQuery.grep( getAll( ret, "input" ), fixDefaultChecked ); 6454 } 6455 6456 if ( fragment ) { 6457 for ( i = 0; (elem = ret[i]) != null; i++ ) { 6458 safe = jQuery.contains( elem.ownerDocument, elem ); 6459 6460 // Append to fragment 6461 // #4087 - If origin and destination elements are the same, and this is 6462 // that element, do not append to fragment 6463 if ( !selection || jQuery.inArray( elem, selection ) === -1 ) { 6464 fragment.appendChild( elem ); 6465 } 6466 tmp = getAll( elem, "script" ); 6467 6468 // Preserve script evaluation history 6469 if ( safe ) { 6470 setGlobalEval( tmp ); 6471 } 6472 6473 // Capture executables 6474 if ( scripts ) { 6475 for ( j = 0; (elem = tmp[j]) != null; j++ ) { 6476 if ( rscriptType.test( elem.type || "" ) ) { 6477 scripts.push( elem ); 6478 } 6507 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); 6508 } 6509 6510 i = 0; 6511 while ( (elem = nodes[ i++ ]) ) { 6512 6513 // #4087 - If origin and destination elements are the same, and this is 6514 // that element, do not do anything 6515 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { 6516 continue; 6517 } 6518 6519 contains = jQuery.contains( elem.ownerDocument, elem ); 6520 6521 // Append to fragment 6522 tmp = getAll( safe.appendChild( elem ), "script" ); 6523 6524 // Preserve script evaluation history 6525 if ( contains ) { 6526 setGlobalEval( tmp ); 6527 } 6528 6529 // Capture executables 6530 if ( scripts ) { 6531 j = 0; 6532 while ( (elem = tmp[ j++ ]) ) { 6533 if ( rscriptType.test( elem.type || "" ) ) { 6534 scripts.push( elem ); 6479 6535 } 6480 6536 } … … 6482 6538 } 6483 6539 6484 elem = tmp = safe= null;6485 6486 return ret;6540 tmp = null; 6541 6542 return safe; 6487 6543 }, 6488 6544 … … 6526 6582 delete elem[ internalKey ]; 6527 6583 6528 } else if ( elem.removeAttribute) {6584 } else if ( typeof elem.removeAttribute !== "undefined" ) { 6529 6585 elem.removeAttribute( internalKey ); 6530 6586 … … 6755 6811 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, 6756 6812 // but it would mean to define eight (for every problematic property) identical functions 6757 if ( value === "" && name.indexOf("background") === 0 ) {6758 value = "";6813 if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { 6814 style[ name ] = "inherit"; 6759 6815 } 6760 6816 … … 7310 7366 ajaxLocParts, 7311 7367 ajaxLocation, 7312 7368 7313 7369 ajax_nonce = jQuery.now(), 7314 7370 … … 8610 8666 function Animation( elem, properties, options ) { 8611 8667 var result, 8668 stopped, 8612 8669 index = 0, 8613 8670 length = animationPrefilters.length, … … 8617 8674 }), 8618 8675 tick = function() { 8676 if ( stopped ) { 8677 return false; 8678 } 8619 8679 var currentTime = fxNow || createFxNow(), 8620 8680 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), … … 8658 8718 // otherwise we skip this part 8659 8719 length = gotoEnd ? animation.tweens.length : 0; 8660 8720 if ( stopped ) { 8721 return this; 8722 } 8723 stopped = true; 8661 8724 for ( ; index < length ; index++ ) { 8662 8725 animation.tweens[ index ].run( 1 ); … … 8692 8755 jQuery.fx.timer( 8693 8756 jQuery.extend( tick, { 8757 elem: elem, 8694 8758 anim: animation, 8695 queue: animation.opts.queue, 8696 elem: elem 8759 queue: animation.opts.queue 8697 8760 }) 8698 8761 ); … … 9015 9078 // Operate on a copy of prop so per-property easing won't be lost 9016 9079 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 9017 9018 // Empty animations resolve immediately 9019 if ( empty ) { 9080 doAnimation.finish = function() { 9020 9081 anim.stop( true ); 9082 }; 9083 // Empty animations, or finishing resolves immediately 9084 if ( empty || jQuery._data( this, "finish" ) ) { 9085 anim.stop( true ); 9021 9086 } 9022 9087 }; 9088 doAnimation.finish = doAnimation; 9023 9089 9024 9090 return empty || optall.queue === false ? … … 9074 9140 jQuery.dequeue( this, type ); 9075 9141 } 9142 }); 9143 }, 9144 finish: function( type ) { 9145 if ( type !== false ) { 9146 type = type || "fx"; 9147 } 9148 return this.each(function() { 9149 var index, 9150 data = jQuery._data( this ), 9151 queue = data[ type + "queue" ], 9152 hooks = data[ type + "queueHooks" ], 9153 timers = jQuery.timers, 9154 length = queue ? queue.length : 0; 9155 9156 // enable finishing flag on private data 9157 data.finish = true; 9158 9159 // empty the queue first 9160 jQuery.queue( this, type, [] ); 9161 9162 if ( hooks && hooks.cur && hooks.cur.finish ) { 9163 hooks.cur.finish.call( this ); 9164 } 9165 9166 // look for any active animations, and finish them 9167 for ( index = timers.length; index--; ) { 9168 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 9169 timers[ index ].anim.stop( true ); 9170 timers.splice( index, 1 ); 9171 } 9172 } 9173 9174 // look for any animations in the old queue and finish them 9175 for ( index = 0; index < length; index++ ) { 9176 if ( queue[ index ] && queue[ index ].finish ) { 9177 queue[ index ].finish.call( this ); 9178 } 9179 } 9180 9181 // turn off finishing flag 9182 delete data.finish; 9076 9183 }); 9077 9184 } -
trunk/wp-includes/script-loader.php
r23220 r23301 127 127 // jQuery 128 128 $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ) ); 129 $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.9.0 b1' );130 $scripts->add( 'jquery-migrate', '/wp-includes/js/jquery/jquery-migrate.js', array(), '1.0.0 b1' );129 $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.9.0' ); 130 $scripts->add( 'jquery-migrate', '/wp-includes/js/jquery/jquery-migrate.js', array(), '1.0.0' ); 131 131 132 132 // full jQuery UI
Note: See TracChangeset
for help on using the changeset viewer.