Changeset 23421
- Timestamp:
- 02/15/2013 04:09:04 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/jquery/jquery-migrate.js
r23301 r23421 1 1 /*! 2 * jQuery Migrate - v1. 0.0 - 2013-01-142 * jQuery Migrate - v1.1.0 - 2013-01-31 3 3 * https://github.com/jquery/jquery-migrate 4 4 * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT … … 15 15 // Set to true to prevent console output; migrateWarnings still maintained 16 16 // jQuery.migrateMute = false; 17 18 // Show a message on the console so devs know we're active 19 if ( !jQuery.migrateMute && window.console && console.log ) { 20 console.log("JQMIGRATE: Logging is active"); 21 } 22 23 // Set to false to disable traces that appear with warnings 24 if ( jQuery.migrateTrace === undefined ) { 25 jQuery.migrateTrace = true; 26 } 17 27 18 28 // Forget any warnings we've already given; public … … 28 38 if ( window.console && console.warn && !jQuery.migrateMute ) { 29 39 console.warn( "JQMIGRATE: " + msg ); 40 if ( jQuery.migrateTrace && console.trace ) { 41 console.trace(); 42 } 30 43 } 31 44 } … … 67 80 68 81 var attrFn = {}, 69 attr = jQuery.attr,82 oldAttr = jQuery.attr, 70 83 valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get || 71 84 function() { return null; }, … … 84 97 nType = elem && elem.nodeType; 85 98 86 if ( pass ) { 99 // Since pass is used internally, we only warn and shim for new jQuery 100 // versions where there isn't a pass arg in the formal params 101 if ( pass && oldAttr.length < 4 ) { 87 102 migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); 88 103 if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) { … … 91 106 } 92 107 93 // Warn if user tries to set `type` since it breaks on IE 6/7/8 94 if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) ) { 108 // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking 109 // for disconnected elements we don't warn on $( "<button>", { type: "button" } ). 110 if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) { 95 111 migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8"); 96 112 } … … 132 148 // Warn only for attributes that can remain distinct from their properties post-1.9 133 149 if ( ruseDefault.test( lowerName ) ) { 134 migrateWarn( "jQuery.fn.attr( " + lowerName + ") may use property instead of attribute" );135 } 136 } 137 138 return attr.call( jQuery, elem, name, value );150 migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" ); 151 } 152 } 153 154 return oldAttr.call( jQuery, elem, name, value ); 139 155 }; 140 156 … … 147 163 } 148 164 if ( nodeName !== "input" && nodeName !== "option" ) { 149 migrateWarn(" property-based jQuery.fn.attr('value') is deprecated");165 migrateWarn("jQuery.fn.attr('value') no longer gets properties"); 150 166 } 151 167 return name in elem ? … … 159 175 } 160 176 if ( nodeName !== "input" && nodeName !== "option" ) { 161 migrateWarn(" property-based jQuery.fn.attr('value', val) is deprecated");177 migrateWarn("jQuery.fn.attr('value', val) no longer sets properties"); 162 178 } 163 179 // Does not return so that setAttribute is also used … … 169 185 var matched, browser, 170 186 oldInit = jQuery.fn.init, 171 // Note this does NOT include the # XSS fix from 1.7! 172 rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/; 187 oldParseJSON = jQuery.parseJSON, 188 // Note this does NOT include the #9521 XSS fix from 1.7! 189 rquickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*|#([\w\-]*))$/; 173 190 174 191 // $(html) "looks like html" rule change … … 195 212 }; 196 213 jQuery.fn.init.prototype = jQuery.fn; 214 215 // Let $.parseJSON(falsy_value) return null 216 jQuery.parseJSON = function( json ) { 217 if ( !json && json !== null ) { 218 migrateWarn("jQuery.parseJSON requires a valid JSON string"); 219 return null; 220 } 221 return oldParseJSON.apply( this, arguments ); 222 }; 197 223 198 224 jQuery.uaMatch = function( ua ) { … … 275 301 276 302 var rscriptType = /\/(java|ecma)script/i, 277 oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack, 278 oldFragment = jQuery.buildFragment; 303 oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; 279 304 280 305 jQuery.fn.andSelf = function() { … … 332 357 }; 333 358 } 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 logic340 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 it348 } 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 user352 migrateWarn( warning );353 }354 355 // jQuery < 1.9 returned an object instead of the fragment itself356 if ( !ret.fragment ) {357 migrateWarnProp( ret, "fragment", ret, warning );358 migrateWarnProp( ret, "cacheable", false, warning );359 }360 361 return ret;362 };363 359 364 360 var eventAdd = jQuery.event.add, … … 387 383 388 384 // 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" ); 385 if ( jQuery.event.dispatch ) { 386 migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" ); 387 } 390 388 391 389 // Support for 'hover' pseudo-event and ajax event warnings -
trunk/wp-includes/js/jquery/jquery.js
r23301 r23421 1 1 /*! 2 * jQuery JavaScript Library v1.9. 02 * jQuery JavaScript Library v1.9.1 3 3 * http://jquery.com/ 4 4 * … … 10 10 * http://jquery.org/license 11 11 * 12 * Date: 2013- 1-1412 * Date: 2013-2-4 13 13 */ 14 14 (function( window, undefined ) { 15 "use strict"; 15 16 // Can't do this because several apps including ASP.NET trace 17 // the stack via arguments.caller.callee and Firefox dies if 18 // you try to trace through "use strict" call chains. (#13335) 19 // Support: Firefox 18+ 20 //"use strict"; 16 21 var 22 // The deferred used on DOM ready 23 readyList, 24 17 25 // A central reference to the root jQuery(document) 18 26 rootjQuery, 19 27 20 // The deferred used on DOM ready 21 readyList, 28 // Support: IE<9 29 // For `typeof node.method` instead of `node.method !== undefined` 30 core_strundefined = typeof undefined, 22 31 23 32 // Use the correct document accordingly with window argument (sandbox) … … 37 46 core_deletedIds = [], 38 47 39 core_version = "1.9. 0",48 core_version = "1.9.1", 40 49 41 50 // Save a reference to some core methods … … 86 95 }, 87 96 88 // The ready event handler and self cleanup method 89 DOMContentLoaded = function() { 97 // The ready event handler 98 completed = function( event ) { 99 100 // readyState === "complete" is good enough for us to call the dom ready in oldIE 101 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { 102 detach(); 103 jQuery.ready(); 104 } 105 }, 106 // Clean-up method for dom ready events 107 detach = function() { 90 108 if ( document.addEventListener ) { 91 document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); 92 jQuery.ready(); 93 } else if ( document.readyState === "complete" ) { 94 // we're here because readyState === "complete" in oldIE 95 // which is good enough for us to call the dom ready! 96 document.detachEvent( "onreadystatechange", DOMContentLoaded ); 97 jQuery.ready(); 109 document.removeEventListener( "DOMContentLoaded", completed, false ); 110 window.removeEventListener( "load", completed, false ); 111 112 } else { 113 document.detachEvent( "onreadystatechange", completed ); 114 window.detachEvent( "onload", completed ); 98 115 } 99 116 }; … … 300 317 301 318 jQuery.extend = jQuery.fn.extend = function() { 302 var options, name, src, copy, copyIsArray, clone,319 var src, copyIsArray, copy, name, options, clone, 303 320 target = arguments[0] || {}, 304 321 i = 1, … … 782 799 // arguments. 783 800 proxy: function( fn, context ) { 784 var tmp, args, proxy;801 var args, proxy, tmp; 785 802 786 803 if ( typeof context === "string" ) { … … 881 898 } else if ( document.addEventListener ) { 882 899 // Use the handy event callback 883 document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );900 document.addEventListener( "DOMContentLoaded", completed, false ); 884 901 885 902 // A fallback to window.onload, that will always work 886 window.addEventListener( "load", jQuery.ready, false );903 window.addEventListener( "load", completed, false ); 887 904 888 905 // If IE event model is used 889 906 } else { 890 907 // Ensure firing before onload, maybe late but safe also for iframes 891 document.attachEvent( "onreadystatechange", DOMContentLoaded );908 document.attachEvent( "onreadystatechange", completed ); 892 909 893 910 // A fallback to window.onload, that will always work 894 window.attachEvent( "onload", jQuery.ready);911 window.attachEvent( "onload", completed ); 895 912 896 913 // If IE and not a frame … … 913 930 return setTimeout( doScrollCheck, 50 ); 914 931 } 932 933 // detach all dom ready events 934 detach(); 915 935 916 936 // and execute any waiting functions … … 990 1010 jQuery.extend( {}, options ); 991 1011 992 var // Last fire value (for non-forgettable lists) 1012 var // Flag to know if list is currently firing 1013 firing, 1014 // Last fire value (for non-forgettable lists) 993 1015 memory, 994 1016 // Flag to know if list was already fired 995 1017 fired, 996 // Flag to know if list is currently firing997 firing,998 // First callback to fire (used internally by add and fireWith)999 firingStart,1000 1018 // End of the loop when firing 1001 1019 firingLength, 1002 1020 // Index of currently firing callback (modified by remove if needed) 1003 1021 firingIndex, 1022 // First callback to fire (used internally by add and fireWith) 1023 firingStart, 1004 1024 // Actual callback list 1005 1025 list = [], … … 1087 1107 return this; 1088 1108 }, 1089 // Control if a given callback is in the list 1109 // Check if a given callback is in the list. 1110 // If no argument is given, return whether or not list has callbacks attached. 1090 1111 has: function( fn ) { 1091 return jQuery.inArray( fn, list ) > -1;1112 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); 1092 1113 }, 1093 1114 // Remove all callbacks from the list … … 1286 1307 jQuery.support = (function() { 1287 1308 1288 var support, all, a, select, opt, input, fragment, eventName, isSupported, i, 1309 var support, all, a, 1310 input, select, fragment, 1311 opt, eventName, isSupported, i, 1289 1312 div = document.createElement("div"); 1290 1313 … … 1487 1510 } 1488 1511 1489 if ( typeof div.style.zoom !== "undefined") {1512 if ( typeof div.style.zoom !== core_strundefined ) { 1490 1513 // Support: IE<8 1491 1514 // Check if natively block-level elements act like inline-block … … 1503 1526 support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); 1504 1527 1505 // Prevent IE 6 from affecting layout for positioned elements #11048 1506 // Prevent IE from shrinking the body in IE 7 mode #12869 1507 body.style.zoom = 1; 1528 if ( support.inlineBlockNeedsLayout ) { 1529 // Prevent IE 6 from affecting layout for positioned elements #11048 1530 // Prevent IE from shrinking the body in IE 7 mode #12869 1531 // Support: IE<8 1532 body.style.zoom = 1; 1533 } 1508 1534 } 1509 1535 … … 1522 1548 var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, 1523 1549 rmultiDash = /([A-Z])/g; 1524 1550 1525 1551 function internalData( elem, name, data, pvt /* Internal Use Only */ ){ 1526 1552 if ( !jQuery.acceptData( elem ) ) { … … 1617 1643 } 1618 1644 1619 function internalRemoveData( elem, name, pvt /* For internal use only */ ){1645 function internalRemoveData( elem, name, pvt ) { 1620 1646 if ( !jQuery.acceptData( elem ) ) { 1621 1647 return; 1622 1648 } 1623 1649 1624 var thisCache, i, l, 1625 1650 var i, l, thisCache, 1626 1651 isNode = elem.nodeType, 1627 1652 … … 1727 1752 1728 1753 data: function( elem, name, data ) { 1729 return internalData( elem, name, data , false);1754 return internalData( elem, name, data ); 1730 1755 }, 1731 1756 1732 1757 removeData: function( elem, name ) { 1733 return internalRemoveData( elem, name , false);1758 return internalRemoveData( elem, name ); 1734 1759 }, 1735 1760 … … 1738 1763 return internalData( elem, name, data, true ); 1739 1764 }, 1740 1765 1741 1766 _removeData: function( elem, name ) { 1742 1767 return internalRemoveData( elem, name, true ); … … 1745 1770 // A method for determining if a DOM node can handle the data expando 1746 1771 acceptData: function( elem ) { 1772 // Do not set data on non-element because it will not be cleared (#8335). 1773 if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { 1774 return false; 1775 } 1776 1747 1777 var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; 1748 1778 … … 1770 1800 1771 1801 if ( !name.indexOf( "data-" ) ) { 1772 name = jQuery.camelCase( name.s ubstring(5) );1802 name = jQuery.camelCase( name.slice(5) ); 1773 1803 1774 1804 dataAttr( elem, name, data[ name ] ); … … 1821 1851 try { 1822 1852 data = data === "true" ? true : 1823 data === "false" ? false :1824 data === "null" ? null :1825 // Only convert to a number if it doesn't change the string1826 +data + "" === data ? +data :1827 rbrace.test( data ) ? jQuery.parseJSON( data ) :1828 data;1853 data === "false" ? false : 1854 data === "null" ? null : 1855 // Only convert to a number if it doesn't change the string 1856 +data + "" === data ? +data : 1857 rbrace.test( data ) ? jQuery.parseJSON( data ) : 1858 data; 1829 1859 } catch( e ) {} 1830 1860 … … 2142 2172 2143 2173 // Toggle whole class name 2144 } else if ( type === "undefined"|| type === "boolean" ) {2174 } else if ( type === core_strundefined || type === "boolean" ) { 2145 2175 if ( this.className ) { 2146 2176 // store className if set … … 2171 2201 2172 2202 val: function( value ) { 2173 var hooks, ret, isFunction,2203 var ret, hooks, isFunction, 2174 2204 elem = this[0]; 2175 2205 … … 2295 2325 2296 2326 attr: function( elem, name, value ) { 2297 var ret, hooks, notxml,2327 var hooks, notxml, ret, 2298 2328 nType = elem.nodeType; 2299 2329 … … 2304 2334 2305 2335 // Fallback to prop when attributes are not supported 2306 if ( typeof elem.getAttribute === "undefined") {2336 if ( typeof elem.getAttribute === core_strundefined ) { 2307 2337 return jQuery.prop( elem, name, value ); 2308 2338 } … … 2337 2367 // In IE9+, Flash objects don't have .getAttribute (#12945) 2338 2368 // Support: IE9+ 2339 if ( typeof elem.getAttribute !== "undefined") {2369 if ( typeof elem.getAttribute !== core_strundefined ) { 2340 2370 ret = elem.getAttribute( name ); 2341 2371 } … … 2687 2717 2688 2718 add: function( elem, types, handler, data, selector ) { 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 2719 var tmp, events, t, handleObjIn, 2720 special, eventHandle, handleObj, 2721 handlers, type, namespaces, origType, 2722 elemData = jQuery._data( elem ); 2723 2724 // Don't attach events to noData or text/comment nodes (but allow plain objects) 2696 2725 if ( !elemData ) { 2697 2726 return; … … 2718 2747 // Discard the second event of a jQuery.event.trigger() and 2719 2748 // when an event is called after a page has unloaded 2720 return typeof jQuery !== "undefined"&& (!e || jQuery.event.triggered !== e.type) ?2749 return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? 2721 2750 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : 2722 2751 undefined; … … 2798 2827 // Detach an event or set of events from an element 2799 2828 remove: function( elem, types, handler, selector, mappedTypes ) { 2800 2801 var j, origCount, tmp,2802 events, t, handleObj,2803 special, handlers, type,namespaces, origType,2829 var j, handleObj, tmp, 2830 origCount, t, events, 2831 special, handlers, type, 2832 namespaces, origType, 2804 2833 elemData = jQuery.hasData( elem ) && jQuery._data( elem ); 2805 2834 … … 2871 2900 2872 2901 trigger: function( event, data, elem, onlyHandlers ) { 2873 2874 var i, cur, tmp, bubbleType, ontype, handle, special,2902 var handle, ontype, cur, 2903 bubbleType, special, tmp, i, 2875 2904 eventPath = [ elem || document ], 2876 type = event.type ||event,2877 namespaces = event.namespace? event.namespace.split(".") : [];2905 type = core_hasOwn.call( event, "type" ) ? event.type : event, 2906 namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; 2878 2907 2879 2908 cur = tmp = elem = elem || document; … … 3009 3038 event = jQuery.event.fix( event ); 3010 3039 3011 var i, j, ret, matched, handleObj,3040 var i, ret, handleObj, matched, j, 3012 3041 handlerQueue = [], 3013 3042 args = core_slice.call( arguments ), … … 3064 3093 3065 3094 handlers: function( event, handlers ) { 3066 var i, matches, sel, handleObj,3095 var sel, handleObj, matches, i, 3067 3096 handlerQueue = [], 3068 3097 delegateCount = handlers.delegateCount, … … 3076 3105 for ( ; cur != this; cur = cur.parentNode || this ) { 3077 3106 3107 // Don't check non-elements (#13208) 3078 3108 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 3079 if ( cur. disabled !== true || event.type !== "click") {3109 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { 3080 3110 matches = []; 3081 3111 for ( i = 0; i < delegateCount; i++ ) { … … 3115 3145 3116 3146 // Create a writable copy of the event object and normalize some properties 3117 var i, prop, 3147 var i, prop, copy, 3148 type = event.type, 3118 3149 originalEvent = event, 3119 fixHook = jQuery.event.fixHooks[ event.type ] || {}, 3120 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 3150 fixHook = this.fixHooks[ type ]; 3151 3152 if ( !fixHook ) { 3153 this.fixHooks[ type ] = fixHook = 3154 rmouseEvent.test( type ) ? this.mouseHooks : 3155 rkeyEvent.test( type ) ? this.keyHooks : 3156 {}; 3157 } 3158 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 3121 3159 3122 3160 event = new jQuery.Event( originalEvent ); … … 3168 3206 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), 3169 3207 filter: function( event, original ) { 3170 var eventDoc, doc, body,3208 var body, eventDoc, doc, 3171 3209 button = original.button, 3172 3210 fromElement = original.fromElement; … … 3284 3322 // #8545, #7054, preventing memory leaks for custom events in IE6-8 3285 3323 // detachEvent needed property on element, by name of that event, to properly expose it to GC 3286 if ( typeof elem[ name ] === "undefined") {3324 if ( typeof elem[ name ] === core_strundefined ) { 3287 3325 elem[ name ] = null; 3288 3326 } … … 3533 3571 3534 3572 on: function( types, selector, data, fn, /*INTERNAL*/ one ) { 3535 var origFn, type;3573 var type, origFn; 3536 3574 3537 3575 // Types can be a map of types/handlers … … 3645 3683 return jQuery.event.trigger( type, data, elem, true ); 3646 3684 } 3647 },3648 3649 hover: function( fnOver, fnOut ) {3650 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );3651 }3652 });3653 3654 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +3655 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +3656 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {3657 3658 // Handle event binding3659 jQuery.fn[ name ] = function( data, fn ) {3660 return arguments.length > 0 ?3661 this.on( name, null, data, fn ) :3662 this.trigger( name );3663 };3664 3665 if ( rkeyEvent.test( name ) ) {3666 jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;3667 }3668 3669 if ( rmouseEvent.test( name ) ) {3670 jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;3671 3685 } 3672 3686 }); … … 3782 3796 rsibling = /[\x20\t\r\n\f]*[+~]/, 3783 3797 3784 rnative = / \{\s*\[native code\]\s*\}/,3798 rnative = /^[^{]+\{\s*\[native code/, 3785 3799 3786 3800 // Easily-parseable/retrievable ID or TAG or CLASS selectors … … 3809 3823 // Use a stripped-down slice if we can't use a native one 3810 3824 try { 3811 slice.call( docElem.childNodes, 0 )[0].nodeType;3825 slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType; 3812 3826 } catch ( e ) { 3813 3827 slice = function( i ) { 3814 3828 var elem, 3815 3829 results = []; 3816 for ( ; (elem = this[i]); i++) {3830 while ( (elem = this[i++]) ) { 3817 3831 results.push( elem ); 3818 3832 } … … 4133 4147 // Filter out possible comments 4134 4148 if ( tag === "*" ) { 4135 for ( ; (elem = results[i]); i++) {4149 while ( (elem = results[i++]) ) { 4136 4150 if ( elem.nodeType === 1 ) { 4137 4151 tmp.push( elem ); … … 4291 4305 bp = [ b ]; 4292 4306 4293 // The nodes are identical, we can exit early4307 // Exit early if the nodes are identical 4294 4308 if ( a === b ) { 4295 4309 hasDuplicate = true; 4296 4310 return 0; 4297 4298 // Fallback to using sourceIndex (in IE) if it's available on both nodes4299 } else if ( a.sourceIndex && b.sourceIndex ) {4300 return ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE );4301 4311 4302 4312 // Parentless nodes are either documents or disconnected … … 4438 4448 4439 4449 function siblingCheck( a, b ) { 4440 var cur = a && b && a.nextSibling; 4441 4442 for ( ; cur; cur = cur.nextSibling ) { 4443 if ( cur === b ) { 4444 return -1; 4450 var cur = b && a, 4451 diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); 4452 4453 // Use IE sourceIndex if available on both nodes 4454 if ( diff ) { 4455 return diff; 4456 } 4457 4458 // Check if b follows a 4459 if ( cur ) { 4460 while ( (cur = cur.nextSibling) ) { 4461 if ( cur === b ) { 4462 return -1; 4463 } 4445 4464 } 4446 4465 } … … 4652 4671 operator === "^=" ? check && result.indexOf( check ) === 0 : 4653 4672 operator === "*=" ? check && result.indexOf( check ) > -1 : 4654 operator === "$=" ? check && result.s ubstr( result.length -check.length ) === check :4673 operator === "$=" ? check && result.slice( -check.length ) === check : 4655 4674 operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : 4656 operator === "|=" ? result === check || result.s ubstr( 0, check.length + 1 ) === check + "-" :4675 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 4657 4676 false; 4658 4677 }; … … 5072 5091 function addCombinator( matcher, combinator, base ) { 5073 5092 var dir = combinator.dir, 5074 checkNonElements = base && combinator.dir === "parentNode",5093 checkNonElements = base && dir === "parentNode", 5075 5094 doneName = done++; 5076 5095 … … 5315 5334 // We must always have either seed elements or context 5316 5335 elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), 5317 // Nested matchers should use non-integer dirruns5318 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math. E);5336 // Use integer dirruns iff this is the outermost matcher 5337 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); 5319 5338 5320 5339 if ( outermost ) { … … 5324 5343 5325 5344 // Add elements passing elementMatchers directly to results 5345 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below 5326 5346 for ( ; (elem = elems[i]) != null; i++ ) { 5327 5347 if ( byElement && elem ) { 5328 for ( j = 0; (matcher = elementMatchers[j]); j++ ) { 5348 j = 0; 5349 while ( (matcher = elementMatchers[j++]) ) { 5329 5350 if ( matcher( elem, context, xml ) ) { 5330 5351 results.push( elem ); … … 5353 5374 5354 5375 // Apply set filters to unmatched elements 5355 // `i` starts as a string, so matchedCount would equal "00" if there are no elements5356 5376 matchedCount += i; 5357 5377 if ( bySet && i !== matchedCount ) { 5358 for ( j = 0; (matcher = setMatchers[j]); j++ ) { 5378 j = 0; 5379 while ( (matcher = setMatchers[j++]) ) { 5359 5380 matcher( unmatched, setMatched, context, xml ); 5360 5381 } … … 5458 5479 5459 5480 // Fetch a seed set for right-to-left matching 5460 for ( i = matchExpr["needsContext"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) { 5481 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 5482 while ( i-- ) { 5461 5483 token = tokens[i]; 5462 5484 … … 5536 5558 jQuery.fn.extend({ 5537 5559 find: function( selector ) { 5538 var i, ret, self; 5560 var i, ret, self, 5561 len = this.length; 5539 5562 5540 5563 if ( typeof selector !== "string" ) { 5541 5564 self = this; 5542 5565 return this.pushStack( jQuery( selector ).filter(function() { 5543 for ( i = 0; i < self.length; i++ ) {5566 for ( i = 0; i < len; i++ ) { 5544 5567 if ( jQuery.contains( self[ i ], this ) ) { 5545 5568 return true; … … 5550 5573 5551 5574 ret = []; 5552 for ( i = 0; i < this.length; i++ ) {5575 for ( i = 0; i < len; i++ ) { 5553 5576 jQuery.find( selector, this[ i ], ret ); 5554 5577 } 5555 5578 5556 5579 // Needed because $( selector, context ) becomes $( context ).find( selector ) 5557 ret = this.pushStack( jQuery.unique( ret ));5580 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); 5558 5581 ret.selector = ( this.selector ? this.selector + " " : "" ) + selector; 5559 5582 return ret; … … 6067 6090 parent = this.parentNode; 6068 6091 6069 if ( parent && this.nodeType === 1 || this.nodeType === 11 ) { 6070 6092 if ( parent ) { 6071 6093 jQuery( this ).remove(); 6072 6073 if ( next ) { 6074 next.parentNode.insertBefore( elem, next ); 6075 } else { 6076 parent.appendChild( elem ); 6077 } 6094 parent.insertBefore( elem, next ); 6078 6095 } 6079 6096 }); … … 6089 6106 args = core_concat.apply( [], args ); 6090 6107 6091 var fragment, first, scripts, hasScripts, node, doc, 6108 var first, node, hasScripts, 6109 scripts, doc, fragment, 6092 6110 i = 0, 6093 6111 l = this.length, … … 6240 6258 6241 6259 function fixCloneNodeIssues( src, dest ) { 6242 var nodeName, data, e;6260 var nodeName, e, data; 6243 6261 6244 6262 // We do not need to do anything for non-Elements … … 6335 6353 var elems, elem, 6336 6354 i = 0, 6337 found = typeof context.getElementsByTagName !== "undefined"? context.getElementsByTagName( tag || "*" ) :6338 typeof context.querySelectorAll !== "undefined"? context.querySelectorAll( tag || "*" ) :6355 found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : 6356 typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : 6339 6357 undefined; 6340 6358 … … 6363 6381 jQuery.extend({ 6364 6382 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 6365 var destElements, srcElements, node, i, clone,6383 var destElements, node, clone, i, srcElements, 6366 6384 inPage = jQuery.contains( elem.ownerDocument, elem ); 6367 6385 … … 6418 6436 6419 6437 buildFragment: function( elems, context, scripts, selection ) { 6420 var contains, elem, tag, tmp, wrap, tbody, j, 6438 var j, elem, contains, 6439 tmp, tag, tbody, wrap, 6421 6440 l = elems.length, 6422 6441 … … 6544 6563 6545 6564 cleanData: function( elems, /* internal */ acceptData ) { 6546 var data, id, elem, type,6565 var elem, type, id, data, 6547 6566 i = 0, 6548 6567 internalKey = jQuery.expando, … … 6582 6601 delete elem[ internalKey ]; 6583 6602 6584 } else if ( typeof elem.removeAttribute !== "undefined") {6603 } else if ( typeof elem.removeAttribute !== core_strundefined ) { 6585 6604 elem.removeAttribute( internalKey ); 6586 6605 … … 6596 6615 } 6597 6616 }); 6598 var curCSS, getStyles, iframe,6617 var iframe, getStyles, curCSS, 6599 6618 ralpha = /alpha\([^)]*\)/i, 6600 6619 ropacity = /opacity\s*=\s*([^)]*)/, … … 6649 6668 6650 6669 function showHide( elements, show ) { 6651 var elem,6670 var display, elem, hidden, 6652 6671 values = [], 6653 6672 index = 0, … … 6659 6678 continue; 6660 6679 } 6680 6661 6681 values[ index ] = jQuery._data( elem, "olddisplay" ); 6682 display = elem.style.display; 6662 6683 if ( show ) { 6663 6684 // Reset the inline display of this element to learn if it is 6664 6685 // being hidden by cascaded rules or not 6665 if ( !values[ index ] && elem.style.display === "none" ) {6686 if ( !values[ index ] && display === "none" ) { 6666 6687 elem.style.display = ""; 6667 6688 } … … 6673 6694 values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); 6674 6695 } 6675 } else if ( !values[ index ] && !isHidden( elem ) ) { 6676 jQuery._data( elem, "olddisplay", jQuery.css( elem, "display" ) ); 6696 } else { 6697 6698 if ( !values[ index ] ) { 6699 hidden = isHidden( elem ); 6700 6701 if ( display && display !== "none" || !hidden ) { 6702 jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); 6703 } 6704 } 6677 6705 } 6678 6706 } … … 6696 6724 css: function( name, value ) { 6697 6725 return jQuery.access( this, function( elem, name, value ) { 6698 var styles, len,6726 var len, styles, 6699 6727 map = {}, 6700 6728 i = 0; … … 6837 6865 6838 6866 css: function( elem, name, extra, styles ) { 6839 var val, num, hooks,6867 var num, val, hooks, 6840 6868 origName = jQuery.camelCase( name ); 6841 6869 … … 6863 6891 6864 6892 // Return, converting to number if forced or a qualifier was provided and val looks numeric 6865 if ( extra ) {6893 if ( extra === "" || extra ) { 6866 6894 num = parseFloat( val ); 6867 6895 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; … … 7228 7256 if ( jQuery.expr && jQuery.expr.filters ) { 7229 7257 jQuery.expr.filters.hidden = function( elem ) { 7230 return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); 7258 // Support: Opera <= 12.12 7259 // Opera reports offsetWidths and offsetHeights less than zero on some elements 7260 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || 7261 (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); 7231 7262 }; 7232 7263 … … 7266 7297 rbracket = /\[\]$/, 7267 7298 rCRLF = /\r?\n/g, 7268 rsubmitterTypes = /^(?:submit|button|image|reset )$/i,7299 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 7269 7300 rsubmittable = /^(?:input|select|textarea|keygen)/i; 7270 7301 … … 7362 7393 } 7363 7394 } 7395 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + 7396 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 7397 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { 7398 7399 // Handle event binding 7400 jQuery.fn[ name ] = function( data, fn ) { 7401 return arguments.length > 0 ? 7402 this.on( name, null, data, fn ) : 7403 this.trigger( name ); 7404 }; 7405 }); 7406 7407 jQuery.fn.hover = function( fnOver, fnOut ) { 7408 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 7409 }; 7364 7410 var 7365 7411 // Document location 7366 7412 ajaxLocParts, 7367 7413 ajaxLocation, 7368 7369 7414 ajax_nonce = jQuery.now(), 7370 7415 … … 7479 7524 // Fixes #9887 7480 7525 function ajaxExtend( target, src ) { 7481 var key, deep,7526 var deep, key, 7482 7527 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 7483 7528 … … 7499 7544 } 7500 7545 7501 var selector, type, response,7546 var selector, response, type, 7502 7547 self = this, 7503 7548 off = url.indexOf(" "); … … 7680 7725 options = options || {}; 7681 7726 7682 var transport, 7727 var // Cross-domain detection vars 7728 parts, 7729 // Loop variable 7730 i, 7683 7731 // URL without anti-cache param 7684 7732 cacheURL, 7685 // Response headers 7733 // Response headers as string 7686 7734 responseHeadersString, 7687 responseHeaders,7688 7735 // timeout handle 7689 7736 timeoutTimer, 7690 // Cross-domain detection vars 7691 parts, 7737 7692 7738 // To know if global events are to be dispatched 7693 7739 fireGlobals, 7694 // Loop variable 7695 i, 7740 7741 transport, 7742 // Response headers 7743 responseHeaders, 7696 7744 // Create the final options object 7697 7745 s = jQuery.ajaxSetup( {}, options ), … … 7988 8036 } 7989 8037 7990 // If not modified 7991 if ( status === 304 ) { 8038 // if no content 8039 if ( status === 204 ) { 8040 isSuccess = true; 8041 statusText = "nocontent"; 8042 8043 // if not modified 8044 } else if ( status === 304 ) { 7992 8045 isSuccess = true; 7993 8046 statusText = "notmodified"; 7994 8047 7995 // If we have data 8048 // If we have data, let's convert it 7996 8049 } else { 7997 8050 isSuccess = ajaxConvert( s, response ); … … 8063 8116 */ 8064 8117 function ajaxHandleResponses( s, jqXHR, responses ) { 8065 8066 var ct, type, finalDataType, firstDataType, 8118 var firstDataType, ct, finalDataType, type, 8067 8119 contents = s.contents, 8068 8120 dataTypes = s.dataTypes, … … 8125 8177 // Chain conversions given the request and the original response 8126 8178 function ajaxConvert( s, response ) { 8127 8128 var conv, conv2, current, tmp, 8179 var conv2, current, conv, tmp, 8129 8180 converters = {}, 8130 8181 i = 0, … … 8477 8528 // Listener 8478 8529 callback = function( _, isAbort ) { 8479 8480 var status, 8481 statusText, 8482 responseHeaders, 8483 responses, 8484 xml; 8530 var status, responseHeaders, statusText, responses; 8485 8531 8486 8532 // Firefox throws exceptions when accessing properties … … 8512 8558 responses = {}; 8513 8559 status = xhr.status; 8514 xml = xhr.responseXML;8515 8560 responseHeaders = xhr.getAllResponseHeaders(); 8516 8517 // Construct response list8518 if ( xml && xml.documentElement /* #4958 */ ) {8519 responses.xml = xml;8520 }8521 8561 8522 8562 // When requesting binary data, IE6-9 will throw an exception … … 8769 8809 8770 8810 function propFilter( props, specialEasing ) { 8771 var index, name, easing, value, hooks;8811 var value, name, index, easing, hooks; 8772 8812 8773 8813 // camelCase, specialEasing and expand cssHook pass … … 8837 8877 function defaultPrefilter( elem, props, opts ) { 8838 8878 /*jshint validthis:true */ 8839 var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire, 8879 var prop, index, length, 8880 value, dataShow, toggle, 8881 tween, hooks, oldfire, 8840 8882 anim = this, 8841 8883 style = elem.style, … … 8897 8939 style.overflow = "hidden"; 8898 8940 if ( !jQuery.support.shrinkWrapBlocks ) { 8899 anim. done(function() {8941 anim.always(function() { 8900 8942 style.overflow = opts.overflow[ 0 ]; 8901 8943 style.overflowX = opts.overflow[ 1 ]; … … 9021 9063 } 9022 9064 9023 // passing a non empty string as a 3rd parameter to .css will automatically9065 // passing an empty string as a 3rd parameter to .css will automatically 9024 9066 // attempt a parseFloat and fallback to a string if the parse fails 9025 9067 // so, simple values such as "10px" are parsed to Float. 9026 9068 // complex values such as "rotate(1rad)" are returned as is. 9027 result = jQuery.css( tween.elem, tween.prop, " auto" );9069 result = jQuery.css( tween.elem, tween.prop, "" ); 9028 9070 // Empty strings, null, undefined and "auto" are converted to 0. 9029 9071 return !result || result === "auto" ? 0 : result; … … 9347 9389 // If we don't have gBCR, just use 0,0 rather than error 9348 9390 // BlackBerry 5, iOS 3 (original iPhone) 9349 if ( typeof elem.getBoundingClientRect !== "undefined") {9391 if ( typeof elem.getBoundingClientRect !== core_strundefined ) { 9350 9392 box = elem.getBoundingClientRect(); 9351 9393 } -
trunk/wp-includes/script-loader.php
r23417 r23421 132 132 // jQuery 133 133 $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ) ); 134 $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.9. 0' );135 $scripts->add( 'jquery-migrate', '/wp-includes/js/jquery/jquery-migrate.js', array(), '1. 0.0' );134 $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.9.1' ); 135 $scripts->add( 'jquery-migrate', '/wp-includes/js/jquery/jquery-migrate.js', array(), '1.1.0' ); 136 136 137 137 // full jQuery UI
Note: See TracChangeset
for help on using the changeset viewer.