Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- v = $(this)
- .keyup(function(){
- if( typeof el == "undefined" )
- this.el = $(this);
- var s = getPasswordStrength (this.value);
- var p = this.percents;
- var t = Math.floor( s / p );
- if( 100 <= s )
- t = this.opts.classes.length - 1;
- this.div
- .removeAttr('class')
- .addClass( this.defaultClass )
- .addClass( this.opts.classes[ t ] );
- })
- .after('<a href="#">Generate Password</a>')
- .next()
- .click(function(){
- $(this).prev().val( randomPassword() ).trigger('keyup');
- return false;
- })
- .after('<a href="#">Toggle password visibility</a>')
- .next()
- .toggle(function(){
- $(this).prev().prev().attr('type','text');
- return false;
- },function(){
- $(this).prev().prev().attr('type','password');
- return false;
- });
Add Comment
Please, Sign In to add comment