From db055c8f4796918589080641bab68d4780e9c52e Mon Sep 17 00:00:00 2001 From: Kartik Mistry Date: Tue, 11 Feb 2014 17:50:14 +0530 Subject: [PATCH] Update jquery.ime from upstream Upstream: https://github.com/wikimedia/jquery.ime Changes: * Bug 53695: For languages with no input methods, set "use native keyboard" by default. * Add Venetian input method. * Drop -moz-linear-gradient * Apply /* @embed */ pragma to all images, not just the topmost in each block. * Validate the input method id in load method. Change-Id: I05f8350003227e150948670caf919f05a2b00f88 --- lib/jquery.ime/css/jquery.ime.css | 4 ---- lib/jquery.ime/jquery.ime.js | 21 ++++++++++++++++--- lib/jquery.ime/rules/vec/vec-GVU.js | 32 +++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 lib/jquery.ime/rules/vec/vec-GVU.js diff --git a/lib/jquery.ime/css/jquery.ime.css b/lib/jquery.ime/css/jquery.ime.css index e3fb9576..e15d353b 100644 --- a/lib/jquery.ime/css/jquery.ime.css +++ b/lib/jquery.ime/css/jquery.ime.css @@ -5,8 +5,6 @@ /* @embed */ background-image: -webkit-linear-gradient(transparent, transparent), url('../images/ime-active.svg'); /* @embed */ - background-image: -moz-linear-gradient(transparent, transparent), url('../images/ime-active.svg'); - /* @embed */ background-image: linear-gradient(transparent, transparent), url('../images/ime-active.svg'); background-color: rgba(255,255,255,0.75); background-position: left 3px center; @@ -176,8 +174,6 @@ span.ime-disable-shortcut { /* @embed */ background-image: -webkit-linear-gradient(transparent, transparent), url('../images/tick.svg'); /* @embed */ - background-image: -moz-linear-gradient(transparent, transparent), url('../images/tick.svg'); - /* @embed */ background-image: linear-gradient(transparent, transparent), url('../images/tick.svg'); background-position: left 4px center; background-position-x: 4px; diff --git a/lib/jquery.ime/jquery.ime.js b/lib/jquery.ime/jquery.ime.js index 76633477..c87b26b9 100644 --- a/lib/jquery.ime/jquery.ime.js +++ b/lib/jquery.ime/jquery.ime.js @@ -1,6 +1,6 @@ -/*! jquery.ime - v0.1.0+20131123 +/*! jquery.ime - v0.1.0+20140211 * https://github.com/wikimedia/jquery.ime -* Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */ +* Copyright (c) 2014 Santhosh Thottingal; Licensed GPL, MIT */ ( function ( $ ) { 'use strict'; @@ -303,6 +303,11 @@ return deferred.resolve(); } + // Validate the input method id. + if ( !$.ime.sources[inputmethodId] ) { + return deferred.reject(); + } + dependency = $.ime.sources[inputmethodId].depends; if ( dependency && !$.ime.inputmethods[dependency] ) { ime.load( dependency ).done( function () { @@ -337,7 +342,7 @@ /** * Set the caret position in the div. - * @param {jQuery} element The content editable div element + * @param {jQuery} $element The content editable div element * @param {Object} position An object with start and end properties. * @return {Array} If the cursor could not be placed at given position, how * many characters had to go back to place the cursor @@ -665,6 +670,7 @@ /** * Set the caret position in the div. * @param {Element} element The content editable div element + * @param position */ function setDivCaretPosition( element, position ) { var nextCharIndex, @@ -1384,6 +1390,7 @@ 'class': 'ime-disable-link', 'data-i18n': 'jquery-ime-disable-text' } ) + .addClass( 'ime-checked' ) .text( 'System input method' ), $( '' ) .addClass( 'ime-disable-shortcut' ) @@ -2117,6 +2124,10 @@ 'uz-kbd': { name: 'Uzbek kbd', source: 'rules/uz/uz-kbd.js' + }, + 'vec-GVU': { + name: 'Venetian', + source: 'rules/vec/vec-GVU.js' } } ); @@ -2448,6 +2459,10 @@ 'uz': { autonym: 'Oʻzbekcha', inputmethods: [ 'uz-kbd' ] + }, + 'vec': { + autonym: 'Venetian', + inputmethods: [ 'vec-GVU' ] } } ); diff --git a/lib/jquery.ime/rules/vec/vec-GVU.js b/lib/jquery.ime/rules/vec/vec-GVU.js new file mode 100644 index 00000000..b9b55279 --- /dev/null +++ b/lib/jquery.ime/rules/vec/vec-GVU.js @@ -0,0 +1,32 @@ +( function ( $ ) { + 'use strict'; + + var vec = { + id: 'vec-GVU', + name: 'Venetian GVU', + description: 'Venetian input method.', + date: '2013-08-06', + URL: 'http://github.com/wikimedia/jquery.ime', + author: 'Vec.wiki community', + license: 'GPLv3', + version: '1.0', + patterns: [ + ['dh', 'đ'], + ['lh', 'ƚ'], + ['òò', 'ó'], + ['zh', 'ẑ'], + ['đh', 'dh'], + ['ƚh', 'lh'], + ['ẑh', 'zh'], + ['Dh', 'Đ'], + ['Lh', 'Ƚ'], + ['Òò', 'Ó'], + ['Zh', 'Ẑ'], + ['Đh', 'Dh'], + ['Ƚh', 'Lh'], + ['Ẑh', 'Zh'] + ] + }; + + $.ime.register( vec ); +}( jQuery ) );