diff --git a/brown-wall.html b/brown-wall.html index 706772c..f398f02 100644 --- a/brown-wall.html +++ b/brown-wall.html @@ -10,9 +10,13 @@

Brown Wall

A wall which has been hit with a considerable amount of faeces.

- + + + +
diff --git a/main.js b/main.js index cf082c3..2287c21 100644 --- a/main.js +++ b/main.js @@ -20,4 +20,22 @@ menus.forEach( menu =>{ menu.items.forEach(item =>{ dropdownSelect.append(Object.assign(document.createElement('option'), {id:item.toLowerCase(), innerHTML:item})) }) -}) \ No newline at end of file +}) + +document.getElementById('import').onclick = function() { + const files = document.getElementById('selectFiles').files; + if (files.length <= 0) { + return false; + } + + var fr = new FileReader(); + + fr.onload = function(e) { + console.log(e); + var result = JSON.parse(e.target.result); + var formatted = JSON.stringify(result, null, 2); + document.getElementById('result').value = formatted; + } + + fr.readAsText(files.item(0)); +};