shoutbox: add standalone shoutbox at /chat

This commit is contained in:
Lephe 2023-06-27 22:35:42 +02:00 committed by Eragon
parent c679f65406
commit 6a34a42081
Signed by: Eragon
GPG Key ID: 087126EBFC725006
8 changed files with 32 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# Register routes here
from app.routes import index, search, users, tools, development
from app.routes import index, search, users, tools, development, chat
from app.routes.account import login, account, notification, polls
from app.routes.admin import index, groups, account, forums, \
attachments, config, members, polls, login_as

16
app/routes/chat.py Normal file
View File

@ -0,0 +1,16 @@
from app import app
from app.utils.render import render
from flask import send_file, url_for
@app.route('/chat')
def chat():
return render('chat.html',
styles=[
'+css/v5shoutbox.css'],
scripts=[
'-scripts/trigger_menu.js',
'-scripts/editor.js'])
@app.route('/v5shoutbox.js')
def v5shoutbox_js():
return send_file('static/scripts/v5shoutbox.js')

View File

@ -0,0 +1 @@
../../../submodules/v5shoutbox/style.css

View File

@ -0,0 +1 @@
../../../submodules/v5shoutbox/v5shoutbox.js

View File

@ -1,4 +1,5 @@
{% for s in scripts %}
<script type="text/javascript" src={{url_for('static', filename=s)}}></script>
{% endfor %}
<script type="text/javascript" src='/v5shoutbox.js'></script>
<script type="module" src={{url_for('static', filename='scripts/emoji-picker-element/index.js')}}></script>

10
app/templates/chat.html Normal file
View File

@ -0,0 +1,10 @@
{% set tabtitle = "Shoutbox" %}
<!DOCTYPE html>
<html lang="fr-FR">
{% include "base/head.html" with context %}
<body>
{% include "widgets/v5shoutbox.html" %}
{% include "base/scripts.html" %}
</body>
</html>

View File

@ -0,0 +1 @@
../../../submodules/v5shoutbox/widget.html

@ -1 +1 @@
Subproject commit 203b1288e4dea747aa2b996839459c92fd4cddd4
Subproject commit d7e929000f039488f42385912c98be88b4a63fcf