From 22d312758df4abd0fe718467f95fd65686315076 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Tue, 16 Mar 2021 14:34:35 -0700 Subject: [PATCH] Hide sensitive setting text fields with button to reveal --- data/interfaces/default/settings.html | 67 +++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 1c36d6f2..6e09667d 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -688,14 +688,17 @@
Current API key: ${config['api_key']}
+API key used to access the Tautulli API.
@@ -774,7 +777,12 @@@@ -923,7 +931,10 @@
Enter the password that will be required to view self-hosted newsletters.
@@ -1259,7 +1275,12 @@Enter your Imgur API Client ID.
@@ -1281,7 +1302,12 @@@@ -1292,7 +1318,12 @@
@@ -1303,7 +1334,12 @@
@@ -3123,13 +3159,24 @@ $(document).ready(function() { } }); - $("body").on('click', '[data-toggle=browse]', function () { + $('body').on('click', '[data-toggle=browse]', function () { var filter = $(this).data('filter'); var target = $(this).data('target'); var path = $(target).val(); var description = $(this).data('description') || $("label[for='" + target.replace('#', '') + "']").text(); openBrowsePath(null, path, filter, description, target); }); + + $('body').on('click', '.reveal-token', function() { + var input = $(this).parent().next('input'); + if (input.prop('type') === 'password') { + input.prop('type', 'text'); + $(this).children('.fa').removeClass('fa-eye-slash').addClass('fa-eye'); + } else { + input.prop('type', 'password'); + $(this).children('.fa').removeClass('fa-eye').addClass('fa-eye-slash'); + } + }); }); %def>