summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/user.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/user/user.js b/modules/user/user.js
index 0d3727a66..66e74e890 100644
--- a/modules/user/user.js
+++ b/modules/user/user.js
@@ -6,8 +6,8 @@
* that its confirmation is correct.
*/
Drupal.behaviors.password = {
- attach: function(context) {
- var translate = Drupal.settings.password;
+ attach: function(context, settings) {
+ var translate = settings.password;
$("input.password-field:not(.password-processed)", context).each(function() {
var passwordInput = $(this).addClass('password-processed');
var innerWrapper = $(this).parent();
@@ -34,7 +34,7 @@ Drupal.behaviors.password = {
var passwordCheck = function () {
// Evaluate the password strength.
- var result = Drupal.evaluatePasswordStrength(passwordInput.val());
+ var result = Drupal.evaluatePasswordStrength(passwordInput.val(), settings.password);
// Update the suggestions for how to improve the password.
if (passwordDescription.html() != result.message) {
@@ -92,8 +92,8 @@ Drupal.behaviors.password = {
*
* Returns the estimated strength and the relevant output message.
*/
-Drupal.evaluatePasswordStrength = function (password) {
- var weaknesses = 0, strength = 100, msg = [], translate = Drupal.settings.password;
+Drupal.evaluatePasswordStrength = function (password, translate) {
+ var weaknesses = 0, strength = 100, msg = [];
var hasLowercase = password.match(/[a-z]+/);
var hasUppercase = password.match(/[A-Z]+/);
@@ -166,7 +166,7 @@ Drupal.evaluatePasswordStrength = function (password) {
* "Picture support" radio buttons.
*/
Drupal.behaviors.userSettings = {
- attach: function(context) {
+ attach: function(context, settings) {
$('div.user-admin-picture-radios input[type=radio]:not(.userSettings-processed)', context).addClass('userSettings-processed').click(function () {
$('div.user-admin-picture-settings', context)[['hide', 'show'][this.value]]();
});