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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/serviceworker.js +42 -0
  3. metadata +6 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 145219beea8b880d6c3139736bffd1d1ca1634541af232d7eca0d6daf8e7a448
4
- data.tar.gz: 2948451d3eabeeafd99ca628df15b4699038049bf2338baf0c55266bd9dd708c
3
+ metadata.gz: 2388defe1413c42bcf3e10a82c71dbd3ea7d15e1713413194b70cce5e5d80972
4
+ data.tar.gz: 58e08304a5f3e1695870df893c7f4a5d811b9de17800f4c38505226fdbf3a12a
5
5
  SHA512:
6
- metadata.gz: fa04f65e804ca4466093ed318eeae266863022da28f25ac818dbf90db3462ebbece0d9898d762a6888c58a7075a4fc7ba04f09a332bc529a34ac265437bcc0fd
7
- data.tar.gz: 13ec9bd29c6d0c9c95d129281ecacf052a2f105d898adcdd6356a26d5562b14db02763bfedd982786a8a83a1d94463480878e64a972069fd15f091e4c1040969
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.7.9
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