Work around deprecation of offline capabilities
This commit is contained in:
22
globals.js
22
globals.js
@@ -59,16 +59,20 @@ function initSession(){
|
|||||||
|
|
||||||
// Check if a new cache is available on page load. || TODO: the Server could notify for new versions, then the check would be done closer to time.
|
// Check if a new cache is available on page load. || TODO: the Server could notify for new versions, then the check would be done closer to time.
|
||||||
window.addEventListener('load', function(e) {
|
window.addEventListener('load', function(e) {
|
||||||
window.applicationCache.addEventListener('updateready', function(e) {
|
try{
|
||||||
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
|
window.applicationCache.addEventListener('updateready', function(e) {
|
||||||
// Intentially not calling swapcache here, it's quite useless because it will only use the new verstion for newly loaded files anyway...
|
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
|
||||||
if (confirm('A new version of this site is available. Load it?')) {
|
// Intentially not calling swapcache here, it's quite useless because it will only use the new verstion for newly loaded files anyway...
|
||||||
window.location.reload();
|
if (confirm('A new version of this site is available. Load it?')) {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Manifest didn't changed. Nothing new to server.
|
||||||
}
|
}
|
||||||
} else {
|
}, false);
|
||||||
// Manifest didn't changed. Nothing new to server.
|
} catch (ex) {
|
||||||
}
|
console.log("Quick Fix - switch off AppCachea",ex);
|
||||||
}, false);
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
var indexHtmlRevision = $("#lbRevision").text().split(" ")[1];
|
var indexHtmlRevision = $("#lbRevision").text().split(" ")[1];
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
|
|
||||||
<html lang="en" manifest="cache.manifest">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<!-- meta name="apple-mobile-web-app-capable" content="yes" / TODO: prevents from cache refreshing! -->
|
<!-- meta name="apple-mobile-web-app-capable" content="yes" / TODO: prevents from cache refreshing! -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
@@ -26,8 +26,11 @@
|
|||||||
|
|
||||||
$(document).bind('pageinit',function() {
|
$(document).bind('pageinit',function() {
|
||||||
defineDisplayStatus();
|
defineDisplayStatus();
|
||||||
|
try {
|
||||||
if (applicationCache.status==applicationCache.IDLE) { applicationCache.update(); }
|
if (applicationCache.status==applicationCache.IDLE) { applicationCache.update(); }
|
||||||
|
} catch(ex) {
|
||||||
|
console.log("Quick fix switch off appCache",ex);
|
||||||
|
}
|
||||||
$("#lbHeading").text("Shopping List");
|
$("#lbHeading").text("Shopping List");
|
||||||
$("#pnlHeading").show();
|
$("#pnlHeading").show();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user