浏览代码

getLoadedArticleIds: consider visible rows only
catchupFeedInGroup: hide articles when catching up, with caveats

Andrew Dolgov 8 年之前
父节点
当前提交
2d052e42b5
共有 3 个文件被更改,包括 25 次插入5 次删除
  1. 4 4
      classes/feeds.php
  2. 18 0
      js/feedlist.js
  3. 3 1
      js/viewfeed.js

+ 4 - 4
classes/feeds.php

@@ -465,7 +465,7 @@ class Feeds extends Handler_Protected {
 
 							$vf_catchup_link = "<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>";
 
-							$reply['content'] .= "<div id='FTITLE-$feed_id' class='cdmFeedTitle'>".
+							$reply['content'] .= "<div data-feed-id='$feed_id' id='FTITLE-$feed_id' class='cdmFeedTitle'>".
 								"<div style='float : right'>$feed_icon_img</div>".
 								"<a class='title' href=\"#\" onclick=\"viewfeed({feed:$feed_id})\">".
 								$line["feed_title"]."</a>
@@ -478,7 +478,7 @@ class Feeds extends Handler_Protected {
 					$mouseover_attrs = "onmouseover='postMouseIn(event, $id)'
 						onmouseout='postMouseOut($id)'";
 
-					$reply['content'] .= "<div class='hl $class' orig-feed-id='$feed_id' id='RROW-$id' $mouseover_attrs>";
+					$reply['content'] .= "<div class='hl $class' orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>";
 
 					$reply['content'] .= "<div class='hlLeft'>";
 
@@ -570,7 +570,7 @@ class Feeds extends Handler_Protected {
 								//$feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\" alt=\"\">";
 							}
 
-							$reply['content'] .= "<div id='FTITLE-$feed_id' class='cdmFeedTitle'>".
+							$reply['content'] .= "<div data-feed-id='$feed_id' id='FTITLE-$feed_id' class='cdmFeedTitle'>".
 								"<div style=\"float : right\">$feed_icon_img</div>".
 								"<a href=\"#\" class='title' onclick=\"viewfeed({feed:$feed_id})\">".
 								$line["feed_title"]."</a> $vf_catchup_link</div>";
@@ -584,7 +584,7 @@ class Feeds extends Handler_Protected {
 					$expanded_class = $expand_cdm ? "expanded" : "expandable";
 
 					$reply['content'] .= "<div class=\"cdm $hlc_suffix $expanded_class $class\"
-						id=\"RROW-$id\" orig-feed-id='$feed_id' $mouseover_attrs>";
+						id=\"RROW-$id\" data-article-id='$id' orig-feed-id='$feed_id' $mouseover_attrs>";
 
 					$reply['content'] .= "<div class=\"cdmHeader\">";
 					$reply['content'] .= "<div style=\"vertical-align : middle\">";

+ 18 - 0
js/feedlist.js

@@ -453,8 +453,26 @@ function catchupFeedInGroup(id) {
 
 				rows.each(function (row) {
 					row.removeClassName("Unread");
+
+					if (row.getAttribute("data-article-id") != getActiveArticleId()) {
+						new Effect.Fade(row, {duration: 0.5});
+					}
+
 				});
 
+				var feedTitles = $$("#headlines-frame > div[class='cdmFeedTitle']");
+
+				for (var i = 0; i < feedTitles.length; i++) {
+					if (feedTitles[i].getAttribute("data-feed-id") == id) {
+
+						if (i < feedTitles.length - 1) {
+							new Effect.Fade(feedTitles[i], {duration: 0.5});
+						}
+
+						break;
+					}
+				}
+
 				updateFloatingTitle(true);
 			}
 

+ 3 - 1
js/viewfeed.js

@@ -928,8 +928,10 @@ function getLoadedArticleIds() {
 	var children = $$("#headlines-frame > div[id*=RROW-]");
 
 	children.each(function(child) {
+		if (Element.visible(child)) {
 			rv.push(child.id.replace("RROW-", ""));
-		});
+		}
+	});
 
 	return rv;