Changeset 55237
- Timestamp:
- 02/06/2023 08:57:05 PM (22 months ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/vendor/jquery/jquery-migrate.js
r49649 r55237 1 1 /*! 2 * jQuery Migrate - v3. 3.2 - 2020-11-18T08:29Z2 * jQuery Migrate - v3.4.0 - 2022-03-24T16:30Z 3 3 * Copyright OpenJS Foundation and other contributors 4 4 */ … … 25 25 "use strict"; 26 26 27 jQuery.migrateVersion = "3. 3.2";27 jQuery.migrateVersion = "3.4.0"; 28 28 29 29 // Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 … … 49 49 } 50 50 51 // A map from disabled patch codes to `true`. This should really 52 // be a `Set` but those are unsupported in IE. 53 var disabledPatches = Object.create( null ); 54 55 // Don't apply patches for specified codes. Helpful for code bases 56 // where some Migrate warnings have been addressed and it's desirable 57 // to avoid needless patches or false positives. 58 jQuery.migrateDisablePatches = function() { 59 var i; 60 for ( i = 0; i < arguments.length; i++ ) { 61 disabledPatches[ arguments[ i ] ] = true; 62 } 63 }; 64 65 // Allow enabling patches disabled via `jQuery.migrateDisablePatches`. 66 // Helpful if you want to disable a patch only for some code that won't 67 // be updated soon to be able to focus on other warnings - and enable it 68 // immediately after such a call: 69 // ```js 70 // jQuery.migrateDisablePatches( "workaroundA" ); 71 // elem.pluginViolatingWarningA( "pluginMethod" ); 72 // jQuery.migrateEnablePatches( "workaroundA" ); 73 // ``` 74 jQuery.migrateEnablePatches = function() { 75 var i; 76 for ( i = 0; i < arguments.length; i++ ) { 77 delete disabledPatches[ arguments[ i ] ]; 78 } 79 }; 80 81 jQuery.migrateIsPatchEnabled = function( patchCode ) { 82 return !disabledPatches[ patchCode ]; 83 }; 84 51 85 ( function() { 52 86 … … 92 126 }; 93 127 94 function migrateWarn( msg ) {128 function migrateWarn( code, msg ) { 95 129 var console = window.console; 96 if ( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) { 130 if ( jQuery.migrateIsPatchEnabled( code ) && 131 ( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) ) { 97 132 warnedAbout[ msg ] = true; 98 jQuery.migrateWarnings.push( msg );133 jQuery.migrateWarnings.push( msg + " [" + code + "]" ); 99 134 if ( console && console.warn && !jQuery.migrateMute ) { 100 135 console.warn( "JQMIGRATE: " + msg ); … … 106 141 } 107 142 108 function migrateWarnProp( obj, prop, value, msg ) {143 function migrateWarnProp( obj, prop, value, code, msg ) { 109 144 Object.defineProperty( obj, prop, { 110 145 configurable: true, 111 146 enumerable: true, 112 147 get: function() { 113 migrateWarn( msg );148 migrateWarn( code, msg ); 114 149 return value; 115 150 }, 116 151 set: function( newValue ) { 117 migrateWarn( msg );152 migrateWarn( code, msg ); 118 153 value = newValue; 119 154 } … … 121 156 } 122 157 123 function migrateWarnFunc( obj, prop, newFunc, msg ) { 158 function migrateWarnFuncInternal( obj, prop, newFunc, code, msg ) { 159 var finalFunc, 160 origFunc = obj[ prop ]; 161 124 162 obj[ prop ] = function() { 125 migrateWarn( msg ); 126 return newFunc.apply( this, arguments ); 163 164 // If `msg` not provided, do not warn; more sophisticated warnings 165 // logic is most likely embedded in `newFunc`, in that case here 166 // we just care about the logic choosing the proper implementation 167 // based on whether the patch is disabled or not. 168 if ( msg ) { 169 migrateWarn( code, msg ); 170 } 171 172 // Since patches can be disabled & enabled dynamically, we 173 // need to decide which implementation to run on each invocation. 174 finalFunc = jQuery.migrateIsPatchEnabled( code ) ? 175 newFunc : 176 177 // The function may not have existed originally so we need a fallback. 178 ( origFunc || jQuery.noop ); 179 180 return finalFunc.apply( this, arguments ); 127 181 }; 128 182 } 129 183 184 function migratePatchAndWarnFunc( obj, prop, newFunc, code, msg ) { 185 if ( !msg ) { 186 throw new Error( "No warning message provided" ); 187 } 188 return migrateWarnFuncInternal( obj, prop, newFunc, code, msg ); 189 } 190 191 function migratePatchFunc( obj, prop, newFunc, code ) { 192 return migrateWarnFuncInternal( obj, prop, newFunc, code ); 193 } 194 130 195 if ( window.document.compatMode === "BackCompat" ) { 131 196 132 // JQuery has never supported or tested Quirks Mode133 migrateWarn( " jQuery is not compatible with Quirks Mode" );197 // jQuery has never supported or tested Quirks Mode 198 migrateWarn( "quirks", "jQuery is not compatible with Quirks Mode" ); 134 199 } 135 200 … … 146 211 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 147 212 148 jQuery.fn.init =function( arg1 ) {213 migratePatchFunc( jQuery.fn, "init", function( arg1 ) { 149 214 var args = Array.prototype.slice.call( arguments ); 150 215 151 if ( typeof arg1 === "string" && arg1 === "#" ) { 152 153 // JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0 154 migrateWarn( "jQuery( '#' ) is not a valid selector" ); 216 if ( jQuery.migrateIsPatchEnabled( "selector-empty-id" ) && 217 typeof arg1 === "string" && arg1 === "#" ) { 218 219 // JQuery( "#" ) is a bogus ID selector, but it returned an empty set 220 // before jQuery 3.0 221 migrateWarn( "selector-empty-id", "jQuery( '#' ) is not a valid selector" ); 155 222 args[ 0 ] = []; 156 223 } 157 224 158 225 return oldInit.apply( this, args ); 159 }; 226 }, "selector-empty-id" ); 227 228 // This is already done in Core but the above patch will lose this assignment 229 // so we need to redo it. It doesn't matter whether the patch is enabled or not 230 // as the method is always going to be a Migrate-created wrapper. 160 231 jQuery.fn.init.prototype = jQuery.fn; 161 232 162 jQuery.find =function( selector ) {233 migratePatchFunc( jQuery, "find", function( selector ) { 163 234 var args = Array.prototype.slice.call( arguments ); 164 235 … … 182 253 try { 183 254 window.document.querySelector( selector ); 184 migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); 255 migrateWarn( "selector-hash", 256 "Attribute selector with '#' must be quoted: " + args[ 0 ] ); 185 257 args[ 0 ] = selector; 186 258 } catch ( err2 ) { 187 migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] ); 259 migrateWarn( "selector-hash", 260 "Attribute selector with '#' was not fixed: " + args[ 0 ] ); 188 261 } 189 262 } … … 191 264 192 265 return oldFind.apply( this, args ); 193 } ;266 }, "selector-hash" ); 194 267 195 268 // Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) … … 201 274 202 275 // The number of elements contained in the matched element set 203 migrate WarnFunc( jQuery.fn, "size", function() {276 migratePatchAndWarnFunc( jQuery.fn, "size", function() { 204 277 return this.length; 205 }, 278 }, "size", 206 279 "jQuery.fn.size() is deprecated and removed; use the .length property" ); 207 280 208 migrate WarnFunc( jQuery, "parseJSON", function() {281 migratePatchAndWarnFunc( jQuery, "parseJSON", function() { 209 282 return JSON.parse.apply( null, arguments ); 210 }, 283 }, "parseJSON", 211 284 "jQuery.parseJSON is deprecated; use JSON.parse" ); 212 285 213 migrate WarnFunc( jQuery, "holdReady", jQuery.holdReady,214 " jQuery.holdReady is deprecated" );215 216 migrate WarnFunc( jQuery, "unique", jQuery.uniqueSort,217 " jQuery.unique is deprecated; use jQuery.uniqueSort" );286 migratePatchAndWarnFunc( jQuery, "holdReady", jQuery.holdReady, 287 "holdReady", "jQuery.holdReady is deprecated" ); 288 289 migratePatchAndWarnFunc( jQuery, "unique", jQuery.uniqueSort, 290 "unique", "jQuery.unique is deprecated; use jQuery.uniqueSort" ); 218 291 219 292 // Now jQuery.expr.pseudos is the standard incantation 220 migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, 293 migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, "expr-pre-pseudos", 221 294 "jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" ); 222 migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, 295 migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, "expr-pre-pseudos", 223 296 "jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" ); 224 297 225 298 // Prior to jQuery 3.1.1 there were internal refs so we don't warn there 226 299 if ( jQueryVersionSince( "3.1.1" ) ) { 227 migrate WarnFunc( jQuery, "trim", function( text ) {300 migratePatchAndWarnFunc( jQuery, "trim", function( text ) { 228 301 return text == null ? 229 302 "" : 230 303 ( text + "" ).replace( rtrim, "" ); 231 }, 304 }, "trim", 232 305 "jQuery.trim is deprecated; use String.prototype.trim" ); 233 306 } … … 235 308 // Prior to jQuery 3.2 there were internal refs so we don't warn there 236 309 if ( jQueryVersionSince( "3.2.0" ) ) { 237 migrate WarnFunc( jQuery, "nodeName", function( elem, name ) {310 migratePatchAndWarnFunc( jQuery, "nodeName", function( elem, name ) { 238 311 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 239 }, 312 }, "nodeName", 240 313 "jQuery.nodeName is deprecated" ); 241 314 242 migrate WarnFunc( jQuery, "isArray", Array.isArray,315 migratePatchAndWarnFunc( jQuery, "isArray", Array.isArray, "isArray", 243 316 "jQuery.isArray is deprecated; use Array.isArray" 244 317 ); … … 247 320 if ( jQueryVersionSince( "3.3.0" ) ) { 248 321 249 migrate WarnFunc( jQuery, "isNumeric", function( obj ) {322 migratePatchAndWarnFunc( jQuery, "isNumeric", function( obj ) { 250 323 251 324 // As of jQuery 3.0, isNumeric is limited to … … 259 332 // subtraction forces infinities to NaN 260 333 !isNaN( obj - parseFloat( obj ) ); 261 }, 334 }, "isNumeric", 262 335 "jQuery.isNumeric() is deprecated" 263 336 ); … … 270 343 } ); 271 344 272 migrate WarnFunc( jQuery, "type", function( obj ) {345 migratePatchAndWarnFunc( jQuery, "type", function( obj ) { 273 346 if ( obj == null ) { 274 347 return obj + ""; … … 279 352 class2type[ Object.prototype.toString.call( obj ) ] || "object" : 280 353 typeof obj; 281 }, 354 }, "type", 282 355 "jQuery.type is deprecated" ); 283 356 284 migrate WarnFunc( jQuery, "isFunction",357 migratePatchAndWarnFunc( jQuery, "isFunction", 285 358 function( obj ) { 286 359 return typeof obj === "function"; 287 }, 360 }, "isFunction", 288 361 "jQuery.isFunction() is deprecated" ); 289 362 290 migrate WarnFunc( jQuery, "isWindow",363 migratePatchAndWarnFunc( jQuery, "isWindow", 291 364 function( obj ) { 292 365 return obj != null && obj === obj.window; 293 }, 366 }, "isWindow", 294 367 "jQuery.isWindow() is deprecated" 295 368 ); … … 302 375 rjsonp = /(=)\?(?=&|$)|\?\?/; 303 376 304 jQuery.ajax = function() {377 migratePatchFunc( jQuery, "ajax", function() { 305 378 var jQXHR = oldAjax.apply( this, arguments ); 306 379 307 380 // Be sure we got a jQXHR (e.g., not sync) 308 381 if ( jQXHR.promise ) { 309 migrate WarnFunc( jQXHR, "success", jQXHR.done,382 migratePatchAndWarnFunc( jQXHR, "success", jQXHR.done, "jqXHR-methods", 310 383 "jQXHR.success is deprecated and removed" ); 311 migrate WarnFunc( jQXHR, "error", jQXHR.fail,384 migratePatchAndWarnFunc( jQXHR, "error", jQXHR.fail, "jqXHR-methods", 312 385 "jQXHR.error is deprecated and removed" ); 313 migrate WarnFunc( jQXHR, "complete", jQXHR.always,386 migratePatchAndWarnFunc( jQXHR, "complete", jQXHR.always, "jqXHR-methods", 314 387 "jQXHR.complete is deprecated and removed" ); 315 388 } 316 389 317 390 return jQXHR; 318 } ;391 }, "jqXHR-methods" ); 319 392 320 393 // Only trigger the logic in jQuery <4 as the JSON-to-JSONP auto-promotion … … 335 408 rjsonp.test( s.data ) 336 409 ) ) { 337 migrateWarn( " JSON-to-JSONP auto-promotion is deprecated" );410 migrateWarn( "jsonp-promotion", "JSON-to-JSONP auto-promotion is deprecated" ); 338 411 } 339 412 } ); … … 346 419 rmatchNonSpace = /\S+/g; 347 420 348 jQuery.fn.removeAttr =function( name ) {421 migratePatchFunc( jQuery.fn, "removeAttr", function( name ) { 349 422 var self = this; 350 423 351 424 jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) { 352 425 if ( jQuery.expr.match.bool.test( attr ) ) { 353 migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); 426 migrateWarn( "removeAttr-bool", 427 "jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); 354 428 self.prop( attr, false ); 355 429 } … … 357 431 358 432 return oldRemoveAttr.apply( this, arguments ); 359 } ;360 361 jQuery.fn.toggleClass =function( state ) {433 }, "removeAttr-bool" ); 434 435 migratePatchFunc( jQuery.fn, "toggleClass", function( state ) { 362 436 363 437 // Only deprecating no-args or single boolean arg 364 438 if ( state !== undefined && typeof state !== "boolean" ) { 439 365 440 return oldToggleClass.apply( this, arguments ); 366 441 } 367 442 368 migrateWarn( " jQuery.fn.toggleClass( boolean ) is deprecated" );443 migrateWarn( "toggleClass-bool", "jQuery.fn.toggleClass( boolean ) is deprecated" ); 369 444 370 445 // Toggle entire class name of each element … … 388 463 } 389 464 } ); 390 } ;465 }, "toggleClass-bool" ); 391 466 392 467 function camelCase( string ) { … … 396 471 } 397 472 398 var o ldFnCss,473 var origFnCss, 399 474 internalSwapCall = false, 400 475 ralphaStart = /^[a-z]/, … … 441 516 } 442 517 443 jQuery.swap =function( elem, options, callback, args ) {518 migratePatchFunc( jQuery, "swap", function( elem, options, callback, args ) { 444 519 var ret, name, 445 520 old = {}; 446 521 447 522 if ( !internalSwapCall ) { 448 migrateWarn( " jQuery.swap() is undocumented and deprecated" );523 migrateWarn( "swap", "jQuery.swap() is undocumented and deprecated" ); 449 524 } 450 525 … … 463 538 464 539 return ret; 465 } ;540 }, "swap" ); 466 541 467 542 if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) { 468 469 543 jQuery.cssProps = new Proxy( jQuery.cssProps || {}, { 470 544 set: function() { 471 migrateWarn( " JQMIGRATE:jQuery.cssProps is deprecated" );545 migrateWarn( "cssProps", "jQuery.cssProps is deprecated" ); 472 546 return Reflect.set.apply( this, arguments ); 473 547 } … … 475 549 } 476 550 477 // Create a dummy jQuery.cssNumber if missing. It won't be used by jQuery but 478 // it will prevent code adding new keys to it unconditionally from crashing. 479 if ( !jQuery.cssNumber ) { 480 jQuery.cssNumber = {}; 551 // In jQuery >=4 where jQuery.cssNumber is missing fill it with the latest 3.x version: 552 // https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233 553 // This way, number values for the CSS properties below won't start triggering 554 // Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438). 555 if ( jQueryVersionSince( "4.0.0" ) && typeof Proxy !== "undefined" ) { 556 jQuery.cssNumber = new Proxy( { 557 animationIterationCount: true, 558 columnCount: true, 559 fillOpacity: true, 560 flexGrow: true, 561 flexShrink: true, 562 fontWeight: true, 563 gridArea: true, 564 gridColumn: true, 565 gridColumnEnd: true, 566 gridColumnStart: true, 567 gridRow: true, 568 gridRowEnd: true, 569 gridRowStart: true, 570 lineHeight: true, 571 opacity: true, 572 order: true, 573 orphans: true, 574 widows: true, 575 zIndex: true, 576 zoom: true 577 }, { 578 get: function() { 579 migrateWarn( "css-number", "jQuery.cssNumber is deprecated" ); 580 return Reflect.get.apply( this, arguments ); 581 }, 582 set: function() { 583 migrateWarn( "css-number", "jQuery.cssNumber is deprecated" ); 584 return Reflect.set.apply( this, arguments ); 585 } 586 } ); 481 587 } 482 588 … … 490 596 } 491 597 492 o ldFnCss = jQuery.fn.css;493 494 jQuery.fn.css =function( name, value ) {598 origFnCss = jQuery.fn.css; 599 600 migratePatchFunc( jQuery.fn, "css", function( name, value ) { 495 601 var camelName, 496 602 origThis = this; 603 497 604 if ( name && typeof name === "object" && !Array.isArray( name ) ) { 498 605 jQuery.each( name, function( n, v ) { … … 501 608 return this; 502 609 } 610 503 611 if ( typeof value === "number" ) { 504 612 camelName = camelCase( name ); 505 613 if ( !isAutoPx( camelName ) && !jQuery.cssNumber[ camelName ] ) { 506 migrateWarn( "Number-typed values are deprecated for jQuery.fn.css( \"" + 614 migrateWarn( "css-number", 615 "Number-typed values are deprecated for jQuery.fn.css( \"" + 507 616 name + "\", value )" ); 508 617 } 509 618 } 510 619 511 return o ldFnCss.apply( this, arguments );512 } ;513 514 var o ldData = jQuery.data;515 516 jQuery.data =function( elem, name, value ) {620 return origFnCss.apply( this, arguments ); 621 }, "css-number" ); 622 623 var origData = jQuery.data; 624 625 migratePatchFunc( jQuery, "data", function( elem, name, value ) { 517 626 var curData, sameKeys, key; 518 627 519 628 // Name can be an object, and each entry in the object is meant to be set as data 520 629 if ( name && typeof name === "object" && arguments.length === 2 ) { 521 curData = jQuery.hasData( elem ) && oldData.call( this, elem ); 630 631 curData = jQuery.hasData( elem ) && origData.call( this, elem ); 522 632 sameKeys = {}; 523 633 for ( key in name ) { 524 634 if ( key !== camelCase( key ) ) { 525 migrateWarn( "jQuery.data() always sets/gets camelCased names: " + key ); 635 migrateWarn( "data-camelCase", 636 "jQuery.data() always sets/gets camelCased names: " + key ); 526 637 curData[ key ] = name[ key ]; 527 638 } else { … … 530 641 } 531 642 532 o ldData.call( this, elem, sameKeys );643 origData.call( this, elem, sameKeys ); 533 644 534 645 return name; … … 537 648 // If the name is transformed, look for the un-transformed name in the data object 538 649 if ( name && typeof name === "string" && name !== camelCase( name ) ) { 539 curData = jQuery.hasData( elem ) && oldData.call( this, elem ); 650 651 curData = jQuery.hasData( elem ) && origData.call( this, elem ); 540 652 if ( curData && name in curData ) { 541 migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name ); 653 migrateWarn( "data-camelCase", 654 "jQuery.data() always sets/gets camelCased names: " + name ); 542 655 if ( arguments.length > 2 ) { 543 656 curData[ name ] = value; … … 547 660 } 548 661 549 return o ldData.apply( this, arguments );550 } ;662 return origData.apply( this, arguments ); 663 }, "data-camelCase" ); 551 664 552 665 // Support jQuery slim which excludes the effects module … … 559 672 }; 560 673 561 jQuery.Tween.prototype.run =function( ) {674 migratePatchFunc( jQuery.Tween.prototype, "run", function( ) { 562 675 if ( jQuery.easing[ this.easing ].length > 1 ) { 563 676 migrateWarn( 677 "easing-one-arg", 564 678 "'jQuery.easing." + this.easing.toString() + "' should use only one argument" 565 679 ); … … 569 683 570 684 oldTweenRun.apply( this, arguments ); 571 } ;572 573 intervalValue = jQuery.fx.interval || 13;685 }, "easing-one-arg" ); 686 687 intervalValue = jQuery.fx.interval; 574 688 intervalMsg = "jQuery.fx.interval is deprecated"; 575 689 … … 583 697 get: function() { 584 698 if ( !window.document.hidden ) { 585 migrateWarn( intervalMsg );699 migrateWarn( "fx-interval", intervalMsg ); 586 700 } 587 return intervalValue; 701 702 // Only fallback to the default if patch is enabled 703 if ( !jQuery.migrateIsPatchEnabled( "fx-interval" ) ) { 704 return intervalValue; 705 } 706 return intervalValue === undefined ? 13 : intervalValue; 588 707 }, 589 708 set: function( newValue ) { 590 migrateWarn( intervalMsg );709 migrateWarn( "fx-interval", intervalMsg ); 591 710 intervalValue = newValue; 592 711 } … … 604 723 605 724 migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat, 725 "event-old-patch", 606 726 "jQuery.event.props.concat() is deprecated and removed" ); 607 727 608 jQuery.event.fix =function( originalEvent ) {728 migratePatchFunc( jQuery.event, "fix", function( originalEvent ) { 609 729 var event, 610 730 type = originalEvent.type, … … 613 733 614 734 if ( props.length ) { 615 migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() ); 735 migrateWarn( "event-old-patch", 736 "jQuery.event.props are deprecated and removed: " + props.join() ); 616 737 while ( props.length ) { 617 738 jQuery.event.addProp( props.pop() ); … … 621 742 if ( fixHook && !fixHook._migrated_ ) { 622 743 fixHook._migrated_ = true; 623 migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type ); 744 migrateWarn( "event-old-patch", 745 "jQuery.event.fixHooks are deprecated and removed: " + type ); 624 746 if ( ( props = fixHook.props ) && props.length ) { 625 747 while ( props.length ) { … … 631 753 event = originalFix.call( this, originalEvent ); 632 754 633 return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 634 }; 635 636 jQuery.event.add = function( elem, types ) { 755 return fixHook && fixHook.filter ? 756 fixHook.filter( event, originalEvent ) : 757 event; 758 }, "event-old-patch" ); 759 760 migratePatchFunc( jQuery.event, "add", function( elem, types ) { 637 761 638 762 // This misses the multiple-types case but that seems awfully rare 639 763 if ( elem === window && types === "load" && window.document.readyState === "complete" ) { 640 migrateWarn( "jQuery(window).on('load'...) called after load event occurred" ); 764 migrateWarn( "load-after-event", 765 "jQuery(window).on('load'...) called after load event occurred" ); 641 766 } 642 767 return oldEventAdd.apply( this, arguments ); 643 } ;768 }, "load-after-event" ); 644 769 645 770 jQuery.each( [ "load", "unload", "error" ], function( _, name ) { 646 771 647 jQuery.fn[ name ] =function() {772 migratePatchFunc( jQuery.fn, name, function() { 648 773 var args = Array.prototype.slice.call( arguments, 0 ); 649 774 … … 656 781 } 657 782 658 migrateWarn( "jQuery.fn." + name + "() is deprecated" ); 783 migrateWarn( "shorthand-removed-v3", 784 "jQuery.fn." + name + "() is deprecated" ); 659 785 660 786 args.splice( 0, 0, name ); … … 669 795 this.triggerHandler.apply( this, args ); 670 796 return this; 671 } ;797 }, "shorthand-removed-v3" ); 672 798 673 799 } ); … … 679 805 680 806 // Handle event binding 681 jQuery.fn[ name ] = function( data, fn ) { 682 migrateWarn( "jQuery.fn." + name + "() event shorthand is deprecated" ); 807 migratePatchAndWarnFunc( jQuery.fn, name, function( data, fn ) { 683 808 return arguments.length > 0 ? 684 809 this.on( name, null, data, fn ) : 685 810 this.trigger( name ); 686 }; 811 }, 812 "shorthand-deprecated-v3", 813 "jQuery.fn." + name + "() event shorthand is deprecated" ); 687 814 } ); 688 815 … … 695 822 setup: function() { 696 823 if ( this === window.document ) { 697 migrateWarn( " 'ready' event is deprecated" );824 migrateWarn( "ready-event", "'ready' event is deprecated" ); 698 825 } 699 826 } 700 827 }; 701 828 702 jQuery.fn.extend( { 703 704 bind: function( types, data, fn ) { 705 migrateWarn( "jQuery.fn.bind() is deprecated" ); 706 return this.on( types, null, data, fn ); 707 }, 708 unbind: function( types, fn ) { 709 migrateWarn( "jQuery.fn.unbind() is deprecated" ); 710 return this.off( types, null, fn ); 711 }, 712 delegate: function( selector, types, data, fn ) { 713 migrateWarn( "jQuery.fn.delegate() is deprecated" ); 714 return this.on( types, selector, data, fn ); 715 }, 716 undelegate: function( selector, types, fn ) { 717 migrateWarn( "jQuery.fn.undelegate() is deprecated" ); 718 return arguments.length === 1 ? 719 this.off( selector, "**" ) : 720 this.off( types, selector || "**", fn ); 721 }, 722 hover: function( fnOver, fnOut ) { 723 migrateWarn( "jQuery.fn.hover() is deprecated" ); 724 return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver ); 725 } 726 } ); 829 migratePatchAndWarnFunc( jQuery.fn, "bind", function( types, data, fn ) { 830 return this.on( types, null, data, fn ); 831 }, "pre-on-methods", "jQuery.fn.bind() is deprecated" ); 832 migratePatchAndWarnFunc( jQuery.fn, "unbind", function( types, fn ) { 833 return this.off( types, null, fn ); 834 }, "pre-on-methods", "jQuery.fn.unbind() is deprecated" ); 835 migratePatchAndWarnFunc( jQuery.fn, "delegate", function( selector, types, data, fn ) { 836 return this.on( types, selector, data, fn ); 837 }, "pre-on-methods", "jQuery.fn.delegate() is deprecated" ); 838 migratePatchAndWarnFunc( jQuery.fn, "undelegate", function( selector, types, fn ) { 839 return arguments.length === 1 ? 840 this.off( selector, "**" ) : 841 this.off( types, selector || "**", fn ); 842 }, "pre-on-methods", "jQuery.fn.undelegate() is deprecated" ); 843 migratePatchAndWarnFunc( jQuery.fn, "hover", function( fnOver, fnOut ) { 844 return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver ); 845 }, "pre-on-methods", "jQuery.fn.hover() is deprecated" ); 727 846 728 847 var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, 729 origHtmlPrefilter = jQuery.htmlPrefilter,730 848 makeMarkup = function( html ) { 731 849 var doc = window.document.implementation.createHTMLDocument( "" ); … … 736 854 var changed = html.replace( rxhtmlTag, "<$1></$2>" ); 737 855 if ( changed !== html && makeMarkup( html ) !== makeMarkup( changed ) ) { 738 migrateWarn( "HTML tags must be properly nested and closed: " + html ); 856 migrateWarn( "self-closed-tags", 857 "HTML tags must be properly nested and closed: " + html ); 739 858 } 740 859 }; 741 860 861 /** 862 * Deprecated, please use `jQuery.migrateDisablePatches( "self-closed-tags" )` instead. 863 * @deprecated 864 */ 742 865 jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() { 743 jQuery.htmlPrefilter = function( html ) { 744 warnIfChanged( html ); 745 return html.replace( rxhtmlTag, "<$1></$2>" ); 746 }; 866 jQuery.migrateEnablePatches( "self-closed-tags" ); 747 867 }; 748 868 749 jQuery.htmlPrefilter =function( html ) {869 migratePatchFunc( jQuery, "htmlPrefilter", function( html ) { 750 870 warnIfChanged( html ); 751 return origHtmlPrefilter( html ); 752 }; 753 754 var oldOffset = jQuery.fn.offset; 755 756 jQuery.fn.offset = function() { 871 return html.replace( rxhtmlTag, "<$1></$2>" ); 872 }, "self-closed-tags" ); 873 874 // This patch needs to be disabled by default as it re-introduces 875 // security issues (CVE-2020-11022, CVE-2020-11023). 876 jQuery.migrateDisablePatches( "self-closed-tags" ); 877 878 var origOffset = jQuery.fn.offset; 879 880 migratePatchFunc( jQuery.fn, "offset", function() { 757 881 var elem = this[ 0 ]; 758 882 759 883 if ( elem && ( !elem.nodeType || !elem.getBoundingClientRect ) ) { 760 migrateWarn( " jQuery.fn.offset() requires a valid DOM element" );884 migrateWarn( "offset-valid-elem", "jQuery.fn.offset() requires a valid DOM element" ); 761 885 return arguments.length ? this : undefined; 762 886 } 763 887 764 return o ldOffset.apply( this, arguments );765 } ;888 return origOffset.apply( this, arguments ); 889 }, "offset-valid-elem" ); 766 890 767 891 // Support jQuery slim which excludes the ajax module … … 770 894 if ( jQuery.ajax ) { 771 895 772 var o ldParam = jQuery.param;773 774 jQuery.param =function( data, traditional ) {896 var origParam = jQuery.param; 897 898 migratePatchFunc( jQuery, "param", function( data, traditional ) { 775 899 var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 776 900 777 901 if ( traditional === undefined && ajaxTraditional ) { 778 902 779 migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" ); 903 migrateWarn( "param-ajax-traditional", 904 "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" ); 780 905 traditional = ajaxTraditional; 781 906 } 782 907 783 return oldParam.call( this, data, traditional ); 784 }; 785 786 } 787 788 var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; 789 790 jQuery.fn.andSelf = function() { 791 migrateWarn( "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" ); 792 return oldSelf.apply( this, arguments ); 793 }; 908 return origParam.call( this, data, traditional ); 909 }, "param-ajax-traditional" ); 910 911 } 912 913 migratePatchAndWarnFunc( jQuery.fn, "andSelf", jQuery.fn.addBack, "andSelf", 914 "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" ); 794 915 795 916 // Support jQuery slim which excludes the deferred module in jQuery 4.0+ … … 808 929 ]; 809 930 810 jQuery.Deferred =function( func ) {931 migratePatchFunc( jQuery, "Deferred", function( func ) { 811 932 var deferred = oldDeferred(), 812 933 promise = deferred.promise(); 813 934 814 deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) {935 function newDeferredPipe( /* fnDone, fnFail, fnProgress */ ) { 815 936 var fns = arguments; 816 817 migrateWarn( "deferred.pipe() is deprecated" );818 937 819 938 return jQuery.Deferred( function( newDefer ) { … … 841 960 fns = null; 842 961 } ).promise(); 843 844 }; 962 } 963 964 migratePatchAndWarnFunc( deferred, "pipe", newDeferredPipe, "deferred-pipe", 965 "deferred.pipe() is deprecated" ); 966 migratePatchAndWarnFunc( promise, "pipe", newDeferredPipe, "deferred-pipe", 967 "deferred.pipe() is deprecated" ); 845 968 846 969 if ( func ) { … … 849 972 850 973 return deferred; 851 } ;974 }, "deferred-pipe" ); 852 975 853 976 // Preserve handler of uncaught exceptions in promise chains -
trunk/src/js/_enqueues/vendor/jquery/jquery-migrate.min.js
r49649 r55237 1 /*! jQuery Migrate v3. 3.2| (c) OpenJS Foundation and other contributors | jquery.org/license */2 "undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[], i=1;i<=3;i++){if(+o[i]<+n[i])return 1;if(+n[i]<+o[i])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.3.2",n.console&&n.console.log&&(s&&e("3.0.0")||n.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var r={};function u(e){var t=n.console;s.migrateDeduplicateWarnings&&r[e]||(r[e]=!0,s.migrateWarnings.push(e),t&&t.warn&&!s.migrateMute&&(t.warn("JQMIGRATE: "+e),s.migrateTrace&&t.trace&&t.trace()))}function t(e,t,r,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n),r},set:function(e){u(n),r=e}})}function o(e,t,r,n){e[t]=function(){return u(n),r.apply(this,arguments)}}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){r={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("jQuery is not compatible with Quirks Mode");var i,a,c,d={},l=s.fn.init,p=s.find,f=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,y=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,m=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;for(i in s.fn.init=function(e){var t=Array.prototype.slice.call(arguments);return"string"==typeof e&&"#"===e&&(u("jQuery( '#' ) is not a valid selector"),t[0]=[]),l.apply(this,t)},s.fn.init.prototype=s.fn,s.find=function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&f.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(y,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("Attribute selector with '#' was not fixed: "+r[0])}}return p.apply(this,r)},p)Object.prototype.hasOwnProperty.call(p,i)&&(s.find[i]=p[i]);o(s.fn,"size",function(){return this.length},"jQuery.fn.size() is deprecated and removed; use the .length property"),o(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"jQuery.parseJSON is deprecated; use JSON.parse"),o(s,"holdReady",s.holdReady,"jQuery.holdReady is deprecated"),o(s,"unique",s.uniqueSort,"jQuery.unique is deprecated; use jQuery.uniqueSort"),t(s.expr,"filters",s.expr.pseudos,"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),t(s.expr,":",s.expr.pseudos,"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&o(s,"trim",function(e){return null==e?"":(e+"").replace(m,"")},"jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(o(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"jQuery.nodeName is deprecated"),o(s,"isArray",Array.isArray,"jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(o(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){d["[object "+t+"]"]=t.toLowerCase()}),o(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[Object.prototype.toString.call(e)]||"object":typeof e},"jQuery.type is deprecated"),o(s,"isFunction",function(e){return"function"==typeof e},"jQuery.isFunction() is deprecated"),o(s,"isWindow",function(e){return null!=e&&e===e.window},"jQuery.isWindow() is deprecated")),s.ajax&&(a=s.ajax,c=/(=)\?(?=&|$)|\?\?/,s.ajax=function(){var e=a.apply(this,arguments);return e.promise&&(o(e,"success",e.done,"jQXHR.success is deprecated and removed"),o(e,"error",e.fail,"jQXHR.error is deprecated and removed"),o(e,"complete",e.always,"jQXHR.complete is deprecated and removed")),e},e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(c.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&c.test(e.data))&&u("JSON-to-JSONP auto-promotion is deprecated")}));var g=s.fn.removeAttr,h=s.fn.toggleClass,v=/\S+/g;function j(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}s.fn.removeAttr=function(e){var r=this;return s.each(e.match(v),function(e,t){s.expr.match.bool.test(t)&&(u("jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),g.apply(this,arguments)};var Q,b=!(s.fn.toggleClass=function(t){return void 0!==t&&"boolean"!=typeof t?h.apply(this,arguments):(u("jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))}),w=/^[a-z]/,x=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return b=!0,e=r.apply(this,arguments),b=!1,e})}),s.swap=function(e,t,r,n){var o,i,a={};for(i in b||u("jQuery.swap() is undocumented and deprecated"),t)a[i]=e.style[i],e.style[i]=t[i];for(i in o=r.apply(e,n||[]),t)e.style[i]=a[i];return o},e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("JQMIGRATE: jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),s.cssNumber||(s.cssNumber={}),Q=s.fn.css,s.fn.css=function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=j(e),n=r,w.test(n)&&x.test(n[0].toUpperCase()+n.slice(1))||s.cssNumber[r]||u('Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))};var A,k,S,M,N=s.data;s.data=function(e,t,r){var n,o,i;if(t&&"object"==typeof t&&2===arguments.length){for(i in n=s.hasData(e)&&N.call(this,e),o={},t)i!==j(i)?(u("jQuery.data() always sets/gets camelCased names: "+i),n[i]=t[i]):o[i]=t[i];return N.call(this,e,o),t}return t&&"string"==typeof t&&t!==j(t)&&(n=s.hasData(e)&&N.call(this,e))&&t in n?(u("jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):N.apply(this,arguments)},s.fx&&(S=s.Tween.prototype.run,M=function(e){return e},s.Tween.prototype.run=function(){1<s.easing[this.easing].length&&(u("'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=M),S.apply(this,arguments)},A=s.fx.interval||13,k="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u(k),A},set:function(e){u(k),A=e}}));var R=s.fn.load,H=s.event.add,C=s.event.fix;s.event.props=[],s.event.fixHooks={},t(s.event.props,"concat",s.event.props.concat,"jQuery.event.props.concat() is deprecated and removed"),s.event.fix=function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=C.call(this,e),n&&n.filter?n.filter(t,e):t},s.event.add=function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("jQuery(window).on('load'...) called after load event occurred"),H.apply(this,arguments)},s.each(["load","unload","error"],function(e,t){s.fn[t]=function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?R.apply(this,e):(u("jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))}}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){s.fn[r]=function(e,t){return u("jQuery.fn."+r+"() event shorthand is deprecated"),0<arguments.length?this.on(r,null,e,t):this.trigger(r)}}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("'ready' event is deprecated")}},s.fn.extend({bind:function(e,t,r){return u("jQuery.fn.bind() is deprecated"),this.on(e,null,t,r)},unbind:function(e,t){return u("jQuery.fn.unbind() is deprecated"),this.off(e,null,t)},delegate:function(e,t,r,n){return u("jQuery.fn.delegate() is deprecated"),this.on(t,e,r,n)},undelegate:function(e,t,r){return u("jQuery.fn.undelegate() is deprecated"),1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},hover:function(e,t){return u("jQuery.fn.hover() is deprecated"),this.on("mouseenter",e).on("mouseleave",t||e)}});function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}function P(e){var t=e.replace(O,"<$1></$2>");t!==e&&T(e)!==T(t)&&u("HTML tags must be properly nested and closed: "+e)}var O=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,q=s.htmlPrefilter;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.htmlPrefilter=function(e){return P(e),e.replace(O,"<$1></$2>")}},s.htmlPrefilter=function(e){return P(e),q(e)};var D,_=s.fn.offset;s.fn.offset=function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?_.apply(this,arguments):(u("jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},s.ajax&&(D=s.param,s.param=function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)});var E,F,J=s.fn.andSelf||s.fn.addBack;return s.fn.andSelf=function(){return u("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),J.apply(this,arguments)},s.Deferred&&(E=s.Deferred,F=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],s.Deferred=function(e){var i=E(),a=i.promise();return i.pipe=a.pipe=function(){var o=arguments;return u("deferred.pipe() is deprecated"),s.Deferred(function(n){s.each(F,function(e,t){var r="function"==typeof o[e]&&o[e];i[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===a?n.promise():this,r?[e]:arguments)})}),o=null}).promise()},e&&e.call(i,i),i},s.Deferred.exceptionHook=E.exceptionHook),s});1 /*! jQuery Migrate v3.4.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 2 "undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+n[a]>+o[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.0";var t=Object.create(null),o=(s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")||n.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion)),{});function i(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return i(n,o),r},set:function(e){i(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&i(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function u(e,t,r,n,o){if(!o)throw new Error("No warning message provided");a(e,t,r,n,o)}function d(e,t,r,n){a(e,t,r,n)}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&i("quirks","jQuery is not compatible with Quirks Mode");var c,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;for(c in d(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(i("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,d(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(g,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),i("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){i("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,c)&&(s.find[c]=y[c]);u(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),u(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),u(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),u(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&u(s,"trim",function(e){return null==e?"":(e+"").replace(v,"")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(u(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),u(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(u(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),u(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),u(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),u(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,d(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(u(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),u(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),u(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&i("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,w=/\S+/g;function Q(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}d(s.fn,"removeAttr",function(e){var r=this;return s.each(e.match(w),function(e,t){s.expr.match.bool.test(t)&&(i("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),d(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(i("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var x,A=!1,R=/^[a-z]/,T=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return A=!0,e=r.apply(this,arguments),A=!1,e})}),d(s,"swap",function(e,t,r,n){var o,a={};for(o in A||i("swap","jQuery.swap() is undocumented and deprecated"),t)a[o]=e.style[o],e.style[o]=t[o];for(o in r=r.apply(e,n||[]),t)e.style[o]=a[o];return r},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return i("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")&&"undefined"!=typeof Proxy&&(s.cssNumber=new Proxy({animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},{get:function(){return i("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return i("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}})),x=s.fn.css,d(s.fn,"css",function(e,t){var r,n=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(n,e,t)}),this):("number"==typeof t&&(t=Q(e),r=t,R.test(r)&&T.test(r[0].toUpperCase()+r.slice(1))||s.cssNumber[t]||i("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),x.apply(this,arguments))},"css-number");function C(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var S,N,P,k,H,E,M,q=s.data,D=(d(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&q.call(this,e),o={},t)a!==Q(a)?(i("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return q.call(this,e,o),t}return t&&"string"==typeof t&&t!==Q(t)&&(n=s.hasData(e)&&q.call(this,e))&&t in n?(i("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):q.apply(this,arguments)},"data-camelCase"),s.fx&&(P=s.Tween.prototype.run,k=function(e){return e},d(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(i("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=k),P.apply(this,arguments)},"easing-one-arg"),S=s.fx.interval,N="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||i("fx-interval",N),s.migrateIsPatchEnabled("fx-interval")&&void 0===S?13:S},set:function(e){i("fx-interval",N),S=e}})),s.fn.load),F=s.event.add,W=s.event.fix,O=(s.event.props=[],s.event.fixHooks={},r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),d(s.event,"fix",function(e){var t=e.type,r=this.fixHooks[t],n=s.event.props;if(n.length){i("event-old-patch","jQuery.event.props are deprecated and removed: "+n.join());while(n.length)s.event.addProp(n.pop())}if(r&&!r._migrated_&&(r._migrated_=!0,i("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+t),(n=r.props)&&n.length))while(n.length)s.event.addProp(n.pop());return t=W.call(this,e),r&&r.filter?r.filter(t,e):t},"event-old-patch"),d(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&i("load-after-event","jQuery(window).on('load'...) called after load event occurred"),F.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){d(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?D.apply(this,e):(i("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){u(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&i("ready-event","'ready' event is deprecated")}},u(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),u(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),u(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),u(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),u(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated"),/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi),_=(s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},d(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(O,"<$1></$2>"))!==t&&C(t)!==C(r)&&i("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(O,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags"),s.fn.offset);return d(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?_.apply(this,arguments):(i("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(H=s.param,d(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(i("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),H.call(this,e,t)},"param-ajax-traditional")),u(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(E=s.Deferred,M=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],d(s,"Deferred",function(e){var a=E(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(M,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return u(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),u(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=E.exceptionHook),s}); -
trunk/src/wp-includes/script-loader.php
r55192 r55237 825 825 $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '3.6.3' ); 826 826 $scripts->add( 'jquery-core', "/wp-includes/js/jquery/jquery$suffix.js", array(), '3.6.3' ); 827 $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '3. 3.2' );827 $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '3.4.0' ); 828 828 829 829 // Full jQuery UI.
Note: See TracChangeset
for help on using the changeset viewer.