Sửa lỗi đăng nhập vào admin mà không reload được page do lỗi tạo scene trước đó, sử dụng lệnh resetDB.js để khởi tạo lại, xóa các scene trước và ảnh đã upload
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
let activeViewer = null;
|
||||
let currentHotspots = [];
|
||||
let securityApplied = false;
|
||||
|
||||
/**
|
||||
* Initializes and shows the Pannellum 360° panorama viewer with security overlays.
|
||||
@@ -72,6 +73,9 @@ function closeViewer() {
|
||||
* Appends event listeners to block right-clicks and common image saving shortcuts.
|
||||
*/
|
||||
function applyViewerSecurity() {
|
||||
if (securityApplied) return; // Chỉ gán sự kiện một lần duy nhất
|
||||
securityApplied = true;
|
||||
|
||||
// Target the actual viewer element where Pannellum renders
|
||||
const container = document.getElementById('viewer-container');
|
||||
const panoramaViewer = document.getElementById('panorama-viewer');
|
||||
@@ -114,18 +118,16 @@ function applyViewerSecurity() {
|
||||
});
|
||||
}
|
||||
|
||||
// Global safety shortcut listeners (F12, Ctrl+S, Ctrl+U, Ctrl+Shift+I)
|
||||
// Global safety shortcut listeners (Ctrl+S, Ctrl+U) - Tạm thời cho phép F12 và Ctrl+Shift+I để debug
|
||||
document.addEventListener('keydown', (e) => {
|
||||
// Only enforce when viewer is active
|
||||
if (document.getElementById('viewer-container').style.display === 'block') {
|
||||
const isCtrlS = e.ctrlKey && (e.key === 's' || e.key === 'S');
|
||||
const isCtrlU = e.ctrlKey && (e.key === 'u' || e.key === 'U');
|
||||
const isF12 = e.key === 'F12';
|
||||
const isCtrlShiftI = e.ctrlKey && e.shiftKey && (e.key === 'i' || e.key === 'I');
|
||||
|
||||
if (isCtrlS || isCtrlU || isF12 || isCtrlShiftI) {
|
||||
if (isCtrlS || isCtrlU) {
|
||||
e.preventDefault();
|
||||
alert('Security Alert: Inspection and saving functions are restricted on this viewer.');
|
||||
console.warn('Security Alert: Inspection and saving functions are restricted.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user