From 512d3605add8ccd6ae1e9fcf6736ec51a3d8bba5 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sat, 29 Oct 2016 17:58:34 +0200 Subject: [PATCH] Remove connect dialog It only contained a password field, which might not be needed, and is handled by a separate dialog if it is. --- app/styles/base.css | 7 +------ app/ui.js | 47 +++++++-------------------------------------- vnc.html | 19 +----------------- 3 files changed, 9 insertions(+), 64 deletions(-) diff --git a/app/styles/base.css b/app/styles/base.css index 606c135..51ba939 100644 --- a/app/styles/base.css +++ b/app/styles/base.css @@ -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 diff --git a/app/ui.js b/app/ui.js index b2e7e99..a8b6ec1 100644 --- a/app/ui.js +++ b/app/ui.js @@ -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(); }, /* ------^------- diff --git a/vnc.html b/vnc.html index bdb706c..e56065e 100644 --- a/vnc.html +++ b/vnc.html @@ -250,28 +250,11 @@ -
-
-
    -
  • - Connection -
  • -
  • - - -
  • -

  • -
  • - -
  • -
-
-
-- 2.39.2