Created
July 5, 2017 18:35
-
-
Save salsalabs/86b44e861c98bbe4d2bb4308a7aa84e4 to your computer and use it in GitHub Desktop.
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"> | |
// 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