diff --git a/.eslintrc.json b/.eslintrc.json index 1dc4bf01..f8d3c1bc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,11 +2,11 @@ "extends": "wikimedia", "env": { "browser": true, - "jquery": true, "qunit": true }, "globals": { - "mediaWiki": false, + "$": false, + "mw": false, "OO": false }, "rules": { diff --git a/resources/js/ext.uls.common.js b/resources/js/ext.uls.common.js index a9e6a285..d70bff35 100644 --- a/resources/js/ext.uls.common.js +++ b/resources/js/ext.uls.common.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; /* @@ -211,4 +211,4 @@ return unique; }; -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/js/ext.uls.compactlinks.js b/resources/js/ext.uls.compactlinks.js index 20f02d00..f80d057b 100644 --- a/resources/js/ext.uls.compactlinks.js +++ b/resources/js/ext.uls.compactlinks.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var DEFAULT_LIST_SIZE = 9; @@ -527,4 +527,4 @@ $( createCompactList ); } -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index 557c4773..8cfb1227 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var template = '
' + @@ -733,4 +733,4 @@ $.fn.languagesettings.modules = $.extend( $.fn.languagesettings.modules, { display: DisplaySettings } ); -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/js/ext.uls.eventlogger.js b/resources/js/ext.uls.eventlogger.js index 34f2c484..24b9b574 100644 --- a/resources/js/ext.uls.eventlogger.js +++ b/resources/js/ext.uls.eventlogger.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; /** @@ -245,4 +245,4 @@ mw.uls = mw.uls || {}; mw.uls.eventlogger = new ULSEventLogger(); -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/js/ext.uls.geoclient.js b/resources/js/ext.uls.geoclient.js index 2d07ceca..8164743a 100644 --- a/resources/js/ext.uls.geoclient.js +++ b/resources/js/ext.uls.geoclient.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var geo, @@ -44,4 +44,5 @@ window.Geo = data; mw.cookie.set( 'ULSGeo', JSON.stringify( data ), cacheAge ); } ); -}( jQuery, mediaWiki ) ); + +}() ); diff --git a/resources/js/ext.uls.i18n.js b/resources/js/ext.uls.i18n.js index 71905944..f1228e60 100644 --- a/resources/js/ext.uls.i18n.js +++ b/resources/js/ext.uls.i18n.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; mw.uls = mw.uls || {}; @@ -58,4 +58,4 @@ ); }; -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js index 7e1f7480..117777c7 100644 --- a/resources/js/ext.uls.ime.js +++ b/resources/js/ext.uls.ime.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var mwImeRulesPath, inputSelector, inputPreferences, ulsIMEPreferences, customHelpLink; @@ -323,4 +323,5 @@ } ); } }; -}( jQuery, mediaWiki ) ); + +}() ); diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 6c4aab47..f3d47733 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var template = '
' + @@ -591,4 +591,4 @@ input: InputSettings } ); -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index fcdc0740..96ea23c3 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; /** @@ -448,4 +448,5 @@ } else { $( init ); } -}( jQuery, mediaWiki ) ); + +}() ); diff --git a/resources/js/ext.uls.languagesettings.js b/resources/js/ext.uls.languagesettings.js index 6fd18cf0..95f56826 100644 --- a/resources/js/ext.uls.languagesettings.js +++ b/resources/js/ext.uls.languagesettings.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var closeRow, settingsMenu, settingsPanel, windowTemplate, panelsRow, buttonsRow; @@ -314,4 +314,5 @@ }; $.fn.languagesettings.Constructor = LanguageSettings; -}( jQuery, mediaWiki ) ); + +}() ); diff --git a/resources/js/ext.uls.mediawiki.js b/resources/js/ext.uls.mediawiki.js index 2e49cd28..baae3e5a 100644 --- a/resources/js/ext.uls.mediawiki.js +++ b/resources/js/ext.uls.mediawiki.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; // MediaWiki overrides for ULS defaults @@ -30,4 +30,5 @@ $.fn.uls.Constructor.prototype.render = function () { this.$languageFilter.addClass( 'noime' ); }; -}( jQuery, mediaWiki ) ); + +}() ); diff --git a/resources/js/ext.uls.preferences.js b/resources/js/ext.uls.preferences.js index 03f45944..0569fab4 100644 --- a/resources/js/ext.uls.preferences.js +++ b/resources/js/ext.uls.preferences.js @@ -18,7 +18,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var ULSPreferences; @@ -155,4 +155,4 @@ return data; }; -}( jQuery, mediaWiki ) ); +}() ); diff --git a/resources/js/ext.uls.webfonts.js b/resources/js/ext.uls.webfonts.js index 1b354142..1a303568 100644 --- a/resources/js/ext.uls.webfonts.js +++ b/resources/js/ext.uls.webfonts.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var ulsPreferences; @@ -138,4 +138,5 @@ mw.loader.using( 'ext.uls.webfonts.fonts', mw.webfonts.setup ); } } ); -}( jQuery, mediaWiki ) ); + +}() ); diff --git a/resources/js/ext.uls.webfonts.mobile.js b/resources/js/ext.uls.webfonts.mobile.js index 576d6171..bf3bb800 100644 --- a/resources/js/ext.uls.webfonts.mobile.js +++ b/resources/js/ext.uls.webfonts.mobile.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $, mw ) { +( function () { 'use strict'; var mediawikiFontRepository; @@ -47,4 +47,5 @@ $( 'body' ).webfonts(); } ); -}( jQuery, mediaWiki ) ); + +}() ); diff --git a/resources/js/ext.uls.webfonts.repository.js b/resources/js/ext.uls.webfonts.repository.js index 74fcbaab..a6b50377 100644 --- a/resources/js/ext.uls.webfonts.repository.js +++ b/resources/js/ext.uls.webfonts.repository.js @@ -1,5 +1,5 @@ // Do not edit! This file is generated from data/fontrepo by scripts/compile-font-repo.php -( function ( $ ) { +( function () { $.webfonts = $.webfonts || {}; $.webfonts.repository = { "base": "../data/fontrepo/fonts/", @@ -761,4 +761,4 @@ } } }; -}( jQuery ) ); +}() ); diff --git a/scripts/compile-font-repo.php b/scripts/compile-font-repo.php index 1f32a860..28ef7ef3 100644 --- a/scripts/compile-font-repo.php +++ b/scripts/compile-font-repo.php @@ -34,10 +34,10 @@ class CompileFontRepo extends Maintenance { $json = FormatJson::encode( $list, "\t" ); $js = <<