Move the IME customization code out of document.ready

Change-Id: If358cb1639b4a7e847aefac8f4b7b1923209f76d
This commit is contained in:
Santhosh Thottingal
2012-10-29 14:32:44 +05:30
parent 1c72077c89
commit 87c7d50b01

View File

@@ -57,12 +57,26 @@
return unique.slice( 0, 6 ); return unique.slice( 0, 6 );
}; };
$( document ).ready( function () { // Extend the ime preference system
// MediaWiki specific overrides for jquery.webfonts $.extend( $.ime.preferences, {
save: function ( callback ) {
inputPreferences.set( 'ime', this.registry );
inputPreferences.save( callback );
},
load: function () {
this.registry = inputPreferences.get( 'ime' ) || this.registry;
}
} );
// MediaWiki specific overrides for jquery.ime
$.extend( $.ime.defaults, { $.extend( $.ime.defaults, {
imePath: mwImeRulesPath imePath: mwImeRulesPath
} ); } );
$( document ).ready( function () {
$( 'body' ).on( 'focus', inputSelector, function () { $( 'body' ).on( 'focus', inputSelector, function () {
var $input = $( this ); var $input = $( this );
@@ -91,18 +105,7 @@
} ); } );
} ); } );
$.extend( $.ime.preferences, { // Load the ime preferences
save: function ( callback ) {
inputPreferences.set( 'ime', this.registry );
inputPreferences.save( callback );
},
load: function () {
this.registry = inputPreferences.get( 'ime' ) || this.registry;
}
} );
$.ime.preferences.load(); $.ime.preferences.load();
} ); } );