diff --git a/client/css/bootstrap.css b/client/css/bootstrap.css index e1d5b223..5f41c698 100644 --- a/client/css/bootstrap.css +++ b/client/css/bootstrap.css @@ -143,6 +143,10 @@ input::-moz-focus-inner { border: 0; padding: 0; } +input::-ms-clear, +input::-ms-reveal { + display: none; +} input { line-height: normal; } diff --git a/client/css/style.css b/client/css/style.css index af3ef6aa..c07500d1 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -1675,30 +1675,49 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */ position: relative; } +.password-container input { + padding-right: 37px; +} + #sign-in .password-container { width: 100%; } -.password-container .see-pw { +#sign-in .password-container .reveal-password { + top: 31px; + right: 0; +} + +.password-container .reveal-password { + height: 37px; + width: 37px; + position: absolute; + top: 2px; + right: 15px; + cursor: pointer; +} + +.password-container .reveal-password i { font: normal normal normal 14px/1 FontAwesome; font-size: 16px; color: #cdd3da; - position: absolute; - top: 13px; - right: 25px; + display: flex; + justify-content: center; + align-items: center; + height: 100%; } -#sign-in .password-container .see-pw { - top: 42px; - right: 10px; +.password-container .reveal-password i:hover { + color: #79838c; } -.password-container .see-pw::before { +.password-container .reveal-password i::before { content: "\f06e"; /* https://fontawesome.com/icons/eye?style=solid */ } -.password-container .see-pw.visible::before { +.password-container .reveal-password.visible i::before { content: "\f070"; /* https://fontawesome.com/icons/eye-slash?style=solid */ + color: #ff4136; } #help .help-item { diff --git a/client/js/socket-events/auth.js b/client/js/socket-events/auth.js index 773d8da1..1ffbfab0 100644 --- a/client/js/socket-events/auth.js +++ b/client/js/socket-events/auth.js @@ -23,9 +23,7 @@ socket.on("auth", function(data) { login.html(templates.windows.sign_in()); - $(".see-pw").on("click", function() { - utils.togglePasswordField(this); - }); + utils.togglePasswordField(".reveal-password"); login.find("form").on("submit", function() { const form = $(this); diff --git a/client/js/socket-events/configuration.js b/client/js/socket-events/configuration.js index bd5e1790..04b8ba88 100644 --- a/client/js/socket-events/configuration.js +++ b/client/js/socket-events/configuration.js @@ -30,9 +30,7 @@ socket.on("configuration", function(data) { pop.play(); }); - $(".see-pw").on("click", function() { - utils.togglePasswordField(this); - }); + utils.togglePasswordField(".reveal-password"); options.initialize(); webpush.initialize(); @@ -89,8 +87,6 @@ socket.on("configuration", function(data) { $(this).data("lastvalue", nick); }); - $(".see-pw").on("click", function() { - utils.togglePasswordField(this); - }); + utils.togglePasswordField(".reveal-password"); }); }); diff --git a/client/js/socket-events/network.js b/client/js/socket-events/network.js index f72dc81c..78c1633f 100644 --- a/client/js/socket-events/network.js +++ b/client/js/socket-events/network.js @@ -43,7 +43,5 @@ socket.on("network:info", function(data) { .click(); }); - $(".see-pw").on("click", function() { - utils.togglePasswordField(this); - }); + utils.togglePasswordField(".reveal-password"); }); diff --git a/client/js/utils.js b/client/js/utils.js index da26b6a2..01aa459d 100644 --- a/client/js/utils.js +++ b/client/js/utils.js @@ -98,19 +98,22 @@ function toggleNotificationMarkers(newState) { viewport.toggleClass("notified", newState); } -function togglePasswordField(that) { - const $this = $(that); - const input = $this.closest("div").find("input"); +function togglePasswordField(elem) { + $(elem).on("click", function() { + const $this = $(this); + const input = $this.closest("div").find("input"); - if (input.attr("type") === "password") { - input.attr("type", "text"); - $this.attr("title", "Hide Password"); - } else { - input.attr("type", "password"); - $this.attr("title", "Show Password"); - } + input.attr("type") === "password" ? input.attr("type", "text") : input.attr("type", "password"); - $this.toggleClass("visible"); + swapLabel($this); + $this.toggleClass("visible"); + }); +} + +// Given a span, swap its aria-label with the content of `data-alt-label` +function swapLabel(span) { + const altText = span.data("alt-label"); + span.data("alt-label", span.attr("aria-label")).attr("aria-label", altText); } function confirmExit() { diff --git a/client/views/windows/connect.tpl b/client/views/windows/connect.tpl index 2a26ac69..8eeedbc9 100644 --- a/client/views/windows/connect.tpl +++ b/client/views/windows/connect.tpl @@ -80,7 +80,9 @@
- + + +
diff --git a/client/views/windows/settings.tpl b/client/views/windows/settings.tpl index 486c725d..5c025048 100644 --- a/client/views/windows/settings.tpl +++ b/client/views/windows/settings.tpl @@ -190,17 +190,23 @@
- + + +
- + + +
- + + +
diff --git a/client/views/windows/sign_in.tpl b/client/views/windows/sign_in.tpl index 8bcc6701..17e30981 100644 --- a/client/views/windows/sign_in.tpl +++ b/client/views/windows/sign_in.tpl @@ -8,7 +8,9 @@
- + + +
Authentication failed.