diff options
author | Robin Stocker <robin@nibor.org> | 2012-02-06 12:48:20 +0100 |
---|---|---|
committer | Robin Stocker <robin@nibor.org> | 2012-02-06 12:55:03 +0100 |
commit | bfc3213f0591da036dea165992769b2ec862a309 (patch) | |
tree | 2b2fccc2e5a4706d7248449051ab95af4272d2f2 | |
parent | aa59dd6e333339d50e40166e83e82d0f169e7c66 (diff) | |
download | askbot-bfc3213f0591da036dea165992769b2ec862a309.tar.gz askbot-bfc3213f0591da036dea165992769b2ec862a309.tar.bz2 askbot-bfc3213f0591da036dea165992769b2ec862a309.zip |
Show errors of "Change password" for local provider
When submitting the "Change your Askbot password" form previously, and
validation had an error (e.g. "Please choose password > 8 characters"),
the error was never displayed because the JavaScript always removed it.
Now, the error message is shown. The display can be improved though, as
the trailing span messes up the horizontal alignment of the input
fields.
-rw-r--r-- | askbot/skins/common/media/jquery-openid/jquery.openid.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/askbot/skins/common/media/jquery-openid/jquery.openid.js b/askbot/skins/common/media/jquery-openid/jquery.openid.js index 29b31b34..249413b9 100644 --- a/askbot/skins/common/media/jquery-openid/jquery.openid.js +++ b/askbot/skins/common/media/jquery-openid/jquery.openid.js @@ -193,7 +193,6 @@ $.fn.authenticator = function() { password_input_fields.hide(); } reset_password_input_fields(); - $('.error').remove(); if (userIsAuthenticated === false){ email_input_fields.hide(); account_recovery_heading.hide(); @@ -210,13 +209,18 @@ $.fn.authenticator = function() { } }; + var reset_form_and_errors = function(){ + reset_form(); + $('.error').remove(); + } + var set_provider_name = function(element){ var provider_name = element.attr('name'); provider_name_input.val(provider_name); }; var show_openid_input_fields = function(provider_name){ - reset_form(); + reset_form_and_errors(); var token_name = extra_token_name[provider_name] if (userIsAuthenticated){ $('#openid-heading').html( @@ -290,7 +294,7 @@ $.fn.authenticator = function() { var start_password_login_or_change = function(){ //called upon clicking on one of the password login buttons - reset_form(); + reset_form_and_errors(); set_provider_name($(this)); var provider_name = $(this).attr('name'); return setup_password_login_or_change(provider_name); @@ -370,7 +374,7 @@ $.fn.authenticator = function() { }; var start_account_recovery = function(){ - reset_form(); + reset_form_and_errors(); account_recovery_hint.hide(); account_recovery_heading.css('margin-bottom', '0px'); account_recovery_heading.html(account_recovery_prompt_text).show(); |