Merge "Add .pipeline/ with dev image variant"
[lhc/web/wiklou.git] / resources / lib / jquery / jquery.migrate-3.0.1.patch
1 diff --git a/resources/lib/jquery/jquery.migrate.js b/resources/lib/jquery/jquery.migrate.js
2 index 6ba8af4a42..711e424a39 100644
3 --- a/resources/lib/jquery/jquery.migrate.js
4 +++ b/resources/lib/jquery/jquery.migrate.js
5 @@ -1,6 +1,14 @@
6 /*!
7 * jQuery Migrate - v3.0.1 - 2017-09-26
8 * Copyright jQuery Foundation and other contributors
9 + *
10 + * Patched for MediaWiki:
11 + * - Qualify the global lookup for 'jQuery' as 'window.jQuery',
12 + * because within mw.loader.implement() for 'jquery', the closure
13 + * specifies '$' and 'jQuery', which are undefined.
14 + * - Add mw.track instrumentation for statistics.
15 + * - Disable jQuery.migrateTrace by default. They are slow and
16 + * redundant given console.warn() already provides a trace.
17 */
18 ;( function( factory ) {
19 if ( typeof define === "function" && define.amd ) {
20 @@ -15,7 +23,8 @@
21 } else {
22
23 // Browser globals
24 - factory( jQuery, window );
25 + // PATCH: Qualify jQuery lookup as window.jQuery. --Krinkle
26 + factory( window.jQuery, window );
27 }
28 } )( function( jQuery, window ) {
29 "use strict";
30 @@ -58,7 +67,8 @@ jQuery.migrateWarnings = [];
31
32 // Set to false to disable traces that appear with warnings
33 if ( jQuery.migrateTrace === undefined ) {
34 - jQuery.migrateTrace = true;
35 + // PATCH: Disable extra console.trace() call --Krinkle
36 + jQuery.migrateTrace = false;
37 }
38
39 // Forget any warnings we've already given; public
40 @@ -72,6 +82,10 @@ function migrateWarn( msg ) {
41 if ( !warnedAbout[ msg ] ) {
42 warnedAbout[ msg ] = true;
43 jQuery.migrateWarnings.push( msg );
44 + // PATCH: Add instrumentation for statistics --Krinkle
45 + if ( window.mw && window.mw.track ) {
46 + window.mw.track( "mw.deprecate", "jquery-migrate" );
47 + }
48 if ( console && console.warn && !jQuery.migrateMute ) {
49 console.warn( "JQMIGRATE: " + msg );
50 if ( jQuery.migrateTrace && console.trace ) {
51 @@ -466,20 +480,6 @@ jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
52
53 } );
54
55 -jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
56 - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
57 - "change select submit keydown keypress keyup contextmenu" ).split( " " ),
58 - function( i, name ) {
59 -
60 - // Handle event binding
61 - jQuery.fn[ name ] = function( data, fn ) {
62 - migrateWarn( "jQuery.fn." + name + "() event shorthand is deprecated" );
63 - return arguments.length > 0 ?
64 - this.on( name, null, data, fn ) :
65 - this.trigger( name );
66 - };
67 -} );
68 -
69 // Trigger "ready" event only once, on document ready
70 jQuery( function() {
71 jQuery( window.document ).triggerHandler( "ready" );