Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

keyboard_shortcuts: Add Shift+H to open message edit history dialog.

palashb01ad70838cffff
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index 6db11820075..d83f5916c08 100644
--- a/web/src/hotkey.js
+++ b/web/src/hotkey.js
@@ -24,6 +24,7 @@ import * as hotspots from "./hotspots";
import * as lightbox from "./lightbox";
import * as list_util from "./list_util";
import * as message_edit from "./message_edit";
+import * as message_edit_history from "./message_edit_history";
import * as message_lists from "./message_lists";
import * as message_scroll from "./message_scroll";
import * as narrow from "./narrow";
@@ -77,6 +78,7 @@ const keydown_shift_mappings = {
39: {name: "right_arrow", message_view_only: false}, // right arrow
38: {name: "up_arrow", message_view_only: false}, // up arrow
40: {name: "down_arrow", message_view_only: false}, // down arrow
+ 72: {name: "view_edit_history", message_view_only: true}, // 'H'
};
const keydown_unshift_mappings = {
@@ -1044,6 +1046,14 @@ export function process_hotkey(e, hotkey) {
message_edit.start($row);
return true;
}
+ case "view_edit_history": {
+ if (page_params.realm_allow_edit_history) {
+ message_edit_history.show_history(msg);
+ $("#message-history-cancel").trigger("focus");
+ return true;
+ }
+ return false;
+ }
case "move_message": {
if (!message_edit.can_move_message(msg)) {
return false;
diff --git a/web/templates/keyboard_shortcuts.hbs b/web/templates/keyboard_shortcuts.hbs
index 9b2dd3eb324..0f4bc841dc8 100644
--- a/web/templates/keyboard_shortcuts.hbs
+++ b/web/templates/keyboard_shortcuts.hbs
@@ -258,6 +258,10 @@
<td class="definition">{{t 'Toggle topic mute' }}</td>
<td><span class="hotkey"><kbd>Shift</kbd> + <kbd>M</kbd></span></td>
</tr>
+ <tr>
+ <td class="definition">{{t 'View edit history' }}</td>
+ <td><span class="hotkey"><kbd>Shift</kbd> + <kbd>H</kbd></span></td>
+ </tr>
</table>
</div>
<div>