Skip to content

Commit

Permalink
Use Eventbrite widget container (#850)
Browse files Browse the repository at this point in the history
* Use Eventbrite widget container

* remove JS to detect missing eventbrite iframe
  • Loading branch information
tobyhodges authored Dec 18, 2024
1 parent 4487155 commit ac6556b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
7 changes: 0 additions & 7 deletions _includes/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@
show_instructions();
});

// detect misssing iframe for Eventbrite
$(document).ready(function(){
if ($('iframe').height() == 0) {
$('iframe').before('<p>Looks like your adblocker blocked the registration window. Please navigate to <a href="https://www.eventbrite.com/tickets-external?eid={{page.eventbrite}}&ref=etckt">https://www.eventbrite.com/tickets-external?eid={{page.eventbrite}}&ref=etckt</a> to register.</p>');
}
});

// hide alerts when site is rendered on carpentries.github.io
$(document).ready(function() {
if (location.href.startsWith("https://carpentries.github.io/workshop-template/")) {
Expand Down
17 changes: 10 additions & 7 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,16 @@ displayed if the 'eventbrite' field in the header is not set.
{% if page.eventbrite %}
<strong>Some adblockers block the registration window. If you do not see the
registration box below, please check your adblocker settings.</strong>
<iframe
src="https://www.eventbrite.com/tickets-external?eid={{page.eventbrite}}&ref=etckt"
frameborder="0"
width="100%"
height="280px"
scrolling="auto">
</iframe>
<div id="eventbrite-widget-container"></div>
<script src="https://www.eventbrite.com/static/widgets/eb_widgets.js"></script>
<script type="text/javascript">
window.EBWidgets.createWidget({
// Required
widgetType: 'checkout',
eventId: {{eventbrite}},
iframeContainerId: 'eventbrite-widget-container',
});
</script>
{% endif %}


Expand Down

0 comments on commit ac6556b

Please sign in to comment.