diff options
| author | Bobby <[email protected]> | 2023-05-15 07:30:20 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-05-15 07:30:20 -0400 |
| commit | 394d74b553360a82f803a34205a8df609777fdff (patch) | |
| tree | 8e78eb5214a47eb5fa46d7400cea192ed6b3aa94 /templates | |
| parent | 4cbc1c64b3f5f7bc6f6f9744dd09828d7e79d65d (diff) | |
| download | thatcomputerscientist-394d74b553360a82f803a34205a8df609777fdff.tar.xz thatcomputerscientist-394d74b553360a82f803a34205a8df609777fdff.zip | |
Simple working live chat
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/blog/home.html | 16 |
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 %} |
