summaryrefslogtreecommitdiff
path: root/viewfeed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-03 21:54:03 +0300
committerAndrew Dolgov <[email protected]>2009-02-03 21:54:03 +0300
commit2f71f07bdd2c44e52eb3f439a4821e61d583f11e (patch)
treea3124ead0d4e6f6e311e2d4e158fd5764bd4b77e /viewfeed.js
parent51f6f91758bfc57e52e8e9316495ae723d7c2332 (diff)
update local db on toggle marked and view_offline()
Diffstat (limited to 'viewfeed.js')
-rw-r--r--viewfeed.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/viewfeed.js b/viewfeed.js
index de392103f..019d29229 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -343,6 +343,10 @@ function article_callback2(transport, id, feed_id) {
showArticleInHeadlines(id);
+ if (db) {
+ db.execute("UPDATE articles SET unread = 0 WHERE id = ?", [id]);
+ }
+
var reply = transport.responseXML.firstChild.firstChild;
} else {
@@ -387,6 +391,10 @@ function view_offline(id, feed_id) {
enableHotkeys();
showArticleInHeadlines(id);
+ if (db) {
+ db.execute("UPDATE articles SET unread = 0 WHERE id = ?", [id]);
+ }
+
render_article("FIXME");
return false;
@@ -554,6 +562,10 @@ function toggleMark(id, client_only, no_effects) {
mark_img.alt = __("Unstar article");
query = query + "&mark=1";
+ if (db) {
+ db.execute("UPDATE articles SET marked = 1 WHERE id = ?", [id]);
+ }
+
} else {
//mark_img.src = "images/mark_unset.png";
mark_img.alt = __("Please wait...");
@@ -565,6 +577,11 @@ function toggleMark(id, client_only, no_effects) {
mark_img.src = mark_img.src.replace("mark_set", "mark_unset");
mark_img.alt = __("Star article");
}
+
+ if (db) {
+ db.execute("UPDATE articles SET marked = 0 WHERE id = ?", [id]);
+ }
+
}
if (!client_only) {