mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
dark-mode: Add "T" hotkey for dark mode theme.
This commit is contained in:
committed by
Tim Abbott
parent
f9f0f356be
commit
ce62abce73
@@ -149,7 +149,7 @@ function stubbing(func_name_to_stub, test_function) {
|
||||
// Unmapped keys should immediately return false, without
|
||||
// calling any functions outside of hotkey.js.
|
||||
assert_unmapped('abefhlmoptxyz');
|
||||
assert_unmapped('BEFHILNOQTUWXYZ');
|
||||
assert_unmapped('BEFHILNOQUWXYZ');
|
||||
|
||||
// We have to skip some checks due to the way the code is
|
||||
// currently organized for mapped keys.
|
||||
|
||||
@@ -78,6 +78,7 @@ var keypress_mappings = {
|
||||
80: {name: 'narrow_private', message_view_only: true}, // 'P'
|
||||
82: {name: 'respond_to_author', message_view_only: true}, // 'R'
|
||||
83: {name: 'narrow_by_subject', message_view_only: true}, //'S'
|
||||
84: {name: 'toggle_night_mode', message_view_only: false}, // 'T'
|
||||
86: {name: 'view_selected_stream', message_view_only: false}, //'V'
|
||||
99: {name: 'compose', message_view_only: true}, // 'c'
|
||||
100: {name: 'open_drafts', message_view_only: true}, // 'd'
|
||||
@@ -580,6 +581,9 @@ exports.process_hotkey = function (e, hotkey) {
|
||||
|
||||
// Shortcuts that don't require a message
|
||||
switch (event_name) {
|
||||
case 'toggle_night_mode':
|
||||
settings_display.set_night_mode(!page_params.night_mode);
|
||||
return true;
|
||||
case 'compose': // 'c': compose
|
||||
compose_actions.start('stream', {trigger: "compose_hotkey"});
|
||||
return true;
|
||||
@@ -717,6 +721,7 @@ exports.process_keydown = function (e) {
|
||||
if (!hotkey) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return exports.process_hotkey(e, hotkey);
|
||||
};
|
||||
|
||||
@@ -734,6 +739,7 @@ exports.process_keypress = function (e) {
|
||||
if (!hotkey) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return exports.process_hotkey(e, hotkey);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user