Skip to content

Instantly share code, notes, and snippets.

@salsalabs
Created July 5, 2017 18:35
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/86b44e861c98bbe4d2bb4308a7aa84e4 to your computer and use it in GitHub Desktop.
Save salsalabs/86b44e861c98bbe4d2bb4308a7aa84e4 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
// Script to correct the recurring donation's "What's this?" link on donation pages with short URLs.
$(document).ready(function() {
var a = $('label[for=recurring] a');
if (a.length != 0) {
a[0].onclick = function() {
var fixedURL = '/o/[[organization_KEY]]/p/salsa/donation/common/public/help-recurring.html';
fixedURL = fixedURL.replace('[[organization_KEY]]', $('input[name=organization_KEY]').val());
var chapterKey = $('input[name=chapter_KEY]');
if (chapterKey.length > 0) {
fixedURL = fixedURL.replace("/p/", "/c/" + chapterKey.val() + "/p/");
}
window.open(fixedURL, 'pop1', 'toolbar=no,menubar=yes,scrollbars=no,,width=500,height=200');
};
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment