]> git.wh0rd.org - tt-rss.git/commitdiff
CDM: show clickable excerpt if article is collapsed
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 21 May 2008 03:47:14 +0000 (04:47 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 21 May 2008 03:47:14 +0000 (04:47 +0100)
functions.php
tt-rss.css
viewfeed.js

index 100a1306e845b96ff32a1c4cbc42459db85305f5..087ba8a4e8d20fcd40ab75ea472e028e9ede080c 100644 (file)
                                        }       
 
                                        $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 "<div class=\"cdmArticle$add_class\" 
-                                               id=\"RROW-$id\"
-                                               onclick='cdmClicked(this)'
+                                               id=\"RROW-$id\"                                         
                                                $mouseover_attrs'>";
 
                                        print "<div class=\"cdmHeader\">";
 
                                        print $entry_author;
 
-                                       if (!$expand_cdm || $score < -100) {
+/*                                     if (!$expand_cdm || $score < -100) {
                                                print "&nbsp;<a id=\"CICH-$id\" 
                                                        href=\"javascript:cdmExpandArticle($id)\">
                                                        (".__('Show article').")</a>";
-                                       } 
+                                       } */
 
 
                                        if (!get_pref($link, 'VFEED_GROUP_BY_FEED')) {
                                                        "target=\"_new\" href=", $line["content_preview"]);
                                        }
 
-                                       print "<div class=\"cdmContent\" id=\"CICD-$id\" $cdm_cstyle>";
+                                       if ($show_excerpt) {
+                                               print "<div class=\"cdmExcerpt\" id=\"CEXC-$id\"
+                                                       onclick=\"cdmExpandArticle($id)\"
+                                                       title=\"".__('Click to expand article')."\">";
+                                               print truncate_string(strip_tags($line["content_preview"]), 100);
+                                               print "</div>";
+                                       }
+       
+                                       print "<div class=\"cdmContent\" 
+                                               onclick=\"cdmClicked($id)\"
+                                               id=\"CICD-$id\" $cdm_cstyle>";
 
 //                                     print "<div class=\"cdmInnerContent\" id=\"CICD-$id\" $cdm_cstyle>";
 
index 49dfc827cb094f0aad283d3b131c4d917c97012b..eae6fc8a66c54f196f18ebf44b0604b106d92b72 100644 (file)
@@ -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 {
index 713cc7e440f69ddf1dca2f577cd8c4a33e2e37a1..73417c3d5755ae5f046aec28ec5cdfaa52f91920 100644 (file)
@@ -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;