1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added toggle footer bar option in webapp.

This commit is contained in:
Ylian Saint-Hilaire 2019-12-21 16:07:25 -08:00
parent 3ae3da2187
commit 7491607ad3
16 changed files with 226 additions and 33 deletions

View file

@ -114,6 +114,7 @@
<div tabindex=0 id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Top bar interface" onkeypress="if (event.key == 'Enter') userInterfaceSelectMenu(2)"><div class="uiSelector2"></div></div>
<div tabindex=0 id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Fixed width interface" onkeypress="if (event.key == 'Enter') userInterfaceSelectMenu(3)"><div class="uiSelector3"></div></div>
<div tabindex=0 id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Toggle night mode" onkeypress="if (event.key == 'Enter') toggleNightMode()"><div class="uiSelector4"></div></div>
<div tabindex=0 id=uiViewButton5 class=uiSelector onclick=toggleFooterBarMode() title="Toggle footer bar" onkeypress="if (event.key == 'Enter') toggleFooterBarMode()"><div class="uiSelector5"></div></div>
</div>
</div>
<table id=MainMenuSpan cellpadding=0 cellspacing=0 class=style1>
@ -1110,6 +1111,7 @@
var webPageStackMenu = false;
var webPageFullScreen = true;
var nightMode = (getstore('_nightMode', '0') == '1');
var footerBar = (getstore('_footerBar', '1') == '1');
var sessionActivity = Date.now();
var updateSessionTimer = null;
var pluginHandlerBuilder = {{{pluginHandler}}};
@ -1152,6 +1154,7 @@
if (globalHide) { hide = (hide | globalHide); }
}
args.hide = hide;
QV('uiViewButton5', !(args.hide & 4)); // Hide the footer toggle button if footer is hidden anyway.
adjustPanels();
// Setup logout control
@ -1242,6 +1245,7 @@
function adjustPanels() {
var hide = args.hide;
if (footerBar == false) { hide |= 4; }
QV('masthead', !(hide & 1));
QV('topbar', !(hide & 2));
QV('footer', !(hide & 4));
@ -1280,7 +1284,7 @@
// Adjust height of remote desktop, files and Intel AMT
// 1 = Top bar, 2 = Tool Bar, 4 = Bottom Bar, 8 = Tab Title
var xh = (((args.hide & 1) ? 0 : 66) + ((args.hide & 2) ? 0 : 24) + ((args.hide & 4) ? 0 : 45) + ((args.hide & 8) ? 0 : 60)); // 0 to 195
var xh = (((hide & 1) ? 0 : 66) + ((hide & 2) ? 0 : 24) + ((hide & 4) ? 0 : 45) + ((hide & 8) ? 0 : 60)); // 0 to 195
var xh2 = (uiMode > 1)?24:0;
QS('p3users')['max-height'] = 'calc(100vh - ' + (50 + xh) + 'px)'; // 124
QS('p3events')['height'] = 'calc(100vh - ' + (50 + xh) + 'px)'; // 124
@ -1354,10 +1358,12 @@
Q('uiViewButton2').classList.remove('uiSelectorSel');
Q('uiViewButton3').classList.remove('uiSelectorSel');
Q('uiViewButton4').classList.remove('uiSelectorSel');
Q('uiViewButton5').classList.remove('uiSelectorSel');
try { Q('uiViewButton' + uiMode).classList.add('uiSelectorSel'); } catch (ex) { }
QV('uiMenu', (QS('uiMenu').display == 'none'));
//Q('uiViewButton1').focus();
if (nightMode) { Q('uiViewButton4').classList.add('uiSelectorSel'); }
if (footerBar) { Q('uiViewButton5').classList.add('uiSelectorSel'); }
}
function userInterfaceSelectMenu(s) {
@ -1376,6 +1382,14 @@
putstore('_nightMode', nightMode?'1':'0');
}
function toggleFooterBarMode() {
footerBar = !footerBar;
putstore('_footerBar', footerBar?'1':'0');
QS('container')['grid-template-rows'] = null;
QS('container')['-ms-grid-rows'] = null;
adjustPanels();
}
// Toggle the web page to full screen
function toggleFullScreen(toggle) {
if (toggle === 1) { webPageFullScreen = !webPageFullScreen; putstore('webPageFullScreen', webPageFullScreen); }
@ -5544,7 +5558,9 @@
if (e.shiftKey == true) { enterBrowserFullscreen(Q('deskarea0')); browserfullscreen = true; }
} else {
QC('body').remove('fulldesk');
var xh = (((args.hide & 1) ? 0 : 66) + ((args.hide & 2) ? 0 : 24) + ((args.hide & 4) ? 0 : 45) + ((args.hide & 8) ? 0 : 60)); // 0 to 195
var hide = args.hide;
if (footerBar == false) { hide |= 4; }
var xh = (((hide & 1) ? 0 : 66) + ((hide & 2) ? 0 : 24) + ((hide & 4) ? 0 : 45) + ((hide & 8) ? 0 : 60)); // 0 to 195
QS('deskarea3x')['height'] = 'calc(100vh - ' + (75 + xh) + 'px)';
QS('deskarea3x')['max-height'] = 'calc(100vh - ' + (75 + xh) + 'px)';
if (browserfullscreen == true) { exitBrowserFullscreen(); browserfullscreen = false; }