Fix some issues + last stand

Signed-off-by: Josef Fröhle <github@josef-froehle.de>
This commit is contained in:
2020-06-25 14:57:42 +02:00
parent 4a2526d691
commit 63024ffe8f
22 changed files with 1977 additions and 590 deletions

17
assets/js/file_reader.js Normal file
View File

@@ -0,0 +1,17 @@
function getFileContents(file) {
var file = document.getElementById("fileUpload").files[0];
var fileContents = false;
if (file) {
var reader = new FileReader();
reader.readAsText(file, "UTF-8");
reader.onload = function (evt) {
var warData = JSON.parse(evt.target.result);
initApp(warData, 'withSave', warData);
}
reader.onerror = function (evt) {
console.error('error reading the file.')
}
}
}