From: Andrew Dolgov Date: Mon, 8 Oct 2012 10:32:17 +0000 (+0400) Subject: add hotkeys to select marked/published articles X-Git-Tag: 1.6.0~16 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5482b38807459eaf9e04060f6e42f63ef08d1d97;p=tt-rss.git add hotkeys to select marked/published articles --- 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");