summaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2020-03-23 23:05:01 +0100
committerGravatar GitHub <noreply@github.com> 2020-03-23 23:05:01 +0100
commita7b72481e7cbc14d729f85816b6851ee6fcf711c (patch)
tree96f01bf865726a8a6a864cf75ddcf9e2b89bf0eb /p/scripts
parent8fabed337a6a11d61e2ac969acc9690d296f8cb6 (diff)
Shortcut mark previous articles as read (#2843)
* Shortcut mark previous articles as read Address part of https://github.com/FreshRSS/FreshRSS/issues/2836 The shortcut [shift]+[r] now marks previous articles as read; The previous action of marking all articles as read is now achieved by [alt]+[r] So this is a slight breaking change, but I like the logic of the upward-facing [shift] arrow to hint at previous articles, while [alt] is more like "all", at least to my eyes :-) * Update app/i18n/nl/conf.php Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com> * [⇧ Shift] / [Alt ⎇] With standard Unicode signs * <kbd> + CSS styling * Missing themes Tested with all themes * Travis CSS Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 6143692eb..4cd67e014 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -298,6 +298,13 @@ function mark_read(div, only_not_read, asBatch) {
}
}
+function mark_previous_read(div) {
+ while (div) {
+ mark_read(div, true, true);
+ div = div.previousElementSibling;
+ }
+}
+
function mark_favorite(div) {
if (!div) {
return false;
@@ -786,9 +793,9 @@ function init_shortcuts() {
}
if (k === s.mark_read) {
if (ev.altKey) {
- return true;
- } else if (ev.shiftKey) { // Mark everything as read
document.querySelector('.nav_menu .read_all').click();
+ } else if (ev.shiftKey) {
+ mark_previous_read(document.querySelector('.flux.current'));
} else { // Toggle the read state
mark_read(document.querySelector('.flux.current'), false, false);
}