Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/jquery
File: jquery-migrate.js
/*!
[0] Fix | Delete
* jQuery Migrate - v3.3.2 - 2020-11-18T08:29Z
[1] Fix | Delete
* Copyright OpenJS Foundation and other contributors
[2] Fix | Delete
*/
[3] Fix | Delete
( function( factory ) {
[4] Fix | Delete
"use strict";
[5] Fix | Delete
[6] Fix | Delete
if ( typeof define === "function" && define.amd ) {
[7] Fix | Delete
[8] Fix | Delete
// AMD. Register as an anonymous module.
[9] Fix | Delete
define( [ "jquery" ], function( jQuery ) {
[10] Fix | Delete
return factory( jQuery, window );
[11] Fix | Delete
} );
[12] Fix | Delete
} else if ( typeof module === "object" && module.exports ) {
[13] Fix | Delete
[14] Fix | Delete
// Node/CommonJS
[15] Fix | Delete
// eslint-disable-next-line no-undef
[16] Fix | Delete
module.exports = factory( require( "jquery" ), window );
[17] Fix | Delete
} else {
[18] Fix | Delete
[19] Fix | Delete
// Browser globals
[20] Fix | Delete
factory( jQuery, window );
[21] Fix | Delete
}
[22] Fix | Delete
} )( function( jQuery, window ) {
[23] Fix | Delete
"use strict";
[24] Fix | Delete
[25] Fix | Delete
jQuery.migrateVersion = "3.3.2";
[26] Fix | Delete
[27] Fix | Delete
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
[28] Fix | Delete
function compareVersions( v1, v2 ) {
[29] Fix | Delete
var i,
[30] Fix | Delete
rVersionParts = /^(\d+)\.(\d+)\.(\d+)/,
[31] Fix | Delete
v1p = rVersionParts.exec( v1 ) || [ ],
[32] Fix | Delete
v2p = rVersionParts.exec( v2 ) || [ ];
[33] Fix | Delete
[34] Fix | Delete
for ( i = 1; i <= 3; i++ ) {
[35] Fix | Delete
if ( +v1p[ i ] > +v2p[ i ] ) {
[36] Fix | Delete
return 1;
[37] Fix | Delete
}
[38] Fix | Delete
if ( +v1p[ i ] < +v2p[ i ] ) {
[39] Fix | Delete
return -1;
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
return 0;
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
function jQueryVersionSince( version ) {
[46] Fix | Delete
return compareVersions( jQuery.fn.jquery, version ) >= 0;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
( function() {
[50] Fix | Delete
[51] Fix | Delete
// Support: IE9 only
[52] Fix | Delete
// IE9 only creates console object when dev tools are first opened
[53] Fix | Delete
// IE9 console is a host object, callable but doesn't have .apply()
[54] Fix | Delete
if ( !window.console || !window.console.log ) {
[55] Fix | Delete
return;
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
// Need jQuery 3.0.0+ and no older Migrate loaded
[59] Fix | Delete
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) {
[60] Fix | Delete
window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
[61] Fix | Delete
}
[62] Fix | Delete
if ( jQuery.migrateWarnings ) {
[63] Fix | Delete
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" );
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
// Show a message on the console so devs know we're active
[67] Fix | Delete
window.console.log( "JQMIGRATE: Migrate is installed" +
[68] Fix | Delete
( jQuery.migrateMute ? "" : " with logging active" ) +
[69] Fix | Delete
", version " + jQuery.migrateVersion );
[70] Fix | Delete
[71] Fix | Delete
} )();
[72] Fix | Delete
[73] Fix | Delete
var warnedAbout = {};
[74] Fix | Delete
[75] Fix | Delete
// By default each warning is only reported once.
[76] Fix | Delete
jQuery.migrateDeduplicateWarnings = true;
[77] Fix | Delete
[78] Fix | Delete
// List of warnings already given; public read only
[79] Fix | Delete
jQuery.migrateWarnings = [];
[80] Fix | Delete
[81] Fix | Delete
// Set to false to disable traces that appear with warnings
[82] Fix | Delete
if ( jQuery.migrateTrace === undefined ) {
[83] Fix | Delete
jQuery.migrateTrace = true;
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
// Forget any warnings we've already given; public
[87] Fix | Delete
jQuery.migrateReset = function() {
[88] Fix | Delete
warnedAbout = {};
[89] Fix | Delete
jQuery.migrateWarnings.length = 0;
[90] Fix | Delete
};
[91] Fix | Delete
[92] Fix | Delete
function migrateWarn( msg ) {
[93] Fix | Delete
var console = window.console;
[94] Fix | Delete
if ( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) {
[95] Fix | Delete
warnedAbout[ msg ] = true;
[96] Fix | Delete
jQuery.migrateWarnings.push( msg );
[97] Fix | Delete
if ( console && console.warn && !jQuery.migrateMute ) {
[98] Fix | Delete
console.warn( "JQMIGRATE: " + msg );
[99] Fix | Delete
if ( jQuery.migrateTrace && console.trace ) {
[100] Fix | Delete
console.trace();
[101] Fix | Delete
}
[102] Fix | Delete
}
[103] Fix | Delete
}
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
function migrateWarnProp( obj, prop, value, msg ) {
[107] Fix | Delete
Object.defineProperty( obj, prop, {
[108] Fix | Delete
configurable: true,
[109] Fix | Delete
enumerable: true,
[110] Fix | Delete
get: function() {
[111] Fix | Delete
migrateWarn( msg );
[112] Fix | Delete
return value;
[113] Fix | Delete
},
[114] Fix | Delete
set: function( newValue ) {
[115] Fix | Delete
migrateWarn( msg );
[116] Fix | Delete
value = newValue;
[117] Fix | Delete
}
[118] Fix | Delete
} );
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
function migrateWarnFunc( obj, prop, newFunc, msg ) {
[122] Fix | Delete
obj[ prop ] = function() {
[123] Fix | Delete
migrateWarn( msg );
[124] Fix | Delete
return newFunc.apply( this, arguments );
[125] Fix | Delete
};
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
if ( window.document.compatMode === "BackCompat" ) {
[129] Fix | Delete
[130] Fix | Delete
// JQuery has never supported or tested Quirks Mode
[131] Fix | Delete
migrateWarn( "jQuery is not compatible with Quirks Mode" );
[132] Fix | Delete
}
[133] Fix | Delete
[134] Fix | Delete
var findProp,
[135] Fix | Delete
class2type = {},
[136] Fix | Delete
oldInit = jQuery.fn.init,
[137] Fix | Delete
oldFind = jQuery.find,
[138] Fix | Delete
[139] Fix | Delete
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
[140] Fix | Delete
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,
[141] Fix | Delete
[142] Fix | Delete
// Support: Android <=4.0 only
[143] Fix | Delete
// Make sure we trim BOM and NBSP
[144] Fix | Delete
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
[145] Fix | Delete
[146] Fix | Delete
jQuery.fn.init = function( arg1 ) {
[147] Fix | Delete
var args = Array.prototype.slice.call( arguments );
[148] Fix | Delete
[149] Fix | Delete
if ( typeof arg1 === "string" && arg1 === "#" ) {
[150] Fix | Delete
[151] Fix | Delete
// JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
[152] Fix | Delete
migrateWarn( "jQuery( '#' ) is not a valid selector" );
[153] Fix | Delete
args[ 0 ] = [];
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
return oldInit.apply( this, args );
[157] Fix | Delete
};
[158] Fix | Delete
jQuery.fn.init.prototype = jQuery.fn;
[159] Fix | Delete
[160] Fix | Delete
jQuery.find = function( selector ) {
[161] Fix | Delete
var args = Array.prototype.slice.call( arguments );
[162] Fix | Delete
[163] Fix | Delete
// Support: PhantomJS 1.x
[164] Fix | Delete
// String#match fails to match when used with a //g RegExp, only on some strings
[165] Fix | Delete
if ( typeof selector === "string" && rattrHashTest.test( selector ) ) {
[166] Fix | Delete
[167] Fix | Delete
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
[168] Fix | Delete
// First see if qS thinks it's a valid selector, if so avoid a false positive
[169] Fix | Delete
try {
[170] Fix | Delete
window.document.querySelector( selector );
[171] Fix | Delete
} catch ( err1 ) {
[172] Fix | Delete
[173] Fix | Delete
// Didn't *look* valid to qSA, warn and try quoting what we think is the value
[174] Fix | Delete
selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) {
[175] Fix | Delete
return "[" + attr + op + "\"" + value + "\"]";
[176] Fix | Delete
} );
[177] Fix | Delete
[178] Fix | Delete
// If the regexp *may* have created an invalid selector, don't update it
[179] Fix | Delete
// Note that there may be false alarms if selector uses jQuery extensions
[180] Fix | Delete
try {
[181] Fix | Delete
window.document.querySelector( selector );
[182] Fix | Delete
migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] );
[183] Fix | Delete
args[ 0 ] = selector;
[184] Fix | Delete
} catch ( err2 ) {
[185] Fix | Delete
migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] );
[186] Fix | Delete
}
[187] Fix | Delete
}
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
return oldFind.apply( this, args );
[191] Fix | Delete
};
[192] Fix | Delete
[193] Fix | Delete
// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
[194] Fix | Delete
for ( findProp in oldFind ) {
[195] Fix | Delete
if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) {
[196] Fix | Delete
jQuery.find[ findProp ] = oldFind[ findProp ];
[197] Fix | Delete
}
[198] Fix | Delete
}
[199] Fix | Delete
[200] Fix | Delete
// The number of elements contained in the matched element set
[201] Fix | Delete
migrateWarnFunc( jQuery.fn, "size", function() {
[202] Fix | Delete
return this.length;
[203] Fix | Delete
},
[204] Fix | Delete
"jQuery.fn.size() is deprecated and removed; use the .length property" );
[205] Fix | Delete
[206] Fix | Delete
migrateWarnFunc( jQuery, "parseJSON", function() {
[207] Fix | Delete
return JSON.parse.apply( null, arguments );
[208] Fix | Delete
},
[209] Fix | Delete
"jQuery.parseJSON is deprecated; use JSON.parse" );
[210] Fix | Delete
[211] Fix | Delete
migrateWarnFunc( jQuery, "holdReady", jQuery.holdReady,
[212] Fix | Delete
"jQuery.holdReady is deprecated" );
[213] Fix | Delete
[214] Fix | Delete
migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort,
[215] Fix | Delete
"jQuery.unique is deprecated; use jQuery.uniqueSort" );
[216] Fix | Delete
[217] Fix | Delete
// Now jQuery.expr.pseudos is the standard incantation
[218] Fix | Delete
migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos,
[219] Fix | Delete
"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" );
[220] Fix | Delete
migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos,
[221] Fix | Delete
"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" );
[222] Fix | Delete
[223] Fix | Delete
// Prior to jQuery 3.1.1 there were internal refs so we don't warn there
[224] Fix | Delete
if ( jQueryVersionSince( "3.1.1" ) ) {
[225] Fix | Delete
migrateWarnFunc( jQuery, "trim", function( text ) {
[226] Fix | Delete
return text == null ?
[227] Fix | Delete
"" :
[228] Fix | Delete
( text + "" ).replace( rtrim, "" );
[229] Fix | Delete
},
[230] Fix | Delete
"jQuery.trim is deprecated; use String.prototype.trim" );
[231] Fix | Delete
}
[232] Fix | Delete
[233] Fix | Delete
// Prior to jQuery 3.2 there were internal refs so we don't warn there
[234] Fix | Delete
if ( jQueryVersionSince( "3.2.0" ) ) {
[235] Fix | Delete
migrateWarnFunc( jQuery, "nodeName", function( elem, name ) {
[236] Fix | Delete
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
[237] Fix | Delete
},
[238] Fix | Delete
"jQuery.nodeName is deprecated" );
[239] Fix | Delete
[240] Fix | Delete
migrateWarnFunc( jQuery, "isArray", Array.isArray,
[241] Fix | Delete
"jQuery.isArray is deprecated; use Array.isArray"
[242] Fix | Delete
);
[243] Fix | Delete
}
[244] Fix | Delete
[245] Fix | Delete
if ( jQueryVersionSince( "3.3.0" ) ) {
[246] Fix | Delete
[247] Fix | Delete
migrateWarnFunc( jQuery, "isNumeric", function( obj ) {
[248] Fix | Delete
[249] Fix | Delete
// As of jQuery 3.0, isNumeric is limited to
[250] Fix | Delete
// strings and numbers (primitives or objects)
[251] Fix | Delete
// that can be coerced to finite numbers (gh-2662)
[252] Fix | Delete
var type = typeof obj;
[253] Fix | Delete
return ( type === "number" || type === "string" ) &&
[254] Fix | Delete
[255] Fix | Delete
// parseFloat NaNs numeric-cast false positives ("")
[256] Fix | Delete
// ...but misinterprets leading-number strings, e.g. hex literals ("0x...")
[257] Fix | Delete
// subtraction forces infinities to NaN
[258] Fix | Delete
!isNaN( obj - parseFloat( obj ) );
[259] Fix | Delete
},
[260] Fix | Delete
"jQuery.isNumeric() is deprecated"
[261] Fix | Delete
);
[262] Fix | Delete
[263] Fix | Delete
// Populate the class2type map
[264] Fix | Delete
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".
[265] Fix | Delete
split( " " ),
[266] Fix | Delete
function( _, name ) {
[267] Fix | Delete
class2type[ "[object " + name + "]" ] = name.toLowerCase();
[268] Fix | Delete
} );
[269] Fix | Delete
[270] Fix | Delete
migrateWarnFunc( jQuery, "type", function( obj ) {
[271] Fix | Delete
if ( obj == null ) {
[272] Fix | Delete
return obj + "";
[273] Fix | Delete
}
[274] Fix | Delete
[275] Fix | Delete
// Support: Android <=2.3 only (functionish RegExp)
[276] Fix | Delete
return typeof obj === "object" || typeof obj === "function" ?
[277] Fix | Delete
class2type[ Object.prototype.toString.call( obj ) ] || "object" :
[278] Fix | Delete
typeof obj;
[279] Fix | Delete
},
[280] Fix | Delete
"jQuery.type is deprecated" );
[281] Fix | Delete
[282] Fix | Delete
migrateWarnFunc( jQuery, "isFunction",
[283] Fix | Delete
function( obj ) {
[284] Fix | Delete
return typeof obj === "function";
[285] Fix | Delete
},
[286] Fix | Delete
"jQuery.isFunction() is deprecated" );
[287] Fix | Delete
[288] Fix | Delete
migrateWarnFunc( jQuery, "isWindow",
[289] Fix | Delete
function( obj ) {
[290] Fix | Delete
return obj != null && obj === obj.window;
[291] Fix | Delete
},
[292] Fix | Delete
"jQuery.isWindow() is deprecated"
[293] Fix | Delete
);
[294] Fix | Delete
}
[295] Fix | Delete
[296] Fix | Delete
// Support jQuery slim which excludes the ajax module
[297] Fix | Delete
if ( jQuery.ajax ) {
[298] Fix | Delete
[299] Fix | Delete
var oldAjax = jQuery.ajax,
[300] Fix | Delete
rjsonp = /(=)\?(?=&|$)|\?\?/;
[301] Fix | Delete
[302] Fix | Delete
jQuery.ajax = function( ) {
[303] Fix | Delete
var jQXHR = oldAjax.apply( this, arguments );
[304] Fix | Delete
[305] Fix | Delete
// Be sure we got a jQXHR (e.g., not sync)
[306] Fix | Delete
if ( jQXHR.promise ) {
[307] Fix | Delete
migrateWarnFunc( jQXHR, "success", jQXHR.done,
[308] Fix | Delete
"jQXHR.success is deprecated and removed" );
[309] Fix | Delete
migrateWarnFunc( jQXHR, "error", jQXHR.fail,
[310] Fix | Delete
"jQXHR.error is deprecated and removed" );
[311] Fix | Delete
migrateWarnFunc( jQXHR, "complete", jQXHR.always,
[312] Fix | Delete
"jQXHR.complete is deprecated and removed" );
[313] Fix | Delete
}
[314] Fix | Delete
[315] Fix | Delete
return jQXHR;
[316] Fix | Delete
};
[317] Fix | Delete
[318] Fix | Delete
// Only trigger the logic in jQuery <4 as the JSON-to-JSONP auto-promotion
[319] Fix | Delete
// behavior is gone in jQuery 4.0 and as it has security implications, we don't
[320] Fix | Delete
// want to restore the legacy behavior.
[321] Fix | Delete
if ( !jQueryVersionSince( "4.0.0" ) ) {
[322] Fix | Delete
[323] Fix | Delete
// Register this prefilter before the jQuery one. Otherwise, a promoted
[324] Fix | Delete
// request is transformed into one with the script dataType and we can't
[325] Fix | Delete
// catch it anymore.
[326] Fix | Delete
jQuery.ajaxPrefilter( "+json", function( s ) {
[327] Fix | Delete
[328] Fix | Delete
// Warn if JSON-to-JSONP auto-promotion happens.
[329] Fix | Delete
if ( s.jsonp !== false && ( rjsonp.test( s.url ) ||
[330] Fix | Delete
typeof s.data === "string" &&
[331] Fix | Delete
( s.contentType || "" )
[332] Fix | Delete
.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
[333] Fix | Delete
rjsonp.test( s.data )
[334] Fix | Delete
) ) {
[335] Fix | Delete
migrateWarn( "JSON-to-JSONP auto-promotion is deprecated" );
[336] Fix | Delete
}
[337] Fix | Delete
} );
[338] Fix | Delete
}
[339] Fix | Delete
[340] Fix | Delete
}
[341] Fix | Delete
[342] Fix | Delete
var oldRemoveAttr = jQuery.fn.removeAttr,
[343] Fix | Delete
oldToggleClass = jQuery.fn.toggleClass,
[344] Fix | Delete
rmatchNonSpace = /\S+/g;
[345] Fix | Delete
[346] Fix | Delete
jQuery.fn.removeAttr = function( name ) {
[347] Fix | Delete
var self = this;
[348] Fix | Delete
[349] Fix | Delete
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) {
[350] Fix | Delete
if ( jQuery.expr.match.bool.test( attr ) ) {
[351] Fix | Delete
migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
[352] Fix | Delete
self.prop( attr, false );
[353] Fix | Delete
}
[354] Fix | Delete
} );
[355] Fix | Delete
[356] Fix | Delete
return oldRemoveAttr.apply( this, arguments );
[357] Fix | Delete
};
[358] Fix | Delete
[359] Fix | Delete
jQuery.fn.toggleClass = function( state ) {
[360] Fix | Delete
[361] Fix | Delete
// Only deprecating no-args or single boolean arg
[362] Fix | Delete
if ( state !== undefined && typeof state !== "boolean" ) {
[363] Fix | Delete
return oldToggleClass.apply( this, arguments );
[364] Fix | Delete
}
[365] Fix | Delete
[366] Fix | Delete
migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" );
[367] Fix | Delete
[368] Fix | Delete
// Toggle entire class name of each element
[369] Fix | Delete
return this.each( function() {
[370] Fix | Delete
var className = this.getAttribute && this.getAttribute( "class" ) || "";
[371] Fix | Delete
[372] Fix | Delete
if ( className ) {
[373] Fix | Delete
jQuery.data( this, "__className__", className );
[374] Fix | Delete
}
[375] Fix | Delete
[376] Fix | Delete
// If the element has a class name or if we're passed `false`,
[377] Fix | Delete
// then remove the whole classname (if there was one, the above saved it).
[378] Fix | Delete
// Otherwise bring back whatever was previously saved (if anything),
[379] Fix | Delete
// falling back to the empty string if nothing was stored.
[380] Fix | Delete
if ( this.setAttribute ) {
[381] Fix | Delete
this.setAttribute( "class",
[382] Fix | Delete
className || state === false ?
[383] Fix | Delete
"" :
[384] Fix | Delete
jQuery.data( this, "__className__" ) || ""
[385] Fix | Delete
);
[386] Fix | Delete
}
[387] Fix | Delete
} );
[388] Fix | Delete
};
[389] Fix | Delete
[390] Fix | Delete
function camelCase( string ) {
[391] Fix | Delete
return string.replace( /-([a-z])/g, function( _, letter ) {
[392] Fix | Delete
return letter.toUpperCase();
[393] Fix | Delete
} );
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
var oldFnCss,
[397] Fix | Delete
internalSwapCall = false,
[398] Fix | Delete
ralphaStart = /^[a-z]/,
[399] Fix | Delete
[400] Fix | Delete
// The regex visualized:
[401] Fix | Delete
//
[402] Fix | Delete
// /----------\
[403] Fix | Delete
// | | /-------\
[404] Fix | Delete
// | / Top \ | | |
[405] Fix | Delete
// /--- Border ---+-| Right |-+---+- Width -+---\
[406] Fix | Delete
// | | Bottom | |
[407] Fix | Delete
// | \ Left / |
[408] Fix | Delete
// | |
[409] Fix | Delete
// | /----------\ |
[410] Fix | Delete
// | /-------------\ | | |- END
[411] Fix | Delete
// | | | | / Top \ | |
[412] Fix | Delete
// | | / Margin \ | | | Right | | |
[413] Fix | Delete
// |---------+-| |-+---+-| Bottom |-+----|
[414] Fix | Delete
// | \ Padding / \ Left / |
[415] Fix | Delete
// BEGIN -| |
[416] Fix | Delete
// | /---------\ |
[417] Fix | Delete
// | | | |
[418] Fix | Delete
// | | / Min \ | / Width \ |
[419] Fix | Delete
// \--------------+-| |-+---| |---/
[420] Fix | Delete
// \ Max / \ Height /
[421] Fix | Delete
rautoPx = /^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;
[422] Fix | Delete
[423] Fix | Delete
// If this version of jQuery has .swap(), don't false-alarm on internal uses
[424] Fix | Delete
if ( jQuery.swap ) {
[425] Fix | Delete
jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
[426] Fix | Delete
var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;
[427] Fix | Delete
[428] Fix | Delete
if ( oldHook ) {
[429] Fix | Delete
jQuery.cssHooks[ name ].get = function() {
[430] Fix | Delete
var ret;
[431] Fix | Delete
[432] Fix | Delete
internalSwapCall = true;
[433] Fix | Delete
ret = oldHook.apply( this, arguments );
[434] Fix | Delete
internalSwapCall = false;
[435] Fix | Delete
return ret;
[436] Fix | Delete
};
[437] Fix | Delete
}
[438] Fix | Delete
} );
[439] Fix | Delete
}
[440] Fix | Delete
[441] Fix | Delete
jQuery.swap = function( elem, options, callback, args ) {
[442] Fix | Delete
var ret, name,
[443] Fix | Delete
old = {};
[444] Fix | Delete
[445] Fix | Delete
if ( !internalSwapCall ) {
[446] Fix | Delete
migrateWarn( "jQuery.swap() is undocumented and deprecated" );
[447] Fix | Delete
}
[448] Fix | Delete
[449] Fix | Delete
// Remember the old values, and insert the new ones
[450] Fix | Delete
for ( name in options ) {
[451] Fix | Delete
old[ name ] = elem.style[ name ];
[452] Fix | Delete
elem.style[ name ] = options[ name ];
[453] Fix | Delete
}
[454] Fix | Delete
[455] Fix | Delete
ret = callback.apply( elem, args || [] );
[456] Fix | Delete
[457] Fix | Delete
// Revert the old values
[458] Fix | Delete
for ( name in options ) {
[459] Fix | Delete
elem.style[ name ] = old[ name ];
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
return ret;
[463] Fix | Delete
};
[464] Fix | Delete
[465] Fix | Delete
if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) {
[466] Fix | Delete
[467] Fix | Delete
jQuery.cssProps = new Proxy( jQuery.cssProps || {}, {
[468] Fix | Delete
set: function() {
[469] Fix | Delete
migrateWarn( "JQMIGRATE: jQuery.cssProps is deprecated" );
[470] Fix | Delete
return Reflect.set.apply( this, arguments );
[471] Fix | Delete
}
[472] Fix | Delete
} );
[473] Fix | Delete
}
[474] Fix | Delete
[475] Fix | Delete
// Create a dummy jQuery.cssNumber if missing. It won't be used by jQuery but
[476] Fix | Delete
// it will prevent code adding new keys to it unconditionally from crashing.
[477] Fix | Delete
if ( !jQuery.cssNumber ) {
[478] Fix | Delete
jQuery.cssNumber = {};
[479] Fix | Delete
}
[480] Fix | Delete
[481] Fix | Delete
function isAutoPx( prop ) {
[482] Fix | Delete
[483] Fix | Delete
// The first test is used to ensure that:
[484] Fix | Delete
// 1. The prop starts with a lowercase letter (as we uppercase it for the second regex).
[485] Fix | Delete
// 2. The prop is not empty.
[486] Fix | Delete
return ralphaStart.test( prop ) &&
[487] Fix | Delete
rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) );
[488] Fix | Delete
}
[489] Fix | Delete
[490] Fix | Delete
oldFnCss = jQuery.fn.css;
[491] Fix | Delete
[492] Fix | Delete
jQuery.fn.css = function( name, value ) {
[493] Fix | Delete
var camelName,
[494] Fix | Delete
origThis = this;
[495] Fix | Delete
if ( name && typeof name === "object" && !Array.isArray( name ) ) {
[496] Fix | Delete
jQuery.each( name, function( n, v ) {
[497] Fix | Delete
jQuery.fn.css.call( origThis, n, v );
[498] Fix | Delete
} );
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function