|
@@ -1205,13 +1205,13 @@ function init_shortcuts() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
document.addEventListener('keydown', ev => {
|
|
document.addEventListener('keydown', ev => {
|
|
|
- if (ev.ctrlKey || ev.metaKey || (ev.altKey && ev.shiftKey) || ev.target.closest('input, select, textarea')) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
const s = context.shortcuts;
|
|
const s = context.shortcuts;
|
|
|
let k = (ev.key.trim() || ev.code || 'Space').toUpperCase();
|
|
let k = (ev.key.trim() || ev.code || 'Space').toUpperCase();
|
|
|
|
|
|
|
|
|
|
+ if ((ev.ctrlKey && k !== s.go_website) || ev.metaKey || (ev.altKey && ev.shiftKey) || ev.target.closest('input, select, textarea')) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// IE11
|
|
// IE11
|
|
|
if (k === 'SPACEBAR') k = 'SPACE';
|
|
if (k === 'SPACEBAR') k = 'SPACE';
|
|
|
else if (k === 'DEL') k = 'DELETE';
|
|
else if (k === 'DEL') k = 'DELETE';
|
|
@@ -1324,14 +1324,6 @@ function init_shortcuts() {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (ev.altKey || ev.shiftKey) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- if (k === s.mark_favorite) { // Toggle the favorite state
|
|
|
|
|
- mark_favorite(document.querySelector('.flux.current'));
|
|
|
|
|
- ev.preventDefault();
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
if (k === s.go_website) {
|
|
if (k === s.go_website) {
|
|
|
if (context.auto_mark_site) {
|
|
if (context.auto_mark_site) {
|
|
|
mark_read(document.querySelector('.flux.current'), true, false);
|
|
mark_read(document.querySelector('.flux.current'), true, false);
|
|
@@ -1344,6 +1336,15 @@ function init_shortcuts() {
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (ev.altKey || ev.shiftKey) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (k === s.mark_favorite) { // Toggle the favorite state
|
|
|
|
|
+ mark_favorite(document.querySelector('.flux.current'));
|
|
|
|
|
+ ev.preventDefault();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const hash = location.hash.substr(1);
|
|
const hash = location.hash.substr(1);
|
|
|
if (k === s.skip_next_entry) { next_entry(true); ev.preventDefault(); return; }
|
|
if (k === s.skip_next_entry) { next_entry(true); ev.preventDefault(); return; }
|
|
|
if (k === s.skip_prev_entry) { prev_entry(true); ev.preventDefault(); return; }
|
|
if (k === s.skip_prev_entry) { prev_entry(true); ev.preventDefault(); return; }
|