appscms-tools-theme 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49216e24cf5cde96fd438de7d207efaafbcc84ed20a097bcb447aef639828210
4
- data.tar.gz: 93fbfbb224f868bdfa32b3b4e48fbdad8dd8b9f31acae9b006b15289ea8f3ffb
3
+ metadata.gz: 5183f9cd88b7a36c36486588341b696f1254a3d31b39b5bbe2a32eab6e114948
4
+ data.tar.gz: e8f8422e7a6b3044ef15eed4a5769d721649e8e3e1d42f900b88873c35158845
5
5
  SHA512:
6
- metadata.gz: 6c796100af52bbcad9f97a82bb21a407cdb45195156953d777087b7aea3e0e4be5f00639ba0e9b734162124d6634ce9dc45eb61a0075dcc329a86aa4b1691f75
7
- data.tar.gz: 455168e1d6d37be80189271228833fe6cfef7ea8bb2d02697516083e5c39ba9a2dc986d3f0386b5452044db78c64adb6facbf95eae9ff14a31f310aebbda8932
6
+ metadata.gz: c9c3bf9de696a3d4543c0e76d8d3d8d5141ebd3478475302fbb97e11aa9ab8a45b8c4ca517ac3f3462e18aa0125014b5e5cde0fb74c5da3da54b49ffdfa0f085
7
+ data.tar.gz: 4ecc712c6870ea45c6ef404bd7963b6a48f5b51cd6a29359696ab294be157771437680013292d588ceee439803482b300171a43681dcde5459d4f6bd00b9acae
@@ -1,195 +1,190 @@
1
1
  {
2
- "Language":"English",
3
- "feature":"compress-pdf",
4
- "htmlLangAtt":"en",
5
- "H1":"Set alarm for $variable minutes from now",
6
- "H2":"Simplest online alarm clock to set alarms. Do not close browser tab.",
2
+ "Language": "English",
3
+ "feature": "compress-pdf",
4
+ "htmlLangAtt": "en",
5
+ "H1": "Set alarm for $variable minutes from now",
6
+ "H2": "Simplest online alarm clock to set alarms. Do not close browser tab.",
7
7
  "TITLE": "Set alarm for $variable minutes from now",
8
8
  "META": "Easiest way to set alarm for $variable minutes from now. Choose sound for alarm from multiple options.",
9
- "keywords":"key1,key2,key3,key4",
9
+ "keywords": "key1,key2,key3,key4",
10
10
  "LABEL": "DOCX to PDF",
11
- "nofileupload":true,
11
+ "nofileupload": true,
12
+ "variant": "info",
12
13
  "BREADCRUMB_LABEL": "DOCX TO PDF",
13
14
  "color": "purple",
14
15
  "height": "300px",
15
- "img":"/assets/bulb.svg",
16
- "imgwidth":"40px",
17
- "imgheight":"40px",
18
- "imgalt":"altvalue",
16
+ "img": "/assets/bulb.svg",
17
+ "imgwidth": "40px",
18
+ "imgheight": "40px",
19
+ "imgalt": "altvalue",
20
+ "jscdns": [
21
+ "<script data-folderName='$folderName' data-lang='$lang' data-fileName='$fileName' data-tool='$tool' src=\"js/main.js\"></script>"
22
+ ],
19
23
  "TEXTUAL_CONTENT": [
20
24
  {
21
- "priority": 1,
22
- "logoUrl": "/assets/bulb.svg",
23
- "header": "Simple to use",
24
- "content": "Setalarmforme.com provides simplest way to set alarms for X minutes from now."
25
+ "priority": 1,
26
+ "logoUrl": "/assets/bulb.svg",
27
+ "header": "Simple to use",
28
+ "content": "Setalarmforme.com provides simplest way to set alarms for X minutes from now."
25
29
  },
26
30
  {
27
- "priority": 1,
28
- "logoUrl": "/assets/guaranty.svg",
29
- "header": "Accurate alarms",
30
- "content": "Alarms setup by Setalarmforme.com are accurate. You can rely on us completely to start alarm after $variable minutes."
31
+ "priority": 1,
32
+ "logoUrl": "/assets/guaranty.svg",
33
+ "header": "Accurate alarms",
34
+ "content": "Alarms setup by Setalarmforme.com are accurate. You can rely on us completely to start alarm after $variable minutes."
31
35
  },
32
36
  {
33
- "priority": 1,
34
- "logoUrl": "/assets/support.svg",
35
- "header": "Cross platform",
36
- "content": "You can setup alarm for $variable minutes from now on any operating system, like Windows/Mac/Linux/Android/iPhone."
37
+ "priority": 1,
38
+ "logoUrl": "/assets/support.svg",
39
+ "header": "Cross platform",
40
+ "content": "You can setup alarm for $variable minutes from now on any operating system, like Windows/Mac/Linux/Android/iPhone."
37
41
  },
38
42
  {
39
- "priority": 1,
40
- "logoUrl": "/assets/protect.svg",
41
- "header": "Secure and trustworthy",
42
- "content": "Setalarmforme.com does not require users to login for setting alarm for $variable minutes from now. No user information is send to our servers."
43
+ "priority": 1,
44
+ "logoUrl": "/assets/protect.svg",
45
+ "header": "Secure and trustworthy",
46
+ "content": "Setalarmforme.com does not require users to login for setting alarm for $variable minutes from now. No user information is send to our servers."
43
47
  },
44
48
  {
45
- "priority": 1,
46
- "logoUrl": "/assets/easy.svg",
47
- "header": "All timezones supported",
48
- "content": "Using Setalarmforme.com you can set alarm to start after $variable minutes from current time, in any time zone."
49
+ "priority": 1,
50
+ "logoUrl": "/assets/easy.svg",
51
+ "header": "All timezones supported",
52
+ "content": "Using Setalarmforme.com you can set alarm to start after $variable minutes from current time, in any time zone."
49
53
  },
50
54
  {
51
- "priority": 1,
52
- "logoUrl": "/assets/cloud.svg",
53
- "header": "No need to install any software",
54
- "content": "Setalarmforme.com is a cloud and web based application. You do not need to install any software to use Setalarmforme.com while setting alarms for $variable minutes from now."
55
+ "priority": 1,
56
+ "logoUrl": "/assets/cloud.svg",
57
+ "header": "No need to install any software",
58
+ "content": "Setalarmforme.com is a cloud and web based application. You do not need to install any software to use Setalarmforme.com while setting alarms for $variable minutes from now."
55
59
  }
56
60
  ],
57
61
  "HOW_TO_CONTENT": {
58
62
  "logoImageUrl": "/assets/pdf.svg",
59
63
  "heading": "How to set alarm for $variable minutes:",
60
64
  "steps": [
61
- "Click on set alarm",
62
- "Set $variable minutes for alarm.",
63
- "Choose sound of your choice.",
64
- "Click submit to set alarm, that's it !."
65
+ "Click on set alarm",
66
+ "Set $variable minutes for alarm.",
67
+ "Choose sound of your choice.",
68
+ "Click submit to set alarm, that's it !."
65
69
  ]
66
70
  },
67
71
  "FAQ": [
68
72
  {
69
- "question": "How many seconds from now, will the alarm ring ?",
70
- "answer": "When you setup alarm for $variable minutes from now, the alarm will ring after { % $variable * 60 % } seconds."
73
+ "question": "How many seconds from now, will the alarm ring ?",
74
+ "answer": "When you setup alarm for $variable minutes from now, the alarm will ring after { % $variable * 60 % } seconds."
71
75
  },
72
76
  {
73
- "question": "Can I rely on Setalarmforme.com to setup alarm for $variable minutes from now ?",
74
- "answer": "If you have set alarm for $variable minutes from now, you can be 100% sure that alarm will ring after $variable minutes. You can trust us completely."
77
+ "question": "Can I rely on Setalarmforme.com to setup alarm for $variable minutes from now ?",
78
+ "answer": "If you have set alarm for $variable minutes from now, you can be 100% sure that alarm will ring after $variable minutes. You can trust us completely."
75
79
  },
76
80
  {
77
- "question": "What will happen to the alarm that I have set, if I refresh the browser ?",
78
- "answer": "The alarm will still ring after $variable minutes, even if you refresh the browser, since we store the information in browser's local cache."
81
+ "question": "What will happen to the alarm that I have set, if I refresh the browser ?",
82
+ "answer": "The alarm will still ring after $variable minutes, even if you refresh the browser, since we store the information in browser's local cache."
79
83
  },
80
84
  {
81
- "question": "What will happen to the alarm that I have set, if I close the tab of browser in which Setalarmforme.com is opened ?",
82
- "answer": "It will be gone. The alarm will not ring after $variable minutes, if you close the tab."
85
+ "question": "What will happen to the alarm that I have set, if I close the tab of browser in which Setalarmforme.com is opened ?",
86
+ "answer": "It will be gone. The alarm will not ring after $variable minutes, if you close the tab."
83
87
  },
84
88
  {
85
- "question": "What will happen to the alarm that I have set, if I close the browser ?",
86
- "answer": "It will be gone. The alarm will not ring after $variable minutes, if you close the browser."
89
+ "question": "What will happen to the alarm that I have set, if I close the browser ?",
90
+ "answer": "It will be gone. The alarm will not ring after $variable minutes, if you close the browser."
87
91
  }
88
- ],
89
- "megaMenu": {
90
- "nav-link-name": "Tools",
91
- "dropdown": [{
92
- "categoryName":" Pdf",
93
- "links": [
92
+ ],
93
+ "megaMenu": {
94
+ "nav-link-name": "Tools",
95
+ "dropdown": [
96
+ {
97
+ "categoryName": " Pdf",
98
+ "links": [
94
99
  {
95
100
  "iconSrc": "/assets/cloud.svg",
96
101
  "name": "Compress",
97
- "url":"/",
102
+ "url": "/",
98
103
  "hover": "red"
99
104
  },
100
105
  {
101
106
  "iconSrc": "/assets/cloud.svg",
102
107
  "name": "Split",
103
- "url":"/",
108
+ "url": "/",
104
109
  "hover": "blue"
105
-
106
110
  },
107
111
  {
108
112
  "iconSrc": "/assets/easy.svg",
109
113
  "name": "Merge Pdf",
110
- "url":"/",
114
+ "url": "/",
111
115
  "hover": "green"
112
116
  }
113
117
  ]
114
-
115
118
  },
116
119
  {
117
- "categoryName":" Pdf",
120
+ "categoryName": " Pdf",
118
121
  "links": [
119
- {
120
- "iconSrc": "/assets/cloud.svg",
121
- "name": "Compress",
122
- "url":"/",
123
- "hover": "red"
124
- },
125
- {
126
- "iconSrc": "/assets/cloud.svg",
127
- "name": "Split",
128
- "url":"/",
129
- "hover": "blue"
130
-
131
- },
132
- {
133
- "iconSrc": "/assets/easy.svg",
134
- "name": "Merge Pdf",
135
- "url":"/",
136
- "hover": "green"
137
- }
138
- ]
139
-
140
- },
141
- {
142
- "categoryName":"Compress Pdf",
122
+ {
123
+ "iconSrc": "/assets/cloud.svg",
124
+ "name": "Compress",
125
+ "url": "/",
126
+ "hover": "red"
127
+ },
128
+ {
129
+ "iconSrc": "/assets/cloud.svg",
130
+ "name": "Split",
131
+ "url": "/",
132
+ "hover": "blue"
133
+ },
134
+ {
135
+ "iconSrc": "/assets/easy.svg",
136
+ "name": "Merge Pdf",
137
+ "url": "/",
138
+ "hover": "green"
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "categoryName": "Compress Pdf",
143
144
  "links": [
144
- {
145
- "iconSrc": "/assets/cloud.svg",
146
- "name": "Compress",
147
- "url":"/",
148
- "hover": "red"
149
- },
150
- {
151
- "iconSrc": "/assets/cloud.svg",
152
- "name": "Split",
153
- "url":"/",
154
- "hover": "blue"
155
-
156
- },
157
- {
158
- "iconSrc": "/assets/easy.svg",
159
- "name": "Merge Pdf",
160
- "url":"/",
161
- "hover": "green"
162
- }
163
- ]
164
-
165
- },
166
- {
167
- "categoryName":"Compress Pdf",
145
+ {
146
+ "iconSrc": "/assets/cloud.svg",
147
+ "name": "Compress",
148
+ "url": "/",
149
+ "hover": "red"
150
+ },
151
+ {
152
+ "iconSrc": "/assets/cloud.svg",
153
+ "name": "Split",
154
+ "url": "/",
155
+ "hover": "blue"
156
+ },
157
+ {
158
+ "iconSrc": "/assets/easy.svg",
159
+ "name": "Merge Pdf",
160
+ "url": "/",
161
+ "hover": "green"
162
+ }
163
+ ]
164
+ },
165
+ {
166
+ "categoryName": "Compress Pdf",
168
167
  "links": [
169
- {
170
- "iconSrc": "/assets/cloud.svg",
171
- "name": "Compress",
172
- "url":"/",
173
- "hover": "red"
174
- },
175
- {
176
- "iconSrc": "/assets/cloud.svg",
177
- "name": "Split",
178
- "url":"/",
179
- "hover": "blue"
180
-
181
- },
182
- {
183
- "iconSrc": "/assets/easy.svg",
184
- "name": "Merge Pdf",
185
- "url":"/",
186
- "hover": "green"
187
- }
188
- ]
189
-
190
- }
191
-
192
- ]
193
- }
194
-
168
+ {
169
+ "iconSrc": "/assets/cloud.svg",
170
+ "name": "Compress",
171
+ "url": "/",
172
+ "hover": "red"
173
+ },
174
+ {
175
+ "iconSrc": "/assets/cloud.svg",
176
+ "name": "Split",
177
+ "url": "/",
178
+ "hover": "blue"
179
+ },
180
+ {
181
+ "iconSrc": "/assets/easy.svg",
182
+ "name": "Merge Pdf",
183
+ "url": "/",
184
+ "hover": "green"
185
+ }
186
+ ]
187
+ }
188
+ ]
189
+ }
195
190
  }
@@ -1,75 +1,73 @@
1
1
  {
2
- "logo":"https://sta1.pdfdoctor.com/1/2962/logo.png.png",
3
- "heading":"We make PDF easy.",
4
- "company":[
5
- {
6
- "name":"About",
7
- "url":"/about"
8
- },
9
- {
10
- "name":"Help",
11
- "url":"/help"
12
- },
13
- {
14
- "name":"Blog",
15
- "url":"/blog"
16
- }
2
+ "logo": "https://sta1.pdfdoctor.com/1/2962/logo.png.png",
3
+ "heading": "We make PDF easy.",
4
+ "companytitle": "Company",
5
+ "networksitestitle": "Network sites",
6
+ "producttitle": "Product",
7
+ "company": [
8
+ {
9
+ "name": "About",
10
+ "url": "/about"
11
+ },
12
+ {
13
+ "name": "Help",
14
+ "url": "/help"
15
+ },
16
+ {
17
+ "name": "Blog",
18
+ "url": "/blog"
19
+ }
17
20
  ],
18
- "product":[
21
+ "product": [
19
22
  {
20
- "name":"Pricing",
21
- "url":"/pricing"
23
+ "name": "Pricing",
24
+ "url": "/pricing"
22
25
  },
23
26
  {
24
- "name":"Team",
25
- "url":"/team"
27
+ "name": "Team",
28
+ "url": "/team"
26
29
  },
27
30
  {
28
- "name":"Developers",
29
- "url":"/developers"
31
+ "name": "Developers",
32
+ "url": "/developers"
30
33
  }
31
34
  ],
32
- "social":[
35
+ "social": [
33
36
  {
34
- "logo":"/assets/facebook.svg",
37
+ "logo": "/assets/facebook.svg",
35
38
  "url": "/",
36
- "title":"abc"
37
-
39
+ "title": "abc"
38
40
  },
39
41
  {
40
- "logo":"/assets/youtube.svg",
42
+ "logo": "/assets/youtube.svg",
41
43
  "url": "/",
42
- "title":"abc"
44
+ "title": "abc"
43
45
  },
44
46
  {
45
- "logo":"/assets/instagram.svg",
47
+ "logo": "/assets/instagram.svg",
46
48
  "url": "/",
47
- "title":"abc"
48
-
49
+ "title": "abc"
49
50
  },
50
51
  {
51
- "logo":"/assets/linkdin.svg",
52
+ "logo": "/assets/linkdin.svg",
52
53
  "url": "/",
53
- "title":"abc"
54
-
54
+ "title": "abc"
55
55
  },
56
56
  {
57
- "logo":"/assets/twitter.svg",
57
+ "logo": "/assets/twitter.svg",
58
58
  "url": "/",
59
- "title":"abc"
60
-
59
+ "title": "abc"
61
60
  }
62
61
  ],
63
62
  "messege": "© 2021 pdf AG — Made with love for the people of the internet.",
64
- "legal":[
63
+ "legal": [
65
64
  {
66
- "name":"Terms and conditions",
67
- "url":"/terms-and-conditions"
68
- },
65
+ "name": "Terms and conditions",
66
+ "url": "/terms-and-conditions"
67
+ },
69
68
  {
70
- "name":"Privacy Policy",
71
- "url":"/privacy-policy"
72
- }
73
- ]
74
-
75
- }
69
+ "name": "Privacy Policy",
70
+ "url": "/privacy-policy"
71
+ }
72
+ ]
73
+ }
@@ -12,19 +12,19 @@
12
12
  {%- endif -%}
13
13
  <nav class="footer-nav">
14
14
  <ul class="footer-ul">
15
- <h2 class="footer-ul-title">Company</h2>
15
+ <h2 class="footer-ul-title">{{dataToShow.companytitle}}</h2>
16
16
  {% for data in dataToShow.company %}
17
17
  <a class="footer-link" href="{{data.url}}">{{data.name}}</a>
18
18
  {% endfor %}
19
19
  </ul>
20
20
  <ul class="footer-ul">
21
- <h2 class="footer-ul-title">Product</h2>
21
+ <h2 class="footer-ul-title">{{dataToShow.producttitle}}</h2>
22
22
  {% for data in dataToShow.product %}
23
23
  <a class="footer-link" href="{{data.url}}">{{data.name}}</a>
24
24
  {% endfor %}
25
25
  </ul>
26
26
  <ul class="footer-ul">
27
- <h2 class="footer-ul-title">Network sites</h2>
27
+ <h2 class="footer-ul-title">{{dataToShow.networksitestitle}}</h2>
28
28
  {% for data in networksitesData.networkSites %}
29
29
  <a class="footer-link" href="{{data.url}}">{{data.name}}</a>
30
30
  {% endfor %}
@@ -128,7 +128,7 @@
128
128
  <script>
129
129
  if ('serviceWorker' in navigator) {
130
130
  window.addEventListener('load', () => {
131
- navigator.serviceWorker.register('/assets/js/serviceworker.js')
131
+ navigator.serviceWorker.register('/serviceworker.js')
132
132
  .then((reg) => console.log('Success: ', reg.scope))
133
133
  .catch((err) => console.log('Failure: ', err));
134
134
  })
@@ -9,6 +9,6 @@
9
9
  {%- endif -%}
10
10
  {%- if scriptData.jscdns -%}
11
11
  {%- for item in scriptData.jscdns -%}
12
- {{item}}
12
+ {{item | replace:"$folderName", page.folderName | replace: "$fileName", page.fileName | replace: "$lang", page.lang | replace: "$tool", page.tool }}
13
13
  {%- endfor -%}
14
14
  {%- endif -%}
@@ -73,7 +73,6 @@
73
73
  </div>
74
74
  <div class="col-md-12 download-page-rate-us">
75
75
  <div class="rating-tool" style="border: none;">
76
- <img id="rating-img" loading='lazy' src="/assets/images/rating.png" alt="rating-img">
77
76
  <div class="rating-text">Rate us</div>
78
77
  <div class="rating-stars" >
79
78
  <i class="fas fa-star rating-star"></i><i class="fas fa-star rating-star"></i
@@ -118,8 +117,7 @@
118
117
  ratingValue.innerText=data.rating
119
118
  count.innerText=data.votes
120
119
  }
121
- let ratingImg = document.querySelector('#rating-img');
122
- ratingImg.addEventListener('load', (event) => {
120
+ window.addEventListener('DOMContentLoaded', () => {
123
121
  fetchRating()
124
122
  });
125
123
  const ratingNode=document.getElementsByClassName('rating-star')
@@ -10,7 +10,7 @@
10
10
  {% include header/index.html %}
11
11
  {%- include dropdown/langdropdown.html -%}
12
12
  {%- if featureData.nofileupload -%}
13
- <div class="alert alert-warning alert-dismissible fade show text-center" role="alert">
13
+ <div class="alert alert-{{featureData.variant | default: 'warning'}} alert-dismissible fade show text-center" role="alert">
14
14
  <img src="/assets/secure.svg" height="23px" width="18px" alt="secure"> &nbsp;
15
15
  {%- if featureData.alertmsg -%}
16
16
  {{featureData.alertmsg}}
data/_layouts/home.html CHANGED
@@ -9,7 +9,7 @@
9
9
  {% include header/index.html %}
10
10
  {%- include dropdown/langdropdown.html -%}
11
11
  {%- if homeData.nofileupload -%}
12
- <div class="alert alert-warning alert-dismissible fade show text-center" role="alert">
12
+ <div class="alert alert-{{featureData.variant | default: 'warning'}} alert-dismissible fade show text-center" role="alert">
13
13
  <img src="/assets/secure.svg" height="23px" width="18px" alt="secure"> &nbsp;
14
14
  {%- if featureData.alertmsg -%}
15
15
  {{featureData.alertmsg}}
data/assets/css/tools.css CHANGED
@@ -1325,8 +1325,12 @@ ul li {
1325
1325
  position: relative;
1326
1326
  color: white;
1327
1327
  margin: 0;
1328
+ transition: 0.2s linear;
1328
1329
  border: 1px solid white;
1329
1330
  }
1331
+ .home-feature-box:hover {
1332
+ transform: translateY(-17px);
1333
+ }
1330
1334
  @media (min-width: 0px) and (max-width: 767px) {
1331
1335
  .home-feature-box {
1332
1336
  width: 100%;
@@ -1348,9 +1352,6 @@ ul li {
1348
1352
  .home-feature-name {
1349
1353
  line-height: 24px;
1350
1354
  font-size: 16px;
1351
- -webkit-font-smoothing: antialiased;
1352
- -webkit-font-smoothing: antialiased;
1353
- -webkit-font-smoothing: antialiased;
1354
1355
  font-stretch: 400;
1355
1356
  font-weight: 700;
1356
1357
  text-overflow: ellipsis;
@@ -1367,6 +1368,8 @@ ul li {
1367
1368
  .home-feature-name:hover {
1368
1369
  box-shadow: 0px 0px 24px rgba(26, 26, 26, 0.2);
1369
1370
  z-index: 1;
1371
+ color: currentColor;
1372
+ text-decoration: none;
1370
1373
  }
1371
1374
  @media (max-width: 767px) {
1372
1375
  .home-feature-name {
@@ -10,7 +10,7 @@
10
10
  "sizes": "1024x1024"
11
11
  }
12
12
  ],
13
- "start_url": ".",
13
+ "start_url": "/",
14
14
  "display": "standalone",
15
15
  "theme_color": "#000000",
16
16
  "background_color": "#ffffff"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscms-tools-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-21 00:00:00.000000000 Z
11
+ date: 2021-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -160,7 +160,6 @@ files:
160
160
  - assets/js/googledrive.js
161
161
  - assets/js/manifest.json
162
162
  - assets/js/scrabbleDictonary.js
163
- - assets/js/serviceworker.js
164
163
  - assets/js/wordScrabble.js
165
164
  - assets/linkdin.svg
166
165
  - assets/noserverupload.svg
@@ -1,42 +0,0 @@
1
- const CACHE_NAME = 'v1'
2
- const urlsToCache = ['/']
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(urlsToCache))
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
- })