diff options
author | Samuel Mannehed <samuel@cendio.se> | 2018-08-16 11:52:32 +0200 |
---|---|---|
committer | Samuel Mannehed <samuel@cendio.se> | 2018-08-28 10:42:39 +0200 |
commit | 26d51e490e16b6ab0cdd0b67e97e8b00070a3e8e (patch) | |
tree | 166815aae68f32b243a7925b7299e046f49edaf5 | |
parent | c756665e81ff486869848875f2639cc423a10251 (diff) | |
download | novnc-26d51e490e16b6ab0cdd0b67e97e8b00070a3e8e.tar.gz |
Order vnc_lite functions
-rw-r--r-- | vnc_lite.html | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/vnc_lite.html b/vnc_lite.html index a8d5e26..4ba4932 100644 --- a/vnc_lite.html +++ b/vnc_lite.html @@ -86,10 +86,21 @@ let rfb; let desktopName; - // When this function is called we have received - // a desktop name from the server - function updateDesktopName(e) { - desktopName = e.detail.name; + // When this function is called we have + // successfully connected to a server + function connectedToServer(e) { + document.getElementById('sendCtrlAltDelButton').disabled = false; + status("Connected to " + desktopName); + } + + // This function is called when we are disconnected + function disconnectedFromServer(e) { + document.getElementById('sendCtrlAltDelButton').disabled = true; + if (e.detail.clean) { + status("Disconnected"); + } else { + status("Something went wrong, connection is closed"); + } } // When this function is called, the server requires @@ -108,6 +119,12 @@ document.getElementById('noVNC_status').querySelector('label').textContent = 'Password Required: '; } + // When this function is called we have received + // a desktop name from the server + function updateDesktopName(e) { + desktopName = e.detail.name; + } + // Send the credentials from the input element function setPassword() { rfb.sendCredentials({ password: document.getElementById('password_input').value }); @@ -121,28 +138,12 @@ rfb.sendCtrlAltDel(); return false; } + // Show a status text in the top bar function status(text) { document.getElementById('noVNC_status').textContent = text; } - // When this function is called we have - // successfully connected to a server - function connectedToServer(e) { - document.getElementById('sendCtrlAltDelButton').disabled = false; - status("Connected to " + desktopName); - } - - // This function is called when we are disconnected - function disconnectedFromServer(e) { - document.getElementById('sendCtrlAltDelButton').disabled = true; - if (e.detail.clean) { - status("Disconnected"); - } else { - status("Something went wrong, connection is closed"); - } - } - // This function extracts the value of one variable from the // query string. If the variable isn't defined in the URL // it returns the default value instead. |