1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00

fixes javascript style issues

This commit is contained in:
Falk Werner 2019-04-01 22:06:22 +02:00
parent 1dc135fca4
commit def500fd79
2 changed files with 13 additions and 13 deletions

View File

@ -6,51 +6,51 @@ export class ConnectionView {
this.element = document.createElement("div"); this.element = document.createElement("div");
const a = document.createElement("div"); const connectBox = document.createElement("div");
this.element.appendChild(a); this.element.appendChild(connectBox);
const urlLabel = document.createElement("span"); const urlLabel = document.createElement("span");
urlLabel.textContent = "URL:"; urlLabel.textContent = "URL:";
a.appendChild(urlLabel); connectBox.appendChild(urlLabel);
this.urlTextbox = document.createElement("input"); this.urlTextbox = document.createElement("input");
this.urlTextbox.type = "text"; this.urlTextbox.type = "text";
this.urlTextbox.value = window.location.href.replace(/^http/, "ws"); this.urlTextbox.value = window.location.href.replace(/^http/, "ws");
a.appendChild(this.urlTextbox); connectBox.appendChild(this.urlTextbox);
this.connectButton = document.createElement("input"); this.connectButton = document.createElement("input");
this.connectButton.type = "button"; this.connectButton.type = "button";
this.connectButton.value = "connect"; this.connectButton.value = "connect";
this.connectButton.addEventListener("click", () => { this._onConnectButtonClicked(); }); this.connectButton.addEventListener("click", () => { this._onConnectButtonClicked(); });
a.appendChild(this.connectButton); connectBox.appendChild(this.connectButton);
const b = document.createElement("div"); const authenticateBox = document.createElement("div");
this.element.appendChild(b); this.element.appendChild(authenticateBox);
const usernameLabel = document.createElement("span"); const usernameLabel = document.createElement("span");
usernameLabel.textContent = "user:"; usernameLabel.textContent = "user:";
b.appendChild(usernameLabel); authenticateBox.appendChild(usernameLabel);
this.usernameTextbox = document.createElement("input"); this.usernameTextbox = document.createElement("input");
this.usernameTextbox.type = "text"; this.usernameTextbox.type = "text";
this.usernameTextbox.value = "bob"; this.usernameTextbox.value = "bob";
b.appendChild(this.usernameTextbox); authenticateBox.appendChild(this.usernameTextbox);
const passwordLabel = document.createElement("span"); const passwordLabel = document.createElement("span");
passwordLabel.textContent = "user:"; passwordLabel.textContent = "user:";
b.appendChild(passwordLabel); authenticateBox.appendChild(passwordLabel);
this.passwordTextbox = document.createElement("input"); this.passwordTextbox = document.createElement("input");
this.passwordTextbox.type = "password"; this.passwordTextbox.type = "password";
this.passwordTextbox.value = "secret"; this.passwordTextbox.value = "secret";
b.appendChild(this.passwordTextbox); authenticateBox.appendChild(this.passwordTextbox);
this.authenticateButton = document.createElement("input"); this.authenticateButton = document.createElement("input");
this.authenticateButton.type = "button"; this.authenticateButton.type = "button";
this.authenticateButton.value = "authenticate"; this.authenticateButton.value = "authenticate";
this.authenticateButton.addEventListener("click", () => { this._onAuthenticateButtonClicked(); }); this.authenticateButton.addEventListener("click", () => { this._onAuthenticateButtonClicked(); });
b.appendChild(this.authenticateButton); authenticateBox.appendChild(this.authenticateButton);
} }
_onConnectButtonClicked() { _onConnectButtonClicked() {