]> git.wh0rd.org Git - tt-rss.git/commitdiff
offline: actions dropdown works
authorAndrew Dolgov <fox@bah.org.ru>
Sun, 15 Feb 2009 19:41:16 +0000 (22:41 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Sun, 15 Feb 2009 19:41:16 +0000 (22:41 +0300)
offline.js
viewfeed.js

index e146b55e1438b10e5285e71d6c37b28b8e17ad31..3b3695fabeb864ce4333fac80140bf8a4f0952d0 100644 (file)
@@ -146,16 +146,29 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
                                var sel_none_link;
                                var sel_inv_link;
 
+                               var catchup_feed_link = "javascript:catchupCurrentFeed()";
+                               var catchup_sel_link = "javascript:catchupSelection()";
+
+                               var tog_unread_link;
+                               var tog_marked_link;
+
                                if ($("content-frame")) {
                                        sel_all_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, '', true)";
                                        sel_unread_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', true, 'Unread', true)";
                                        sel_none_link = "javascript:selectTableRowsByIdPrefix('headlinesList', 'RROW-', 'RCHK-', false)";
                                        sel_inv_link = "javascript:invertHeadlineSelection()";
+
+                                       tog_unread_link = "javascript:selectionToggleUnread()";
+                                       tog_marked_link = "javascript:selectionToggleMarked()";
+
                                } else {
                                        sel_all_link = "javascript:cdmSelectArticles('all')";
                                        sel_unread_link = "javascript:cdmSelectArticles('unread')";
                                        sel_none_link = "javascript:cdmSelectArticles('none')";
                                        sel_inv_link = "javascript:invertHeadlineSelection()";
+
+                                       tog_unread_link = "javascript:selectionToggleUnread(true)";
+                                       tog_marked_link = "javascript:selectionToggleMarked(true)";
                                }
 
                                tmp += __('Select:')+
@@ -174,11 +187,6 @@ function viewfeed_offline(feed_id, subop, is_cat, subop_param, skip_history, off
 
                                tmp += "<ul id=\"headlineActionsBody\" style=\"display : none\">";
 
-                               var tog_unread_link = "";
-                               var tog_marked_link = "";
-                               var catchup_sel_link = "";
-                               var catchup_feed_link = "";
-
                                tmp += "<li class=\"insensitive\">"+__('Selection toggle:')+"</li>"+
                                "<li onclick=\""+tog_unread_link+"\">&nbsp;&nbsp;"+__('Unread')+"</li>"+
                                "<li onclick=\""+tog_marked_link+"\">&nbsp;&nbsp;"+__('Starred')+"</li>"+
index 339950caca31a9e3859ec6294c0915fa45176427..be1a442e093a1052ae21ce94aa178f9b76c77eaf 100644 (file)
@@ -575,7 +575,7 @@ function toggleMark(id, client_only, no_effects) {
 
                }
 
-               update_local_feedlist_counters();
+               if (!no_effects) update_local_feedlist_counters();
 
                if (!client_only) {
                        debug(query);
@@ -973,20 +973,34 @@ function selectionToggleUnread(cdm_mode, set_state, callback_func, no_error) {
                                        } else {
                                                row.className = nc + "UnreadSelected";
                                        }
+                                       if (db) {
+                                               db.execute("UPDATE articles SET unread = NOT unread WHERE id = ?", 
+                                                       [rows[i]]);
+                                       }
                                }
 
                                if (set_state == false) {
                                        row.className = nc + "Selected";
+                                       if (db) {
+                                               db.execute("UPDATE articles SET unread = 0 WHERE id = ?", 
+                                                       [rows[i]]);
+                                       }
                                }
 
                                if (set_state == true) {
                                        row.className = nc + "UnreadSelected";
+                                       if (db) {
+                                               db.execute("UPDATE articles SET unread = 1 WHERE id = ?", 
+                                                       [rows[i]]);
+                                       }
                                }
                        }
                }
 
                if (rows.length > 0) {
 
+                       update_local_feedlist_counters();
+
                        var cmode = "";
 
                        if (set_state == undefined) {
@@ -1034,6 +1048,8 @@ function selectionToggleMarked(cdm_mode) {
                        toggleMark(rows[i], true, true);
                }
 
+               update_local_feedlist_counters();
+
                if (rows.length > 0) {
 
                        var query = "backend.php?op=rpc&subop=markSelected&ids=" +