dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "registration: Only allow one extension to set a specific config setting"
[lhc/web/wiklou.git]
/
resources
/
lib
/
jquery
/
jquery.migrate.js
diff --git
a/resources/lib/jquery/jquery.migrate.js
b/resources/lib/jquery/jquery.migrate.js
index
12212ff
..
992a734
100644
(file)
--- a/
resources/lib/jquery/jquery.migrate.js
+++ b/
resources/lib/jquery/jquery.migrate.js
@@
-1,12
+1,11
@@
/*!
/*!
- * jQuery Migrate - v3.0.1
-pre - 2017-08-17
+ * jQuery Migrate - v3.0.1
- 2017-09-26
* Copyright jQuery Foundation and other contributors
*
* Patched for MediaWiki:
* Copyright jQuery Foundation and other contributors
*
* Patched for MediaWiki:
- * - Preserve handler of uncaught exceptions in promise chains
- * https://gerrit.wikimedia.org/r/#/c/360999/
- * https://github.com/jquery/jquery-migrate/pull/262
* - Add mw.track instrumentation for statistics.
* - Add mw.track instrumentation for statistics.
+ * - Disable jQuery.migrateTrace by default. They are slow and
+ * redundant given console.warn() already provides a trace.
*/
;( function( factory ) {
if ( typeof define === "function" && define.amd ) {
*/
;( function( factory ) {
if ( typeof define === "function" && define.amd ) {
@@
-27,35
+26,31
@@
"use strict";
"use strict";
-jQuery.migrateVersion = "3.0.1
-pre
";
+jQuery.migrateVersion = "3.0.1";
/* exported migrateWarn, migrateWarnFunc, migrateWarnProp */
( function() {
/* exported migrateWarn, migrateWarnFunc, migrateWarnProp */
( function() {
+ var rbadVersions = /^[12]\./;
+
// Support: IE9 only
// IE9 only creates console object when dev tools are first opened
// Support: IE9 only
// IE9 only creates console object when dev tools are first opened
- // Also, avoid Function#bind here to simplify PhantomJS usage
- var log = window.console && window.console.log &&
- function() {
- window.console.log.apply( window.console, arguments );
- },
- rbadVersions = /^[12]\./;
-
- if ( !log ) {
+ // IE9 console is a host object, callable but doesn't have .apply()
+ if ( !window.console || !window.console.log ) {
return;
}
// Need jQuery 3.0.0+ and no older Migrate loaded
if ( !jQuery || rbadVersions.test( jQuery.fn.jquery ) ) {
return;
}
// Need jQuery 3.0.0+ and no older Migrate loaded
if ( !jQuery || rbadVersions.test( jQuery.fn.jquery ) ) {
- log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
+
window.console.
log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
}
if ( jQuery.migrateWarnings ) {
}
if ( jQuery.migrateWarnings ) {
- log( "JQMIGRATE: Migrate plugin loaded multiple times" );
+
window.console.
log( "JQMIGRATE: Migrate plugin loaded multiple times" );
}
// Show a message on the console so devs know we're active
}
// Show a message on the console so devs know we're active
- log( "JQMIGRATE: Migrate is installed" +
+
window.console.
log( "JQMIGRATE: Migrate is installed" +
( jQuery.migrateMute ? "" : " with logging active" ) +
", version " + jQuery.migrateVersion );
( jQuery.migrateMute ? "" : " with logging active" ) +
", version " + jQuery.migrateVersion );
@@
-68,7
+63,8
@@
jQuery.migrateWarnings = [];
// Set to false to disable traces that appear with warnings
if ( jQuery.migrateTrace === undefined ) {
// Set to false to disable traces that appear with warnings
if ( jQuery.migrateTrace === undefined ) {
- jQuery.migrateTrace = true;
+ // PATCH: Disable extra console.trace() call --Krinkle
+ jQuery.migrateTrace = false;
}
// Forget any warnings we've already given; public
}
// Forget any warnings we've already given; public
@@
-83,7
+79,9
@@
function migrateWarn( msg ) {
warnedAbout[ msg ] = true;
jQuery.migrateWarnings.push( msg );
// PATCH: Add instrumentation for statistics --Krinkle
warnedAbout[ msg ] = true;
jQuery.migrateWarnings.push( msg );
// PATCH: Add instrumentation for statistics --Krinkle
- mw.track( "mw.deprecate", "jquery-migrate" );
+ if ( window.mw && window.mw.track ) {
+ window.mw.track( "mw.deprecate", "jquery-migrate" );
+ }
if ( console && console.warn && !jQuery.migrateMute ) {
console.warn( "JQMIGRATE: " + msg );
if ( jQuery.migrateTrace && console.trace ) {
if ( console && console.warn && !jQuery.migrateMute ) {
console.warn( "JQMIGRATE: " + msg );
if ( jQuery.migrateTrace && console.trace ) {
@@
-212,6
+210,9
@@
jQuery.isNumeric = function( val ) {
return oldValue;
};
return oldValue;
};
+migrateWarnFunc( jQuery, "holdReady", jQuery.holdReady,
+ "jQuery.holdReady is deprecated" );
+
migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort,
"jQuery.unique is deprecated; use jQuery.uniqueSort" );
migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort,
"jQuery.unique is deprecated; use jQuery.uniqueSort" );
@@
-373,19
+374,17
@@
jQuery.data = function( elem, name, value ) {
};
var oldTweenRun = jQuery.Tween.prototype.run;
};
var oldTweenRun = jQuery.Tween.prototype.run;
+var linearEasing = function( pct ) {
+ return pct;
+ };
jQuery.Tween.prototype.run = function( ) {
if ( jQuery.easing[ this.easing ].length > 1 ) {
migrateWarn(
jQuery.Tween.prototype.run = function( ) {
if ( jQuery.easing[ this.easing ].length > 1 ) {
migrateWarn(
- "easing function " +
- "\"jQuery.easing." + this.easing.toString() +
- "\" should use only first argument"
+ "'jQuery.easing." + this.easing.toString() + "' should use only one argument"
);
);
- var oldEasing = jQuery.easing[ this.easing ];
- jQuery.easing[ this.easing ] = function( percent ) {
- return oldEasing.call( jQuery.easing, percent, percent, 0, 1, 1 );
- }.bind( this );
+ jQuery.easing[ this.easing ] = linearEasing;
}
oldTweenRun.apply( this, arguments );
}
oldTweenRun.apply( this, arguments );
@@
-509,6
+508,10
@@
jQuery.fn.extend( {
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
+ },
+ hover: function( fnOver, fnOut ) {
+ migrateWarn( "jQuery.fn.hover() is deprecated" );
+ return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver );
}
} );
}
} );