author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 18 | be944660c56a |
permissions | -rw-r--r-- |
18 | 1 |
/*! |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
2 |
* jQuery Migrate - v3.4.1 - 2023-02-23T15:31Z |
18 | 3 |
* Copyright OpenJS Foundation and other contributors |
4 |
*/ |
|
5 |
( function( factory ) { |
|
6 |
"use strict"; |
|
7 |
||
8 |
if ( typeof define === "function" && define.amd ) { |
|
9 |
||
10 |
// AMD. Register as an anonymous module. |
|
11 |
define( [ "jquery" ], function( jQuery ) { |
|
12 |
return factory( jQuery, window ); |
|
13 |
} ); |
|
14 |
} else if ( typeof module === "object" && module.exports ) { |
|
15 |
||
16 |
// Node/CommonJS |
|
17 |
// eslint-disable-next-line no-undef |
|
18 |
module.exports = factory( require( "jquery" ), window ); |
|
19 |
} else { |
|
20 |
||
21 |
// Browser globals |
|
22 |
factory( jQuery, window ); |
|
23 |
} |
|
24 |
} )( function( jQuery, window ) { |
|
25 |
"use strict"; |
|
26 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
27 |
jQuery.migrateVersion = "3.4.1"; |
18 | 28 |
|
29 |
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 |
|
30 |
function compareVersions( v1, v2 ) { |
|
31 |
var i, |
|
32 |
rVersionParts = /^(\d+)\.(\d+)\.(\d+)/, |
|
33 |
v1p = rVersionParts.exec( v1 ) || [ ], |
|
34 |
v2p = rVersionParts.exec( v2 ) || [ ]; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
35 |
|
18 | 36 |
for ( i = 1; i <= 3; i++ ) { |
37 |
if ( +v1p[ i ] > +v2p[ i ] ) { |
|
38 |
return 1; |
|
39 |
} |
|
40 |
if ( +v1p[ i ] < +v2p[ i ] ) { |
|
41 |
return -1; |
|
42 |
} |
|
43 |
} |
|
44 |
return 0; |
|
45 |
} |
|
46 |
||
47 |
function jQueryVersionSince( version ) { |
|
48 |
return compareVersions( jQuery.fn.jquery, version ) >= 0; |
|
49 |
} |
|
50 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
51 |
// A map from disabled patch codes to `true`. This should really |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
52 |
// be a `Set` but those are unsupported in IE. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
53 |
var disabledPatches = Object.create( null ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
54 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
55 |
// Don't apply patches for specified codes. Helpful for code bases |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
56 |
// where some Migrate warnings have been addressed and it's desirable |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
57 |
// to avoid needless patches or false positives. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
58 |
jQuery.migrateDisablePatches = function() { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
59 |
var i; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
60 |
for ( i = 0; i < arguments.length; i++ ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
61 |
disabledPatches[ arguments[ i ] ] = true; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
62 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
63 |
}; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
64 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
65 |
// Allow enabling patches disabled via `jQuery.migrateDisablePatches`. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
66 |
// Helpful if you want to disable a patch only for some code that won't |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
67 |
// be updated soon to be able to focus on other warnings - and enable it |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
68 |
// immediately after such a call: |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
69 |
// ```js |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
70 |
// jQuery.migrateDisablePatches( "workaroundA" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
71 |
// elem.pluginViolatingWarningA( "pluginMethod" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
72 |
// jQuery.migrateEnablePatches( "workaroundA" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
73 |
// ``` |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
74 |
jQuery.migrateEnablePatches = function() { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
75 |
var i; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
76 |
for ( i = 0; i < arguments.length; i++ ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
77 |
delete disabledPatches[ arguments[ i ] ]; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
78 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
79 |
}; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
80 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
81 |
jQuery.migrateIsPatchEnabled = function( patchCode ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
82 |
return !disabledPatches[ patchCode ]; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
83 |
}; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
84 |
|
18 | 85 |
( function() { |
86 |
||
87 |
// Support: IE9 only |
|
88 |
// IE9 only creates console object when dev tools are first opened |
|
89 |
// IE9 console is a host object, callable but doesn't have .apply() |
|
90 |
if ( !window.console || !window.console.log ) { |
|
91 |
return; |
|
92 |
} |
|
93 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
94 |
// Need jQuery 3.x-4.x and no older Migrate loaded |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
95 |
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) || |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
96 |
jQueryVersionSince( "5.0.0" ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
97 |
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" ); |
18 | 98 |
} |
99 |
if ( jQuery.migrateWarnings ) { |
|
100 |
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); |
|
101 |
} |
|
102 |
||
103 |
// Show a message on the console so devs know we're active |
|
104 |
window.console.log( "JQMIGRATE: Migrate is installed" + |
|
105 |
( jQuery.migrateMute ? "" : " with logging active" ) + |
|
106 |
", version " + jQuery.migrateVersion ); |
|
107 |
||
108 |
} )(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
109 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
110 |
var warnedAbout = {}; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
111 |
|
18 | 112 |
// By default each warning is only reported once. |
113 |
jQuery.migrateDeduplicateWarnings = true; |
|
114 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
115 |
// List of warnings already given; public read only |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
116 |
jQuery.migrateWarnings = []; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
117 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
118 |
// Set to false to disable traces that appear with warnings |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
119 |
if ( jQuery.migrateTrace === undefined ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
120 |
jQuery.migrateTrace = true; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
121 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
122 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
123 |
// Forget any warnings we've already given; public |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
124 |
jQuery.migrateReset = function() { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
125 |
warnedAbout = {}; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
126 |
jQuery.migrateWarnings.length = 0; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
127 |
}; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
128 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
129 |
function migrateWarn( code, msg ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
130 |
var console = window.console; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
131 |
if ( jQuery.migrateIsPatchEnabled( code ) && |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
132 |
( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
133 |
warnedAbout[ msg ] = true; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
134 |
jQuery.migrateWarnings.push( msg + " [" + code + "]" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
135 |
if ( console && console.warn && !jQuery.migrateMute ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
136 |
console.warn( "JQMIGRATE: " + msg ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
137 |
if ( jQuery.migrateTrace && console.trace ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
138 |
console.trace(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
139 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
140 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
141 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
142 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
143 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
144 |
function migrateWarnProp( obj, prop, value, code, msg ) { |
18 | 145 |
Object.defineProperty( obj, prop, { |
146 |
configurable: true, |
|
147 |
enumerable: true, |
|
148 |
get: function() { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
149 |
migrateWarn( code, msg ); |
18 | 150 |
return value; |
151 |
}, |
|
152 |
set: function( newValue ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
153 |
migrateWarn( code, msg ); |
18 | 154 |
value = newValue; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
155 |
} |
18 | 156 |
} ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
157 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
158 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
159 |
function migrateWarnFuncInternal( obj, prop, newFunc, code, msg ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
160 |
var finalFunc, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
161 |
origFunc = obj[ prop ]; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
162 |
|
18 | 163 |
obj[ prop ] = function() { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
164 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
165 |
// If `msg` not provided, do not warn; more sophisticated warnings |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
166 |
// logic is most likely embedded in `newFunc`, in that case here |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
167 |
// we just care about the logic choosing the proper implementation |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
168 |
// based on whether the patch is disabled or not. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
169 |
if ( msg ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
170 |
migrateWarn( code, msg ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
171 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
172 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
173 |
// Since patches can be disabled & enabled dynamically, we |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
174 |
// need to decide which implementation to run on each invocation. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
175 |
finalFunc = jQuery.migrateIsPatchEnabled( code ) ? |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
176 |
newFunc : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
177 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
178 |
// The function may not have existed originally so we need a fallback. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
179 |
( origFunc || jQuery.noop ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
180 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
181 |
return finalFunc.apply( this, arguments ); |
18 | 182 |
}; |
183 |
} |
|
184 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
185 |
function migratePatchAndWarnFunc( obj, prop, newFunc, code, msg ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
186 |
if ( !msg ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
187 |
throw new Error( "No warning message provided" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
188 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
189 |
return migrateWarnFuncInternal( obj, prop, newFunc, code, msg ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
190 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
191 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
192 |
function migratePatchFunc( obj, prop, newFunc, code ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
193 |
return migrateWarnFuncInternal( obj, prop, newFunc, code ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
194 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
195 |
|
18 | 196 |
if ( window.document.compatMode === "BackCompat" ) { |
197 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
198 |
// jQuery has never supported or tested Quirks Mode |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
199 |
migrateWarn( "quirks", "jQuery is not compatible with Quirks Mode" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
200 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
201 |
|
18 | 202 |
var findProp, |
203 |
class2type = {}, |
|
204 |
oldInit = jQuery.fn.init, |
|
205 |
oldFind = jQuery.find, |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
206 |
|
18 | 207 |
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, |
208 |
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g, |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
209 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
210 |
// Require that the "whitespace run" starts from a non-whitespace |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
211 |
// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
212 |
rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
213 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
214 |
migratePatchFunc( jQuery.fn, "init", function( arg1 ) { |
18 | 215 |
var args = Array.prototype.slice.call( arguments ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
216 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
217 |
if ( jQuery.migrateIsPatchEnabled( "selector-empty-id" ) && |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
218 |
typeof arg1 === "string" && arg1 === "#" ) { |
18 | 219 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
220 |
// JQuery( "#" ) is a bogus ID selector, but it returned an empty set |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
221 |
// before jQuery 3.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
222 |
migrateWarn( "selector-empty-id", "jQuery( '#' ) is not a valid selector" ); |
18 | 223 |
args[ 0 ] = []; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
224 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
225 |
|
18 | 226 |
return oldInit.apply( this, args ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
227 |
}, "selector-empty-id" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
228 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
229 |
// This is already done in Core but the above patch will lose this assignment |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
230 |
// so we need to redo it. It doesn't matter whether the patch is enabled or not |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
231 |
// as the method is always going to be a Migrate-created wrapper. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
232 |
jQuery.fn.init.prototype = jQuery.fn; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
233 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
234 |
migratePatchFunc( jQuery, "find", function( selector ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
235 |
var args = Array.prototype.slice.call( arguments ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
236 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
237 |
// Support: PhantomJS 1.x |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
238 |
// String#match fails to match when used with a //g RegExp, only on some strings |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
239 |
if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
240 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
241 |
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
242 |
// First see if qS thinks it's a valid selector, if so avoid a false positive |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
243 |
try { |
18 | 244 |
window.document.querySelector( selector ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
245 |
} catch ( err1 ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
246 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
247 |
// Didn't *look* valid to qSA, warn and try quoting what we think is the value |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
248 |
selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
249 |
return "[" + attr + op + "\"" + value + "\"]"; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
250 |
} ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
251 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
252 |
// If the regexp *may* have created an invalid selector, don't update it |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
253 |
// Note that there may be false alarms if selector uses jQuery extensions |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
254 |
try { |
18 | 255 |
window.document.querySelector( selector ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
256 |
migrateWarn( "selector-hash", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
257 |
"Attribute selector with '#' must be quoted: " + args[ 0 ] ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
258 |
args[ 0 ] = selector; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
259 |
} catch ( err2 ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
260 |
migrateWarn( "selector-hash", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
261 |
"Attribute selector with '#' was not fixed: " + args[ 0 ] ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
262 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
263 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
264 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
265 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
266 |
return oldFind.apply( this, args ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
267 |
}, "selector-hash" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
268 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
269 |
// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
270 |
for ( findProp in oldFind ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
271 |
if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
272 |
jQuery.find[ findProp ] = oldFind[ findProp ]; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
273 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
274 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
275 |
|
18 | 276 |
// The number of elements contained in the matched element set |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
277 |
migratePatchAndWarnFunc( jQuery.fn, "size", function() { |
18 | 278 |
return this.length; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
279 |
}, "size", |
18 | 280 |
"jQuery.fn.size() is deprecated and removed; use the .length property" ); |
281 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
282 |
migratePatchAndWarnFunc( jQuery, "parseJSON", function() { |
18 | 283 |
return JSON.parse.apply( null, arguments ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
284 |
}, "parseJSON", |
18 | 285 |
"jQuery.parseJSON is deprecated; use JSON.parse" ); |
286 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
287 |
migratePatchAndWarnFunc( jQuery, "holdReady", jQuery.holdReady, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
288 |
"holdReady", "jQuery.holdReady is deprecated" ); |
18 | 289 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
290 |
migratePatchAndWarnFunc( jQuery, "unique", jQuery.uniqueSort, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
291 |
"unique", "jQuery.unique is deprecated; use jQuery.uniqueSort" ); |
18 | 292 |
|
293 |
// Now jQuery.expr.pseudos is the standard incantation |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
294 |
migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, "expr-pre-pseudos", |
18 | 295 |
"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
296 |
migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, "expr-pre-pseudos", |
18 | 297 |
"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
298 |
|
18 | 299 |
// Prior to jQuery 3.1.1 there were internal refs so we don't warn there |
300 |
if ( jQueryVersionSince( "3.1.1" ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
301 |
migratePatchAndWarnFunc( jQuery, "trim", function( text ) { |
18 | 302 |
return text == null ? |
303 |
"" : |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
304 |
( text + "" ).replace( rtrim, "$1" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
305 |
}, "trim", |
18 | 306 |
"jQuery.trim is deprecated; use String.prototype.trim" ); |
307 |
} |
|
308 |
||
309 |
// Prior to jQuery 3.2 there were internal refs so we don't warn there |
|
310 |
if ( jQueryVersionSince( "3.2.0" ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
311 |
migratePatchAndWarnFunc( jQuery, "nodeName", function( elem, name ) { |
18 | 312 |
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
313 |
}, "nodeName", |
18 | 314 |
"jQuery.nodeName is deprecated" ); |
315 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
316 |
migratePatchAndWarnFunc( jQuery, "isArray", Array.isArray, "isArray", |
18 | 317 |
"jQuery.isArray is deprecated; use Array.isArray" |
318 |
); |
|
319 |
} |
|
320 |
||
321 |
if ( jQueryVersionSince( "3.3.0" ) ) { |
|
322 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
323 |
migratePatchAndWarnFunc( jQuery, "isNumeric", function( obj ) { |
18 | 324 |
|
325 |
// As of jQuery 3.0, isNumeric is limited to |
|
326 |
// strings and numbers (primitives or objects) |
|
327 |
// that can be coerced to finite numbers (gh-2662) |
|
328 |
var type = typeof obj; |
|
329 |
return ( type === "number" || type === "string" ) && |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
330 |
|
18 | 331 |
// parseFloat NaNs numeric-cast false positives ("") |
332 |
// ...but misinterprets leading-number strings, e.g. hex literals ("0x...") |
|
333 |
// subtraction forces infinities to NaN |
|
334 |
!isNaN( obj - parseFloat( obj ) ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
335 |
}, "isNumeric", |
18 | 336 |
"jQuery.isNumeric() is deprecated" |
337 |
); |
|
338 |
||
339 |
// Populate the class2type map |
|
340 |
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol". |
|
341 |
split( " " ), |
|
342 |
function( _, name ) { |
|
343 |
class2type[ "[object " + name + "]" ] = name.toLowerCase(); |
|
344 |
} ); |
|
345 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
346 |
migratePatchAndWarnFunc( jQuery, "type", function( obj ) { |
18 | 347 |
if ( obj == null ) { |
348 |
return obj + ""; |
|
349 |
} |
|
350 |
||
351 |
// Support: Android <=2.3 only (functionish RegExp) |
|
352 |
return typeof obj === "object" || typeof obj === "function" ? |
|
353 |
class2type[ Object.prototype.toString.call( obj ) ] || "object" : |
|
354 |
typeof obj; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
355 |
}, "type", |
18 | 356 |
"jQuery.type is deprecated" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
357 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
358 |
migratePatchAndWarnFunc( jQuery, "isFunction", |
18 | 359 |
function( obj ) { |
360 |
return typeof obj === "function"; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
361 |
}, "isFunction", |
18 | 362 |
"jQuery.isFunction() is deprecated" ); |
363 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
364 |
migratePatchAndWarnFunc( jQuery, "isWindow", |
18 | 365 |
function( obj ) { |
366 |
return obj != null && obj === obj.window; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
367 |
}, "isWindow", |
18 | 368 |
"jQuery.isWindow() is deprecated" |
369 |
); |
|
370 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
371 |
|
18 | 372 |
// Support jQuery slim which excludes the ajax module |
373 |
if ( jQuery.ajax ) { |
|
374 |
||
375 |
var oldAjax = jQuery.ajax, |
|
376 |
rjsonp = /(=)\?(?=&|$)|\?\?/; |
|
377 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
378 |
migratePatchFunc( jQuery, "ajax", function() { |
18 | 379 |
var jQXHR = oldAjax.apply( this, arguments ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
380 |
|
18 | 381 |
// Be sure we got a jQXHR (e.g., not sync) |
382 |
if ( jQXHR.promise ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
383 |
migratePatchAndWarnFunc( jQXHR, "success", jQXHR.done, "jqXHR-methods", |
18 | 384 |
"jQXHR.success is deprecated and removed" ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
385 |
migratePatchAndWarnFunc( jQXHR, "error", jQXHR.fail, "jqXHR-methods", |
18 | 386 |
"jQXHR.error is deprecated and removed" ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
387 |
migratePatchAndWarnFunc( jQXHR, "complete", jQXHR.always, "jqXHR-methods", |
18 | 388 |
"jQXHR.complete is deprecated and removed" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
389 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
390 |
|
18 | 391 |
return jQXHR; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
392 |
}, "jqXHR-methods" ); |
18 | 393 |
|
394 |
// Only trigger the logic in jQuery <4 as the JSON-to-JSONP auto-promotion |
|
395 |
// behavior is gone in jQuery 4.0 and as it has security implications, we don't |
|
396 |
// want to restore the legacy behavior. |
|
397 |
if ( !jQueryVersionSince( "4.0.0" ) ) { |
|
398 |
||
399 |
// Register this prefilter before the jQuery one. Otherwise, a promoted |
|
400 |
// request is transformed into one with the script dataType and we can't |
|
401 |
// catch it anymore. |
|
402 |
jQuery.ajaxPrefilter( "+json", function( s ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
403 |
|
18 | 404 |
// Warn if JSON-to-JSONP auto-promotion happens. |
405 |
if ( s.jsonp !== false && ( rjsonp.test( s.url ) || |
|
406 |
typeof s.data === "string" && |
|
407 |
( s.contentType || "" ) |
|
408 |
.indexOf( "application/x-www-form-urlencoded" ) === 0 && |
|
409 |
rjsonp.test( s.data ) |
|
410 |
) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
411 |
migrateWarn( "jsonp-promotion", "JSON-to-JSONP auto-promotion is deprecated" ); |
18 | 412 |
} |
413 |
} ); |
|
414 |
} |
|
415 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
416 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
417 |
|
18 | 418 |
var oldRemoveAttr = jQuery.fn.removeAttr, |
419 |
oldToggleClass = jQuery.fn.toggleClass, |
|
420 |
rmatchNonSpace = /\S+/g; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
421 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
422 |
migratePatchFunc( jQuery.fn, "removeAttr", function( name ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
423 |
var self = this, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
424 |
patchNeeded = false; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
425 |
|
18 | 426 |
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) { |
427 |
if ( jQuery.expr.match.bool.test( attr ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
428 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
429 |
// Only warn if at least a single node had the property set to |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
430 |
// something else than `false`. Otherwise, this Migrate patch |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
431 |
// doesn't influence the behavior and there's no need to set or warn. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
432 |
self.each( function() { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
433 |
if ( jQuery( this ).prop( attr ) !== false ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
434 |
patchNeeded = true; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
435 |
return false; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
436 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
437 |
} ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
438 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
439 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
440 |
if ( patchNeeded ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
441 |
migrateWarn( "removeAttr-bool", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
442 |
"jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); |
18 | 443 |
self.prop( attr, false ); |
444 |
} |
|
445 |
} ); |
|
446 |
||
447 |
return oldRemoveAttr.apply( this, arguments ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
448 |
}, "removeAttr-bool" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
449 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
450 |
migratePatchFunc( jQuery.fn, "toggleClass", function( state ) { |
18 | 451 |
|
452 |
// Only deprecating no-args or single boolean arg |
|
453 |
if ( state !== undefined && typeof state !== "boolean" ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
454 |
|
18 | 455 |
return oldToggleClass.apply( this, arguments ); |
456 |
} |
|
457 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
458 |
migrateWarn( "toggleClass-bool", "jQuery.fn.toggleClass( boolean ) is deprecated" ); |
18 | 459 |
|
460 |
// Toggle entire class name of each element |
|
461 |
return this.each( function() { |
|
462 |
var className = this.getAttribute && this.getAttribute( "class" ) || ""; |
|
463 |
||
464 |
if ( className ) { |
|
465 |
jQuery.data( this, "__className__", className ); |
|
466 |
} |
|
467 |
||
468 |
// If the element has a class name or if we're passed `false`, |
|
469 |
// then remove the whole classname (if there was one, the above saved it). |
|
470 |
// Otherwise bring back whatever was previously saved (if anything), |
|
471 |
// falling back to the empty string if nothing was stored. |
|
472 |
if ( this.setAttribute ) { |
|
473 |
this.setAttribute( "class", |
|
474 |
className || state === false ? |
|
475 |
"" : |
|
476 |
jQuery.data( this, "__className__" ) || "" |
|
477 |
); |
|
478 |
} |
|
479 |
} ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
480 |
}, "toggleClass-bool" ); |
18 | 481 |
|
482 |
function camelCase( string ) { |
|
483 |
return string.replace( /-([a-z])/g, function( _, letter ) { |
|
484 |
return letter.toUpperCase(); |
|
485 |
} ); |
|
486 |
} |
|
487 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
488 |
var origFnCss, internalCssNumber, |
18 | 489 |
internalSwapCall = false, |
490 |
ralphaStart = /^[a-z]/, |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
491 |
|
18 | 492 |
// The regex visualized: |
493 |
// |
|
494 |
// /----------\ |
|
495 |
// | | /-------\ |
|
496 |
// | / Top \ | | | |
|
497 |
// /--- Border ---+-| Right |-+---+- Width -+---\ |
|
498 |
// | | Bottom | | |
|
499 |
// | \ Left / | |
|
500 |
// | | |
|
501 |
// | /----------\ | |
|
502 |
// | /-------------\ | | |- END |
|
503 |
// | | | | / Top \ | | |
|
504 |
// | | / Margin \ | | | Right | | | |
|
505 |
// |---------+-| |-+---+-| Bottom |-+----| |
|
506 |
// | \ Padding / \ Left / | |
|
507 |
// BEGIN -| | |
|
508 |
// | /---------\ | |
|
509 |
// | | | | |
|
510 |
// | | / Min \ | / Width \ | |
|
511 |
// \--------------+-| |-+---| |---/ |
|
512 |
// \ Max / \ Height / |
|
513 |
rautoPx = /^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
514 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
515 |
// If this version of jQuery has .swap(), don't false-alarm on internal uses |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
516 |
if ( jQuery.swap ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
517 |
jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
518 |
var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
519 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
520 |
if ( oldHook ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
521 |
jQuery.cssHooks[ name ].get = function() { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
522 |
var ret; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
523 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
524 |
internalSwapCall = true; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
525 |
ret = oldHook.apply( this, arguments ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
526 |
internalSwapCall = false; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
527 |
return ret; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
528 |
}; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
529 |
} |
18 | 530 |
} ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
531 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
532 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
533 |
migratePatchFunc( jQuery, "swap", function( elem, options, callback, args ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
534 |
var ret, name, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
535 |
old = {}; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
536 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
537 |
if ( !internalSwapCall ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
538 |
migrateWarn( "swap", "jQuery.swap() is undocumented and deprecated" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
539 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
540 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
541 |
// Remember the old values, and insert the new ones |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
542 |
for ( name in options ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
543 |
old[ name ] = elem.style[ name ]; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
544 |
elem.style[ name ] = options[ name ]; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
545 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
546 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
547 |
ret = callback.apply( elem, args || [] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
548 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
549 |
// Revert the old values |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
550 |
for ( name in options ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
551 |
elem.style[ name ] = old[ name ]; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
552 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
553 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
554 |
return ret; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
555 |
}, "swap" ); |
18 | 556 |
|
557 |
if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) { |
|
558 |
jQuery.cssProps = new Proxy( jQuery.cssProps || {}, { |
|
559 |
set: function() { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
560 |
migrateWarn( "cssProps", "jQuery.cssProps is deprecated" ); |
18 | 561 |
return Reflect.set.apply( this, arguments ); |
562 |
} |
|
563 |
} ); |
|
564 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
565 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
566 |
// In jQuery >=4 where jQuery.cssNumber is missing fill it with the latest 3.x version: |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
567 |
// https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
568 |
// This way, number values for the CSS properties below won't start triggering |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
569 |
// Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438). |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
570 |
if ( jQueryVersionSince( "4.0.0" ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
571 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
572 |
// We need to keep this as a local variable as we need it internally |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
573 |
// in a `jQuery.fn.css` patch and this usage shouldn't warn. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
574 |
internalCssNumber = { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
575 |
animationIterationCount: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
576 |
columnCount: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
577 |
fillOpacity: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
578 |
flexGrow: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
579 |
flexShrink: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
580 |
fontWeight: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
581 |
gridArea: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
582 |
gridColumn: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
583 |
gridColumnEnd: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
584 |
gridColumnStart: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
585 |
gridRow: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
586 |
gridRowEnd: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
587 |
gridRowStart: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
588 |
lineHeight: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
589 |
opacity: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
590 |
order: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
591 |
orphans: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
592 |
widows: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
593 |
zIndex: true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
594 |
zoom: true |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
595 |
}; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
596 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
597 |
if ( typeof Proxy !== "undefined" ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
598 |
jQuery.cssNumber = new Proxy( internalCssNumber, { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
599 |
get: function() { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
600 |
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
601 |
return Reflect.get.apply( this, arguments ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
602 |
}, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
603 |
set: function() { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
604 |
migrateWarn( "css-number", "jQuery.cssNumber is deprecated" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
605 |
return Reflect.set.apply( this, arguments ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
606 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
607 |
} ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
608 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
609 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
610 |
// Support: IE 9-11+ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
611 |
// IE doesn't support proxies, but we still want to restore the legacy |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
612 |
// jQuery.cssNumber there. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
613 |
jQuery.cssNumber = internalCssNumber; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
614 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
615 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
616 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
617 |
// Make `internalCssNumber` defined for jQuery <4 as well as it's needed |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
618 |
// in the `jQuery.fn.css` patch below. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
619 |
internalCssNumber = jQuery.cssNumber; |
18 | 620 |
} |
621 |
||
622 |
function isAutoPx( prop ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
623 |
|
18 | 624 |
// The first test is used to ensure that: |
625 |
// 1. The prop starts with a lowercase letter (as we uppercase it for the second regex). |
|
626 |
// 2. The prop is not empty. |
|
627 |
return ralphaStart.test( prop ) && |
|
628 |
rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) ); |
|
629 |
} |
|
630 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
631 |
origFnCss = jQuery.fn.css; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
632 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
633 |
migratePatchFunc( jQuery.fn, "css", function( name, value ) { |
18 | 634 |
var camelName, |
635 |
origThis = this; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
636 |
|
18 | 637 |
if ( name && typeof name === "object" && !Array.isArray( name ) ) { |
638 |
jQuery.each( name, function( n, v ) { |
|
639 |
jQuery.fn.css.call( origThis, n, v ); |
|
640 |
} ); |
|
641 |
return this; |
|
642 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
643 |
|
18 | 644 |
if ( typeof value === "number" ) { |
645 |
camelName = camelCase( name ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
646 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
647 |
// Use `internalCssNumber` to avoid triggering our warnings in this |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
648 |
// internal check. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
649 |
if ( !isAutoPx( camelName ) && !internalCssNumber[ camelName ] ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
650 |
migrateWarn( "css-number", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
651 |
"Number-typed values are deprecated for jQuery.fn.css( \"" + |
18 | 652 |
name + "\", value )" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
653 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
654 |
} |
18 | 655 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
656 |
return origFnCss.apply( this, arguments ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
657 |
}, "css-number" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
658 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
659 |
var origData = jQuery.data; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
660 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
661 |
migratePatchFunc( jQuery, "data", function( elem, name, value ) { |
18 | 662 |
var curData, sameKeys, key; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
663 |
|
18 | 664 |
// Name can be an object, and each entry in the object is meant to be set as data |
665 |
if ( name && typeof name === "object" && arguments.length === 2 ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
666 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
667 |
curData = jQuery.hasData( elem ) && origData.call( this, elem ); |
18 | 668 |
sameKeys = {}; |
669 |
for ( key in name ) { |
|
670 |
if ( key !== camelCase( key ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
671 |
migrateWarn( "data-camelCase", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
672 |
"jQuery.data() always sets/gets camelCased names: " + key ); |
18 | 673 |
curData[ key ] = name[ key ]; |
674 |
} else { |
|
675 |
sameKeys[ key ] = name[ key ]; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
676 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
677 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
678 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
679 |
origData.call( this, elem, sameKeys ); |
18 | 680 |
|
681 |
return name; |
|
682 |
} |
|
683 |
||
684 |
// If the name is transformed, look for the un-transformed name in the data object |
|
685 |
if ( name && typeof name === "string" && name !== camelCase( name ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
686 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
687 |
curData = jQuery.hasData( elem ) && origData.call( this, elem ); |
18 | 688 |
if ( curData && name in curData ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
689 |
migrateWarn( "data-camelCase", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
690 |
"jQuery.data() always sets/gets camelCased names: " + name ); |
18 | 691 |
if ( arguments.length > 2 ) { |
692 |
curData[ name ] = value; |
|
693 |
} |
|
694 |
return curData[ name ]; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
695 |
} |
18 | 696 |
} |
697 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
698 |
return origData.apply( this, arguments ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
699 |
}, "data-camelCase" ); |
18 | 700 |
|
701 |
// Support jQuery slim which excludes the effects module |
|
702 |
if ( jQuery.fx ) { |
|
703 |
||
704 |
var intervalValue, intervalMsg, |
|
705 |
oldTweenRun = jQuery.Tween.prototype.run, |
|
706 |
linearEasing = function( pct ) { |
|
707 |
return pct; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
708 |
}; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
709 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
710 |
migratePatchFunc( jQuery.Tween.prototype, "run", function( ) { |
18 | 711 |
if ( jQuery.easing[ this.easing ].length > 1 ) { |
712 |
migrateWarn( |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
713 |
"easing-one-arg", |
18 | 714 |
"'jQuery.easing." + this.easing.toString() + "' should use only one argument" |
715 |
); |
|
716 |
||
717 |
jQuery.easing[ this.easing ] = linearEasing; |
|
718 |
} |
|
719 |
||
720 |
oldTweenRun.apply( this, arguments ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
721 |
}, "easing-one-arg" ); |
18 | 722 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
723 |
intervalValue = jQuery.fx.interval; |
18 | 724 |
intervalMsg = "jQuery.fx.interval is deprecated"; |
725 |
||
726 |
// Support: IE9, Android <=4.4 |
|
727 |
// Avoid false positives on browsers that lack rAF |
|
728 |
// Don't warn if document is hidden, jQuery uses setTimeout (#292) |
|
729 |
if ( window.requestAnimationFrame ) { |
|
730 |
Object.defineProperty( jQuery.fx, "interval", { |
|
731 |
configurable: true, |
|
732 |
enumerable: true, |
|
733 |
get: function() { |
|
734 |
if ( !window.document.hidden ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
735 |
migrateWarn( "fx-interval", intervalMsg ); |
18 | 736 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
737 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
738 |
// Only fallback to the default if patch is enabled |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
739 |
if ( !jQuery.migrateIsPatchEnabled( "fx-interval" ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
740 |
return intervalValue; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
741 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
742 |
return intervalValue === undefined ? 13 : intervalValue; |
18 | 743 |
}, |
744 |
set: function( newValue ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
745 |
migrateWarn( "fx-interval", intervalMsg ); |
18 | 746 |
intervalValue = newValue; |
747 |
} |
|
748 |
} ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
749 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
750 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
751 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
752 |
|
18 | 753 |
var oldLoad = jQuery.fn.load, |
754 |
oldEventAdd = jQuery.event.add, |
|
755 |
originalFix = jQuery.event.fix; |
|
756 |
||
757 |
jQuery.event.props = []; |
|
758 |
jQuery.event.fixHooks = {}; |
|
759 |
||
760 |
migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat, |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
761 |
"event-old-patch", |
18 | 762 |
"jQuery.event.props.concat() is deprecated and removed" ); |
763 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
764 |
migratePatchFunc( jQuery.event, "fix", function( originalEvent ) { |
18 | 765 |
var event, |
766 |
type = originalEvent.type, |
|
767 |
fixHook = this.fixHooks[ type ], |
|
768 |
props = jQuery.event.props; |
|
769 |
||
770 |
if ( props.length ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
771 |
migrateWarn( "event-old-patch", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
772 |
"jQuery.event.props are deprecated and removed: " + props.join() ); |
18 | 773 |
while ( props.length ) { |
774 |
jQuery.event.addProp( props.pop() ); |
|
775 |
} |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
776 |
} |
18 | 777 |
|
778 |
if ( fixHook && !fixHook._migrated_ ) { |
|
779 |
fixHook._migrated_ = true; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
780 |
migrateWarn( "event-old-patch", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
781 |
"jQuery.event.fixHooks are deprecated and removed: " + type ); |
18 | 782 |
if ( ( props = fixHook.props ) && props.length ) { |
783 |
while ( props.length ) { |
|
784 |
jQuery.event.addProp( props.pop() ); |
|
785 |
} |
|
786 |
} |
|
787 |
} |
|
788 |
||
789 |
event = originalFix.call( this, originalEvent ); |
|
790 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
791 |
return fixHook && fixHook.filter ? |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
792 |
fixHook.filter( event, originalEvent ) : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
793 |
event; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
794 |
}, "event-old-patch" ); |
18 | 795 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
796 |
migratePatchFunc( jQuery.event, "add", function( elem, types ) { |
18 | 797 |
|
798 |
// This misses the multiple-types case but that seems awfully rare |
|
799 |
if ( elem === window && types === "load" && window.document.readyState === "complete" ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
800 |
migrateWarn( "load-after-event", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
801 |
"jQuery(window).on('load'...) called after load event occurred" ); |
18 | 802 |
} |
803 |
return oldEventAdd.apply( this, arguments ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
804 |
}, "load-after-event" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
805 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
806 |
jQuery.each( [ "load", "unload", "error" ], function( _, name ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
807 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
808 |
migratePatchFunc( jQuery.fn, name, function() { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
809 |
var args = Array.prototype.slice.call( arguments, 0 ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
810 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
811 |
// If this is an ajax load() the first arg should be the string URL; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
812 |
// technically this could also be the "Anything" arg of the event .load() |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
813 |
// which just goes to show why this dumb signature has been deprecated! |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
814 |
// jQuery custom builds that exclude the Ajax module justifiably die here. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
815 |
if ( name === "load" && typeof args[ 0 ] === "string" ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
816 |
return oldLoad.apply( this, args ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
817 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
818 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
819 |
migrateWarn( "shorthand-removed-v3", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
820 |
"jQuery.fn." + name + "() is deprecated" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
821 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
822 |
args.splice( 0, 0, name ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
823 |
if ( arguments.length ) { |
18 | 824 |
return this.on.apply( this, args ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
825 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
826 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
827 |
// Use .triggerHandler here because: |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
828 |
// - load and unload events don't need to bubble, only applied to window or image |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
829 |
// - error event should not bubble to window, although it does pre-1.7 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
830 |
// See http://bugs.jquery.com/ticket/11820 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
831 |
this.triggerHandler.apply( this, args ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
832 |
return this; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
833 |
}, "shorthand-removed-v3" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
834 |
|
18 | 835 |
} ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
836 |
|
18 | 837 |
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + |
838 |
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
|
839 |
"change select submit keydown keypress keyup contextmenu" ).split( " " ), |
|
840 |
function( _i, name ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
841 |
|
18 | 842 |
// Handle event binding |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
843 |
migratePatchAndWarnFunc( jQuery.fn, name, function( data, fn ) { |
18 | 844 |
return arguments.length > 0 ? |
845 |
this.on( name, null, data, fn ) : |
|
846 |
this.trigger( name ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
847 |
}, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
848 |
"shorthand-deprecated-v3", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
849 |
"jQuery.fn." + name + "() event shorthand is deprecated" ); |
18 | 850 |
} ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
851 |
|
18 | 852 |
// Trigger "ready" event only once, on document ready |
853 |
jQuery( function() { |
|
854 |
jQuery( window.document ).triggerHandler( "ready" ); |
|
855 |
} ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
856 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
857 |
jQuery.event.special.ready = { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
858 |
setup: function() { |
18 | 859 |
if ( this === window.document ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
860 |
migrateWarn( "ready-event", "'ready' event is deprecated" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
861 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
862 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
863 |
}; |
18 | 864 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
865 |
migratePatchAndWarnFunc( jQuery.fn, "bind", function( types, data, fn ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
866 |
return this.on( types, null, data, fn ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
867 |
}, "pre-on-methods", "jQuery.fn.bind() is deprecated" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
868 |
migratePatchAndWarnFunc( jQuery.fn, "unbind", function( types, fn ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
869 |
return this.off( types, null, fn ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
870 |
}, "pre-on-methods", "jQuery.fn.unbind() is deprecated" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
871 |
migratePatchAndWarnFunc( jQuery.fn, "delegate", function( selector, types, data, fn ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
872 |
return this.on( types, selector, data, fn ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
873 |
}, "pre-on-methods", "jQuery.fn.delegate() is deprecated" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
874 |
migratePatchAndWarnFunc( jQuery.fn, "undelegate", function( selector, types, fn ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
875 |
return arguments.length === 1 ? |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
876 |
this.off( selector, "**" ) : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
877 |
this.off( types, selector || "**", fn ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
878 |
}, "pre-on-methods", "jQuery.fn.undelegate() is deprecated" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
879 |
migratePatchAndWarnFunc( jQuery.fn, "hover", function( fnOver, fnOut ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
880 |
return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
881 |
}, "pre-on-methods", "jQuery.fn.hover() is deprecated" ); |
18 | 882 |
|
883 |
var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, |
|
884 |
makeMarkup = function( html ) { |
|
885 |
var doc = window.document.implementation.createHTMLDocument( "" ); |
|
886 |
doc.body.innerHTML = html; |
|
887 |
return doc.body && doc.body.innerHTML; |
|
888 |
}, |
|
889 |
warnIfChanged = function( html ) { |
|
890 |
var changed = html.replace( rxhtmlTag, "<$1></$2>" ); |
|
891 |
if ( changed !== html && makeMarkup( html ) !== makeMarkup( changed ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
892 |
migrateWarn( "self-closed-tags", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
893 |
"HTML tags must be properly nested and closed: " + html ); |
18 | 894 |
} |
895 |
}; |
|
896 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
897 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
898 |
* Deprecated, please use `jQuery.migrateDisablePatches( "self-closed-tags" )` instead. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
899 |
* @deprecated |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
900 |
*/ |
18 | 901 |
jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
902 |
jQuery.migrateEnablePatches( "self-closed-tags" ); |
18 | 903 |
}; |
904 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
905 |
migratePatchFunc( jQuery, "htmlPrefilter", function( html ) { |
18 | 906 |
warnIfChanged( html ); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
907 |
return html.replace( rxhtmlTag, "<$1></$2>" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
908 |
}, "self-closed-tags" ); |
18 | 909 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
910 |
// This patch needs to be disabled by default as it re-introduces |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
911 |
// security issues (CVE-2020-11022, CVE-2020-11023). |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
912 |
jQuery.migrateDisablePatches( "self-closed-tags" ); |
18 | 913 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
914 |
var origOffset = jQuery.fn.offset; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
915 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
916 |
migratePatchFunc( jQuery.fn, "offset", function() { |
18 | 917 |
var elem = this[ 0 ]; |
918 |
||
919 |
if ( elem && ( !elem.nodeType || !elem.getBoundingClientRect ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
920 |
migrateWarn( "offset-valid-elem", "jQuery.fn.offset() requires a valid DOM element" ); |
18 | 921 |
return arguments.length ? this : undefined; |
922 |
} |
|
923 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
924 |
return origOffset.apply( this, arguments ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
925 |
}, "offset-valid-elem" ); |
18 | 926 |
|
927 |
// Support jQuery slim which excludes the ajax module |
|
928 |
// The jQuery.param patch is about respecting `jQuery.ajaxSettings.traditional` |
|
929 |
// so it doesn't make sense for the slim build. |
|
930 |
if ( jQuery.ajax ) { |
|
931 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
932 |
var origParam = jQuery.param; |
18 | 933 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
934 |
migratePatchFunc( jQuery, "param", function( data, traditional ) { |
18 | 935 |
var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; |
936 |
||
937 |
if ( traditional === undefined && ajaxTraditional ) { |
|
938 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
939 |
migrateWarn( "param-ajax-traditional", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
940 |
"jQuery.param() no longer uses jQuery.ajaxSettings.traditional" ); |
18 | 941 |
traditional = ajaxTraditional; |
942 |
} |
|
943 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
944 |
return origParam.call( this, data, traditional ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
945 |
}, "param-ajax-traditional" ); |
18 | 946 |
|
947 |
} |
|
948 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
949 |
migratePatchAndWarnFunc( jQuery.fn, "andSelf", jQuery.fn.addBack, "andSelf", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
950 |
"jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
951 |
|
18 | 952 |
// Support jQuery slim which excludes the deferred module in jQuery 4.0+ |
953 |
if ( jQuery.Deferred ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
954 |
|
18 | 955 |
var oldDeferred = jQuery.Deferred, |
956 |
tuples = [ |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
957 |
|
18 | 958 |
// Action, add listener, callbacks, .then handlers, final state |
959 |
[ "resolve", "done", jQuery.Callbacks( "once memory" ), |
|
960 |
jQuery.Callbacks( "once memory" ), "resolved" ], |
|
961 |
[ "reject", "fail", jQuery.Callbacks( "once memory" ), |
|
962 |
jQuery.Callbacks( "once memory" ), "rejected" ], |
|
963 |
[ "notify", "progress", jQuery.Callbacks( "memory" ), |
|
964 |
jQuery.Callbacks( "memory" ) ] |
|
965 |
]; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
966 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
967 |
migratePatchFunc( jQuery, "Deferred", function( func ) { |
18 | 968 |
var deferred = oldDeferred(), |
969 |
promise = deferred.promise(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
970 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
971 |
function newDeferredPipe( /* fnDone, fnFail, fnProgress */ ) { |
18 | 972 |
var fns = arguments; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
973 |
|
18 | 974 |
return jQuery.Deferred( function( newDefer ) { |
975 |
jQuery.each( tuples, function( i, tuple ) { |
|
976 |
var fn = typeof fns[ i ] === "function" && fns[ i ]; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
977 |
|
18 | 978 |
// Deferred.done(function() { bind to newDefer or newDefer.resolve }) |
979 |
// deferred.fail(function() { bind to newDefer or newDefer.reject }) |
|
980 |
// deferred.progress(function() { bind to newDefer or newDefer.notify }) |
|
981 |
deferred[ tuple[ 1 ] ]( function() { |
|
982 |
var returned = fn && fn.apply( this, arguments ); |
|
983 |
if ( returned && typeof returned.promise === "function" ) { |
|
984 |
returned.promise() |
|
985 |
.done( newDefer.resolve ) |
|
986 |
.fail( newDefer.reject ) |
|
987 |
.progress( newDefer.notify ); |
|
988 |
} else { |
|
989 |
newDefer[ tuple[ 0 ] + "With" ]( |
|
990 |
this === promise ? newDefer.promise() : this, |
|
991 |
fn ? [ returned ] : arguments |
|
992 |
); |
|
993 |
} |
|
994 |
} ); |
|
995 |
} ); |
|
996 |
fns = null; |
|
997 |
} ).promise(); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
998 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
999 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
1000 |
migratePatchAndWarnFunc( deferred, "pipe", newDeferredPipe, "deferred-pipe", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
1001 |
"deferred.pipe() is deprecated" ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
1002 |
migratePatchAndWarnFunc( promise, "pipe", newDeferredPipe, "deferred-pipe", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
1003 |
"deferred.pipe() is deprecated" ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
1004 |
|
18 | 1005 |
if ( func ) { |
1006 |
func.call( deferred, deferred ); |
|
1007 |
} |
|
1008 |
||
1009 |
return deferred; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
18
diff
changeset
|
1010 |
}, "deferred-pipe" ); |
18 | 1011 |
|
1012 |
// Preserve handler of uncaught exceptions in promise chains |
|
1013 |
jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook; |
|
1014 |
||
1015 |
} |
|
1016 |
||
1017 |
return jQuery; |
|
1018 |
} ); |