Add rules to process special case password generations.

This commit is contained in:
Andrew Tomaka 2011-12-12 16:04:38 -05:00
parent a14709661a
commit 43fd5ec787
2 changed files with 13 additions and 5 deletions

View file

@ -45,6 +45,7 @@
head.js('js/jquery.corner.min.js'); head.js('js/jquery.corner.min.js');
head.js('js/jquery.zclip.min.js'); head.js('js/jquery.zclip.min.js');
head.js('js/jquery.md5.min.js'); head.js('js/jquery.md5.min.js');
head.js('js/rules.js');
head.ready(function() { head.ready(function() {
$('input').corner('round 4px'); $('input').corner('round 4px');
@ -54,7 +55,11 @@
//queroy.autocomplete to / ajax / etc. //queroy.autocomplete to / ajax / etc.
$('#generate input').change(function() { $('#generate input').change(function() {
if($('#root').val() in special) {
$('#password').val(special[$('#root').val()]($.md5($('#root').val() + $('#master').val())));
} else {
$('#password').val($.md5($('#root').val() + $('#master').val())); $('#password').val($.md5($('#root').val() + $('#master').val()));
}
}); });
$('#copy').zclip({ $('#copy').zclip({
@ -62,10 +67,7 @@
copy: function() { copy: function() {
return $('#password').val() return $('#password').val()
}, },
afterCopy: function() { afterCopy: function() {}
$.post('update.php', { site: $('#root').val() },
function(data) {});
}
}); });
}); });
</script> </script>

6
js/rules.js Executable file
View file

@ -0,0 +1,6 @@
var special = new Array();
special['53.com'] = (function(password) {
// 6-12 characters
return password.substr(0,12);
});