diff --git a/index.html b/index.html index d41ccc6..ac2bd56 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ @@ -51,6 +52,7 @@
  • Things to do in Rochester
  • Registry
  • FAQ
  • +
  • @@ -293,6 +295,25 @@ } } }); + + + function getParameterByName(name, url) { + if (!url) url = window.location.href; + name = name.replace(/[\[\]]/g, "\\$&"); + var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), + results = regex.exec(url); + if (!results) return null; + if (!results[2]) return ''; + return decodeURIComponent(results[2].replace(/\+/g, " ")); + } + var rsvpCode = getParameterByName('rsvp'); + if (rsvpCode) { + var rsvp = document.querySelectorAll('.rsvp') + for (var i = 0; i < rsvp.length; i += 1) { + rsvp[i].href = 'https://rsvp.as/' + encodeURIComponent(rsvpCode); + rsvp[i].classList.remove('is-hidden'); + } + }