]> git.wh0rd.org Git - tt-rss.git/commitdiff
add hotkeys to select marked/published articles
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 8 Oct 2012 10:32:17 +0000 (14:32 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 8 Oct 2012 10:32:17 +0000 (14:32 +0400)
help/main.php
js/tt-rss.js
js/viewfeed.js

index e1812b3f23569517a1637b3e0bc4d82c2efe51a5..094b2897748e54d3a46180ec4553bfab17f2bfdc 100644 (file)
@@ -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>
index fe53f2ea2f16f348d62414c40657be486f3610b6..9dbf6ef50af28f8854cc5757ebb97b94345ba390 100644 (file)
@@ -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;
index 53219b1594d08d75846c6d1a8b0ae0970a43bf4c..2419988ff6ca88e643c57c8772640d77e74a9e03 100644 (file)
@@ -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");