Merge "Display notification when disabling input methods from keyboard icon menu"
This commit is contained in:
@@ -45,5 +45,9 @@
|
|||||||
"ext-uls-input-disable": "Disable input methods",
|
"ext-uls-input-disable": "Disable input methods",
|
||||||
"ext-uls-input-enable": "Enable input methods",
|
"ext-uls-input-enable": "Enable input methods",
|
||||||
"ext-uls-input-disable-info": "Input methods are disabled.",
|
"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."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,5 +47,9 @@
|
|||||||
"ext-uls-input-disable": "Label for disable input tools submit button",
|
"ext-uls-input-disable": "Label for disable input tools submit button",
|
||||||
"ext-uls-input-enable": "Label for enable input tools 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-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"
|
"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",
|
||||||
}
|
}
|
||||||
@@ -106,3 +106,8 @@ div.input-settings-block {
|
|||||||
padding: 6px 10px;
|
padding: 6px 10px;
|
||||||
background: #f0f0f0;
|
background: #f0f0f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uls-ime-notification-bubble .link {
|
||||||
|
color: #0645AD;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|||||||
@@ -127,19 +127,20 @@
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
// Hide the menu.
|
// Hide the menu.
|
||||||
$moreSettingsLink.on( 'click', function (e) {
|
$moreSettingsLink.on( 'click', function ( e ) {
|
||||||
imeselector.$menu.removeClass( 'open' );
|
imeselector.hide();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$disableInputToolsLink.i18n();
|
$disableInputToolsLink.i18n();
|
||||||
|
|
||||||
$disableInputToolsLink.on( 'click', function (e) {
|
$disableInputToolsLink.on( 'click', function ( e ) {
|
||||||
$.ime.preferences.disable();
|
$.ime.preferences.disable();
|
||||||
imeselector.hide();
|
imeselector.hide();
|
||||||
imeselector.$menu.removeClass( 'open' );
|
imeselector.$imeSetting.hide();
|
||||||
$.ime.preferences.save( function () {
|
$.ime.preferences.save( function () {
|
||||||
mw.ime.disable();
|
mw.ime.disable();
|
||||||
|
imeNotification();
|
||||||
} );
|
} );
|
||||||
e.stopPropagation();
|
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 = $( '<div>' )
|
||||||
|
.addClass( 'uls-ime-notification-bubble' )
|
||||||
|
.append(
|
||||||
|
$( '<div>' )
|
||||||
|
.attr( 'data-i18n', 'ext-uls-input-disable-notification' ),
|
||||||
|
$( '<div>' )
|
||||||
|
.addClass( 'link' )
|
||||||
|
.attr( 'data-i18n', 'ext-uls-input-disable-notification-undo' )
|
||||||
|
.on( 'click', function() {
|
||||||
|
$.ime.preferences.enable();
|
||||||
|
$.ime.preferences.save( function () {
|
||||||
|
mw.ime.setup();
|
||||||
|
} );
|
||||||
|
} ),
|
||||||
|
$( '<div>' ).attr( 'data-i18n', notificationMsg )
|
||||||
|
);
|
||||||
|
|
||||||
|
mw.notify( $notification.i18n() );
|
||||||
|
}
|
||||||
|
|
||||||
}( jQuery, mediaWiki, document ) );
|
}( jQuery, mediaWiki, document ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user