From 54faf8b50143b91b39453ea3f256db7da8f6a733 Mon Sep 17 00:00:00 2001 From: lkddi Date: Sat, 25 Apr 2026 04:00:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E8=81=8A=E5=A4=A9=E5=AE=A4?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=85=A5=E5=8F=A3=E8=AF=B4=E6=98=8E=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/js/chat-room.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/js/chat-room.js b/resources/js/chat-room.js index ccbc1b6..dc759fe 100644 --- a/resources/js/chat-room.js +++ b/resources/js/chat-room.js @@ -1,5 +1,6 @@ // 聊天室 Vite 入口,集中导出从 Blade 内联脚本迁移出的纯前端工具。 +// 统一转发各子模块导出,方便测试或后续模块继续复用同一组工具。 export { escapeHtml, escapeHtmlWithLineBreaks } from "./chat-room/html.js"; export { bindGlobalDialogControls } from "./chat-room/dialog.js"; export { applyFontSize, bindChatFontSizeControl, CHAT_FONT_SIZE_STORAGE_KEY, restoreChatFontSize } from "./chat-room/font-size.js"; @@ -69,6 +70,7 @@ import { import { createMessageQueue } from "./chat-room/message-queue.js"; if (typeof window !== "undefined") { + // 保留聚合入口,给仍在 Blade 内的存量脚本按需读取已迁移工具。 window.ChatRoomTools = { escapeHtml, escapeHtmlWithLineBreaks, @@ -111,12 +113,15 @@ if (typeof window !== "undefined") { createMessageQueue, }; + // 兼容存量 Blade 调用点,避免一次性重构所有 window.* 入口。 window.closeChatImageLightbox = closeChatImageLightbox; window.openChatImageLightbox = openChatImageLightbox; window.closeFriendPanel = closeFriendPanel; window.friendSearch = friendSearch; window.openFriendPanel = openFriendPanel; window.applyFontSize = applyFontSize; + + // 页面加载后立即注册事件委托,具体业务逻辑仍由各子模块负责。 bindGlobalDialogControls(); bindChatFontSizeControl(); bindChatImageUploadControl();