moved from textbot to select

This commit is contained in:
Alec Hoefler 2021-04-11 15:15:43 +02:00
parent 5613187d98
commit b5de01386a
No known key found for this signature in database
GPG key ID: 1680F098C272750C
2 changed files with 8 additions and 1 deletions

View file

@ -47,7 +47,9 @@
<input type="file" id="fileToUpload" name="fileToUpload">
<span id="_jmtoken"> <input type="text" id="jmtoken" placeholder="JM Token">
</span>
<input type="text" id="jmcat" placeholder="JM Category id">
<select id="jmcat">
</select>
<input type="button" id="submitUpload" onclick="uploadFile()" value="Hochladen">
<span id="output"></span>
</div>

View file

@ -5,6 +5,7 @@ let offsetLoadNext = 200;
let memes;
let categories = [];
let categorySelect = document.querySelector("#categorySelect");
let categorySelectUpload = document.querySelector("#jmcat");
let imagesDiv = document.querySelector(".images");
let docElem = document.documentElement;
let docBody = document.body;
@ -44,7 +45,11 @@ function addCategory(category){
let optionItem = document.createElement("option");
optionItem.setAttribute("value", category["id"]);
optionItem.innerText = category["name"];
let optionItemUpload = document.createElement("option");
optionItemUpload.setAttribute("value", category["id"]);
optionItemUpload.innerText = category["name"];
categorySelect.appendChild(optionItem);
categorySelectUpload.appendChild(optionItemUpload);
}
function updateImages(clear = false){