f17f171f4b
迁移收尾修复:
- heartbeat.js: 移除 export { } 中重复的 startHeartbeat/stopHeartbeat(已通过 export function 导出)
- scripts.blade.php: 移除 JS 注释中的 {{ }} 避免 Blade 编译为 e() 导致 PHP 解析错误
- preferences-status.js: 补全 6 个缺失的 window.* 赋值(toggleBlockMenu/toggleFeatureMenu 等),
实现迁移中丢失的 updateDailyStatus/clearDailyStatus,修复 handleFeatureLocalClear 清屏回调
- toolbar.js: 补全 window.runFeatureShortcut 赋值
头像框样式修复(chat-decorations.css):
- z-index 互换:头像降至 1,框升至 3,使框边缘可遮挡头像外围
- 使用 CSS mask(radial-gradient)挖环形替代旧 ::before 实心圆遮挡方案
- clip-path: circle(50%) 硬裁剪确保圆形,不受 chat.css border-radius: 2px 覆盖
- 特异性提升至 .user-item .avatar-frame-wrapper .user-head
新 Vite 模块(从 Blade 迁移):
- chat-state.js / message-renderer.js / user-list.js / chat-events.js
- composer.js(重写)/ heartbeat.js / admin-commands.js
- vip-presence.js / chat-decorations.css
54 lines
1.7 KiB
JavaScript
54 lines
1.7 KiB
JavaScript
// 聊天室管理菜单事件绑定,替代 input-bar 中的管理类内联 onclick。
|
|
// 管理动作业务逻辑已迁至 admin-commands.js。
|
|
|
|
import "./admin-commands.js";
|
|
|
|
let adminMenuEventsBound = false;
|
|
|
|
/**
|
|
* 绑定管理菜单、管理动作与全屏特效选择事件。
|
|
*/
|
|
export function bindAdminMenuControls() {
|
|
if (adminMenuEventsBound || typeof document === "undefined") {
|
|
return;
|
|
}
|
|
|
|
adminMenuEventsBound = true;
|
|
document.addEventListener("click", (event) => {
|
|
if (!(event.target instanceof Element)) {
|
|
return;
|
|
}
|
|
|
|
const menuToggle = event.target.closest("[data-chat-admin-menu-toggle]");
|
|
if (menuToggle) {
|
|
event.preventDefault();
|
|
window.toggleAdminMenu?.(event);
|
|
return;
|
|
}
|
|
|
|
const adminAction = event.target.closest("[data-chat-admin-action]");
|
|
if (adminAction) {
|
|
event.preventDefault();
|
|
const action = adminAction.getAttribute("data-chat-admin-action") || "";
|
|
if (action && typeof window.runAdminAction === "function") {
|
|
window.runAdminAction(action);
|
|
}
|
|
return;
|
|
}
|
|
|
|
const effectButton = event.target.closest("[data-chat-admin-effect]");
|
|
if (effectButton) {
|
|
event.preventDefault();
|
|
const effect = effectButton.getAttribute("data-chat-admin-effect") || "";
|
|
if (effect && typeof window.selectEffect === "function") {
|
|
window.selectEffect(effect);
|
|
}
|
|
return;
|
|
}
|
|
|
|
if (event.target.closest("[data-chat-admin-menu]")) {
|
|
event.stopPropagation();
|
|
}
|
|
});
|
|
}
|