Browse Source

Add option to show/hide webui status bar

adaptive-webui-19844
Thomas Piccirello 7 years ago
parent
commit
8a2e3f5d93
  1. 3
      src/webui/www/private/index.html
  2. 25
      src/webui/www/private/scripts/client.js

3
src/webui/www/private/index.html

@ -62,8 +62,9 @@
<a class="returnFalse">QBT_TR(&View)QBT_TR[CONTEXT=MainWindow]</a> <a class="returnFalse">QBT_TR(&View)QBT_TR[CONTEXT=MainWindow]</a>
<ul> <ul>
<li><a id="showTopToolbarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Top Toolbar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Top Toolbar)QBT_TR[CONTEXT=MainWindow]</a></li> <li><a id="showTopToolbarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Top Toolbar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Top Toolbar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id="showStatusBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(&Status Bar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Status Bar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id="speedInBrowserTitleBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(S&peed in Title Bar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(S&peed in Title Bar)QBT_TR[CONTEXT=MainWindow]</a></li> <li><a id="speedInBrowserTitleBarLink"><img class="MyMenuIcon" src="theme/checked" alt="QBT_TR(S&peed in Title Bar)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(S&peed in Title Bar)QBT_TR[CONTEXT=MainWindow]</a></li>
<li><a id=StatisticsLink ><img class="MyMenuIcon" src="theme/view-statistics" alt="QBT_TR(&Statistics)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Statistics)QBT_TR[CONTEXT=MainWindow]</a></li> <li class="divider"><a id=StatisticsLink ><img class="MyMenuIcon" src="theme/view-statistics" alt="QBT_TR(&Statistics)QBT_TR[CONTEXT=MainWindow]" width="16" height="16" onload="fixPNG(this)"/>QBT_TR(&Statistics)QBT_TR[CONTEXT=MainWindow]</a></li>
</ul> </ul>
</li> </li>
<li> <li>

25
src/webui/www/private/scripts/client.js

@ -161,11 +161,20 @@ window.addEvent('load', function () {
$('mochaToolbar').addClass('invisible'); $('mochaToolbar').addClass('invisible');
} }
// Show Status Bar is enabled by default
var showStatusBar = true;
if (localStorage.getItem('show_status_bar') !== null)
showStatusBar = localStorage.getItem('show_status_bar') === "true";
if (!showStatusBar) {
$('showStatusBarLink').firstChild.style.opacity = '0';
$('desktopFooterWrapper').addClass('invisible');
}
var speedInTitle = localStorage.getItem('speed_in_browser_title_bar') == "true"; var speedInTitle = localStorage.getItem('speed_in_browser_title_bar') == "true";
if (!speedInTitle) if (!speedInTitle)
$('speedInBrowserTitleBarLink').firstChild.style.opacity = '0'; $('speedInBrowserTitleBarLink').firstChild.style.opacity = '0';
// After Show Top Toolbar // After showing/hiding the toolbar + status bar
MochaUI.Desktop.setDesktopSize(); MochaUI.Desktop.setDesktopSize();
var syncMainDataLastResponseId = 0; var syncMainDataLastResponseId = 0;
@ -475,6 +484,20 @@ window.addEvent('load', function () {
MochaUI.Desktop.setDesktopSize(); MochaUI.Desktop.setDesktopSize();
}); });
$('showStatusBarLink').addEvent('click', function(e) {
showStatusBar = !showStatusBar;
localStorage.setItem('show_status_bar', showStatusBar.toString());
if (showStatusBar) {
$('showStatusBarLink').firstChild.style.opacity = '1';
$('desktopFooterWrapper').removeClass('invisible');
}
else {
$('showStatusBarLink').firstChild.style.opacity = '0';
$('desktopFooterWrapper').addClass('invisible');
}
MochaUI.Desktop.setDesktopSize();
});
$('speedInBrowserTitleBarLink').addEvent('click', function(e) { $('speedInBrowserTitleBarLink').addEvent('click', function(e) {
speedInTitle = !speedInTitle; speedInTitle = !speedInTitle;
localStorage.setItem('speed_in_browser_title_bar', speedInTitle.toString()); localStorage.setItem('speed_in_browser_title_bar', speedInTitle.toString());

Loading…
Cancel
Save