New: Add support for left/right arrows on the movie details to navigate through movies

New: Add support for ctrl+home and ctrl+end to jump to the top and bottom of the movie index
New: Add redirect to previous movie instead of index when deleting one
This commit is contained in:
nitsua
2020-09-07 21:12:47 -04:00
committed by Qstick
parent 870a39278c
commit 7f814a3cb9
8 changed files with 91 additions and 11 deletions

View File

@@ -20,18 +20,26 @@ function getShortcuts() {
}
function getShortcutKey(combo, isOsx) {
const comboMatch = combo.match(/(.+?)\+(.)/);
const comboMatch = combo.match(/(.+?)\+(.*)/);
if (!comboMatch) {
return combo;
}
const modifier = comboMatch[1];
const key = comboMatch[2];
let key = comboMatch[2];
let osModifier = modifier;
if (modifier === 'mod') {
osModifier = isOsx ? 'cmd' : 'ctrl';
osModifier = isOsx ? 'cmd' : 'Ctrl';
}
if (key === 'home') {
key = isOsx ? '↑' : 'Home';
}
if (key === 'end') {
key = isOsx ? '↓' : 'End';
}
return `${osModifier} + ${key}`;