aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-03-15 07:08:58 -0400
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-03-15 07:20:42 -0400
commit1af723ca68e2558232ef4c4eb5a7c8f41a07bd0c (patch)
tree87e6ad8c086237250a220c0124c86c83340b688d /p/scripts
parent16d527693138d1839996701af87a04c4d582d213 (diff)
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.
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js12
1 files changed, 12 insertions, 0 deletions
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) {