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 b0207e3f8b
commit 3ae052c13c
2 changed files with 12 additions and 1 deletions

View File

@ -5,7 +5,15 @@
<title>Editor</title> <title>Editor</title>
</head> </head>
<body> <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"> <form id="deckForm">
<div> <label> Deck Name: <input type="text" id="deckName"></label> </div> <div> <label> Deck Name: <input type="text" id="deckName"></label> </div>
<div> <div>

View File

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