]> git.wh0rd.org Git - tt-rss.git/commitdiff
digest: properly mark fresh articles
authorAndrew Dolgov <fox@bah.org.ru>
Mon, 13 Sep 2010 14:32:34 +0000 (18:32 +0400)
committerAndrew Dolgov <fox@bah.org.ru>
Mon, 13 Sep 2010 14:32:34 +0000 (18:32 +0400)
digest.css
digest.js

index 70728c70e9f99d6e00f6e5df83e9b0b5300487c0..2ed6aae93bb2d1d16d640187cecbc487524401cf 100644 (file)
@@ -209,6 +209,14 @@ a:hover {
        clear : left;
 }
 
+#headlines ul#headlines-content li.fresh a.title {
+       font-weight : bold;
+       font-size : 16px;
+       display : block;
+       padding-left : 21px;
+       color : #007FFF;
+}
+
 #headlines ul#headlines-content li.unread a.title {
        font-weight : bold;
        font-size : 16px;
index 8659c8fb3c66e7a7905817b722dfe234a17a888c..cb42633b6111ffd496856535ef1f1e0d72079dee 100644 (file)
--- a/digest.js
+++ b/digest.js
@@ -405,7 +405,15 @@ function add_headline_entry(article, feed, no_effects) {
                if (article.excerpt.trim() == "")
                        article.excerpt = __("Click to expand article.");
 
-               var tmp_html = "<li id=\"A-"+article.id+"\" "+style+" class=\"unread\">" + 
+               var li_class = "unread";
+
+               var fresh_max = getInitParam("fresh_article_max_age") * 60 * 60;
+               var d = new Date();
+
+               if (d.getTime() / 1000 - article.updated < fresh_max)
+                       li_class = "fresh";
+
+               var tmp_html = "<li id=\"A-"+article.id+"\" "+style+" class=\""+li_class+"\">" + 
                        icon_part +
 
                        "<div class='digest-check'>" +