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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html manifest="gmas.manifest">
<head>
<meta charset="utf-8" />
<meta name="generator" content="PSPad editor, www.pspad.com">
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<title>appInventaire</title>
<script>
function logEvent(a) {
console.log(a.type);
switch (a.type)
{
case "checking":
document.getElementById('container').innerHTML = "Vérification...";
break;
case "noupdate":
document.getElementById('container').innerHTML = "Version à jour";
break;
case "progress":
document.getElementById('container').innerHTML = "En cours";
break;
case "downloading":
document.getElementById('container').innerHTML = "Téléchargement en cours...";
break;
case "cached":
document.getElementById('container').innerHTML = "A jour";
break;
case "updateready":
document.getElementById('container').innerHTML = "Mise à jour installée";
break;
case "obsolete":
document.getElementById('container').innerHTML = "Version obsolete";
break;
case "error":
document.getElementById('container').innerHTML = "Erreur";
break;
default:
document.getElementById('container').innerHTML = "En attente...";
break;
}
if (a.type == "updateready" || a.type == "cached") {
window.applicationCache.swapCache();
}
if (a.lengthComputable) {
console.log("total:" + a.total + " loaded:" + a.loaded);
}
if (a.type == "error") {
window.applicationCache.update();
document.getElementById('container').innerHTML = "Mise à jour forcée";
}
}
$(function() {
if(window.applicationCache){
window.applicationCache.addEventListener("checking", logEvent, false);
window.applicationCache.addEventListener("downloading", logEvent, false);
window.applicationCache.addEventListener("noupdate", logEvent, false);
window.applicationCache.addEventListener("progress", logEvent, false);
window.applicationCache.addEventListener("error", logEvent, false);
window.applicationCache.addEventListener("cached", logEvent, false);
window.applicationCache.addEventListener("updateready", logEvent, false);
window.applicationCache.addEventListener("obsolete", logEvent, false);
}
});
</script>
<style type="text/css">
#container.default{
position:absolute;
right: 2px;
top: 2px;
width: 200px;
height:18px;
color: #fff;
padding: 1px 3px;
background-color: #000;
opacity:0.7;
font-size:13px;
}
</style>
</head>
<body>
<div id="container" class="default">???</div>
</body>
</html> |
Partager