Skip to content

Instantly share code, notes, and snippets.

@salsalabs
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salsalabs/29fd813c24f1fb133b8b to your computer and use it in GitHub Desktop.
Save salsalabs/29fd813c24f1fb133b8b to your computer and use it in GitHub Desktop.
Hide the email addresses on the letter page of an action. Updated to handle blind targeted actions and confirmation pages.
<script type="text/javascript">
// See https://help.salsalabs.com/entries/22876904-Hide-email-addresses-on-targeted-actions
$(document).ready(function() {
if (RegExp('action_KEY=NNNNN').test(window.location.href)) {
var checkExist = null;
var recipientChecker = function() {
if ($('.recipient').length > 0) {
$('.recipient .number').each(function() {
var x = $(this).html();
x = x.replace(RegExp('Email.+?</span>'), '');
$(this).html(x);
});
}
}
// Hide the stuff on the front page for blind targeted actions.
//
recipientChecker();
// Runs until the page is exited so that all AJAX-loaded pages are handled.
//
checkExist = setInterval(recipientChecker, 200);
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment