separate appcache js script detection
This commit is contained in:
parent
5b77366f61
commit
612cf594fb
1 changed files with 1 additions and 51 deletions
52
index.html
52
index.html
|
@ -3,57 +3,6 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="stylesheet" href="gege.css"/>
|
<link rel="stylesheet" href="gege.css"/>
|
||||||
<script>
|
|
||||||
(function() {
|
|
||||||
var webappCache = window.applicationCache;
|
|
||||||
|
|
||||||
function loaded()
|
|
||||||
{
|
|
||||||
//var h1El = document.querySelector("h1");
|
|
||||||
var connectionStatus = ((navigator.onLine) ? 'online' : 'offline');
|
|
||||||
//h1El.textContent = h1El.textContent + " - currently: " + connectionStatus;
|
|
||||||
|
|
||||||
switch(webappCache.status)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
console.log("Cache status: Uncached");
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
console.log("Cache status: Idle");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
console.log("Cache status: Checking");
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
console.log("Cache status: Downloading");
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
console.log("Cache status: Updateready");
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
console.log("Cache status: Obsolete");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateCache()
|
|
||||||
{
|
|
||||||
webappCache.swapCache();
|
|
||||||
console.log("Cache has been updated due to a change found in the manifest");
|
|
||||||
}
|
|
||||||
|
|
||||||
function errorCache()
|
|
||||||
{
|
|
||||||
console.log("You're either offline or something has gone horribly wrong.");
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("load", loaded, false);
|
|
||||||
webappCache.addEventListener("updateready", updateCache, false);
|
|
||||||
webappCache.addEventListener("error", errorCache, false);
|
|
||||||
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<title>GéGé, Geektionnerd Generator</title>
|
<title>GéGé, Geektionnerd Generator</title>
|
||||||
</head>
|
</head>
|
||||||
|
@ -113,6 +62,7 @@
|
||||||
<script type="text/javascript" src="jquery-1.5.2.min.js"></script>
|
<script type="text/javascript" src="jquery-1.5.2.min.js"></script>
|
||||||
<script type="text/javascript" src="ragaboom.min.js"></script>
|
<script type="text/javascript" src="ragaboom.min.js"></script>
|
||||||
<script type="text/javascript" src="comicgen.js"></script>
|
<script type="text/javascript" src="comicgen.js"></script>
|
||||||
|
<script type="text/javascript" src="gege.js"></script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in a new issue