aboutsummaryrefslogtreecommitdiff
path: root/p
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
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')
-rw-r--r--p/scripts/main.js11
-rw-r--r--p/themes/Alternative-Dark/template.css10
-rw-r--r--p/themes/base-theme/template.css10
-rw-r--r--p/themes/base-theme/template.rtl.css10
4 files changed, 39 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);
}
diff --git a/p/themes/Alternative-Dark/template.css b/p/themes/Alternative-Dark/template.css
index 005f65ff0..0ec76ea2d 100644
--- a/p/themes/Alternative-Dark/template.css
+++ b/p/themes/Alternative-Dark/template.css
@@ -66,6 +66,16 @@ sup {
vertical-align: baseline;
}
+kbd {
+ background-color: #eee;
+ padding: 2px 4px;
+ display: inline-block;
+ color: #333;
+ border: 1px solid #b4b4b4;
+ border-radius: 3px;
+ white-space: nowrap;
+}
+
/*=== Images */
img {
max-width: 100%;
diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css
index 5977a0d15..ed10c9c7d 100644
--- a/p/themes/base-theme/template.css
+++ b/p/themes/base-theme/template.css
@@ -66,6 +66,16 @@ sup {
vertical-align: baseline;
}
+kbd {
+ background-color: #eee;
+ padding: 2px 4px;
+ display: inline-block;
+ color: #333;
+ border: 1px solid #b4b4b4;
+ border-radius: 3px;
+ white-space: nowrap;
+}
+
/*=== Images */
img {
max-width: 100%;
diff --git a/p/themes/base-theme/template.rtl.css b/p/themes/base-theme/template.rtl.css
index a0a7b7d5a..8e637690d 100644
--- a/p/themes/base-theme/template.rtl.css
+++ b/p/themes/base-theme/template.rtl.css
@@ -66,6 +66,16 @@ sup {
vertical-align: baseline;
}
+kbd {
+ background-color: #eee;
+ padding: 2px 4px;
+ display: inline-block;
+ color: #333;
+ border: 1px solid #b4b4b4;
+ border-radius: 3px;
+ white-space: nowrap;
+}
+
/*=== Images */
img {
max-width: 100%;