summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-10 11:31:53 +0300
committerAndrew Dolgov <[email protected]>2009-02-10 11:31:53 +0300
commit59b223d74d7a56e253c728bd4a0175a1526d8618 (patch)
tree66f2fb2006154e066cd58c63d5d5ec1ff6a79c53
parent44d148ccc6db9a85772f6b248e9765661926147c (diff)
offline: disable using init-param
-rw-r--r--functions.php2
-rw-r--r--offline.js19
-rw-r--r--tt-rss.js2
3 files changed, 18 insertions, 5 deletions
diff --git a/functions.php b/functions.php
index 08e71b9d9..748cc6156 100644
--- a/functions.php
+++ b/functions.php
@@ -3013,6 +3013,8 @@
print "<param key=\"sync_counters\" value=\"1\"/>";
+ print "<param key=\"offline_enabled\" value=\"0\"/>";
+
$result = db_query($link, "SELECT COUNT(*) AS cf FROM
ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
diff --git a/offline.js b/offline.js
index c2171d981..543930d25 100644
--- a/offline.js
+++ b/offline.js
@@ -751,6 +751,7 @@ function update_offline_data(stage) {
if (!stage) stage = 0;
if (offline_mode) return;
+ if (getInitParam("offline_enabled") != "1") return;
debug("update_offline_data: stage " + stage);
@@ -935,6 +936,20 @@ function get_local_feed_unread(id) {
}
}
+function enable_offline_reading() {
+ try {
+
+ if (getInitParam("offline_enabled") == "1") {
+ init_local_sync_data();
+ Element.show("restartOfflinePic");
+ window.setTimeout("update_offline_data(0)", 100);
+ }
+
+ } catch (e) {
+ exception_error("enable_offline_reading", e);
+ }
+}
+
function init_gears() {
try {
@@ -1019,10 +1034,6 @@ function init_gears() {
"DELETE FROM article_labels WHERE id = OLD.id; "+
"END; ");
- init_local_sync_data();
-
- Element.show("restartOfflinePic");
-
}
cache_expire();
diff --git a/tt-rss.js b/tt-rss.js
index 931a5b611..90ac934d7 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -553,7 +553,7 @@ function init_second_stage() {
resize_headlines();
- window.setTimeout("update_offline_data(0)", 100);
+ enable_offline_reading();
} catch (e) {
exception_error("init_second_stage", e);