From 62bee26ea71cb0f54cb32620a15c69d66c344c68 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 13 Aug 2018 15:05:36 -0700 Subject: [PATCH] Revert "hotkey: Add hotkey to narrow to starred messages." This reverts commit 144d21494ed7f54934aea7ed297eee3a4eba62ab. --- frontend_tests/node_tests/hotkey.js | 6 +----- static/js/hotkey.js | 18 ++---------------- templates/zerver/app/keyboard_shortcuts.html | 4 ---- templates/zerver/help/keyboard-shortcuts.md | 2 -- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/frontend_tests/node_tests/hotkey.js b/frontend_tests/node_tests/hotkey.js index 582d9a8981..ffb24e026e 100644 --- a/frontend_tests/node_tests/hotkey.js +++ b/frontend_tests/node_tests/hotkey.js @@ -70,13 +70,12 @@ run_test('mappings', () => { }); } - function map_down(which, shiftKey, ctrlKey, metaKey, altKey) { + function map_down(which, shiftKey, ctrlKey, metaKey) { return hotkey.get_keydown_hotkey({ which: which, shiftKey: shiftKey, ctrlKey: ctrlKey, metaKey: metaKey, - altKey: altKey, }); } @@ -125,7 +124,6 @@ run_test('mappings', () => { assert.equal(map_down(75, true, true), undefined); // shift + ctrl + k assert.equal(map_down(83, true, true), undefined); // shift + ctrl + s assert.equal(map_down(219, true, true, false), undefined); // shift + ctrl + [ - assert.equal(map_down(83, false, false, false, true), undefined); // alt + s // CMD tests for MacOS global.navigator.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36"; @@ -137,8 +135,6 @@ run_test('mappings', () => { assert.equal(map_down(83, false, true, false), undefined); // ctrl + s // Reset userAgent global.navigator.userAgent = ''; - - assert.equal(map_down(83, false, true, false, true).name, 'narrow_starred'); // ctrl + alt + s }); run_test('basic_chars', () => { diff --git a/static/js/hotkey.js b/static/js/hotkey.js index fc68dae7a8..cff08d9ac0 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -111,23 +111,13 @@ var keypress_mappings = { 120: {name: 'compose_private_message', message_view_only: true}, // 'x' }; -var keydown_ctrl_alt_mappings = { - 83: {name: 'narrow_starred', message_view_only: true}, // 's' -}; - exports.get_keydown_hotkey = function (e) { - var hotkey; - if (e.altKey) { - if (e.ctrlKey) { - hotkey = keydown_ctrl_alt_mappings[e.which]; - if (hotkey) { - return hotkey; - } - } return; } + var hotkey; + if (e.ctrlKey && !e.shiftKey) { hotkey = keydown_ctrl_mappings[e.which]; if (hotkey) { @@ -636,10 +626,6 @@ exports.process_hotkey = function (e, hotkey) { return do_narrow_action(function (target, opts) { narrow.by('is', 'private', opts); }); - case 'narrow_starred': - return do_narrow_action(function (target, opts) { - narrow.by('is', 'starred', opts); - }); case 'query_streams': stream_list.initiate_search(); return true; diff --git a/templates/zerver/app/keyboard_shortcuts.html b/templates/zerver/app/keyboard_shortcuts.html index 1ffafed986..eb50371366 100644 --- a/templates/zerver/app/keyboard_shortcuts.html +++ b/templates/zerver/app/keyboard_shortcuts.html @@ -170,10 +170,6 @@ P {% trans %}Narrow to all private messages{% endtrans %} - - Ctrl + Alt + s - {% trans %}Narrow to starred messages{% endtrans %} - n {% trans %}Narrow to next unread topic{% endtrans %} diff --git a/templates/zerver/help/keyboard-shortcuts.md b/templates/zerver/help/keyboard-shortcuts.md index 77166f8cd7..531e462521 100644 --- a/templates/zerver/help/keyboard-shortcuts.md +++ b/templates/zerver/help/keyboard-shortcuts.md @@ -76,8 +76,6 @@ below, and add more to your repertoire as needed. * **Narrow to all private messages**: `P` -* **Narrow to starred messages**: `Ctrl + Alt + s` - * **Cycle between stream narrows**: `A` (previous) and `D` (next) * **Narrow to all messages**: `Esc` or `Ctrl` + `[` — Shows all unmuted messages.