]> git.wh0rd.org Git - tt-rss.git/commitdiff
toggle hide/display only unread feeds, All feeds: button ops changed into selector
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 15 Nov 2005 09:13:49 +0000 (10:13 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 15 Nov 2005 09:13:49 +0000 (10:13 +0100)
backend.php
feedlist.js
functions.js
tt-rss.css
tt-rss.js
tt-rss.php
tt-rss_compact.css

index abde27d711ceca6689f9983d109c3e31ecf43508..3bae2a869ac59089cf9521df92298cd63da8e914 100644 (file)
                        <script type=\"text/javascript\" src=\"functions.js\"></script>
                        <script type=\"text/javascript\" src=\"feedlist.js\"></script>
                        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
-                       </head><body>";
+                       </head><body onload=\"init()\">";
 
                print "<ul class=\"feedList\" id=\"feedList\">";
 
                                FROM ttrss_entries WHERE marked = true AND unread = true");
                        $num_starred = db_fetch_result($result, 0, "num_starred");
 
-                       $class = "odd";
+                       $class = "virt";
 
                        if ($num_starred > 0) $class .= "Unread";
 
        
                                        $count = db_fetch_result($tmp_result, 0, "count");
        
-                                       $class = "odd";
+                                       $class = "label";
        
                                        if ($count > 0) {
                                                $class .= "Unread";
                                
        //                      $class = ($lnum % 2) ? "even" : "odd";
        
-                               $class = "odd";
+                               $class = "feed";
        
                                if ($unread > 0) $class .= "Unread";
        
index a76e4a345ce73acd45a7fc8b1d094c36c1601bad..9e18489d90f87f3679d29b67c135eeb92e3f9a1c 100644 (file)
@@ -88,4 +88,8 @@ function viewfeed(feed, skip, subop, doc) {
 
 }
 
+function init() {
 
+       hideOrShowFeeds(document, getCookie("ttrss_vf_hreadf") == 1);
+
+}
index baee89558aef55a618d7a45b4e2ee0a52568b25c..78e3bbaaed8b2f97a4b1572cbb0b06cfce660a76 100644 (file)
@@ -396,3 +396,24 @@ function popupHelp(tid) {
     }
   }
 
+
+function hideOrShowFeeds(doc, hide) {
+
+       var css_rules = doc.styleSheets[0].cssRules;
+
+       for (i = 0; i < css_rules.length; i++) {
+               var rule = css_rules[i];
+
+               if (rule.selectorText == "ul.feedList li.feed") {
+                       if (!hide) {
+                               rule.style.display = "block";
+                       } else {
+                               rule.style.display = "none";
+                       }
+               }
+
+       } 
+
+}
+
+
index 46654b85089c8add39625d451f389b2102db36c8..8dbe4c20d1700e0f55f4e3b72f266b539004977d 100644 (file)
@@ -151,7 +151,32 @@ ul.feedList li.oddSelected, ul.feedList li.evenSelected,
 li.oddSelected a, li.evenSelected a,
        li.oddUnreadSelected a, li.evenUnreadSelected a {
        color : #5050aa;
-} 
+}
+
+ul.feedlist 
+       li.virtSelected,
+       li.virtUnreadSelected,
+       li.feedSelected, 
+       li.labelSelected, 
+       li.feedUnreadSelected, 
+       li.labelUnreadSelected {
+       background-color : white;
+}
+
+ul.feedlist 
+       li.feedSelected a, 
+       li.labelSelected a, 
+       li.feedUnreadSelected a, 
+       li.labelUnreadSelected a, 
+       li.virtSelected a, 
+       li.virtUnreadSelected a,
+       li.virtSelectedUnread a {
+       color : #5050aa;
+}
+
+ul.feedList li.feed {
+       display : block;
+}
 
 ul.feedList img {
        margin : 0px 3px 0px 0px;
@@ -285,12 +310,12 @@ a.button {
        font-size : small;
 }
 
-.evenUnreadSelected, .evenSelectedUnread {
+.evenUnreadSelected, .evenSelectedUnread, {
        background-color : #e0e0ff;
        font-weight : bold;
 }
 
-.oddUnreadSelected, .oddSelectedUnread {
+.oddUnreadSelected, .oddSelectedUnread, .feedSelectedUnread,  {
        background-color : #e0e0ff;
        font-weight : bold;
 }
@@ -301,6 +326,17 @@ a.button {
 
 .oddSelected {
        background-color : #e0e0ff;
+} 
+
+.feedUnreadSelected, .feedSelectedUnread, 
+.virtUnreadSelected, .virtSelectedUnread,
+.labelUnreadSelected, .labelSelectedUnread {
+       background-color : #e0e0ff;
+       font-weight : bold;
+}
+
+.feedUnread, .labelUnread, .virtUnread {
+       font-weight : bold;
 }
 
 .disabledButton {
index 96894a58ded4665eb21c5de1f7901db93e5cdf02..0fb61a117526bee3b22094a74f47dd70c8724d54 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -12,6 +12,7 @@ var search_query = "";
 var search_mode = "";
 
 var display_tags = false;
+//var display_read_feeds = true;
 
 var global_unread = 0;
 
@@ -524,3 +525,42 @@ function qfdDelete(feed_id) {
        xmlhttp.send(null);
 }
 
+
+function allFeedsMenuGo() {
+       var chooser = document.getElementById("allFeedsChooser");
+
+       var opname = chooser[chooser.selectedIndex].text;
+
+       if (opname == "Update") {
+               scheduleFeedUpdate(true);
+               return;
+       }
+
+       if (opname == "Mark as read") {
+               catchupAllFeeds();
+               return;
+       }
+
+       if (opname == "Toggle display read") {
+               toggleDispRead();
+               return;
+       }
+
+}
+
+function toggleDispRead() {
+       var hide_read_feeds = (getCookie("ttrss_vf_hreadf") == 1);
+
+       hide_read_feeds = !hide_read_feeds;
+
+       var feeds_doc = window.frames["feeds-frame"].document;
+
+       hideOrShowFeeds(feeds_doc, hide_read_feeds);
+
+       if (hide_read_feeds) {
+               setCookie("ttrss_vf_hreadf", 1);
+       } else {
+               setCookie("ttrss_vf_hreadf", 0);
+       }
+
+}
index a78a41f7a73c10918a4da47e51de313f6c9f1224..34639c64fe33539df91455cc4518f6f07cebc930 100644 (file)
                        src="backend.php?op=error&msg=Loading,%20please wait..."
                        id="feeds-frame" name="feeds-frame" class="feedsFrame"> </iframe>
        
-               <p align="center">All feeds:
+               <div align="center">All feeds: 
                
-               <input class="button" type="submit"     
-                       onclick="javascript:scheduleFeedUpdate(true)" value="Update">
-                               
-               <input class="button" type="submit"     
-                       onclick="javascript:catchupAllFeeds()" value="Mark as read">
+               <select id="allFeedsChooser">
+                       <option>Update</option>
+                       <option>Mark as read</option>
+                       <option>Toggle display read</option>
+               </select>
 
-               </p>
+               <input type="submit" class="button" onclick="allFeedsMenuGo()" value="Go">
+
+               </div>
 
        </td>
        <td valign="top" class="headlinesToolbarBox">
index deec0e39e0dfacdd096def85dd848fc4a0c373e3..844248592ba43f96e402f32405dd9f76669d32da 100644 (file)
@@ -176,6 +176,10 @@ li.oddSelected a, li.evenSelected a,
        font-size:8pt;
 } 
 
+ul.feedList li.even, li.odd {
+       display : block;
+}
+
 ul.feedList img {
        margin : 0px 3px 0px 0px;
        width : 16px;
@@ -328,6 +332,18 @@ a.button {
        background-color : #e0e0ff;
 }
 
+.feedUnreadSelected, .feedSelectedUnread, 
+.virtUnreadSelected, .virtSelectedUnread,
+.labelUnreadSelected, .labelSelectedUnread {
+       background-color : #e0e0ff;
+       font-weight : bold;
+}
+
+.feedUnread, .labelUnread, .virtUnread {
+       font-weight : bold;
+}
+
+
 .disabledButton {
        border : 1px solid #c0c0c0;
        background-color : white;