迁移前台基础页面脚本

This commit is contained in:
2026-04-25 13:43:55 +08:00
parent 4d337a2e8f
commit 19e50944d9
6 changed files with 141 additions and 71 deletions
+3 -23
View File
@@ -106,7 +106,7 @@
转让
</button>
<form action="{{ route('rooms.destroy', $room->id) }}" method="POST" class="inline"
onsubmit="return confirm('警告:确实要彻底解散「{{ $room->name }}」吗?此操作不可逆!');">
data-front-confirm="警告:确实要彻底解散「{{ $room->name }}」吗?此操作不可逆!">
@csrf @method('delete')
<button type="submit"
class="text-xs text-red-600 hover:text-red-800 font-semibold px-2 py-1 rounded hover:bg-red-50 transition">解散</button>
@@ -117,7 +117,8 @@
{{-- 进入按钮 --}}
<a href="#"
onclick="openChatRoom('{{ route('chat.room', $room->id) }}', '{{ $room->name }}'); return false;"
data-chat-room-window-url="{{ route('chat.room', $room->id) }}"
data-chat-room-window-name="{{ $room->name }}"
class="bg-indigo-600 text-white hover:bg-indigo-700 px-4 py-2 rounded-t-xl rounded-br-xl text-sm font-bold shadow-md hover:shadow-lg transition-all transform group-hover:-translate-y-0.5">
立刻进入 &rarr;
</a>
@@ -417,24 +418,3 @@
</div>
</div>
@endsection
@section('scripts')
{{-- 原版风格:弹出独立聊天窗口 --}}
<script>
/**
* 打开聊天室弹出窗口(复刻原版 DEFAULT.asp launchchat 函数)
*/
function openChatRoom(url, roomName) {
var chatWin = window.open(
url,
'chatroom_' + roomName,
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes'
);
if (chatWin) {
chatWin.moveTo(0, 0);
chatWin.resizeTo(screen.availWidth, screen.availHeight);
chatWin.focus();
}
}
</script>
@endsection