hotkey: Add deprecation notice for '*' hotkey.

This commit is contained in:
Anupam Dagar
2018-06-02 13:48:15 +00:00
committed by Tim Abbott
parent 18702b0d71
commit 0e8081093b
3 changed files with 7 additions and 1 deletions

View File

@@ -252,7 +252,7 @@ run_test('basic_chars', () => {
assert_mapping('d', 'drafts.launch');
// Next, test keys that only work on a selected message.
var message_view_only_keys = '@*+>RjJkKsSuvi:GM';
var message_view_only_keys = '@+>RjJkKsSuvi:GM';
// Check that they do nothing without a selected message
global.current_msg_list.empty = return_true;

View File

@@ -74,6 +74,7 @@ var keydown_either_mappings = {
};
var keypress_mappings = {
42: {name: 'star_deprecated', message_view_only: true}, // '*'
43: {name: 'thumbs_up_emoji', message_view_only: true}, // '+'
45: {name: 'toggle_message_collapse', message_view_only: true}, // '-'
47: {name: 'search', message_view_only: false}, // '/'
@@ -660,6 +661,9 @@ exports.process_hotkey = function (e, hotkey) {
case 'C_deprecated':
ui.maybe_show_deprecation_notice('C');
return true;
case 'star_deprecated':
ui.maybe_show_deprecation_notice('*');
return true;
}
if (current_msg_list.empty()) {

View File

@@ -128,6 +128,8 @@ exports.maybe_show_deprecation_notice = function (key) {
var message;
if (key === 'C') {
message = i18n.t('We\'ve replaced the "C" hotkey with "x" to make this common shortcut easier to trigger.');
} else if (key === '*') {
message = i18n.t('We\'ve replaced the "*" hotkey with "Ctrl + s" to make this common shortcut easier to trigger.');
} else {
blueslip.error("Unexpected deprecation notice for hotkey:", key);
return;