/*
* noVNC: HTML5 VNC client
* Copyright (C) 2012 Joel Martin
+ * Copyright (C) 2013 Samuel Mannehed for Cendio AB
* Licensed under MPL 2.0 (see LICENSE.txt)
*
* See README.md for usage and integration instructions.
rfb_state : 'loaded',
settingsOpen : false,
connSettingsOpen : false,
+popupStatusOpen : false,
clipboardOpen: false,
keyboardVisible: false,
$D("keyboardinput").onblur = UI.keyInputBlur;
$D("sendCtrlAltDelButton").onclick = UI.sendCtrlAltDel;
+ $D("noVNC_status_bar").onclick = UI.togglePopupStatusPanel;
+ $D("noVNC_popup_status_panel").onclick = UI.togglePopupStatusPanel;
$D("clipboardButton").onclick = UI.toggleClipboardPanel;
$D("settingsButton").onclick = UI.toggleSettingsPanel;
$D("connectButton").onclick = UI.toggleConnectPanel;
},
+// Show the popup status panel
+togglePopupStatusPanel: function() {
+ var psp = $D('noVNC_popup_status_panel');
+ if (UI.popupStatusOpen === true) {
+ psp.style.display = "none";
+ UI.popupStatusOpen = false;
+ } else {
+ psp.innerHTML = $D('noVNC_status').innerHTML;
+ psp.style.display = "block";
+ psp.style.left = window.innerWidth/2 -
+ parseInt(window.getComputedStyle(psp, false).width)/2 -30 + "px";
+ UI.popupStatusOpen = true;
+ }
+},
+
// Show the clipboard panel
toggleClipboardPanel: function() {
// Close the description panel
$D('noVNC_description').style.display = "none";
- //Close settings if open
+ // Close settings if open
if (UI.settingsOpen === true) {
UI.settingsApply();
UI.closeSettingsMenu();
}
- //Close connection settings if open
+ // Close connection settings if open
if (UI.connSettingsOpen === true) {
UI.toggleConnectPanel();
}
- //Toggle Clipboard Panel
+ // Close popup status panel if open
+ if (UI.popupStatusOpen === true) {
+ UI.togglePopupStatusPanel();
+ }
+ // Toggle Clipboard Panel
if (UI.clipboardOpen === true) {
$D('noVNC_clipboard').style.display = "none";
$D('clipboardButton').className = "noVNC_status_button";
toggleConnectPanel: function() {
// Close the description panel
$D('noVNC_description').style.display = "none";
- //Close connection settings if open
+ // Close connection settings if open
if (UI.settingsOpen === true) {
UI.settingsApply();
UI.closeSettingsMenu();
$D('connectButton').className = "noVNC_status_button";
}
+ // Close clipboard panel if open
if (UI.clipboardOpen === true) {
UI.toggleClipboardPanel();
}
+ // Close popup status panel if open
+ if (UI.popupStatusOpen === true) {
+ UI.togglePopupStatusPanel();
+ }
- //Toggle Connection Panel
+ // Toggle Connection Panel
if (UI.connSettingsOpen === true) {
$D('noVNC_controls').style.display = "none";
$D('connectButton').className = "noVNC_status_button";
openSettingsMenu: function() {
// Close the description panel
$D('noVNC_description').style.display = "none";
+ // Close clipboard panel if open
if (UI.clipboardOpen === true) {
UI.toggleClipboardPanel();
}
- //Close connection settings if open
+ // Close connection settings if open
if (UI.connSettingsOpen === true) {
UI.toggleConnectPanel();
}
+ // Close popup status panel if open
+ if (UI.popupStatusOpen === true) {
+ UI.togglePopupStatusPanel();
+ }
$D('noVNC_settings').style.display = "block";
$D('settingsButton').className = "noVNC_status_button_selected";
UI.settingsOpen = true;