Make WordPress Core

Changeset 23421


Ignore:
Timestamp:
02/15/2013 04:09:04 PM (13 years ago)
Author:
nacin
Message:

jQuery 1.9.1 and jQuery Migrate 1.1.0.

Remains uncompressed for now, until we work out all 1.9.x issues.
Fixes custom fields.

props ocean90, wonderboymusic. see #22975.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/jquery/jquery-migrate.js

    r23301 r23421  
    11/*!
    2  * jQuery Migrate - v1.0.0 - 2013-01-14
     2 * jQuery Migrate - v1.1.0 - 2013-01-31
    33 * https://github.com/jquery/jquery-migrate
    44 * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
     
    1515// Set to true to prevent console output; migrateWarnings still maintained
    1616// jQuery.migrateMute = false;
     17
     18// Show a message on the console so devs know we're active
     19if ( !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
     24if ( jQuery.migrateTrace === undefined ) {
     25        jQuery.migrateTrace = true;
     26}
    1727
    1828// Forget any warnings we've already given; public
     
    2838                if ( window.console && console.warn && !jQuery.migrateMute ) {
    2939                        console.warn( "JQMIGRATE: " + msg );
     40                        if ( jQuery.migrateTrace && console.trace ) {
     41                                console.trace();
     42                        }
    3043                }
    3144        }
     
    6780
    6881var attrFn = {},
    69         attr = jQuery.attr,
     82        oldAttr = jQuery.attr,
    7083        valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
    7184                function() { return null; },
     
    8497                nType = elem && elem.nodeType;
    8598
    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 ) {
    87102                migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
    88103                if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
     
    91106        }
    92107
    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 ) {
    95111                migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
    96112        }
     
    132148                // Warn only for attributes that can remain distinct from their properties post-1.9
    133149                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 );
    139155};
    140156
     
    147163                }
    148164                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");
    150166                }
    151167                return name in elem ?
     
    159175                }
    160176                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");
    162178                }
    163179                // Does not return so that setAttribute is also used
     
    169185var matched, browser,
    170186        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\-]*))$/;
    173190
    174191// $(html) "looks like html" rule change
     
    195212};
    196213jQuery.fn.init.prototype = jQuery.fn;
     214
     215// Let $.parseJSON(falsy_value) return null
     216jQuery.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};
    197223
    198224jQuery.uaMatch = function( ua ) {
     
    275301
    276302var 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;
    279304
    280305jQuery.fn.andSelf = function() {
     
    332357        };
    333358}
    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;
    362 };
    363359
    364360var eventAdd = jQuery.event.add,
     
    387383
    388384// 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" );
     385if ( jQuery.event.dispatch ) {
     386        migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
     387}
    390388
    391389// Support for 'hover' pseudo-event and ajax event warnings
  • trunk/wp-includes/js/jquery/jquery.js

    r23301 r23421  
    11/*!
    2  * jQuery JavaScript Library v1.9.0
     2 * jQuery JavaScript Library v1.9.1
    33 * http://jquery.com/
    44 *
     
    1010 * http://jquery.org/license
    1111 *
    12  * Date: 2013-1-14
     12 * Date: 2013-2-4
    1313 */
    1414(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";
    1621var
     22        // The deferred used on DOM ready
     23        readyList,
     24
    1725        // A central reference to the root jQuery(document)
    1826        rootjQuery,
    1927
    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,
    2231
    2332        // Use the correct document accordingly with window argument (sandbox)
     
    3746        core_deletedIds = [],
    3847
    39         core_version = "1.9.0",
     48        core_version = "1.9.1",
    4049
    4150        // Save a reference to some core methods
     
    8695        },
    8796
    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() {
    90108                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 );
    98115                }
    99116        };
     
    300317
    301318jQuery.extend = jQuery.fn.extend = function() {
    302         var options, name, src, copy, copyIsArray, clone,
     319        var src, copyIsArray, copy, name, options, clone,
    303320                target = arguments[0] || {},
    304321                i = 1,
     
    782799        // arguments.
    783800        proxy: function( fn, context ) {
    784                 var tmp, args, proxy;
     801                var args, proxy, tmp;
    785802
    786803                if ( typeof context === "string" ) {
     
    881898                } else if ( document.addEventListener ) {
    882899                        // Use the handy event callback
    883                         document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
     900                        document.addEventListener( "DOMContentLoaded", completed, false );
    884901
    885902                        // A fallback to window.onload, that will always work
    886                         window.addEventListener( "load", jQuery.ready, false );
     903                        window.addEventListener( "load", completed, false );
    887904
    888905                // If IE event model is used
    889906                } else {
    890907                        // Ensure firing before onload, maybe late but safe also for iframes
    891                         document.attachEvent( "onreadystatechange", DOMContentLoaded );
     908                        document.attachEvent( "onreadystatechange", completed );
    892909
    893910                        // A fallback to window.onload, that will always work
    894                         window.attachEvent( "onload", jQuery.ready );
     911                        window.attachEvent( "onload", completed );
    895912
    896913                        // If IE and not a frame
     
    913930                                                        return setTimeout( doScrollCheck, 50 );
    914931                                                }
     932
     933                                                // detach all dom ready events
     934                                                detach();
    915935
    916936                                                // and execute any waiting functions
     
    9901010                jQuery.extend( {}, options );
    9911011
    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)
    9931015                memory,
    9941016                // Flag to know if list was already fired
    9951017                fired,
    996                 // Flag to know if list is currently firing
    997                 firing,
    998                 // First callback to fire (used internally by add and fireWith)
    999                 firingStart,
    10001018                // End of the loop when firing
    10011019                firingLength,
    10021020                // Index of currently firing callback (modified by remove if needed)
    10031021                firingIndex,
     1022                // First callback to fire (used internally by add and fireWith)
     1023                firingStart,
    10041024                // Actual callback list
    10051025                list = [],
     
    10871107                                return this;
    10881108                        },
    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.
    10901111                        has: function( fn ) {
    1091                                 return jQuery.inArray( fn, list ) > -1;
     1112                                return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
    10921113                        },
    10931114                        // Remove all callbacks from the list
     
    12861307jQuery.support = (function() {
    12871308
    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,
    12891312                div = document.createElement("div");
    12901313
     
    14871510                }
    14881511
    1489                 if ( typeof div.style.zoom !== "undefined" ) {
     1512                if ( typeof div.style.zoom !== core_strundefined ) {
    14901513                        // Support: IE<8
    14911514                        // Check if natively block-level elements act like inline-block
     
    15031526                        support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
    15041527
    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                        }
    15081534                }
    15091535
     
    15221548var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
    15231549        rmultiDash = /([A-Z])/g;
    1524        
     1550
    15251551function internalData( elem, name, data, pvt /* Internal Use Only */ ){
    15261552        if ( !jQuery.acceptData( elem ) ) {
     
    16171643}
    16181644
    1619 function internalRemoveData( elem, name, pvt /* For internal use only */ ){
     1645function internalRemoveData( elem, name, pvt ) {
    16201646        if ( !jQuery.acceptData( elem ) ) {
    16211647                return;
    16221648        }
    16231649
    1624         var thisCache, i, l,
    1625 
     1650        var i, l, thisCache,
    16261651                isNode = elem.nodeType,
    16271652
     
    17271752
    17281753        data: function( elem, name, data ) {
    1729                 return internalData( elem, name, data, false );
     1754                return internalData( elem, name, data );
    17301755        },
    17311756
    17321757        removeData: function( elem, name ) {
    1733                 return internalRemoveData( elem, name, false );
     1758                return internalRemoveData( elem, name );
    17341759        },
    17351760
     
    17381763                return internalData( elem, name, data, true );
    17391764        },
    1740        
     1765
    17411766        _removeData: function( elem, name ) {
    17421767                return internalRemoveData( elem, name, true );
     
    17451770        // A method for determining if a DOM node can handle the data expando
    17461771        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
    17471777                var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
    17481778
     
    17701800
    17711801                                                if ( !name.indexOf( "data-" ) ) {
    1772                                                         name = jQuery.camelCase( name.substring(5) );
     1802                                                        name = jQuery.camelCase( name.slice(5) );
    17731803
    17741804                                                        dataAttr( elem, name, data[ name ] );
     
    18211851                        try {
    18221852                                data = data === "true" ? true :
    1823                                 data === "false" ? false :
    1824                                 data === "null" ? null :
    1825                                 // Only convert to a number if it doesn't change the string
    1826                                 +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;
    18291859                        } catch( e ) {}
    18301860
     
    21422172
    21432173                        // Toggle whole class name
    2144                         } else if ( type === "undefined" || type === "boolean" ) {
     2174                        } else if ( type === core_strundefined || type === "boolean" ) {
    21452175                                if ( this.className ) {
    21462176                                        // store className if set
     
    21712201
    21722202        val: function( value ) {
    2173                 var hooks, ret, isFunction,
     2203                var ret, hooks, isFunction,
    21742204                        elem = this[0];
    21752205
     
    22952325
    22962326        attr: function( elem, name, value ) {
    2297                 var ret, hooks, notxml,
     2327                var hooks, notxml, ret,
    22982328                        nType = elem.nodeType;
    22992329
     
    23042334
    23052335                // Fallback to prop when attributes are not supported
    2306                 if ( typeof elem.getAttribute === "undefined" ) {
     2336                if ( typeof elem.getAttribute === core_strundefined ) {
    23072337                        return jQuery.prop( elem, name, value );
    23082338                }
     
    23372367                        // In IE9+, Flash objects don't have .getAttribute (#12945)
    23382368                        // Support: IE9+
    2339                         if ( typeof elem.getAttribute !== "undefined" ) {
     2369                        if ( typeof elem.getAttribute !== core_strundefined ) {
    23402370                                ret =  elem.getAttribute( name );
    23412371                        }
     
    26872717
    26882718        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)
    26962725                if ( !elemData ) {
    26972726                        return;
     
    27182747                                // Discard the second event of a jQuery.event.trigger() and
    27192748                                // 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) ?
    27212750                                        jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
    27222751                                        undefined;
     
    27982827        // Detach an event or set of events from an element
    27992828        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,
    28042833                        elemData = jQuery.hasData( elem ) && jQuery._data( elem );
    28052834
     
    28712900
    28722901        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,
    28752904                        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(".") : [];
    28782907
    28792908                cur = tmp = elem = elem || document;
     
    30093038                event = jQuery.event.fix( event );
    30103039
    3011                 var i, j, ret, matched, handleObj,
     3040                var i, ret, handleObj, matched, j,
    30123041                        handlerQueue = [],
    30133042                        args = core_slice.call( arguments ),
     
    30643093
    30653094        handlers: function( event, handlers ) {
    3066                 var i, matches, sel, handleObj,
     3095                var sel, handleObj, matches, i,
    30673096                        handlerQueue = [],
    30683097                        delegateCount = handlers.delegateCount,
     
    30763105                        for ( ; cur != this; cur = cur.parentNode || this ) {
    30773106
     3107                                // Don't check non-elements (#13208)
    30783108                                // 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") ) {
    30803110                                        matches = [];
    30813111                                        for ( i = 0; i < delegateCount; i++ ) {
     
    31153145
    31163146                // 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,
    31183149                        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;
    31213159
    31223160                event = new jQuery.Event( originalEvent );
     
    31683206                props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
    31693207                filter: function( event, original ) {
    3170                         var eventDoc, doc, body,
     3208                        var body, eventDoc, doc,
    31713209                                button = original.button,
    31723210                                fromElement = original.fromElement;
     
    32843322                        // #8545, #7054, preventing memory leaks for custom events in IE6-8
    32853323                        // 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 ) {
    32873325                                elem[ name ] = null;
    32883326                        }
     
    35333571
    35343572        on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
    3535                 var origFn, type;
     3573                var type, origFn;
    35363574
    35373575                // Types can be a map of types/handlers
     
    36453683                        return jQuery.event.trigger( type, data, elem, true );
    36463684                }
    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 binding
    3659         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;
    36713685        }
    36723686});
     
    37823796        rsibling = /[\x20\t\r\n\f]*[+~]/,
    37833797
    3784         rnative = /\{\s*\[native code\]\s*\}/,
     3798        rnative = /^[^{]+\{\s*\[native code/,
    37853799
    37863800        // Easily-parseable/retrievable ID or TAG or CLASS selectors
     
    38093823// Use a stripped-down slice if we can't use a native one
    38103824try {
    3811         slice.call( docElem.childNodes, 0 )[0].nodeType;
     3825        slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
    38123826} catch ( e ) {
    38133827        slice = function( i ) {
    38143828                var elem,
    38153829                        results = [];
    3816                 for ( ; (elem = this[i]); i++ ) {
     3830                while ( (elem = this[i++]) ) {
    38173831                        results.push( elem );
    38183832                }
     
    41334147                        // Filter out possible comments
    41344148                        if ( tag === "*" ) {
    4135                                 for ( ; (elem = results[i]); i++ ) {
     4149                                while ( (elem = results[i++]) ) {
    41364150                                        if ( elem.nodeType === 1 ) {
    41374151                                                tmp.push( elem );
     
    42914305                        bp = [ b ];
    42924306
    4293                 // The nodes are identical, we can exit early
     4307                // Exit early if the nodes are identical
    42944308                if ( a === b ) {
    42954309                        hasDuplicate = true;
    42964310                        return 0;
    4297 
    4298                 // Fallback to using sourceIndex (in IE) if it's available on both nodes
    4299                 } else if ( a.sourceIndex && b.sourceIndex ) {
    4300                         return ( ~b.sourceIndex || MAX_NEGATIVE ) - ( contains( preferredDoc, a ) && ~a.sourceIndex || MAX_NEGATIVE );
    43014311
    43024312                // Parentless nodes are either documents or disconnected
     
    44384448
    44394449function 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                        }
    44454464                }
    44464465        }
     
    46524671                                        operator === "^=" ? check && result.indexOf( check ) === 0 :
    46534672                                        operator === "*=" ? check && result.indexOf( check ) > -1 :
    4654                                         operator === "$=" ? check && result.substr( result.length - check.length ) === check :
     4673                                        operator === "$=" ? check && result.slice( -check.length ) === check :
    46554674                                        operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
    4656                                         operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
     4675                                        operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
    46574676                                        false;
    46584677                        };
     
    50725091function addCombinator( matcher, combinator, base ) {
    50735092        var dir = combinator.dir,
    5074                 checkNonElements = base && combinator.dir === "parentNode",
     5093                checkNonElements = base && dir === "parentNode",
    50755094                doneName = done++;
    50765095
     
    53155334                                // We must always have either seed elements or context
    53165335                                elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
    5317                                 // Nested matchers should use non-integer dirruns
    5318                                 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);
    53195338
    53205339                        if ( outermost ) {
     
    53245343
    53255344                        // Add elements passing elementMatchers directly to results
     5345                        // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
    53265346                        for ( ; (elem = elems[i]) != null; i++ ) {
    53275347                                if ( byElement && elem ) {
    5328                                         for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
     5348                                        j = 0;
     5349                                        while ( (matcher = elementMatchers[j++]) ) {
    53295350                                                if ( matcher( elem, context, xml ) ) {
    53305351                                                        results.push( elem );
     
    53535374
    53545375                        // Apply set filters to unmatched elements
    5355                         // `i` starts as a string, so matchedCount would equal "00" if there are no elements
    53565376                        matchedCount += i;
    53575377                        if ( bySet && i !== matchedCount ) {
    5358                                 for ( j = 0; (matcher = setMatchers[j]); j++ ) {
     5378                                j = 0;
     5379                                while ( (matcher = setMatchers[j++]) ) {
    53595380                                        matcher( unmatched, setMatched, context, xml );
    53605381                                }
     
    54585479
    54595480                        // 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-- ) {
    54615483                                token = tokens[i];
    54625484
     
    55365558jQuery.fn.extend({
    55375559        find: function( selector ) {
    5538                 var i, ret, self;
     5560                var i, ret, self,
     5561                        len = this.length;
    55395562
    55405563                if ( typeof selector !== "string" ) {
    55415564                        self = this;
    55425565                        return this.pushStack( jQuery( selector ).filter(function() {
    5543                                 for ( i = 0; i < self.length; i++ ) {
     5566                                for ( i = 0; i < len; i++ ) {
    55445567                                        if ( jQuery.contains( self[ i ], this ) ) {
    55455568                                                return true;
     
    55505573
    55515574                ret = [];
    5552                 for ( i = 0; i < this.length; i++ ) {
     5575                for ( i = 0; i < len; i++ ) {
    55535576                        jQuery.find( selector, this[ i ], ret );
    55545577                }
    55555578
    55565579                // 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 );
    55585581                ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
    55595582                return ret;
     
    60676090                                parent = this.parentNode;
    60686091
    6069                         if ( parent && this.nodeType === 1 || this.nodeType === 11 ) {
    6070 
     6092                        if ( parent ) {
    60716093                                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 );
    60786095                        }
    60796096                });
     
    60896106                args = core_concat.apply( [], args );
    60906107
    6091                 var fragment, first, scripts, hasScripts, node, doc,
     6108                var first, node, hasScripts,
     6109                        scripts, doc, fragment,
    60926110                        i = 0,
    60936111                        l = this.length,
     
    62406258
    62416259function fixCloneNodeIssues( src, dest ) {
    6242         var nodeName, data, e;
     6260        var nodeName, e, data;
    62436261
    62446262        // We do not need to do anything for non-Elements
     
    63356353        var elems, elem,
    63366354                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 || "*" ) :
    63396357                        undefined;
    63406358
     
    63636381jQuery.extend({
    63646382        clone: function( elem, dataAndEvents, deepDataAndEvents ) {
    6365                 var destElements, srcElements, node, i, clone,
     6383                var destElements, node, clone, i, srcElements,
    63666384                        inPage = jQuery.contains( elem.ownerDocument, elem );
    63676385
     
    64186436
    64196437        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,
    64216440                        l = elems.length,
    64226441
     
    65446563
    65456564        cleanData: function( elems, /* internal */ acceptData ) {
    6546                 var data, id, elem, type,
     6565                var elem, type, id, data,
    65476566                        i = 0,
    65486567                        internalKey = jQuery.expando,
     
    65826601                                                        delete elem[ internalKey ];
    65836602
    6584                                                 } else if ( typeof elem.removeAttribute !== "undefined" ) {
     6603                                                } else if ( typeof elem.removeAttribute !== core_strundefined ) {
    65856604                                                        elem.removeAttribute( internalKey );
    65866605
     
    65966615        }
    65976616});
    6598 var curCSS, getStyles, iframe,
     6617var iframe, getStyles, curCSS,
    65996618        ralpha = /alpha\([^)]*\)/i,
    66006619        ropacity = /opacity\s*=\s*([^)]*)/,
     
    66496668
    66506669function showHide( elements, show ) {
    6651         var elem,
     6670        var display, elem, hidden,
    66526671                values = [],
    66536672                index = 0,
     
    66596678                        continue;
    66606679                }
     6680
    66616681                values[ index ] = jQuery._data( elem, "olddisplay" );
     6682                display = elem.style.display;
    66626683                if ( show ) {
    66636684                        // Reset the inline display of this element to learn if it is
    66646685                        // being hidden by cascaded rules or not
    6665                         if ( !values[ index ] && elem.style.display === "none" ) {
     6686                        if ( !values[ index ] && display === "none" ) {
    66666687                                elem.style.display = "";
    66676688                        }
     
    66736694                                values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
    66746695                        }
    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                        }
    66776705                }
    66786706        }
     
    66966724        css: function( name, value ) {
    66976725                return jQuery.access( this, function( elem, name, value ) {
    6698                         var styles, len,
     6726                        var len, styles,
    66996727                                map = {},
    67006728                                i = 0;
     
    68376865
    68386866        css: function( elem, name, extra, styles ) {
    6839                 var val, num, hooks,
     6867                var num, val, hooks,
    68406868                        origName = jQuery.camelCase( name );
    68416869
     
    68636891
    68646892                // Return, converting to number if forced or a qualifier was provided and val looks numeric
    6865                 if ( extra ) {
     6893                if ( extra === "" || extra ) {
    68666894                        num = parseFloat( val );
    68676895                        return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
     
    72287256if ( jQuery.expr && jQuery.expr.filters ) {
    72297257        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");
    72317262        };
    72327263
     
    72667297        rbracket = /\[\]$/,
    72677298        rCRLF = /\r?\n/g,
    7268         rsubmitterTypes = /^(?:submit|button|image|reset)$/i,
     7299        rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
    72697300        rsubmittable = /^(?:input|select|textarea|keygen)/i;
    72707301
     
    73627393        }
    73637394}
     7395jQuery.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
     7407jQuery.fn.hover = function( fnOver, fnOut ) {
     7408        return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
     7409};
    73647410var
    73657411        // Document location
    73667412        ajaxLocParts,
    73677413        ajaxLocation,
    7368        
    73697414        ajax_nonce = jQuery.now(),
    73707415
     
    74797524// Fixes #9887
    74807525function ajaxExtend( target, src ) {
    7481         var key, deep,
     7526        var deep, key,
    74827527                flatOptions = jQuery.ajaxSettings.flatOptions || {};
    74837528
     
    74997544        }
    75007545
    7501         var selector, type, response,
     7546        var selector, response, type,
    75027547                self = this,
    75037548                off = url.indexOf(" ");
     
    76807725                options = options || {};
    76817726
    7682                 var transport,
     7727                var // Cross-domain detection vars
     7728                        parts,
     7729                        // Loop variable
     7730                        i,
    76837731                        // URL without anti-cache param
    76847732                        cacheURL,
    7685                         // Response headers
     7733                        // Response headers as string
    76867734                        responseHeadersString,
    7687                         responseHeaders,
    76887735                        // timeout handle
    76897736                        timeoutTimer,
    7690                         // Cross-domain detection vars
    7691                         parts,
     7737
    76927738                        // To know if global events are to be dispatched
    76937739                        fireGlobals,
    7694                         // Loop variable
    7695                         i,
     7740
     7741                        transport,
     7742                        // Response headers
     7743                        responseHeaders,
    76967744                        // Create the final options object
    76977745                        s = jQuery.ajaxSetup( {}, options ),
     
    79888036                                }
    79898037
    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 ) {
    79928045                                        isSuccess = true;
    79938046                                        statusText = "notmodified";
    79948047
    7995                                 // If we have data
     8048                                // If we have data, let's convert it
    79968049                                } else {
    79978050                                        isSuccess = ajaxConvert( s, response );
     
    80638116 */
    80648117function ajaxHandleResponses( s, jqXHR, responses ) {
    8065 
    8066         var ct, type, finalDataType, firstDataType,
     8118        var firstDataType, ct, finalDataType, type,
    80678119                contents = s.contents,
    80688120                dataTypes = s.dataTypes,
     
    81258177// Chain conversions given the request and the original response
    81268178function ajaxConvert( s, response ) {
    8127 
    8128         var conv, conv2, current, tmp,
     8179        var conv2, current, conv, tmp,
    81298180                converters = {},
    81308181                i = 0,
     
    84778528                                        // Listener
    84788529                                        callback = function( _, isAbort ) {
    8479 
    8480                                                 var status,
    8481                                                         statusText,
    8482                                                         responseHeaders,
    8483                                                         responses,
    8484                                                         xml;
     8530                                                var status, responseHeaders, statusText, responses;
    84858531
    84868532                                                // Firefox throws exceptions when accessing properties
     
    85128558                                                                        responses = {};
    85138559                                                                        status = xhr.status;
    8514                                                                         xml = xhr.responseXML;
    85158560                                                                        responseHeaders = xhr.getAllResponseHeaders();
    8516 
    8517                                                                         // Construct response list
    8518                                                                         if ( xml && xml.documentElement /* #4958 */ ) {
    8519                                                                                 responses.xml = xml;
    8520                                                                         }
    85218561
    85228562                                                                        // When requesting binary data, IE6-9 will throw an exception
     
    87698809
    87708810function propFilter( props, specialEasing ) {
    8771         var index, name, easing, value, hooks;
     8811        var value, name, index, easing, hooks;
    87728812
    87738813        // camelCase, specialEasing and expand cssHook pass
     
    88378877function defaultPrefilter( elem, props, opts ) {
    88388878        /*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,
    88408882                anim = this,
    88418883                style = elem.style,
     
    88978939                style.overflow = "hidden";
    88988940                if ( !jQuery.support.shrinkWrapBlocks ) {
    8899                         anim.done(function() {
     8941                        anim.always(function() {
    89008942                                style.overflow = opts.overflow[ 0 ];
    89018943                                style.overflowX = opts.overflow[ 1 ];
     
    90219063                        }
    90229064
    9023                         // passing a non empty string as a 3rd parameter to .css will automatically
     9065                        // passing an empty string as a 3rd parameter to .css will automatically
    90249066                        // attempt a parseFloat and fallback to a string if the parse fails
    90259067                        // so, simple values such as "10px" are parsed to Float.
    90269068                        // 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, "" );
    90289070                        // Empty strings, null, undefined and "auto" are converted to 0.
    90299071                        return !result || result === "auto" ? 0 : result;
     
    93479389        // If we don't have gBCR, just use 0,0 rather than error
    93489390        // BlackBerry 5, iOS 3 (original iPhone)
    9349         if ( typeof elem.getBoundingClientRect !== "undefined" ) {
     9391        if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
    93509392                box = elem.getBoundingClientRect();
    93519393        }
  • trunk/wp-includes/script-loader.php

    r23417 r23421  
    132132        // jQuery
    133133        $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' );
    136136
    137137        // full jQuery UI
Note: See TracChangeset for help on using the changeset viewer.