Skip to content

Commit 38aa1ae

Browse files
committed
Upgrading sw to 9.1.1
1 parent 1c5854a commit 38aa1ae

File tree

1 file changed

+108
-13
lines changed
  • src/platforms/web/chromium/root

1 file changed

+108
-13
lines changed

src/platforms/web/chromium/root/sw.js

Lines changed: 108 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var snapVersion = '8.0.99',
2-
cacheName = 'snap4arduino-pwa',
1+
var s4aVersion = '9.1.1',
2+
cacheName = `snap4arduino-pwa-${s4aVersion}`,
33
filesToCache = [
44
'index.html',
55

@@ -89,6 +89,7 @@ var snapVersion = '8.0.99',
8989
'locale/lang-sv.js',
9090
'locale/lang-ta.js',
9191
'locale/lang-te.js',
92+
'locale/lang-ti.js',
9293
'locale/lang-tr.js',
9394
'locale/lang-ua.js',
9495
'locale/lang-zh_CN.js',
@@ -122,27 +123,85 @@ var snapVersion = '8.0.99',
122123

123124
'libraries/animation_module.xml',
124125
'libraries/apl.xml',
126+
'libraries/arcs_module.xml',
125127
'libraries/audioComp_module.xml',
126128
'libraries/bar-charts.xml',
129+
'libraries/bbtSnapExtension.js',
127130
'libraries/biginteger.js',
128131
'libraries/bignumbers.xml',
129132
'libraries/bignums.js',
130-
'libraries/bbtSnapExtension.js',
133+
'libraries/bitwise.xml',
131134
'libraries/cases.xml',
132135
'libraries/colors.xml',
136+
'libraries/crayons.xml',
133137
'libraries/Eisenbergification.xml',
134138
'libraries/frequency_distribution_module.xml',
135139
'libraries/httpBlocks.xml',
136140
'libraries/HummingbirdBlocks.xml',
137141
'libraries/iteration-composition.xml',
138142
'libraries/leap-library.xml',
143+
'libraries/list_comprehension_module.xml',
139144
'libraries/list-utilities.xml',
140145
'libraries/localstorage_module.xml',
146+
'libraries/tiles_module.xml',
141147
'libraries/make-variables.xml',
142148
'libraries/maps_module.xml',
149+
'libraries/menu_module.xml',
150+
'libraries/mqttExtension.js',
151+
'libraries/mqtt.js',
152+
'libraries/mqtt.xml',
143153
'libraries/parallel_module.xml',
144154
'libraries/pixel_module.xml',
155+
'libraries/plot_bars_module.xml',
156+
'libraries/replace_letters_module.xml',
145157
'libraries/schemeNumber.js',
158+
'libraries/SciSnapExtensions.js',
159+
'libraries/SciSnap!2Blocks.xml',
160+
161+
'libraries/TuneScope.xml',
162+
163+
// TuneScope dependencies
164+
'libraries/TuneScope/TuneScope.js',
165+
'libraries/TuneScope/TS_init.js',
166+
'libraries/TuneScope/webmidi.iife.js',
167+
'libraries/TuneScope/WebAudioFontPlayer.js',
168+
169+
// TuneScope instruments
170+
'libraries/TuneScope/12849_21_FluidR3_GM_sf2_file.js',
171+
'libraries/TuneScope/12848_21_FluidR3_GM_sf2_file.js',
172+
'libraries/TuneScope/12847_21_FluidR3_GM_sf2_file.js',
173+
'libraries/TuneScope/12846_0_FluidR3_GM_sf2_file.js',
174+
'libraries/TuneScope/12842_0_FluidR3_GM_sf2_file.js',
175+
'libraries/TuneScope/12835_21_FluidR3_GM_sf2_file.js',
176+
'libraries/TuneScope/12840_6_JCLive_sf2_file.js',
177+
'libraries/TuneScope/12869_6_JCLive_sf2_file.js',
178+
'libraries/TuneScope/0580_GeneralUserGS_sf2_file.js',
179+
'libraries/TuneScope/0560_GeneralUserGS_sf2_file.js',
180+
'libraries/TuneScope/0110_GeneralUserGS_sf2_file.js',
181+
'libraries/TuneScope/0680_JCLive_sf2_file.js',
182+
'libraries/TuneScope/0121_FluidR3_GM_sf2_file.js',
183+
'libraries/TuneScope/1070_FluidR3_GM_sf2_file.js',
184+
'libraries/TuneScope/0460_GeneralUserGS_sf2_file.js',
185+
'libraries/TuneScope/0600_GeneralUserGS_sf2_file.js',
186+
'libraries/TuneScope/0730_JCLive_sf2_file.js',
187+
'libraries/TuneScope/0710_Chaos_sf2_file.js',
188+
'libraries/TuneScope/0420_JCLive_sf2_file.js',
189+
'libraries/TuneScope/0400_JCLive_sf2_file.js',
190+
'libraries/TuneScope/0700_FluidR3_GM_sf2_file.js',
191+
'libraries/TuneScope/1040_Aspirin_sf2_file.js',
192+
'libraries/TuneScope/0770_SBLive_sf2.js',
193+
'libraries/TuneScope/0100_SBLive_sf2.js',
194+
'libraries/TuneScope/0650_FluidR3_GM_sf2_file.js',
195+
'libraries/TuneScope/1050_FluidR3_GM_sf2_file.js',
196+
'libraries/TuneScope/0180_Chaos_sf2_file.js',
197+
'libraries/TuneScope/0020_JCLive_sf2_file.js',
198+
'libraries/TuneScope/0260_JCLive_sf2_file.js',
199+
'libraries/TuneScope/0241_JCLive_sf2_file.js',
200+
'libraries/TuneScope/0350_JCLive_sf2_file.js',
201+
'libraries/TuneScope/0291_LesPaul_sf2_file.js',
202+
'libraries/TuneScope/0320_GeneralUserGS_sf2_file.js',
203+
'libraries/TuneScope/0230_Aspirin_sf2_file.js',
204+
146205
'libraries/serial_module.xml',
147206
'libraries/signada.js',
148207
'libraries/signada.xml',
@@ -151,8 +210,8 @@ var snapVersion = '8.0.99',
151210
'libraries/strings.xml',
152211
'libraries/textCostumes_module.xml',
153212
'libraries/try-catch.xml',
154-
'libraries/variadic-reporters.xml',
155213
'libraries/word-sentence.xml',
214+
'libraries/words_module.xml',
156215

157216
'libraries/scale.xml',
158217
'libraries/snapJrLib.xml',
@@ -178,6 +237,12 @@ var snapVersion = '8.0.99',
178237
'Costumes/abby-c.svg',
179238
'Costumes/abby-d.svg',
180239
'Costumes/airplane2.png',
240+
'Costumes/aleassa01.png',
241+
'Costumes/aleassa02.png',
242+
'Costumes/aleassa03.png',
243+
'Costumes/aleassa04.png',
244+
'Costumes/aleassa05.png',
245+
'Costumes/aleassa06.png',
181246
'Costumes/alonzo.png',
182247
'Costumes/Alonzo3D.png',
183248
'Costumes/alonzo.svg',
@@ -362,6 +427,12 @@ var snapVersion = '8.0.99',
362427
'Costumes/dee-c.svg',
363428
'Costumes/dee-d.svg',
364429
'Costumes/dee-e.svg',
430+
'Costumes/derec01.png',
431+
'Costumes/derec02.png',
432+
'Costumes/derec03.png',
433+
'Costumes/derec04.png',
434+
'Costumes/derec05.png',
435+
'Costumes/derec06.png',
365436
'Costumes/devin-a.svg',
366437
'Costumes/devin-b.svg',
367438
'Costumes/devin-c.svg',
@@ -479,13 +550,26 @@ var snapVersion = '8.0.99',
479550
'Costumes/home_button.svg',
480551
'Costumes/horse1-a.svg',
481552
'Costumes/horse1-b.svg',
553+
'Costumes/jahrd01.png',
554+
'Costumes/jahrd02.png',
555+
'Costumes/jahrd03.png',
556+
'Costumes/jahrd04.png',
557+
'Costumes/jahrd05.png',
558+
'Costumes/jahrd06.png',
482559
'Costumes/jaime-a.png',
483560
'Costumes/jaime-b.png',
484561
'Costumes/jaime_walking-a.png',
485562
'Costumes/jaime_walking-b.png',
486563
'Costumes/jaime_walking-c.png',
487564
'Costumes/jaime_walking-d.png',
488565
'Costumes/jaime_walking-e.png',
566+
'Costumes/jamet01.png',
567+
'Costumes/jamet02.png',
568+
'Costumes/jamet03.png',
569+
'Costumes/jamet04.png',
570+
'Costumes/jamet05.png',
571+
'Costumes/jamet06.png',
572+
'Costumes/jamet06-wall.png',
489573
'Costumes/jay.gif',
490574
'Costumes/jeans-a.svg',
491575
'Costumes/jeans-b.svg',
@@ -601,6 +685,12 @@ var snapVersion = '8.0.99',
601685
'Costumes/ruby-b.png',
602686
'Costumes/sail-boat.png',
603687
'Costumes/sam.gif',
688+
'Costumes/sarron01.png',
689+
'Costumes/sarron02.png',
690+
'Costumes/sarron03.png',
691+
'Costumes/sarron04.png',
692+
'Costumes/sarron05.png',
693+
'Costumes/sarron06.png',
604694
'Costumes/saxophone-a.svg',
605695
'Costumes/saxophone-b.svg',
606696
'Costumes/scarf1.svg',
@@ -661,6 +751,12 @@ var snapVersion = '8.0.99',
661751
'Costumes/trombone-b.svg',
662752
'Costumes/trumpet-a2.svg',
663753
'Costumes/trumpet-a.svg',
754+
'Costumes/turtle01_colour.png',
755+
'Costumes/turtle02_colour_resized.png',
756+
'Costumes/turtle03.png',
757+
'Costumes/turtle04.png',
758+
'Costumes/turtle05.png',
759+
'Costumes/turtle06.png',
664760
'Costumes/ukulele.svg',
665761
'Costumes/umbrella.png',
666762
'Costumes/unicorn1.png',
@@ -764,13 +860,12 @@ self.addEventListener('activate', (evt) => {
764860
});
765861

766862
/* Serve cached content when offline */
767-
self.addEventListener('fetch', function(e) {
768-
e.respondWith(
769-
caches.match(
770-
e.request,
771-
{'ignoreSearch': true}
772-
).then(function(response) {
773-
return response || fetch(e.request);
774-
})
775-
);
863+
self.addEventListener('fetch', function(event) {
864+
event.respondWith(
865+
fetch(event.request).catch(function(e) {
866+
return caches.open(cahceName).then(function(cache) {
867+
return cache.match(event.request,
868+
{'ignoreSearch': true}).then(response => response);
869+
});
870+
}));
776871
});

0 commit comments

Comments
 (0)