diff --git a/src/platform/web/index.html b/src/platform/web/index.html index 0c2c2fb..8ba9c6b 100644 --- a/src/platform/web/index.html +++ b/src/platform/web/index.html @@ -8,6 +8,7 @@ } body { margin: 0px; + font-size: 1.0em; overflow: hidden; } .game_fs { @@ -20,6 +21,14 @@ border: 0; display: block; } + table { + border-collapse: collapse; + } + + table, th, td { + border: 1px solid black; + padding: 4px; + } @@ -131,10 +140,18 @@ - (.PHD, .PSX, .TR2) + (.PHD, .PSX, .TR2)  +

- OpenLara on github & facebook
-
last update: 13.10.2018
+ OpenLara on github & facebook
+ +

+
last update: 04.12.2018
+ +

@@ -163,9 +180,9 @@ document.body.appendChild(script); - window.onbeforeunload = function () { // Ctrl+W - return "Really want to quit the game?"; - }; + //window.onbeforeunload = function () { // Ctrl+W + // return "Really want to quit the game?"; + //}; var isMobile = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform); @@ -175,7 +192,30 @@ document.getElementById('info').style.display = 'none'; } - function readLevel(event, home) { + function getLatestChanges() { + var xhr = new XMLHttpRequest(); + + xhr.onreadystatechange = function() { + if (this.readyState === 4 && this.status === 200) { + e = document.getElementById('latest_changes'); + str = ''; + for (var i = 0; i < this.response.length; i++) { + var item = this.response[i]; + var d = new Date(item.commit.author.date); + var date = d.getDate() + '.' + (d.getMonth() + 1) + '.' + d.getFullYear(); + str += ''; + } + str += '
' + date + '' + item.commit.message + '
'; + e.innerHTML = str; + } + }; + + xhr.open('GET', "https://api.github.com/repos/XProger/OpenLara/commits", true); + xhr.responseType = 'json'; + xhr.send(null); + } + + function readLevel(event) { var reader = new FileReader(); reader.onload = function(){ var size = reader.result.byteLength; @@ -185,6 +225,46 @@ }; reader.readAsArrayBuffer(event.target.files[0]); } + /* + var db; + var request = indexedDB.open("db"); +request.onupgradeneeded = function() { +console.log("!!!!!!!! NO DB!"); +}; +request.onsuccess = function() { + db = request.result; + // Enable our buttons once the IndexedDB instance is available. + +}; + + function logTimestamps(timestamps) { + console.log('There are ' + timestamps.length + + ' timestamp(s) saved in IndexedDB: ' + timestamps.join(', ')); +} + + function backupSaves() { + + var transaction = db.transaction("FILE_DATA", 'readonly'); + var store = transaction.objectStore("FILE_DATA"); + store.get("level/1/GYMLOAD.PNG").onsuccess = function(e) { + var value = e.target.result; + // value will be: { zip: {}, foo: { bar: { baz: 1 } } } + console.log(value); + var data = value; + var a = document.createElement("a"); + + a.href = URL.createObjectURL(new Blob([data])); + a.download = "savegame.dat"; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + }; + + } +*/ + function restoreSaves() { + alert('restore'); + }