Skip to content

Instantly share code, notes, and snippets.

@kellenmace
Created March 10, 2015 16:23
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 kellenmace/14a595c824bd6112230b to your computer and use it in GitHub Desktop.
Save kellenmace/14a595c824bd6112230b to your computer and use it in GitHub Desktop.
trivium racing js
$(document).ready(function(){
// Render ACF Google Map
$('.acf-map').each(function(){
render_map( $(this) );
});
// Set up jQuery DataTables
if ( $( '#event-results' ).dataTable || $( '#event-list-container' ).dataTable ) {
$( '#event-results' ).dataTable( {
"order": [ 2, 'desc' ]
} );
$( '#event-list-container' ).dataTable( {
"order": [ 2, 'asc' ]
} );
}
if ( typeof trivium_event_json_objects !== 'undefined' ) {
// Convert localized trivium_event_json_objects string into JSON objects
var trivium_event_json_objects_converted = JSON.parse( decode_html( trivium_event_json_objects ) );
// Initialize FullCalendar
$('#calendar').fullCalendar({
events: trivium_event_json_objects_converted,
eventTextColor: '#fff',
contentHeight: 750,
});
}
});
function decode_html( html ) {
var txt = document.createElement( "textarea" );
txt.innerHTML = html;
return txt.value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment