From 3cd4239a62a449365c5869196187403598d361d8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 21 May 2008 04:47:14 +0100 Subject: [PATCH] CDM: show clickable excerpt if article is collapsed --- functions.php | 22 +++++++++++++++++----- tt-rss.css | 15 ++++++++++++++- viewfeed.js | 10 ++++++++-- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index 100a1306..087ba8a4 100644 --- a/functions.php +++ b/functions.php @@ -5041,19 +5041,21 @@ } $expand_cdm = get_pref($link, 'CDM_EXPANDED'); + $show_excerpt = false; if ($expand_cdm && $score >= -100) { $cdm_cstyle = ""; + $show_excerpt = false; } else { $cdm_cstyle = "style=\"display : none\""; + $show_excerpt = true; } $mouseover_attrs = "onmouseover='postMouseIn($id)' onmouseout='postMouseOut($id)'"; print "
"; print "
"; @@ -5067,11 +5069,11 @@ print $entry_author; - if (!$expand_cdm || $score < -100) { +/* if (!$expand_cdm || $score < -100) { print "  (".__('Show article').")"; - } + } */ if (!get_pref($link, 'VFEED_GROUP_BY_FEED')) { @@ -5087,7 +5089,17 @@ "target=\"_new\" href=", $line["content_preview"]); } - print "
"; + if ($show_excerpt) { + print "
"; + print truncate_string(strip_tags($line["content_preview"]), 100); + print "
"; + } + + print "
"; // print "
"; diff --git a/tt-rss.css b/tt-rss.css index 49dfc827..eae6fc8a 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1036,7 +1036,20 @@ div.cdmHeader a:hover { } div.cdmContent { - margin : 5px 15px 0px 15px; + margin : 0px 15px 5px 15px; +} + +div.cdmContent:hover { + cursor : pointer; +} + +div.cdmExcerpt { + margin : 0px 15px 5px 15px; +} + +div.cdmExcerpt:hover { + cursor : pointer; + color : #88b0f0; } div.cdmEnclosures { diff --git a/viewfeed.js b/viewfeed.js index 713cc7e4..73417c3d 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -1505,9 +1505,11 @@ function getActiveArticleId() { return active_post_id; } -function cdmClicked(elem) { +function cdmClicked(id) { try { - if (elem.id && elem.id.match("RROW-")) { + var elem = document.getElementById("RROW-" + id); + + if (elem) { var id = elem.id.replace("RROW-", ""); active_post_id = id; @@ -1703,6 +1705,10 @@ function cdmExpandArticle(a_id) { try { var id = 'CICD-' + a_id; + try { + Element.hide("CEXC-" + a_id); + } catch (e) { } + Effect.Appear(id, {duration : 0.5, beforeStart: function(effect) { var h_id = 'CICH-' + a_id; -- 2.39.5