Last active
August 29, 2015 14:20
-
-
Save GreggFranklin/d9d23e521087f6844cdc to your computer and use it in GitHub Desktop.
Replacement for the existing function with the new calls to the customizer
This file contains 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
<?php | |
function reveal_initialize_script() { | |
$settings = reveal_get_settings(); | |
?> | |
<script> | |
// Full list of configuration options available here: | |
// https://github.com/hakimel/reveal.js#configuration | |
var reveal_config = { | |
controls: <?php echo get_theme_mod( 'controls_right_corner', '1' ); ?>, | |
progress: <?php echo get_theme_mod( 'presentation_progress_bar', '1' ); ?>, | |
slideNumber: <?php echo get_theme_mod( 'slide_page_number', '0' ); ?>, | |
history: <?php echo get_theme_mod( 'push_slide_history', '0' ); ?>, | |
keyboard: <?php echo get_theme_mod( 'keyboard_shortcuts', '1' ); ?>, | |
overview: <?php echo get_theme_mod( 'slide_overview_mode', '1' ); ?>, | |
center: <?php echo get_theme_mod( 'vertically_center_slides', '1' ); ?>, | |
touch: <?php echo get_theme_mod( 'touch_navigation', '1' ); ?>, | |
loop: <?php echo get_theme_mod( 'loop_presentation', '0' ); ?>, | |
rtl: <?php echo get_theme_mod( 'rtl_direction', '0' ); ?>, | |
fragments: <?php echo get_theme_mod( 'fragments', '1' ); ?>, | |
embedded: <?php echo get_theme_mod( 'embed_mode', '0' ); ?>, | |
autoSlide: <?php echo get_theme_mod( 'milliseconds_slides', '0' ); ?>, | |
autoSlideStoppable: <?php echo get_theme_mod( 'stop_auto_sliding', '1' ); ?>, | |
mouseWheel: <?php echo get_theme_mod( 'navigate_via_mouse', '0' ); ?>, | |
hideAddressBar: <?php echo get_theme_mod( 'hide_address_bar', '1' ); ?>, | |
previewLinks: <?php echo get_theme_mod( 'links_in_iframe', '0' ); ?>, | |
transition: <?php echo json_encode( get_theme_mod( 'transition_style', 'default' ) ) ?>, | |
transitionSpeed: <?php echo json_encode( get_theme_mod( 'transition_speed', 'default' ) ) ?>, | |
backgroundTransition: <?php echo json_encode( get_theme_mod( 'transition_style_full_page', 'default' ) ) ?>, | |
viewDistance: <?php echo get_theme_mod( 'number_slides', '3' ); ?>, | |
parallaxBackgroundImage: <?php echo json_encode( get_theme_mod( 'parallax_background_image', '' ) ) ?>, | |
parallaxBackgroundSize: <?php echo json_encode( get_theme_mod( 'parallax_background_size', '' ) ) ?>, | |
width: <?php echo get_theme_mod( 'base_width', '960' ); ?>, | |
height: <?php echo get_theme_mod( 'base_height', '700' ); ?>, | |
margin: <?php echo get_theme_mod( 'margin', '0.1' ); ?>, | |
minScale: <?php echo get_theme_mod( 'small_scale', '0.2' ); ?>, | |
maxScale: <?php echo get_theme_mod( 'largest_scale', '1' ); ?>, | |
rollingLinks: <?php echo get_theme_mod( '3d_hover', '0' ); ?>, | |
focusBodyOnPageVisiblityChange: <?php echo get_theme_mod( 'focus_body', '1' ); ?>, | |
// Optional libraries used to extend on reveal.js | |
dependencies: [ | |
<?php | |
echo implode( ",\n", apply_filters( 'reveal_default_dependencies', array( | |
'classList' => "{ src: '" . get_template_directory_uri() . "/lib/js/classList.js', condition: function() { return !document.body.classList; } }", | |
'highlight' => "{ src: '" . get_template_directory_uri() . "/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }", | |
'zoom' => "{ src: '" . get_template_directory_uri() . "/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }", | |
'notes' => "{ src: '" . get_template_directory_uri() . "/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }", | |
) ) ); | |
?> | |
] | |
}; | |
<?php do_action( 'reveal_initialize' ) ?> | |
Reveal.initialize( reveal_config ); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment