feat: Implement custom emojis, pinned comments, and thread locking features with schema updates and client-side logic.

This commit is contained in:
x
2026-01-25 13:48:33 +01:00
parent 3016666ab2
commit 14fa613d77

View File

@@ -448,6 +448,27 @@ class CommentSystem {
});
}
// Lock Thread
const lockBtn = this.container.querySelector('#lock-thread-btn');
if (lockBtn) {
lockBtn.addEventListener('click', async () => {
const action = this.isLocked ? 'unlock' : 'lock';
if (!confirm(`Admin: ${action.toUpperCase()} this thread?`)) return;
try {
const res = await fetch(`/api/comments/${this.itemId}/lock`, { method: 'POST' });
const json = await res.json();
if (json.success) {
this.loadComments();
} else {
alert('Failed to lock/unlock: ' + (json.message || 'Error'));
}
} catch (e) {
alert('Error: ' + e);
}
});
}
// Permalinks
this.container.addEventListener('click', (e) => {
if (e.target.classList.contains('comment-permalink')) {