മീഡിയവിക്കി:Jquery.ime.preferences.js
ശ്രദ്ധിക്കുക: സേവ് ചെയ്തശേഷം മാറ്റങ്ങൾ കാണാനായി താങ്കൾക്ക് ബ്രൗസറിന്റെ കാഷെ ഒഴിവാക്കേണ്ടി വന്നേക്കാം.
- ഫയർഫോക്സ് / സഫാരി: Reload ബട്ടൺ അമർത്തുമ്പോൾ Shift കീ അമർത്തി പിടിക്കുകയോ, Ctrl-F5 അല്ലെങ്കിൽ Ctrl-R (മാക്കിന്റോഷിൽ ⌘-R ) എന്ന് ഒരുമിച്ച് അമർത്തുകയോ ചെയ്യുക
- ഗൂഗിൾ ക്രോം: Ctrl-Shift-R (മാക്കിന്റോഷിൽ ⌘-Shift-R ) അമർത്തുക
- ഇന്റർനെറ്റ് എക്സ്പ്ലോറർ: Refresh ബട്ടൺ അമർത്തുമ്പോൾ Ctrl കീ അമർത്തിപിടിക്കുക. അല്ലെങ്കിൽ Ctrl-F5 അമർത്തുക
- ഓപ്പറ: Menu → Settings എടുക്കുക (മാക്കിൽ Opera → Preferences) എന്നിട്ട് Privacy & security → Clear browsing data → Cached images and files ചെയ്യുക.
( function ( $ ) {
'use strict';
$.extend( $.ime.preferences, {
registry: {
isDirty: false,
language : null,
previousLanguages: [], // array of previous languages
previousInputMethods: [], // array of previous inputmethods
imes: {
'en': 'system'
}
},
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.
if ( $.inArray( language, this.registry.previousLanguages ) === -1 ) {
this.registry.previousLanguages.unshift( language );
this.registry.previousLanguages = this.registry.previousLanguages.slice( 0, 5 );
}
},
getLanguage: function () {
return this.registry.language;
},
getDefaultLanguage: function () {
return 'en';
},
getPreviousLanguages: function () {
return this.registry.previousLanguages;
},
getPreviousInputMethods: function () {
return this.registry.previousInputMethods;
},
// Set the given IM as the last used for the language
setIM: function ( inputMethod ) {
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;
if ( !this.registry.previousInputMethods ) {
this.registry.previousInputMethods = [];
}
// Add to the previous languages,
if ( inputMethod !== 'system' ) {
this.registry.previousInputMethods.unshift( inputMethod );
this.registry.previousInputMethods = this.registry.previousInputMethods.slice( 0, 5 );
}
},
// Return the last used or the default IM for language
getIM: function ( language ) {
if ( !this.registry.imes ) {
this.registry.imes = {};
}
return this.registry.imes[language] || 'system';
},
save: function () {
// save registry in cookies or localstorage
$.cookie('ime', this.registry.imes[this.registry.language]);
},
load: function () {
// load registry from cookies or localstorage
}
} );
}( jQuery ) );