summaryrefslogtreecommitdiff
path: root/js/reader.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-09-14 11:43:44 +0300
committerAndrew Dolgov <[email protected]>2020-09-14 11:43:44 +0300
commit4e343773dd6fd4ecb3f3382719ca363f93ef372b (patch)
treecb9e92baaa187fb163899ce09f456c6aadf7b2c5 /js/reader.js
parentfd5e896cca520e55b89f2b24f7cbb0c326f63124 (diff)
show navigator online status with version timestamp
Diffstat (limited to 'js/reader.js')
-rw-r--r--js/reader.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/reader.js b/js/reader.js
index 923a000..a54bea0 100644
--- a/js/reader.js
+++ b/js/reader.js
@@ -244,10 +244,16 @@ const Reader = {
});
localforage.getItem("epube.cache-timestamp").then(function(stamp) {
+ let msg = "V: ";
+
if (parseInt(stamp))
- $(".last-mod-timestamp").text("V: " + new Date(stamp*1000).toLocaleString("en-GB"))
+ msg += new Date(stamp*1000).toLocaleString("en-GB");
else
- $(".last-mod-timestamp").text("");
+ msg += "Unknown";
+
+ msg += " (" + (navigator.onLine ? "Online" : "Offline") + ")";
+
+ $(".last-mod-timestamp").text(msg)
});
localforage.getItem("epube.fontFamily").then(function(font) {