diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-03-21 23:49:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-21 23:49:50 +0300 |
commit | 94333af0ce50adaaebc674ea1429a9291e2b4eec (patch) | |
tree | 0f077a0e6c0b2199ced668c91476fae30505e447 | |
parent | c03806c2db3e324923c1c37a974b1b92c85c5676 (diff) | |
parent | 0ba7497289593e692839570fabf13239a1731eb5 (diff) |
Merge pull request #27 from welch3694/zxcvbn-user_input
Add userInputs option and pass to zxcvbn
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | jquery.strengthify.js | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -46,6 +46,7 @@ be configured with the first parameter of `.strengthify`. <dl> +<dt>userInputs</dt><dd> an array of strings that zxcvbn will treat as an extra dictionary</dd> <dt>drawTitles</dt><dd> pop-up text (above)</dd> <dt>drawMessage</dt><dd> detailed message beneath input</dd> <dt>drawBars</dt><dd> password strength color progression bars beneath input</dd> @@ -58,6 +59,7 @@ Default: ```JSON { "zxcvbn": "zxcvbn/zxcvbn.js", + "userInputs": [], "titles": [ "Weakest", "Weak", diff --git a/jquery.strengthify.js b/jquery.strengthify.js index 2484e84..47641f0 100644 --- a/jquery.strengthify.js +++ b/jquery.strengthify.js @@ -38,6 +38,7 @@ var defaults = { zxcvbn: 'zxcvbn/zxcvbn.js', + userInputs: [], titles: [ 'Weakest', 'Weak', @@ -74,7 +75,7 @@ // hide strengthify if no input is provided opacity = (password === '') ? 0 : 1, // calculate result - result = zxcvbn(password), + result = zxcvbn(password, options.userInputs), // setup some vars for later css = '', bsLevel = '', |