From e947daff4518fa0f5f1098b4e38815bb9ae769f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Mastrup?= Date: Wed, 25 Oct 2023 11:36:17 +0200 Subject: [PATCH] Added password toggle to Umbraco installer form --- .../src/installer/steps/user.controller.js | 7 +++++ .../src/installer/steps/user.html | 12 ++++++-- .../src/less/installer.less | 28 +++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js b/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js index 8b42bdbe27..c7f0bdb1c3 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/user.controller.js @@ -86,6 +86,13 @@ angular.module("umbraco.install").controller("Umbraco.Install.UserController", f } }; + $scope.togglePassword = function () { + var elem = $("form[name='installerForm'] input[name='installer.current.model.password']"); + elem.attr("type", (elem.attr("type") === "text" ? "password" : "text")); + elem.focus(); + $(".password-text.show, .password-text.hide").toggle(); + } + function onChangeConsent(values) { const result = Math.round(Number(values[0]) - 1); diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/user.html b/src/Umbraco.Web.UI.Client/src/installer/steps/user.html index ea487e046a..d1acf0691b 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/user.html +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/user.html @@ -49,9 +49,9 @@
- + + +
+ +
+ At least {{installer.current.model.minCharLength}} characters long