-
Notifications
You must be signed in to change notification settings - Fork 1
/
serviceWorker.js
75 lines (73 loc) · 2.35 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
64
65
66
67
68
69
70
71
72
73
74
75
const staticBrihatCalendar = "brihat-calendar-v1";
const assets = [
"./",
"./data/2070_lunar_data.json",
"./data/2071_lunar_data.json",
"./data/2072_lunar_data.json",
"./data/2073_lunar_data.json",
"./data/2074_lunar_data.json",
"./data/2075_lunar_data.json",
"./data/2076_lunar_data.json",
"./data/2077_lunar_data.json",
"./data/2078_lunar_data.json",
"./data/2079_lunar_data.json",
"./data/2080_lunar_data.json",
"./data/sunrise_sunset_json/sunrise_2019.json",
"./data/sunrise_sunset_json/sunrise_2020.json",
"./data/sunrise_sunset_json/sunrise_2021.json",
"./data/sunrise_sunset_json/sunrise_2022.json",
"./data/sunrise_sunset_json/sunrise_2023.json",
"./data/sunrise_sunset_json/sunrise_2024.json",
"./data/sunrise_sunset_json/sunrise_2025.json",
"./data/sunrise_sunset_json/sunset_2019.json",
"./data/sunrise_sunset_json/sunset_2020.json",
"./data/sunrise_sunset_json/sunset_2021.json",
"./data/sunrise_sunset_json/sunset_2022.json",
"./data/sunrise_sunset_json/sunset_2023.json",
"./data/sunrise_sunset_json/sunset_2024.json",
"./data/sunrise_sunset_json/sunset_2025.json",
"./data/muhoortta.json",
"./data/public_holidays_in_nepal.json",
"./assets/favicon.svg",
"./assets/logo.svg",
"./assets/watermark.svg",
"./assets/brihat_calendar_url_qr.svg",
"./assets/static_logo.svg",
"./assets/brihat_calendar.png",
"https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css",
"./css/index.css",
"./css/index_details.css",
"./css/index_cal_conv.css",
"./css/public_holidays.css",
"./css/muhoortta.css",
"./css/parvas.css",
"./css/settings.css",
"./js/base/NS.js",
"./js/base/NS_AD.js",
"./js/base/NS_BS.js",
"./js/base/AD_BS.js",
"./js/calendar/index.js",
"./js/calendar/index_cal_conv.js",
"./js/calendar/index_details.js",
"./js/addons/infos.js",
"./js/addons/muhoortta.js",
"./js/addons/parvas.js",
"./js/addons/public_holidays.js",
"./js/addons/suggest_edit.js",
"./js/addons/swipe_actions.js",
"./index.html",
];
self.addEventListener("install", installEvent => {
installEvent.waitUntil(
caches.open(staticBrihatCalendar).then(cache => {
cache.addAll(assets);
})
);
});
self.addEventListener("fetch", fetchEvent => {
fetchEvent.respondWith(
caches.match(fetchEvent.request).then(res => {
return res || fetch(fetchEvent.request);
})
);
});