16 changed files with 483 additions and 244 deletions
-
2files.list
-
46lib/controller/getDashBoardItems.php
-
127lib/controller/getReportLayout.php
-
15lib/controller/settings/node_1.js
-
13lib/controller/settings/node_2.js
-
8lib/javascript/jsapi_dynamic/mojo_dashboard.js
-
8lib/javascript/jsapi_dynamic/mojo_global_vars.js
-
22lib/javascript/jsapi_dynamic/mojo_main.js
-
9lib/javascript/jsapi_dynamic/mojo_reports.js
-
44lib/javascript/jsapi_dynamic/mojo_settings.js
-
378lib/javascript/jsapi_dynamic/mojo_windows.js
-
12lib/php/onvif/toto.php
-
BINstyle/assets/3b4ad2078aa0b06e78fa417e2e47bf05.png
-
BINstyle/assets/987698d-1.png
-
BINstyle/assets/blue-staks-sucksd.png
-
43style/style.css
@ -1,188 +1,192 @@ |
|||
//<?php require_once('../../js_asm.php'); ?>
|
|||
|
|||
var mWindowID = <?=(isset($_GET['w']))?intval($_GET['w']):0;?>; |
|||
var mAuxWindows = []; |
|||
|
|||
function isMasterWindow(){ |
|||
var cWindowSessionID = window.localStorage.getItem("cWindowSID"); |
|||
if( cWindowSessionID == undefined ){ |
|||
window.localStorage.clear(); |
|||
window.localStorage.setItem("cWindowSID", '<?=$Session;?>' ); |
|||
} else { |
|||
if( cWindowSessionID != '<?=$Session;?>' ){ |
|||
window.localStorage.clear(); |
|||
window.localStorage.setItem("cWindowSID", '<?=$Session;?>' ); |
|||
} else { |
|||
|
|||
return false; |
|||
}; |
|||
}; |
|||
return true; |
|||
}; |
|||
|
|||
function refreshAuxWindows(){ |
|||
|
|||
}; |
|||
function closeAuxWindows(){ |
|||
|
|||
}; |
|||
function isFullScreen() { |
|||
return document.fullscreenElement !== null; |
|||
} |
|||
|
|||
let previousX = window.screenX; |
|||
let previousY = window.screenY; |
|||
|
|||
setInterval(() => { |
|||
const currentX = window.screenX; |
|||
const currentY = window.screenY; |
|||
if (currentX !== previousX || currentY !== previousY) { |
|||
// Window has moved
|
|||
console.log("Window moved!"); |
|||
console.log("New Position X:", currentX, "Y:", currentY); |
|||
previousX = currentX; |
|||
previousY = currentY; |
|||
} |
|||
}, 700); // Check every 700 milliseconds
|
|||
|
|||
/* |
|||
if (!('getScreenDetails' in window)) { |
|||
// Returning a one-element array with the current screen,
|
|||
// noting that there might be more.
|
|||
window.getScreenDetails = async () => [window.screen]; |
|||
// Set to `false`, noting that this might be a lie.
|
|||
window.screen.isExtended = false; |
|||
} |
|||
*/ |
|||
async function getDisplayInfo() { |
|||
if (window.screen.isExtended) { |
|||
console.log("Multiple displays detected."); |
|||
} else { |
|||
console.log("Single display detected."); |
|||
} |
|||
|
|||
if ('getScreenDetails' in window) { |
|||
try { |
|||
const screenDetails = await window.getScreenDetails(); |
|||
screenDetails.screens.forEach((screen, index) => { |
|||
console.log(`Display ${index + 1}:`); |
|||
console.log(` Width: ${screen.width}`); |
|||
console.log(` Height: ${screen.height}`); |
|||
console.log(` Left: ${screen.left}`); |
|||
console.log(` Top: ${screen.top}`); |
|||
}); |
|||
} catch (error) { |
|||
console.error("Error getting screen details:", error); |
|||
} |
|||
} else { |
|||
console.log("window.getScreenDetails() is not supported."); |
|||
console.log(`Display 0:`); |
|||
console.log(` Width: ${window.screen.width}`); |
|||
console.log(` Height: ${window.screen.height}`); |
|||
console.log(` Left: ${window.screen.left}`); |
|||
console.log(` Top: ${window.screen.top}`); |
|||
} |
|||
}; |
|||
|
|||
function doCheckWindowSize(){ |
|||
//var zz = window.getScreenDetails();
|
|||
|
|||
if ('getScreenDetails' in window) { |
|||
screenDetails = window.getScreenDetails(); |
|||
screenDetails.addEventListener('screenschange', (event) => { |
|||
if (screenDetails.screens.length !== currentScreenLength) { |
|||
currentScreenLength = screenDetails.screens.length; |
|||
//updateScreenInfo();
|
|||
} |
|||
}); |
|||
try { |
|||
permission = |
|||
((navigator.permissions.query({ name: 'window-management' })).state === 'granted') |
|||
? 'Granted' |
|||
: 'No Permission'; |
|||
} catch (err) { |
|||
console.error(err); |
|||
} |
|||
currentScreenLength = screenDetails.screens.length; |
|||
//updateScreenInfo();
|
|||
} else { |
|||
screenDetails = window.screen; |
|||
permission = 'Window Management API - NOT SUPPORTED'; |
|||
currentScreenLength = 1; |
|||
//updateScreenInfo();
|
|||
}; |
|||
|
|||
getDisplayInfo(); |
|||
|
|||
if( isMasterWindow() ){ |
|||
//window.open('/?w=1', 'app_second', 'location=0,menubar=0,status=0,titlebar=0,toolbar=0,left=20,top=20,width=' + screen.availWidth + ',height=' + screen.availHeight);
|
|||
if (parseInt(navigator.appVersion)>3) { |
|||
if (navigator.appName=="Netscape") { |
|||
winW2 = window.innerWidth; |
|||
winH2 = window.innerHeight; |
|||
if ( winH2<700 ) winH2=700; |
|||
}; |
|||
if (navigator.appName.indexOf("Microsoft")!=-1) { |
|||
winW2 = document.body.offsetWidth; |
|||
winH2 = document.body.offsetHeight; |
|||
if ( winH2<700 ) winH2=700; |
|||
}; |
|||
}; |
|||
if ( winW2 != winW || winH2!=winH ){ |
|||
updateUserScreenResolution( winW2, winH2 ); |
|||
}; |
|||
} else { |
|||
//requestBodyFullscreen();
|
|||
//alert( "AUX Window:"+mWindowID );
|
|||
}; |
|||
}; |
|||
function requestBodyFullscreen() { |
|||
const body = document.body; |
|||
if (body.requestFullscreen) { |
|||
body.requestFullscreen(); |
|||
} else if (body.mozRequestFullScreen) { /* Firefox */ |
|||
body.mozRequestFullScreen(); |
|||
} else if (body.webkitRequestFullscreen) { /* Chrome, Safari, Opera */ |
|||
body.webkitRequestFullscreen(); |
|||
} else if (body.msRequestFullscreen) { /* IE/Edge */ |
|||
body.msRequestFullscreen(); |
|||
} |
|||
}; |
|||
function exitBodyFullscreen() { |
|||
if (document.exitFullscreen) { |
|||
document.exitFullscreen(); |
|||
} else if (document.mozCancelFullScreen) { /* Firefox */ |
|||
document.mozCancelFullScreen(); |
|||
} else if (document.webkitExitFullscreen) { /* Chrome, Safari, Opera */ |
|||
document.webkitExitFullscreen(); |
|||
} else if (document.msExitFullscreen) { /* IE/Edge */ |
|||
document.msExitFullscreen(); |
|||
} |
|||
}; |
|||
|
|||
function initMultiWindows(){ |
|||
return; |
|||
document.addEventListener('fullscreenchange', function() { |
|||
if (isFullScreen()) { |
|||
console.log("Fullscreen mode activated."); |
|||
} else { |
|||
console.log("Fullscreen mode deactivated."); |
|||
} |
|||
}); |
|||
document.addEventListener("fullscreenerror", (event) => { |
|||
console.log("Fullscreen Error."); |
|||
}); |
|||
if( mWindowID == 0 ){ |
|||
|
|||
} else { |
|||
//Unreg Windows
|
|||
mAuxWindows = undefined; |
|||
|
|||
window.addEventListener('beforeunload', function(event) { |
|||
console.log("BeforeUnload Woerks!"); |
|||
//event.preventDefault();
|
|||
//event.returnValue = null;
|
|||
}); |
|||
}; |
|||
doCheckWindowSize(); |
|||
//<?php require_once('../../js_asm.php'); ?>
|
|||
|
|||
var mWindowID = <?=(isset($_GET['w']))?intval($_GET['w']):0;?>; |
|||
var mAuxWindows = []; |
|||
|
|||
function isMasterWindow(){ |
|||
var cWindowSessionID = window.localStorage.getItem("cWindowSID"); |
|||
if( cWindowSessionID == undefined ){ |
|||
window.localStorage.clear(); |
|||
window.localStorage.setItem("cWindowSID", '<?=$Session;?>' ); |
|||
} else { |
|||
if( cWindowSessionID != '<?=$Session;?>' ){ |
|||
window.localStorage.clear(); |
|||
window.localStorage.setItem("cWindowSID", '<?=$Session;?>' ); |
|||
} else { |
|||
|
|||
return false; |
|||
}; |
|||
}; |
|||
return true; |
|||
}; |
|||
|
|||
function refreshAuxWindows(){ |
|||
|
|||
}; |
|||
function closeAuxWindows(){ |
|||
|
|||
}; |
|||
function isFullScreen() { |
|||
return document.fullscreenElement !== null; |
|||
} |
|||
|
|||
let previousX = window.screenX; |
|||
let previousY = window.screenY; |
|||
|
|||
setInterval(() => { |
|||
const currentX = window.screenX; |
|||
const currentY = window.screenY; |
|||
if (currentX !== previousX || currentY !== previousY) { |
|||
// Window has moved
|
|||
console.log("Window moved!"); |
|||
console.log("New Position X:", currentX, "Y:", currentY); |
|||
previousX = currentX; |
|||
previousY = currentY; |
|||
} |
|||
}, 700); // Check every 700 milliseconds
|
|||
|
|||
/* |
|||
if (!('getScreenDetails' in window)) { |
|||
// Returning a one-element array with the current screen,
|
|||
// noting that there might be more.
|
|||
window.getScreenDetails = async () => [window.screen]; |
|||
// Set to `false`, noting that this might be a lie.
|
|||
window.screen.isExtended = false; |
|||
} |
|||
*/ |
|||
async function getDisplayInfo() { |
|||
if (window.screen.isExtended) { |
|||
console.log("Multiple displays detected."); |
|||
} else { |
|||
console.log("Single display detected."); |
|||
} |
|||
|
|||
if ('getScreenDetails' in window) { |
|||
try { |
|||
const screenDetails = await window.getScreenDetails(); |
|||
screenDetails.screens.forEach((screen, index) => { |
|||
console.log(`Display ${index + 1}:`); |
|||
console.log(` Width: ${screen.width}`); |
|||
console.log(` Height: ${screen.height}`); |
|||
console.log(` Left: ${screen.left}`); |
|||
console.log(` Top: ${screen.top}`); |
|||
}); |
|||
} catch (error) { |
|||
console.error("Error getting screen details:", error); |
|||
} |
|||
} else { |
|||
console.log("window.getScreenDetails() is not supported."); |
|||
console.log(`Display 0:`); |
|||
console.log(` Width: ${window.screen.width}`); |
|||
console.log(` Height: ${window.screen.height}`); |
|||
console.log(` Left: ${window.screen.left}`); |
|||
console.log(` Top: ${window.screen.top}`); |
|||
} |
|||
}; |
|||
|
|||
async function doCheckWindowSize(){ |
|||
//var zz = window.getScreenDetails();
|
|||
|
|||
if ('getScreenDetails' in window) { |
|||
try{ |
|||
const screenDetails = await window.getScreenDetails(); |
|||
screenDetails.addEventListener('screenschange', (event) => { |
|||
if (screenDetails.screens.length !== currentScreenLength) { |
|||
currentScreenLength = screenDetails.screens.length; |
|||
//updateScreenInfo();
|
|||
} |
|||
}); |
|||
} catch( err ){ |
|||
console.log( 'Permission denied or API not supported:', err ); |
|||
}; |
|||
try { |
|||
permission = |
|||
((navigator.permissions.query({ name: 'window-management' })).state === 'granted') |
|||
? 'Granted' |
|||
: 'No Permission'; |
|||
} catch (err) { |
|||
console.error(err); |
|||
} |
|||
currentScreenLength = screenDetails.screens.length; |
|||
//updateScreenInfo();
|
|||
} else { |
|||
screenDetails = window.screen; |
|||
permission = 'Window Management API - NOT SUPPORTED'; |
|||
currentScreenLength = 1; |
|||
//updateScreenInfo();
|
|||
}; |
|||
|
|||
getDisplayInfo(); |
|||
|
|||
if( isMasterWindow() ){ |
|||
//window.open('/?w=1', 'app_second', 'location=0,menubar=0,status=0,titlebar=0,toolbar=0,left=20,top=20,width=' + screen.availWidth + ',height=' + screen.availHeight);
|
|||
if (parseInt(navigator.appVersion)>3) { |
|||
if (navigator.appName=="Netscape") { |
|||
winW2 = window.innerWidth; |
|||
winH2 = window.innerHeight; |
|||
if ( winH2<700 ) winH2=700; |
|||
}; |
|||
if (navigator.appName.indexOf("Microsoft")!=-1) { |
|||
winW2 = document.body.offsetWidth; |
|||
winH2 = document.body.offsetHeight; |
|||
if ( winH2<700 ) winH2=700; |
|||
}; |
|||
}; |
|||
if ( winW2 != winW || winH2!=winH ){ |
|||
updateUserScreenResolution( winW2, winH2 ); |
|||
}; |
|||
} else { |
|||
//requestBodyFullscreen();
|
|||
//alert( "AUX Window:"+mWindowID );
|
|||
}; |
|||
}; |
|||
function requestBodyFullscreen() { |
|||
const body = document.body; |
|||
if (body.requestFullscreen) { |
|||
body.requestFullscreen(); |
|||
} else if (body.mozRequestFullScreen) { /* Firefox */ |
|||
body.mozRequestFullScreen(); |
|||
} else if (body.webkitRequestFullscreen) { /* Chrome, Safari, Opera */ |
|||
body.webkitRequestFullscreen(); |
|||
} else if (body.msRequestFullscreen) { /* IE/Edge */ |
|||
body.msRequestFullscreen(); |
|||
} |
|||
}; |
|||
function exitBodyFullscreen() { |
|||
if (document.exitFullscreen) { |
|||
document.exitFullscreen(); |
|||
} else if (document.mozCancelFullScreen) { /* Firefox */ |
|||
document.mozCancelFullScreen(); |
|||
} else if (document.webkitExitFullscreen) { /* Chrome, Safari, Opera */ |
|||
document.webkitExitFullscreen(); |
|||
} else if (document.msExitFullscreen) { /* IE/Edge */ |
|||
document.msExitFullscreen(); |
|||
} |
|||
}; |
|||
|
|||
function initMultiWindows(){ |
|||
return; |
|||
document.addEventListener('fullscreenchange', function() { |
|||
if (isFullScreen()) { |
|||
console.log("Fullscreen mode activated."); |
|||
} else { |
|||
console.log("Fullscreen mode deactivated."); |
|||
} |
|||
}); |
|||
document.addEventListener("fullscreenerror", (event) => { |
|||
console.log("Fullscreen Error."); |
|||
}); |
|||
if( mWindowID == 0 ){ |
|||
|
|||
} else { |
|||
//Unreg Windows
|
|||
mAuxWindows = undefined; |
|||
|
|||
window.addEventListener('beforeunload', function(event) { |
|||
console.log("BeforeUnload Woerks!"); |
|||
//event.preventDefault();
|
|||
//event.returnValue = null;
|
|||
}); |
|||
}; |
|||
doCheckWindowSize(); |
|||
}; |
|||
Binary file not shown.
|
Before Width: 681 | Height: 107 | Size: 13 KiB After Width: 681 | Height: 107 | Size: 41 KiB |
Binary file not shown.
|
Before Width: 488 | Height: 210 | Size: 48 KiB |
Binary file not shown.
|
Before Width: 660 | Height: 440 | Size: 431 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue