]> git.wh0rd.org Git - tt-rss.git/commitdiff
limit the amount of tags shown in CDM
authorAndrew Dolgov <fox@bah.spb.su>
Thu, 9 Aug 2007 15:48:23 +0000 (16:48 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Thu, 9 Aug 2007 15:48:23 +0000 (16:48 +0100)
functions.php
tt-rss.css

index ff64a0a7036f90bb009678af597b2a5fe78e839d..11d1d8c04474960f6b70bc35a7193932cb5be51f 100644 (file)
                                        $tags = get_article_tags($link, $id);
 
                                        $tags_str = "";
+                                       $full_tags_str = "";
 
                                        foreach ($tags as $tag) {
                                                $num_tags++;
-                                               $tags_str .= "<a href=\"javascript:viewfeed('$tag')\">$tag</a>, "; 
+                                               $full_tags_str .= "<a href=\"javascript:viewfeed('$tag')\">$tag</a>, "; 
+                                               if ($num_tags < 5) {
+                                                       $tags_str .= "<a href=\"javascript:viewfeed('$tag')\">$tag</a>, "; 
+                                               } else if ($num_tags == 5) {
+                                                       $tags_str .= "...";
+                                               }
                                        }
 
                                        $tags_str = preg_replace("/, $/", "", $tags_str);
+                                       $full_tags_str = preg_replace("/, $/", "", $full_tags_str);
+
+                                       $all_tags_div = "<span class='cdmAllTagsCtr'>...<div class='cdmAllTags'>All Tags: $full_tags_str</div></span>";
+
+                                       $tags_str = preg_replace("/\.\.\.$/", "$all_tags_div", $tags_str);
+
 
                                        if ($tags_str == "") $tags_str = "no tags";
 
index 39ae0bdc89896fc832fbc6192719a9f7e1c246b1..7cdbaf0b328a70e42ad5ee4d778e596cac93c1f7 100644 (file)
@@ -849,6 +849,22 @@ td.hlFeed {
        background-color : white;
 } */
 
+div.cdmAllTags {
+       width : 75%;
+       float : left;
+       background-color : white;
+       border : 1px solid #c0c0c0;
+       display : none;
+       z-index : 3;
+       top : auto;
+       left : auto;
+       position : absolute;
+}
+
+span.cdmAllTagsCtr:hover div {
+       display : block;
+}
+
 div.cdmArticle {
        border-color : #a0a0a0;
        border-width : 0px 0px 1px 0px;