Skip to content

Instantly share code, notes, and snippets.

@salsalabs
Last active February 23, 2021 18:14
Show Gist options
  • Save salsalabs/120d0cd6b476242bf7d7cd79ddbacd8e to your computer and use it in GitHub Desktop.
Save salsalabs/120d0cd6b476242bf7d7cd79ddbacd8e to your computer and use it in GitHub Desktop.
Clean up In Honor Of and In Memory Of to make them legible and have the same style as the rest of the donation page.
<!-- BEGIN Clean up In Honor Of and in Memory Of fields on donation pages. -->
<!-- See: https://gist.github.com/salsalabs/120d0cd6b476242bf7d7cd79ddbacd8e -->
<style type="text/css">
/* Force label to appear before In_Honor_Address. */
label[for=In_Honor_Address],
*[name=In_Honor_Address] {
float: left;
}
/* SalsaStaff 386297: Make the "In Memory Of" prompt easier to read. */
#honorof > p:nth-child(6) {
clear: both;
padding-top: 20px;
}
</style>
<script type="text/javascript">
// Add standard classes to the IMO/IHO fields. This goes a *long* way
// toward making the better looking.
document.addEventListener("DOMContentLoaded", () => {
const names = [
"In_Honor_Name",
"In_Honor_Email",
"In_Honor_Address",
"In_Memory_Name"];
names
.map(n => document.querySelector(`input[name=${n}]`))
.filter (e => e != null)
.forEach(e => {e.classList.add("blockInput")})
})
</script>
<!-- END Clean up In Honor Of and in Memory Of fields on donation pages. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment