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,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];

View File

@@ -1,179 +1,182 @@
<!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">
<title>Shopping List</title> <title>Shopping List</title>
<style type="text/css"> <style type="text/css">
@import "jquery.mobile.theme-1.3.2.css"; @import "jquery.mobile.theme-1.3.2.css";
@import "jquery.mobile.structure-1.3.2.min.css"; @import "jquery.mobile.structure-1.3.2.min.css";
legend { font-weight:bold;text-decoration:underline} legend { font-weight:bold;text-decoration:underline}
</style> </style>
<script src="jquery-1.10.2.min.js"></script> <script src="jquery-1.10.2.min.js"></script>
<script src="jquery.mobile-1.3.2.min.js"></script> <script src="jquery.mobile-1.3.2.min.js"></script>
<script src="IndexedDBShim.js"></script> <script src="IndexedDBShim.js"></script>
<script src="jquery.indexeddb.js"></script> <script src="jquery.indexeddb.js"></script>
<script src="globals.js"></script> <script src="globals.js"></script>
<script src="database.js"></script> <script src="database.js"></script>
<script src="transfer.js"></script> <script src="transfer.js"></script>
<script src="datahandler.js"></script> <script src="datahandler.js"></script>
<script src="helpers.js"></script> <script src="helpers.js"></script>
<script src="uicontroler.js"></script> <script src="uicontroler.js"></script>
<script language='JavaScript'> <script language='JavaScript'>
$(document).bind('pageinit',function() { $(document).bind('pageinit',function() {
defineDisplayStatus(); defineDisplayStatus();
if (applicationCache.status==applicationCache.IDLE) { applicationCache.update(); } try {
if (applicationCache.status==applicationCache.IDLE) { applicationCache.update(); }
$("#lbHeading").text("Shopping List"); } catch(ex) {
$("#pnlHeading").show(); console.log("Quick fix switch off appCache",ex);
}
// get rid of the Searchbox of the Entries ListView $("#lbHeading").text("Shopping List");
$("#lstEntries").prev().children(".ui-input-search").hide(); $("#pnlHeading").show();
initSession(); // get rid of the Searchbox of the Entries ListView
$("#lstEntries").prev().children(".ui-input-search").hide();
// Enter key submits input fields
$("#tbCode,#tbShoppingListName,#tbNewEntry,#tbShopName").keyup( function(e) { initSession();
if (e.keyCode == 13) {
e.currentTarget.onsubmit(); // Enter key submits input fields
} $("#tbCode,#tbShoppingListName,#tbNewEntry,#tbShopName").keyup( function(e) {
}); if (e.keyCode == 13) {
e.currentTarget.onsubmit();
// Setup recurring transfer poll }
window.setInterval(transferQDispatcher,10000); });
// Setup recurring transfer poll
}) window.setInterval(transferQDispatcher,10000);
})
</script>
</head>
<body>
</script>
<div id='pnlHeading' data-role="header"> </head>
<a id="btnHeadingLeft" data-role="button" data-icon="arrow-l">TESTL</a> <body>
<h1 id='lbHeading'>TESTMID</h1>
<a id="btnHeadingRight" data-role="button" data-icon="gear">TESTR</a> <div id='pnlHeading' data-role="header">
<a id="btnHeadingLeft" data-role="button" data-icon="arrow-l">TESTL</a>
<div id='pnlShops'> <h1 id='lbHeading'>TESTMID</h1>
</div> <a id="btnHeadingRight" data-role="button" data-icon="gear">TESTR</a>
<div id='pnlSettingsNav' style='display:none'> <div id='pnlShops'>
<div data-role="navbar"> </div>
<ul>
<li><a onClick='showTransferQ();' class="ui-btn-active ui-state-persist">TransferQ</a></li> <div id='pnlSettingsNav' style='display:none'>
<li><a onClick='setMode("SettingsSettings")'>Settings</a></li> <div data-role="navbar">
<li><a onClick='setMode("About")'>About</a></li> <ul>
</ul> <li><a onClick='showTransferQ();' class="ui-btn-active ui-state-persist">TransferQ</a></li>
</div> <li><a onClick='setMode("SettingsSettings")'>Settings</a></li>
</div> <li><a onClick='setMode("About")'>About</a></li>
</div> </ul>
</div>
<div id='pnlBranding' style='display:none'> </div>
<div id='pnlDisclaimer'> </div>
<fieldset><legend>Terms of Use+Disclaimer</legend>
By using this service you agree to the following terms of use: <div id='pnlBranding' style='display:none'>
<ul> <div id='pnlDisclaimer'>
<li>There is no guarantee of this service to be available and working at any point in time</li> <fieldset><legend>Terms of Use+Disclaimer</legend>
<li>There is no data security whatsoever, data might be lost or shared</li> By using this service you agree to the following terms of use:
<li>This service does not offer any form of data protection or privacy</li> <ul>
<li>No claims can be made for any demage due to using this service</li> <li>There is no guarantee of this service to be available and working at any point in time</li>
<li>Data entered into this system immediately becomes ownership of the system operator</li> <li>There is no data security whatsoever, data might be lost or shared</li>
<li>Even though there are no access restrictions this system isn't available for public use</li> <li>This service does not offer any form of data protection or privacy</li>
<ul> <li>No claims can be made for any demage due to using this service</li>
<br> <li>Data entered into this system immediately becomes ownership of the system operator</li>
<a data-role="button" data-icon="check" data-iconpos="right" onclick='$("#pnlDisclaimer").slideUp();$("#pnlDisclaimerAccepted").slideDown();' >Agree</a> <li>Even though there are no access restrictions this system isn't available for public use</li>
<a data-role="button" data-icon="delete" data-iconpos="right" href='http://www.google.com' >Decline</a> <ul>
</fieldset> <br>
</div> <a data-role="button" data-icon="check" data-iconpos="right" onclick='$("#pnlDisclaimer").slideUp();$("#pnlDisclaimerAccepted").slideDown();' >Agree</a>
<a data-role="button" data-icon="delete" data-iconpos="right" href='http://www.google.com' >Decline</a>
<div id='pnlDisclaimerAccepted' style='display:none'> </fieldset>
<table> </div>
<tr>
<td>Shopping List Name:</td> <div id='pnlDisclaimerAccepted' style='display:none'>
<td><input type='text' onsubmit='$("#btnSubmitBranding").click();' style='width:200px' id='tbShoppingListName' value=''></input></td> <table>
</tr><tr> <tr>
<td colspan='2'> <a data-role="button" data-icon="arrow-r" data-iconpos="right" id='btnSubmitBranding' onclick='JavaScript:brandBrowser($("#tbShoppingListName").val());' >Brand</a> </td> <td>Shopping List Name:</td>
</tr> <td><input type='text' onsubmit='$("#btnSubmitBranding").click();' style='width:200px' id='tbShoppingListName' value=''></input></td>
</table> </tr><tr>
<br /> <td colspan='2'> <a data-role="button" data-icon="arrow-r" data-iconpos="right" id='btnSubmitBranding' onclick='JavaScript:brandBrowser($("#tbShoppingListName").val());' >Brand</a> </td>
<hr /> </tr>
<br /> </table>
<fieldset><legend>INFO</legend> <br />
In order to access a shopping list form multiple computers there must be an identifier that is unique for each shopping list. <hr />
Everybody who knows this identifier can access this shopping list! <br />
</fieldset> <fieldset><legend>INFO</legend>
</div> In order to access a shopping list form multiple computers there must be an identifier that is unique for each shopping list.
Everybody who knows this identifier can access this shopping list!
</div> </fieldset>
</div>
<div id='pnlEntries' style='display:none'>
<table width='100%' border='0'> </div>
<tr>
<td style='width:80%'> <div id='pnlEntries' style='display:none'>
<input type="text" x-webkit-speech name="name" onsubmit="$('#btnSubmitNewEntry').click();" id="tbNewEntry" data-clear-btn="true" value="" data-mini="true" onchange="this.onkeyup()" onkeyup='$("#lstEntries").prev().children(".ui-input-search").children("input").val(this.value).change();'/> <table width='100%' border='0'>
</td> <td> <tr>
<input id="btnSubmitNewEntry" onclick="addNewEntry($('#tbNewEntry').val());$('#tbNewEntry').val('').change();" type="submit" data-mini="true" data-theme="b" value="Add" /> <td style='width:80%'>
</td> <input type="text" x-webkit-speech name="name" onsubmit="$('#btnSubmitNewEntry').click();" id="tbNewEntry" data-clear-btn="true" value="" data-mini="true" onchange="this.onkeyup()" onkeyup='$("#lstEntries").prev().children(".ui-input-search").children("input").val(this.value).change();'/>
</tr> </td> <td>
</table> <input id="btnSubmitNewEntry" onclick="addNewEntry($('#tbNewEntry').val());$('#tbNewEntry').val('').change();" type="submit" data-mini="true" data-theme="b" value="Add" />
<hr> </td>
<ul data-role="listview" id='lstEntries' data-filter="true"> <!-- filtering when entering value in add box... --> </tr>
</ul> </table>
<div data-role="footer" data-id="foo1" data-position="fixed"> <hr>
</div> <ul data-role="listview" id='lstEntries' data-filter="true"> <!-- filtering when entering value in add box... -->
</div> </ul>
<div data-role="footer" data-id="foo1" data-position="fixed">
<div id='pnlShopDetails' style='display:none'> </div>
<div data-role='fieldcontain'> </div>
<label for="tbShopName">Shop-Name:</label>
<input type="text" id="tbShopName" onsubmit="$('#btnShopAddEdit').click();" placeholder="Name of the Shop" value="" /> <div id='pnlShopDetails' style='display:none'>
</div> <div data-role='fieldcontain'>
<a id="btnShopAddEdit" data-role="button" data-icon="arrow-r" data-iconpos="right" onclick="shopChangeHandler($('#tbShopName').attr('globalid') || generateUUID(),$('#tbShopName').val())" type="submit" data-theme="b">Done</a> <label for="tbShopName">Shop-Name:</label>
<a id="btnShopDelete" data-role="button" data-icon="delete" data-iconpos="right" onclick="shopDeletion($('#tbShopName').attr('globalid'))" type="submit" data-theme="c">Delete Shop</a> <input type="text" id="tbShopName" onsubmit="$('#btnShopAddEdit').click();" placeholder="Name of the Shop" value="" />
</div> </div>
<a id="btnShopAddEdit" data-role="button" data-icon="arrow-r" data-iconpos="right" onclick="shopChangeHandler($('#tbShopName').attr('globalid') || generateUUID(),$('#tbShopName').val())" type="submit" data-theme="b">Done</a>
<div id='pnlTransferQ' style='display:none'> <a id="btnShopDelete" data-role="button" data-icon="delete" data-iconpos="right" onclick="shopDeletion($('#tbShopName').attr('globalid'))" type="submit" data-theme="c">Delete Shop</a>
<a data-role="button" data-icon="refresh" onclick='refreshTransferQDisplay()'>Refresh</a> </div>
<ul data-role="listview" id='lstTransferQItems' data-filter="false">
</ul> <div id='pnlTransferQ' style='display:none'>
<hr/ > <a data-role="button" data-icon="refresh" onclick='refreshTransferQDisplay()'>Refresh</a>
<h3>Data:</h3> <ul data-role="listview" id='lstTransferQItems' data-filter="false">
<textarea style='background-colour:yellow' id='txtTransferQDetails'> </ul>
</textarea> <hr/ >
</div> <h3>Data:</h3>
<textarea style='background-colour:yellow' id='txtTransferQDetails'>
<div id='pnlSettings' style='display:none'> </textarea>
<a id="btnUnbrand" data-role="button" data-icon="delete" data-iconpos="right" onclick="unbrandBrowser();" type="submit">Unbrand</a> </div>
<a id="btnShowDebugConsole" data-role="button" data-icon="check" data-iconpos="right" onclick="window.console.log=myConsoleLog;$('#pnlDebugConsole').slideToggle(2000)" type="submit">Show Debug Console</a>
</div> <div id='pnlSettings' style='display:none'>
<a id="btnUnbrand" data-role="button" data-icon="delete" data-iconpos="right" onclick="unbrandBrowser();" type="submit">Unbrand</a>
<div id='pnlAbout' style='display:none'> <a id="btnShowDebugConsole" data-role="button" data-icon="check" data-iconpos="right" onclick="window.console.log=myConsoleLog;$('#pnlDebugConsole').slideToggle(2000)" type="submit">Show Debug Console</a>
Offline, Synchronizing ShoppingList<br /> </div>
Implemented and operated by Joe Tretter (j.tretter at gmail dot com)<br />
</div> <div id='pnlAbout' style='display:none'>
Offline, Synchronizing ShoppingList<br />
<div id='pnlDebugConsole' style='display:none'> Implemented and operated by Joe Tretter (j.tretter at gmail dot com)<br />
<div data-role="fieldcontain"> </div>
<label for="tbCode">Code</label>
<input onsubmit='$("#txtDebugOutput").text(eval($("#tbCode").val()))' id='tbCode'></input> <div id='pnlDebugConsole' style='display:none'>
</div> <div data-role="fieldcontain">
<div data-role="fieldcontain"> <label for="tbCode">Code</label>
<label for="txtDebugOutput">Result Output</label> <input onsubmit='$("#txtDebugOutput").text(eval($("#tbCode").val()))' id='tbCode'></input>
<textarea cols="40" rows="8" id="txtDebugOutput"></textarea> </div>
</div> <div data-role="fieldcontain">
<div data-role="fieldcontain"> <label for="txtDebugOutput">Result Output</label>
<label for="txtDebugConsole">Debug Console</label> <textarea cols="40" rows="8" id="txtDebugOutput"></textarea>
<textarea cols="40" rows="8" id="txtDebugConsole"></textarea> </div>
</div> <div data-role="fieldcontain">
</div> <label for="txtDebugConsole">Debug Console</label>
<textarea cols="40" rows="8" id="txtDebugConsole"></textarea>
<br /> </div>
<span id='lbRevision' style='font-size:xx-small' >$Revision: 74 $</span> </div>
</body>
</html> <br />
<span id='lbRevision' style='font-size:xx-small' >$Revision: 74 $</span>
</body>
</html>