-
Notifications
You must be signed in to change notification settings - Fork 7
/
manifest.html
42 lines (38 loc) · 1.2 KB
/
manifest.html
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
<!DOCTYPE html>
<html lang="en" manifest="offline.manifest.php">
<head>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
/*global $, document, applicationCache, setTimeout, clearTimeout, parent, console*/
$(document).ready(function () {
'use strict';
var checkTimer, status, hasChecked, loopMax = 60;
function check() {
if (applicationCache.status === applicationCache.CHECKING
|| applicationCache.status === applicationCache.DOWNLOADING
|| applicationCache.status === applicationCache.UPDATEREADY) {
hasChecked = true;
}
if (applicationCache.status !== status) {
status = applicationCache.status;
parent.APP.appcache.logEvent(status, hasChecked);
}
loopMax = loopMax - 1;
if (loopMax > 0) {
if (checkTimer) {
clearTimeout(checkTimer);
}
setTimeout(check, 1000);
} else {
parent.APP.appcache.logEvent(-1, hasChecked);
}
}
if (parent.APP) {
$(applicationCache).bind('updateready cached checking downloading error noupdate obsolete progress updateready', check);
setTimeout(check, 250);
}
});
</script>
</head>
<body></body>
</html>