From 774b8df8739d2cab5656fa9907c6e6dd6f32158e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 4 Feb 2009 10:19:36 +0300 Subject: [PATCH] move more stuff to offline.js --- feedlist.js | 85 ----------------------------------------------------- offline.js | 25 ++++++++++++++++ 2 files changed, 25 insertions(+), 85 deletions(-) diff --git a/feedlist.js b/feedlist.js index 9f431fe8..3cf23804 100644 --- a/feedlist.js +++ b/feedlist.js @@ -64,91 +64,6 @@ function printFeedEntry(id, title, row_class, unread, icon) { return tmp; } -function get_local_feed_unread(id) { - try { - var rs; - - if (id == -4) { - rs = db.execute("SELECT SUM(unread) FROM articles"); - } else if (id == -1) { - rs = db.execute("SELECT SUM(unread) FROM articles WHERE marked = 1"); - } else { - rs = db.execute("SELECT SUM(unread) FROM articles WHERE feed_id = ?", [id]); - } - - if (rs.isValidRow()) { - return rs.field(0); - } else { - return 0; - } - - } catch (e) { - exception_error("get_local_feed_unread", e); - } -} - -function render_offline_feedlist() { - try { - var tmp = ""; - - render_feedlist(tmp); - } catch (e) { - exception_error("render_offline_feedlist", e); - } -} - function render_feedlist(data) { try { diff --git a/offline.js b/offline.js index 371aeecf..58c2377c 100644 --- a/offline.js +++ b/offline.js @@ -490,3 +490,28 @@ function update_local_feedlist_counters() { exception_error("update_local_feedlist_counters", e); } } + +function get_local_feed_unread(id) { + try { + var rs; + + if (id == -4) { + rs = db.execute("SELECT SUM(unread) FROM articles"); + } else if (id == -1) { + rs = db.execute("SELECT SUM(unread) FROM articles WHERE marked = 1"); + } else { + rs = db.execute("SELECT SUM(unread) FROM articles WHERE feed_id = ?", [id]); + } + + if (rs.isValidRow()) { + return rs.field(0); + } else { + return 0; + } + + } catch (e) { + exception_error("get_local_feed_unread", e); + } +} + + -- 2.39.5