summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-12 20:16:10 +0300
committerAndrew Dolgov <[email protected]>2009-02-12 20:16:10 +0300
commit206d49676228fa2a1b74ab4116038c4d59370980 (patch)
tree6626abd3d8f546726f2190385429cd9aabb6750a /tt-rss.js
parentb4dc02e2071f9cc8d1d49fa366861d603e1ce4a0 (diff)
rework gears offline/online interaction the way it probably should be done (also remove redirecting login system)
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/tt-rss.js b/tt-rss.js
index d6a95eddd..fbfde92d4 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -132,18 +132,10 @@ function backend_sanity_check_callback(transport) {
}
if (!transport.responseXML) {
- if (!window.google && !google.gears) {
- fatalError(3, "Sanity check: Received reply is not XML", transport.responseText);
- } else {
- init_offline();
- }
+ fatalError(3, "Sanity check: Received reply is not XML", transport.responseText);
return;
}
- if (getURLParam("offline")) {
- return init_offline();
- }
-
var reply = transport.responseXML.firstChild.firstChild;
if (!reply) {
@@ -405,10 +397,17 @@ function init() {
loading_set_progress(30);
- new Ajax.Request("backend.php?op=rpc&subop=sanityCheck" + params, {
- onComplete: function(transport) {
- backend_sanity_check_callback(transport);
- } });
+ offline_mode = false;
+ if (store) offline_mode = store.currentVersion;
+
+ if (offline_mode) {
+ init_offline();
+ } else {
+ new Ajax.Request("backend.php?op=rpc&subop=sanityCheck" + params, {
+ onComplete: function(transport) {
+ backend_sanity_check_callback(transport);
+ } });
+ }
} catch (e) {
exception_error("init", e);