mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
hotkeys: Replace C with x for composing PM.
Pressing the 'x' key can now be used to compose a PM. Pressing the 'C' key displays a modal that shows a deprecation notice. Fixes #6548.
This commit is contained in:
committed by
Tim Abbott
parent
af004fa6f5
commit
1227857de6
@@ -122,6 +122,27 @@ exports.show_failed_message_success = function (message_id) {
|
||||
});
|
||||
};
|
||||
|
||||
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 {
|
||||
// should never get here
|
||||
return;
|
||||
}
|
||||
|
||||
var shown_deprecation_notices = JSON.parse(localStorage.getItem('shown_deprecation_notices'));
|
||||
if (shown_deprecation_notices === null) {
|
||||
shown_deprecation_notices = [];
|
||||
}
|
||||
if (shown_deprecation_notices.indexOf(key) === -1) {
|
||||
$('#deprecation-notice-modal').modal('show');
|
||||
$('#deprecation-notice-message').text(message);
|
||||
shown_deprecation_notices.push(key);
|
||||
localStorage.setItem('shown_deprecation_notices', JSON.stringify(shown_deprecation_notices));
|
||||
}
|
||||
};
|
||||
|
||||
/* EXPERIMENTS */
|
||||
|
||||
/* This method allows an advanced user to use the console
|
||||
|
||||
Reference in New Issue
Block a user