From 41ac99cd5ca4dbbda630f2e5c6240ada0679e488 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Thu, 16 Jul 2026 06:24:55 +0200 Subject: [PATCH] fdsfdsa --- migrations/add_emoji_favorites.sql | 10 ++++++++++ public/s/css/f0ckm.css | 4 ++-- public/s/js/comments.js | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 migrations/add_emoji_favorites.sql diff --git a/migrations/add_emoji_favorites.sql b/migrations/add_emoji_favorites.sql new file mode 100644 index 0000000..caa40eb --- /dev/null +++ b/migrations/add_emoji_favorites.sql @@ -0,0 +1,10 @@ +-- User emoji favorites — persisted per-user, cross-device +CREATE TABLE IF NOT EXISTS user_emoji_favorites ( + user_id integer NOT NULL REFERENCES "user"(id) ON DELETE CASCADE, + emoji_name text NOT NULL, + emoji_url text NOT NULL, + created_at timestamptz NOT NULL DEFAULT now(), + PRIMARY KEY (user_id, emoji_name) +); + +CREATE INDEX IF NOT EXISTS idx_user_emoji_favorites_user_id ON user_emoji_favorites (user_id); diff --git a/public/s/css/f0ckm.css b/public/s/css/f0ckm.css index e9ee226..931a61a 100644 --- a/public/s/css/f0ckm.css +++ b/public/s/css/f0ckm.css @@ -9268,12 +9268,12 @@ body.layout-legacy .comment-content img.emoji { } .comment-highlighted { - border-left: 3px solid var(--accent) !important; + box-shadow: inset 3px 0px 0px var(--accent) !important; background: var(--bg) !important; } .anchor-target { - border-left: 3px solid var(--accent) !important; + box-shadow: inset 3px 0px 0px var(--accent) !important; background: rgba(17, 17, 17, 0.55) !important; padding-left: 5px; } diff --git a/public/s/js/comments.js b/public/s/js/comments.js index 61acf32..ebee305 100644 --- a/public/s/js/comments.js +++ b/public/s/js/comments.js @@ -1022,6 +1022,25 @@ class CommentSystem { document.body.appendChild(preview); CommentSystem.playEmojiVideos(preview); + // If the emoji cache isn't ready yet but this preview contains :emoji: shortcodes, + // trigger a load and re-render just the preview's content once the cache arrives. + const previewContentEl = preview.querySelector('.comment-content'); + if (previewContentEl && !CommentSystem.emojiCache && /:([a-z0-9_]+):/.test(previewContentEl.textContent)) { + const rerender = () => { + if (!document.body.contains(preview)) return; + const raw = previewContentEl.dataset.raw; + if (raw) { + previewContentEl.innerHTML = this.renderCommentContent(raw); + CommentSystem.playEmojiVideos(previewContentEl); + } + }; + if (!CommentSystem.loadingEmojis) { + this.loadEmojis(true).then(rerender); + } else { + window.addEventListener('f0ck:emojis_ready', rerender, { once: true }); + } + } + const previewRect = preview.getBoundingClientRect(); // Boundary checks