Files
chatroom/resources/js/chat-room.js
T

111 lines
4.0 KiB
JavaScript
Raw Normal View History

// 聊天室 Vite 入口,集中导出从 Blade 内联脚本迁移出的纯前端工具。
export { escapeHtml, escapeHtmlWithLineBreaks } from "./chat-room/html.js";
2026-04-25 03:40:30 +08:00
export { applyFontSize, bindChatFontSizeControl, CHAT_FONT_SIZE_STORAGE_KEY, restoreChatFontSize } from "./chat-room/font-size.js";
2026-04-25 03:41:45 +08:00
export { bindChatImageUploadControl } from "./chat-room/image-upload.js";
2026-04-25 03:36:30 +08:00
export { closeChatImageLightbox, initChatImageLightboxEvents, openChatImageLightbox } from "./chat-room/lightbox.js";
2026-04-25 03:44:04 +08:00
export { bindMobileDrawerControls } from "./chat-room/mobile-drawer.js";
2026-04-25 03:49:13 +08:00
export { bindWelcomeMenuControls } from "./chat-room/welcome-menu.js";
export {
BLOCKABLE_SYSTEM_SENDERS,
BLOCKED_SYSTEM_SENDERS_STORAGE_KEY,
CHAT_SOUND_MUTED_STORAGE_KEY,
2026-04-25 03:45:30 +08:00
bindBlockMenuControls,
2026-04-25 03:39:31 +08:00
bindSoundMuteControl,
2026-04-25 03:38:27 +08:00
isSoundMuted,
loadBlockedSystemSenders,
normalizeChatPreferences,
normalizeDailyStatus,
parseDailyStatusExpiry,
2026-04-25 03:38:27 +08:00
persistBlockedSystemSenders,
setSoundMuted,
shouldMigrateLocalChatPreferences,
} from "./chat-room/preferences-status.js";
2026-04-25 03:42:54 +08:00
export { bindChatRightPanelControls } from "./chat-room/right-panel.js";
export {
normalizeRoomStatus,
renderRoomStatusRow,
renderRoomsOnlineStatus,
renderRoomsOnlineStatusToContainer,
resolveRoomUrl,
} from "./chat-room/rooms.js";
export { createMessageQueue } from "./chat-room/message-queue.js";
import { escapeHtml, escapeHtmlWithLineBreaks } from "./chat-room/html.js";
2026-04-25 03:40:30 +08:00
import { applyFontSize, bindChatFontSizeControl, CHAT_FONT_SIZE_STORAGE_KEY, restoreChatFontSize } from "./chat-room/font-size.js";
2026-04-25 03:41:45 +08:00
import { bindChatImageUploadControl } from "./chat-room/image-upload.js";
2026-04-25 03:36:30 +08:00
import { closeChatImageLightbox, initChatImageLightboxEvents, openChatImageLightbox } from "./chat-room/lightbox.js";
2026-04-25 03:44:04 +08:00
import { bindMobileDrawerControls } from "./chat-room/mobile-drawer.js";
2026-04-25 03:49:13 +08:00
import { bindWelcomeMenuControls } from "./chat-room/welcome-menu.js";
import {
BLOCKABLE_SYSTEM_SENDERS,
BLOCKED_SYSTEM_SENDERS_STORAGE_KEY,
CHAT_SOUND_MUTED_STORAGE_KEY,
2026-04-25 03:45:30 +08:00
bindBlockMenuControls,
2026-04-25 03:39:31 +08:00
bindSoundMuteControl,
2026-04-25 03:38:27 +08:00
isSoundMuted,
loadBlockedSystemSenders,
normalizeChatPreferences,
normalizeDailyStatus,
parseDailyStatusExpiry,
2026-04-25 03:38:27 +08:00
persistBlockedSystemSenders,
setSoundMuted,
shouldMigrateLocalChatPreferences,
} from "./chat-room/preferences-status.js";
2026-04-25 03:42:54 +08:00
import { bindChatRightPanelControls } from "./chat-room/right-panel.js";
import {
normalizeRoomStatus,
renderRoomStatusRow,
renderRoomsOnlineStatus,
renderRoomsOnlineStatusToContainer,
resolveRoomUrl,
} from "./chat-room/rooms.js";
import { createMessageQueue } from "./chat-room/message-queue.js";
if (typeof window !== "undefined") {
window.ChatRoomTools = {
escapeHtml,
escapeHtmlWithLineBreaks,
applyFontSize,
2026-04-25 03:40:30 +08:00
bindChatFontSizeControl,
2026-04-25 03:41:45 +08:00
bindChatImageUploadControl,
2026-04-25 03:44:04 +08:00
bindMobileDrawerControls,
2026-04-25 03:49:13 +08:00
bindWelcomeMenuControls,
CHAT_FONT_SIZE_STORAGE_KEY,
restoreChatFontSize,
closeChatImageLightbox,
2026-04-25 03:36:30 +08:00
initChatImageLightboxEvents,
openChatImageLightbox,
BLOCKABLE_SYSTEM_SENDERS,
BLOCKED_SYSTEM_SENDERS_STORAGE_KEY,
CHAT_SOUND_MUTED_STORAGE_KEY,
2026-04-25 03:45:30 +08:00
bindBlockMenuControls,
2026-04-25 03:39:31 +08:00
bindSoundMuteControl,
2026-04-25 03:38:27 +08:00
isSoundMuted,
loadBlockedSystemSenders,
normalizeChatPreferences,
normalizeDailyStatus,
parseDailyStatusExpiry,
2026-04-25 03:38:27 +08:00
persistBlockedSystemSenders,
setSoundMuted,
shouldMigrateLocalChatPreferences,
2026-04-25 03:42:54 +08:00
bindChatRightPanelControls,
normalizeRoomStatus,
renderRoomStatusRow,
renderRoomsOnlineStatus,
renderRoomsOnlineStatusToContainer,
resolveRoomUrl,
createMessageQueue,
};
window.closeChatImageLightbox = closeChatImageLightbox;
window.openChatImageLightbox = openChatImageLightbox;
window.applyFontSize = applyFontSize;
2026-04-25 03:40:30 +08:00
bindChatFontSizeControl();
2026-04-25 03:41:45 +08:00
bindChatImageUploadControl();
2026-04-25 03:42:54 +08:00
bindChatRightPanelControls();
2026-04-25 03:44:04 +08:00
bindMobileDrawerControls();
2026-04-25 03:49:13 +08:00
bindWelcomeMenuControls();
2026-04-25 03:45:30 +08:00
bindBlockMenuControls();
}