slight ui changes

This commit is contained in:
Peter Beluzsar
2026-01-20 02:32:38 +01:00
parent 376630b68d
commit 2cda6c8608
4 changed files with 41 additions and 7 deletions

View File

@@ -46,6 +46,7 @@
async function open_message(id)
{
answid = id;
var url = 'admin/api/all_messages/' + id;
fetch(url)
@@ -57,13 +58,23 @@
})
.then(data => {
document.getElementById("messages").innerHTML = '<footer> <div class="textbox"><input class="text_input" name="valami" type="text" id="promptText" placeholder="answ"><button class="send_button" onclick="send_data()">send</button><button class="send_button" onclick="open_message(' + answid + ')">reload</button></div></footer>' + data;
document.getElementById("messages").innerHTML = '<footer> <div class="textbox"><input class="text_input" name="valami" type="text" id="promptText" placeholder="answ"><button class="send_button" id="send-button" onclick="send_data()">send</button><button class="send_button" onclick="open_message(' + answid + ')">reload</button></div></footer>' + data;
var input = document.getElementById("promptText");
input.addEventListener("keypress", function(event) {
if (event.key === "Enter") {
event.preventDefault();
document.getElementById("send-button").click();
}
});
console.log(data.body)
})
.catch(error => {x0
console.error('Error:', error);
});
}
async function send_data()