From 54ab93ea7b22e7c82ad8f4fa6833739fc6af30bb Mon Sep 17 00:00:00 2001 From: nyne Date: Fri, 4 Jul 2025 15:24:23 +0800 Subject: [PATCH] Support comment reply. --- frontend/src/app.ts | 3 + frontend/src/components/comment_input.tsx | 12 +- frontend/src/components/comment_tile.tsx | 95 +++++++++------ frontend/src/i18n.ts | 25 +++- frontend/src/markdown.css | 4 +- frontend/src/network/network.ts | 11 ++ frontend/src/pages/comment_page.tsx | 136 ++++++++++++++++++---- frontend/src/pages/edit_resource_page.tsx | 2 +- frontend/src/pages/publish_page.tsx | 2 +- server/service/comment.go | 33 +++--- server/utils/storage.go | 12 +- 11 files changed, 243 insertions(+), 92 deletions(-) diff --git a/frontend/src/app.ts b/frontend/src/app.ts index 4699c17..9237f1a 100644 --- a/frontend/src/app.ts +++ b/frontend/src/app.ts @@ -33,6 +33,9 @@ class App { this.appName = (window as MyWindow).serverName || this.appName; this.cloudflareTurnstileSiteKey = (window as MyWindow).cloudflareTurnstileSiteKey || null; + if (this.cloudflareTurnstileSiteKey === "{{CFTurnstileSiteKey}}") { + this.cloudflareTurnstileSiteKey = null; // Placeholder value, set to null if not configured + } this.siteInfo = (window as MyWindow).siteInfo || ""; } diff --git a/frontend/src/components/comment_input.tsx b/frontend/src/components/comment_input.tsx index 3f0aa54..f14438f 100644 --- a/frontend/src/components/comment_input.tsx +++ b/frontend/src/components/comment_input.tsx @@ -27,8 +27,8 @@ export function CommentInput({ if (textareaRef.current) { textareaRef.current.style.height = 'auto'; let height = textareaRef.current.scrollHeight; - if (height < 144) { - height = 144; // Minimum height of 144px (h-36) + if (height < 128) { + height = 128; } textareaRef.current.style.height = `${height}px`; } @@ -37,7 +37,7 @@ export function CommentInput({ // Reset textarea height to default const resetTextareaHeight = () => { if (textareaRef.current) { - textareaRef.current.style.height = '144px'; // h-36 = 144px + textareaRef.current.style.height = '128px'; } }; @@ -158,13 +158,13 @@ export function CommentInput({