Work around deprecation of offline capabilities

This commit is contained in:
Joe Tretter
2020-08-29 14:11:41 -05:00
parent e1a15e7efb
commit 32122b8213
2 changed files with 195 additions and 188 deletions

View File

@@ -59,6 +59,7 @@ 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) {
try{
window.applicationCache.addEventListener('updateready', function(e) { window.applicationCache.addEventListener('updateready', function(e) {
if (window.applicationCache.status == window.applicationCache.UPDATEREADY) { if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
// Intentially not calling swapcache here, it's quite useless because it will only use the new verstion for newly loaded files anyway... // Intentially not calling swapcache here, it's quite useless because it will only use the new verstion for newly loaded files anyway...
@@ -69,6 +70,9 @@ function initSession(){
// Manifest didn't changed. Nothing new to server. // Manifest didn't changed. Nothing new to server.
} }
}, false); }, false);
} catch (ex) {
console.log("Quick Fix - switch off AppCachea",ex);
}
}, false); }, false);
var indexHtmlRevision = $("#lbRevision").text().split(" ")[1]; var indexHtmlRevision = $("#lbRevision").text().split(" ")[1];

View File

@@ -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();