Skip to content

Instantly share code, notes, and snippets.

@TychoWerner
Created December 7, 2022 14:31
Show Gist options
  • Select an option

  • Save TychoWerner/1d627045e504a3600c09ed961d597b1a to your computer and use it in GitHub Desktop.

Select an option

Save TychoWerner/1d627045e504a3600c09ed961d597b1a to your computer and use it in GitHub Desktop.
azuracast public page custom button (Custom JS for Public Pages)
url = window.location.pathname;
if(url == '/public/test_station'){
window.addEventListener('load', function () {
buttons = document.querySelector("body > div:nth-child(25) > div > div > div.card-actions").innerHTML;
customButtonHtml = '<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank" class="btn btn-sm btn-outline-secondary" role="button"><i aria-hidden="true" class="material-icons">podcasts</i>Podcast</a>'
document.querySelector("body > div:nth-child(25) > div > div > div.card-actions").innerHTML = buttons + customButtonHtml;
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment