Update jquery.ime from upstream

* Hide the IME selector after a few milliseconds of inactivity.

Change-Id: I1d06cab7b5a573dea9c82a95fea463b021c4f8ba
This commit is contained in:
Santhosh Thottingal
2012-11-26 12:12:36 +05:30
parent ddbdd28651
commit 0d4c477323
3 changed files with 292 additions and 9 deletions

View File

@@ -662,9 +662,9 @@
name: 'Phonetic',
source: 'rules/pa/pa-phonetic.js'
},
'ru-transliteration': {
name: 'Transliteration',
source: 'rules/ru/ru-transliteration.js'
'ru-jcuken': {
name: 'ЙЦУКЕН',
source: 'rules/ru/ru-jcuken.js'
},
'sa-inscript': {
name: 'Inscript',
@@ -695,8 +695,12 @@
source: 'rules/ur/ur-transliteration.js'
},
'mn-cyrl': {
name: 'Cyrillc',
name: 'Cyrillic',
source: 'rules/mn/mn-cyrl.js'
},
'ipa-sil': {
name: 'International Phonetic Alphabet - SIL',
source: 'rules/fonipa/ipa-sil.js'
}
} );
@@ -749,6 +753,10 @@
autonym: 'Deutsch',
inputmethods: [ 'de' ]
},
'en': {
autonym: 'English',
inputmethods: [ 'ipa-sil' ]
},
'eo': {
autonym: 'Esperanto',
inputmethods: [ 'eo-transliteration' ]
@@ -785,6 +793,10 @@
autonym: 'Íslenska',
inputmethods: [ 'is-normforms' ]
},
'fonipa': {
autonym: 'International Phonetic Alphabet',
inputmethods: [ 'ipa-sil' ]
},
'jv': {
autonym: 'ꦧꦱꦗꦮ',
inputmethods: [ 'jv-transliteration' ]
@@ -863,7 +875,7 @@
},
'ru': {
autonym: 'русский',
inputmethods: [ 'ru-transliteration' ]
inputmethods: [ 'ru-jcuken' ]
},
'sah': {
autonym: 'саха тыла',
@@ -925,6 +937,7 @@
this.inputmethod = null;
this.init();
this.listen();
this.timer = null;
}
IMESelector.prototype = {
@@ -955,19 +968,51 @@
$( 'body' ).append( this.$imeSetting );
},
stopTimer: function () {
if ( this.timer ) {
clearTimeout( this.timer );
this.timer = null;
}
this.$imeSetting.stop( true, true );
},
resetTimer: function () {
var imeselector = this;
this.stopTimer();
this.timer = setTimeout(
function () {
imeselector.$imeSetting.animate( {
'opacity': 0,
'marginTop': '-20px'
}, 500, function () {
imeselector.$imeSetting.hide();
// Restore properties for next time it becomes visible:
imeselector.$imeSetting.css( 'opacity', 1 );
imeselector.$imeSetting.css( 'margin-top', 0 );
} );
}, 2500 );
},
focus: function () {
// Hide all other IME settings
$( 'div.imeselector' ).hide();
this.$imeSetting.show();
this.resetTimer();
},
show: function () {
this.$menu.addClass( 'open' );
this.stopTimer();
this.$imeSetting.show();
return false;
},
hide: function () {
this.$menu.removeClass( 'open' );
this.resetTimer();
return false;
},
@@ -1045,7 +1090,7 @@
*/
keydown: function ( e ) {
var ime = $( e.target ).data( 'ime' );
this.focus(); // shows the trigger in case it is hidden
if ( isShortcutKey( e ) ) {
if ( ime.isActive() ) {
this.disableIM();
@@ -1070,6 +1115,7 @@
* Position the im selector relative to the edit area
*/
position: function () {
this.focus(); // shows the trigger in case it is hidden
var position = this.$element.offset();
this.$imeSetting.css( 'top', position.top + this.$element.outerHeight() );