Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/strengthify.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-03-21 23:49:50 +0300
committerGitHub <noreply@github.com>2019-03-21 23:49:50 +0300
commit94333af0ce50adaaebc674ea1429a9291e2b4eec (patch)
tree0f077a0e6c0b2199ced668c91476fae30505e447
parentc03806c2db3e324923c1c37a974b1b92c85c5676 (diff)
parent0ba7497289593e692839570fabf13239a1731eb5 (diff)
Merge pull request #27 from welch3694/zxcvbn-user_input
Add userInputs option and pass to zxcvbn
-rw-r--r--README.md2
-rw-r--r--jquery.strengthify.js3
2 files changed, 4 insertions, 1 deletions
diff --git a/README.md b/README.md
index 8320aae..8891c39 100644
--- a/README.md
+++ b/README.md
@@ -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 = '',