Created
March 10, 2015 16:23
-
-
Save kellenmace/14a595c824bd6112230b to your computer and use it in GitHub Desktop.
trivium racing js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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