-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better input behavior #27
Changes from 1 commit
93c4454
b592e98
e9ac3b5
d3a14ff
3ed4b83
865bc15
31b3eab
0250af9
3e82895
ff83faa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,15 @@ document.addEventListener("DOMContentLoaded", function () { | |
$advanced.style.display = "block"; | ||
} | ||
} | ||
$("secure").onchange = function () { | ||
var port = $("port"); | ||
if (port.value) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of a true branch with an early return, can you just use |
||
return; | ||
} | ||
var secure = this.checked; | ||
var hint = port.placeholder.replace(/\d+/, secure ? '6697' : '6667'); | ||
port.placeholder = hint; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could all be one line: |
||
} | ||
|
||
if (localStorage.nick) { | ||
$("username").value = localStorage.nick; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A notation we've been using is to prefix variable identifiers that are elements with a dollar sign. Please rename to
var $port = ...