diff --git a/i18n/en.json b/i18n/en.json index 5fd47afe..9f760d91 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -45,5 +45,9 @@ "ext-uls-input-disable": "Disable input methods", "ext-uls-input-enable": "Enable input methods", "ext-uls-input-disable-info": "Input methods are disabled.", -"ext-uls-input-settings-noime": "No input methods are available for this language." +"ext-uls-input-settings-noime": "No input methods are available for this language.", +"ext-uls-input-disable-notification": "Input tools have been disabled", +"ext-uls-input-disable-notification-undo": "Undo", +"ext-uls-input-disable-notification-info-personal": "You can enable the input tools at any time from the language settings.", +"ext-uls-input-disable-notification-info-interlanguage": "You can enable the input tools at any time from the language settings next to the language list." } diff --git a/i18n/qqq.json b/i18n/qqq.json index abaf2151..1ca947ad 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -47,5 +47,9 @@ "ext-uls-input-disable": "Label for disable input tools submit button", "ext-uls-input-enable": "Label for enable input tools button", "ext-uls-input-disable-info": "Info text for the disable input tools button", - "ext-uls-input-settings-noime": "Text to be shown when no input methods are available for a selected language" -} \ No newline at end of file + "ext-uls-input-settings-noime": "Text to be shown when no input methods are available for a selected language", + "ext-uls-input-disable-notification": "Notification bubble text when input methods are disabled", + "ext-uls-input-disable-notification-undo": "Undo link text in the input method disable notification bubble", + "ext-uls-input-disable-notification-info-personal": "Notification bubble text when input methods are disabled, appears if the ULS is at personal toolbar", + "ext-uls-input-disable-notification-info-interlanguage": "Notification bubble text when input methods are disabled, appears if the ULS is at interlanguage toolbar", +} diff --git a/resources/css/ext.uls.inputsettings.css b/resources/css/ext.uls.inputsettings.css index b6b7531d..924cd02b 100644 --- a/resources/css/ext.uls.inputsettings.css +++ b/resources/css/ext.uls.inputsettings.css @@ -106,3 +106,8 @@ div.input-settings-block { padding: 6px 10px; background: #f0f0f0; } + +.uls-ime-notification-bubble .link { + color: #0645AD; + cursor: pointer; +} diff --git a/resources/js/ext.uls.ime.js b/resources/js/ext.uls.ime.js index 581f7c54..80fd5e97 100644 --- a/resources/js/ext.uls.ime.js +++ b/resources/js/ext.uls.ime.js @@ -127,19 +127,20 @@ } ); // Hide the menu. - $moreSettingsLink.on( 'click', function (e) { - imeselector.$menu.removeClass( 'open' ); + $moreSettingsLink.on( 'click', function ( e ) { + imeselector.hide(); e.stopPropagation(); } ); $disableInputToolsLink.i18n(); - $disableInputToolsLink.on( 'click', function (e) { + $disableInputToolsLink.on( 'click', function ( e ) { $.ime.preferences.disable(); imeselector.hide(); - imeselector.$menu.removeClass( 'open' ); + imeselector.$imeSetting.hide(); $.ime.preferences.save( function () { mw.ime.disable(); + imeNotification(); } ); e.stopPropagation(); } ); @@ -202,5 +203,28 @@ } ); + function imeNotification () { + var notificationMsg = ( mw.config.get( 'wgULSPosition' ) === 'personal' ) ? + 'ext-uls-input-disable-notification-info-personal' : + 'ext-uls-input-disable-notification-info-interlanguage', + $notification = $( '