aboutsummaryrefslogtreecommitdiff
path: root/templates/blog
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-05-15 07:30:20 -0400
committerBobby <[email protected]>2023-05-15 07:30:20 -0400
commit394d74b553360a82f803a34205a8df609777fdff (patch)
tree8e78eb5214a47eb5fa46d7400cea192ed6b3aa94 /templates/blog
parent4cbc1c64b3f5f7bc6f6f9744dd09828d7e79d65d (diff)
downloadthatcomputerscientist-394d74b553360a82f803a34205a8df609777fdff.tar.xz
thatcomputerscientist-394d74b553360a82f803a34205a8df609777fdff.zip
Simple working live chat
Diffstat (limited to 'templates/blog')
-rw-r--r--templates/blog/home.html16
1 files changed, 1 insertions, 15 deletions
diff --git a/templates/blog/home.html b/templates/blog/home.html
index 4bb5c003..3fa8c524 100644
--- a/templates/blog/home.html
+++ b/templates/blog/home.html
@@ -59,21 +59,7 @@
{% include 'blog/partials/mathjax.html' %}
<script type="text/javascript">
var username = "{{ user.username }}" ? "{{ user.username }}" : "Anonymous";
- $(document).ready(function() {
- $('#chatbox-input').on('keyup', function(e) {
- if (e.keyCode === 13) {
- var msg = $('#chatbox-input').val();
- if (msg.trim().length > 0) {
- var message = document.createElement("div");
- message.className = "message";
- message.innerHTML = "<b>" + username + "</b>: " + msg;
- $('#messages').append(message);
- $('#messages').animate({scrollTop: $('#messages').prop("scrollHeight")}, 100);
- }
- $('#chatbox-input').val("");
- }
- });
- });
</script>
+<script src="{% static 'js/chat.js' %}"></script>
{% endblock %}