From e3d2c029a6bf929fe3506d14bd1bcee3a4dcddf0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 11 Nov 2011 15:28:11 +0400 Subject: [PATCH] add mark as read to feedlist popup menu --- FeedTree.js | 22 +++++++++++++++++++++- feedlist.js | 19 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/FeedTree.js b/FeedTree.js index c9a0cc81..f40dd9c6 100644 --- a/FeedTree.js +++ b/FeedTree.js @@ -121,10 +121,16 @@ dojo.declare("fox.FeedTree", dijit.Tree, { var menu = new dijit.Menu(); menu.row_id = bare_id; + menu.addChild(new dijit.MenuItem({ + label: __("Mark as read"), + onClick: function() { + catchupFeed(this.getParent().row_id); + }})); + menu.addChild(new dijit.MenuItem({ label: __("Edit feed"), onClick: function() { - editFeed(this.getParent().row_id); + editFeed(this.getParent().row_id, false); }})); menu.addChild(new dijit.MenuItem({ @@ -137,6 +143,20 @@ dojo.declare("fox.FeedTree", dijit.Tree, { tnode._menu = menu; } + if (id.match("CAT:") && bare_id > 0) { + var menu = new dijit.Menu(); + menu.row_id = bare_id; + + menu.addChild(new dijit.MenuItem({ + label: __("Mark as read"), + onClick: function() { + catchupFeed(this.getParent().row_id, true); + }})); + + menu.bindDomNode(tnode.domNode); + tnode._menu = menu; + } + //tnode.labelNode.innerHTML = args.label; return tnode; }, diff --git a/feedlist.js b/feedlist.js index 1c2adc88..dacef5c2 100644 --- a/feedlist.js +++ b/feedlist.js @@ -457,3 +457,22 @@ function getNextUnreadFeed(feed, is_cat) { } } +function catchupFeed(feed, is_cat) { + try { + + var catchup_query = "?op=rpc&subop=catchupFeed&feed_id=" + + feed + "&is_cat=" + is_cat; + + notify_progress("Loading, please wait...", true); + + new Ajax.Request("backend.php", { + parameters: catchup_query, + onComplete: function(transport) { + handle_rpc_json(transport); + notify(""); + } }); + + } catch (e) { + exception_error("catchupFeed", e); + } +} -- 2.39.5