add: custom emojis

fix: don't show reposts of posts from blocked users
fix: don't show questions when they're from users you've blocked
This commit is contained in:
trisua 2025-05-10 21:58:02 -04:00
parent 9f187039e6
commit 275dd0a1eb
25 changed files with 697 additions and 61 deletions

View file

@ -179,6 +179,9 @@ and show_community and community.id != config.town_square or question %}
<div
class="card flex flex-col gap-2 {% if secondary %}secondary{% endif %}"
id="post:{{ post.id }}"
data-community="{{ post.community }}"
data-ownsup="{{ owner.permissions|has_supporter }}"
hook="verify_emojis"
>
<div class="w-full flex gap-2">
<a href="/@{{ owner.username }}">
@ -1202,6 +1205,17 @@ show_kick=false, secondary=false) -%}
></emoji-picker>
<script>
setTimeout(async () => {
document.querySelector("emoji-picker").customEmoji =
await trigger("me::emojis");
const style = document.createElement("style");
style.textContent = `.custom-emoji { border-radius: 4px !important; } .category { font-weight: 600; }`;
document
.querySelector("emoji-picker")
.shadowRoot.appendChild(style);
}, 150);
document
.querySelector("emoji-picker")
.addEventListener("emoji-click", async (event) => {
@ -1214,14 +1228,20 @@ show_kick=false, secondary=false) -%}
return;
}
document.getElementById(
window.EMOJI_PICKER_TEXT_ID,
).value += ` :${await (
await fetch("/api/v1/lookup_emoji", {
method: "POST",
body: event.detail.unicode,
})
).text()}:`;
if (event.detail.unicode) {
document.getElementById(
window.EMOJI_PICKER_TEXT_ID,
).value += ` :${await (
await fetch("/api/v1/lookup_emoji", {
method: "POST",
body: event.detail.unicode,
})
).text()}:`;
} else {
document.getElementById(
window.EMOJI_PICKER_TEXT_ID,
).value += ` :${event.detail.emoji.shortcodes[0]}:`;
}
document.getElementById("emoji_dialog").close();
});