Merge "Move the IME customization code out of document.ready"

This commit is contained in:
Amire80
2012-10-29 10:31:46 +00:00
committed by Gerrit Code Review

View File

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