]> git.wh0rd.org Git - tt-rss.git/commitdiff
offline: simplify table names
authorAndrew Dolgov <fox@bah.org.ru>
Tue, 3 Feb 2009 15:16:58 +0000 (18:16 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Tue, 3 Feb 2009 15:16:58 +0000 (18:16 +0300)
feedlist.js
tt-rss.js

index d56f28d1e9092d5fa98f5840c1ddb40e386559ba..6e26a92fc266835d39b4597056f2017525bd41dc 100644 (file)
@@ -34,7 +34,7 @@ function render_offline_feedlist() {
        try {
                var tmp = "<ul class=\"feedList\" id=\"feedList\">";
 
-               var rs = db.execute("SELECT id,title,has_icon FROM offline_feeds ORDER BY title");
+               var rs = db.execute("SELECT id,title,has_icon FROM feeds ORDER BY title");
 
                while (rs.isValidRow()) {
 
@@ -42,7 +42,7 @@ function render_offline_feedlist() {
                        var title = rs.field(1);
                        var has_icon = rs.field(2);
 
-                       var rs_u = db.execute("SELECT SUM(unread) FROM offline_data WHERE feed_id = ?",
+                       var rs_u = db.execute("SELECT SUM(unread) FROM articles WHERE feed_id = ?",
                                [id]);
                        var unread = 0;
 
index 5089fcf278afd11974e8189f34c82e134dedf980..15227c325bfd7cf1aa4090da8b961b73b1e9b3d3 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -1507,9 +1507,9 @@ 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, has_icon integer)");
+                       db.execute("CREATE TABLE if not exists 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)");
+                       db.execute("CREATE TABLE if not exists articles (id integer, feed_id integer, title text, link text, guid text, updated text, content text, tags text, unread text, marked text)");
 
                        var qmcDownload = document.getElementById("qmcDownload");
                        if (qmcDownload) Element.show(qmcDownload);
@@ -1544,7 +1544,7 @@ function offline_download_parse(stage, transport) {
                                var feeds = transport.responseXML.getElementsByTagName("feed");
 
                                if (feeds.length > 0) {
-                                       db.execute("DELETE FROM offline_feeds");
+                                       db.execute("DELETE FROM feeds");
                                }
 
                                for (var i = 0; i < feeds.length; i++) {
@@ -1552,7 +1552,7 @@ function offline_download_parse(stage, transport) {
                                        var has_icon = feeds[i].getAttribute("has_icon");
                                        var title = feeds[i].firstChild.nodeValue;
        
-                                       db.execute("INSERT INTO offline_feeds (id,title,has_icon)"+
+                                       db.execute("INSERT INTO feeds (id,title,has_icon)"+
                                                "VALUES (?,?,?)",
                                                [id, title, has_icon]);
                                }
@@ -1568,8 +1568,8 @@ function offline_download_parse(stage, transport) {
                                        var a = eval("("+articles[i].firstChild.nodeValue+")");
                                        articles_found++;
                                        if (a) {
-                                               db.execute("DELETE FROM offline_data WHERE id = ?", [a.id]);
-                                               db.execute("INSERT INTO offline_data "+
+                                               db.execute("DELETE FROM articles WHERE id = ?", [a.id]);
+                                               db.execute("INSERT INTO articles "+
                                                        "(id, feed_id, title, link, guid, updated, content, unread, marked) "+
                                                        "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", 
                                                        [a.id, a.feed_id, a.title, a.link, a.guid, a.updated,