$cur_feed_title = htmlspecialchars($cur_feed_title);
- $vf_catchup_link = "(<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('Mark as read')."</a>)";
+ $vf_catchup_link = "<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>";
- $reply['content'] .= "<div class='cdmFeedTitle'>".
- "<div style=\"float : right\">$feed_icon_img</div>".
- "<a class='title' href=\"#\" onclick=\"viewfeed($feed_id)\">".
- $line["feed_title"]."</a> $vf_catchup_link</div>";
+ $reply['content'] .= "<div id='FTITLE-$feed_id' class='cdmFeedTitle'>".
+ "<div style='float : right'>$feed_icon_img</div>".
+ "<a class='title' href=\"#\" onclick=\"viewfeed($feed_id)\">". $line["feed_title"]."</a>
+ $vf_catchup_link</div>";
}
}
$mouseover_attrs = "onmouseover='postMouseIn(event, $id)'
onmouseout='postMouseOut($id)'";
- $reply['content'] .= "<div class='hl $class' id='RROW-$id' $mouseover_attrs>";
+ $reply['content'] .= "<div class='hl $class' orig-feed-id='$feed_id' id='RROW-$id' $mouseover_attrs>";
$reply['content'] .= "<div class='hlLeft'>";
$cur_feed_title = htmlspecialchars($cur_feed_title);
- $vf_catchup_link = "(<a class='catchup' onclick='javascript:catchupFeedInGroup($feed_id);' href='#'>".__('mark as read')."</a>)";
+ $vf_catchup_link = "<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>";
$has_feed_icon = feed_has_icon($feed_id);
//$feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\" alt=\"\">";
}
- $reply['content'] .= "<div class='cdmFeedTitle'>".
+ $reply['content'] .= "<div id='FTITLE-$feed_id' class='cdmFeedTitle'>".
"<div style=\"float : right\">$feed_icon_img</div>".
"<a href=\"#\" class='title' onclick=\"viewfeed($feed_id)\">".
$line["feed_title"]."</a> $vf_catchup_link</div>";
$expanded_class = $expand_cdm ? "expanded" : "expandable";
$reply['content'] .= "<div class=\"cdm $hlc_suffix $expanded_class $class\"
- id=\"RROW-$id\" $mouseover_attrs>";
+ id=\"RROW-$id\" orig-feed-id='$feed_id' $mouseover_attrs>";
$reply['content'] .= "<div class=\"cdmHeader\" style=\"$row_background\">";
$reply['content'] .= "<div style=\"vertical-align : middle\">";
}
// mode = all,none,unread,invert,marked,published
-function selectArticles(mode) {
+function selectArticles(mode, query) {
try {
- var children = $$("#headlines-frame > div[id*=RROW]");
+ if (!query) query = "#headlines-frame > div[id*=RROW]";
+
+ var children = $$(query);
children.each(function(child) {
var id = child.id.replace("RROW-", "");
menu.startup();
+ /* vgroup feed title menu */
+
+ var nodes = $$("#headlines-frame > div[class='cdmFeedTitle']");
+ var ids = [];
+
+ nodes.each(function(node) {
+ ids.push(node.id);
+ });
+
+ if (ids.length > 0) {
+ if (dijit.byId("headlinesFeedTitleMenu"))
+ dijit.byId("headlinesFeedTitleMenu").destroyRecursive();
+
+ var menu = new dijit.Menu({
+ id: "headlinesFeedTitleMenu",
+ targetNodeIds: ids,
+ });
+
+ var tmph = dojo.connect(menu, '_openMyself', function (event) {
+ var callerNode = event.target, match = null, tries = 0;
+
+ while (match == null && callerNode && tries <= 3) {
+ console.log(callerNode.id);
+
+ match = callerNode.id.match("^[A-Z]+[-]([0-9]+)$");
+ callerNode = callerNode.parentNode;
+ ++tries;
+
+ console.log(match[1]);
+ }
+
+ if (match) this.callerRowId = parseInt(match[1]);
+
+ });
+
+ menu.addChild(new dijit.MenuItem({
+ label: __("Select articles in group"),
+ onClick: function(event) {
+ selectArticles("all",
+ "#headlines-frame > div[id*=RROW]"+
+ "[orig-feed-id='"+menu.callerRowId+"']");
+
+ }}));
+
+ menu.addChild(new dijit.MenuItem({
+ label: __("Mark group as read"),
+ onClick: function(event) {
+ selectArticles("all",
+ "#headlines-frame > div[id*=RROW]"+
+ "[orig-feed-id='"+menu.callerRowId+"']");
+
+ catchupSelection();
+ }}));
+
+
+ menu.addChild(new dijit.MenuItem({
+ label: __("Mark feed as read"),
+ onClick: function(event) {
+ catchupFeedInGroup(menu.callerRowId);
+ }}));
+
+ menu.startup();
+
+ }
+
} catch (e) {
exception_error("initHeadlinesMenu", e);
}