Class SS.control.passwordmeter
Password Strength Meter. Displays a bar and message indicating how secure the password that has been entered is.
Defined in: SS.control.passwordmeter.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
| Field Attributes | Field Name and Description |
|---|---|
|
Class name to apply to the outer most element of the password meter control
once it has rendered.
|
|
|
Class name to apply to the strength bar element of the password meter control
once it has rendered.
|
|
|
Class name to apply to the message text element of the password meter control
once it has rendered and the password entered is in a state of errpr.
|
|
|
Class name to apply to the message text element of the password meter control
once it has rendered and the password entered is current considered to be weak.
|
|
|
Class name to apply to the message text element of the password meter control
once it has rendered and the password entered is current considered to be of
medium strength.
|
|
|
Class name to apply to the message text of the password meter control
once it has rendered.
|
|
|
Class name to apply to the message text element of the password meter control
once it has rendered and the password entered is current considered to be weak
Default = "SS_control_passwordmeter_weak".
|
|
|
Identifier of the passwordmeter control.
|
|
|
Id of the input control to link the password meter to.
|
|
|
Maximum number of characters the password should be.
|
|
|
Minimum number of characters the password should be.
|
|
|
Message to display if the password is does not match the regular expression
as defined in regex.
|
|
|
Message to display if the number of characters in the password entered exceeds the
maximum number of characters required, as defined in maxlength.
|
|
|
Message to display if the password is considered to be of "medium" strength.
|
|
|
Message to display if the number of characters in the password entered does not
equal or exceed the minimum number of characters required, as defined in minlength.
|
|
|
Message to display if the password is considered to be "strong".
|
|
|
Message to display if the password is considered to be "weak".
|
|
|
Holds the entered password.
|
|
|
Regular expression to validate the password against.
|
|
|
Holds password strength value.
|
|
|
Weighting used in the algorithm that calculates the strength of a
password.
|
| Method Attributes | Method Name and Description |
|---|---|
|
render()
Renders the passwordmeter control on the page and links it to the input password field.
|
|
|
strength()
Calculates the strength of the current password in the range -1 to 100 where
-1 = "invalid", 0 = "weakest", and 100 = "strongest".
|
Field Detail
css
Class name to apply to the outer most element of the password meter control
once it has rendered. Default = "SS_control_passwordmeter"
css_bar
Class name to apply to the strength bar element of the password meter control
once it has rendered. Default = "SS_control_passwordmeter_bar"
css_error
Class name to apply to the message text element of the password meter control
once it has rendered and the password entered is in a state of errpr. Typically
this is when the password eneterd does not match the defined password regular
expression, see regex.
Default = "SS_control_passwordmeter_error".
css_medium
Class name to apply to the message text element of the password meter control
once it has rendered and the password entered is current considered to be weak.
Default = "SS_control_passwordmeter_medium".
css_strong
Class name to apply to the message text element of the password meter control
once it has rendered and the password entered is current considered to be of
medium strength. Default = "SS_control_passwordmeter_strong".
css_text
Class name to apply to the message text of the password meter control
once it has rendered. Default = "SS_control_passwordmeter_text"
css_weak
Class name to apply to the message text element of the password meter control
once it has rendered and the password entered is current considered to be weak
Default = "SS_control_passwordmeter_weak".
id
Identifier of the passwordmeter control.
linkto
Id of the input control to link the password meter to. Typically this will be a password input {HTMLElement}.
maxlength
Maximum number of characters the password should be. 0 = unlimited.
minlength
Minimum number of characters the password should be.
msg_invalid
Message to display if the password is does not match the regular expression
as defined in regex. Default = "Invalid Password".
msg_long
Message to display if the number of characters in the password entered exceeds the
maximum number of characters required, as defined in maxlength.
Default = "Too Long".
msg_medium
Message to display if the password is considered to be of "medium" strength. Default = "Medium".
msg_short
Message to display if the number of characters in the password entered does not
equal or exceed the minimum number of characters required, as defined in minlength.
Default = "Too Short".
msg_strong
Message to display if the password is considered to be "strong". Default = "Strong".
msg_weak
Message to display if the password is considered to be "weak". Default = "Weak".
pass
Holds the entered password.
regex
Regular expression to validate the password against.
Default = "^.*$" which allows for a password containing any printable
character.
value
Holds password strength value.
weight
Weighting used in the algorithm that calculates the strength of a
password. Increasing this value allows for weaker passwords to be
considered stronger, whereas decreasing this value makes it harder
to get a password that is considered "Strong". Default = 0.12.
Method Detail
render()
Renders the passwordmeter control on the page and links it to the input password field.
- Returns:
- null
{Integer}
strength()
Calculates the strength of the current password in the range -1 to 100 where
-1 = "invalid", 0 = "weakest", and 100 = "strongest".
- Returns:
- {Integer} Strength of the password.
