From: Andrew Dolgov Date: Thu, 17 Oct 2013 09:38:48 +0000 (+0400) Subject: add context menu for cdmFeedTitle; change mark as read prompt for grouped headlines... X-Git-Tag: 1.11~39 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=87065739cdc569bbcfe92ad6f0b6ebef3c72f3ec;p=tt-rss.git add context menu for cdmFeedTitle; change mark as read prompt for grouped headlines more clear --- diff --git a/classes/feeds.php b/classes/feeds.php index e26318e7..7f5fd10a 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -430,12 +430,12 @@ class Feeds extends Handler_Protected { $cur_feed_title = htmlspecialchars($cur_feed_title); - $vf_catchup_link = "(".__('Mark as read').")"; + $vf_catchup_link = "".__('mark feed as read').""; - $reply['content'] .= "
". - "
$feed_icon_img
". - "". - $line["feed_title"]." $vf_catchup_link
"; + $reply['content'] .= "
". + "
$feed_icon_img
". + "". $line["feed_title"]." + $vf_catchup_link
"; } } @@ -443,7 +443,7 @@ class Feeds extends Handler_Protected { $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' onmouseout='postMouseOut($id)'"; - $reply['content'] .= "
"; + $reply['content'] .= "
"; $reply['content'] .= "
"; @@ -524,7 +524,7 @@ class Feeds extends Handler_Protected { $cur_feed_title = htmlspecialchars($cur_feed_title); - $vf_catchup_link = "(".__('mark as read').")"; + $vf_catchup_link = "".__('mark feed as read').""; $has_feed_icon = feed_has_icon($feed_id); @@ -534,7 +534,7 @@ class Feeds extends Handler_Protected { //$feed_icon_img = "\"\""; } - $reply['content'] .= "
". + $reply['content'] .= "
". "
$feed_icon_img
". "". $line["feed_title"]." $vf_catchup_link
"; @@ -547,7 +547,7 @@ class Feeds extends Handler_Protected { $expanded_class = $expand_cdm ? "expanded" : "expandable"; $reply['content'] .= "
"; + id=\"RROW-$id\" orig-feed-id='$feed_id' $mouseover_attrs>"; $reply['content'] .= "
"; $reply['content'] .= "
"; diff --git a/css/cdm.css b/css/cdm.css index c91f0992..dd4346e4 100644 --- a/css/cdm.css +++ b/css/cdm.css @@ -341,4 +341,24 @@ div#floatingTitle img.hlScorePic { text-decoration : line-through; } +div.cdmFeedTitle > * { + display : table-cell; + vertical-align : middle; +} + +div.cdmFeedTitle a.title { + width : 100%; +} + +div.cdmFeedTitle a.catchup { + text-align : right; + color : #555; + padding-right : 10px; + font-size : 11px; + white-space : nowrap; +} + +div.cdmFeedTitle a.catchup:hover { + color : #4684ff; +} diff --git a/js/viewfeed.js b/js/viewfeed.js index cb9a3c64..3c02d462 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -961,10 +961,12 @@ function getLoadedArticleIds() { } // 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-", ""); @@ -2107,6 +2109,71 @@ function initHeadlinesMenu() { 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); }