From: jenkins-bot Date: Mon, 17 Sep 2018 18:41:32 +0000 (+0000) Subject: Merge "resources: Strip '$' and 'mw' from file closures" X-Git-Tag: 1.34.0-rc.0~4078 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=fe94275c8fcfc248a5eae857dde7c5772d993ab5;hp=a2001cd3bf25c0bbad7d7f7c755d04510c34de28 Merge "resources: Strip '$' and 'mw' from file closures" --- diff --git a/.eslintrc.json b/.eslintrc.json index 4630e071e5..c0767517ea 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,8 +8,6 @@ "module": false, "mw": false, "$": false, - "mediaWiki": false, - "jQuery": false, "OO": false }, "rules": { diff --git a/mw-config/config.js b/mw-config/config.js index 99290f4453..74bdcf85b1 100644 --- a/mw-config/config.js +++ b/mw-config/config.js @@ -1,5 +1,5 @@ /* global extDependencyMap */ -( function ( $ ) { +( function () { $( function () { var $label, labelText; @@ -148,4 +148,4 @@ } ); } ); } ); -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery.spinner/spinner.js b/resources/src/jquery.spinner/spinner.js index 9079cc09b7..5024688677 100644 --- a/resources/src/jquery.spinner/spinner.js +++ b/resources/src/jquery.spinner/spinner.js @@ -5,7 +5,7 @@ * * @class jQuery.plugin.spinner */ -( function ( $ ) { +( function () { // Default options for new spinners, // stored outside the function to share between calls. @@ -111,4 +111,4 @@ * @mixins jQuery.plugin.spinner */ -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery.tablesorter/jquery.tablesorter.js b/resources/src/jquery.tablesorter/jquery.tablesorter.js index cbdc2fa9b3..a37bcf7b1d 100644 --- a/resources/src/jquery.tablesorter/jquery.tablesorter.js +++ b/resources/src/jquery.tablesorter/jquery.tablesorter.js @@ -43,7 +43,7 @@ * * @author Christian Bach/christian.bach@polyester.se */ -( function ( $, mw ) { +( function () { var ts, parsers = []; @@ -1281,4 +1281,4 @@ type: 'numeric' } ); -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/src/jquery.tipsy/jquery.tipsy.js b/resources/src/jquery.tipsy/jquery.tipsy.js index ddda432f32..a5e51843de 100644 --- a/resources/src/jquery.tipsy/jquery.tipsy.js +++ b/resources/src/jquery.tipsy/jquery.tipsy.js @@ -6,7 +6,7 @@ // * This installation of tipsy includes several local modifications to both Javascript and CSS. // Please be careful when upgrading. -( function ( mw, $ ) { +( function () { function maybeCall(thing, ctx) { return (typeof thing == 'function') ? (thing.call(ctx)) : thing; @@ -278,4 +278,4 @@ } }; -}( mediaWiki, jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.accessKeyLabel.js b/resources/src/jquery/jquery.accessKeyLabel.js index 674f62cd74..cdc5808ca7 100644 --- a/resources/src/jquery/jquery.accessKeyLabel.js +++ b/resources/src/jquery/jquery.accessKeyLabel.js @@ -3,7 +3,7 @@ * * @class jQuery.plugin.accessKeyLabel */ -( function ( $, mw ) { +( function () { // Cached access key modifiers for used browser var cachedAccessKeyModifiers, @@ -236,4 +236,4 @@ * @mixins jQuery.plugin.accessKeyLabel */ -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/src/jquery/jquery.byteLength.js b/resources/src/jquery/jquery.byteLength.js index 5764ae90ad..2e1a338d56 100644 --- a/resources/src/jquery/jquery.byteLength.js +++ b/resources/src/jquery/jquery.byteLength.js @@ -12,7 +12,7 @@ * @param {string} str * @return {number} */ -mediaWiki.log.deprecate( jQuery, 'byteLength', require( 'mediawiki.String' ).byteLength, +mw.log.deprecate( $, 'byteLength', require( 'mediawiki.String' ).byteLength, 'Use require( \'mediawiki.String\' ).byteLength instead.', '$.byteLength' ); /** diff --git a/resources/src/jquery/jquery.checkboxShiftClick.js b/resources/src/jquery/jquery.checkboxShiftClick.js index d99e9f0a8b..63cf28c5b8 100644 --- a/resources/src/jquery/jquery.checkboxShiftClick.js +++ b/resources/src/jquery/jquery.checkboxShiftClick.js @@ -1,7 +1,7 @@ /** * @class jQuery.plugin.checkboxShiftClick */ -( function ( $ ) { +( function () { /** * Enable checkboxes to be checked or unchecked in a row by clicking one, @@ -40,4 +40,4 @@ * @mixins jQuery.plugin.checkboxShiftClick */ -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.color.js b/resources/src/jquery/jquery.color.js index 894cf863e8..6df02adf5b 100644 --- a/resources/src/jquery/jquery.color.js +++ b/resources/src/jquery/jquery.color.js @@ -7,7 +7,7 @@ * * - 2011-01-05: Forked for MediaWiki. See also jQuery.colorUtil plugin */ -( function ( $ ) { +( function () { function getColor( elem, attr ) { var color; @@ -52,4 +52,4 @@ }; } ); -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.colorUtil.js b/resources/src/jquery/jquery.colorUtil.js index d46d009909..009be1aa73 100644 --- a/resources/src/jquery/jquery.colorUtil.js +++ b/resources/src/jquery/jquery.colorUtil.js @@ -6,7 +6,7 @@ * Mostly based on other plugins and functions (linted and optimized a little). * Sources cited inline. */ -( function ( $ ) { +( function () { /** * @class jQuery.colorUtil * @singleton @@ -265,4 +265,4 @@ }; -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.confirmable.js b/resources/src/jquery/jquery.confirmable.js index 7931c8147f..028b4b9184 100644 --- a/resources/src/jquery/jquery.confirmable.js +++ b/resources/src/jquery/jquery.confirmable.js @@ -7,7 +7,7 @@ * * @class jQuery.plugin.confirmable */ -( function ( $ ) { +( function () { var identity = function ( data ) { return data; }; @@ -180,4 +180,4 @@ noTitle: undefined } }; -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.confirmable.mediawiki.js b/resources/src/jquery/jquery.confirmable.mediawiki.js index daf23a99c0..aa1e90e14c 100644 --- a/resources/src/jquery/jquery.confirmable.mediawiki.js +++ b/resources/src/jquery/jquery.confirmable.mediawiki.js @@ -4,7 +4,7 @@ * This file serves to inject our localised messages into it. */ -( function ( mw, $ ) { +( function () { $.fn.confirmable.defaultOptions.i18n = { space: mw.message( 'word-separator' ).text(), confirm: mw.message( 'confirmable-confirm', mw.user ).text(), @@ -13,4 +13,4 @@ yesTitle: undefined, noTitle: undefined }; -}( mediaWiki, jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.getAttrs.js b/resources/src/jquery/jquery.getAttrs.js index e00298f406..e464c90bd1 100644 --- a/resources/src/jquery/jquery.getAttrs.js +++ b/resources/src/jquery/jquery.getAttrs.js @@ -1,7 +1,7 @@ /** * @class jQuery.plugin.getAttrs */ -( function ( $ ) { +( function () { function serializeControls( controls ) { var i, data = {}, @@ -34,4 +34,4 @@ $.fn.serializeObject = function () { return serializeControls( this.serializeArray() ); }; -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.hidpi.js b/resources/src/jquery/jquery.hidpi.js index 7a7109cbc3..025e6c23e1 100644 --- a/resources/src/jquery/jquery.hidpi.js +++ b/resources/src/jquery/jquery.hidpi.js @@ -9,7 +9,7 @@ * * @class jQuery.plugin.hidpi */ -( function ( $ ) { +( function () { /** * Get reported or approximate device pixel ratio. @@ -174,4 +174,4 @@ * @mixins jQuery.plugin.hidpi */ -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.highlightText.js b/resources/src/jquery/jquery.highlightText.js index a14e3ebd38..782d7118fd 100644 --- a/resources/src/jquery/jquery.highlightText.js +++ b/resources/src/jquery/jquery.highlightText.js @@ -3,7 +3,7 @@ * TODO: Add a function for restoring the previous text. * TODO: Accept mappings for converting shortcuts like WP: to Wikipedia:. */ -( function ( $, mw ) { +( function () { $.highlightText = { @@ -94,4 +94,4 @@ } ); }; -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/src/jquery/jquery.lengthLimit.js b/resources/src/jquery/jquery.lengthLimit.js index 3823395c6b..26f8f9b1f3 100644 --- a/resources/src/jquery/jquery.lengthLimit.js +++ b/resources/src/jquery/jquery.lengthLimit.js @@ -1,7 +1,7 @@ /** * @class jQuery.plugin.lengthLimit */ -( function ( $, mw ) { +( function () { var eventKeys = [ @@ -211,4 +211,4 @@ * @class jQuery * @mixins jQuery.plugin.lengthLimit */ -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/src/jquery/jquery.localize.js b/resources/src/jquery/jquery.localize.js index 20dc1b20fe..ab269f0cff 100644 --- a/resources/src/jquery/jquery.localize.js +++ b/resources/src/jquery/jquery.localize.js @@ -1,7 +1,7 @@ /** * @class jQuery.plugin.localize */ -( function ( $, mw ) { +( function () { /** * Gets a localized message, using parameters from options if present. @@ -177,4 +177,4 @@ * @mixins jQuery.plugin.localize */ -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/src/jquery/jquery.makeCollapsible.js b/resources/src/jquery/jquery.makeCollapsible.js index 082603a5a0..43b8f0d667 100644 --- a/resources/src/jquery/jquery.makeCollapsible.js +++ b/resources/src/jquery/jquery.makeCollapsible.js @@ -10,7 +10,7 @@ * * @class jQuery.plugin.makeCollapsible */ -( function ( $, mw ) { +( function () { /** * Handler for a click on a collapsible toggler. * @@ -364,4 +364,4 @@ * @mixins jQuery.plugin.makeCollapsible */ -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/src/jquery/jquery.mw-jump.js b/resources/src/jquery/jquery.mw-jump.js index 5eae0bec8d..ad1c96dba4 100644 --- a/resources/src/jquery/jquery.mw-jump.js +++ b/resources/src/jquery/jquery.mw-jump.js @@ -1,7 +1,7 @@ /** * JavaScript to show jump links to motor-impaired users when they are focused. */ -jQuery( function ( $ ) { +$( function () { $( '.mw-jump' ).on( 'focus blur', 'a', function ( e ) { // Confusingly jQuery leaves e.type as focusout for delegated blur events diff --git a/resources/src/jquery/jquery.suggestions.js b/resources/src/jquery/jquery.suggestions.js index 35c6a5dfb7..f2d6a044f1 100644 --- a/resources/src/jquery/jquery.suggestions.js +++ b/resources/src/jquery/jquery.suggestions.js @@ -90,7 +90,7 @@ * input or not. */ -( function ( $, mw ) { +( function () { var hasOwn = Object.hasOwnProperty; @@ -775,4 +775,4 @@ * @mixins jQuery.plugin.suggestions */ -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/src/jquery/jquery.tabIndex.js b/resources/src/jquery/jquery.tabIndex.js index 5fb28aa34b..dab437d4f0 100644 --- a/resources/src/jquery/jquery.tabIndex.js +++ b/resources/src/jquery/jquery.tabIndex.js @@ -1,7 +1,7 @@ /** * @class jQuery.plugin.tabIndex */ -( function ( $ ) { +( function () { /** * Find the lowest tabindex in use within a selection. @@ -54,4 +54,4 @@ * @mixins jQuery.plugin.tabIndex */ -}( jQuery ) ); +}() ); diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index da882708b9..6b4ab979a1 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -19,7 +19,7 @@ * $textbox.textSelection( 'encapsulateSelection', { pre: '', post: '' } ); * // Result: Textbox contains 'This is bold!', with cursor before the '!' */ -( function ( $ ) { +( function () { /** * Do things to the selection in a `