Load shoutbox UI scripts only when the shoutbox is displayed

This commit is contained in:
Eragon 2024-03-09 12:51:49 +01:00
parent 0b524f19b7
commit e41bfaddff
Signed by: Eragon
GPG Key ID: 087126EBFC725006
2 changed files with 6 additions and 3 deletions

View File

@ -5,7 +5,12 @@ from app.utils.render import render
@app.route('/')
def index():
return render('index.html', styles=["+css/homepage.css"])
return render('index.html',
styles=["+css/homepage.css"],
scripts=[
"+scripts/v5shoutbox_ui.js",
"+scripts/v5shoutbox.js"
])
@app.errorhandler(404)

View File

@ -33,8 +33,6 @@ def render(*args, styles=[], scripts=[], modules=[], **kwargs):
'scripts/tag_selector.js',
'scripts/editor.js',
'scripts/v5shoutbox_irc.js',
'scripts/v5shoutbox_ui.js',
'scripts/v5shoutbox.js',
]
modules_ = [
'scripts/emoji-picker-element/index.js',