]> git.wh0rd.org Git - tt-rss.git/commitdiff
add collapsed CDM mode
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 18 Oct 2007 02:55:44 +0000 (03:55 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 18 Oct 2007 02:55:44 +0000 (03:55 +0100)
functions.js
functions.php
viewfeed.js

index abbe6232662344e5875bdf07ef7d4efcb95f9025..0211d2f56ffd7a187b88e48082c16bbbc0b57f21 100644 (file)
@@ -1198,7 +1198,9 @@ function checkboxToggleElement(elem, id) {
 function appearBlockElement(id, h_id) {
 
        try {
-               Effect.Fade(h_id);
+               if (h_id) {
+                       Effect.Fade(h_id);
+               }
                Effect.SlideDown(id, {duration : 1.0, afterFinish: appearBlockElement_afh});
        } catch (e) {
                exception_error("appearBlockElement", e);
@@ -1206,7 +1208,6 @@ function appearBlockElement(id, h_id) {
 
 }
 
-
 function hideParentElement(e) {
        e.parentNode.style.display = "none";
 }
index f87491d61675243b7a3642466587cc2c1ba02ae2..32240b1ac64fc6ec7051a98e9caff37ce9dfcba8 100644 (file)
                                                        "target=\"_new\" href=", $line["content_preview"]);
                                        }
 
-                                       print "<div class=\"cdmContent\">" . $line["content_preview"] . "</div><br clear=\"all\">";
+                                       $expand_cdm = get_pref($link, 'CDM_EXPANDED');
+
+                                       if ($expand_cdm) {
+                                               $cdm_cstyle = "";
+                                       } else {
+                                               $cdm_cstyle = "style=\"display : none\"";
+                                       }
+
+                                       print "<div class=\"cdmContent\">";
+
+                                       print "<div class=\"cdmInnerContent\" id=\"CICD-$id\" $cdm_cstyle>";
+                                       print $line["content_preview"];
+                                       print "</div>";
+
+                                       print "<a id=\"CICH-$id\" 
+                                               href=\"javascript:cdmExpandArticle($id)\">
+                                               Show article</a>";
+
+                                       print "</div><br clear=\"all\">";
 
                                        print "<div class=\"cdmFooter\"><span class='s0'>";
 
index 273e2d91b4d5b7b7d77229e77f0cb26751a02ac2..24584e49fc376317d6c39621de9f863b31a008bf 100644 (file)
@@ -1355,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);
+       }
+
+}
+
+