Updating from upstream

Change-Id: I3acc149e5272914d10c879b08e284ef5aa1e2f7f
This commit is contained in:
Amir E. Aharoni
2012-11-27 08:44:09 +02:00
parent 263f46f726
commit 4359f1e85a
8 changed files with 487 additions and 13 deletions

View File

@@ -729,6 +729,10 @@
autonym: 'беларуская',
inputmethods: [ 'be-transliteration', 'be-latin' ]
},
'be-tarask': {
autonym: 'беларуская (тарашкевіца)',
inputmethods: [ 'be-transliteration', 'be-latin' ]
},
'ber': {
autonym: 'ⵜⵉⴼⵉⵏⴰⵖ',
inputmethods: [ 'ber-tfng' ]
@@ -1422,6 +1426,7 @@
$.extend( $.ime.preferences, {
registry: {
isDirty: false,
language : 'en',
previousLanguages: [], // array of previous languages
imes: {
@@ -1430,11 +1435,18 @@
},
setLanguage: function ( language ) {
// Do nothing if there's no actual change
if ( language === this.registry.language ) {
return;
}
this.registry.language = language;
this.registry.isDirty = true;
if ( !this.registry.previousLanguages ) {
this.registry.previousLanguages = [];
}
//Add to the previous languages, but avoid duplicates.
// Add to the previous languages, but avoid duplicates.
if ( $.inArray( language, this.registry.previousLanguages ) === -1 ) {
this.registry.previousLanguages.push( language );
}
@@ -1453,13 +1465,20 @@
if ( !this.registry.imes ) {
this.registry.imes = {};
}
// Do nothing if there's no actual change
if ( inputMethod === this.registry.imes[this.registry.language] ) {
return;
}
this.registry.imes[this.getLanguage()] = inputMethod;
this.registry.isDirty = true;
},
// Return the last used or the default IM for language
getIM: function ( language ) {
if ( !this.registry.imes ) {
this.registry.imes= {};
this.registry.imes = {};
}
return this.registry.imes[language] || $.ime.languages[language].inputmethods[0];
},
@@ -1472,4 +1491,4 @@
// load registry from cookies or localstorage
}
} );
}( jQuery ) );
}( jQuery ) );