Compare commits

...

2 Commits

Author SHA1 Message Date
84baaff88a message style refine 2023-04-04 00:59:42 +08:00
ce89247a9c message auto wrap 2023-04-04 00:38:02 +08:00

View File

@ -7,10 +7,11 @@
</ul>
</div>
<div class="fixed-bottom form-inline">
<textarea id="msgbox" class="form-control" style="min-width:80%"></textarea>
<textarea id="msgbox" class="form-control" style="width:85%; float: left;"></textarea>
<button id="btn-send"
class="btn btn-info"
type="button"
style="width: 10%;"
onclick="send_message()"
disabled>
<svg xmlns="http://www.w3.org/2000/svg"
@ -50,18 +51,17 @@
var li = document.createElement('li');
var pre = document.createElement('pre');
li.appendChild(pre)
li.style.marginBottom = "20px"
li.style.textAlign = "left"
li.style.padding = "10px"
li.style.clear = "both"
if (msg.response == "" && msg.request != "") {
li.style.textAlign = "right"
pre.innerText = msg.request
pre.style.backgroundColor = "lightblue"
pre.style = "background-color: lightblue; border-radius: 10px; padding: 5px; white-space: pre-wrap; word-wrap: break-word; float: right;"
} else if (msg.request != "") {
li.style.textAlign = "left"
pre.innerText = msg.response
pre.style.backgroundColor = "lightgreen"
pre.style = "background-color: lightgreen; border-radius: 10px; padding: 5px; white-space: pre-wrap; word-wrap: break-word;"
}
pre.style.borderRadius = "10px"
pre.style.padding = "5px"
msg_list.appendChild(li)
})
window.scrollTo(0,document.documentElement.scrollHeight)
@ -82,12 +82,11 @@
var li = document.createElement('li');
var pre = document.createElement('pre');
li.appendChild(pre)
li.style.textAlign="right"
li.style.marginBottom="20px"
pre.innerText=data.msg
pre.style.backgroundColor="lightblue"
pre.style.borderRadius="10px"
pre.style.padding="5px"
li.style.textAlign = "left"
li.style.padding = "10px"
li.style.clear = "both"
pre.innerText = data.msg
pre.style = "background-color: lightblue; border-radius: 10px; padding: 5px; white-space: pre-wrap; word-wrap: break-word; float: right;"
msg_list.appendChild(li)
}
msgbox.value=""
@ -105,12 +104,11 @@
var li = document.createElement('li');
var pre = document.createElement('pre');
li.appendChild(pre)
pre.innerText=response.message
li.style.textAlign="left"
li.style.marginBottom="20px"
pre.style.backgroundColor="lightgreen"
pre.style.borderRadius="10px"
pre.style.padding="5px"
pre.innerText = response.message
li.style.textAlign = "left"
li.style.padding = "10px"
li.style.clear = "both"
pre.style = "background-color: lightgreen; border-radius: 10px; padding: 5px; white-space: pre-wrap; word-wrap: break-word;"
msg_list.appendChild(li)
msg_list.appendChild(document.createElement('br'))
}