]> git.wh0rd.org Git - tt-rss.git/commitdiff
move more stuff to offline.js
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 4 Feb 2009 10:36:06 +0000 (13:36 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 4 Feb 2009 10:36:06 +0000 (13:36 +0300)
manifest.json
offline.js
tt-rss.js

index 6dd6ecc9b0dbe05463407276699b472521571e14..98794670bded6fff8fb00f9067c676e753fa5eff 100644 (file)
@@ -1,12 +1,13 @@
 {
   "betaManifestVersion": 1,
-  "version": "0",
+  "version": "1",
   "entries": [
       { "url": "tt-rss.php"},
       { "url": "tt-rss.css"},
       { "url": "viewfeed.js"},
       { "url": "feedlist.js"},
       { "url": "functions.js"},
+      { "url": "offline.js"},
       { "url": "tt-rss.js"},
       { "url": "lib/scriptaculous/effects.js"},
       { "url": "lib/scriptaculous/controls.js"},
index a46702144728b6a21741b5e1e501139180ad3477..04262bfbaf0a4df3dd80dbdc99e2dd8d3e4a8df0 100644 (file)
@@ -1,3 +1,8 @@
+var offline_mode = false;
+var store = false;
+var localServer = false;
+var db = false;
+
 function view_offline(id, feed_id) {
        try {
 
@@ -547,4 +552,48 @@ function get_local_feed_unread(id) {
        }
 }
 
+function init_gears() {
+       try {
+
+               if (window.google && google.gears) {
+                       localServer = google.gears.factory.create("beta.localserver");
+                       store = localServer.createManagedStore("tt-rss");
+                       db = google.gears.factory.create('beta.database');
+                       db.open('tt-rss');
+
+                       db.execute("CREATE TABLE IF NOT EXISTS version (schema_version text)");
+
+                       var rs = db.execute("SELECT schema_version FROM version");
+
+                       var version = "";
+
+                       if (rs.isValidRow()) {
+                               version = rs.field(0);
+                       }
+
+                       if (version != SCHEMA_VERSION) {
+                               db.execute("DROP TABLE cache");
+                               db.execute("DROP TABLE feeds");
+                               db.execute("DROP TABLE articles");
+                               db.execute("INSERT INTO version (schema_version) VALUES (?)", 
+                                       [SCHEMA_VERSION]);
+                       }
+
+                       db.execute("CREATE TABLE IF NOT EXISTS cache (id text, article text, param text, added text)");
+
+                       db.execute("CREATE TABLE if not exists feeds (id integer, title text, has_icon integer)");
+
+                       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, added text)");
+
+                       window.setTimeout("update_offline_data(0)", 100);
+
+               }       
+       
+               cache_expire();
+
+       } catch (e) {
+               exception_error("init_gears", e);
+       }
+}
+
 
index 883eb29976e46fe695a7779f84227410d9fcc2f9..f27c01da3de136b03ea7734b8cb4778ddf929cf8 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -21,11 +21,6 @@ var ver_offset = 0;
 var hor_offset = 0;
 var feeds_sort_by_unread = false;
 var feedlist_sortable_enabled = false;
-var offline_mode = false;
-var store = false;
-var localServer = false;
-var db = false;
-var download_progress_last = 0;
 
 function activeFeedIsCat() {
        return _active_feed_is_cat;
@@ -1500,48 +1495,4 @@ function feedBrowserSubscribe() {
        }
 }
 
-function init_gears() {
-       try {
-
-               if (window.google && google.gears) {
-                       localServer = google.gears.factory.create("beta.localserver");
-                       store = localServer.createManagedStore("tt-rss");
-                       db = google.gears.factory.create('beta.database');
-                       db.open('tt-rss');
-
-                       db.execute("CREATE TABLE IF NOT EXISTS version (schema_version text)");
-
-                       var rs = db.execute("SELECT schema_version FROM version");
-
-                       var version = "";
-
-                       if (rs.isValidRow()) {
-                               version = rs.field(0);
-                       }
-
-                       if (version != SCHEMA_VERSION) {
-                               db.execute("DROP TABLE cache");
-                               db.execute("DROP TABLE feeds");
-                               db.execute("DROP TABLE articles");
-                               db.execute("INSERT INTO version (schema_version) VALUES (?)", 
-                                       [SCHEMA_VERSION]);
-                       }
-
-                       db.execute("CREATE TABLE IF NOT EXISTS cache (id text, article text, param text, added text)");
-
-                       db.execute("CREATE TABLE if not exists feeds (id integer, title text, has_icon integer)");
-
-                       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, added text)");
-
-                       window.setTimeout("update_offline_data(0)", 100);
-
-               }       
-       
-               cache_expire();
-
-       } catch (e) {
-               exception_error("init_gears", e);
-       }
-}
-