Skip to content

Instantly share code, notes, and snippets.

@salsalabs
Created May 14, 2014 15:11
Show Gist options
  • Save salsalabs/7a1d70a9e0c3bb9df520 to your computer and use it in GitHub Desktop.
Save salsalabs/7a1d70a9e0c3bb9df520 to your computer and use it in GitHub Desktop.
This is a script that modifies the contents of the profile manager page. See the comments for more details.
<script type="text/javascript">
$(document).ready(function() {
if (RegExp('profile/login').test(window.location.href)) {
$('a[onclick*=forgotpassword]')
.html("Click here to receive your password.")
.click(function() {
$('.login form').eq(0).hide();
$('.login table').eq(0).hide();
$('a[onclick*=forgotpassword]').hide();
var x = $('#forgotpassword').html()
.replace('No problem.', '')
.replace('temporary', '');
$('#forgotpassword').html(x);
// Copy the email address from the "Login now" form as needed.
var source = $('form[action*=processLogin]').find('input[name=Email]').val();
var dest = $('form[action*=processForgotPassword]').find('input[name=Email]').val(source);
})
$('a[onclick*=createaccount]').hide();
}
})
</script>
@salsalabs
Copy link
Author

This script was written for a client that needed these mods to the profile management page:

  1. Forgot your password? changed so something more friendly, and
  2. Not signed up yet? hidden,

That left a fairly unattractive message behind, so I also added these mods:

  1. Remove No problem. It didn't make sense in the newly created context.
  2. Remove temporary. That would have confused folks that were going to use this page exactly once.
  3. Copied the Email field from the Login so that the user would not have to type it again.

Last note: This script must be in the default template to work, since that's the only template that the profile manager knows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment