Rename functions in vnc_lite

Give them obvious names to make the code easier to understand.
This commit is contained in:
Samuel Mannehed 2018-08-16 11:38:35 +02:00
parent 25551b6b40
commit c756665e81
1 changed files with 6 additions and 6 deletions

View File

@ -94,7 +94,7 @@
// When this function is called, the server requires
// credentials to authenticate
function credentials(e) {
function credentialsAreRequired(e) {
// Let's create a password input
const form = document.createElement('form');
form.innerHTML = '<label></label>';
@ -128,13 +128,13 @@
// When this function is called we have
// successfully connected to a server
function connected(e) {
function connectedToServer(e) {
document.getElementById('sendCtrlAltDelButton').disabled = false;
status("Connected to " + desktopName);
}
// This function is called when we are disconnected
function disconnected(e) {
function disconnectedFromServer(e) {
document.getElementById('sendCtrlAltDelButton').disabled = true;
if (e.detail.clean) {
status("Disconnected");
@ -197,9 +197,9 @@
{ credentials: { password: password } });
// Add listeners to important events from the RFB module
rfb.addEventListener("connect", connected);
rfb.addEventListener("disconnect", disconnected);
rfb.addEventListener("credentialsrequired", credentials);
rfb.addEventListener("connect", connectedToServer);
rfb.addEventListener("disconnect", disconnectedFromServer);
rfb.addEventListener("credentialsrequired", credentialsAreRequired);
rfb.addEventListener("desktopname", updateDesktopName);
// Set parameters that can be changed on an active connection