diff options
author | pacien | 2018-07-19 19:02:09 +0200 |
---|---|---|
committer | pacien | 2018-07-19 19:02:09 +0200 |
commit | 0a60570aaf54138b88a115eaa30bd1b6f8422097 (patch) | |
tree | 81b12a465dd90043fb957f18d1feb2c2eb0413f1 /pointless/viewer | |
parent | feed2b79f25899d4655b1391b2ff58f8147303af (diff) | |
download | beamer-viewer-0a60570aaf54138b88a115eaa30bd1b6f8422097.tar.gz |
Add offline support
Diffstat (limited to 'pointless/viewer')
-rw-r--r-- | pointless/viewer/init.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pointless/viewer/init.js b/pointless/viewer/init.js index 9454a23..9ba881c 100644 --- a/pointless/viewer/init.js +++ b/pointless/viewer/init.js | |||
@@ -20,9 +20,16 @@ function isController() { | |||
20 | return window.opener == null || window.opener.location.href != window.location.href; | 20 | return window.opener == null || window.opener.location.href != window.location.href; |
21 | } | 21 | } |
22 | 22 | ||
23 | function initCache() { | ||
24 | if (!navigator.serviceWorker) return; | ||
25 | navigator.serviceWorker.register("appcache.js"); | ||
26 | } | ||
27 | |||
23 | function init() { | 28 | function init() { |
29 | initCache(); | ||
30 | |||
24 | var viewer = new Viewer(); | 31 | var viewer = new Viewer(); |
25 | 32 | ||
26 | if ("file" in params) | 33 | if ("file" in params) |
27 | viewer.load(params["file"]); | 34 | viewer.load(params["file"]); |
28 | } | 35 | } |