jenkins-bot has submitted this change and it was merged.
Change subject: Fix all jshint errors
......................................................................
Fix all jshint errors
Change-Id: Ib8fb350132bb34c1e063eb644af5aeff833f95e8
---
M .jshintrc
M resources/js/ext.uls.init.js
M resources/js/ext.uls.inputsettings.js
M resources/js/ext.uls.preferences.js
M tests/qunit/ext.uls.tests.js
5 files changed, 17 insertions(+), 8 deletions(-)
Approvals:
Amire80: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.jshintrc b/.jshintrc
index b6a0f58..e8ce16e 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -35,6 +35,15 @@
"predef": [
"mediaWiki",
"jQuery",
- "QUnit"
+
+ /* Qunit specific rules */
+ "QUnit",
+ "module",
+ "expect",
+ "start",
+ "stop",
+ "ok",
+ "test",
+ "strictEqual"
]
}
diff --git a/resources/js/ext.uls.init.js b/resources/js/ext.uls.init.js
index 0bc1682..0b1bb2e 100644
--- a/resources/js/ext.uls.init.js
+++ b/resources/js/ext.uls.init.js
@@ -66,6 +66,7 @@
return ( window.navigator.language ||
window.navigator.userLanguage ).split( '-' )[0];
};
+ /*jshint camelcase:false*/
mw.uls.getCountryCode = function () {
return window.Geo && ( window.Geo.country ||
window.Geo.country_code );
};
diff --git a/resources/js/ext.uls.inputsettings.js
b/resources/js/ext.uls.inputsettings.js
index 4684554..0abe952 100644
--- a/resources/js/ext.uls.inputsettings.js
+++ b/resources/js/ext.uls.inputsettings.js
@@ -477,9 +477,8 @@
if ( success ) {
// Live ime update
this.$parent.hide();
- } else {
- // FIXME failure. what to do?!
}
+ // FIXME in case of failure. what to do?!
},
/**
diff --git a/resources/js/ext.uls.preferences.js
b/resources/js/ext.uls.preferences.js
index d60bd30..cfefb63 100644
--- a/resources/js/ext.uls.preferences.js
+++ b/resources/js/ext.uls.preferences.js
@@ -167,8 +167,9 @@
* @param callback
*/
save: function ( callback ) {
- var ulsPreferences = this;
-
+ var ulsPreferences = this,
+ successFunction,
+ failFunction;
callback = callback || $.noop;
if ( this.isAnon ) {
@@ -176,7 +177,6 @@
$.jStorage.set( this.preferenceName,
this.preferences );
callback.call( this, true );
} else {
- var successFunction, failFunction;
successFunction = function () {
callback.call( this, true );
diff --git a/tests/qunit/ext.uls.tests.js b/tests/qunit/ext.uls.tests.js
index c3733a0..6257222 100644
--- a/tests/qunit/ext.uls.tests.js
+++ b/tests/qunit/ext.uls.tests.js
@@ -17,7 +17,7 @@
* @licence MIT License
*/
-( function ( $ ) {
+( function ( $, mw ) {
'use strict';
module( 'ext.uls', QUnit.newMwEnvironment() );
@@ -68,4 +68,4 @@
prefs.set( prefName, undefined );
prefs.save();
} );
-}( jQuery ) );
+}( jQuery, mediaWiki ) );
--
To view, visit https://gerrit.wikimedia.org/r/64558
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib8fb350132bb34c1e063eb644af5aeff833f95e8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits