# HG changeset patch # User Goffi # Date 1620394690 -7200 # Node ID 6a26c8a43d105a79f2f5baca4924176a6c6d3c5a # Parent bfb0d5829728999a259c5a699373fefc1e7f72b1 bulma (chat): fix chat: those change are done to have a minimal chat working, but it's really basic. A full-featured chat should come in a future version. diff -r bfb0d5829728 -r 6a26c8a43d10 sat_templates/templates/bulma/base/base.html --- a/sat_templates/templates/bulma/base/base.html Sat May 01 18:47:35 2021 +0200 +++ b/sat_templates/templates/bulma/base/base.html Fri May 07 15:38:10 2021 +0200 @@ -70,12 +70,22 @@ {% endif %} + {# FIXME: websocket handling is to be replaced by Brython #} + {% if websocket is defined %} + {{ script.include('websocket', '') }} + {% endif %} + {{ script.generate_scripts() }} {% for script in scripts %} {{script.content|safe}} {% endfor %} + {# FIXME: websocket handling is to be replaced by Brython #} + {% if websocket is defined %} + + {% endif %} + {% block favicon %} {% endblock favicon %} diff -r bfb0d5829728 -r 6a26c8a43d10 sat_templates/templates/bulma/chat/chat.html --- a/sat_templates/templates/bulma/chat/chat.html Sat May 01 18:47:35 2021 +0200 +++ b/sat_templates/templates/bulma/chat/chat.html Fri May 07 15:38:10 2021 +0200 @@ -2,19 +2,19 @@ {% if not embedded %}{% extends 'base/base.html' %}{% endif %} {% block title %}{{ target_jid }} - {{ super() }}{% endblock %} {% block body %} -
-
- {% if subject is defined %} -
- {{- subject|urlize(nofollow=true,target='_blank') -}} +
+ {% if subject is defined %} +
+ {{- subject|urlize(nofollow=true,target='_blank') -}} +
+ {% endif %} +
+ {% for msg in messages %} + {% include 'chat/message.html' %} + {% endfor %}
- {% endif %} - {% for msg in messages %} - {% include 'chat/message.html' %} - {% endfor %} +
- -
{% endblock body %} {% block footer %}{% endblock footer %} diff -r bfb0d5829728 -r 6a26c8a43d10 sat_templates/templates/bulma/static/chat.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/templates/bulma/static/chat.css Fri May 07 15:38:10 2021 +0200 @@ -0,0 +1,10 @@ +#chat-panel { + height: calc(100vh - 3.25rem); + padding-top: 1rem; + display: flex; + flex-direction: column; +} + +#messages { + overflow: auto; +} diff -r bfb0d5829728 -r 6a26c8a43d10 sat_templates/templates/default/static/chat.js --- a/sat_templates/templates/default/static/chat.js Sat May 01 18:47:35 2021 +0200 +++ b/sat_templates/templates/default/static/chat.js Fri May 07 15:38:10 2021 +0200 @@ -43,7 +43,7 @@ var mutationCb = function(mutationsList) { scrollPos = messages.scrollTop + messages.clientHeight; - if (messages.lastChild.offsetTop - scrollPos - 10 <= 0) { + if (messages.lastChild.offsetTop - scrollPos - 150 <= 0) { // we auto scroll only if we are at the bottom of the page // else the use is probably checking history // Note thas this doesn't take margin into account,