localstorage for emojis

This commit is contained in:
Aevann1 2021-12-10 02:39:39 +02:00
parent d7b9b1686a
commit 2f02940ab3
7 changed files with 45 additions and 27 deletions

View file

@ -22,14 +22,6 @@ def post_embed(id, v):
return render_template("submission_listing.html", listing=[p], v=v)
@app.template_filter("favorite_emojis")
def favorite_emojis(x):
str = ""
emojis = sorted(x.items(), key=lambda x: x[1], reverse=True)[:25]
for k, v in emojis:
str += f'<button class="btn m-1 px-0 emoji2" onclick="getEmoji(\'{k}\')" data-bs-toggle="tooltip" title=":{k}:" delay:="0"><img loading="lazy" width=50 src="/assets/images/emojis/{k}.webp" alt="{k}-emoji"></button>'
return str
@app.context_processor
def inject_constants():
constants = [c for c in dir(const) if not c.startswith("_")]