summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-07-26 13:54:30 +0300
committerAndrew Dolgov <[email protected]>2017-07-26 13:54:30 +0300
commit6ee7389a0a966feb7c347b944d52a4a420d4dcf6 (patch)
treef9617f8de59c95521986f4c55a8e0b7759db2c7b /index.php
parent23d5d2a4762ee01f9bddf8d9e94dc3d3912a9148 (diff)
add a cache refresh link to index
Diffstat (limited to 'index.php')
-rw-r--r--index.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/index.php b/index.php
index b2291c0..bfb5fe8 100644
--- a/index.php
+++ b/index.php
@@ -131,9 +131,13 @@
.then(function() {
console.log("service worker registered");
});
- /*$(window).on('offline', function() {
- window.location.reload();
- });*/
+
+ navigator.serviceWorker.addEventListener('message', function(event) {
+ // not used yet
+ if (event.data == 'client-reload') {
+ window.location.reload();
+ }
+ });
}
mark_offline_books();
@@ -375,6 +379,11 @@
<?php } ?>
</ul>
+ <p class="text-center small">
+ <a class="text-muted" href="#" onclick="return cache_refresh(true)">Refresh cache</a>
+ </p>
+
+
</div>
</body>
</html>