UI.initSetting('path', 'websockify');
UI.initSetting('repeaterID', '');
- UI.rfb = new RFB({'target': $D('noVNC_canvas'),
- 'onUpdateState': UI.updateState,
- 'onXvpInit': UI.updateXvpVisualState,
- 'onClipboard': UI.clipReceive,
- 'onFBUComplete': UI.FBUComplete,
- 'onFBResize': UI.updateViewDragButton,
- 'onDesktopName': UI.updateDocumentTitle});
+ UI.initRFB();
var autoconnect = WebUtil.getQueryVar('autoconnect', false);
if (autoconnect === 'true' || autoconnect == '1') {
}
},
+ initRFB: function () {
+ UI.rfb = new RFB({'target': $D('noVNC_canvas'),
+ 'onUpdateState': UI.updateState,
+ 'onXvpInit': UI.updateXvpVisualState,
+ 'onClipboard': UI.clipReceive,
+ 'onFBUComplete': UI.FBUComplete,
+ 'onFBResize': UI.updateViewDragButton,
+ 'onDesktopName': UI.updateDocumentTitle});
+ },
+
addMouseHandlers: function() {
// Setup interface handlers that can't be inline
$D("noVNC_view_drag_button").onclick = UI.setViewDrag;
break;
}
+ switch (state) {
+ case 'fatal':
+ case 'failed':
+ case 'disconnected':
+ UI.initRFB();
+ }
+
if (typeof(msg) !== 'undefined') {
$D('noVNC-control-bar').setAttribute("class", klass);
$D('noVNC_status').innerHTML = msg;
switch (UI.rfb_state) {
case 'fatal':
case 'failed':
- case 'loaded':
case 'disconnected':
+ $D('connectButton').style.display = "";
+ $D('disconnectButton').style.display = "none";
+ UI.connSettingsOpen = false;
+ UI.toggleConnectPanel();
+ break;
+ case 'loaded':
$D('connectButton').style.display = "";
$D('disconnectButton').style.display = "none";
break;
UI.rfb.set_onFBUComplete(UI.FBUComplete);
$D('noVNC_logo').style.display = "block";
- UI.connSettingsOpen = false;
- UI.toggleConnectPanel();
+ // Don't display the connection settings until we're actually disconnected
},
displayBlur: function() {