r106177 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106176‎ | r106177 | r106178 >
Date:12:15, 14 December 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Some JSHint fixes
Modified paths:
  • /trunk/extensions/Narayam/resources/ext.narayam.core.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/resources/ext.narayam.core.js
@@ -56,7 +56,7 @@
5757 if ( regex.test( str ) // Input string match
5858 &&
5959 (
60 - rules[i][1].length == 0 // Keybuffer match not required
 60+ rules[i][1].length === 0 // Keybuffer match not required
6161 ||
6262 ( // Keybuffer match specified, so it should be met
6363 rules[i][1].length > 0
@@ -130,7 +130,7 @@
131131 shiftKey: false,
132132 cmdKey: false,
133133 key: 'm'
134 - }
 134+ };
135135 // Browser sniffing to determine the available shortcutKey
136136 // Refer: mediawiki.util.js and en.wikipedia.org/wiki/Access_key
137137 var profile = $.client.profile();
@@ -168,7 +168,7 @@
169169 text += 'Command-';
170170 }
171171 text += shortcutKey.key.toUpperCase();
172 - return text;
 172+ return text;
173173 }
174174
175175 /**
@@ -428,7 +428,7 @@
429429 */
430430 this.getScheme = function( name ) {
431431 return schemes[name];
432 - }
 432+ };
433433
434434 /**
435435 * Change the current transliteration scheme
@@ -438,9 +438,9 @@
439439 var recent = $.cookie( 'narayam-scheme' ) || [];
440440 if ( typeof recent === "string" ) {
441441 recent = recent.split( "," );
442 - };
 442+ }
443443 recent = $.grep( recent, function( value ) {
444 - return value != name;
 444+ return value != name;
445445 } );
446446 recent.unshift( name );
447447 recent = recent.slice( 0, recentItemsLength );
@@ -465,7 +465,7 @@
466466 this.setup = function() {
467467 that.buildMenu();
468468 // Restore state from cookies
469 - var recentSchemes = $.cookie( 'narayam-scheme' );
 469+ var recent = $.cookie( 'narayam-scheme' );
470470 var lastScheme = null;
471471 if ( typeof recent === "string" ) {
472472 lastScheme = recent.split( "," )[0];
@@ -531,7 +531,7 @@
532532 if ( $.inArray( scheme, seen ) > -1 ) { continue; }
533533 seen.push( scheme );
534534 if ( count++ > recentItemsLength ) { break; }
535 - $narayamMenuItem = that.buildMenuItem( scheme );
 535+ var $narayamMenuItem = that.buildMenuItem( scheme );
536536 $narayamMenuItem.addClass( 'narayam-recent-menu-item' );
537537 $narayamMenuItems.append( $narayamMenuItem );
538538 }
@@ -548,7 +548,7 @@
549549 haveSchemes = true;
550550 if ( $.inArray( scheme, seen ) !== -1 ) { continue; }
551551 seen.push( scheme );
552 - $narayamMenuItem = that.buildMenuItem( scheme );
 552+ var $narayamMenuItem = that.buildMenuItem( scheme );
553553 $narayamMenuItems.append( $narayamMenuItem );
554554 }
555555 }
@@ -599,7 +599,7 @@
600600 // Donot repeat the input methods in more input methods section.
601601 // If already shown on recent items.
602602 if ( $.inArray( langscheme, seen ) > -1 ) { continue; }
603 - $narayamMenuItem = that.buildMenuItem( langscheme );
 603+ var $narayamMenuItem = that.buildMenuItem( langscheme );
604604 $narayamMenuItem.addClass( 'narayam-scheme-dynamic-item' );
605605 $narayamMenuItems.append( $narayamMenuItem );
606606

Status & tagging log