]> git.wh0rd.org - tt-rss.git/commitdiff
new hotkey =: toggle hide read headlines
authorAndrew Dolgov <fox@bah.spb.su>
Tue, 3 Jun 2008 15:37:46 +0000 (16:37 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Tue, 3 Jun 2008 15:37:46 +0000 (16:37 +0100)
feedlist.js
help/3.php
tt-rss.js
viewfeed.js

index 1cd784524a0ab8b833ed31c5da31ea752c609014..6ac2765d1452154f140cc7dfa7668a3ccad1f8ef 100644 (file)
@@ -44,6 +44,9 @@ function viewNextFeedPage() {
 function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
        try {
 
+               // reset = hotkey
+               read_headlines_visible = true;
+
 //             if (!offset) page_offset = 0;
 
                last_requested_article = 0;
index fa65df2ccc21e6fbfc1300797a8df1513001dda6..701214adadf79468d2a78c5226b21c51fc32ffc2 100644 (file)
@@ -38,6 +38,7 @@
        <table>
                <tr><td class='n'>r</td><td><?php echo __("Update active feed") ?></td></tr>
                <tr><td class='n'>R</td><td><?php echo __("Update all feeds") ?></td></tr>
+               <tr><td class='n'>=</td><td><?php echo __("(Un)hide read articles") ?></td></tr>
                <tr><td class='n'>f a</td><td><?php echo __("(Un)hide read feeds") ?></td></tr>
                <tr><td class='n'>f s</td><td><?php echo __("Subscribe to feed") ?></td></tr>
                <tr><td class='n'>f e</td><td><?php echo __("Edit feed") ?></td></tr>
index 8ac20bfe8b7d29a04037d12e17d15d202c680f3b..a9a3b3f1b43fe9d92c02f162e96cd6b0c64e6cdd 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -1170,6 +1170,11 @@ function hotkey_handler(e) {
                                        }
                                }
                        }
+
+                       if (keycode == 187) { // =
+                               hideReadHeadlines();
+                               return;
+                       }
                }
 
                /* Prefix f */
index 21e9f48bfa6a7d76930233d62b6846a1ea3879f7..9890ac233f0d24cb71637e36fac5ea0dd762c949 100644 (file)
@@ -21,6 +21,7 @@ var vgroup_last_feed = false;
 var post_under_pointer = false;
 
 var last_requested_article = false;
+var read_headlines_visible = true;
 
 function catchup_callback() {
        if (xmlhttp_rpc.readyState == 4) {
@@ -1792,6 +1793,46 @@ function subtoolbarSearch() {
        } 
 }
 
+function hideReadHeadlines() {
+       try {
+
+               var ids = false;
+               var vis_ids = new Array();
+
+               if (document.getElementById("headlinesList")) {
+                       ids = getVisibleHeadlineIds();
+               } else {
+                       ids = cdmGetVisibleArticles();
+               }
+
+               for (var i = 0; i < ids.length; i++) {
+                       var row = document.getElementById("RROW-" + ids[i]);
+
+                       if (row && row.className) {
+                               if (read_headlines_visible) {
+                                       if (row.className.match("Unread") || row.className.match("Selected")) {
+                                               Element.show(row);
+                                               vis_ids.push(ids[i]);
+                                       } else {
+                                               //Effect.Fade(row, {duration : 0.3});
+                                               Element.hide(row);
+                                       }
+                               } else {
+                                       Element.show(row);
+                                       vis_ids.push(ids[i]);
+                               }
+                       }
+               }
+               
+               fixHeadlinesOrder(vis_ids);
+
+               read_headlines_visible = !read_headlines_visible;
+
+       } catch (e) {
+               exception_error("hideReadHeadlines", e);
+       } 
+}
+
 function getArticleUnderPointer() {
        return post_under_pointer;
 }