From 1af723ca68e2558232ef4c4eb5a7c8f41a07bd0c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 15 Mar 2014 07:08:58 -0400 Subject: Add a button to reveal/hide password I add a button on the configure user interface to reveal the password for 2 seconds and hide it after that period. See #442 I am not sure if the fallback unicode text for the icon is correct. I can not make it work. --- p/scripts/main.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 799d46625..57618c29b 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -998,6 +998,17 @@ function init_feed_observers() { }); }; +function init_password_observers() { + $('input[type="password"] + a.btn.toggle-password').on('click', function(e){ + e.preventDefault(); + var passwordField = $(this).siblings('input[type="password"]'); + passwordField.attr('type','text'); + setTimeout(function(){ + passwordField.attr('type','password'); + },2000); + }); +}; + function init_all() { if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { if (window.console) { @@ -1030,6 +1041,7 @@ function init_all() { } else { init_share_observers(); init_feed_observers(); + init_password_observers(); } if (window.console) { -- cgit v1.2.3