-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ServiceWorker.js
executable file
·63 lines (61 loc) · 2.9 KB
/
ServiceWorker.js
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
self.addEventListener('install', function (e) {
e.waitUntil(
caches.open('mainPage').then(function (cache) {
return cache.addAll([
'./',
'./assets/Colors/Colors.js',
'./assets/locales/en-US.js',
'./assets/locales/zh-CN.js',
'./assets/locales/zh-HK.js',
'./assets/locales/zh-YUE.js',
'./assets/mipmap/border.png',
'./assets/mipmap/grid.png',
'./assets/mipmap/[email protected]',
'./assets/mipmap/[email protected]',
'./assets/mipmap/[email protected]',
'./assets/mipmap/opacity.png',
'./dist/libs/bundle/PenguinUI/font/Anodina-Bold.otf',
'./dist/libs/bundle/PenguinUI/font/Anodina-Regular.otf',
'./dist/libs/bundle/PenguinUI/font/MaterialIcons-Regular.woff2',
'./dist/libs/bundle/PenguinUI/require/color.css',
'./dist/libs/bundle/PenguinUI/require/CookieManager.js',
'./dist/libs/bundle/PenguinUI/require/HoverTips.js',
'./dist/libs/bundle/PenguinUI/require/LocaleStorageManager.js',
'./dist/libs/bundle/PenguinUI/require/MediaQuery.js',
'./dist/libs/bundle/PenguinUI/require/NotificationManager.js',
'./dist/libs/bundle/PenguinUI/require/PenguinUI.selector.js',
'./dist/libs/bundle/PenguinUI/require/PenguinUI.switchToggle.js',
'./dist/libs/bundle/PenguinUI/require/ProgressManager.js',
'./dist/libs/bundle/PenguinUI/require/utils.js',
'./dist/libs/bundle/PenguinUI/require/WindowManager.js',
'./dist/libs/bundle/PenguinUI/bundle.PenguinUI.js',
'./dist/libs/bundle/PenguinUI/bundle.PenguinUI.css',
'./dist/libs/bundle/storyboard/bundle.storyboard.css',
'./dist/libs/bundle/ColorUtils/bundle.colorUtils.js',
'./dist/libs/attachWindowCursorEvent.js',
'./dist/libs/build.package.js',
'./dist/libs/drawMap.js',
'./dist/libs/editPathsInfo.js',
'./dist/libs/editStationsInfo.js',
'./dist/libs/exportDrawable.js',
'./dist/libs/initDrawable.js',
'./dist/libs/initInterface.js',
'./dist/libs/savePathComp.js',
'./dist/libs/SystemFunction.js',
'./index.html',
]).then(() => self.skipWaiting());
})
);
});
self.addEventListener('activate', event => {
event.waitUntil(self.clients.claim());
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.open("mainPage")
.then(cache => cache.match(event.request, {ignoreSearch: true}))
.then(response => {
return response || fetch(event.request);
})
);
});