From 87c7d50b018cd63fae58af605dddf387c9e864a6 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Mon, 29 Oct 2012 14:32:44 +0530 Subject: [PATCH] Move the IME customization code out of document.ready Change-Id: If358cb1639b4a7e847aefac8f4b7b1923209f76d --- resources/js/ext.uls.ime.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js index 9877337a..85157e14 100644 --- a/resources/js/ext.uls.ime.js +++ b/resources/js/ext.uls.ime.js @@ -57,11 +57,25 @@ return unique.slice( 0, 6 ); }; + // 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 () { - // MediaWiki specific overrides for jquery.webfonts - $.extend( $.ime.defaults, { - imePath: mwImeRulesPath - } ); $( '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(); } );