-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsw.js
More file actions
113 lines (103 loc) · 2.77 KB
/
Copy pathsw.js
File metadata and controls
113 lines (103 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
const CACHE = 'soaring-vibes-v1';
const ASSETS = [
'/',
'/index.html',
'/css/style.css',
'/manifest.json',
// Core JS modules
'/js/utils.js',
'/js/config.js',
'/js/controls.js',
'/js/multiplayer.js',
'/js/aircraft.js',
'/js/camera.js',
'/js/ocean.js',
'/js/environment.js',
'/js/islands.js',
'/js/airport.js',
'/js/airport-map-parser.js',
'/js/boats.js',
'/js/gauges.js',
'/js/performance.js',
'/js/spatial-grid.js',
'/js/flora-manager.js',
'/js/building-manager.js',
'/js/hot-air-balloons.js',
'/js/fauna-manager.js',
'/js/music-player.js',
// Physics modules
'/js/physics/physics-bridge.js',
'/js/physics/aerodynamics.js',
'/js/physics/realistic-physics.js',
'/js/physics/arcade-physics.js',
// Tree geometry classes
'/js/trees/palm.js',
'/js/trees/coconut-palm.js',
'/js/trees/koa.js',
'/js/trees/giant-koa.js',
'/js/trees/ohia.js',
'/js/trees/banyan.js',
'/js/trees/tree-fern.js',
'/js/trees/ti-plant.js',
'/js/trees/bamboo.js',
'/js/trees/wiliwili.js',
'/js/trees/shrub.js',
'/js/trees/grass.js',
'/js/trees/ground-fern.js',
'/js/trees/naupaka.js',
'/js/trees/beach-morning-glory.js',
'/js/trees/driftwood.js',
'/js/trees/lava-rock.js',
// Animal classes
'/js/animals/animal-base.js',
'/js/animals/whale.js',
'/js/animals/dolphin.js',
'/js/animals/seaturtle.js',
'/js/animals/albatross.js',
'/js/animals/frigatebird.js',
'/js/animals/honeycreeper.js',
'/js/animals/nene.js',
// Building classes
'/js/buildings/residential.js',
'/js/buildings/commercial.js',
'/js/buildings/lighthouse.js',
// Assets - heightmaps and metadata
'assets/heightmaps/big-island.png',
'assets/heightmaps/big-island.json',
'assets/heightmaps/molie.png',
'assets/heightmaps/molie.json',
'assets/heightmaps/oahu.png',
'assets/heightmaps/oahu.json',
'assets/heightmaps/kauai.png',
'assets/heightmaps/kauai.json',
'assets/heightmaps/molokai.png',
'assets/heightmaps/molokai.json',
'assets/heightmaps/lanai.png',
'assets/heightmaps/lanai.json',
'assets/heightmaps/niihau.png',
'assets/heightmaps/niihau.json',
'assets/heightmaps/kahoolawe.png',
'assets/heightmaps/kahoolawe.json',
// Images
'assets/images/icon.png',
'assets/images/logo.png',
];
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE).then((cache) => cache.addAll(ASSETS))
);
self.skipWaiting();
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((keys) =>
Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))
)
);
self.clients.claim();
});
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((cached) => cached || fetch(event.request))
);
});