Last active
August 29, 2015 14:01
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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