|
@@ -91,6 +91,7 @@ start: function(callback) {
|
|
|
|
|
|
UI.rfb = RFB({'target': $D('noVNC_canvas'),
|
|
UI.rfb = RFB({'target': $D('noVNC_canvas'),
|
|
'onUpdateState': UI.updateState,
|
|
'onUpdateState': UI.updateState,
|
|
|
|
+ 'onXvpInit': UI.updateXvpVisualState,
|
|
'onClipboard': UI.clipReceive,
|
|
'onClipboard': UI.clipReceive,
|
|
'onDesktopName': UI.updateDocumentTitle});
|
|
'onDesktopName': UI.updateDocumentTitle});
|
|
|
|
|
|
@@ -184,8 +185,12 @@ addMouseHandlers: function() {
|
|
$D("sendEscButton").onclick = UI.sendEsc;
|
|
$D("sendEscButton").onclick = UI.sendEsc;
|
|
|
|
|
|
$D("sendCtrlAltDelButton").onclick = UI.sendCtrlAltDel;
|
|
$D("sendCtrlAltDelButton").onclick = UI.sendCtrlAltDel;
|
|
|
|
+ $D("xvpShutdownButton").onclick = UI.xvpShutdown;
|
|
|
|
+ $D("xvpRebootButton").onclick = UI.xvpReboot;
|
|
|
|
+ $D("xvpResetButton").onclick = UI.xvpReset;
|
|
$D("noVNC_status").onclick = UI.togglePopupStatusPanel;
|
|
$D("noVNC_status").onclick = UI.togglePopupStatusPanel;
|
|
$D("noVNC_popup_status_panel").onclick = UI.togglePopupStatusPanel;
|
|
$D("noVNC_popup_status_panel").onclick = UI.togglePopupStatusPanel;
|
|
|
|
+ $D("xvpButton").onclick = UI.toggleXvpPanel;
|
|
$D("clipboardButton").onclick = UI.toggleClipboardPanel;
|
|
$D("clipboardButton").onclick = UI.toggleClipboardPanel;
|
|
$D("settingsButton").onclick = UI.toggleSettingsPanel;
|
|
$D("settingsButton").onclick = UI.toggleSettingsPanel;
|
|
$D("connectButton").onclick = UI.toggleConnectPanel;
|
|
$D("connectButton").onclick = UI.toggleConnectPanel;
|
|
@@ -302,6 +307,39 @@ togglePopupStatusPanel: function() {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+// Show the XVP panel
|
|
|
|
+toggleXvpPanel: function() {
|
|
|
|
+ // Close the description panel
|
|
|
|
+ $D('noVNC_description').style.display = "none";
|
|
|
|
+ // Close settings if open
|
|
|
|
+ if (UI.settingsOpen === true) {
|
|
|
|
+ UI.settingsApply();
|
|
|
|
+ UI.closeSettingsMenu();
|
|
|
|
+ }
|
|
|
|
+ // Close connection settings if open
|
|
|
|
+ if (UI.connSettingsOpen === true) {
|
|
|
|
+ UI.toggleConnectPanel();
|
|
|
|
+ }
|
|
|
|
+ // Close popup status panel if open
|
|
|
|
+ if (UI.popupStatusOpen === true) {
|
|
|
|
+ UI.togglePopupStatusPanel();
|
|
|
|
+ }
|
|
|
|
+ // Close clipboard panel if open
|
|
|
|
+ if (UI.clipboardOpen === true) {
|
|
|
|
+ UI.toggleClipboardPanel();
|
|
|
|
+ }
|
|
|
|
+ // Toggle XVP panel
|
|
|
|
+ if (UI.xvpOpen === true) {
|
|
|
|
+ $D('noVNC_xvp').style.display = "none";
|
|
|
|
+ $D('xvpButton').className = "noVNC_status_button";
|
|
|
|
+ UI.xvpOpen = false;
|
|
|
|
+ } else {
|
|
|
|
+ $D('noVNC_xvp').style.display = "block";
|
|
|
|
+ $D('xvpButton').className = "noVNC_status_button_selected";
|
|
|
|
+ UI.xvpOpen = true;
|
|
|
|
+ }
|
|
|
|
+},
|
|
|
|
+
|
|
// Show the clipboard panel
|
|
// Show the clipboard panel
|
|
toggleClipboardPanel: function() {
|
|
toggleClipboardPanel: function() {
|
|
// Close the description panel
|
|
// Close the description panel
|
|
@@ -319,6 +357,10 @@ toggleClipboardPanel: function() {
|
|
if (UI.popupStatusOpen === true) {
|
|
if (UI.popupStatusOpen === true) {
|
|
UI.togglePopupStatusPanel();
|
|
UI.togglePopupStatusPanel();
|
|
}
|
|
}
|
|
|
|
+ // Close XVP panel if open
|
|
|
|
+ if (UI.xvpOpen === true) {
|
|
|
|
+ UI.toggleXvpPanel();
|
|
|
|
+ }
|
|
// Toggle Clipboard Panel
|
|
// Toggle Clipboard Panel
|
|
if (UI.clipboardOpen === true) {
|
|
if (UI.clipboardOpen === true) {
|
|
$D('noVNC_clipboard').style.display = "none";
|
|
$D('noVNC_clipboard').style.display = "none";
|
|
@@ -349,6 +391,10 @@ toggleConnectPanel: function() {
|
|
if (UI.popupStatusOpen === true) {
|
|
if (UI.popupStatusOpen === true) {
|
|
UI.togglePopupStatusPanel();
|
|
UI.togglePopupStatusPanel();
|
|
}
|
|
}
|
|
|
|
+ // Close XVP panel if open
|
|
|
|
+ if (UI.xvpOpen === true) {
|
|
|
|
+ UI.toggleXvpPanel();
|
|
|
|
+ }
|
|
|
|
|
|
// Toggle Connection Panel
|
|
// Toggle Connection Panel
|
|
if (UI.connSettingsOpen === true) {
|
|
if (UI.connSettingsOpen === true) {
|
|
@@ -412,6 +458,10 @@ openSettingsMenu: function() {
|
|
if (UI.popupStatusOpen === true) {
|
|
if (UI.popupStatusOpen === true) {
|
|
UI.togglePopupStatusPanel();
|
|
UI.togglePopupStatusPanel();
|
|
}
|
|
}
|
|
|
|
+ // Close XVP panel if open
|
|
|
|
+ if (UI.xvpOpen === true) {
|
|
|
|
+ UI.toggleXvpPanel();
|
|
|
|
+ }
|
|
$D('noVNC_settings').style.display = "block";
|
|
$D('noVNC_settings').style.display = "block";
|
|
$D('settingsButton').className = "noVNC_status_button_selected";
|
|
$D('settingsButton').className = "noVNC_status_button_selected";
|
|
UI.settingsOpen = true;
|
|
UI.settingsOpen = true;
|
|
@@ -464,6 +514,18 @@ sendCtrlAltDel: function() {
|
|
UI.rfb.sendCtrlAltDel();
|
|
UI.rfb.sendCtrlAltDel();
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+xvpShutdown: function() {
|
|
|
|
+ UI.rfb.xvpShutdown();
|
|
|
|
+},
|
|
|
|
+
|
|
|
|
+xvpReboot: function() {
|
|
|
|
+ UI.rfb.xvpReboot();
|
|
|
|
+},
|
|
|
|
+
|
|
|
|
+xvpReset: function() {
|
|
|
|
+ UI.rfb.xvpReset();
|
|
|
|
+},
|
|
|
|
+
|
|
setMouseButton: function(num) {
|
|
setMouseButton: function(num) {
|
|
var b, blist = [0, 1,2,4], button;
|
|
var b, blist = [0, 1,2,4], button;
|
|
|
|
|
|
@@ -562,6 +624,7 @@ updateVisualState: function() {
|
|
$D('showKeyboard').style.display = "none";
|
|
$D('showKeyboard').style.display = "none";
|
|
$D('noVNC_extra_keys').style.display = "none";
|
|
$D('noVNC_extra_keys').style.display = "none";
|
|
$D('sendCtrlAltDelButton').style.display = "none";
|
|
$D('sendCtrlAltDelButton').style.display = "none";
|
|
|
|
+ UI.updateXvpVisualState(0);
|
|
}
|
|
}
|
|
|
|
|
|
// State change disables viewport dragging.
|
|
// State change disables viewport dragging.
|
|
@@ -585,6 +648,19 @@ updateVisualState: function() {
|
|
//Util.Debug("<< updateVisualState");
|
|
//Util.Debug("<< updateVisualState");
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+// Disable/enable XVP button
|
|
|
|
+updateXvpVisualState: function(ver) {
|
|
|
|
+ if (ver >= 1) {
|
|
|
|
+ $D('xvpButton').style.display = 'inline';
|
|
|
|
+ } else {
|
|
|
|
+ $D('xvpButton').style.display = 'none';
|
|
|
|
+ // Close XVP panel if open
|
|
|
|
+ if (UI.xvpOpen === true) {
|
|
|
|
+ UI.toggleXvpPanel();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+},
|
|
|
|
+
|
|
|
|
|
|
// Display the desktop name in the document title
|
|
// Display the desktop name in the document title
|
|
updateDocumentTitle: function(rfb, name) {
|
|
updateDocumentTitle: function(rfb, name) {
|