Skip to content

Instantly share code, notes, and snippets.

@salsalabs
Last active December 28, 2015 20:02
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/fc4c4e3b4f9d4fff84b0 to your computer and use it in GitHub Desktop.
Save salsalabs/fc4c4e3b4f9d4fff84b0 to your computer and use it in GitHub Desktop.
Script to change the zip lookup prompt on the page that supporters use to look up legislator contact information. Needs to be installed into the default template, preferably just before the </body> tag. Does not use jQuery because some folks don't have that in their default template.
<!-- Change the ZIP prompt on the legislative lookup page.
See https://salsasupport.zendesk.com/entries/98542078 -->
<style type="text/css">
/* Ruleset to decorate the prompt inserted by the script. */
#officials_search {
font-size: 15pt;
font-weight: 900;
}
</style>
<script type="text/javascript">
// Script to change the zip prompt on getLocal.jsp. Also makes it bigger and bolder.
document.addEventListener('DOMContentLoaded', function(){
var firstPart = "You'll need your full Zip + 4 to find your legislators.";
var secondPart = "Not sure of your ZIP + 4?";
if (window.location.href.indexOf('getLocal.jsp') != -1) {
var e = document.getElementById('officials_search');
if (e != null) {
var list = e.getElementsByTagName('p');
if (list.length > 1) {
list[0].innerHTML = firstPart;
list[1].innerHTML = list[1].innerHTML.replace("Don't know your ZIP + 4?", secondPart);
}
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment