r110465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110464‎ | r110465 | r110466 >
Date:07:34, 1 February 2012
Author:amire80
Status:ok
Tags:miscextensions 
Comment:
Comments cleanup.
Modified paths:
  • /trunk/extensions/Narayam/resources/ext.narayam.core.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/resources/ext.narayam.core.js
@@ -173,7 +173,7 @@
174174
175175 /**
176176 * Change visual appearance of element (text input, textarea) according
177 - * current state of Narayam
 177+ * to the current state of Narayam
178178 */
179179 function changeVisual( $element ) {
180180 if ( enabled ) {
@@ -185,7 +185,7 @@
186186
187187 /**
188188 * Replace text part from startPos to endPos with peri
189 - * It function is specifically for webkit browsers,
 189+ * This function is specifically for webkit browsers,
190190 * because of bug: https://bugs.webkit.org/show_bug.cgi?id=66630
191191 * TODO: remove when webkit bug is handled in jQuery.textSelection.js
192192 *
@@ -237,7 +237,7 @@
238238 return true;
239239 }
240240
241 - // Leave non-ASCII stuff alone, as well as anything involving
 241+ // Leave ASCII control characters alone, as well as anything involving
242242 // Alt (except for extended keymaps), Ctrl and Meta
243243 if ( e.which < 32 || ( e.altKey && !currentScheme.extended_keyboard ) || e.ctrlKey || e.metaKey ) {
244244 return true;
@@ -319,7 +319,7 @@
320320 */
321321 this.addInputs = function( inputs ) {
322322 if ( typeof( inputs ) === "string" ) {
323 - // If a string is passed, it is CSS selector
 323+ // If a string is passed, it is a CSS selector
324324 // We can use jQuery's .live() instead of .bind()
325325 // So Narayam can work on elements added later to DOM too
326326 $( inputs )
@@ -502,11 +502,12 @@
503503 var $narayamMenuItemLabel = $( '<label>' )
504504 .attr( 'for' ,'narayam-' + scheme )
505505 .append( $input )
506 - .append( mw.message( "narayam-"+ scheme ).escaped() );
 506+ .append( mw.message( 'narayam-' + scheme ).escaped() );
507507
508508 var $narayamMenuItem = $( '<li>' )
509509 .append( $input )
510510 .append( $narayamMenuItemLabel );
 511+
511512 return $narayamMenuItem;
512513 };
513514
@@ -525,6 +526,7 @@
526527 if ( typeof recent === "string" ) {
527528 recent = recent.split( "," );
528529 }
 530+
529531 // Prepare the recent inputmethods menu items
530532 for ( var i = 0; i < recent.length; i++ ) {
531533 var scheme = recent[i];
@@ -535,6 +537,7 @@
536538 $narayamMenuItem.addClass( 'narayam-recent-menu-item' );
537539 $narayamMenuItems.append( $narayamMenuItem );
538540 }
 541+
539542 // menu items for the language of wiki.
540543 var requested = [mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ), mw.config.get( 'wgUserLanguage' )];
541544 $( 'textarea[lang]' ).each( function( index ) {
@@ -591,13 +594,13 @@
592595 for ( var lang in allImes ) {
593596 var langschemes = allImes[lang];
594597 for ( var langscheme in langschemes ) {
595 - // Donot repeat the input methods in more input methods section.
 598+ // Do not repeat the input methods in more input methods section.
596599 // If already shown on recent items.
597600 if ( $.inArray( langscheme, seen ) > -1 ) { continue; }
 601+
598602 var $narayamMenuItem = that.buildMenuItem( langscheme );
599603 $narayamMenuItem.addClass( 'narayam-scheme-dynamic-item' );
600604 $narayamMenuItems.append( $narayamMenuItem );
601 -
602605 }
603606 }
604607
@@ -626,6 +629,7 @@
627630 }
628631
629632 $narayamMenuItems.prepend( $( '<li>' ).append( $label ) );
 633+
630634 return $( '<div>' )
631635 .attr( 'id', 'narayam-menu-items' )
632636 .addClass( 'menu-items' )
@@ -693,6 +697,7 @@
694698 event.stopPropagation();
695699 }
696700 } );
 701+
697702 $( 'html' ).click( function() {
698703 $menu.removeClass( 'open' );
699704 $menu.hide();
@@ -700,6 +705,7 @@
701706 $menu.click( function( event ) {
702707 event.stopPropagation();
703708 } );
 709+
704710 // Workaround for IE bug - activex components like input fields
705711 // coming on top of everything.
706712 // TODO: is there a better solution other than hiding it on hover?
@@ -711,6 +717,7 @@
712718 });
713719 }
714720 $('.narayam-scheme-dynamic-item').hide();
 721+
715722 // Narayam controls setup complete, returns true
716723 return true;
717724 };

Status & tagging log