]> git.wh0rd.org Git - tt-rss.git/commitdiff
add mark as read to feedlist popup menu
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 11 Nov 2011 11:28:11 +0000 (15:28 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 11 Nov 2011 11:28:11 +0000 (15:28 +0400)
FeedTree.js
feedlist.js

index c9a0cc81c456257ad7d9a7483078bd0ffd2b71ad..f40dd9c62f6d775826a48febebf3700524e73003 100644 (file)
@@ -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;
        },
index 1c2adc887906689ae5714e9bbb81174019f1d55d..dacef5c22b7bdd4b7b3093efb994adbf443cbab5 100644 (file)
@@ -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);
+       }
+}