Editor: Add save button and rearange buttons a bit

This commit is contained in:
Adam Goldsmith 2017-10-09 03:30:17 -04:00
parent a765cefe5f
commit 3f2d480635
2 changed files with 12 additions and 1 deletions

View File

@ -5,7 +5,15 @@
<title>Editor</title>
</head>
<body>
<input id="jsonUpload" type="file"> <button type="button" id="jsonInputDownload">Download input</button> <br>
<div>
<button type="button" id="saveButton">Save Deck</button>
<button type="button" id="jsonInputDownload">Download JSON</button>
</div>
<div>
<label> Upload JSON: WARNING: WILL CLEAR DECK
<input id="jsonUpload" type="file">
</label>
</div>
<form id="deckForm">
<div> <label> Deck Name: <input type="text" id="deckName"></label> </div>
<div>

View File

@ -22,6 +22,9 @@ window.addEventListener("load", () => {
reader.readAsText(files[0]);
});
// Upload on save button
document.querySelector('#saveButton').addEventListener('click', upload);
// download input JSON
document.querySelector('#jsonInputDownload').addEventListener('click', () => {
let dl = document.createElement('a');