Rename functions in vnc_lite
Give them obvious names to make the code easier to understand.
This commit is contained in:
parent
25551b6b40
commit
c756665e81
|
@ -94,7 +94,7 @@
|
||||||
|
|
||||||
// When this function is called, the server requires
|
// When this function is called, the server requires
|
||||||
// credentials to authenticate
|
// credentials to authenticate
|
||||||
function credentials(e) {
|
function credentialsAreRequired(e) {
|
||||||
// Let's create a password input
|
// Let's create a password input
|
||||||
const form = document.createElement('form');
|
const form = document.createElement('form');
|
||||||
form.innerHTML = '<label></label>';
|
form.innerHTML = '<label></label>';
|
||||||
|
@ -128,13 +128,13 @@
|
||||||
|
|
||||||
// When this function is called we have
|
// When this function is called we have
|
||||||
// successfully connected to a server
|
// successfully connected to a server
|
||||||
function connected(e) {
|
function connectedToServer(e) {
|
||||||
document.getElementById('sendCtrlAltDelButton').disabled = false;
|
document.getElementById('sendCtrlAltDelButton').disabled = false;
|
||||||
status("Connected to " + desktopName);
|
status("Connected to " + desktopName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is called when we are disconnected
|
// This function is called when we are disconnected
|
||||||
function disconnected(e) {
|
function disconnectedFromServer(e) {
|
||||||
document.getElementById('sendCtrlAltDelButton').disabled = true;
|
document.getElementById('sendCtrlAltDelButton').disabled = true;
|
||||||
if (e.detail.clean) {
|
if (e.detail.clean) {
|
||||||
status("Disconnected");
|
status("Disconnected");
|
||||||
|
@ -197,9 +197,9 @@
|
||||||
{ credentials: { password: password } });
|
{ credentials: { password: password } });
|
||||||
|
|
||||||
// Add listeners to important events from the RFB module
|
// Add listeners to important events from the RFB module
|
||||||
rfb.addEventListener("connect", connected);
|
rfb.addEventListener("connect", connectedToServer);
|
||||||
rfb.addEventListener("disconnect", disconnected);
|
rfb.addEventListener("disconnect", disconnectedFromServer);
|
||||||
rfb.addEventListener("credentialsrequired", credentials);
|
rfb.addEventListener("credentialsrequired", credentialsAreRequired);
|
||||||
rfb.addEventListener("desktopname", updateDesktopName);
|
rfb.addEventListener("desktopname", updateDesktopName);
|
||||||
|
|
||||||
// Set parameters that can be changed on an active connection
|
// Set parameters that can be changed on an active connection
|
||||||
|
|
Loading…
Reference in New Issue