Added no-db warning
This commit is contained in:
@@ -27,6 +27,11 @@ $(window).on('load',function(){
|
||||
hideLoader();
|
||||
})
|
||||
|
||||
//Generating Cookies
|
||||
function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + n * 365 * 24 * 3600 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"}
|
||||
function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null}
|
||||
function eraseCookie(e) {createCookie(e, "", -1)}
|
||||
|
||||
$(document).ready(function(){
|
||||
'use strict'
|
||||
|
||||
@@ -187,11 +192,6 @@ $(document).ready(function(){
|
||||
return false;
|
||||
});
|
||||
|
||||
//Generating Cookies
|
||||
function createCookie(e, t, n) {if (n) {var o = new Date;o.setTime(o.getTime() + n * 365 * 24 * 3600 * 1e3);var r = "; expires=" + o.toGMTString()} else var r = "";document.cookie = e + "=" + t + r + "; path=/"}
|
||||
function readCookie(e) {for (var t = e + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {for (var r = n[o];" " == r.charAt(0);) r = r.substring(1, r.length);if (0 == r.indexOf(t)) return r.substring(t.length, r.length)}return null}
|
||||
function eraseCookie(e) {createCookie(e, "", -1)}
|
||||
|
||||
//Disabling & Enabling Dark Transitions in Dark Mode to Speed up Performance.
|
||||
function allowTransitions(){$('body').find('#transitions-remove').remove();}
|
||||
function removeTransitions(){$('body').append('<style id="transitions-remove">.btn, .header, #footer-bar, .menu-box, .menu-active{transition:all 0ms ease!important;}</style>'); setTimeout(function(){allowTransitions();},10);}
|
||||
|
||||
@@ -933,6 +933,8 @@ function initDatabase() {
|
||||
request.onerror = function (event) {
|
||||
log("Cannot open DB: " + event.target);
|
||||
|
||||
if (typeof onDatabaseLoaded == 'function') onDatabaseLoaded();
|
||||
|
||||
runPageScript();
|
||||
};
|
||||
request.onsuccess = function (event) {
|
||||
@@ -1048,6 +1050,8 @@ function initDatabase() {
|
||||
osUpdateTimes.put({ table: 'last_sync', time: 0 });
|
||||
}
|
||||
} else {
|
||||
if (typeof onDatabaseLoaded == 'function') onDatabaseLoaded();
|
||||
|
||||
runPageScript();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,6 +470,20 @@ var onServiceWorkerLoaded = function() {
|
||||
}
|
||||
|
||||
var onDatabaseLoaded = function() {
|
||||
if (!canUseLocalDB) {
|
||||
function NoDbWarningOk() {
|
||||
createCookie('regatten_nodb_banner', true, 1);
|
||||
$('#menu-nodb-warning').hideMenu();
|
||||
}
|
||||
function showNoDbWarning() {
|
||||
if (!readCookie('regatten_nodb_banner')) {
|
||||
$('#menu-nodb-warning').showMenu();
|
||||
}
|
||||
}
|
||||
$('#menu-nodb-warning-okay').click(NoDbWarningOk);
|
||||
showNoDbWarning();
|
||||
}
|
||||
|
||||
onServiceWorkerLoaded();
|
||||
initPushSettings();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user