Remove connect dialog

It only contained a password field, which might not be needed, and
is handled by a separate dialog if it is.
This commit is contained in:
Pierre Ossman 2016-10-29 17:58:34 +02:00
parent ef3e12b595
commit 512d3605ad
3 changed files with 9 additions and 64 deletions

View File

@ -558,17 +558,12 @@ input[type=button]:active, select:active {
}
/* Connection Controls */
:root.noVNC_connected #noVNC_connect_controls_button {
:root.noVNC_connected #noVNC_connect_button {
display: none;
}
:root:not(.noVNC_connected) #noVNC_disconnect_button {
display: none;
}
#noVNC_connect_controls ul {
list-style: none;
margin: 0px;
padding: 0px;
}
/* ----------------------------------------
* Status Dialog

View File

@ -142,10 +142,7 @@ var UI;
UI.addClipboardHandlers();
UI.addSettingsHandlers();
// Show the connect panel on first load unless autoconnecting
if (!autoconnect) {
UI.openConnectPanel();
}
UI.openControlbar();
UI.updateViewClip();
@ -194,7 +191,6 @@ var UI;
/* Populate the controls if defaults are provided in the URL */
UI.initSetting('host', window.location.hostname);
UI.initSetting('port', port);
UI.initSetting('password', '');
UI.initSetting('encrypt', (window.location.protocol === "https:"));
UI.initSetting('true_color', true);
UI.initSetting('cursor', !Util.isTouchDevice);
@ -336,8 +332,6 @@ var UI;
},
addConnectionControlHandlers: function() {
document.getElementById("noVNC_connect_controls_button")
.addEventListener('click', UI.toggleConnectPanel);
document.getElementById("noVNC_disconnect_button")
.addEventListener('click', UI.disconnect);
document.getElementById("noVNC_connect_button")
@ -863,7 +857,6 @@ var UI;
UI.closeSettingsPanel();
UI.closeXvpPanel();
UI.closeClipboardPanel();
UI.closeConnectPanel();
UI.closeExtraKeys();
},
@ -1020,42 +1013,16 @@ var UI;
* CONNECTION
* ------v------*/
openConnectPanel: function() {
UI.closeAllPanels();
UI.openControlbar();
document.getElementById('noVNC_connect_controls')
.classList.add("noVNC_open");
document.getElementById('noVNC_connect_controls_button')
.classList.add("noVNC_selected");
document.getElementById('noVNC_setting_host').focus();
},
closeConnectPanel: function() {
document.getElementById('noVNC_connect_controls')
.classList.remove("noVNC_open");
document.getElementById('noVNC_connect_controls_button')
.classList.remove("noVNC_selected");
//UI.saveSetting('password');
},
toggleConnectPanel: function() {
if (document.getElementById('noVNC_connect_controls')
.classList.contains("noVNC_open")) {
UI.closeConnectPanel();
} else {
UI.openConnectPanel();
}
},
connect: function() {
var host = document.getElementById('noVNC_setting_host').value;
var port = document.getElementById('noVNC_setting_port').value;
var password = document.getElementById('noVNC_setting_password').value;
var path = document.getElementById('noVNC_setting_path').value;
var password = WebUtil.getConfigVar('password');
if (password === null) {
password = undefined;
}
if ((!host) || (!port)) {
var msg = _("Must set host and port");
Util.Error(msg);
@ -1091,7 +1058,7 @@ var UI;
if (typeof reason !== 'undefined') {
UI.showStatus(reason, 'error');
}
UI.openConnectPanel();
UI.openControlbar();
},
/* ------^-------

View File

@ -250,28 +250,11 @@
<!-- Connection Controls -->
<input type="image" alt="Connect" src="app/images/connect.svg"
id="noVNC_connect_controls_button" class="noVNC_button"
id="noVNC_connect_button" class="noVNC_button"
title="Connect" />
<input type="image" alt="Disconnect" src="app/images/disconnect.svg"
id="noVNC_disconnect_button" class="noVNC_button"
title="Disconnect" />
<div class="noVNC_vcenter">
<div id="noVNC_connect_controls" class="noVNC_panel">
<ul>
<li class="noVNC_heading">
<img src="app/images/connect.svg"> Connection
</li>
<li>
<label for="noVNC_setting_password">Password:</label>
<input id="noVNC_setting_password" type="password" />
</li>
<li><hr></li>
<li>
<input id="noVNC_connect_button" type="button" value="Connect" class="noVNC_submit" />
</li>
</ul>
</div>
</div>
</div>
</div>