Skip to content
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

Small edits to login.js #305

Merged
merged 3 commits into from
Jul 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions public/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ textarea {
border: none;
}

textarea:focus, input:focus {
/*border-color: transparent !important;*/
}

input:focus::-webkit-input-placeholder { color:transparent; }
input:focus:-moz-placeholder { color:transparent; }
input:focus::-moz-placeholder { color:transparent; }
Expand Down Expand Up @@ -235,7 +231,6 @@ iframe {

#error {
color: red;
display: none;
}

#bottom-text {
Expand Down
26 changes: 10 additions & 16 deletions public/js/login.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
// Display appropriate error message on failed login
let err;
if ((err = (new URLSearchParams(window.location.search)).get("error"))) {
let message;
switch (err) {
case "loginfail":
message = "Incorrect username or password.";
break;
case "aspendown":
message = "Aspen is currently unreachable.";
break;
}
if (message) {
const elem = document.querySelector("#error");
elem.style.setProperty("display", "unset");
elem.textContent = message;
}
const elem = document.getElementById("error");
switch (new URLSearchParams(window.location.search).get("error")) {
case "loginfail":
elem.textContent = "Incorrect username or password.";
break;
case "aspendown":
elem.textContent = "Aspen is currently unreachable.";
break;
default:
elem.style.setProperty("display", "none");
}

// Remove vestiges of client-side "remember me" from localStorage
Expand Down
2 changes: 1 addition & 1 deletion public/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
Enter Aspen credentials or leave blank to import data
</span>
<br/>
<span id="error" class="txt3"></span>
<span id="error"></span>
</div>
<!-- Username Input -->
<div class="wrap-input100">
Expand Down