slight ui changes
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<footer>
|
||||
<div class="textbox">
|
||||
<input class="text_input" name="valami" type="text" id="promptText" placeholder="Kérdezz az OSI modellről... vagy idk...">
|
||||
<button class="send_button" onclick="send_data()">send</button>
|
||||
<button id="send-button" class="send_button" onclick="send_data()">send</button>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -49,6 +49,15 @@
|
||||
<script>
|
||||
let id;
|
||||
|
||||
var input = document.getElementById("promptText");
|
||||
input.addEventListener("keypress", function(event) {
|
||||
if (event.key === "Enter") {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
document.getElementById("send-button").click();
|
||||
}
|
||||
});
|
||||
|
||||
function genZ() {
|
||||
var x = document.getElementById("funniez");
|
||||
|
||||
Reference in New Issue
Block a user