From 36f787976fbbfff3cdc364810a483d68b40290b1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 3 Feb 2009 17:03:35 +0300 Subject: [PATCH] render feedlist using local data when in offline mode --- feedlist.js | 55 ++++++++++++++++++++++++++++++++++++++++- modules/backend-rpc.php | 5 +++- tt-rss.js | 8 +++--- 3 files changed, 63 insertions(+), 5 deletions(-) diff --git a/feedlist.js b/feedlist.js index 4a892a90..d56f28d1 100644 --- a/feedlist.js +++ b/feedlist.js @@ -32,7 +32,60 @@ function viewCategory(cat) { function render_offline_feedlist() { try { - // FIXME + var tmp = ""; + + render_feedlist(tmp); } catch (e) { exception_error("render_offline_feedlist", e); } diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 751934f3..64e7df2f 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -532,7 +532,10 @@ ttrss_feeds WHERE owner_uid = ".$_SESSION["uid"]); while ($line = db_fetch_assoc($result)) { - print ""; } diff --git a/tt-rss.js b/tt-rss.js index e1ca160a..5089fcf2 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -1507,7 +1507,7 @@ function init_gears() { db.execute("CREATE TABLE IF NOT EXISTS cache (id text, article text, param text, added text)"); - db.execute("CREATE TABLE if not exists offline_feeds (id integer, title text)"); + db.execute("CREATE TABLE if not exists offline_feeds (id integer, title text, has_icon integer)"); db.execute("CREATE TABLE if not exists offline_data (id integer, feed_id integer, title text, link text, guid text, updated text, content text, tags text, unread text, marked text)"); @@ -1549,10 +1549,12 @@ function offline_download_parse(stage, transport) { for (var i = 0; i < feeds.length; i++) { var id = feeds[i].getAttribute("id"); + var has_icon = feeds[i].getAttribute("has_icon"); var title = feeds[i].firstChild.nodeValue; - db.execute("INSERT INTO offline_feeds (id,title) VALUES (?,?)", - [id, title]); + db.execute("INSERT INTO offline_feeds (id,title,has_icon)"+ + "VALUES (?,?,?)", + [id, title, has_icon]); } window.setTimeout("initiate_offline_download("+(stage+1)+")", 50); -- 2.39.5