vnc_auto.html: sync with mobile changes.
Also, add path option settable with query string.
This commit is contained in:
parent
6209639f2c
commit
a7f5589946
|
@ -11,7 +11,7 @@
|
||||||
<head>
|
<head>
|
||||||
<title>noVNC</title>
|
<title>noVNC</title>
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<link rel="stylesheet" href="include/plain.css" title="plain">
|
<link rel="stylesheet" href="include/base.css" title="plain">
|
||||||
<!--
|
<!--
|
||||||
<script type='text/javascript'
|
<script type='text/javascript'
|
||||||
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
||||||
|
@ -19,18 +19,18 @@
|
||||||
<script src="include/vnc.js"></script>
|
<script src="include/vnc.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="margin: 0px;" onKeyDown="onKeyDown(event);">
|
<body style="margin: 0px;">
|
||||||
<div id="VNC_screen">
|
<div id="noVNC_screen">
|
||||||
<div id="VNC_status_bar" class="VNC_status_bar" style="margin-top: 0px;">
|
<div id="noVNC_status_bar" class="noVNC_status_bar" style="margin-top: 0px;">
|
||||||
<table border=0 width="100%"><tr>
|
<table border=0 width="100%"><tr>
|
||||||
<td><div id="VNC_status">Loading</div></td>
|
<td><div id="noVNC_status">Loading</div></td>
|
||||||
<td width="1%"><div id="VNC_buttons">
|
<td width="1%"><div id="noVNC_buttons">
|
||||||
<input type=button value="Send CtrlAltDel"
|
<input type=button value="Send CtrlAltDel"
|
||||||
id="sendCtrlAltDelButton">
|
id="sendCtrlAltDelButton">
|
||||||
</div></td>
|
</div></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
</div>
|
</div>
|
||||||
<canvas id="VNC_canvas" width="640px" height="20px">
|
<canvas id="noVNC_canvas" width="640px" height="20px">
|
||||||
Canvas not supported.
|
Canvas not supported.
|
||||||
</canvas>
|
</canvas>
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,10 +47,10 @@
|
||||||
msg = '<form onsubmit="return setPassword();"';
|
msg = '<form onsubmit="return setPassword();"';
|
||||||
msg += ' style="margin-bottom: 0px">';
|
msg += ' style="margin-bottom: 0px">';
|
||||||
msg += 'Password Required: ';
|
msg += 'Password Required: ';
|
||||||
msg += '<input type=password size=10 id="password_input" class="VNC_status">';
|
msg += '<input type=password size=10 id="password_input" class="noVNC_status">';
|
||||||
msg += '<\/form>';
|
msg += '<\/form>';
|
||||||
$D('VNC_status_bar').setAttribute("class", "VNC_status_warn");
|
$D('noVNC_status_bar').setAttribute("class", "noVNC_status_warn");
|
||||||
$D('VNC_status').innerHTML = msg;
|
$D('noVNC_status').innerHTML = msg;
|
||||||
}
|
}
|
||||||
function setPassword() {
|
function setPassword() {
|
||||||
rfb.sendPassword($D('password_input').value);
|
rfb.sendPassword($D('password_input').value);
|
||||||
|
@ -62,8 +62,8 @@
|
||||||
}
|
}
|
||||||
function updateState(rfb, state, oldstate, msg) {
|
function updateState(rfb, state, oldstate, msg) {
|
||||||
var s, sb, cad, level;
|
var s, sb, cad, level;
|
||||||
s = $D('VNC_status');
|
s = $D('noVNC_status');
|
||||||
sb = $D('VNC_status_bar');
|
sb = $D('noVNC_status_bar');
|
||||||
cad = $D('sendCtrlAltDelButton');
|
cad = $D('sendCtrlAltDelButton');
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case 'failed': level = "error"; break;
|
case 'failed': level = "error"; break;
|
||||||
|
@ -78,34 +78,36 @@
|
||||||
else { cad.disabled = true; }
|
else { cad.disabled = true; }
|
||||||
|
|
||||||
if (typeof(msg) !== 'undefined') {
|
if (typeof(msg) !== 'undefined') {
|
||||||
sb.setAttribute("class", "VNC_status_" + level);
|
sb.setAttribute("class", "noVNC_status_" + level);
|
||||||
s.innerHTML = msg;
|
s.innerHTML = msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
var host, port, password;
|
var host, port, password, path;
|
||||||
|
|
||||||
|
$D('sendCtrlAltDelButton').style.display = "inline";
|
||||||
$D('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
|
$D('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
|
||||||
|
|
||||||
document.title = unescape(WebUtil.getQueryVar('title', 'noVNC'));
|
document.title = unescape(WebUtil.getQueryVar('title', 'noVNC'));
|
||||||
host = WebUtil.getQueryVar('host', null);
|
host = WebUtil.getQueryVar('host', null);
|
||||||
port = WebUtil.getQueryVar('port', null);
|
port = WebUtil.getQueryVar('port', null);
|
||||||
password = WebUtil.getQueryVar('password', '');
|
password = WebUtil.getQueryVar('password', '');
|
||||||
|
path = WebUtil.getQueryVar('path', '');
|
||||||
if ((!host) || (!port)) {
|
if ((!host) || (!port)) {
|
||||||
updateState('failed',
|
updateState('failed',
|
||||||
"Must specify host and port in URL");
|
"Must specify host and port in URL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rfb = new RFB({'target': $D('VNC_canvas'),
|
rfb = new RFB({'target': $D('noVNC_canvas'),
|
||||||
'encrypt': WebUtil.getQueryVar('encrypt', false),
|
'encrypt': WebUtil.getQueryVar('encrypt', false),
|
||||||
'true_color': WebUtil.getQueryVar('true_color', true),
|
'true_color': WebUtil.getQueryVar('true_color', true),
|
||||||
'local_cursor': WebUtil.getQueryVar('cursor', true),
|
'local_cursor': WebUtil.getQueryVar('cursor', true),
|
||||||
'shared': WebUtil.getQueryVar('shared', true),
|
'shared': WebUtil.getQueryVar('shared', true),
|
||||||
'updateState': updateState,
|
'updateState': updateState,
|
||||||
'onPasswordRequired': passwordRequired});
|
'onPasswordRequired': passwordRequired});
|
||||||
rfb.connect(host, port, password);
|
rfb.connect(host, port, password, path);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue