-
Hakim El Hattab authoredHakim El Hattab authored
reveal.js 65.78 KiB
import SlideContent from './controllers/slidecontent.js'
import SlideNumber from './controllers/slidenumber.js'
import Backgrounds from './controllers/backgrounds.js'
import AutoAnimate from './controllers/autoanimate.js'
import Fragments from './controllers/fragments.js'
import Overview from './controllers/overview.js'
import Keyboard from './controllers/keyboard.js'
import Location from './controllers/location.js'
import Controls from './controllers/controls.js'
import Progress from './controllers/progress.js'
import Pointer from './controllers/pointer.js'
import Plugins from './controllers/plugins.js'
import Print from './controllers/print.js'
import Touch from './controllers/touch.js'
import Focus from './controllers/focus.js'
import Notes from './controllers/notes.js'
import Playback from './components/playback.js'
import defaultConfig from './config.js'
import * as Util from './utils/util.js'
import * as Device from './utils/device.js'
import {
SLIDES_SELECTOR,
HORIZONTAL_SLIDES_SELECTOR,
VERTICAL_SLIDES_SELECTOR,
POST_MESSAGE_METHOD_BLACKLIST
} from './utils/constants.js'
/**
* reveal.js
* https://revealjs.com
* MIT licensed
*
* Copyright (C) 2020 Hakim El Hattab, https://hakim.se
*/
export default function( revealElement, options ) {
// Support initialization with no args, one arg
// [options] or two args [revealElement, options]
if( arguments.length < 2 ) {
options = arguments[0];
revealElement = document.querySelector( '.reveal' );
}
const Reveal = {};
// The reveal.js version
const VERSION = '4.0.0-dev';
// Configuration defaults, can be overridden at initialization time
let config,
// Flags if reveal.js is loaded (has dispatched the 'ready' event)
ready = false,
// The horizontal and vertical index of the currently active slide
indexh,
indexv,
// The previous and current slide HTML elements
previousSlide,
currentSlide,
// Remember which directions that the user has navigated towards
navigationHistory = {
hasNavigatedHorizontally: false,
hasNavigatedVertically: false
},
// Slides may have a data-state attribute which we pick up and apply
// as a class to the body. This list contains the combined state of