jenkins-bot has submitted this change and it was merged.
Change subject: .jshintrc based on Nimbus skin.
..
.jshintrc based on Nimbus skin.
Change-Id: I3975e9d6878c362995948ab3622a37a22a1b4d5e
---
A .jshintrc
M resources/js/navigation.js
2 files changed, 31 insertions(+), 4 deletions(-)
Approvals:
Lewis Cawte: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 000..180ac6a
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,26 @@
+{
+ /* Common */
+
+ // Enforcing
+ camelcase: false,
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ noempty: true,
+ nonew: true,
+ quotmark: single,
+ trailing: true,
+ undef: true,
+ unused: true,
+ // Legacy
+ onevar: true,
+
+ /* Local */
+ predef: [
+ mediaWiki,
+ jQuery
+ ]
+}
diff --git a/resources/js/navigation.js b/resources/js/navigation.js
index 3555f8c..1d732f2 100644
--- a/resources/js/navigation.js
+++ b/resources/js/navigation.js
@@ -3,21 +3,22 @@
*
* Handles toggling the navigation menu for small screens.
*/
+/* global document */
( function() {
var container = document.getElementById( 'access' );
var button= container.getElementsByTagName( 'h1' )[0],
menu = container.getElementsByTagName( 'ul' )[0];
- if ( undefined == button || undefined == menu ) {
+ if ( undefined === button || undefined === menu ) {
return false;
}
button.onclick = function() {
- if ( menu.className.indexOf( 'nav-menu' ) == -1 ) {
+ if ( menu.className.indexOf( 'nav-menu' ) === -1 ) {
menu.className = 'nav-menu';
}
- if ( button.className.indexOf( 'toggled-on' ) != -1 ) {
+ if ( button.className.indexOf( 'toggled-on' ) !== -1 ) {
button.className = button.className.replace( '
toggled-on', '' );
menu.className = menu.className.replace( ' toggled-on',
'' );
container.className = container.className.replace(
'main-small-navigation', 'navigation-main' );
@@ -32,4 +33,4 @@
if ( !menu.childNodes.length ) {
button.style.display = 'none';
}
-} )();
\ No newline at end of file
+} )();
--
To view, visit https://gerrit.wikimedia.org/r/172269
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3975e9d6878c362995948ab3622a37a22a1b4d5e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/Bouquet
Gerrit-Branch: master
Gerrit-Owner: Lewis Cawte le...@lewiscawte.me
Gerrit-Reviewer: Lewis Cawte le...@lewiscawte.me
Gerrit-Reviewer: jenkins-bot
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits