补充聊天室前端入口说明注释

This commit is contained in:
2026-04-25 04:00:38 +08:00
parent be22710424
commit 54faf8b501
+5
View File
@@ -1,5 +1,6 @@
// 聊天室 Vite 入口,集中导出从 Blade 内联脚本迁移出的纯前端工具。 // 聊天室 Vite 入口,集中导出从 Blade 内联脚本迁移出的纯前端工具。
// 统一转发各子模块导出,方便测试或后续模块继续复用同一组工具。
export { escapeHtml, escapeHtmlWithLineBreaks } from "./chat-room/html.js"; export { escapeHtml, escapeHtmlWithLineBreaks } from "./chat-room/html.js";
export { bindGlobalDialogControls } from "./chat-room/dialog.js"; export { bindGlobalDialogControls } from "./chat-room/dialog.js";
export { applyFontSize, bindChatFontSizeControl, CHAT_FONT_SIZE_STORAGE_KEY, restoreChatFontSize } from "./chat-room/font-size.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"; import { createMessageQueue } from "./chat-room/message-queue.js";
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
// 保留聚合入口,给仍在 Blade 内的存量脚本按需读取已迁移工具。
window.ChatRoomTools = { window.ChatRoomTools = {
escapeHtml, escapeHtml,
escapeHtmlWithLineBreaks, escapeHtmlWithLineBreaks,
@@ -111,12 +113,15 @@ if (typeof window !== "undefined") {
createMessageQueue, createMessageQueue,
}; };
// 兼容存量 Blade 调用点,避免一次性重构所有 window.* 入口。
window.closeChatImageLightbox = closeChatImageLightbox; window.closeChatImageLightbox = closeChatImageLightbox;
window.openChatImageLightbox = openChatImageLightbox; window.openChatImageLightbox = openChatImageLightbox;
window.closeFriendPanel = closeFriendPanel; window.closeFriendPanel = closeFriendPanel;
window.friendSearch = friendSearch; window.friendSearch = friendSearch;
window.openFriendPanel = openFriendPanel; window.openFriendPanel = openFriendPanel;
window.applyFontSize = applyFontSize; window.applyFontSize = applyFontSize;
// 页面加载后立即注册事件委托,具体业务逻辑仍由各子模块负责。
bindGlobalDialogControls(); bindGlobalDialogControls();
bindChatFontSizeControl(); bindChatFontSizeControl();
bindChatImageUploadControl(); bindChatImageUploadControl();