Skip to content

Commit

Permalink
added hotkeys for some common operations )
Browse files Browse the repository at this point in the history
  • Loading branch information
gf-mse committed Aug 5, 2022
1 parent f790731 commit 6321efd
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion nullboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -5439,6 +5439,33 @@ <h3>Auto-backup</h3>
if (! redoBoard())
showDing();
}
else // Ctrl-Alt-R
if (ev.ctrlKey && ev.altKey && (ev.keyCode == 82))
{
// alert(`Ctrl-Alt-Shift-R`);
stashBoardCopyRemote(NB);
_dbg("stashBoardCopyRemote(NB) command requested via a hotkey");
}
else // Ctrl-Alt-F
if (ev.ctrlKey && ev.altKey && (ev.keyCode == 70))
{
invokeFetchBoardCopyRemote();
_dbg("invokeFetchBoardCopyRemote() command requested via a hotkey");
}
else // Ctrl-Alt-Shift-/ as Ctrl-Alt-?
// if (ev.ctrlKey && ev.altKey && (ev.keyCode == 63))
if (ev.ctrlKey && ev.altKey && (ev.key == '?'))
{
invokeStashAndFetchRemote();
_dbg("invokeStashAndFetchRemote() command requested via a hotkey");
}
else // Ctrl-Alt-'+'
// if (ev.ctrlKey && ev.altKey && (ev.keyCode == 43))
if (ev.ctrlKey && ev.altKey && (ev.key == '+'))
{
invokeMergeStashedLocal();
_dbg("invokeMergeStashedLocal() command requested via a hotkey");
}
});

$('.wrap').on('click', '.board .text', function(ev){
Expand Down Expand Up @@ -5547,14 +5574,36 @@ <h3>Auto-backup</h3>
return false;
}

// done + toggle 'raw'
// done + toggle 'raw' // Alt-'R'
if (isNote && ev.altKey && ev.keyCode == 82)
{
$this.parent().toggleClass('raw');
stopEditing($this, false, false);
return false;
}

// Alt-O|M|N
if (isNote && ev.altKey) {

var changed = false;

if (ev.keyCode == 77) {
$this.parent().toggleClass('mark');
changed = true;
} else if (ev.keyCode == 78) {
$this.parent().toggleClass('new');
changed = true;
} else if (ev.keyCode == 79) {
$this.parent().toggleClass('old');
changed = true;
}

if (changed) {
stopEditing($this, false, false);
return false;
}
}

// ctrl-shift-8
if (isNote && ev.key == '*' && ev.ctrlKey)
{
Expand Down

0 comments on commit 6321efd

Please sign in to comment.