diff options
| -rw-r--r-- | app/views/helpers/javascript_vars.phtml | 1 | ||||
| -rw-r--r-- | p/scripts/main.js | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 5be818935..54ba2917f 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -61,6 +61,7 @@ echo htmlspecialchars(json_encode(array( 'login' => Minz_Url::display(array('c' => 'auth', 'a' => 'login'), 'php'), 'logout' => Minz_Url::display(array('c' => 'auth', 'a' => 'logout'), 'php'), 'help' => FRESHRSS_WIKI, + 'shortcuts' => Minz_Url::display(array('c' => 'configure', 'a' => 'shortcut'), 'php'), ), 'i18n' => array( 'confirmation_default' => _t('gen.js.confirm_action'), diff --git a/p/scripts/main.js b/p/scripts/main.js index f35fa35df..3d1022872 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -973,8 +973,7 @@ function init_shortcuts() { }); document.addEventListener('keydown', ev => { - if (ev.target.closest('input, textarea') || - ev.ctrlKey || ev.metaKey || (ev.altKey && ev.shiftKey)) { + if (ev.ctrlKey || ev.metaKey || (ev.altKey && ev.shiftKey) || ev.target.closest('input, select, textarea')) { return; } @@ -1080,6 +1079,10 @@ function init_shortcuts() { ev.preventDefault(); return; } + if (ev.key === '?') { + window.location.href = context.urls.shortcuts.replace(/&/g, '&'); + return; + } if (ev.altKey || ev.shiftKey) { return; |
