mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
Shake head on login failures.
This commit is contained in:
@@ -466,6 +466,8 @@ GuacamoleRootUI.sections.login_form.onsubmit = function() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
GuacUI.removeClass(GuacamoleRootUI.views.login, "error");
|
||||||
|
|
||||||
// Attempt login
|
// Attempt login
|
||||||
GuacamoleRootUI.login(
|
GuacamoleRootUI.login(
|
||||||
GuacamoleRootUI.fields.username.value,
|
GuacamoleRootUI.fields.username.value,
|
||||||
@@ -482,12 +484,17 @@ GuacamoleRootUI.sections.login_form.onsubmit = function() {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|
||||||
// Display error, reset and refocus password field
|
window.setTimeout(function() {
|
||||||
GuacamoleRootUI.messages.login_error.textContent = e.message;
|
|
||||||
|
|
||||||
// Reset and recofus password field
|
// Display error
|
||||||
GuacamoleRootUI.fields.password.value = "";
|
GuacUI.addClass(GuacamoleRootUI.views.login, "error");
|
||||||
GuacamoleRootUI.fields.password.focus();
|
GuacamoleRootUI.messages.login_error.textContent = e.message;
|
||||||
|
|
||||||
|
// Reset and refocus password field
|
||||||
|
GuacamoleRootUI.fields.password.value = "";
|
||||||
|
GuacamoleRootUI.fields.password.focus();
|
||||||
|
|
||||||
|
}, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,11 +53,53 @@ div#login-ui {
|
|||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes shake-head {
|
||||||
|
0% { margin-left: 0.5em; }
|
||||||
|
25% { margin-left: -0.5em; }
|
||||||
|
50% { margin-left: 0.5em; }
|
||||||
|
75% { margin-left: -0.5em; }
|
||||||
|
100% { margin-left: 0.0em; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes shake-head {
|
||||||
|
0% { margin-left: 0.5em; }
|
||||||
|
25% { margin-left: -0.5em; }
|
||||||
|
50% { margin-left: 0.5em; }
|
||||||
|
75% { margin-left: -0.5em; }
|
||||||
|
100% { margin-left: 0.0em; }
|
||||||
|
}
|
||||||
|
|
||||||
p#login-error {
|
p#login-error {
|
||||||
text-align: center;
|
display: none;
|
||||||
background: #FDD;
|
}
|
||||||
color: red;
|
|
||||||
|
.error p#login-error {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
|
||||||
|
padding: 1em;
|
||||||
margin: 0.2em;
|
margin: 0.2em;
|
||||||
|
|
||||||
|
background: #FDD;
|
||||||
|
border: 1px solid #964040;
|
||||||
|
-moz-border-radius: 0.25em;
|
||||||
|
-webkit-border-radius: 0.25em;
|
||||||
|
-khtml-border-radius: 0.25em;
|
||||||
|
text-align: center;
|
||||||
|
color: #964040;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error #login-form {
|
||||||
|
animation-name: shake-head;
|
||||||
|
animation-duration: 0.25s;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
-webkit-animation-name: shake-head;
|
||||||
|
-webkit-animation-duration: 0.25s;
|
||||||
|
-webkit-animation-timing-function: linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#login-logo {
|
div#login-logo {
|
||||||
|
Reference in New Issue
Block a user