Merge "Log ime-change event"
This commit is contained in:
@@ -78,6 +78,7 @@
|
||||
mw.hook( 'mw.uls.language.revert' ).add( $.proxy( this.ulsLanguageRevert, this ) );
|
||||
mw.hook( 'mw.uls.ime.enable' ).add( $.proxy( this.enableIME, this ) );
|
||||
mw.hook( 'mw.uls.ime.disable' ).add( $.proxy( this.disableIME, this ) );
|
||||
mw.hook( 'mw.uls.ime.change' ).add( $.proxy( this.changeIME, this ) );
|
||||
mw.hook( 'mw.uls.login.click' ).add( $.proxy( this.loginClick, this ) );
|
||||
mw.hook( 'mw.uls.ime.morelanguages' ).add( $.proxy( this.imeMoreLanguages, this ) );
|
||||
mw.hook( 'mw.uls.interface.morelanguages' ).add( $.proxy( this.interfaceMoreLanguages, this ) );
|
||||
@@ -121,6 +122,17 @@
|
||||
this.log( { action: 'ime-enable' } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Log IME change
|
||||
* @param {string} inputMethod
|
||||
*/
|
||||
changeIME: function ( inputMethod ) {
|
||||
this.log( {
|
||||
action: 'ime-change',
|
||||
inputMethod: inputMethod
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Log login link click in display settings.
|
||||
* @param {jQuery.Deferred} deferred
|
||||
|
||||
@@ -262,9 +262,11 @@
|
||||
imeselector = $input.data( 'imeselector' );
|
||||
if ( imeselector ) {
|
||||
imeselector.selectLanguage( $.ime.preferences.getLanguage() );
|
||||
imeselector.$element.on( 'setim.ime', function ( event, inputMethod ) {
|
||||
mw.hook( 'mw.uls.ime.change' ).fire( inputMethod );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
};
|
||||
|
||||
$( document ).ready( function () {
|
||||
|
||||
@@ -530,6 +530,10 @@
|
||||
apply: function () {
|
||||
var inputSettings = this;
|
||||
|
||||
mw.hook( 'mw.uls.ime.change' ).fire(
|
||||
$.ime.preferences.getIM( $.ime.preferences.getLanguage() )
|
||||
);
|
||||
|
||||
// Save the preferences
|
||||
$.ime.preferences.save( function ( result ) {
|
||||
// closure for not losing the scope
|
||||
|
||||
Reference in New Issue
Block a user