feat: Implement custom emojis, pinned comments, and thread locking features with schema updates and client-side logic.
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user