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

130 lines
5.0 KiB
JavaScript

// 聊天室 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";
export { bindChatImageUploadControl } from "./chat-room/image-upload.js";
export { bindFriendPanelControls, closeFriendPanel, friendSearch, loadFriends, openFriendPanel } from "./chat-room/friend-panel.js";
export { closeChatImageLightbox, initChatImageLightboxEvents, openChatImageLightbox } from "./chat-room/lightbox.js";
export { bindMobileDrawerControls } from "./chat-room/mobile-drawer.js";
export { bindToolbarControls } from "./chat-room/toolbar.js";
export { bindWelcomeMenuControls } from "./chat-room/welcome-menu.js";
export {
BLOCKABLE_SYSTEM_SENDERS,
BLOCKED_SYSTEM_SENDERS_STORAGE_KEY,
CHAT_SOUND_MUTED_STORAGE_KEY,
bindBlockMenuControls,
bindSoundMuteControl,
isSoundMuted,
loadBlockedSystemSenders,
normalizeChatPreferences,
normalizeDailyStatus,
parseDailyStatusExpiry,
persistBlockedSystemSenders,
setSoundMuted,
shouldMigrateLocalChatPreferences,
} from "./chat-room/preferences-status.js";
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";
import { bindGlobalDialogControls } from "./chat-room/dialog.js";
import { applyFontSize, bindChatFontSizeControl, CHAT_FONT_SIZE_STORAGE_KEY, restoreChatFontSize } from "./chat-room/font-size.js";
import { bindChatImageUploadControl } from "./chat-room/image-upload.js";
import { bindFriendPanelControls, closeFriendPanel, friendSearch, loadFriends, openFriendPanel } from "./chat-room/friend-panel.js";
import { closeChatImageLightbox, initChatImageLightboxEvents, openChatImageLightbox } from "./chat-room/lightbox.js";
import { bindMobileDrawerControls } from "./chat-room/mobile-drawer.js";
import { bindToolbarControls } from "./chat-room/toolbar.js";
import { bindWelcomeMenuControls } from "./chat-room/welcome-menu.js";
import {
BLOCKABLE_SYSTEM_SENDERS,
BLOCKED_SYSTEM_SENDERS_STORAGE_KEY,
CHAT_SOUND_MUTED_STORAGE_KEY,
bindBlockMenuControls,
bindSoundMuteControl,
isSoundMuted,
loadBlockedSystemSenders,
normalizeChatPreferences,
normalizeDailyStatus,
parseDailyStatusExpiry,
persistBlockedSystemSenders,
setSoundMuted,
shouldMigrateLocalChatPreferences,
} from "./chat-room/preferences-status.js";
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,
bindGlobalDialogControls,
applyFontSize,
bindChatFontSizeControl,
bindChatImageUploadControl,
bindFriendPanelControls,
closeFriendPanel,
friendSearch,
loadFriends,
openFriendPanel,
bindMobileDrawerControls,
bindToolbarControls,
bindWelcomeMenuControls,
CHAT_FONT_SIZE_STORAGE_KEY,
restoreChatFontSize,
closeChatImageLightbox,
initChatImageLightboxEvents,
openChatImageLightbox,
BLOCKABLE_SYSTEM_SENDERS,
BLOCKED_SYSTEM_SENDERS_STORAGE_KEY,
CHAT_SOUND_MUTED_STORAGE_KEY,
bindBlockMenuControls,
bindSoundMuteControl,
isSoundMuted,
loadBlockedSystemSenders,
normalizeChatPreferences,
normalizeDailyStatus,
parseDailyStatusExpiry,
persistBlockedSystemSenders,
setSoundMuted,
shouldMigrateLocalChatPreferences,
bindChatRightPanelControls,
normalizeRoomStatus,
renderRoomStatusRow,
renderRoomsOnlineStatus,
renderRoomsOnlineStatusToContainer,
resolveRoomUrl,
createMessageQueue,
};
window.closeChatImageLightbox = closeChatImageLightbox;
window.openChatImageLightbox = openChatImageLightbox;
window.closeFriendPanel = closeFriendPanel;
window.friendSearch = friendSearch;
window.openFriendPanel = openFriendPanel;
window.applyFontSize = applyFontSize;
bindGlobalDialogControls();
bindChatFontSizeControl();
bindChatImageUploadControl();
bindFriendPanelControls();
bindToolbarControls();
bindChatRightPanelControls();
bindMobileDrawerControls();
bindWelcomeMenuControls();
bindBlockMenuControls();
}