appscms-tools-theme 0.7.9 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/serviceworker.js +42 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2388defe1413c42bcf3e10a82c71dbd3ea7d15e1713413194b70cce5e5d80972
|
4
|
+
data.tar.gz: 58e08304a5f3e1695870df893c7f4a5d811b9de17800f4c38505226fdbf3a12a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0c7b8b2543ade8394559c3c771994970708cc8ebfcacffb35b0f6b71acb7dc2217252c3edf02a6cbc504e24829cdd2c08b12a8de976af0f4c112d4e318dcbd7
|
7
|
+
data.tar.gz: 0b05542aed618b726b0db0cc342e9c3fb844ef8dedaa313c8545f02c9f2f14b98a85ad41daffb177045bd5e74dcb0057986ffa6936d9dc0dc5f49ca2815b4be8
|
data/serviceworker.js
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
const CACHE_NAME = 'v1'
|
2
|
+
const urlsToCache = ['index.html']
|
3
|
+
|
4
|
+
const self = this
|
5
|
+
|
6
|
+
// Install SW
|
7
|
+
self.addEventListener('install', (event) => {
|
8
|
+
event.waitUntil(
|
9
|
+
caches.open(CACHE_NAME).then((cache) => {
|
10
|
+
console.log('Opened cache')
|
11
|
+
|
12
|
+
return cache.addAll(urlsToCache)
|
13
|
+
})
|
14
|
+
)
|
15
|
+
})
|
16
|
+
|
17
|
+
// Listen for requests
|
18
|
+
self.addEventListener('fetch', (event) => {
|
19
|
+
event.respondWith(
|
20
|
+
caches.match(event.request).then(() => {
|
21
|
+
return fetch(event.request).catch(() => caches.match('index.html'))
|
22
|
+
})
|
23
|
+
)
|
24
|
+
})
|
25
|
+
|
26
|
+
// Activate the SW
|
27
|
+
self.addEventListener('activate', (event) => {
|
28
|
+
const cacheWhitelist = []
|
29
|
+
cacheWhitelist.push(CACHE_NAME)
|
30
|
+
|
31
|
+
event.waitUntil(
|
32
|
+
caches.keys().then((cacheNames) =>
|
33
|
+
Promise.all(
|
34
|
+
cacheNames.map((cacheName) => {
|
35
|
+
if (!cacheWhitelist.includes(cacheName)) {
|
36
|
+
return caches.delete(cacheName)
|
37
|
+
}
|
38
|
+
})
|
39
|
+
)
|
40
|
+
)
|
41
|
+
)
|
42
|
+
})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appscms-tools-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vivek-appscms
|
@@ -57,8 +57,11 @@ email:
|
|
57
57
|
- vivek@appscms.com
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
|
-
extra_rdoc_files:
|
60
|
+
extra_rdoc_files:
|
61
|
+
- serviceworker.js
|
62
|
+
- "./serviceworker.js"
|
61
63
|
files:
|
64
|
+
- "./serviceworker.js"
|
62
65
|
- LICENSE.txt
|
63
66
|
- README.md
|
64
67
|
- _data/about/en/about.json
|
@@ -162,6 +165,7 @@ files:
|
|
162
165
|
- assets/support.svg
|
163
166
|
- assets/twitter.svg
|
164
167
|
- assets/youtube.svg
|
168
|
+
- serviceworker.js
|
165
169
|
homepage: https://github.com/Appscms-com/appscms-tools-theme
|
166
170
|
licenses:
|
167
171
|
- MIT
|