Index: trunk/extensions/Narayam/resources/ext.narayam.core.js |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | |
175 | 175 | /** |
176 | 176 | * Change visual appearance of element (text input, textarea) according |
177 | | - * current state of Narayam |
| 177 | + * to the current state of Narayam |
178 | 178 | */ |
179 | 179 | function changeVisual( $element ) { |
180 | 180 | if ( enabled ) { |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | |
187 | 187 | /** |
188 | 188 | * 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, |
190 | 190 | * because of bug: https://bugs.webkit.org/show_bug.cgi?id=66630 |
191 | 191 | * TODO: remove when webkit bug is handled in jQuery.textSelection.js |
192 | 192 | * |
— | — | @@ -237,7 +237,7 @@ |
238 | 238 | return true; |
239 | 239 | } |
240 | 240 | |
241 | | - // Leave non-ASCII stuff alone, as well as anything involving |
| 241 | + // Leave ASCII control characters alone, as well as anything involving |
242 | 242 | // Alt (except for extended keymaps), Ctrl and Meta |
243 | 243 | if ( e.which < 32 || ( e.altKey && !currentScheme.extended_keyboard ) || e.ctrlKey || e.metaKey ) { |
244 | 244 | return true; |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | */ |
321 | 321 | this.addInputs = function( inputs ) { |
322 | 322 | 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 |
324 | 324 | // We can use jQuery's .live() instead of .bind() |
325 | 325 | // So Narayam can work on elements added later to DOM too |
326 | 326 | $( inputs ) |
— | — | @@ -502,11 +502,12 @@ |
503 | 503 | var $narayamMenuItemLabel = $( '<label>' ) |
504 | 504 | .attr( 'for' ,'narayam-' + scheme ) |
505 | 505 | .append( $input ) |
506 | | - .append( mw.message( "narayam-"+ scheme ).escaped() ); |
| 506 | + .append( mw.message( 'narayam-' + scheme ).escaped() ); |
507 | 507 | |
508 | 508 | var $narayamMenuItem = $( '<li>' ) |
509 | 509 | .append( $input ) |
510 | 510 | .append( $narayamMenuItemLabel ); |
| 511 | + |
511 | 512 | return $narayamMenuItem; |
512 | 513 | }; |
513 | 514 | |
— | — | @@ -525,6 +526,7 @@ |
526 | 527 | if ( typeof recent === "string" ) { |
527 | 528 | recent = recent.split( "," ); |
528 | 529 | } |
| 530 | + |
529 | 531 | // Prepare the recent inputmethods menu items |
530 | 532 | for ( var i = 0; i < recent.length; i++ ) { |
531 | 533 | var scheme = recent[i]; |
— | — | @@ -535,6 +537,7 @@ |
536 | 538 | $narayamMenuItem.addClass( 'narayam-recent-menu-item' ); |
537 | 539 | $narayamMenuItems.append( $narayamMenuItem ); |
538 | 540 | } |
| 541 | + |
539 | 542 | // menu items for the language of wiki. |
540 | 543 | var requested = [mw.config.get( 'wgUserVariant' ), mw.config.get( 'wgContentLanguage' ), mw.config.get( 'wgUserLanguage' )]; |
541 | 544 | $( 'textarea[lang]' ).each( function( index ) { |
— | — | @@ -591,13 +594,13 @@ |
592 | 595 | for ( var lang in allImes ) { |
593 | 596 | var langschemes = allImes[lang]; |
594 | 597 | 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. |
596 | 599 | // If already shown on recent items. |
597 | 600 | if ( $.inArray( langscheme, seen ) > -1 ) { continue; } |
| 601 | + |
598 | 602 | var $narayamMenuItem = that.buildMenuItem( langscheme ); |
599 | 603 | $narayamMenuItem.addClass( 'narayam-scheme-dynamic-item' ); |
600 | 604 | $narayamMenuItems.append( $narayamMenuItem ); |
601 | | - |
602 | 605 | } |
603 | 606 | } |
604 | 607 | |
— | — | @@ -626,6 +629,7 @@ |
627 | 630 | } |
628 | 631 | |
629 | 632 | $narayamMenuItems.prepend( $( '<li>' ).append( $label ) ); |
| 633 | + |
630 | 634 | return $( '<div>' ) |
631 | 635 | .attr( 'id', 'narayam-menu-items' ) |
632 | 636 | .addClass( 'menu-items' ) |
— | — | @@ -693,6 +697,7 @@ |
694 | 698 | event.stopPropagation(); |
695 | 699 | } |
696 | 700 | } ); |
| 701 | + |
697 | 702 | $( 'html' ).click( function() { |
698 | 703 | $menu.removeClass( 'open' ); |
699 | 704 | $menu.hide(); |
— | — | @@ -700,6 +705,7 @@ |
701 | 706 | $menu.click( function( event ) { |
702 | 707 | event.stopPropagation(); |
703 | 708 | } ); |
| 709 | + |
704 | 710 | // Workaround for IE bug - activex components like input fields |
705 | 711 | // coming on top of everything. |
706 | 712 | // TODO: is there a better solution other than hiding it on hover? |
— | — | @@ -711,6 +717,7 @@ |
712 | 718 | }); |
713 | 719 | } |
714 | 720 | $('.narayam-scheme-dynamic-item').hide(); |
| 721 | + |
715 | 722 | // Narayam controls setup complete, returns true |
716 | 723 | return true; |
717 | 724 | }; |