mirror of
https://github.com/fcwu/docker-ubuntu-vnc-desktop
synced 2026-08-05 16:12:41 +02:00
Update noVNC
This commit is contained in:
+44
-11
@@ -80,7 +80,23 @@
|
||||
"jsunzip.js", "rfb.js", "keysym.js"]);
|
||||
|
||||
var rfb;
|
||||
var resizeTimeout;
|
||||
|
||||
|
||||
function UIresize() {
|
||||
if (WebUtil.getQueryVar('resize', false)) {
|
||||
var innerW = window.innerWidth;
|
||||
var innerH = window.innerHeight;
|
||||
var controlbarH = $D('noVNC_status_bar').offsetHeight;
|
||||
var padding = 5;
|
||||
if (innerW !== undefined && innerH !== undefined)
|
||||
rfb.setDesktopSize(innerW, innerH - controlbarH - padding);
|
||||
}
|
||||
}
|
||||
function FBUComplete(rfb, fbu) {
|
||||
UIresize();
|
||||
rfb.set_onFBUComplete(function() { });
|
||||
}
|
||||
function passwordRequired(rfb) {
|
||||
var msg;
|
||||
msg = '<form onsubmit="return setPassword();"';
|
||||
@@ -138,6 +154,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
window.onresize = function () {
|
||||
// When the window has been resized, wait until the size remains
|
||||
// the same for 0.5 seconds before sending the request for changing
|
||||
// the resolution of the session
|
||||
clearTimeout(resizeTimeout);
|
||||
resizeTimeout = setTimeout(function(){
|
||||
UIresize();
|
||||
}, 500);
|
||||
};
|
||||
|
||||
function xvpInit(ver) {
|
||||
var xvpbuttons;
|
||||
xvpbuttons = $D('noVNC_xvp_buttons');
|
||||
@@ -190,17 +216,24 @@
|
||||
return;
|
||||
}
|
||||
|
||||
rfb = new RFB({'target': $D('noVNC_canvas'),
|
||||
'encrypt': WebUtil.getQueryVar('encrypt',
|
||||
(window.location.protocol === "https:")),
|
||||
'repeaterID': WebUtil.getQueryVar('repeaterID', ''),
|
||||
'true_color': WebUtil.getQueryVar('true_color', true),
|
||||
'local_cursor': WebUtil.getQueryVar('cursor', true),
|
||||
'shared': WebUtil.getQueryVar('shared', true),
|
||||
'view_only': WebUtil.getQueryVar('view_only', false),
|
||||
'onUpdateState': updateState,
|
||||
'onXvpInit': xvpInit,
|
||||
'onPasswordRequired': passwordRequired});
|
||||
try {
|
||||
rfb = new RFB({'target': $D('noVNC_canvas'),
|
||||
'encrypt': WebUtil.getQueryVar('encrypt',
|
||||
(window.location.protocol === "https:")),
|
||||
'repeaterID': WebUtil.getQueryVar('repeaterID', ''),
|
||||
'true_color': WebUtil.getQueryVar('true_color', true),
|
||||
'local_cursor': WebUtil.getQueryVar('cursor', true),
|
||||
'shared': WebUtil.getQueryVar('shared', true),
|
||||
'view_only': WebUtil.getQueryVar('view_only', false),
|
||||
'onUpdateState': updateState,
|
||||
'onXvpInit': xvpInit,
|
||||
'onPasswordRequired': passwordRequired,
|
||||
'onFBUComplete': FBUComplete});
|
||||
} catch (exc) {
|
||||
UI.updateState(null, 'fatal', null, 'Unable to create RFB client -- ' + exc);
|
||||
return; // don't continue trying to connect
|
||||
}
|
||||
|
||||
rfb.connect(host, port, password, path);
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user