diff --git a/.gitignore b/.gitignore index 00cf2914..6465a1b9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ .*.swp .idea .bundle/ - diff --git a/.jshintrc b/.jshintrc index d7649a35..cfe8a311 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,4 +1,5 @@ { + "camelcase": true, "curly": true, "eqeqeq": true, @@ -12,7 +13,7 @@ "trailing": true, "undef": true, "unused": true, - "onevar": true, + "bitwise": true, "forin": false, "regexp": false, @@ -21,6 +22,8 @@ "smarttabs": true, "multistr": true, "browser": true, + "onevar": true, + "predef": [ "mediaWiki", "jQuery", diff --git a/data/LanguageNameIndexer.php b/data/LanguageNameIndexer.php index 6c4f19a7..9fb5f57f 100644 --- a/data/LanguageNameIndexer.php +++ b/data/LanguageNameIndexer.php @@ -18,19 +18,16 @@ * @licence MIT License */ -// Standard boilerplate to define $IP -if ( getenv( 'MW_INSTALL_PATH' ) !== false ) { - $IP = getenv( 'MW_INSTALL_PATH' ); -} else { - $dir = __DIR__; - $IP = "$dir/../../.."; +$IP = getenv( 'MW_INSTALL_PATH' ); +if ( $IP === false ) { + $IP = __DIR__ . '/../../..'; } require_once "$IP/maintenance/Maintenance.php"; class LanguageNameIndexer extends Maintenance { public function __construct() { parent::__construct(); - $this->addDescription( "Script to create language names index." ); + $this->addDescription( 'Script to create language names index.' ); } public function execute() { diff --git a/resources/css/ext.uls.css b/resources/css/ext.uls.css index f831c0b9..bb7c1a07 100644 --- a/resources/css/ext.uls.css +++ b/resources/css/ext.uls.css @@ -43,4 +43,4 @@ button.uls-more-languages { div.display-settings-block:hover .settings-text { color: #252525; -} \ No newline at end of file +} diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index db70e419..704c32b3 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -16,8 +16,7 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - -( function ( $, mw, undefined ) { +( function ( $, mw ) { 'use strict'; var template = '
' diff --git a/resources/js/ext.uls.eventlogger.js b/resources/js/ext.uls.eventlogger.js index d49dca7f..8f9a8635 100644 --- a/resources/js/ext.uls.eventlogger.js +++ b/resources/js/ext.uls.eventlogger.js @@ -16,7 +16,6 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - ( function ( $, mw ) { 'use strict'; diff --git a/resources/js/ext.uls.geoclient.js b/resources/js/ext.uls.geoclient.js index 3a66b0cb..21d0d29b 100644 --- a/resources/js/ext.uls.geoclient.js +++ b/resources/js/ext.uls.geoclient.js @@ -16,8 +16,7 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - -( function ( mw, $ ) { +( function ( $, mw ) { 'use strict'; mw.uls = mw.uls || {}; @@ -45,4 +44,4 @@ } } -}( mediaWiki, jQuery ) ); +}( jQuery, mediaWiki ) ); diff --git a/resources/js/ext.uls.i18n.js b/resources/js/ext.uls.i18n.js index 50f7f9fb..f526bc02 100644 --- a/resources/js/ext.uls.i18n.js +++ b/resources/js/ext.uls.i18n.js @@ -16,7 +16,6 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - ( function ( $, mw ) { 'use strict'; diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js index c3791016..aa6fc0f4 100644 --- a/resources/js/ext.uls.ime.js +++ b/resources/js/ext.uls.ime.js @@ -16,7 +16,7 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ -( function ( $, mw, document, undefined ) { +( function ( $, mw ) { 'use strict'; var mwImeRulesPath, inputSelector, inputPreferences, ulsIMEPreferences, customHelpLink; @@ -324,4 +324,4 @@ mw.notify( $notification.i18n() ); } -}( jQuery, mediaWiki, document ) ); +}( jQuery, mediaWiki ) ); diff --git a/resources/js/ext.uls.init.js b/resources/js/ext.uls.init.js index b2d769e5..1318c5af 100644 --- a/resources/js/ext.uls.init.js +++ b/resources/js/ext.uls.init.js @@ -16,8 +16,7 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - -( function ( $, mw, undefined ) { +( function ( $, mw ) { 'use strict'; // FIXME: Remove when ULS minimum MW version is 1.22 diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 11e592fb..8822a36f 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -16,8 +16,7 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - -( function ( $, mw, undefined ) { +( function ( $, mw ) { 'use strict'; var template = '
' diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index eea1d082..f1e50d91 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -16,7 +16,6 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - ( function ( $, mw ) { 'use strict'; diff --git a/resources/js/ext.uls.languagesettings.js b/resources/js/ext.uls.languagesettings.js index b82ace42..8c4e960f 100644 --- a/resources/js/ext.uls.languagesettings.js +++ b/resources/js/ext.uls.languagesettings.js @@ -16,7 +16,6 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - ( function ( $, mw ) { 'use strict'; diff --git a/resources/js/ext.uls.preferences.js b/resources/js/ext.uls.preferences.js index f0cbb5fa..11e11716 100644 --- a/resources/js/ext.uls.preferences.js +++ b/resources/js/ext.uls.preferences.js @@ -17,8 +17,7 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ - -( function ( $, mw, undefined ) { +( function ( $, mw ) { 'use strict'; var ULSPreferences, diff --git a/resources/js/ext.uls.webfonts.js b/resources/js/ext.uls.webfonts.js index d2a14f49..991674aa 100644 --- a/resources/js/ext.uls.webfonts.js +++ b/resources/js/ext.uls.webfonts.js @@ -16,8 +16,9 @@ * @licence GNU General Public Licence 2.0 or later * @licence MIT License */ -( function ( $, mw, undefined ) { +( function ( $, mw ) { 'use strict'; + var mediawikiFontRepository, ulsPreferences, // Text to prepend the sample text. 0D00 is an unassigned unicode point. tofuSalt = '\u0D00', diff --git a/scripts/update-jquery-i18n.sh b/scripts/update-jquery-i18n.sh index cc42903d..4e53c18b 100755 --- a/scripts/update-jquery-i18n.sh +++ b/scripts/update-jquery-i18n.sh @@ -7,4 +7,4 @@ UPSTREAM="https://github.com/wikimedia/jquery.i18n.git"; echo -e "Getting latest jquery.i18n from $UPSTREAM\n"; if cd $CLONEDIR; then git pull; else git clone $UPSTREAM $CLONEDIR; fi cd $HERE; -cp -rf $CLONEDIR/src/* $DEST \ No newline at end of file +cp -rf $CLONEDIR/src/* $DEST diff --git a/scripts/update-jquery-ime.sh b/scripts/update-jquery-ime.sh index 2f289b11..c39f6423 100755 --- a/scripts/update-jquery-ime.sh +++ b/scripts/update-jquery-ime.sh @@ -10,4 +10,4 @@ cd $CLONEDIR; npm install; grunt copy concat; cd $HERE; -cp -rf $CLONEDIR/dist/jquery.ime/{images,css,rules,jquery.ime.js} $DEST; \ No newline at end of file +cp -rf $CLONEDIR/dist/jquery.ime/{images,css,rules,jquery.ime.js} $DEST; diff --git a/scripts/update-jquery-uls.sh b/scripts/update-jquery-uls.sh index 02382c8c..bff030be 100755 --- a/scripts/update-jquery-uls.sh +++ b/scripts/update-jquery-uls.sh @@ -7,4 +7,4 @@ UPSTREAM="https://github.com/wikimedia/jquery.uls.git"; echo -e "Getting latest jquery.uls from $UPSTREAM\n"; if cd $CLONEDIR; then git pull; else git clone $UPSTREAM $CLONEDIR; fi cd $HERE; -cp -rf $CLONEDIR/{images,css,src,i18n} $DEST \ No newline at end of file +cp -rf $CLONEDIR/{images,css,src,i18n} $DEST diff --git a/scripts/update-jquery-webfonts.sh b/scripts/update-jquery-webfonts.sh index 33fc7125..32f48183 100755 --- a/scripts/update-jquery-webfonts.sh +++ b/scripts/update-jquery-webfonts.sh @@ -7,4 +7,4 @@ UPSTREAM="https://github.com/wikimedia/jquery.webfonts.git"; echo -e "Getting latest jquery.webfonts from $UPSTREAM\n"; if cd $CLONEDIR; then git pull; else git clone $UPSTREAM $CLONEDIR; fi cd $HERE; -cp -rf $CLONEDIR/src/* $DEST \ No newline at end of file +cp -rf $CLONEDIR/src/* $DEST