summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2018-08-15 09:18:43 +0200
committerSamuel Mannehed <samuel@cendio.se>2018-08-21 12:22:57 +0200
commitde79ae92e5f6be6219c90d054ce4bc7f587d04a8 (patch)
treea6d4a975c27c18bf666a19c9778946680f0584f7
parente0d4e5a1c0fec254933f850c2a50fc2808b97d3d (diff)
downloadnovnc-de79ae92e5f6be6219c90d054ce4bc7f587d04a8.tar.gz
Remove unneccessary code and bling from vnc_lite
Unused code, variables and unnecessary styles. The host/port check would only have an effect if someone explicitly set them as empty in the query string. The different colors of the status bar are not necessary, nor is the styling of the background.
-rw-r--r--vnc_lite.html53
1 files changed, 10 insertions, 43 deletions
diff --git a/vnc_lite.html b/vnc_lite.html
index 7f1b906..d3d33fc 100644
--- a/vnc_lite.html
+++ b/vnc_lite.html
@@ -26,21 +26,21 @@
body {
margin: 0;
- background-color: #313131;
- border-bottom-right-radius: 800px 600px;
+ background-color: dimgrey;
height: 100%;
display: flex;
flex-direction: column;
}
html {
- background-color: #494949;
height: 100%;
}
#noVNC_status_bar {
+ background-color: #6e84a3;
width: 100%;
display: flex;
justify-content: space-between;
+ border-bottom: 1px outset;
}
#noVNC_status {
color: #ffffff;
@@ -48,23 +48,6 @@
margin: auto;
}
- .noVNC_status_normal {
- background: linear-gradient(#b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%);
- }
- .noVNC_status_error {
- background: linear-gradient(#c83737 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%);
- }
- .noVNC_status_warn {
- background: linear-gradient(#b4b41e 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%);
- }
-
- .noNVC_shown {
- display: inline;
- }
- .noVNC_hidden {
- display: none;
- }
-
#noVNC_left_dummy_elem {
flex: 1;
}
@@ -106,15 +89,12 @@
desktopName = e.detail.name;
}
function credentials(e) {
- var html;
-
var form = document.createElement('form');
form.innerHTML = '<label></label>';
form.innerHTML += '<input type=password size=10 id="password_input">';
form.onsubmit = setPassword;
// bypass status() because it sets text content
- document.getElementById('noVNC_status_bar').setAttribute("class", "noVNC_status_warn");
document.getElementById('noVNC_status').innerHTML = '';
document.getElementById('noVNC_status').appendChild(form);
document.getElementById('noVNC_status').querySelector('label').textContent = 'Password Required: ';
@@ -127,16 +107,7 @@
rfb.sendCtrlAltDel();
return false;
}
- function status(text, level) {
- switch (level) {
- case 'normal':
- case 'warn':
- case 'error':
- break;
- default:
- level = "warn";
- }
- document.getElementById('noVNC_status_bar').className = "noVNC_status_" + level;
+ function status(text) {
document.getElementById('noVNC_status').textContent = text;
}
@@ -144,18 +115,18 @@
document.getElementById('sendCtrlAltDelButton').disabled = false;
if (WebUtil.getConfigVar('encrypt',
(window.location.protocol === "https:"))) {
- status("Connected (encrypted) to " + desktopName, "normal");
+ status("Connected (encrypted) to " + desktopName);
} else {
- status("Connected (unencrypted) to " + desktopName, "normal");
+ status("Connected (unencrypted) to " + desktopName);
}
}
function disconnected(e) {
document.getElementById('sendCtrlAltDelButton').disabled = true;
if (e.detail.clean) {
- status("Disconnected", "normal");
+ status("Disconnected");
} else {
- status("Something went wrong, connection is closed", "error");
+ status("Something went wrong, connection is closed");
}
}
@@ -193,11 +164,7 @@
(function() {
- status("Connecting", "normal");
-
- if ((!host) || (!port)) {
- status('Must specify host and port in URL', 'error');
- }
+ status("Connecting");
var url;
@@ -235,7 +202,7 @@
<div id="noVNC_status">Loading</div>
<div id="noVNC_buttons">
<input type=button value="Send CtrlAltDel"
- id="sendCtrlAltDelButton" class="noVNC_shown">
+ id="sendCtrlAltDelButton">
</div>
</div>
</body>