Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added email check rule to core widget, added README and LICENCE
- Loading branch information
Tane Piper
committed
Jun 21, 2010
1 parent
ce581f0
commit 81081e2
Showing
3 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License | ||
|
||
Copyright (c) 2010 Tane Piper <github@digitalspaghetti.me.uk> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
================================ | ||
jQueryUI Password Strength Meter | ||
================================ | ||
|
||
The jQuery UI Password Strength Meter is a widget for jQueryUI that provides | ||
rulesets for visualy displaying the quality of a users typed in password. | ||
|
||
The widget requires jQueryUI 1.8 core and progress meter. | ||
|
||
Options | ||
======= | ||
|
||
minChar: | ||
Default: 8 (Integer) | ||
Sets the minimum required of characters for a password to not be considered | ||
too weak | ||
|
||
progressClass: | ||
Default: ['zero', 'twenty-five', 'fifty', 'seventy-five', 'one-hundred'] (Array) | ||
The names of the classes that are added to the visual display bar, used to | ||
provide CSS overide for display | ||
|
||
verdicts: | ||
Default: ["Weak", "Normal", "Medium", "Strong", "Very Strong"] (Array) | ||
The display names for the verdicts related to the progressClass | ||
|
||
scores: | ||
Default: [17, 26, 40, 50] (Array) | ||
The scores used to determine what progressClass and verdicts to display | ||
|
||
showVerdicts: | ||
Default: true (Boolean) | ||
Determines if the verdicts are display on the progress bar or not | ||
|
||
usernameField: | ||
Default: "#username" (String) | ||
The username field to match a password to, to ensure the user does not use | ||
the same value for their password | ||
|
||
raisePower: | ||
Default: 1.4 (Double) | ||
The value used to modify the final score, allows you to tailor your results | ||
|
||
onLoad: | ||
Default: undefined (Function) | ||
A callback function, fired on load of the widget | ||
|
||
onKeyUp: | ||
Default: undefined (Function) | ||
A callback function, fired on key up when the user is typing | ||
|
||
errorMessages: | ||
Default: { | ||
password_to_short : "The Password is too short", | ||
same_as_username : "Your password cannot be the same as your username" | ||
} (Object) | ||
An object containing error messages. These can be overwritten for language | ||
purposes, and can also be added to for your custom rules. | ||
|
||
|
||
Adding Custom Rules | ||
=================== | ||
|
||
The widget comes with the functionality to easily define your own custom rules. | ||
|
||
An example is as follows | ||
|
||
The format is as follows: | ||
$.ui.pwstrength.addRule("ruleName", function(ui, word, score) {}, rule_score, rule_enabled); | ||
|
||
Example: | ||
$.ui.pwstrength.addRule("testRule", function(ui, word, score) { | ||
return word.match(/[a-z].[0-9]/) && score; | ||
}, 10, true); | ||
|
||
|
||
Callback Functions | ||
================== | ||
|
||
The widget provides two callback functions, onLoad and onKeyUp. You can use them like this: | ||
|
||
$(document).ready(function(){ | ||
var options = { | ||
onLoad: function() { | ||
$('#messages').text('Start typing password'); | ||
}, | ||
onKeyUp: function() { | ||
$('#messages').html($.ui.pwstrength.outputErrorList()); | ||
} | ||
} | ||
$(':password').pwstrength(options); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters