summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-10-18 03:55:44 +0100
committerAndrew Dolgov <[email protected]>2007-10-18 03:55:44 +0100
commita04c8e8dc2efd08e6f4d828d93099bacf02d421d (patch)
treeb0ca415a34a1d2c513396244f3095ce9b3a27591
parentbef4c2451ee731b572e95646f40e75a514baae9a (diff)
add collapsed CDM mode
-rw-r--r--functions.js5
-rw-r--r--functions.php20
-rw-r--r--viewfeed.js22
3 files changed, 44 insertions, 3 deletions
diff --git a/functions.js b/functions.js
index abbe62326..0211d2f56 100644
--- a/functions.js
+++ b/functions.js
@@ -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";
}
diff --git a/functions.php b/functions.php
index f87491d61..32240b1ac 100644
--- a/functions.php
+++ b/functions.php
@@ -4622,7 +4622,25 @@
"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'>";
diff --git a/viewfeed.js b/viewfeed.js
index 273e2d91b..24584e49f 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -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);
+ }
+
+}
+
+