add reddit embeds to chat

master
Aevann 2024-08-11 00:06:45 +03:00
parent 3b5d9ee12f
commit e89c85aa41
3 changed files with 6 additions and 0 deletions

View File

@ -123,6 +123,8 @@ socket.on('speak', function(json) {
}
}
scrolled_down()
let line = document.getElementsByClassName('chat-line')[0].cloneNode(true)
register_new_elements(line);
bs_trigger(line)
@ -144,6 +146,8 @@ socket.on('speak', function(json) {
if (scrolled_down() && document.getElementsByClassName('chat-message').length > 250)
document.getElementById('chat-window').firstElementChild.remove()
embed_reddit()
})
function send() {

View File

@ -123,4 +123,5 @@
{% else %}
<script defer src="{{'js/vendor/twitter.js' | asset}}"></script>
{% endif %}
<script defer src="{{'js/vendor/reddit.js' | asset}}"></script>
{% endblock %}

View File

@ -134,4 +134,5 @@
{% else %}
<script defer src="{{'js/vendor/twitter.js' | asset}}"></script>
{% endif %}
<script defer src="{{'js/vendor/reddit.js' | asset}}"></script>
{% endblock %}