Editor: Add save button and rearange buttons a bit
This commit is contained in:
parent
a765cefe5f
commit
3f2d480635
@ -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>
|
||||||
|
@ -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');
|
||||||
|
Loading…
Reference in New Issue
Block a user