Added the automatic resize functionality for vnc_auto.html.
This commit is contained in:
parent
359f88a764
commit
0ac6c31ccf
|
|
@ -71,7 +71,18 @@
|
||||||
"input.js", "display.js", "jsunzip.js", "rfb.js"]);
|
"input.js", "display.js", "jsunzip.js", "rfb.js"]);
|
||||||
|
|
||||||
var rfb;
|
var rfb;
|
||||||
|
var resizeTimeout;
|
||||||
|
|
||||||
|
|
||||||
|
function UIresize() {
|
||||||
|
// Control-bar height: 36px +
|
||||||
|
// border height: 5px = 41px to be deducted from the height
|
||||||
|
rfb.setDesktopSize(window.innerWidth, window.innerHeight - 41);
|
||||||
|
}
|
||||||
|
function FBUComplete(rfb, fbu) {
|
||||||
|
UIresize();
|
||||||
|
rfb.set_onFBUComplete(function() { });
|
||||||
|
}
|
||||||
function passwordRequired(rfb) {
|
function passwordRequired(rfb) {
|
||||||
var msg;
|
var msg;
|
||||||
msg = '<form onsubmit="return setPassword();"';
|
msg = '<form onsubmit="return setPassword();"';
|
||||||
|
|
@ -113,6 +124,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);
|
||||||
|
};
|
||||||
|
|
||||||
window.onscriptsload = function () {
|
window.onscriptsload = function () {
|
||||||
var host, port, password, path, token;
|
var host, port, password, path, token;
|
||||||
|
|
||||||
|
|
@ -161,7 +182,8 @@
|
||||||
'shared': WebUtil.getQueryVar('shared', true),
|
'shared': WebUtil.getQueryVar('shared', true),
|
||||||
'view_only': WebUtil.getQueryVar('view_only', false),
|
'view_only': WebUtil.getQueryVar('view_only', false),
|
||||||
'updateState': updateState,
|
'updateState': updateState,
|
||||||
'onPasswordRequired': passwordRequired});
|
'onPasswordRequired': passwordRequired,
|
||||||
|
'onFBUComplete': FBUComplete});
|
||||||
rfb.connect(host, port, password, path);
|
rfb.connect(host, port, password, path);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue