-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
68 lines (64 loc) · 2.8 KB
/
Copy pathindex.html
File metadata and controls
68 lines (64 loc) · 2.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MonommaniaPOS</title>
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#ffffff">
<!-- add to homescreen for ios -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- un-comment this code to enable service worker -->
<script>
window.MonommaniaPosUpdateIsAvailable = new Promise(function(resolve, reject) {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(reg => {
console.log("service worker installed successfully!");
reg.onupdatefound = () => {
const installingWorker = reg.installing;
installingWorker.onstatechange = () => {
switch (installingWorker.state) {
case 'installed':
if (navigator.serviceWorker.controller) {
// new update available
resolve(true);
} else {
// no update available
resolve(false);
}
break;
}
};
};
})
.catch(err => console.error('Error', err));
}
});
setInterval(function(){
console.log("checking");
window['MonommaniaPosUpdateIsAvailable']
.then(isAvailable => {
console.log("update available", isAvailable);
if (isAvailable) {
if (window.confirm("New application update available, reload application?")) {
window.location.reload();
}
}
});
}, 300000);
</script>
<link rel="stylesheet" href="build/css/tachyons.min.css"/>
<link rel="stylesheet" href="build/css/pick-search.css"/>
</head>
<body>
<div id="root">
<h1>Loading...</h1>
</div>
<script src="build/app.js"></script>
</body>
</html>