From 5482b38807459eaf9e04060f6e42f63ef08d1d97 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 8 Oct 2012 14:32:17 +0400 Subject: [PATCH] add hotkeys to select marked/published articles --- help/main.php | 2 ++ js/tt-rss.js | 12 +++++++++++- js/viewfeed.js | 23 ++++++++++++++++++++++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/help/main.php b/help/main.php index e1812b3f..094b2897 100644 --- a/help/main.php +++ b/help/main.php @@ -43,6 +43,8 @@ + +
a a
a u
a U
a p
a i
a n
diff --git a/js/tt-rss.js b/js/tt-rss.js index fe53f2ea..9dbf6ef5 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 53219b15..2419988f 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"); -- 2.39.5