feature: watches on the backend, need frontend implementation for

notifications and unread indicators
This commit is contained in:
Andy Burke 2025-10-25 14:57:28 -07:00
parent 7046bb0389
commit 6293374bb7
28 changed files with 1405 additions and 608 deletions

View file

@ -12,6 +12,15 @@ const reactions_popup_styling = `
border: 1px solid var(--border-normal);
padding: 0.5rem;
text-align: center;
visibility: hidden;
display: none;
opacity: 0;
}
#reactionspopup[data-shown] {
visibility: visible;
display: block;
opacity: 1;
}
#reactionspopup .icon.close {
@ -103,10 +112,7 @@ function open_reactions_popup(event) {
reactions_popup.style.left = position.x + "px";
reactions_popup.style.top = position.y + "px";
reactions_popup.style.visibility = "visible";
reactions_popup.style.opacity = "1";
reactions_popup.style.display = "block";
reactions_popup.dataset.shown = true;
reactions_popup_search_input.focus();
}
@ -115,9 +121,7 @@ function clear_reactions_popup() {
return;
}
reactions_popup.style.visibility = "hidden";
reactions_popup.style.opacity = "0";
reactions_popup.style.display = "none";
delete reactions_popup.dataset.shown;
}
document.addEventListener("DOMContentLoaded", () => {
@ -160,7 +164,7 @@ document.addEventListener("DOMContentLoaded", () => {
<input
type="hidden"
name="creator_id"
generator="() => { return JSON.parse( document.body.dataset.user ?? '{}' ).id; }"
generator="() => { return APP.user?.id; }"
/>
<input
@ -194,7 +198,7 @@ document.addEventListener("DOMContentLoaded", () => {
document.body.appendChild(reactions_popup);
reactions_popup_form = document.getElementById("reactions-selection-form");
document.addEventListener("topic_changed", ({ detail: { topic_id } }) => {
APP.on("topic_changed", ({ topic_id }) => {
const reaction_topic_id = topic_id ?? document.body.dataset.topic;
reactions_popup_form.action = reaction_topic_id
? `/api/topics/${reaction_topic_id}/events`