mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
implemted import file by url
This commit is contained in:
parent
9aa369b6df
commit
5912dfe7f3
2 changed files with 38 additions and 8 deletions
|
|
@ -183,7 +183,7 @@ function saveMap() {
|
|||
console.timeEnd("saveMap");
|
||||
}
|
||||
|
||||
function uploadFile(file, callback) {
|
||||
function uploadFile(file, type, callback) {
|
||||
console.time("loadMap");
|
||||
const fileReader = new FileReader();
|
||||
fileReader.onload = function(fileLoadedEvent) {
|
||||
|
|
@ -213,7 +213,7 @@ function uploadFile(file, callback) {
|
|||
}});
|
||||
};
|
||||
|
||||
fileReader.readAsText(file, "UTF-8");
|
||||
fileReader.readAsText(file, type);
|
||||
if (callback) callback();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue