Rewrite some stuff
This commit is contained in:
parent
8177d33304
commit
3be664d8c7
@ -549,6 +549,7 @@ if ("loading" === document.readyState) {
|
||||
|
||||
async function uploadFile() {
|
||||
const fileInput = document.getElementById('fileInput');
|
||||
const fileForm = document.getElementById('uploadForm');
|
||||
let data = {
|
||||
action: "uploadFiles"
|
||||
};
|
||||
@ -556,7 +557,7 @@ async function uploadFile() {
|
||||
data[`userFile${i}`] = fileInput.files[i];
|
||||
}
|
||||
await doAction("/upload", data, "Súbor bol úspešne nahraný", "Nastala chyba pri nahrávaní súboru", false);
|
||||
fileInput.reset();
|
||||
fileForm.reset();
|
||||
}
|
||||
|
||||
async function deleteFile(fileID) {
|
||||
@ -590,6 +591,7 @@ async function addMeme() {
|
||||
let memeTitleElement = document.getElementById("meme_title_input");
|
||||
let memeTextElement = document.getElementById("meme_text_input");
|
||||
let memeImageElement = document.getElementById("meme_image_input");
|
||||
let memeFormElement = document.getElementById("memeAddForm");
|
||||
|
||||
await doAction("/meme", {
|
||||
action: "addMeme",
|
||||
@ -597,9 +599,7 @@ async function addMeme() {
|
||||
meme_text: memeTextElement.value,
|
||||
meme_image_id: memeImageElement.value
|
||||
}, "Meme bol zmazaný", "Nastala chyba pri mazaní meme-u", false);
|
||||
memeTitleElement.reset();
|
||||
memeTextElement.reset();
|
||||
memeImageElement.reset();
|
||||
memeFormElement.reset();
|
||||
}
|
||||
|
||||
async function deleteMeme(memeId) {
|
||||
|
@ -1,9 +1,11 @@
|
||||
<!--suppress HtmlUnknownTag, HtmlUnknownTag -->
|
||||
<page minimal_permission_level="2" secret="yes" page_title="Vytvoriť"></page>
|
||||
<label for="meme_title_input">Názov meme-u: </label>
|
||||
<input type="text" id="meme_title_input"/>
|
||||
<label for="meme_text_input">Text meme-u: </label>
|
||||
<input type="text" id="meme_text_input"/>
|
||||
<label for="meme_image_input">Obrázok meme-u</label>
|
||||
<select id="meme_image_input"></select>
|
||||
<input type="button" value="Pridať meme" onclick="addMeme()"/>
|
||||
<form id="memeAddForm">
|
||||
<label for="meme_title_input">Názov meme-u: </label>
|
||||
<input type="text" id="meme_title_input"/>
|
||||
<label for="meme_text_input">Text meme-u: </label>
|
||||
<input type="text" id="meme_text_input"/>
|
||||
<label for="meme_image_input">Obrázok meme-u</label>
|
||||
<select id="meme_image_input"></select>
|
||||
<input type="button" value="Pridať meme" onclick="addMeme()"/>
|
||||
</form>
|
Loading…
Reference in New Issue
Block a user