Make WordPress Core

Changeset 55237


Ignore:
Timestamp:
02/06/2023 08:57:05 PM (15 months ago)
Author:
audrasjb
Message:

External Libraries: Update jQuery Migrate to version 3.4.0.

A full list of changes in this release can be found upstream on the jQuery Migrate GitHub repository:
https://github.com/jquery/jquery-migrate/compare/3.3.2...3.4.0.

Props desrosj, audrasjb, a4jpcom, stalukder03, mukesh27, adeltahri, robinwpdeveloper, mahbubshovan.
Fixes #56743.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/vendor/jquery/jquery-migrate.js

    r49649 r55237  
    11/*!
    2  * jQuery Migrate - v3.3.2 - 2020-11-18T08:29Z
     2 * jQuery Migrate - v3.4.0 - 2022-03-24T16:30Z
    33 * Copyright OpenJS Foundation and other contributors
    44 */
     
    2525"use strict";
    2626
    27 jQuery.migrateVersion = "3.3.2";
     27jQuery.migrateVersion = "3.4.0";
    2828
    2929// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
     
    4949}
    5050
     51// A map from disabled patch codes to `true`. This should really
     52// be a `Set` but those are unsupported in IE.
     53var disabledPatches = Object.create( null );
     54
     55// Don't apply patches for specified codes. Helpful for code bases
     56// where some Migrate warnings have been addressed and it's desirable
     57// to avoid needless patches or false positives.
     58jQuery.migrateDisablePatches = function() {
     59    var i;
     60    for ( i = 0; i < arguments.length; i++ ) {
     61        disabledPatches[ arguments[ i ] ] = true;
     62    }
     63};
     64
     65// Allow enabling patches disabled via `jQuery.migrateDisablePatches`.
     66// Helpful if you want to disable a patch only for some code that won't
     67// be updated soon to be able to focus on other warnings - and enable it
     68// immediately after such a call:
     69// ```js
     70// jQuery.migrateDisablePatches( "workaroundA" );
     71// elem.pluginViolatingWarningA( "pluginMethod" );
     72// jQuery.migrateEnablePatches( "workaroundA" );
     73// ```
     74jQuery.migrateEnablePatches = function() {
     75    var i;
     76    for ( i = 0; i < arguments.length; i++ ) {
     77        delete disabledPatches[ arguments[ i ] ];
     78    }
     79};
     80
     81jQuery.migrateIsPatchEnabled = function( patchCode ) {
     82    return !disabledPatches[ patchCode ];
     83};
     84
    5185( function() {
    5286
     
    92126};
    93127
    94 function migrateWarn( msg ) {
     128function migrateWarn( code, msg ) {
    95129    var console = window.console;
    96     if ( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) {
     130    if ( jQuery.migrateIsPatchEnabled( code ) &&
     131        ( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) ) {
    97132        warnedAbout[ msg ] = true;
    98         jQuery.migrateWarnings.push( msg );
     133        jQuery.migrateWarnings.push( msg + " [" + code + "]" );
    99134        if ( console && console.warn && !jQuery.migrateMute ) {
    100135            console.warn( "JQMIGRATE: " + msg );
     
    106141}
    107142
    108 function migrateWarnProp( obj, prop, value, msg ) {
     143function migrateWarnProp( obj, prop, value, code, msg ) {
    109144    Object.defineProperty( obj, prop, {
    110145        configurable: true,
    111146        enumerable: true,
    112147        get: function() {
    113             migrateWarn( msg );
     148            migrateWarn( code, msg );
    114149            return value;
    115150        },
    116151        set: function( newValue ) {
    117             migrateWarn( msg );
     152            migrateWarn( code, msg );
    118153            value = newValue;
    119154        }
     
    121156}
    122157
    123 function migrateWarnFunc( obj, prop, newFunc, msg ) {
     158function migrateWarnFuncInternal( obj, prop, newFunc, code, msg ) {
     159    var finalFunc,
     160        origFunc = obj[ prop ];
     161
    124162    obj[ prop ] = function() {
    125         migrateWarn( msg );
    126         return newFunc.apply( this, arguments );
     163
     164        // If `msg` not provided, do not warn; more sophisticated warnings
     165        // logic is most likely embedded in `newFunc`, in that case here
     166        // we just care about the logic choosing the proper implementation
     167        // based on whether the patch is disabled or not.
     168        if ( msg ) {
     169            migrateWarn( code, msg );
     170        }
     171
     172        // Since patches can be disabled & enabled dynamically, we
     173        // need to decide which implementation to run on each invocation.
     174        finalFunc = jQuery.migrateIsPatchEnabled( code ) ?
     175            newFunc :
     176
     177            // The function may not have existed originally so we need a fallback.
     178            ( origFunc || jQuery.noop );
     179
     180        return finalFunc.apply( this, arguments );
    127181    };
    128182}
    129183
     184function migratePatchAndWarnFunc( obj, prop, newFunc, code, msg ) {
     185    if ( !msg ) {
     186        throw new Error( "No warning message provided" );
     187    }
     188    return migrateWarnFuncInternal( obj, prop, newFunc, code, msg );
     189}
     190
     191function migratePatchFunc( obj, prop, newFunc, code ) {
     192    return migrateWarnFuncInternal( obj, prop, newFunc, code );
     193}
     194
    130195if ( window.document.compatMode === "BackCompat" ) {
    131196
    132     // JQuery has never supported or tested Quirks Mode
    133     migrateWarn( "jQuery is not compatible with Quirks Mode" );
     197    // jQuery has never supported or tested Quirks Mode
     198    migrateWarn( "quirks", "jQuery is not compatible with Quirks Mode" );
    134199}
    135200
     
    146211    rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
    147212
    148 jQuery.fn.init = function( arg1 ) {
     213migratePatchFunc( jQuery.fn, "init", function( arg1 ) {
    149214    var args = Array.prototype.slice.call( arguments );
    150215
    151     if ( typeof arg1 === "string" && arg1 === "#" ) {
    152 
    153         // JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
    154         migrateWarn( "jQuery( '#' ) is not a valid selector" );
     216    if ( jQuery.migrateIsPatchEnabled( "selector-empty-id" ) &&
     217        typeof arg1 === "string" && arg1 === "#" ) {
     218
     219        // JQuery( "#" ) is a bogus ID selector, but it returned an empty set
     220        // before jQuery 3.0
     221        migrateWarn( "selector-empty-id", "jQuery( '#' ) is not a valid selector" );
    155222        args[ 0 ] = [];
    156223    }
    157224
    158225    return oldInit.apply( this, args );
    159 };
     226}, "selector-empty-id" );
     227
     228// This is already done in Core but the above patch will lose this assignment
     229// so we need to redo it. It doesn't matter whether the patch is enabled or not
     230// as the method is always going to be a Migrate-created wrapper.
    160231jQuery.fn.init.prototype = jQuery.fn;
    161232
    162 jQuery.find = function( selector ) {
     233migratePatchFunc( jQuery, "find", function( selector ) {
    163234    var args = Array.prototype.slice.call( arguments );
    164235
     
    182253            try {
    183254                window.document.querySelector( selector );
    184                 migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] );
     255                migrateWarn( "selector-hash",
     256                    "Attribute selector with '#' must be quoted: " + args[ 0 ] );
    185257                args[ 0 ] = selector;
    186258            } catch ( err2 ) {
    187                 migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] );
     259                migrateWarn( "selector-hash",
     260                    "Attribute selector with '#' was not fixed: " + args[ 0 ] );
    188261            }
    189262        }
     
    191264
    192265    return oldFind.apply( this, args );
    193 };
     266}, "selector-hash" );
    194267
    195268// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
     
    201274
    202275// The number of elements contained in the matched element set
    203 migrateWarnFunc( jQuery.fn, "size", function() {
     276migratePatchAndWarnFunc( jQuery.fn, "size", function() {
    204277    return this.length;
    205 },
     278}, "size",
    206279"jQuery.fn.size() is deprecated and removed; use the .length property" );
    207280
    208 migrateWarnFunc( jQuery, "parseJSON", function() {
     281migratePatchAndWarnFunc( jQuery, "parseJSON", function() {
    209282    return JSON.parse.apply( null, arguments );
    210 },
     283}, "parseJSON",
    211284"jQuery.parseJSON is deprecated; use JSON.parse" );
    212285
    213 migrateWarnFunc( jQuery, "holdReady", jQuery.holdReady,
    214     "jQuery.holdReady is deprecated" );
    215 
    216 migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort,
    217     "jQuery.unique is deprecated; use jQuery.uniqueSort" );
     286migratePatchAndWarnFunc( jQuery, "holdReady", jQuery.holdReady,
     287    "holdReady", "jQuery.holdReady is deprecated" );
     288
     289migratePatchAndWarnFunc( jQuery, "unique", jQuery.uniqueSort,
     290    "unique", "jQuery.unique is deprecated; use jQuery.uniqueSort" );
    218291
    219292// Now jQuery.expr.pseudos is the standard incantation
    220 migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos,
     293migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, "expr-pre-pseudos",
    221294    "jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" );
    222 migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos,
     295migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, "expr-pre-pseudos",
    223296    "jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" );
    224297
    225298// Prior to jQuery 3.1.1 there were internal refs so we don't warn there
    226299if ( jQueryVersionSince( "3.1.1" ) ) {
    227     migrateWarnFunc( jQuery, "trim", function( text ) {
     300    migratePatchAndWarnFunc( jQuery, "trim", function( text ) {
    228301        return text == null ?
    229302            "" :
    230303            ( text + "" ).replace( rtrim, "" );
    231     },
     304    }, "trim",
    232305    "jQuery.trim is deprecated; use String.prototype.trim" );
    233306}
     
    235308// Prior to jQuery 3.2 there were internal refs so we don't warn there
    236309if ( jQueryVersionSince( "3.2.0" ) ) {
    237     migrateWarnFunc( jQuery, "nodeName", function( elem, name ) {
     310    migratePatchAndWarnFunc( jQuery, "nodeName", function( elem, name ) {
    238311        return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
    239     },
     312    }, "nodeName",
    240313    "jQuery.nodeName is deprecated" );
    241314
    242     migrateWarnFunc( jQuery, "isArray", Array.isArray,
     315    migratePatchAndWarnFunc( jQuery, "isArray", Array.isArray, "isArray",
    243316        "jQuery.isArray is deprecated; use Array.isArray"
    244317    );
     
    247320if ( jQueryVersionSince( "3.3.0" ) ) {
    248321
    249     migrateWarnFunc( jQuery, "isNumeric", function( obj ) {
     322    migratePatchAndWarnFunc( jQuery, "isNumeric", function( obj ) {
    250323
    251324            // As of jQuery 3.0, isNumeric is limited to
     
    259332                // subtraction forces infinities to NaN
    260333                !isNaN( obj - parseFloat( obj ) );
    261         },
     334        }, "isNumeric",
    262335        "jQuery.isNumeric() is deprecated"
    263336    );
     
    270343    } );
    271344
    272     migrateWarnFunc( jQuery, "type", function( obj ) {
     345    migratePatchAndWarnFunc( jQuery, "type", function( obj ) {
    273346        if ( obj == null ) {
    274347            return obj + "";
     
    279352            class2type[ Object.prototype.toString.call( obj ) ] || "object" :
    280353            typeof obj;
    281     },
     354    }, "type",
    282355    "jQuery.type is deprecated" );
    283356
    284     migrateWarnFunc( jQuery, "isFunction",
     357    migratePatchAndWarnFunc( jQuery, "isFunction",
    285358        function( obj ) {
    286359            return typeof obj === "function";
    287         },
     360        }, "isFunction",
    288361        "jQuery.isFunction() is deprecated" );
    289362
    290     migrateWarnFunc( jQuery, "isWindow",
     363    migratePatchAndWarnFunc( jQuery, "isWindow",
    291364        function( obj ) {
    292365            return obj != null && obj === obj.window;
    293         },
     366        }, "isWindow",
    294367        "jQuery.isWindow() is deprecated"
    295368    );
     
    302375    rjsonp = /(=)\?(?=&|$)|\?\?/;
    303376
    304 jQuery.ajax = function( ) {
     377migratePatchFunc( jQuery, "ajax", function() {
    305378    var jQXHR = oldAjax.apply( this, arguments );
    306379
    307380    // Be sure we got a jQXHR (e.g., not sync)
    308381    if ( jQXHR.promise ) {
    309         migrateWarnFunc( jQXHR, "success", jQXHR.done,
     382        migratePatchAndWarnFunc( jQXHR, "success", jQXHR.done, "jqXHR-methods",
    310383            "jQXHR.success is deprecated and removed" );
    311         migrateWarnFunc( jQXHR, "error", jQXHR.fail,
     384        migratePatchAndWarnFunc( jQXHR, "error", jQXHR.fail, "jqXHR-methods",
    312385            "jQXHR.error is deprecated and removed" );
    313         migrateWarnFunc( jQXHR, "complete", jQXHR.always,
     386        migratePatchAndWarnFunc( jQXHR, "complete", jQXHR.always, "jqXHR-methods",
    314387            "jQXHR.complete is deprecated and removed" );
    315388    }
    316389
    317390    return jQXHR;
    318 };
     391}, "jqXHR-methods" );
    319392
    320393// Only trigger the logic in jQuery <4 as the JSON-to-JSONP auto-promotion
     
    335408                rjsonp.test( s.data )
    336409        ) ) {
    337             migrateWarn( "JSON-to-JSONP auto-promotion is deprecated" );
     410            migrateWarn( "jsonp-promotion", "JSON-to-JSONP auto-promotion is deprecated" );
    338411        }
    339412    } );
     
    346419    rmatchNonSpace = /\S+/g;
    347420
    348 jQuery.fn.removeAttr = function( name ) {
     421migratePatchFunc( jQuery.fn, "removeAttr", function( name ) {
    349422    var self = this;
    350423
    351424    jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) {
    352425        if ( jQuery.expr.match.bool.test( attr ) ) {
    353             migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
     426            migrateWarn( "removeAttr-bool",
     427                "jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
    354428            self.prop( attr, false );
    355429        }
     
    357431
    358432    return oldRemoveAttr.apply( this, arguments );
    359 };
    360 
    361 jQuery.fn.toggleClass = function( state ) {
     433}, "removeAttr-bool" );
     434
     435migratePatchFunc( jQuery.fn, "toggleClass", function( state ) {
    362436
    363437    // Only deprecating no-args or single boolean arg
    364438    if ( state !== undefined && typeof state !== "boolean" ) {
     439
    365440        return oldToggleClass.apply( this, arguments );
    366441    }
    367442
    368     migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" );
     443    migrateWarn( "toggleClass-bool", "jQuery.fn.toggleClass( boolean ) is deprecated" );
    369444
    370445    // Toggle entire class name of each element
     
    388463        }
    389464    } );
    390 };
     465}, "toggleClass-bool" );
    391466
    392467function camelCase( string ) {
     
    396471}
    397472
    398 var oldFnCss,
     473var origFnCss,
    399474    internalSwapCall = false,
    400475    ralphaStart = /^[a-z]/,
     
    441516}
    442517
    443 jQuery.swap = function( elem, options, callback, args ) {
     518migratePatchFunc( jQuery, "swap", function( elem, options, callback, args ) {
    444519    var ret, name,
    445520        old = {};
    446521
    447522    if ( !internalSwapCall ) {
    448         migrateWarn( "jQuery.swap() is undocumented and deprecated" );
     523        migrateWarn( "swap", "jQuery.swap() is undocumented and deprecated" );
    449524    }
    450525
     
    463538
    464539    return ret;
    465 };
     540}, "swap" );
    466541
    467542if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) {
    468 
    469543    jQuery.cssProps = new Proxy( jQuery.cssProps || {}, {
    470544        set: function() {
    471             migrateWarn( "JQMIGRATE: jQuery.cssProps is deprecated" );
     545            migrateWarn( "cssProps", "jQuery.cssProps is deprecated" );
    472546            return Reflect.set.apply( this, arguments );
    473547        }
     
    475549}
    476550
    477 // Create a dummy jQuery.cssNumber if missing. It won't be used by jQuery but
    478 // it will prevent code adding new keys to it unconditionally from crashing.
    479 if ( !jQuery.cssNumber ) {
    480     jQuery.cssNumber = {};
     551// In jQuery >=4 where jQuery.cssNumber is missing fill it with the latest 3.x version:
     552// https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233
     553// This way, number values for the CSS properties below won't start triggering
     554// Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438).
     555if ( jQueryVersionSince( "4.0.0" ) && typeof Proxy !== "undefined" ) {
     556    jQuery.cssNumber = new Proxy( {
     557        animationIterationCount: true,
     558        columnCount: true,
     559        fillOpacity: true,
     560        flexGrow: true,
     561        flexShrink: true,
     562        fontWeight: true,
     563        gridArea: true,
     564        gridColumn: true,
     565        gridColumnEnd: true,
     566        gridColumnStart: true,
     567        gridRow: true,
     568        gridRowEnd: true,
     569        gridRowStart: true,
     570        lineHeight: true,
     571        opacity: true,
     572        order: true,
     573        orphans: true,
     574        widows: true,
     575        zIndex: true,
     576        zoom: true
     577    }, {
     578        get: function() {
     579            migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
     580            return Reflect.get.apply( this, arguments );
     581        },
     582        set: function() {
     583            migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
     584            return Reflect.set.apply( this, arguments );
     585        }
     586    } );
    481587}
    482588
     
    490596}
    491597
    492 oldFnCss = jQuery.fn.css;
    493 
    494 jQuery.fn.css = function( name, value ) {
     598origFnCss = jQuery.fn.css;
     599
     600migratePatchFunc( jQuery.fn, "css", function( name, value ) {
    495601    var camelName,
    496602        origThis = this;
     603
    497604    if ( name && typeof name === "object" && !Array.isArray( name ) ) {
    498605        jQuery.each( name, function( n, v ) {
     
    501608        return this;
    502609    }
     610
    503611    if ( typeof value === "number" ) {
    504612        camelName = camelCase( name );
    505613        if ( !isAutoPx( camelName ) && !jQuery.cssNumber[ camelName ] ) {
    506             migrateWarn( "Number-typed values are deprecated for jQuery.fn.css( \"" +
     614            migrateWarn( "css-number",
     615                "Number-typed values are deprecated for jQuery.fn.css( \"" +
    507616                name + "\", value )" );
    508617        }
    509618    }
    510619
    511     return oldFnCss.apply( this, arguments );
    512 };
    513 
    514 var oldData = jQuery.data;
    515 
    516 jQuery.data = function( elem, name, value ) {
     620    return origFnCss.apply( this, arguments );
     621}, "css-number" );
     622
     623var origData = jQuery.data;
     624
     625migratePatchFunc( jQuery, "data", function( elem, name, value ) {
    517626    var curData, sameKeys, key;
    518627
    519628    // Name can be an object, and each entry in the object is meant to be set as data
    520629    if ( name && typeof name === "object" && arguments.length === 2 ) {
    521         curData = jQuery.hasData( elem ) && oldData.call( this, elem );
     630
     631        curData = jQuery.hasData( elem ) && origData.call( this, elem );
    522632        sameKeys = {};
    523633        for ( key in name ) {
    524634            if ( key !== camelCase( key ) ) {
    525                 migrateWarn( "jQuery.data() always sets/gets camelCased names: " + key );
     635                migrateWarn( "data-camelCase",
     636                    "jQuery.data() always sets/gets camelCased names: " + key );
    526637                curData[ key ] = name[ key ];
    527638            } else {
     
    530641        }
    531642
    532         oldData.call( this, elem, sameKeys );
     643        origData.call( this, elem, sameKeys );
    533644
    534645        return name;
     
    537648    // If the name is transformed, look for the un-transformed name in the data object
    538649    if ( name && typeof name === "string" && name !== camelCase( name ) ) {
    539         curData = jQuery.hasData( elem ) && oldData.call( this, elem );
     650
     651        curData = jQuery.hasData( elem ) && origData.call( this, elem );
    540652        if ( curData && name in curData ) {
    541             migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name );
     653            migrateWarn( "data-camelCase",
     654                "jQuery.data() always sets/gets camelCased names: " + name );
    542655            if ( arguments.length > 2 ) {
    543656                curData[ name ] = value;
     
    547660    }
    548661
    549     return oldData.apply( this, arguments );
    550 };
     662    return origData.apply( this, arguments );
     663}, "data-camelCase" );
    551664
    552665// Support jQuery slim which excludes the effects module
     
    559672    };
    560673
    561 jQuery.Tween.prototype.run = function( ) {
     674migratePatchFunc( jQuery.Tween.prototype, "run", function( ) {
    562675    if ( jQuery.easing[ this.easing ].length > 1 ) {
    563676        migrateWarn(
     677            "easing-one-arg",
    564678            "'jQuery.easing." + this.easing.toString() + "' should use only one argument"
    565679        );
     
    569683
    570684    oldTweenRun.apply( this, arguments );
    571 };
    572 
    573 intervalValue = jQuery.fx.interval || 13;
     685}, "easing-one-arg" );
     686
     687intervalValue = jQuery.fx.interval;
    574688intervalMsg = "jQuery.fx.interval is deprecated";
    575689
     
    583697        get: function() {
    584698            if ( !window.document.hidden ) {
    585                 migrateWarn( intervalMsg );
     699                migrateWarn( "fx-interval", intervalMsg );
    586700            }
    587             return intervalValue;
     701
     702            // Only fallback to the default if patch is enabled
     703            if ( !jQuery.migrateIsPatchEnabled( "fx-interval" ) ) {
     704                return intervalValue;
     705            }
     706            return intervalValue === undefined ? 13 : intervalValue;
    588707        },
    589708        set: function( newValue ) {
    590             migrateWarn( intervalMsg );
     709            migrateWarn( "fx-interval", intervalMsg );
    591710            intervalValue = newValue;
    592711        }
     
    604723
    605724migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat,
     725    "event-old-patch",
    606726    "jQuery.event.props.concat() is deprecated and removed" );
    607727
    608 jQuery.event.fix = function( originalEvent ) {
     728migratePatchFunc( jQuery.event, "fix", function( originalEvent ) {
    609729    var event,
    610730        type = originalEvent.type,
     
    613733
    614734    if ( props.length ) {
    615         migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() );
     735        migrateWarn( "event-old-patch",
     736            "jQuery.event.props are deprecated and removed: " + props.join() );
    616737        while ( props.length ) {
    617738            jQuery.event.addProp( props.pop() );
     
    621742    if ( fixHook && !fixHook._migrated_ ) {
    622743        fixHook._migrated_ = true;
    623         migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type );
     744        migrateWarn( "event-old-patch",
     745            "jQuery.event.fixHooks are deprecated and removed: " + type );
    624746        if ( ( props = fixHook.props ) && props.length ) {
    625747            while ( props.length ) {
     
    631753    event = originalFix.call( this, originalEvent );
    632754
    633     return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
    634 };
    635 
    636 jQuery.event.add = function( elem, types ) {
     755    return fixHook && fixHook.filter ?
     756        fixHook.filter( event, originalEvent ) :
     757        event;
     758}, "event-old-patch" );
     759
     760migratePatchFunc( jQuery.event, "add", function( elem, types ) {
    637761
    638762    // This misses the multiple-types case but that seems awfully rare
    639763    if ( elem === window && types === "load" && window.document.readyState === "complete" ) {
    640         migrateWarn( "jQuery(window).on('load'...) called after load event occurred" );
     764        migrateWarn( "load-after-event",
     765            "jQuery(window).on('load'...) called after load event occurred" );
    641766    }
    642767    return oldEventAdd.apply( this, arguments );
    643 };
     768}, "load-after-event" );
    644769
    645770jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
    646771
    647     jQuery.fn[ name ] = function() {
     772    migratePatchFunc( jQuery.fn, name, function() {
    648773        var args = Array.prototype.slice.call( arguments, 0 );
    649774
     
    656781        }
    657782
    658         migrateWarn( "jQuery.fn." + name + "() is deprecated" );
     783        migrateWarn( "shorthand-removed-v3",
     784            "jQuery.fn." + name + "() is deprecated" );
    659785
    660786        args.splice( 0, 0, name );
     
    669795        this.triggerHandler.apply( this, args );
    670796        return this;
    671     };
     797    }, "shorthand-removed-v3" );
    672798
    673799} );
     
    679805
    680806    // Handle event binding
    681     jQuery.fn[ name ] = function( data, fn ) {
    682         migrateWarn( "jQuery.fn." + name + "() event shorthand is deprecated" );
     807    migratePatchAndWarnFunc( jQuery.fn, name, function( data, fn ) {
    683808        return arguments.length > 0 ?
    684809            this.on( name, null, data, fn ) :
    685810            this.trigger( name );
    686     };
     811        },
     812        "shorthand-deprecated-v3",
     813        "jQuery.fn." + name + "() event shorthand is deprecated" );
    687814} );
    688815
     
    695822    setup: function() {
    696823        if ( this === window.document ) {
    697             migrateWarn( "'ready' event is deprecated" );
     824            migrateWarn( "ready-event", "'ready' event is deprecated" );
    698825        }
    699826    }
    700827};
    701828
    702 jQuery.fn.extend( {
    703 
    704     bind: function( types, data, fn ) {
    705         migrateWarn( "jQuery.fn.bind() is deprecated" );
    706         return this.on( types, null, data, fn );
    707     },
    708     unbind: function( types, fn ) {
    709         migrateWarn( "jQuery.fn.unbind() is deprecated" );
    710         return this.off( types, null, fn );
    711     },
    712     delegate: function( selector, types, data, fn ) {
    713         migrateWarn( "jQuery.fn.delegate() is deprecated" );
    714         return this.on( types, selector, data, fn );
    715     },
    716     undelegate: function( selector, types, fn ) {
    717         migrateWarn( "jQuery.fn.undelegate() is deprecated" );
    718         return arguments.length === 1 ?
    719             this.off( selector, "**" ) :
    720             this.off( types, selector || "**", fn );
    721     },
    722     hover: function( fnOver, fnOut ) {
    723         migrateWarn( "jQuery.fn.hover() is deprecated" );
    724         return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver );
    725     }
    726 } );
     829migratePatchAndWarnFunc( jQuery.fn, "bind", function( types, data, fn ) {
     830    return this.on( types, null, data, fn );
     831}, "pre-on-methods", "jQuery.fn.bind() is deprecated" );
     832migratePatchAndWarnFunc( jQuery.fn, "unbind", function( types, fn ) {
     833    return this.off( types, null, fn );
     834}, "pre-on-methods", "jQuery.fn.unbind() is deprecated" );
     835migratePatchAndWarnFunc( jQuery.fn, "delegate", function( selector, types, data, fn ) {
     836    return this.on( types, selector, data, fn );
     837}, "pre-on-methods", "jQuery.fn.delegate() is deprecated" );
     838migratePatchAndWarnFunc( jQuery.fn, "undelegate", function( selector, types, fn ) {
     839    return arguments.length === 1 ?
     840        this.off( selector, "**" ) :
     841        this.off( types, selector || "**", fn );
     842}, "pre-on-methods", "jQuery.fn.undelegate() is deprecated" );
     843migratePatchAndWarnFunc( jQuery.fn, "hover", function( fnOver, fnOut ) {
     844    return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver );
     845}, "pre-on-methods", "jQuery.fn.hover() is deprecated" );
    727846
    728847var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
    729     origHtmlPrefilter = jQuery.htmlPrefilter,
    730848    makeMarkup = function( html ) {
    731849        var doc = window.document.implementation.createHTMLDocument( "" );
     
    736854        var changed = html.replace( rxhtmlTag, "<$1></$2>" );
    737855        if ( changed !== html && makeMarkup( html ) !== makeMarkup( changed ) ) {
    738             migrateWarn( "HTML tags must be properly nested and closed: " + html );
     856            migrateWarn( "self-closed-tags",
     857                "HTML tags must be properly nested and closed: " + html );
    739858        }
    740859    };
    741860
     861/**
     862 * Deprecated, please use `jQuery.migrateDisablePatches( "self-closed-tags" )` instead.
     863 * @deprecated
     864 */
    742865jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() {
    743     jQuery.htmlPrefilter = function( html ) {
    744         warnIfChanged( html );
    745         return html.replace( rxhtmlTag, "<$1></$2>" );
    746     };
     866    jQuery.migrateEnablePatches( "self-closed-tags" );
    747867};
    748868
    749 jQuery.htmlPrefilter = function( html ) {
     869migratePatchFunc( jQuery, "htmlPrefilter", function( html ) {
    750870    warnIfChanged( html );
    751     return origHtmlPrefilter( html );
    752 };
    753 
    754 var oldOffset = jQuery.fn.offset;
    755 
    756 jQuery.fn.offset = function() {
     871    return html.replace( rxhtmlTag, "<$1></$2>" );
     872}, "self-closed-tags" );
     873
     874// This patch needs to be disabled by default as it re-introduces
     875// security issues (CVE-2020-11022, CVE-2020-11023).
     876jQuery.migrateDisablePatches( "self-closed-tags" );
     877
     878var origOffset = jQuery.fn.offset;
     879
     880migratePatchFunc( jQuery.fn, "offset", function() {
    757881    var elem = this[ 0 ];
    758882
    759883    if ( elem && ( !elem.nodeType || !elem.getBoundingClientRect ) ) {
    760         migrateWarn( "jQuery.fn.offset() requires a valid DOM element" );
     884        migrateWarn( "offset-valid-elem", "jQuery.fn.offset() requires a valid DOM element" );
    761885        return arguments.length ? this : undefined;
    762886    }
    763887
    764     return oldOffset.apply( this, arguments );
    765 };
     888    return origOffset.apply( this, arguments );
     889}, "offset-valid-elem" );
    766890
    767891// Support jQuery slim which excludes the ajax module
     
    770894if ( jQuery.ajax ) {
    771895
    772 var oldParam = jQuery.param;
    773 
    774 jQuery.param = function( data, traditional ) {
     896var origParam = jQuery.param;
     897
     898migratePatchFunc( jQuery, "param", function( data, traditional ) {
    775899    var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
    776900
    777901    if ( traditional === undefined && ajaxTraditional ) {
    778902
    779         migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" );
     903        migrateWarn( "param-ajax-traditional",
     904            "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" );
    780905        traditional = ajaxTraditional;
    781906    }
    782907
    783     return oldParam.call( this, data, traditional );
    784 };
    785 
    786 }
    787 
    788 var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
    789 
    790 jQuery.fn.andSelf = function() {
    791     migrateWarn( "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" );
    792     return oldSelf.apply( this, arguments );
    793 };
     908    return origParam.call( this, data, traditional );
     909}, "param-ajax-traditional" );
     910
     911}
     912
     913migratePatchAndWarnFunc( jQuery.fn, "andSelf", jQuery.fn.addBack, "andSelf",
     914    "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" );
    794915
    795916// Support jQuery slim which excludes the deferred module in jQuery 4.0+
     
    808929    ];
    809930
    810 jQuery.Deferred = function( func ) {
     931migratePatchFunc( jQuery, "Deferred", function( func ) {
    811932    var deferred = oldDeferred(),
    812933        promise = deferred.promise();
    813934
    814     deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {
     935    function newDeferredPipe( /* fnDone, fnFail, fnProgress */ ) {
    815936        var fns = arguments;
    816 
    817         migrateWarn( "deferred.pipe() is deprecated" );
    818937
    819938        return jQuery.Deferred( function( newDefer ) {
     
    841960            fns = null;
    842961        } ).promise();
    843 
    844     };
     962    }
     963
     964    migratePatchAndWarnFunc( deferred, "pipe", newDeferredPipe, "deferred-pipe",
     965        "deferred.pipe() is deprecated" );
     966    migratePatchAndWarnFunc( promise, "pipe", newDeferredPipe, "deferred-pipe",
     967        "deferred.pipe() is deprecated" );
    845968
    846969    if ( func ) {
     
    849972
    850973    return deferred;
    851 };
     974}, "deferred-pipe" );
    852975
    853976// Preserve handler of uncaught exceptions in promise chains
  • trunk/src/js/_enqueues/vendor/jquery/jquery-migrate.min.js

    r49649 r55237  
    1 /*! jQuery Migrate v3.3.2 | (c) OpenJS Foundation and other contributors | jquery.org/license */
    2 "undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],i=1;i<=3;i++){if(+o[i]<+n[i])return 1;if(+n[i]<+o[i])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.3.2",n.console&&n.console.log&&(s&&e("3.0.0")||n.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var r={};function u(e){var t=n.console;s.migrateDeduplicateWarnings&&r[e]||(r[e]=!0,s.migrateWarnings.push(e),t&&t.warn&&!s.migrateMute&&(t.warn("JQMIGRATE: "+e),s.migrateTrace&&t.trace&&t.trace()))}function t(e,t,r,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n),r},set:function(e){u(n),r=e}})}function o(e,t,r,n){e[t]=function(){return u(n),r.apply(this,arguments)}}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){r={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("jQuery is not compatible with Quirks Mode");var i,a,c,d={},l=s.fn.init,p=s.find,f=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,y=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,m=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;for(i in s.fn.init=function(e){var t=Array.prototype.slice.call(arguments);return"string"==typeof e&&"#"===e&&(u("jQuery( '#' ) is not a valid selector"),t[0]=[]),l.apply(this,t)},s.fn.init.prototype=s.fn,s.find=function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&f.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(y,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("Attribute selector with '#' was not fixed: "+r[0])}}return p.apply(this,r)},p)Object.prototype.hasOwnProperty.call(p,i)&&(s.find[i]=p[i]);o(s.fn,"size",function(){return this.length},"jQuery.fn.size() is deprecated and removed; use the .length property"),o(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"jQuery.parseJSON is deprecated; use JSON.parse"),o(s,"holdReady",s.holdReady,"jQuery.holdReady is deprecated"),o(s,"unique",s.uniqueSort,"jQuery.unique is deprecated; use jQuery.uniqueSort"),t(s.expr,"filters",s.expr.pseudos,"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),t(s.expr,":",s.expr.pseudos,"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&o(s,"trim",function(e){return null==e?"":(e+"").replace(m,"")},"jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(o(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"jQuery.nodeName is deprecated"),o(s,"isArray",Array.isArray,"jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(o(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){d["[object "+t+"]"]=t.toLowerCase()}),o(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[Object.prototype.toString.call(e)]||"object":typeof e},"jQuery.type is deprecated"),o(s,"isFunction",function(e){return"function"==typeof e},"jQuery.isFunction() is deprecated"),o(s,"isWindow",function(e){return null!=e&&e===e.window},"jQuery.isWindow() is deprecated")),s.ajax&&(a=s.ajax,c=/(=)\?(?=&|$)|\?\?/,s.ajax=function(){var e=a.apply(this,arguments);return e.promise&&(o(e,"success",e.done,"jQXHR.success is deprecated and removed"),o(e,"error",e.fail,"jQXHR.error is deprecated and removed"),o(e,"complete",e.always,"jQXHR.complete is deprecated and removed")),e},e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(c.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&c.test(e.data))&&u("JSON-to-JSONP auto-promotion is deprecated")}));var g=s.fn.removeAttr,h=s.fn.toggleClass,v=/\S+/g;function j(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}s.fn.removeAttr=function(e){var r=this;return s.each(e.match(v),function(e,t){s.expr.match.bool.test(t)&&(u("jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),g.apply(this,arguments)};var Q,b=!(s.fn.toggleClass=function(t){return void 0!==t&&"boolean"!=typeof t?h.apply(this,arguments):(u("jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))}),w=/^[a-z]/,x=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return b=!0,e=r.apply(this,arguments),b=!1,e})}),s.swap=function(e,t,r,n){var o,i,a={};for(i in b||u("jQuery.swap() is undocumented and deprecated"),t)a[i]=e.style[i],e.style[i]=t[i];for(i in o=r.apply(e,n||[]),t)e.style[i]=a[i];return o},e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("JQMIGRATE: jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),s.cssNumber||(s.cssNumber={}),Q=s.fn.css,s.fn.css=function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=j(e),n=r,w.test(n)&&x.test(n[0].toUpperCase()+n.slice(1))||s.cssNumber[r]||u('Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))};var A,k,S,M,N=s.data;s.data=function(e,t,r){var n,o,i;if(t&&"object"==typeof t&&2===arguments.length){for(i in n=s.hasData(e)&&N.call(this,e),o={},t)i!==j(i)?(u("jQuery.data() always sets/gets camelCased names: "+i),n[i]=t[i]):o[i]=t[i];return N.call(this,e,o),t}return t&&"string"==typeof t&&t!==j(t)&&(n=s.hasData(e)&&N.call(this,e))&&t in n?(u("jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):N.apply(this,arguments)},s.fx&&(S=s.Tween.prototype.run,M=function(e){return e},s.Tween.prototype.run=function(){1<s.easing[this.easing].length&&(u("'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=M),S.apply(this,arguments)},A=s.fx.interval||13,k="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u(k),A},set:function(e){u(k),A=e}}));var R=s.fn.load,H=s.event.add,C=s.event.fix;s.event.props=[],s.event.fixHooks={},t(s.event.props,"concat",s.event.props.concat,"jQuery.event.props.concat() is deprecated and removed"),s.event.fix=function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=C.call(this,e),n&&n.filter?n.filter(t,e):t},s.event.add=function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("jQuery(window).on('load'...) called after load event occurred"),H.apply(this,arguments)},s.each(["load","unload","error"],function(e,t){s.fn[t]=function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?R.apply(this,e):(u("jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))}}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){s.fn[r]=function(e,t){return u("jQuery.fn."+r+"() event shorthand is deprecated"),0<arguments.length?this.on(r,null,e,t):this.trigger(r)}}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("'ready' event is deprecated")}},s.fn.extend({bind:function(e,t,r){return u("jQuery.fn.bind() is deprecated"),this.on(e,null,t,r)},unbind:function(e,t){return u("jQuery.fn.unbind() is deprecated"),this.off(e,null,t)},delegate:function(e,t,r,n){return u("jQuery.fn.delegate() is deprecated"),this.on(t,e,r,n)},undelegate:function(e,t,r){return u("jQuery.fn.undelegate() is deprecated"),1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},hover:function(e,t){return u("jQuery.fn.hover() is deprecated"),this.on("mouseenter",e).on("mouseleave",t||e)}});function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}function P(e){var t=e.replace(O,"<$1></$2>");t!==e&&T(e)!==T(t)&&u("HTML tags must be properly nested and closed: "+e)}var O=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,q=s.htmlPrefilter;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.htmlPrefilter=function(e){return P(e),e.replace(O,"<$1></$2>")}},s.htmlPrefilter=function(e){return P(e),q(e)};var D,_=s.fn.offset;s.fn.offset=function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?_.apply(this,arguments):(u("jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},s.ajax&&(D=s.param,s.param=function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)});var E,F,J=s.fn.andSelf||s.fn.addBack;return s.fn.andSelf=function(){return u("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),J.apply(this,arguments)},s.Deferred&&(E=s.Deferred,F=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],s.Deferred=function(e){var i=E(),a=i.promise();return i.pipe=a.pipe=function(){var o=arguments;return u("deferred.pipe() is deprecated"),s.Deferred(function(n){s.each(F,function(e,t){var r="function"==typeof o[e]&&o[e];i[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===a?n.promise():this,r?[e]:arguments)})}),o=null}).promise()},e&&e.call(i,i),i},s.Deferred.exceptionHook=E.exceptionHook),s});
     1/*! jQuery Migrate v3.4.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
     2"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+n[a]>+o[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.0";var t=Object.create(null),o=(s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")||n.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion)),{});function i(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return i(n,o),r},set:function(e){i(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&i(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function u(e,t,r,n,o){if(!o)throw new Error("No warning message provided");a(e,t,r,n,o)}function d(e,t,r,n){a(e,t,r,n)}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&i("quirks","jQuery is not compatible with Quirks Mode");var c,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;for(c in d(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(i("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,d(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(g,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),i("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){i("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,c)&&(s.find[c]=y[c]);u(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),u(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),u(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),u(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&u(s,"trim",function(e){return null==e?"":(e+"").replace(v,"")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(u(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),u(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(u(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),u(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),u(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),u(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,d(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(u(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),u(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),u(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&i("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,w=/\S+/g;function Q(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}d(s.fn,"removeAttr",function(e){var r=this;return s.each(e.match(w),function(e,t){s.expr.match.bool.test(t)&&(i("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),d(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(i("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var x,A=!1,R=/^[a-z]/,T=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return A=!0,e=r.apply(this,arguments),A=!1,e})}),d(s,"swap",function(e,t,r,n){var o,a={};for(o in A||i("swap","jQuery.swap() is undocumented and deprecated"),t)a[o]=e.style[o],e.style[o]=t[o];for(o in r=r.apply(e,n||[]),t)e.style[o]=a[o];return r},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return i("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")&&"undefined"!=typeof Proxy&&(s.cssNumber=new Proxy({animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},{get:function(){return i("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return i("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}})),x=s.fn.css,d(s.fn,"css",function(e,t){var r,n=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(n,e,t)}),this):("number"==typeof t&&(t=Q(e),r=t,R.test(r)&&T.test(r[0].toUpperCase()+r.slice(1))||s.cssNumber[t]||i("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),x.apply(this,arguments))},"css-number");function C(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var S,N,P,k,H,E,M,q=s.data,D=(d(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&q.call(this,e),o={},t)a!==Q(a)?(i("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return q.call(this,e,o),t}return t&&"string"==typeof t&&t!==Q(t)&&(n=s.hasData(e)&&q.call(this,e))&&t in n?(i("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):q.apply(this,arguments)},"data-camelCase"),s.fx&&(P=s.Tween.prototype.run,k=function(e){return e},d(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(i("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=k),P.apply(this,arguments)},"easing-one-arg"),S=s.fx.interval,N="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||i("fx-interval",N),s.migrateIsPatchEnabled("fx-interval")&&void 0===S?13:S},set:function(e){i("fx-interval",N),S=e}})),s.fn.load),F=s.event.add,W=s.event.fix,O=(s.event.props=[],s.event.fixHooks={},r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),d(s.event,"fix",function(e){var t=e.type,r=this.fixHooks[t],n=s.event.props;if(n.length){i("event-old-patch","jQuery.event.props are deprecated and removed: "+n.join());while(n.length)s.event.addProp(n.pop())}if(r&&!r._migrated_&&(r._migrated_=!0,i("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+t),(n=r.props)&&n.length))while(n.length)s.event.addProp(n.pop());return t=W.call(this,e),r&&r.filter?r.filter(t,e):t},"event-old-patch"),d(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&i("load-after-event","jQuery(window).on('load'...) called after load event occurred"),F.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){d(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?D.apply(this,e):(i("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){u(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&i("ready-event","'ready' event is deprecated")}},u(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),u(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),u(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),u(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),u(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated"),/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi),_=(s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},d(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(O,"<$1></$2>"))!==t&&C(t)!==C(r)&&i("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(O,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags"),s.fn.offset);return d(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?_.apply(this,arguments):(i("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(H=s.param,d(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(i("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),H.call(this,e,t)},"param-ajax-traditional")),u(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(E=s.Deferred,M=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],d(s,"Deferred",function(e){var a=E(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(M,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return u(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),u(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=E.exceptionHook),s});
  • trunk/src/wp-includes/script-loader.php

    r55192 r55237  
    825825    $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '3.6.3' );
    826826    $scripts->add( 'jquery-core', "/wp-includes/js/jquery/jquery$suffix.js", array(), '3.6.3' );
    827     $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '3.3.2' );
     827    $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '3.4.0' );
    828828
    829829    // Full jQuery UI.
Note: See TracChangeset for help on using the changeset viewer.