change function name in dms
"postMessage" -> "postMsg"
This commit is contained in:
parent
685f7de37c
commit
5e425c0fbc
13
js/dms.js
13
js/dms.js
@ -57,7 +57,18 @@ function set_keys(s_key) {
|
|||||||
main()
|
main()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function postMessage(elem) {
|
let last_called_postMsg = Date.now()
|
||||||
|
|
||||||
|
/*
|
||||||
|
previously called postMessage
|
||||||
|
*/
|
||||||
|
async function postMsg() {
|
||||||
|
if((Date.now() - last_called_postMsg) < 100) {
|
||||||
|
createModal("slow down there")
|
||||||
|
debugger;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
last_called_postMsg = Date.now()
|
||||||
let len = document.getElementById("post-text").value.length
|
let len = document.getElementById("post-text").value.length
|
||||||
if(len >= 1001) {
|
if(len >= 1001) {
|
||||||
alert(`Your message cant contain more than 1000 characters! (${len})`)
|
alert(`Your message cant contain more than 1000 characters! (${len})`)
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<span id="reply" style="display:none;" class="noselect">Replying to: <b id="reply_username"></b> <small id="reply_text"></small> <button onclick="unreply()" style="color:red">X</button></span> <br>
|
<span id="reply" style="display:none;" class="noselect">Replying to: <b id="reply_username"></b> <small id="reply_text"></small> <button onclick="unreply()" style="color:red">X</button></span> <br>
|
||||||
<textarea name="name" id="post-text" rows="8" cols="80"></textarea>
|
<textarea name="name" id="post-text" rows="8" cols="80"></textarea>
|
||||||
<br>
|
<br>
|
||||||
<button type="button" name="button" id="post-btn" onclick="postMessage(this)">Post</button>
|
<button type="button" name="button" id="post-btn" onclick="postMsg()">Post</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="channelTab">
|
<div class="channelTab">
|
||||||
<input type="text" name="Username_input" id="Username_input" placeholder="Username" class="channel" style="font-size: 16px;" onkeypress="clickPress(event)"> <br>
|
<input type="text" name="Username_input" id="Username_input" placeholder="Username" class="channel" style="font-size: 16px;" onkeypress="clickPress(event)"> <br>
|
||||||
@ -45,6 +45,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="posts" id="posts"></div>
|
<div class="posts" id="posts"></div>
|
||||||
</div>
|
</div>
|
||||||
<script><%- loadfile("./js/dms.js") %></script>
|
<script>
|
||||||
|
<%- loadfile("./js/dms.js") %>
|
||||||
|
<%- loadfile("./js/modal.js") %>
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user