diff options
Diffstat (limited to 'static/functions/user.js')
-rw-r--r-- | static/functions/user.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/static/functions/user.js b/static/functions/user.js index b7e23dd..5542fef 100644 --- a/static/functions/user.js +++ b/static/functions/user.js @@ -217,3 +217,15 @@ function displayCommStats(stats) { } } } + +$(document).ready(function() { + $("#random_password").click(function() { + var length = 15, + charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-=<>?", + password = ""; + for (var i = 0, n = charset.length; i < length; ++i) { + password += charset.charAt(Math.floor(Math.random() * n)); + } + $('#change_password').val(password); + }); +}); |