Remove redundant closure aliases

'mw' are '$' are globals, always have been, and aren't going
anywhere. They're every bit as real as their longer versions.
If anything, the longer ones are less "real" or 'stable" because
they're not used internally by RL and easier to accidentally
replace or override. For anecdotes and history, see 91f950d6b0.

Change-Id: I526fb8c961d9477992d88f2780a0ff4cbdc51923
This commit is contained in:
Timo Tijhof
2018-09-06 22:55:46 +01:00
committed by Krinkle
parent e58be7c411
commit 4e067715dc
18 changed files with 43 additions and 36 deletions

View File

@@ -2,11 +2,11 @@
"extends": "wikimedia", "extends": "wikimedia",
"env": { "env": {
"browser": true, "browser": true,
"jquery": true,
"qunit": true "qunit": true
}, },
"globals": { "globals": {
"mediaWiki": false, "$": false,
"mw": false,
"OO": false "OO": false
}, },
"rules": { "rules": {

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
/* /*
@@ -211,4 +211,4 @@
return unique; return unique;
}; };
}( jQuery, mediaWiki ) ); }() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var DEFAULT_LIST_SIZE = 9; var DEFAULT_LIST_SIZE = 9;
@@ -527,4 +527,4 @@
$( createCompactList ); $( createCompactList );
} }
}( jQuery, mediaWiki ) ); }() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var template = '<div class="uls-display-settings">' + var template = '<div class="uls-display-settings">' +
@@ -733,4 +733,4 @@
$.fn.languagesettings.modules = $.extend( $.fn.languagesettings.modules, { $.fn.languagesettings.modules = $.extend( $.fn.languagesettings.modules, {
display: DisplaySettings display: DisplaySettings
} ); } );
}( jQuery, mediaWiki ) ); }() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
/** /**
@@ -245,4 +245,4 @@
mw.uls = mw.uls || {}; mw.uls = mw.uls || {};
mw.uls.eventlogger = new ULSEventLogger(); mw.uls.eventlogger = new ULSEventLogger();
}( jQuery, mediaWiki ) ); }() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var geo, var geo,
@@ -44,4 +44,5 @@
window.Geo = data; window.Geo = data;
mw.cookie.set( 'ULSGeo', JSON.stringify( data ), cacheAge ); mw.cookie.set( 'ULSGeo', JSON.stringify( data ), cacheAge );
} ); } );
}( jQuery, mediaWiki ) );
}() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
mw.uls = mw.uls || {}; mw.uls = mw.uls || {};
@@ -58,4 +58,4 @@
); );
}; };
}( jQuery, mediaWiki ) ); }() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var mwImeRulesPath, inputSelector, inputPreferences, ulsIMEPreferences, customHelpLink; var mwImeRulesPath, inputSelector, inputPreferences, ulsIMEPreferences, customHelpLink;
@@ -323,4 +323,5 @@
} ); } );
} }
}; };
}( jQuery, mediaWiki ) );
}() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var template = '<div class="uls-input-settings">' + var template = '<div class="uls-input-settings">' +
@@ -591,4 +591,4 @@
input: InputSettings input: InputSettings
} ); } );
}( jQuery, mediaWiki ) ); }() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
/** /**
@@ -448,4 +448,5 @@
} else { } else {
$( init ); $( init );
} }
}( jQuery, mediaWiki ) );
}() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var closeRow, settingsMenu, settingsPanel, windowTemplate, panelsRow, buttonsRow; var closeRow, settingsMenu, settingsPanel, windowTemplate, panelsRow, buttonsRow;
@@ -314,4 +314,5 @@
}; };
$.fn.languagesettings.Constructor = LanguageSettings; $.fn.languagesettings.Constructor = LanguageSettings;
}( jQuery, mediaWiki ) );
}() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
// MediaWiki overrides for ULS defaults // MediaWiki overrides for ULS defaults
@@ -30,4 +30,5 @@
$.fn.uls.Constructor.prototype.render = function () { $.fn.uls.Constructor.prototype.render = function () {
this.$languageFilter.addClass( 'noime' ); this.$languageFilter.addClass( 'noime' );
}; };
}( jQuery, mediaWiki ) );
}() );

View File

@@ -18,7 +18,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var ULSPreferences; var ULSPreferences;
@@ -155,4 +155,4 @@
return data; return data;
}; };
}( jQuery, mediaWiki ) ); }() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var ulsPreferences; var ulsPreferences;
@@ -138,4 +138,5 @@
mw.loader.using( 'ext.uls.webfonts.fonts', mw.webfonts.setup ); mw.loader.using( 'ext.uls.webfonts.fonts', mw.webfonts.setup );
} }
} ); } );
}( jQuery, mediaWiki ) );
}() );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
var mediawikiFontRepository; var mediawikiFontRepository;
@@ -47,4 +47,5 @@
$( 'body' ).webfonts(); $( 'body' ).webfonts();
} ); } );
}( jQuery, mediaWiki ) );
}() );

View File

@@ -1,5 +1,5 @@
// Do not edit! This file is generated from data/fontrepo by scripts/compile-font-repo.php // Do not edit! This file is generated from data/fontrepo by scripts/compile-font-repo.php
( function ( $ ) { ( function () {
$.webfonts = $.webfonts || {}; $.webfonts = $.webfonts || {};
$.webfonts.repository = { $.webfonts.repository = {
"base": "../data/fontrepo/fonts/", "base": "../data/fontrepo/fonts/",
@@ -761,4 +761,4 @@
} }
} }
}; };
}( jQuery ) ); }() );

View File

@@ -34,10 +34,10 @@ class CompileFontRepo extends Maintenance {
$json = FormatJson::encode( $list, "\t" ); $json = FormatJson::encode( $list, "\t" );
$js = <<<JAVASCRIPT $js = <<<JAVASCRIPT
// Do not edit! This file is generated from data/fontrepo by scripts/compile-font-repo.php // Do not edit! This file is generated from data/fontrepo by scripts/compile-font-repo.php
( function ( $ ) { ( function () {
$.webfonts = $.webfonts || {}; $.webfonts = $.webfonts || {};
$.webfonts.repository = $json; $.webfonts.repository = $json;
}( jQuery ) ); }() );
JAVASCRIPT; JAVASCRIPT;
file_put_contents( "$base/resources/js/ext.uls.webfonts.repository.js", $js ); file_put_contents( "$base/resources/js/ext.uls.webfonts.repository.js", $js );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $, mw ) { ( function () {
'use strict'; 'use strict';
QUnit.module( 'ext.uls', QUnit.newMwEnvironment() ); QUnit.module( 'ext.uls', QUnit.newMwEnvironment() );
@@ -88,4 +88,4 @@
'Tagalog is one of the languages presented to users in the Philippines.' 'Tagalog is one of the languages presented to users in the Philippines.'
); );
} ); } );
}( jQuery, mediaWiki ) ); }() );