Forgot to include the newly created JS file
authorJef van Schendel <mail@jefvanschendel.nl>
Thu, 29 Dec 2011 21:56:42 +0000 (22:56 +0100)
committerJef van Schendel <mail@jefvanschendel.nl>
Thu, 29 Dec 2011 21:56:42 +0000 (22:56 +0100)
mediagoblin/static/js/show_password.js [new file with mode: 0644]

diff --git a/mediagoblin/static/js/show_password.js b/mediagoblin/static/js/show_password.js
new file mode 100644 (file)
index 0000000..519b29c
--- /dev/null
@@ -0,0 +1,19 @@
+$(document).ready(function(){
+  $("#password").after('<input type="text" value="" name="password_clear" id="password_clear" /><label><input type="checkbox" id="password_boolean" />Show password</label>');
+  $('#password_clear').hide();
+  $('#password_boolean').click(function(){
+    if($('#password_boolean').prop("checked")) {
+      $('#password_clear').val($('#password').val());
+      $('#password').hide();
+      $('#password_clear').show();
+    } else {
+      $('#password').val($('#password_clear').val());
+      $('#password_clear').hide();
+      $('#password').show();
+    };
+  });
+  $('#password,#password_clear').keyup(function(){
+    $('#password').val($(this).val());
+    $('#password_clear').val($(this).val());
+  });
+});