Edit File by line
/home/zeestwma/richards.../wp-inclu.../js/jquery
File: jquery-migrate.js
/*!
[0] Fix | Delete
* jQuery Migrate - v3.4.1 - 2023-02-23T15:31Z
[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.4.1";
[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
// A map from disabled patch codes to `true`. This should really
[50] Fix | Delete
// be a `Set` but those are unsupported in IE.
[51] Fix | Delete
var disabledPatches = Object.create( null );
[52] Fix | Delete
[53] Fix | Delete
// Don't apply patches for specified codes. Helpful for code bases
[54] Fix | Delete
// where some Migrate warnings have been addressed and it's desirable
[55] Fix | Delete
// to avoid needless patches or false positives.
[56] Fix | Delete
jQuery.migrateDisablePatches = function() {
[57] Fix | Delete
var i;
[58] Fix | Delete
for ( i = 0; i < arguments.length; i++ ) {
[59] Fix | Delete
disabledPatches[ arguments[ i ] ] = true;
[60] Fix | Delete
}
[61] Fix | Delete
};
[62] Fix | Delete
[63] Fix | Delete
// Allow enabling patches disabled via `jQuery.migrateDisablePatches`.
[64] Fix | Delete
// Helpful if you want to disable a patch only for some code that won't
[65] Fix | Delete
// be updated soon to be able to focus on other warnings - and enable it
[66] Fix | Delete
// immediately after such a call:
[67] Fix | Delete
// ```js
[68] Fix | Delete
// jQuery.migrateDisablePatches( "workaroundA" );
[69] Fix | Delete
// elem.pluginViolatingWarningA( "pluginMethod" );
[70] Fix | Delete
// jQuery.migrateEnablePatches( "workaroundA" );
[71] Fix | Delete
// ```
[72] Fix | Delete
jQuery.migrateEnablePatches = function() {
[73] Fix | Delete
var i;
[74] Fix | Delete
for ( i = 0; i < arguments.length; i++ ) {
[75] Fix | Delete
delete disabledPatches[ arguments[ i ] ];
[76] Fix | Delete
}
[77] Fix | Delete
};
[78] Fix | Delete
[79] Fix | Delete
jQuery.migrateIsPatchEnabled = function( patchCode ) {
[80] Fix | Delete
return !disabledPatches[ patchCode ];
[81] Fix | Delete
};
[82] Fix | Delete
[83] Fix | Delete
( function() {
[84] Fix | Delete
[85] Fix | Delete
// Support: IE9 only
[86] Fix | Delete
// IE9 only creates console object when dev tools are first opened
[87] Fix | Delete
// IE9 console is a host object, callable but doesn't have .apply()
[88] Fix | Delete
if ( !window.console || !window.console.log ) {
[89] Fix | Delete
return;
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
// Need jQuery 3.x-4.x and no older Migrate loaded
[93] Fix | Delete
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ||
[94] Fix | Delete
jQueryVersionSince( "5.0.0" ) ) {
[95] Fix | Delete
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" );
[96] Fix | Delete
}
[97] Fix | Delete
if ( jQuery.migrateWarnings ) {
[98] Fix | Delete
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" );
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
// Show a message on the console so devs know we're active
[102] Fix | Delete
window.console.log( "JQMIGRATE: Migrate is installed" +
[103] Fix | Delete
( jQuery.migrateMute ? "" : " with logging active" ) +
[104] Fix | Delete
", version " + jQuery.migrateVersion );
[105] Fix | Delete
[106] Fix | Delete
} )();
[107] Fix | Delete
[108] Fix | Delete
var warnedAbout = {};
[109] Fix | Delete
[110] Fix | Delete
// By default each warning is only reported once.
[111] Fix | Delete
jQuery.migrateDeduplicateWarnings = true;
[112] Fix | Delete
[113] Fix | Delete
// List of warnings already given; public read only
[114] Fix | Delete
jQuery.migrateWarnings = [];
[115] Fix | Delete
[116] Fix | Delete
// Set to false to disable traces that appear with warnings
[117] Fix | Delete
if ( jQuery.migrateTrace === undefined ) {
[118] Fix | Delete
jQuery.migrateTrace = true;
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
// Forget any warnings we've already given; public
[122] Fix | Delete
jQuery.migrateReset = function() {
[123] Fix | Delete
warnedAbout = {};
[124] Fix | Delete
jQuery.migrateWarnings.length = 0;
[125] Fix | Delete
};
[126] Fix | Delete
[127] Fix | Delete
function migrateWarn( code, msg ) {
[128] Fix | Delete
var console = window.console;
[129] Fix | Delete
if ( jQuery.migrateIsPatchEnabled( code ) &&
[130] Fix | Delete
( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) ) {
[131] Fix | Delete
warnedAbout[ msg ] = true;
[132] Fix | Delete
jQuery.migrateWarnings.push( msg + " [" + code + "]" );
[133] Fix | Delete
if ( console && console.warn && !jQuery.migrateMute ) {
[134] Fix | Delete
console.warn( "JQMIGRATE: " + msg );
[135] Fix | Delete
if ( jQuery.migrateTrace && console.trace ) {
[136] Fix | Delete
console.trace();
[137] Fix | Delete
}
[138] Fix | Delete
}
[139] Fix | Delete
}
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
function migrateWarnProp( obj, prop, value, code, msg ) {
[143] Fix | Delete
Object.defineProperty( obj, prop, {
[144] Fix | Delete
configurable: true,
[145] Fix | Delete
enumerable: true,
[146] Fix | Delete
get: function() {
[147] Fix | Delete
migrateWarn( code, msg );
[148] Fix | Delete
return value;
[149] Fix | Delete
},
[150] Fix | Delete
set: function( newValue ) {
[151] Fix | Delete
migrateWarn( code, msg );
[152] Fix | Delete
value = newValue;
[153] Fix | Delete
}
[154] Fix | Delete
} );
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
function migrateWarnFuncInternal( obj, prop, newFunc, code, msg ) {
[158] Fix | Delete
var finalFunc,
[159] Fix | Delete
origFunc = obj[ prop ];
[160] Fix | Delete
[161] Fix | Delete
obj[ prop ] = function() {
[162] Fix | Delete
[163] Fix | Delete
// If `msg` not provided, do not warn; more sophisticated warnings
[164] Fix | Delete
// logic is most likely embedded in `newFunc`, in that case here
[165] Fix | Delete
// we just care about the logic choosing the proper implementation
[166] Fix | Delete
// based on whether the patch is disabled or not.
[167] Fix | Delete
if ( msg ) {
[168] Fix | Delete
migrateWarn( code, msg );
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
// Since patches can be disabled & enabled dynamically, we
[172] Fix | Delete
// need to decide which implementation to run on each invocation.
[173] Fix | Delete
finalFunc = jQuery.migrateIsPatchEnabled( code ) ?
[174] Fix | Delete
newFunc :
[175] Fix | Delete
[176] Fix | Delete
// The function may not have existed originally so we need a fallback.
[177] Fix | Delete
( origFunc || jQuery.noop );
[178] Fix | Delete
[179] Fix | Delete
return finalFunc.apply( this, arguments );
[180] Fix | Delete
};
[181] Fix | Delete
}
[182] Fix | Delete
[183] Fix | Delete
function migratePatchAndWarnFunc( obj, prop, newFunc, code, msg ) {
[184] Fix | Delete
if ( !msg ) {
[185] Fix | Delete
throw new Error( "No warning message provided" );
[186] Fix | Delete
}
[187] Fix | Delete
return migrateWarnFuncInternal( obj, prop, newFunc, code, msg );
[188] Fix | Delete
}
[189] Fix | Delete
[190] Fix | Delete
function migratePatchFunc( obj, prop, newFunc, code ) {
[191] Fix | Delete
return migrateWarnFuncInternal( obj, prop, newFunc, code );
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
if ( window.document.compatMode === "BackCompat" ) {
[195] Fix | Delete
[196] Fix | Delete
// jQuery has never supported or tested Quirks Mode
[197] Fix | Delete
migrateWarn( "quirks", "jQuery is not compatible with Quirks Mode" );
[198] Fix | Delete
}
[199] Fix | Delete
[200] Fix | Delete
var findProp,
[201] Fix | Delete
class2type = {},
[202] Fix | Delete
oldInit = jQuery.fn.init,
[203] Fix | Delete
oldFind = jQuery.find,
[204] Fix | Delete
[205] Fix | Delete
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
[206] Fix | Delete
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,
[207] Fix | Delete
[208] Fix | Delete
// Require that the "whitespace run" starts from a non-whitespace
[209] Fix | Delete
// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
[210] Fix | Delete
rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
[211] Fix | Delete
[212] Fix | Delete
migratePatchFunc( jQuery.fn, "init", function( arg1 ) {
[213] Fix | Delete
var args = Array.prototype.slice.call( arguments );
[214] Fix | Delete
[215] Fix | Delete
if ( jQuery.migrateIsPatchEnabled( "selector-empty-id" ) &&
[216] Fix | Delete
typeof arg1 === "string" && arg1 === "#" ) {
[217] Fix | Delete
[218] Fix | Delete
// JQuery( "#" ) is a bogus ID selector, but it returned an empty set
[219] Fix | Delete
// before jQuery 3.0
[220] Fix | Delete
migrateWarn( "selector-empty-id", "jQuery( '#' ) is not a valid selector" );
[221] Fix | Delete
args[ 0 ] = [];
[222] Fix | Delete
}
[223] Fix | Delete
[224] Fix | Delete
return oldInit.apply( this, args );
[225] Fix | Delete
}, "selector-empty-id" );
[226] Fix | Delete
[227] Fix | Delete
// This is already done in Core but the above patch will lose this assignment
[228] Fix | Delete
// so we need to redo it. It doesn't matter whether the patch is enabled or not
[229] Fix | Delete
// as the method is always going to be a Migrate-created wrapper.
[230] Fix | Delete
jQuery.fn.init.prototype = jQuery.fn;
[231] Fix | Delete
[232] Fix | Delete
migratePatchFunc( jQuery, "find", function( selector ) {
[233] Fix | Delete
var args = Array.prototype.slice.call( arguments );
[234] Fix | Delete
[235] Fix | Delete
// Support: PhantomJS 1.x
[236] Fix | Delete
// String#match fails to match when used with a //g RegExp, only on some strings
[237] Fix | Delete
if ( typeof selector === "string" && rattrHashTest.test( selector ) ) {
[238] Fix | Delete
[239] Fix | Delete
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
[240] Fix | Delete
// First see if qS thinks it's a valid selector, if so avoid a false positive
[241] Fix | Delete
try {
[242] Fix | Delete
window.document.querySelector( selector );
[243] Fix | Delete
} catch ( err1 ) {
[244] Fix | Delete
[245] Fix | Delete
// Didn't *look* valid to qSA, warn and try quoting what we think is the value
[246] Fix | Delete
selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) {
[247] Fix | Delete
return "[" + attr + op + "\"" + value + "\"]";
[248] Fix | Delete
} );
[249] Fix | Delete
[250] Fix | Delete
// If the regexp *may* have created an invalid selector, don't update it
[251] Fix | Delete
// Note that there may be false alarms if selector uses jQuery extensions
[252] Fix | Delete
try {
[253] Fix | Delete
window.document.querySelector( selector );
[254] Fix | Delete
migrateWarn( "selector-hash",
[255] Fix | Delete
"Attribute selector with '#' must be quoted: " + args[ 0 ] );
[256] Fix | Delete
args[ 0 ] = selector;
[257] Fix | Delete
} catch ( err2 ) {
[258] Fix | Delete
migrateWarn( "selector-hash",
[259] Fix | Delete
"Attribute selector with '#' was not fixed: " + args[ 0 ] );
[260] Fix | Delete
}
[261] Fix | Delete
}
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
return oldFind.apply( this, args );
[265] Fix | Delete
}, "selector-hash" );
[266] Fix | Delete
[267] Fix | Delete
// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
[268] Fix | Delete
for ( findProp in oldFind ) {
[269] Fix | Delete
if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) {
[270] Fix | Delete
jQuery.find[ findProp ] = oldFind[ findProp ];
[271] Fix | Delete
}
[272] Fix | Delete
}
[273] Fix | Delete
[274] Fix | Delete
// The number of elements contained in the matched element set
[275] Fix | Delete
migratePatchAndWarnFunc( jQuery.fn, "size", function() {
[276] Fix | Delete
return this.length;
[277] Fix | Delete
}, "size",
[278] Fix | Delete
"jQuery.fn.size() is deprecated and removed; use the .length property" );
[279] Fix | Delete
[280] Fix | Delete
migratePatchAndWarnFunc( jQuery, "parseJSON", function() {
[281] Fix | Delete
return JSON.parse.apply( null, arguments );
[282] Fix | Delete
}, "parseJSON",
[283] Fix | Delete
"jQuery.parseJSON is deprecated; use JSON.parse" );
[284] Fix | Delete
[285] Fix | Delete
migratePatchAndWarnFunc( jQuery, "holdReady", jQuery.holdReady,
[286] Fix | Delete
"holdReady", "jQuery.holdReady is deprecated" );
[287] Fix | Delete
[288] Fix | Delete
migratePatchAndWarnFunc( jQuery, "unique", jQuery.uniqueSort,
[289] Fix | Delete
"unique", "jQuery.unique is deprecated; use jQuery.uniqueSort" );
[290] Fix | Delete
[291] Fix | Delete
// Now jQuery.expr.pseudos is the standard incantation
[292] Fix | Delete
migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, "expr-pre-pseudos",
[293] Fix | Delete
"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" );
[294] Fix | Delete
migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, "expr-pre-pseudos",
[295] Fix | Delete
"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" );
[296] Fix | Delete
[297] Fix | Delete
// Prior to jQuery 3.1.1 there were internal refs so we don't warn there
[298] Fix | Delete
if ( jQueryVersionSince( "3.1.1" ) ) {
[299] Fix | Delete
migratePatchAndWarnFunc( jQuery, "trim", function( text ) {
[300] Fix | Delete
return text == null ?
[301] Fix | Delete
"" :
[302] Fix | Delete
( text + "" ).replace( rtrim, "$1" );
[303] Fix | Delete
}, "trim",
[304] Fix | Delete
"jQuery.trim is deprecated; use String.prototype.trim" );
[305] Fix | Delete
}
[306] Fix | Delete
[307] Fix | Delete
// Prior to jQuery 3.2 there were internal refs so we don't warn there
[308] Fix | Delete
if ( jQueryVersionSince( "3.2.0" ) ) {
[309] Fix | Delete
migratePatchAndWarnFunc( jQuery, "nodeName", function( elem, name ) {
[310] Fix | Delete
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
[311] Fix | Delete
}, "nodeName",
[312] Fix | Delete
"jQuery.nodeName is deprecated" );
[313] Fix | Delete
[314] Fix | Delete
migratePatchAndWarnFunc( jQuery, "isArray", Array.isArray, "isArray",
[315] Fix | Delete
"jQuery.isArray is deprecated; use Array.isArray"
[316] Fix | Delete
);
[317] Fix | Delete
}
[318] Fix | Delete
[319] Fix | Delete
if ( jQueryVersionSince( "3.3.0" ) ) {
[320] Fix | Delete
[321] Fix | Delete
migratePatchAndWarnFunc( jQuery, "isNumeric", function( obj ) {
[322] Fix | Delete
[323] Fix | Delete
// As of jQuery 3.0, isNumeric is limited to
[324] Fix | Delete
// strings and numbers (primitives or objects)
[325] Fix | Delete
// that can be coerced to finite numbers (gh-2662)
[326] Fix | Delete
var type = typeof obj;
[327] Fix | Delete
return ( type === "number" || type === "string" ) &&
[328] Fix | Delete
[329] Fix | Delete
// parseFloat NaNs numeric-cast false positives ("")
[330] Fix | Delete
// ...but misinterprets leading-number strings, e.g. hex literals ("0x...")
[331] Fix | Delete
// subtraction forces infinities to NaN
[332] Fix | Delete
!isNaN( obj - parseFloat( obj ) );
[333] Fix | Delete
}, "isNumeric",
[334] Fix | Delete
"jQuery.isNumeric() is deprecated"
[335] Fix | Delete
);
[336] Fix | Delete
[337] Fix | Delete
// Populate the class2type map
[338] Fix | Delete
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".
[339] Fix | Delete
split( " " ),
[340] Fix | Delete
function( _, name ) {
[341] Fix | Delete
class2type[ "[object " + name + "]" ] = name.toLowerCase();
[342] Fix | Delete
} );
[343] Fix | Delete
[344] Fix | Delete
migratePatchAndWarnFunc( jQuery, "type", function( obj ) {
[345] Fix | Delete
if ( obj == null ) {
[346] Fix | Delete
return obj + "";
[347] Fix | Delete
}
[348] Fix | Delete
[349] Fix | Delete
// Support: Android <=2.3 only (functionish RegExp)
[350] Fix | Delete
return typeof obj === "object" || typeof obj === "function" ?
[351] Fix | Delete
class2type[ Object.prototype.toString.call( obj ) ] || "object" :
[352] Fix | Delete
typeof obj;
[353] Fix | Delete
}, "type",
[354] Fix | Delete
"jQuery.type is deprecated" );
[355] Fix | Delete
[356] Fix | Delete
migratePatchAndWarnFunc( jQuery, "isFunction",
[357] Fix | Delete
function( obj ) {
[358] Fix | Delete
return typeof obj === "function";
[359] Fix | Delete
}, "isFunction",
[360] Fix | Delete
"jQuery.isFunction() is deprecated" );
[361] Fix | Delete
[362] Fix | Delete
migratePatchAndWarnFunc( jQuery, "isWindow",
[363] Fix | Delete
function( obj ) {
[364] Fix | Delete
return obj != null && obj === obj.window;
[365] Fix | Delete
}, "isWindow",
[366] Fix | Delete
"jQuery.isWindow() is deprecated"
[367] Fix | Delete
);
[368] Fix | Delete
}
[369] Fix | Delete
[370] Fix | Delete
// Support jQuery slim which excludes the ajax module
[371] Fix | Delete
if ( jQuery.ajax ) {
[372] Fix | Delete
[373] Fix | Delete
var oldAjax = jQuery.ajax,
[374] Fix | Delete
rjsonp = /(=)\?(?=&|$)|\?\?/;
[375] Fix | Delete
[376] Fix | Delete
migratePatchFunc( jQuery, "ajax", function() {
[377] Fix | Delete
var jQXHR = oldAjax.apply( this, arguments );
[378] Fix | Delete
[379] Fix | Delete
// Be sure we got a jQXHR (e.g., not sync)
[380] Fix | Delete
if ( jQXHR.promise ) {
[381] Fix | Delete
migratePatchAndWarnFunc( jQXHR, "success", jQXHR.done, "jqXHR-methods",
[382] Fix | Delete
"jQXHR.success is deprecated and removed" );
[383] Fix | Delete
migratePatchAndWarnFunc( jQXHR, "error", jQXHR.fail, "jqXHR-methods",
[384] Fix | Delete
"jQXHR.error is deprecated and removed" );
[385] Fix | Delete
migratePatchAndWarnFunc( jQXHR, "complete", jQXHR.always, "jqXHR-methods",
[386] Fix | Delete
"jQXHR.complete is deprecated and removed" );
[387] Fix | Delete
}
[388] Fix | Delete
[389] Fix | Delete
return jQXHR;
[390] Fix | Delete
}, "jqXHR-methods" );
[391] Fix | Delete
[392] Fix | Delete
// Only trigger the logic in jQuery <4 as the JSON-to-JSONP auto-promotion
[393] Fix | Delete
// behavior is gone in jQuery 4.0 and as it has security implications, we don't
[394] Fix | Delete
// want to restore the legacy behavior.
[395] Fix | Delete
if ( !jQueryVersionSince( "4.0.0" ) ) {
[396] Fix | Delete
[397] Fix | Delete
// Register this prefilter before the jQuery one. Otherwise, a promoted
[398] Fix | Delete
// request is transformed into one with the script dataType and we can't
[399] Fix | Delete
// catch it anymore.
[400] Fix | Delete
jQuery.ajaxPrefilter( "+json", function( s ) {
[401] Fix | Delete
[402] Fix | Delete
// Warn if JSON-to-JSONP auto-promotion happens.
[403] Fix | Delete
if ( s.jsonp !== false && ( rjsonp.test( s.url ) ||
[404] Fix | Delete
typeof s.data === "string" &&
[405] Fix | Delete
( s.contentType || "" )
[406] Fix | Delete
.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
[407] Fix | Delete
rjsonp.test( s.data )
[408] Fix | Delete
) ) {
[409] Fix | Delete
migrateWarn( "jsonp-promotion", "JSON-to-JSONP auto-promotion is deprecated" );
[410] Fix | Delete
}
[411] Fix | Delete
} );
[412] Fix | Delete
}
[413] Fix | Delete
[414] Fix | Delete
}
[415] Fix | Delete
[416] Fix | Delete
var oldRemoveAttr = jQuery.fn.removeAttr,
[417] Fix | Delete
oldToggleClass = jQuery.fn.toggleClass,
[418] Fix | Delete
rmatchNonSpace = /\S+/g;
[419] Fix | Delete
[420] Fix | Delete
migratePatchFunc( jQuery.fn, "removeAttr", function( name ) {
[421] Fix | Delete
var self = this,
[422] Fix | Delete
patchNeeded = false;
[423] Fix | Delete
[424] Fix | Delete
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) {
[425] Fix | Delete
if ( jQuery.expr.match.bool.test( attr ) ) {
[426] Fix | Delete
[427] Fix | Delete
// Only warn if at least a single node had the property set to
[428] Fix | Delete
// something else than `false`. Otherwise, this Migrate patch
[429] Fix | Delete
// doesn't influence the behavior and there's no need to set or warn.
[430] Fix | Delete
self.each( function() {
[431] Fix | Delete
if ( jQuery( this ).prop( attr ) !== false ) {
[432] Fix | Delete
patchNeeded = true;
[433] Fix | Delete
return false;
[434] Fix | Delete
}
[435] Fix | Delete
} );
[436] Fix | Delete
}
[437] Fix | Delete
[438] Fix | Delete
if ( patchNeeded ) {
[439] Fix | Delete
migrateWarn( "removeAttr-bool",
[440] Fix | Delete
"jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
[441] Fix | Delete
self.prop( attr, false );
[442] Fix | Delete
}
[443] Fix | Delete
} );
[444] Fix | Delete
[445] Fix | Delete
return oldRemoveAttr.apply( this, arguments );
[446] Fix | Delete
}, "removeAttr-bool" );
[447] Fix | Delete
[448] Fix | Delete
migratePatchFunc( jQuery.fn, "toggleClass", function( state ) {
[449] Fix | Delete
[450] Fix | Delete
// Only deprecating no-args or single boolean arg
[451] Fix | Delete
if ( state !== undefined && typeof state !== "boolean" ) {
[452] Fix | Delete
[453] Fix | Delete
return oldToggleClass.apply( this, arguments );
[454] Fix | Delete
}
[455] Fix | Delete
[456] Fix | Delete
migrateWarn( "toggleClass-bool", "jQuery.fn.toggleClass( boolean ) is deprecated" );
[457] Fix | Delete
[458] Fix | Delete
// Toggle entire class name of each element
[459] Fix | Delete
return this.each( function() {
[460] Fix | Delete
var className = this.getAttribute && this.getAttribute( "class" ) || "";
[461] Fix | Delete
[462] Fix | Delete
if ( className ) {
[463] Fix | Delete
jQuery.data( this, "__className__", className );
[464] Fix | Delete
}
[465] Fix | Delete
[466] Fix | Delete
// If the element has a class name or if we're passed `false`,
[467] Fix | Delete
// then remove the whole classname (if there was one, the above saved it).
[468] Fix | Delete
// Otherwise bring back whatever was previously saved (if anything),
[469] Fix | Delete
// falling back to the empty string if nothing was stored.
[470] Fix | Delete
if ( this.setAttribute ) {
[471] Fix | Delete
this.setAttribute( "class",
[472] Fix | Delete
className || state === false ?
[473] Fix | Delete
"" :
[474] Fix | Delete
jQuery.data( this, "__className__" ) || ""
[475] Fix | Delete
);
[476] Fix | Delete
}
[477] Fix | Delete
} );
[478] Fix | Delete
}, "toggleClass-bool" );
[479] Fix | Delete
[480] Fix | Delete
function camelCase( string ) {
[481] Fix | Delete
return string.replace( /-([a-z])/g, function( _, letter ) {
[482] Fix | Delete
return letter.toUpperCase();
[483] Fix | Delete
} );
[484] Fix | Delete
}
[485] Fix | Delete
[486] Fix | Delete
var origFnCss, internalCssNumber,
[487] Fix | Delete
internalSwapCall = false,
[488] Fix | Delete
ralphaStart = /^[a-z]/,
[489] Fix | Delete
[490] Fix | Delete
// The regex visualized:
[491] Fix | Delete
//
[492] Fix | Delete
// /----------\
[493] Fix | Delete
// | | /-------\
[494] Fix | Delete
// | / Top \ | | |
[495] Fix | Delete
// /--- Border ---+-| Right |-+---+- Width -+---\
[496] Fix | Delete
// | | Bottom | |
[497] Fix | Delete
// | \ Left / |
[498] Fix | Delete
// | |
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function