KartikMistry has submitted this change and it was merged.

Change subject: Update jquery.ime from upstream
......................................................................


Update jquery.ime from upstream

version: v0.1.0+20131019 (commit: 4ac70e0047)
upstream: https://github.com/wikimedia/jquery.ime

Changes:
* Language tags are case insensitive now
* Fixes to Hindi and Persian input methods
* Shift modifier key support
* Misc CSS fixes

Bug: 54117
Change-Id: I581a1006c34fd86372facdae85ea48b4ed1ffc2c
---
M lib/jquery.ime/css/jquery.ime.css
M lib/jquery.ime/jquery.ime.js
M lib/jquery.ime/rules/fa/fa-kbd.js
M lib/jquery.ime/rules/hi/hi-phonetic.js
4 files changed, 43 insertions(+), 8 deletions(-)

Approvals:
  KartikMistry: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/jquery.ime/css/jquery.ime.css 
b/lib/jquery.ime/css/jquery.ime.css
index 177a4d9..03ba6ed 100644
--- a/lib/jquery.ime/css/jquery.ime.css
+++ b/lib/jquery.ime/css/jquery.ime.css
@@ -7,6 +7,7 @@
        background-image: linear-gradient(transparent, transparent), 
url('../images/ime-active.svg');
        background-color: rgba(255,255,255,0.75);
        background-position: left 3px center;
+       background-position-x: 3px;
        height: 15px;
        font-size: small;
        padding: 2px 2px 1px 20px;
@@ -168,10 +169,12 @@
 
 .imeselector-menu .ime-checked {
        /* @embed */
-       background: url(../images/tick.png) no-repeat left 4px center;
+       background: url(../images/tick.png) no-repeat left center;
        background-image: -webkit-linear-gradient(transparent, transparent), 
url('../images/tick.svg');
        background-image: -moz-linear-gradient(transparent, transparent), 
url('../images/tick.svg');
        background-image: linear-gradient(transparent, transparent), 
url('../images/tick.svg');
+       background-position: left 4px center;
+       background-position-x: 4px;
 }
 
 .imeselector-menu .ime-help-link {
diff --git a/lib/jquery.ime/jquery.ime.js b/lib/jquery.ime/jquery.ime.js
index c7c3153..814f898 100644
--- a/lib/jquery.ime/jquery.ime.js
+++ b/lib/jquery.ime/jquery.ime.js
@@ -1,4 +1,4 @@
-/*! jquery.ime - v0.1.0+20130914
+/*! jquery.ime - v0.1.0+20131019
 * https://github.com/wikimedia/jquery.ime
 * Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */
 ( function ( $ ) {
@@ -19,6 +19,7 @@
                $.ime.defaults.languages = arrayKeys( $.ime.languages );
                this.options = $.extend( {}, $.ime.defaults, options );
                this.active = false;
+               this.shifted = false;
                this.inputmethod = null;
                this.language = null;
                this.context = '';
@@ -34,6 +35,8 @@
                 */
                listen: function () {
                        this.$element.on( 'keypress.ime', $.proxy( 
this.keypress, this ) );
+                       this.$element.on( 'keyup.ime', $.proxy( this.keyup, 
this ) );
+                       this.$element.on( 'keydown.ime', $.proxy( this.keydown, 
this ) );
                        this.$element.on( 'destroy.ime', $.proxy( this.destroy, 
this ) );
                        this.$element.on( 'enable.ime', $.proxy( this.enable, 
this ) );
                        this.$element.on( 'disable.ime', $.proxy( this.disable, 
this ) );
@@ -55,6 +58,14 @@
                                patterns = this.inputmethod.patterns_x || [];
                        } else {
                                patterns = this.inputmethod.patterns || [];
+                       }
+
+                       if ( this.shifted ) {
+                               // if shift is pressed give priority for the 
patterns_shift
+                               // if exists.
+                               // Example: Shift+space where shift does not 
alter the keycode
+                               patterns = ( this.inputmethod.patterns_shift || 
[] )
+                                       .concat( patterns );
                        }
 
                        if ( $.isFunction( patterns ) ) {
@@ -86,6 +97,18 @@
 
                        // No matches, return the input
                        return input;
+               },
+
+               keyup: function ( e ) {
+                       if ( e.which === 16 ) { // shift key
+                               this.shifted = false;
+                       }
+               },
+
+               keydown: function ( e ) {
+                       if ( e.which === 16 ) { // shift key
+                               this.shifted = true;
+                       }
                },
 
                /**
@@ -1066,9 +1089,14 @@
                 * @return {string|bool} Selected input method id or false
                 */
                selectLanguage: function ( languageCode ) {
-                       var ime = this.$element.data( 'ime' ),
-                               imePref = $.ime.preferences.getIM( languageCode 
),
-                               language = $.ime.languages[languageCode];
+                       var ime, imePref, language;
+
+                       // consider language codes case insensitive
+                       languageCode = languageCode && 
languageCode.toLowerCase();
+
+                       ime = this.$element.data( 'ime' );
+                       imePref = $.ime.preferences.getIM( languageCode );
+                       language = $.ime.languages[languageCode];
 
                        this.setMenuTitle( this.getAutonym( languageCode ) );
 
diff --git a/lib/jquery.ime/rules/fa/fa-kbd.js 
b/lib/jquery.ime/rules/fa/fa-kbd.js
index 164a0c2..d042137 100644
--- a/lib/jquery.ime/rules/fa/fa-kbd.js
+++ b/lib/jquery.ime/rules/fa/fa-kbd.js
@@ -155,7 +155,11 @@
                        ['m', '…'],
                        [',', ','],
                        ['\\.', '\''],
-                       ['/', '?']
+                       ['/', '?'],
+                       [' ', '\xa0']
+               ],
+               patterns_shift: [
+                       [' ', '\u200c']
                ]
        };
 
diff --git a/lib/jquery.ime/rules/hi/hi-phonetic.js 
b/lib/jquery.ime/rules/hi/hi-phonetic.js
index b4a97f2..8d1624f 100644
--- a/lib/jquery.ime/rules/hi/hi-phonetic.js
+++ b/lib/jquery.ime/rules/hi/hi-phonetic.js
@@ -12,14 +12,14 @@
                patterns: [
                        ['्f', '्\u200c'],
                        ['\\~', 'ऎ'],
-                       ['\\`","ॆ'],
+                       ['\\`','ॆ'],
                        ['\\!', 'ऍ'],
                        ['1', '१'],
                        ['\\@', 'ॅ'],
                        ['2', '२'],
                        ['\\#', 'ऑ'],
                        ['3', '३'],
-                       ['\\$","ॉ'],
+                       ['\\$','ॉ'],
                        ['4', '४'],
                        ['\\%', 'ञ'],
                        ['5', '५'],

-- 
To view, visit https://gerrit.wikimedia.org/r/90692
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I581a1006c34fd86372facdae85ea48b4ed1ffc2c
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>
Gerrit-Reviewer: Ebrahim <ebra...@byagowi.com>
Gerrit-Reviewer: KartikMistry <kartik.mis...@gmail.com>
Gerrit-Reviewer: Santhosh <santhosh.thottin...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to