App-revealup
view release on metacpan or search on metacpan
share/revealjs/js/reveal.js view on Meta::CPAN
return new Promise( resolve => Reveal.on( 'ready', resolve ) );
}
/**
* Encase the presentation in a reveal.js viewport. The
* extent of the viewport differs based on configuration.
*/
function setViewport() {
// Embedded decks use the reveal element as their viewport
if( config.embedded === true ) {
dom.viewport = Util.closest( revealElement, '.reveal-viewport' ) || revealElement;
}
// Full-page decks use the body as their viewport
else {
dom.viewport = document.body;
document.documentElement.classList.add( 'reveal-full-page' );
}
dom.viewport.classList.add( 'reveal-viewport' );
}
/**
* Starts up reveal.js by binding input events and navigating
* to the current URL deeplink if there is one.
*/
function start() {
ready = true;
// Remove slides hidden with data-visibility
removeHiddenSlides();
// Make sure we've got all the DOM elements we need
setupDOM();
// Listen to messages posted to this window
setupPostMessage();
// Prevent the slides from being scrolled out of view
setupScrollPrevention();
// Adds bindings for fullscreen mode
setupFullscreen();
// Resets all vertical slides so that only the first is visible
resetVerticalSlides();
// Updates the presentation to match the current configuration values
configure();
// Read the initial hash
location.readURL();
// Create slide backgrounds
backgrounds.update( true );
// Notify listeners that the presentation is ready but use a 1ms
// timeout to ensure it's not fired synchronously after #initialize()
setTimeout( () => {
// Enable transitions now that we're loaded
dom.slides.classList.remove( 'no-transition' );
dom.wrapper.classList.add( 'ready' );
dispatchEvent({
type: 'ready',
data: {
indexh,
indexv,
currentSlide
}
});
}, 1 );
// Special setup and config is required when printing to PDF
if( print.isPrintingPDF() ) {
removeEventListeners();
// The document needs to have loaded for the PDF layout
// measurements to be accurate
if( document.readyState === 'complete' ) {
print.setupPDF();
}
else {
window.addEventListener( 'load', () => {
print.setupPDF();
} );
}
}
}
/**
* Removes all slides with data-visibility="hidden". This
* is done right before the rest of the presentation is
* initialized.
*
* If you want to show all hidden slides, initialize
* reveal.js with showHiddenSlides set to true.
*/
function removeHiddenSlides() {
if( !config.showHiddenSlides ) {
Util.queryAll( dom.wrapper, 'section[data-visibility="hidden"]' ).forEach( slide => {
slide.parentNode.removeChild( slide );
} );
}
}
/**
* Finds and stores references to DOM elements which are
* required by the presentation. If a required element is
* not found, it is created.
*/
function setupDOM() {
// Prevent transitions while we're loading
( run in 0.651 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )