🔒🔍 Combine jQuery and zxcvbn to create a password strength meter
Перейти к файлу
Morris Jobke d78452649d
0.5.9
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-03 12:12:17 +02:00
LICENSE 0.5.9 2020-08-03 12:12:17 +02:00
README.md 0.5.9 2020-08-03 12:12:17 +02:00
bower.json 0.5.9 2020-08-03 12:12:17 +02:00
examples.html add tilesOptions (#10) 2016-04-17 20:48:32 +02:00
examples.png update example image 2016-04-06 09:37:09 +02:00
jquery.strengthify.js 0.5.9 2020-08-03 12:12:17 +02:00
jquery.strengthify.min.js 0.5.9 2020-08-03 12:12:17 +02:00
package.json 0.5.9 2020-08-03 12:12:17 +02:00
strengthify.css 0.5.9 2020-08-03 12:12:17 +02:00
strengthify.min.css Add minified js and css (#16) 2017-03-28 16:50:57 -06:00

README.md

🔒🔍 strengthify

Combine jQuery and zxcvbn to create a password strength meter.

Examples

How to use

As of 0.5.0, the wrapper will be automatically added beneath the target input field

Add jquery (tested with 1.10.0), jquery.strengthify.js and strengthify.css to your document.

If using the message option, include bootstrap.

If using the titles option, include bootstrap's tooltip.js,

<script src="jquery-1.10.0.min.js"></script>
<script src="tooltip.js"></script>
<script src="jquery.strengthify.js"></script>
<link rel="stylesheet" href="bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="strengthify.css" type="text/css">

Because zxcvbn is really heavyweight, it will be loaded asynchronously from zxcvbn/zxcvbn.js. This can however be configured with an optional parameter.

Then call .strengthify on the password input field.

$('#password-field').strengthify()

That's it. Now the password strength meter will be updated after each keystroke.

Configuration

The path and the title of the different strength categories can be configured with the first parameter of .strengthify.

userInputs
an array of strings that zxcvbn will treat as an extra dictionary
drawTitles
pop-up text (above)
drawMessage
detailed message beneath input
drawBars
password strength color progression bars beneath input
$addAfter
element after which the strengthify element should be inserted
nonce
a nonce that is added to the `