]> git.wh0rd.org - tt-rss.git/blobdiff - viewfeed.js
add collapsed CDM mode
[tt-rss.git] / viewfeed.js
index 7106d781bcbdadf12a7e1b91f03ceb8d33c2c6ca..24584e49fc376317d6c39621de9f863b31a008bf 100644 (file)
@@ -109,8 +109,17 @@ function headlines_callback2(transport, active_feed_id, is_cat, feed_cur_page) {
                                                if (!c) {
                                                        c = document.getElementById("headlinesInnerContainer");
                                                }
+
+                                               var ids = getSelectedArticleIds2();
        
                                                c.innerHTML = c.innerHTML + headlines.firstChild.nodeValue;
+
+                                               debug("restore selected ids: " + ids);
+
+                                               for (var i = 0; i < ids.length; i++) {
+                                                       markHeadline(ids[i]);
+                                               }
+
                                        } else {
                                                debug("no new headlines received");
                                        }
@@ -204,6 +213,9 @@ function showArticleInHeadlines(id) {
                cleanSelected("headlinesList");
        
                var crow = document.getElementById("RROW-" + id);
+
+               if (!crow) return;
+
                var article_is_unread = crow.className.match("Unread");
                        
                crow.className = crow.className.replace("Unread", "");
@@ -1331,10 +1343,11 @@ function catchupRelativeToArticle(below) {
                                var query = "backend.php?op=rpc&subop=catchupSelected&ids=" +
                                        param_escape(ids_to_mark.toString()) + "&cmode=0";
 
-                               xmlhttp_rpc.open("GET", query, true);
-                               xmlhttp_rpc.onreadystatechange=catchup_callback;
-                               xmlhttp_rpc.send(null);
-       
+                               new Ajax.Request(query, {
+                                       onComplete: function(transport) { 
+                                               catchup_callback2(transport); 
+                                       } });
+
                        }
                }
 
@@ -1342,3 +1355,25 @@ function catchupRelativeToArticle(below) {
                exception_error("catchupRelativeToArticle", e);
        }
 }
+
+function cdmExpandArticle(a_id) {
+       try {
+               var id = 'CICD-' + a_id;
+
+               Effect.Appear(id, {duration : 0.5, 
+                       beforeStart: function(effect) { 
+                               var h_id = 'CICH-' + a_id;
+                               var h_elem = document.getElementById(h_id);
+                               if (h_elem) { h_elem.style.display = "none"; }
+
+                               toggleUnread(a_id, 0);
+                       }});
+
+
+       } catch (e) {
+               exception_error("appearBlockElementF", e);
+       }
+
+}
+
+