dark-mode: Add "T" hotkey for dark mode theme.

This commit is contained in:
Brock Whittaker
2017-11-14 12:06:04 -08:00
committed by Tim Abbott
parent f9f0f356be
commit ce62abce73
2 changed files with 7 additions and 1 deletions

View File

@@ -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.

View File

@@ -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);
};