summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-10-08 14:32:17 +0400
committerAndrew Dolgov <[email protected]>2012-10-08 14:32:17 +0400
commit5482b38807459eaf9e04060f6e42f63ef08d1d97 (patch)
tree5518aa71427a96136c03766faee88d08566fc582
parent441a89d3c509dd796ea4d5093afe0c03f7eaf4a9 (diff)
add hotkeys to select marked/published articles
-rw-r--r--help/main.php2
-rw-r--r--js/tt-rss.js12
-rw-r--r--js/viewfeed.js23
3 files changed, 35 insertions, 2 deletions
diff --git a/help/main.php b/help/main.php
index e1812b3f2..094b28977 100644
--- a/help/main.php
+++ b/help/main.php
@@ -43,6 +43,8 @@
<table>
<tr><td class='n'>a a</td><td><?php echo __("Select all articles") ?></td></tr>
<tr><td class='n'>a u</td><td><?php echo __("Select unread articles") ?></td></tr>
+ <tr><td class='n'>a U</td><td><?php echo __("Select starred articles") ?></td></tr>
+ <tr><td class='n'>a p</td><td><?php echo __("Select published articles") ?></td></tr>
<tr><td class='n'>a i</td><td><?php echo __("Invert article selection") ?></td></tr>
<tr><td class='n'>a n</td><td><?php echo __("Deselect all articles") ?></td></tr>
</table>
diff --git a/js/tt-rss.js b/js/tt-rss.js
index fe53f2ea2..9dbf6ef50 100644
--- a/js/tt-rss.js
+++ b/js/tt-rss.js
@@ -839,11 +839,21 @@ function hotkey_handler(e) {
return;
}
- if (keycode == 85) { // u
+ if (keycode == 85 && !shift_key) { // u
selectArticles('unread');
return;
}
+ if (keycode == 80) { // p
+ selectArticles('published');
+ return;
+ }
+
+ if (keycode == 85 && shift_key) { // u
+ selectArticles('marked');
+ return;
+ }
+
if (keycode == 73) { // i
selectArticles('invert');
return;
diff --git a/js/viewfeed.js b/js/viewfeed.js
index 53219b159..2419988ff 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -851,7 +851,7 @@ function getLoadedArticleIds() {
}
-// mode = all,none,unread,invert
+// mode = all,none,unread,invert,marked,published
function selectArticles(mode) {
try {
@@ -872,6 +872,27 @@ function selectArticles(mode) {
child.removeClassName("Selected");
cb.checked = false;
}
+ } else if (mode == "marked") {
+ var img = $("FMPIC-" + child.id.replace("RROW-", ""));
+
+ if (img && img.src.match("mark_set")) {
+ child.addClassName("Selected");
+ cb.checked = true;
+ } else {
+ child.removeClassName("Selected");
+ cb.checked = false;
+ }
+ } else if (mode == "published") {
+ var img = $("FPPIC-" + child.id.replace("RROW-", ""));
+
+ if (img && img.src.match("pub_set")) {
+ child.addClassName("Selected");
+ cb.checked = true;
+ } else {
+ child.removeClassName("Selected");
+ cb.checked = false;
+ }
+
} else if (mode == "invert") {
if (child.hasClassName("Selected")) {
child.removeClassName("Selected");