From 0cd6bb46f7d8b8c11a8704603f9816e9f78d1ec9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 12 Feb 2009 13:59:00 +0300 Subject: [PATCH] offline: automatically set version of manifest.json (using filemtime) --- functions.js | 7 ++++ manifest.json.php | 96 +++++++++++++++++++++++++++++++++++++++++++++++ offline.js | 2 +- 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 manifest.json.php diff --git a/functions.js b/functions.js index 5c056489..8355deb0 100644 --- a/functions.js +++ b/functions.js @@ -458,6 +458,13 @@ function parse_counters(reply, scheduled_call) { var xmsg = elems[l].getAttribute("xmsg"); if (id == "global-unread") { + + if (ctr > global_unread) { + if (db && getInitParam("offline_enabled") == "1") { + window.setTimeout("update_offline_data(0)", 100); + } + } + global_unread = ctr; updateTitle(); continue; diff --git a/manifest.json.php b/manifest.json.php new file mode 100644 index 00000000..22ea4cda --- /dev/null +++ b/manifest.json.php @@ -0,0 +1,96 @@ + $mtime) { + $mtime_max = $tmp; + } + + array_push($manifest_formatted, "{ \"url\": \"$f\" }"); + } +?> + +{ + "betaManifestVersion": 1, + "version": "", + "entries": [ + + ] +} diff --git a/offline.js b/offline.js index f20559f2..e6b77ed7 100644 --- a/offline.js +++ b/offline.js @@ -974,7 +974,7 @@ function init_gears() { if (window.google && google.gears) { localServer = google.gears.factory.create("beta.localserver"); store = localServer.createManagedStore("tt-rss"); - store.manifestUrl = "manifest.json"; + store.manifestUrl = "manifest.json.php"; store.checkForUpdate(); db = google.gears.factory.create('beta.database'); -- 2.39.5