Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions front/public/hotkeys-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@
// above is the hotkeys.js library code
// CTFNote code starts here:

// Disable hotkeys.js INPUT, SELECT and TEXTAREA filter (https://wangchujiang.com/hotkeys-js/#filter)
// This is required for shortcuts to work in HedgeDoc's CodeMirror editor
hotkeys.filter = function() {
return true;
}

hotkeys('ctrl+k, command+k', function (event) {
event.stopImmediatePropagation();
event.preventDefault();
Expand All @@ -372,23 +378,3 @@ hotkeys('ctrl+s, command+s', function (event) {

parent.postMessage('solveTask', '*');
});

// Hotkeys for HedgeDoc CodeMirror editor
editor.setOption('extraKeys', {
'Ctrl-K': () => {
parent.postMessage('showSearchDialog', '*');
return false;
},
'Cmd-K': () => {
parent.postMessage('showSearchDialog', '*');
return false;
},
'Ctrl-S': () => {
parent.postMessage('solveTask', '*');
return false;
},
'Cmd-S': () => {
parent.postMessage('solveTask', '*');
return false;
},
});
Loading