Ticket #22975: 22975.rc1.patch
File 22975.rc1.patch, 42.5 KB (added by , 10 years ago) |
---|
-
wp-includes/js/jquery/jquery.js
1 1 /*! 2 * jQuery JavaScript Library v1.9.0 b12 * jQuery JavaScript Library v1.9.0rc1 3 3 * http://jquery.com/ 4 4 * 5 5 * Includes Sizzle.js … … 9 9 * Released under the MIT license 10 10 * http://jquery.org/license 11 11 * 12 * Date: 201 2-12-1612 * Date: 2013-1-8 13 13 */ 14 14 (function( window, undefined ) { 15 15 "use strict"; … … 36 36 // List of deleted data cache ids, so we can reuse them 37 37 core_deletedIds = [], 38 38 39 core_version = "1.9.0 b1",39 core_version = "1.9.0rc1", 40 40 41 41 // Save a reference to some core methods 42 42 core_concat = core_deletedIds.concat, … … 111 111 return this; 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" ) { 123 116 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { … … 191 184 return this.constructor( context ).find( selector ); 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 196 195 } else if ( jQuery.isFunction( selector ) ) { … … 442 441 }, 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 450 452 isPlainObject: function( obj ) { … … 509 511 return [ context.createElement( parsed[1] ) ]; 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(); 516 517 } … … 1164 1165 return jQuery.Deferred(function( newDefer ) { 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; 1185 1183 }).promise(); … … 1215 1213 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 }; 1221 1219 deferred[ tuple[0] + "With" ] = list.fireWith; … … 1287 1285 }); 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 1303 1291 // Setup … … 1367 1355 boxModel: document.compatMode === "CSS1Compat", 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, 1375 1360 inlineBlockNeedsLayout: false, … … 1388 1373 select.disabled = 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; 1395 1379 } catch( e ) { 1396 1380 support.deleteExpando = false; 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"); 1411 1385 input.setAttribute( "value", "" ); … … 1417 1391 support.radioValue = input.value === "t"; 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);1398 fragment.appendChild( input ); 1426 1399 1427 // WebKit doesn't clone checked state correctly in fragments1428 support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;1429 1430 1400 // Check if a disconnected checkbox will retain its checked 1431 1401 // value of true after appended to the DOM (IE6/7) 1432 1402 support.appendChecked = input.checked; 1433 1403 1434 fragment.removeChild( input );1435 fragment.appendChild( div );1404 // WebKit doesn't clone checked state correctly in fragments 1405 support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; 1436 1406 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 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 } 1411 div.attachEvent( "onclick", function() { 1412 support.noCloneEvent = false; 1413 }); 1414 1415 div.cloneNode( true ).click(); 1457 1416 } 1458 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"; 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 1465 1436 if ( !body ) { … … 1468 1439 } 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 ); 1442 container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; 1473 1443 1474 // Construct the test element 1475 div = document.createElement("div"); 1476 container.appendChild( div ); 1444 body.appendChild( container ).appendChild( div ); 1477 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 1480 1449 // table row; if so, offsetWidth/Height are not reliable for use when 1481 1450 // determining if an element has been hidden directly using 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"); 1487 1455 tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; … … 1490 1458 tds[ 0 ].style.display = ""; 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 1497 1465 // Check box-sizing and margin behavior … … 1500 1468 support.boxSizing = ( div.offsetWidth === 4 ); 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%"; 1507 1474 support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; 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 ); 1521 1487 } 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"; 1538 1503 support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); … … 1542 1507 body.style.zoom = 1; 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 … … 1926 1892 startLength--; 1927 1893 } 1928 1894 1895 hooks.cur = fn; 1929 1896 if ( fn ) { 1930 1897 1931 1898 // Add a progress sentinel to prevent the fx queue from being … … 2367 2334 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 2373 2344 return ret == null ? … … 2637 2608 jQuery.attrHooks.style = { 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 ) { 2644 2616 return ( elem.style.cssText = value + "" ); … … 3633 3605 return this.off( types, null, fn ); 3634 3606 }, 3635 3607 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 3608 delegate: function( selector, types, data, fn ) { 3646 3609 return this.on( types, selector, data, fn ); 3647 3610 }, … … 3713 3676 contains, 3714 3677 sortOrder, 3715 3678 3679 // Instance-specific data 3716 3680 expando = "sizzle" + -(new Date()), 3681 preferredDoc = window.document, 3682 support = {}, 3683 dirruns = 0, 3684 done = 0, 3685 classCache = createCache(), 3686 tokenCache = createCache(), 3687 compilerCache = createCache(), 3717 3688 3689 // General-purpose constants 3690 Token = String, 3718 3691 strundefined = typeof undefined, 3719 3720 // Used in sorting3721 3692 MAX_NEGATIVE = 1 << 31, 3722 preferredDoc = window.document,3723 3693 3724 Token = String,3725 dirruns = 0,3726 done = 0,3727 support = {},3728 3729 3694 // Array methods 3730 3695 arr = [], 3731 3696 pop = arr.pop, … … 3743 3708 return -1; 3744 3709 }, 3745 3710 3746 // Augment a function for special use by Sizzle3747 markFunction = function( fn, value ) {3748 fn[ expando ] = value == null || value;3749 return fn;3750 },3751 3711 3752 createCache = function() { 3753 var cache = {}, 3754 keys = []; 3712 // Regular expressions 3755 3713 3756 return markFunction(function( key, value ) {3757 // Only keep the most recent entries3758 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 // Regex3772 3773 3714 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace 3774 3715 whitespace = "[\\x20\\t\\r\\n\\f]", 3775 3716 // http://www.w3.org/TR/css3-syntax/#characters 3776 3717 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 3777 3718 3778 3719 // Loosely modeled on CSS identifier characters 3779 // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)3720 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors 3780 3721 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 3781 3722 identifier = characterEncoding.replace( "w", "w#" ), 3782 3723 … … 3799 3740 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 3800 3741 rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), 3801 3742 rpseudo = new RegExp( pseudos ), 3743 ridentifier = new RegExp( "^" + identifier + "$" ), 3802 3744 3803 // Easily-parseable/retrievable ID or TAG or CLASS selectors3804 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,3817 3818 3745 matchExpr = { 3819 3746 "ID": new RegExp( "^#(" + characterEncoding + ")" ), 3820 3747 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), … … 3831 3758 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 3832 3759 }, 3833 3760 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 }, 3761 rsibling = /[\x20\t\r\n\f]*[+~]/, 3841 3762 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"); 3763 rnative = /\{\s*\[native code\]\s*\}/, 3848 3764 3849 try { 3850 return fn( div ); 3851 } catch (e) { 3852 return false; 3853 } finally { 3854 // release memory in IE 3855 div = null; 3856 } 3765 // Easily-parseable/retrievable ID or TAG or CLASS selectors 3766 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 3767 3768 rinputs = /^(?:input|select|textarea|button)$/i, 3769 rheader = /^h\d$/i, 3770 3771 rescape = /'|\\/g, 3772 rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, 3773 3774 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 3775 runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, 3776 funescape = function( _, escaped ) { 3777 var high = "0x" + escaped - 0x10000; 3778 // NaN means non-codepoint 3779 return high !== high ? 3780 escaped : 3781 // BMP codepoint 3782 high < 0 ? 3783 String.fromCharCode( high + 0x10000 ) : 3784 // Supplemental Plane codepoint (surrogate pair) 3785 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 3857 3786 }; 3858 3787 3859 3788 // Use a stripped-down slice if we can't use a native one … … 3870 3799 }; 3871 3800 } 3872 3801 3802 /** 3803 * For feature detection 3804 * @param {Function} fn The function to test for native support 3805 */ 3806 function isNative( fn ) { 3807 return rnative.test( fn + "" ); 3808 } 3809 3810 /** 3811 * Create key-value caches of limited size 3812 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with 3813 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 3814 * deleting the oldest entry 3815 */ 3816 function createCache() { 3817 var cache, 3818 keys = []; 3819 3820 return (cache = function( key, value ) { 3821 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 3822 if ( keys.push( key += " " ) > Expr.cacheLength ) { 3823 // Only keep the most recent entries 3824 delete cache[ keys.shift() ]; 3825 } 3826 return (cache[ key ] = value); 3827 }); 3828 } 3829 3830 /** 3831 * Mark a function for special use by Sizzle 3832 * @param {Function} fn The function to mark 3833 */ 3834 function markFunction( fn ) { 3835 fn[ expando ] = true; 3836 return fn; 3837 } 3838 3839 /** 3840 * Support testing using an element 3841 * @param {Function} fn Passed the created div and expects a boolean result 3842 */ 3843 function assert( fn ) { 3844 var div = document.createElement("div"); 3845 3846 try { 3847 return fn( div ); 3848 } catch (e) { 3849 return false; 3850 } finally { 3851 // release memory in IE 3852 div = null; 3853 } 3854 } 3855 3873 3856 function Sizzle( selector, context, results, seed ) { 3874 3857 var match, elem, m, nodeType, 3875 3858 // QSA vars 3876 3859 i, groups, old, nid, newContext, newSelector; 3877 3860 3878 if ( context && (( context.ownerDocument || context ) !== document)) {3861 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 3879 3862 setDocument( context ); 3880 3863 } 3881 3864 … … 3996 3979 * @param {Element|Object} [doc] An element or document object to use to set the document 3997 3980 * @returns {Object} Returns the current document 3998 3981 */ 3999 setDocument = Sizzle.setDocument = function( doc) {4000 doc = doc && doc.ownerDocument || doc || window.document;3982 setDocument = Sizzle.setDocument = function( node ) { 3983 var doc = node ? node.ownerDocument || node : preferredDoc; 4001 3984 4002 3985 // If no document and documentElement is available, return 4003 if ( !doc || doc.nodeType !== 9 || !doc.documentElement || document === doc) {3986 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 4004 3987 return document; 4005 3988 } 4006 3989 … … 4087 4070 } 4088 4071 }; 4089 4072 Expr.filter["ID"] = function( id ) { 4090 var attrId = id.replace( r backslash, "");4073 var attrId = id.replace( runescape, funescape ); 4091 4074 return function( elem ) { 4092 4075 return elem.getAttribute("id") === attrId; 4093 4076 }; … … 4105 4088 } 4106 4089 }; 4107 4090 Expr.filter["ID"] = function( id ) { 4108 var attrId = id.replace( r backslash, "");4091 var attrId = id.replace( runescape, funescape ); 4109 4092 return function( elem ) { 4110 4093 var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); 4111 4094 return node && node.value === attrId; … … 4189 4172 4190 4173 assert(function( div ) { 4191 4174 4192 // Opera 10-12/IE 9- ^= $= *= and empty values4175 // Opera 10-12/IE8 - ^= $= *= and empty values 4193 4176 // Should not select anything 4194 div.innerHTML = "< p test=''></p>";4195 if ( div.querySelectorAll("[ test^='']").length ) {4177 div.innerHTML = "<input type='hidden' i=''/>"; 4178 if ( div.querySelectorAll("[i^='']").length ) { 4196 4179 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); 4197 4180 } 4198 4181 4199 4182 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 4200 4183 // IE8 throws error here and will not see later tests 4201 div.innerHTML = "<input type='hidden'/>";4202 4184 if ( !div.querySelectorAll(":enabled").length ) { 4203 4185 rbuggyQSA.push( ":enabled", ":disabled" ); 4204 4186 } … … 4222 4204 4223 4205 // This should fail with an exception 4224 4206 // Gecko does not error, returns false instead 4225 matches.call( div, "[ test!='']:x" );4207 matches.call( div, "[s!='']:x" ); 4226 4208 rbuggyMatches.push( "!=", pseudos ); 4227 4209 }); 4228 4210 } … … 4344 4326 }; 4345 4327 4346 4328 Sizzle.matches = function( expr, elements ) { 4347 return Sizzle( expr, window.document, null, elements );4329 return Sizzle( expr, null, null, elements ); 4348 4330 }; 4349 4331 4350 4332 Sizzle.matchesSelector = function( elem, expr ) { 4351 4333 // Set document vars if needed 4352 if ( elem && (( elem.ownerDocument || elem ) !== document)) {4334 if ( ( elem.ownerDocument || elem ) !== document ) { 4353 4335 setDocument( elem ); 4354 4336 } 4355 4337 … … 4376 4358 4377 4359 Sizzle.contains = function( context, elem ) { 4378 4360 // Set document vars if needed 4379 if ( context && (( context.ownerDocument || context ) !== document)) {4361 if ( ( context.ownerDocument || context ) !== document ) { 4380 4362 setDocument( context ); 4381 4363 } 4382 4364 return contains( context, elem ); … … 4386 4368 var val; 4387 4369 4388 4370 // Set document vars if needed 4389 if ( elem && (( elem.ownerDocument || elem ) !== document)) {4371 if ( ( elem.ownerDocument || elem ) !== document ) { 4390 4372 setDocument( elem ); 4391 4373 } 4392 4374 … … 4535 4517 4536 4518 preFilter: { 4537 4519 "ATTR": function( match ) { 4538 match[1] = match[1].replace( r backslash, "");4520 match[1] = match[1].replace( runescape, funescape ); 4539 4521 4540 4522 // Move the given value to match[3] whether quoted or unquoted 4541 match[3] = ( match[4] || match[5] || "" ).replace( r backslash, "");4523 match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); 4542 4524 4543 4525 if ( match[2] === "~=" ) { 4544 4526 match[3] = " " + match[3] + " "; … … 4615 4597 return function() { return true; }; 4616 4598 } 4617 4599 4618 nodeName = nodeName.replace( r backslash, "").toLowerCase();4600 nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); 4619 4601 return function( elem ) { 4620 4602 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 4621 4603 }; 4622 4604 }, 4623 4605 4624 4606 "CLASS": function( className ) { 4625 var pattern = classCache[ expando ][className + " " ];4607 var pattern = classCache[ className + " " ]; 4626 4608 4627 4609 return pattern || 4628 4610 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && … … 4824 4806 }; 4825 4807 }), 4826 4808 4809 // "Whether an element is represented by a :lang() selector 4810 // is based solely on the element's language value 4811 // being equal to the identifier C, 4812 // or beginning with the identifier C immediately followed by "-". 4813 // The matching of C against the element's language value is performed case-insensitively. 4814 // The identifier C does not have to be a valid language name." 4815 // http://www.w3.org/TR/selectors/#lang-pseudo 4816 "lang": markFunction( function( lang ) { 4817 // lang value must be a valid identifider 4818 if ( !ridentifier.test(lang || "") ) { 4819 Sizzle.error( "unsupported lang: " + lang ); 4820 } 4821 lang = lang.replace( runescape, funescape ).toLowerCase(); 4822 return function( elem ) { 4823 var elemLang; 4824 do { 4825 if ( (elemLang = documentIsXML ? 4826 elem.getAttribute("xml:lang") || elem.getAttribute("lang") : 4827 elem.lang) ) { 4828 4829 elemLang = elemLang.toLowerCase(); 4830 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 4831 } 4832 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 4833 return false; 4834 }; 4835 }), 4836 4827 4837 // Miscellaneous 4828 4838 "target": function( elem ) { 4829 4839 var hash = window.location && window.location.hash; … … 4964 4974 function tokenize( selector, parseOnly ) { 4965 4975 var matched, match, tokens, type, 4966 4976 soFar, groups, preFilters, 4967 cached = tokenCache[ expando ][selector + " " ];4977 cached = tokenCache[ selector + " " ]; 4968 4978 4969 4979 if ( cached ) { 4970 4980 return parseOnly ? 0 : cached.slice( 0 ); … … 5357 5367 var i, 5358 5368 setMatchers = [], 5359 5369 elementMatchers = [], 5360 cached = compilerCache[ expando ][selector + " " ];5370 cached = compilerCache[ selector + " " ]; 5361 5371 5362 5372 if ( !cached ) { 5363 5373 // Generate a function of recursive functions that can be used to check each element … … 5403 5413 context.nodeType === 9 && !documentIsXML && 5404 5414 Expr.relative[ tokens[1].type ] ) { 5405 5415 5406 context = Expr.find["ID"]( token.matches[0].replace( r backslash, ""), context )[0];5416 context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0]; 5407 5417 if ( !context ) { 5408 5418 return results; 5409 5419 } … … 5422 5432 if ( (find = Expr.find[ type ]) ) { 5423 5433 // Search, expanding context for leading sibling combinators 5424 5434 if ( (seed = find( 5425 token.matches[0].replace( r backslash, ""),5435 token.matches[0].replace( runescape, funescape ), 5426 5436 rsibling.test( tokens[0].type ) && context.parentNode || context 5427 5437 )) ) { 5428 5438 … … 5944 5954 while ( elem.firstChild ) { 5945 5955 elem.removeChild( elem.firstChild ); 5946 5956 } 5957 5958 // If this is a select, ensure that it displays empty (#12336) 5959 // Support: IE<9 5960 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { 5961 elem.options.length = 0; 5962 } 5947 5963 } 5948 5964 5949 5965 return this; … … 6038 6054 var fragment, first, scripts, hasScripts, node, doc, 6039 6055 i = 0, 6040 6056 l = this.length, 6057 set = this, 6041 6058 iNoClone = l - 1, 6042 6059 value = args[0], 6043 6060 isFunction = jQuery.isFunction( value ); 6044 6061 6045 6062 // We can't cloneNode fragments that contain checked, in WebKit 6046 6063 if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { 6047 return this.each(function( ) {6048 var self = jQuery( this);6064 return this.each(function( index ) { 6065 var self = set.eq( index ); 6049 6066 if ( isFunction ) { 6050 args[0] = value.call( this, i , table ? self.html() : undefined );6067 args[0] = value.call( this, index, table ? self.html() : undefined ); 6051 6068 } 6052 6069 self.domManip( args, table, callback ); 6053 6070 }); … … 6055 6072 6056 6073 if ( this[0] ) { 6057 6074 doc = this[0].ownerDocument; 6058 fragment = doc.createDocumentFragment(); 6059 jQuery.clean( args, doc, fragment, undefined, this ); 6075 fragment = jQuery.buildFragment( args, doc, false, this ); 6060 6076 first = fragment.firstChild; 6061 6077 6062 6078 if ( fragment.childNodes.length === 1 ) { … … 6301 6317 found; 6302 6318 } 6303 6319 6304 // Used in clean, fixes the defaultChecked property6320 // Used in buildFragment, fixes the defaultChecked property 6305 6321 function fixDefaultChecked( elem ) { 6306 6322 if ( manipulation_rcheckableType.test( elem.type ) ) { 6307 6323 elem.defaultChecked = elem.checked; … … 6364 6380 return clone; 6365 6381 }, 6366 6382 6367 clean: function( elems, context, fragment, scripts, selection ) {6383 buildFragment: function( elems, context, scripts, selection ) { 6368 6384 var elem, i, j, tmp, tag, wrap, tbody, 6369 6385 ret = [], 6386 fragment = context.createDocumentFragment(), 6370 6387 safe = context === document && safeFragment; 6371 6388 6372 6389 // Ensure that context is a document … … 6453 6470 jQuery.grep( getAll( ret, "input" ), fixDefaultChecked ); 6454 6471 } 6455 6472 6456 if ( fragment ) { 6457 for ( i = 0; (elem = ret[i]) != null; i++ ) { 6458 safe = jQuery.contains( elem.ownerDocument, elem ); 6473 for ( i = 0; (elem = ret[i]) != null; i++ ) { 6474 safe = jQuery.contains( elem.ownerDocument, elem ); 6459 6475 6460 6461 6462 6463 6464 6465 6466 6476 // Append to fragment 6477 // #4087 - If origin and destination elements are the same, and this is 6478 // that element, do not append to fragment 6479 if ( !selection || jQuery.inArray( elem, selection ) === -1 ) { 6480 fragment.appendChild( elem ); 6481 } 6482 tmp = getAll( elem, "script" ); 6467 6483 6468 6469 6470 6471 6484 // Preserve script evaluation history 6485 if ( safe ) { 6486 setGlobalEval( tmp ); 6487 } 6472 6488 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 } 6489 // Capture executables 6490 if ( scripts ) { 6491 for ( j = 0; (elem = tmp[j]) != null; j++ ) { 6492 if ( rscriptType.test( elem.type || "" ) ) { 6493 scripts.push( elem ); 6479 6494 } 6480 6495 } 6481 6496 } … … 6483 6498 6484 6499 elem = tmp = safe = null; 6485 6500 6486 return ret;6501 return fragment; 6487 6502 }, 6488 6503 6489 6504 cleanData: function( elems, /* internal */ acceptData ) { … … 6525 6540 if ( deleteExpando ) { 6526 6541 delete elem[ internalKey ]; 6527 6542 6528 } else if ( elem.removeAttribute) {6543 } else if ( typeof elem.removeAttribute !== "undefined" ) { 6529 6544 elem.removeAttribute( internalKey ); 6530 6545 6531 6546 } else { … … 6754 6769 6755 6770 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, 6756 6771 // but it would mean to define eight (for every problematic property) identical functions 6757 if ( value === "" && name.indexOf("background") === 0 ) {6758 value = "";6772 if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { 6773 style[ name ] = "inherit"; 6759 6774 } 6760 6775 6761 6776 // If a hook was provided, use that value, otherwise just set the specified value … … 8609 8624 8610 8625 function Animation( elem, properties, options ) { 8611 8626 var result, 8627 stopped, 8612 8628 index = 0, 8613 8629 length = animationPrefilters.length, 8614 8630 deferred = jQuery.Deferred().always( function() { … … 8616 8632 delete tick.elem; 8617 8633 }), 8618 8634 tick = function() { 8635 if ( stopped ) { 8636 return false; 8637 } 8619 8638 var currentTime = fxNow || createFxNow(), 8620 8639 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 8621 8640 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) … … 8657 8676 // if we are going to the end, we want to run all the tweens 8658 8677 // otherwise we skip this part 8659 8678 length = gotoEnd ? animation.tweens.length : 0; 8660 8679 if ( stopped ) { 8680 return this; 8681 } 8682 stopped = true; 8661 8683 for ( ; index < length ; index++ ) { 8662 8684 animation.tweens[ index ].run( 1 ); 8663 8685 } … … 9014 9036 doAnimation = function() { 9015 9037 // Operate on a copy of prop so per-property easing won't be lost 9016 9038 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 9017 9018 // Empty animations resolve immediately 9019 if ( empty ) { 9039 doAnimation.finish = function() { 9020 9040 anim.stop( true ); 9041 }; 9042 // Empty animations, or finishing resolves immediately 9043 if ( empty || jQuery._data( this, "finish" ) ) { 9044 anim.stop( true ); 9021 9045 } 9022 9046 }; 9047 doAnimation.finish = doAnimation; 9023 9048 9024 9049 return empty || optall.queue === false ? 9025 9050 this.each( doAnimation ) : … … 9074 9099 jQuery.dequeue( this, type ); 9075 9100 } 9076 9101 }); 9102 }, 9103 finish: function( type ) { 9104 if ( type !== false ) { 9105 type = type || "fx"; 9106 } 9107 return this.each(function() { 9108 var index, 9109 data = jQuery._data( this ), 9110 queue = data[ type + "queue" ], 9111 hooks = data[ type + "queueHooks" ], 9112 timers = jQuery.timers, 9113 length = queue ? queue.length : 0; 9114 9115 // enable finishing flag on private data 9116 data.finish = true; 9117 9118 // empty the queue first 9119 jQuery.queue( this, type, [] ); 9120 9121 if ( hooks && hooks.cur && hooks.cur.finish ) { 9122 hooks.cur.finish.call( this ); 9123 } 9124 9125 // look for any active animations, and finish them 9126 for ( index = timers.length; index--; ) { 9127 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 9128 timers[ index ].anim.stop( true ); 9129 timers.splice( index, 1 ); 9130 } 9131 } 9132 9133 // look for any animations in the old queue and finish them 9134 for ( index = 0; index < length; index++ ) { 9135 if ( queue[ index ] && queue[ index ].finish ) { 9136 queue[ index ].finish.call( this ); 9137 } 9138 } 9139 9140 // turn off finishing flag 9141 delete data.finish; 9142 }); 9077 9143 } 9078 9144 }); 9079 9145 -
wp-includes/js/jquery/jquery-migrate.js
1 1 /*! 2 * jQuery Migrate - v1.0.0pre - 201 2-12-172 * jQuery Migrate - v1.0.0pre - 2013-01-09 3 3 * https://github.com/jquery/jquery-migrate 4 * Copyright 201 2jQuery Foundation and other contributors; Licensed MIT4 * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT 5 5 */ 6 7 6 (function( jQuery, window, undefined ) { 8 7 "use strict"; 9 8 10 9 // 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 } 10 // the minified version will set this to false during compilation. 11 window.JQMIGRATE_WARN = typeof JQMIGRATE_WARN === "undefined"; 15 12 16 13 17 14 var warnedAbout = {}; … … 19 16 // List of warnings already given; public read only 20 17 jQuery.migrateWarnings = []; 21 18 19 // Set to true to prevent console output; migrateWarnings still maintained 20 // Leave as undefined so that it can be set before plugin is loaded 21 //jQuery.migrateMute = false; 22 22 23 // Forget any warnings we've already given; public 23 24 jQuery.migrateReset = function() { 24 25 warnedAbout = {}; … … 30 31 if ( !warnedAbout[ msg ] ) { 31 32 warnedAbout[ msg ] = true; 32 33 jQuery.migrateWarnings.push( msg ); 33 if ( window.console && console.warn ) {34 if ( window.console && console.warn && !jQuery.migrateMute ) { 34 35 console.warn( "JQMIGRATE: " + msg ); 35 36 } 36 37 } … … 78 79 valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set || 79 80 function() { return undefined; }, 80 81 rnoType = /^(?:input|button)$/i, 81 rnoAttrNodeType = /^[238]$/; 82 rnoAttrNodeType = /^[238]$/, 83 rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, 84 ruseDefault = /^(?:checked|selected)$/i; 82 85 83 86 // jQuery.attrFn 84 87 migrateWarnProp( jQuery, "attrFn", attrFn, "jQuery.attrFn is deprecated" ); 85 88 86 89 jQuery.attr = function( elem, name, value, pass ) { 90 var lowerName = name.toLowerCase(), 91 nType = elem && elem.nodeType; 92 87 93 if ( pass ) { 88 94 migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); 89 if ( elem && !rnoAttrNodeType.test( elem.nodeType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {95 if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) { 90 96 return jQuery( elem )[ name ]( value ); 91 97 } 92 98 } … … 96 102 migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8"); 97 103 } 98 104 105 // Restore boolHook for boolean property/attribute synchronization 106 if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) { 107 jQuery.attrHooks[ lowerName ] = { 108 get: function( elem, name ) { 109 // Align boolean attributes with corresponding properties 110 // Fall back to attribute presence where some booleans are not supported 111 var attrNode, 112 property = jQuery.prop( elem, name ); 113 return property === true || typeof property !== "boolean" && 114 ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? 115 116 name.toLowerCase() : 117 undefined; 118 }, 119 set: function( elem, value, name ) { 120 var propName; 121 if ( value === false ) { 122 // Remove boolean attributes when set to false 123 jQuery.removeAttr( elem, name ); 124 } else { 125 // value is true since we know at this point it's type boolean and not false 126 // Set boolean attributes to the same name and set the DOM property 127 propName = jQuery.propFix[ name ] || name; 128 if ( propName in elem ) { 129 // Only set the IDL specifically if it already exists on the element 130 elem[ propName ] = true; 131 } 132 133 elem.setAttribute( name, name.toLowerCase() ); 134 } 135 return name; 136 } 137 }; 138 139 // Warn only for attributes that can remain distinct from their properties post-1.9 140 if ( ruseDefault.test( lowerName ) ) { 141 migrateWarn( "jQuery.fn.attr(" + lowerName + ") may use property instead of attribute" ); 142 } 143 } 144 99 145 return attr.call( jQuery, elem, name, value ); 100 146 }; 101 147 102 148 // attrHooks: value 103 149 jQuery.attrHooks.value = { 104 150 get: function( elem, name ) { 105 if ( jQuery.nodeName( elem, "button" ) ) { 151 var nodeName = ( elem.nodeName || "" ).toLowerCase(); 152 if ( nodeName === "button" ) { 106 153 return valueAttrGet.apply( this, arguments ); 107 154 } 108 migrateWarn("property-based jQuery.fn.attr('value') is deprecated"); 155 if ( nodeName !== "input" && nodeName !== "option" ) { 156 migrateWarn("property-based jQuery.fn.attr('value') is deprecated"); 157 } 109 158 return name in elem ? 110 159 elem.value : 111 160 null; 112 161 }, 113 set: function( elem, value, name ) { 114 if ( jQuery.nodeName( elem, "button" ) ) { 162 set: function( elem, value ) { 163 var nodeName = ( elem.nodeName || "" ).toLowerCase(); 164 if ( nodeName === "button" ) { 115 165 return valueAttrSet.apply( this, arguments ); 116 166 } 117 migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated"); 167 if ( nodeName !== "input" && nodeName !== "option" ) { 168 migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated"); 169 } 118 170 // Does not return so that setAttribute is also used 119 171 elem.value = value; 120 172 } … … 122 174 123 175 124 176 var matched, browser, 125 oldAccess = jQuery.access,126 177 oldInit = jQuery.fn.init, 127 178 // Note this does NOT include the # XSS fix from 1.7! 128 rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w -]*))$/;179 rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/; 129 180 130 181 // $(html) "looks like html" rule change 131 182 jQuery.fn.init = function( selector, context, rootjQuery ) { … … 151 202 }; 152 203 jQuery.fn.init.prototype = jQuery.fn; 153 204 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 175 205 jQuery.uaMatch = function( ua ) { 176 206 ua = ua.toLowerCase(); 177 207 … … 250 280 }; 251 281 252 282 253 var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack, 254 oldFragment = jQuery.buildFragment; 283 var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; 255 284 256 285 jQuery.fn.andSelf = function() { 257 286 migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"); 258 287 return oldSelf.apply( this, arguments ); 259 288 }; 260 289 261 jQuery.buildFragment = function( args, context, scripts ) { 262 var fragment; 290 // Since jQuery.clean is used internally on older versions, we only shim if it's missing 291 if ( !jQuery.clean ) { 292 jQuery.clean = function( elems, context, fragment, scripts, selection ) { 293 var newFragment = jQuery.buildFragment( elems, context || document, scripts, selection ); 263 294 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 268 context = context || document; 269 context = !context.nodeType && context[0] || context; 270 context = context.ownerDocument || context; 295 migrateWarn("jQuery.clean() is deprecated"); 296 if ( fragment ) { 297 fragment.appendChild( newFragment ); 271 298 272 fragment = context.createDocumentFragment(); 273 jQuery.clean( args, context, fragment, scripts ); 299 } else { 300 fragment = newFragment; 301 } 274 302 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 ); 280 }; 303 return jQuery.merge( [], fragment.childNodes ); 304 }; 305 } 281 306 282 307 var eventAdd = jQuery.event.add, 283 308 eventRemove = jQuery.event.remove, … … 314 339 eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes ); 315 340 }; 316 341 317 jQuery.fn.error = function( data, fn) {342 jQuery.fn.error = function() { 318 343 var args = Array.prototype.slice.call( arguments, 0); 319 344 migrateWarn("jQuery.fn.error() is deprecated"); 320 345 args.splice( 0, 0, "error" ); … … 387 412 jQuery.each( ajaxEvents.split("|"), 388 413 function( _, name ) { 389 414 jQuery.event.special[ name ] = { 390 setup: function( data) {415 setup: function() { 391 416 var elem = this; 392 417 393 418 // The document needs no shimming; must be !== for oldIE 394 419 if ( elem !== document ) { 395 jQuery.event.add( document, name + "." + jQuery.guid, function( event) {420 jQuery.event.add( document, name + "." + jQuery.guid, function() { 396 421 jQuery.event.trigger( name, null, elem, true ); 397 422 }); 398 423 jQuery._data( this, name, jQuery.guid++ ); 399 424 } 400 425 return false; 401 426 }, 402 teardown: function( data, handleObj) {427 teardown: function() { 403 428 if ( this !== document ) { 404 429 jQuery.event.remove( document, name + "." + jQuery._data( this, name ) ); 405 430 } 406 431 return false; 407 432 } 408 } 433 }; 409 434 } 410 435 ); 411 436