Invalid argument jquery-1.6.2 line 8538
HTML
<input type="password" value="" name="password" id="register_password">
<ul class="well-bad invisible" id="pass_strength_container" style="display: block;">
<li id="password_strength">
<div class="passwordStrengthBar" style="width: 100px;"><div style=" overflow: hidden;" class="strong"></div></div>
</li>
<li class="password_text" id="password_text">Strong</li>
</ul>
CSS
.passwordStrengthBar {
background: white;
border: 1px solid #777777;
width: 100px;
}
.passwordStrengthBar div {
height: 5px;
width: 0%;
}
.passwordStrengthBar div.strong {
background-color: #32cd32;
}
.passwordStrengthBar div.medium {
background-color: yellow;
}
.passwordStrengthBar div.weak {
background-color: orange;
}
.passwordStrengthBar div.useless {
background-color: red;
}
JavaScript
/* Intelligent Web NameSpace */
var IW = IW || {};
/**
* Password validator logic
*/
(function(IW) {
var secondsInADay = 86400;
function PasswordValidator() {
}
/**
* How long a password can be expected to last
*/
PasswordValidator.prototype.passwordLifeTimeInDays = 365;
/**
* An estimate of how many attempts could be made per second to guess a password
*/
PasswordValidator.prototype.passwordAttemptsPerSecond = 500;
/**
* An array of regular expressions to match against the password. Each is associated
* with the number of unique characters that each expression can match.
* @param password
*/
PasswordValidator.prototype.expressions = [
{
regex : /[A-Z]+/,
uniqueChars : 26
},
{
regex : /[a-z]+/,
uniqueChars : 26
},
{
regex : /[0-9]+/,
uniqueChars : 10
},
{
regex : /[!\?.;,\\@$£#*()%~<>{}\[\]]+/,
uniqueChars : 17
}
];
/**
* Checks the supplied password
* @param {String} password
* @return The predicted lifetime of the password, as a percentage of the defined password lifetime.
*/
PasswordValidator.prototype.checkPassword = function(password) {
var
expressions = this.expressions,
i,
l = expressions.length,
expression,
possibilitiesPerLetterInPassword = 0;
for (i = 0; i < l; i++) {
expression = expressions[i];
if (expression.regex.exec(password)) {
possibilitiesPerLetterInPassword += expression.uniqueChars;
}
}
var
totalCombinations = Math.pow(possibilitiesPerLetterInPassword, password.length),
// how long, on average,...