]> git.wh0rd.org Git - tt-rss.git/commitdiff
combined mode improvements (add toggle read link, set post as read when link is clicked)
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 16 May 2006 13:41:57 +0000 (14:41 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 16 May 2006 13:41:57 +0000 (14:41 +0100)
backend.php
tt-rss.css
viewfeed.js

index 51551314e487f12033e375ced788cb3c6c0dfff2..081bd7726d83c3fa40a4e58d47b9ed83b1aa1bb1 100644 (file)
 
                                        print "<div class=\"cdmHeader\">";
 
-                                       print "<div style=\"float : right\">$updated_fmt</div>";
+                                       print "<div style=\"float : right\">$updated_fmt,
+                                               <a class=\"cdmToggleLink\"
+                                                       href=\"javascript:toggleUnread($id)\">Toggle unread</a>
+                                       </div>";
                                        
-                                       print "<a target=\"new\" href=\"".$line["link"]."\">".$line["title"]."</a>";
+                                       print "<a class=\"title\" 
+                                               onclick=\"javascript:toggleUnread($id, 0)\"
+                                               target=\"new\" href=\"".$line["link"]."\">".$line["title"]."</a>";
 
                                        if ($line["feed_title"]) {      
                                                print "&nbsp;(<a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a>)";
                                        print "</div>";
 
                                        print "<div class=\"cdmContent\">" . $line["content_preview"] . "</div>";
-       
+
                                        print "<div style=\"float : right\">$marked_pic</div>
-                                               <div class=\"cdmFooter\">
+                                               <div lass=\"cdmFooter\">
                                                        <input type=\"checkbox\" onclick=\"toggleSelectRowById(this, 
                                                        'RROW-$id')\" class=\"feedCheckBox\" id=\"RCHK-$id\"></div>";
 
+#                                      print "<div align=\"center\"><a class=\"cdmToggleLink\"
+#                                                      href=\"javascript:toggleUnread($id)\">
+#                                                      Toggle unread</a></div>";
+
                                        print "</div>"; 
 
                                }                               
index edbb311611dceb369659413ed1b15517566639af..a38159835534df46793f65a33a3df437fd242efb 100644 (file)
@@ -895,7 +895,7 @@ div.cdmArticleSelected, div.cdmArticleUnreadSelected {
        padding : 10px;
 }
 
-div.cdmArticleUnread div.cdmHeader a, div.cdmArticleUnreadSelected div.cdmHeader a {
+div.cdmArticleUnread div.cdmHeader a.title, div.cdmArticleUnreadSelected div.cdmHeader a {
        font-weight : bold;
 }
 
@@ -923,6 +923,7 @@ div.cdmHeader a:hover {
 }
 
 div.cdmContent {
+       margin-bottom : 5px;
 }
 
 a.warning {
@@ -1011,6 +1012,15 @@ div.cdmContent a:hover {
        color : black;
 }
 
+a.cdmToggleLink {
+       color : #808080;
+       font-size : x-small;
+}
+
+a.cdmToggleLink:hover {
+       color : #5050aa;
+}
+
 .noborder {
        border-width : 0px;
 }
index 8ad6c52074895ba5079f860921cc42a66a7648f0..809d36d4e07632789ebdf098a41f76d1c88a6264 100644 (file)
@@ -207,6 +207,42 @@ function localHotkeyHandler(keycode) {
 
 }
 
+function toggleUnread(id, cmode) {
+       try {
+               if (!xmlhttp_ready(xmlhttp_rpc)) {
+                       printLockingError();
+                       return;
+               }
+       
+               var row = document.getElementById("RROW-" + id);
+               if (row) {
+                       var nc = row.className;
+                       nc = nc.replace("Unread", "");
+                       nc = nc.replace("Selected", "");
+
+                       if (row.className.match("Unread")) {
+                               row.className = nc;
+                       } else {
+                               row.className = nc + "Unread";
+                       }
+
+                       if (!cmode) cmode = 2;
+
+                       var query = "backend.php?op=rpc&subop=catchupSelected&ids=" +
+                               param_escape(id) + "&cmode=" + param_escape(cmode);
+
+                       xmlhttp_rpc.open("GET", query, true);
+                       xmlhttp_rpc.onreadystatechange=all_counters_callback;
+                       xmlhttp_rpc.send(null);
+
+               }
+
+
+       } catch (e) {
+               exception_error("toggleUnread", e);
+       }
+}
+
 function selectionToggleUnread(cdm_mode) {
        try {
                if (!xmlhttp_ready(xmlhttp_rpc)) {