diff --git a/include/themes/midwinter/main.js b/include/themes/midwinter/main.js index 045706837..9d542bc42 100755 --- a/include/themes/midwinter/main.js +++ b/include/themes/midwinter/main.js @@ -60,14 +60,14 @@ function themeReady() { setThemeColor(); hideConsoleNavigation(); - //setupTree(); + setupTree(); setupThemeActions(); themeLoader('off'); } function hideConsoleNavigation() { $('[class^="mdw-ConsoleNavigationBox"]').removeClass('visible'); - //$('[class^="mdw-ConsoleNavigationBox"][data-helper!="tree"]').removeClass('visible'); + $('[class^="mdw-ConsoleNavigationBox"][data-helper!="tree"]').removeClass('visible'); $('.compact_nav_icon[data-helper!="tree"]').removeClass('selected'); } @@ -225,7 +225,12 @@ function setupTheme() { '' + ''+ '' + - '' + '
' + + '' + + '
' ). insertBefore("#breadCrumbBar"); @@ -268,7 +273,7 @@ function setupTheme() { ); /* dashboards */ - new navigationButton('dashboards', 'Panels', 'Panels', 'far fa-compass', '#compact_tab_menu').show(); + new navigationButton('dashboards', 'Panels', 'Panels', 'far fa-map', '#compact_tab_menu').show(); new navigationBox(cactiDashboards, 'dashboards', 'full','auto', { close: true, search: 'searchToHighlight', @@ -277,7 +282,7 @@ function setupTheme() { /* settings */ if (cactiConsoleAllowed) { - new navigationButton('settings', 'Setup', 'Settings', 'fa fa-cogs', '#compact_tab_menu'); + new navigationButton('settings', 'Setup', 'Settings', 'far fa-sun', '#compact_tab_menu'); new navigationBox(zoom_i18n_settings, 'settings', 'full', 'auto', { close: true, search: 'searchToHighlight', @@ -295,6 +300,7 @@ function setupTheme() { },'left', 'Tree').build(); } + /* user help */ new navigationButton('help', 'Help', 'Help', 'far fa-comments', '#compact_user_menu').show(); new navigationBox(help, 'help', 'half', '2', { @@ -323,6 +329,12 @@ function setupTheme() { }, 'right','Table Layout', 'auto').build(); new navigationButton('toggleColorMode', 'Color', 'Toggle light/dark Mode', 'fas fa-circle-half-stroke', '#navControl', 'toggleColorMode', 'on').show(); new navigationButton('kioskMode', 'Kiosk', 'Enable Kiosk Mode', 'fas fa-tv', '#navControl', 'kioskMode', 'on').show(); + + if ( document.fullscreenEnabled ) { + let icon = (!document.fullscreenElement) ? 'fas fa-expand' : 'fas fa-compress'; + new navigationButton('fullScreen', 'Fullscreen', 'Switch to Fullscreen', icon, '#navControl', 'fullScreen').show(); + } + } } @@ -336,6 +348,11 @@ function setupTheme() { }else { $('[class^="compact_nav_icon"][data-helper="settings"]').removeClass('hide'); } + + $('#main').off('resize').on('resize', function() { + let width = $('#main'); + $('#main .saveRowParent').width(width); + }) } function setupThemeActions() { @@ -357,6 +374,7 @@ function setupThemeActions() { $('#main, #navigation_right').off().on('click', {param: 'off'}, toggleCactiNavigationBox); $('.mdw-ConsoleNavigationBox').off().on('click', hideDropDownMenu); //$('.dropdown').off().on('click', toggleDropDownMenu); + document.addEventListener("fullscreenchange", fullScreenChangeHandler); } function redirect(event) { @@ -556,7 +574,8 @@ function setupDefaultElements() { }); /* cleanup - remove unused elements */ - $('#breadCrumbBar, .cactiPageHead, .cactiShadow, .cactiConsoleNavigationArea, .cactiTreeNavigationArea').detach(); + //$('#breadCrumbBar, .cactiPageHead, .cactiShadow, .cactiConsoleNavigationArea, .cactiTreeNavigationArea').detach(); + $('#breadCrumbBar, .cactiPageHead, .cactiShadow, .cactiConsoleNavigationArea').detach(); // top right corner navigation bar - holds buttons //$('#navFilter').removeClass('visible'); @@ -613,7 +632,7 @@ function setupDefaultElements() { } /* display option: table layout */ - let btn_table_layout = new navigationButton('displayOptions', 'Table', 'Setup Table Layout','fas fa-sliders', '#navFilter'); + let btn_table_layout = new navigationButton('displayOptions', 'Table', 'Setup Table Layout','fas fa-table-list', '#navFilter'); if ($('tr.tableHeader').length !== 0) { let cArray = []; @@ -968,6 +987,31 @@ function checkThemeColorSetup(color_mode) { } } +function togglePopOver() { + const popover = document.getElementById('mdw-PopOver'); + const popupOpened = popover.togglePopover(); + if (popupOpened !== undefined) { + this.innerText += + popupOpened === true ? `\nOpened` : `\nClosed`; + } +} + +function fullScreen(event) { + if (!document.fullscreenElement) { + document.documentElement.requestFullscreen().then( r => fullScreenChangeHandler() ); + }else if (document.exitFullscreen) { + document.exitFullscreen().then( r => fullScreenChangeHandler() ); + } +} + +function fullScreenChangeHandler() { + if (document.fullscreenElement) { + $('.compact_nav_icon[data-helper="fullScreen"]>i').removeClass('fa-expand').addClass('fa-compress'); + }else { + $('.compact_nav_icon[data-helper="fullScreen"]>i').addClass('fa-expand').removeClass('fa-compress'); + } +} + function kioskMode(event = false) { if (event === false) { diff --git a/include/themes/midwinter/midwinter.js b/include/themes/midwinter/midwinter.js index a3c8c0b63..55e285ce7 100644 --- a/include/themes/midwinter/midwinter.js +++ b/include/themes/midwinter/midwinter.js @@ -178,7 +178,7 @@ class navigationButton { this.#icon.onclick = onclick; } - this.#container = '
'; + this.#container = '
'; /* avoid duplicates */ if( $(this.#icon.destination + ' > div[class^="compact_nav_icon"][data-helper="' + this.#icon.helper + '"]').length === 0 ) { @@ -240,7 +240,7 @@ function get_dashboards_content(){ compact_tab_menu_content += '