From 9f93b82223e81ea775704fb0c208499d1415bfe4 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Tue, 27 Aug 2013 00:42:23 -0400 Subject: [PATCH] Remove temp variables for form fields --- js/passwd.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/passwd.js b/js/passwd.js index 7ca9e75..39acb95 100644 --- a/js/passwd.js +++ b/js/passwd.js @@ -3,16 +3,14 @@ $(document).ready(function() { }); $('#generate input').on('input', function() { - var root = $('#root').val(); - var master = $('#master').val() - var hash = $.md5(root + master); + var hash = $.md5($('#root').val() + ('#master').val()); hash = hash.replace(/[a-f]/, function(alpha) { return alpha.toUpperCase(); }); - if(root in special) { - $('#password').val(special[root](hash)); + if($('#root').val() in special) { + $('#password').val(special[$('#root').val()](hash)); } else { $('#password').val(hash); }