Update jquery.ime from upstream
Change-Id: I37d3f1e6b0ebff3ddfd46b2c155e4f5fe590cb4b Version: 0.1.0+20130708
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/*! jquery.ime - v0.1.0+20130707
|
/*! jquery.ime - v0.1.0+20130708
|
||||||
* https://github.com/wikimedia/jquery.ime
|
* https://github.com/wikimedia/jquery.ime
|
||||||
* Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */
|
* Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */
|
||||||
( function ( $ ) {
|
( function ( $ ) {
|
||||||
@@ -508,20 +508,24 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
prepareSelectorMenu: function () {
|
prepareSelectorMenu: function () {
|
||||||
|
|
||||||
// TODO: In this approach there is a menu for each editable area.
|
// TODO: In this approach there is a menu for each editable area.
|
||||||
// With correct event mapping we can probably reduce it to one menu.
|
// With correct event mapping we can probably reduce it to one menu.
|
||||||
this.$imeSetting = $( selectorTemplate );
|
this.$imeSetting = $( selectorTemplate );
|
||||||
this.$menu = $( '<div class="imeselector-menu" role="menu">' );
|
this.$menu = $( '<div class="imeselector-menu" role="menu">' );
|
||||||
this.$menu.append( imeListTitle() )
|
this.$menu.append(
|
||||||
.append( imeList() )
|
imeListTitle(),
|
||||||
.append( toggleMenuItem() )
|
imeList(),
|
||||||
.append( languageListTitle() );
|
toggleMenuItem(),
|
||||||
|
languageListTitle()
|
||||||
|
);
|
||||||
|
|
||||||
this.prepareLanguageList();
|
this.prepareLanguageList();
|
||||||
this.$menu.append( this.helpLink() );
|
this.$menu.append( this.helpLink() );
|
||||||
|
|
||||||
if ( $.i18n ) {
|
if ( $.i18n ) {
|
||||||
this.$menu.i18n();
|
this.$menu.i18n();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$imeSetting.append( this.$menu );
|
this.$imeSetting.append( this.$menu );
|
||||||
$( 'body' ).append( this.$imeSetting );
|
$( 'body' ).append( this.$imeSetting );
|
||||||
},
|
},
|
||||||
@@ -551,7 +555,8 @@
|
|||||||
imeselector.$imeSetting.css( 'opacity', 1 );
|
imeselector.$imeSetting.css( 'opacity', 1 );
|
||||||
imeselector.$imeSetting.css( 'margin-top', 0 );
|
imeselector.$imeSetting.css( 'margin-top', 0 );
|
||||||
} );
|
} );
|
||||||
}, 2500 );
|
}, 2500
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
focus: function () {
|
focus: function () {
|
||||||
@@ -597,6 +602,7 @@
|
|||||||
if ( t.hasClass( 'imeselector-toggle' ) ) {
|
if ( t.hasClass( 'imeselector-toggle' ) ) {
|
||||||
imeselector.toggle();
|
imeselector.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@@ -619,24 +625,33 @@
|
|||||||
|
|
||||||
imeselector.$menu.on( 'click.ime', 'li', function() {
|
imeselector.$menu.on( 'click.ime', 'li', function() {
|
||||||
imeselector.$element.focus();
|
imeselector.$element.focus();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
imeselector.$menu.on( 'click.ime', 'li.ime-im', function () {
|
imeselector.$menu.on( 'click.ime', 'li.ime-im', function () {
|
||||||
imeselector.selectIM( $( this ).data( 'ime-inputmethod' ) );
|
imeselector.selectIM( $( this ).data( 'ime-inputmethod' ) );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
imeselector.$menu.on( 'click.ime', 'li.ime-lang', function () {
|
imeselector.$menu.on( 'click.ime', 'li.ime-lang', function () {
|
||||||
imeselector.selectLanguage( $( this ).attr( 'lang' ) );
|
imeselector.selectLanguage( $( this ).attr( 'lang' ) );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
imeselector.$menu.on( 'click.ime', 'div.ime-disable', function () {
|
imeselector.$menu.on( 'click.ime', 'div.ime-disable', function () {
|
||||||
imeselector.disableIM();
|
imeselector.disableIM();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Just make it work as a regular link
|
||||||
|
imeselector.$menu.on( 'click.ime', '.ime-help-link', function ( e ) {
|
||||||
|
e.stopPropagation();
|
||||||
|
} );
|
||||||
|
|
||||||
imeselector.$element.on( 'focus.ime', function ( e ) {
|
imeselector.$element.on( 'focus.ime', function ( e ) {
|
||||||
imeselector.selectLanguage( imeselector.decideLanguage() );
|
imeselector.selectLanguage( imeselector.decideLanguage() );
|
||||||
imeselector.focus();
|
imeselector.focus();
|
||||||
@@ -683,10 +698,12 @@
|
|||||||
} else {
|
} else {
|
||||||
languageCode = this.decideLanguage();
|
languageCode = this.decideLanguage();
|
||||||
this.selectLanguage( languageCode );
|
this.selectLanguage( languageCode );
|
||||||
|
|
||||||
if ( !ime.isActive() && $.ime.languages[languageCode] ) {
|
if ( !ime.isActive() && $.ime.languages[languageCode] ) {
|
||||||
// Even after pressing toggle shortcut again, it is still disabled
|
// Even after pressing toggle shortcut again, it is still disabled
|
||||||
// Check if there is a previously used input method.
|
// Check if there is a previously used input method.
|
||||||
previousInputMethods = $.ime.preferences.getPreviousInputMethods();
|
previousInputMethods = $.ime.preferences.getPreviousInputMethods();
|
||||||
|
|
||||||
if ( previousInputMethods[0] ) {
|
if ( previousInputMethods[0] ) {
|
||||||
this.selectIM( previousInputMethods[0] );
|
this.selectIM( previousInputMethods[0] );
|
||||||
} else {
|
} else {
|
||||||
@@ -812,7 +829,6 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decide on initial language to select
|
* Decide on initial language to select
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
decideLanguage: function () {
|
decideLanguage: function () {
|
||||||
if ( $.ime.preferences.getLanguage() ) {
|
if ( $.ime.preferences.getLanguage() ) {
|
||||||
@@ -892,7 +908,7 @@
|
|||||||
* Prepare language list
|
* Prepare language list
|
||||||
*/
|
*/
|
||||||
prepareLanguageList: function () {
|
prepareLanguageList: function () {
|
||||||
var languageCodeIndex = 0,
|
var languageCodeIndex,
|
||||||
$languageListWrapper,
|
$languageListWrapper,
|
||||||
$languageList,
|
$languageList,
|
||||||
languageList,
|
languageList,
|
||||||
@@ -950,8 +966,12 @@
|
|||||||
$imeItem = $( '<a>' ).attr( 'href', '#' ).text( name ),
|
$imeItem = $( '<a>' ).attr( 'href', '#' ).text( name ),
|
||||||
$inputMethod = $( '<li data-ime-inputmethod=' + inputmethod + '>' );
|
$inputMethod = $( '<li data-ime-inputmethod=' + inputmethod + '>' );
|
||||||
|
|
||||||
$inputMethod.append( '<span class="ime-im-check">' ).append( $imeItem );
|
$inputMethod
|
||||||
$inputMethod.addClass( 'ime-im' );
|
.append(
|
||||||
|
'<span class="ime-im-check">',
|
||||||
|
$imeItem
|
||||||
|
)
|
||||||
|
.addClass( 'ime-im' );
|
||||||
$imeList.append( $inputMethod );
|
$imeList.append( $inputMethod );
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
@@ -1009,14 +1029,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggleMenuItem() {
|
function toggleMenuItem() {
|
||||||
return $( '<div class="ime-disable">' )
|
return $( '<div class="ime-disable">' ).append(
|
||||||
.append( $( '<span>' )
|
$( '<span>' )
|
||||||
.attr( {
|
.attr( {
|
||||||
'class': 'ime-disable-link',
|
'class': 'ime-disable-link',
|
||||||
'data-i18n': 'jquery-ime-disable-text'
|
'data-i18n': 'jquery-ime-disable-text'
|
||||||
} )
|
} )
|
||||||
.text( 'System input method' )
|
.text( 'System input method' ),
|
||||||
).append( $( '<span>' )
|
$( '<span>' )
|
||||||
.addClass( 'ime-disable-shortcut' )
|
.addClass( 'ime-disable-shortcut' )
|
||||||
.text( 'CTRL+M' )
|
.text( 'CTRL+M' )
|
||||||
);
|
);
|
||||||
@@ -1557,15 +1577,15 @@
|
|||||||
source: 'rules/no/no-tildeforms.js'
|
source: 'rules/no/no-tildeforms.js'
|
||||||
},
|
},
|
||||||
'or-transliteration': {
|
'or-transliteration': {
|
||||||
name: 'ଟରନସଲିତେରତିଓନ',
|
name: 'ଟ୍ରାନ୍ସଲି ଟରେସନ',
|
||||||
source: 'rules/or/or-transliteration.js'
|
source: 'rules/or/or-transliteration.js'
|
||||||
},
|
},
|
||||||
'or-inscript': {
|
'or-inscript': {
|
||||||
name: 'ଈନସକରିପତ',
|
name: 'ଇନସ୍କ୍ରିପ୍ଟ',
|
||||||
source: 'rules/or/or-inscript.js'
|
source: 'rules/or/or-inscript.js'
|
||||||
},
|
},
|
||||||
'or-inscript2': {
|
'or-inscript2': {
|
||||||
name: 'ଈନସକରିପତ2',
|
name: 'ଇନସ୍କ୍ରିପ୍ଟ2',
|
||||||
source: 'rules/or/or-inscript2.js'
|
source: 'rules/or/or-inscript2.js'
|
||||||
},
|
},
|
||||||
'or-lekhani': {
|
'or-lekhani': {
|
||||||
@@ -1573,7 +1593,7 @@
|
|||||||
source: 'rules/or/or-lekhani.js'
|
source: 'rules/or/or-lekhani.js'
|
||||||
},
|
},
|
||||||
'or-phonetic': {
|
'or-phonetic': {
|
||||||
name: 'ହୋନେତିକ',
|
name: 'ଫୋନେଟିକ',
|
||||||
source: 'rules/or/or-phonetic.js'
|
source: 'rules/or/or-phonetic.js'
|
||||||
},
|
},
|
||||||
'sd-inscript2': {
|
'sd-inscript2': {
|
||||||
@@ -1917,7 +1937,7 @@
|
|||||||
},
|
},
|
||||||
'or': {
|
'or': {
|
||||||
autonym: 'ଓଡ଼ିଆ',
|
autonym: 'ଓଡ଼ିଆ',
|
||||||
inputmethods: [ 'or-transliteration', 'or-lekhani', 'or-inscript', 'or-phonetic', 'or-inscript2' ]
|
inputmethods: [ 'or-phonetic', 'or-transliteration', 'or-inscript', 'or-inscript2', 'or-lekhani' ]
|
||||||
},
|
},
|
||||||
'pa': {
|
'pa': {
|
||||||
autonym: 'ਪੰਜਾਬੀ',
|
autonym: 'ਪੰਜਾਬੀ',
|
||||||
|
|||||||
0
lib/jquery.ime/rules/mh/mh.js
Executable file → Normal file
0
lib/jquery.ime/rules/mh/mh.js
Executable file → Normal file
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
var orInScript = {
|
var orInScript = {
|
||||||
id: 'or-inscript',
|
id: 'or-inscript',
|
||||||
name: 'Odia InScript',
|
name: 'ଇନସ୍କ୍ରିପ୍ଟ',
|
||||||
description: 'InScript keyboard for Odia script',
|
description: 'InScript keyboard for Odia script',
|
||||||
date: '2012-10-14',
|
date: '2012-10-14',
|
||||||
author: 'Junaid P V',
|
author: 'Junaid P V',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
var orInScript2 = {
|
var orInScript2 = {
|
||||||
id: 'or-inscript2',
|
id: 'or-inscript2',
|
||||||
name: 'InScript2',
|
name: 'ଇନସ୍କ୍ରିପ୍ଟ2',
|
||||||
description: 'Enhanced InScript keyboard for Odia language',
|
description: 'Enhanced InScript keyboard for Odia language',
|
||||||
date: '2013-02-09',
|
date: '2013-02-09',
|
||||||
author: 'Parag Nemade',
|
author: 'Parag Nemade',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
var orPhonetic = {
|
var orPhonetic = {
|
||||||
id: 'or-phonetic',
|
id: 'or-phonetic',
|
||||||
name: 'Odia Phonetic',
|
name: 'ଫୋନେଟିକ',
|
||||||
description: 'Phonetic keyboard for Odia script',
|
description: 'Phonetic keyboard for Odia script',
|
||||||
date: '2013-02-09',
|
date: '2013-02-09',
|
||||||
URL: 'http://github.com/wikimedia/jquery.ime',
|
URL: 'http://github.com/wikimedia/jquery.ime',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
var orTransliteration = {
|
var orTransliteration = {
|
||||||
id: 'or-transliteration',
|
id: 'or-transliteration',
|
||||||
name: 'Odia Transliteration',
|
name: 'Odia Transliteration',
|
||||||
description: 'Odia transliteration',
|
description: 'ଟ୍ରାନ୍ସଲି ଟରେସନ',
|
||||||
date: '2012-10-14',
|
date: '2012-10-14',
|
||||||
URL: 'http://github.com/wikimedia/jquery.ime',
|
URL: 'http://github.com/wikimedia/jquery.ime',
|
||||||
author: 'Junaid P V and Subhashish Panigrahi',
|
author: 'Junaid P V and Subhashish Panigrahi',
|
||||||
|
|||||||
Reference in New Issue
Block a user