<div id="noGLwarning">
Unable to initialize WebGL. You need a browser that supports it.
</div>
+<div id="DBError">
+ Unable to open indexedDB database in your browser. Please make sure you have
+ not disabled access to in-browser storage.
+</div>
<div id="firstRunIntro">
<p class="dialogTitle">Welcome to Lantea Maps!</p>
<p>This web app lets you record GPS tracks of your journeys, which you can
request.onerror = function(event) {
// Errors can be handled here. Error codes explain in:
// https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#Constants
- if (gDebug)
- console.log("error opening mainDB: " + event.target.errorCode);
+ console.log("error opening mainDB: " + event.target.error);
+ showDBErrorDialog();
+ if (gDebug) {
+ console.log("error code: " + event.target.error.code +
+ " - name: " + event.target.error.name);
+ }
};
request.onsuccess = function(event) {
- mainDB = request.result;
+ mainDB = event.target.result;
var throwEv = new CustomEvent("dbinit-done");
gAction.dispatchEvent(throwEv);
};
dia.classList.remove("hidden");
}
+function showDBErrorDialog() {
+ var dia = document.getElementById("dialogArea");
+ var areas = dia.children;
+ for (var i = 0; i <= areas.length - 1; i++) {
+ areas[i].style.display = "none";
+ }
+ document.getElementById("DBError").style.display = "block";
+ dia.classList.remove("hidden");
+}
+
function showFirstRunDialog() {
var dia = document.getElementById("dialogArea");
var areas = dia.children;