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

This commit introduces a new keyboard shortcut to open the message
edit history dialog for the selected message by using Shift+H.
This commit is contained in:
palashb01 2023-07-28 05:23:54 +05:30 committed by Tim Abbott
parent 92d1c6e390
commit ad70838cff
2 changed files with 14 additions and 0 deletions

View File

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

View File

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