two js bundles; reveal.js (es6) and reveal.es5.js, add source maps

This commit is contained in:
Hakim El Hattab
2020-04-17 10:59:55 +02:00
parent d9690462e0
commit 4f6bdf1420
31 changed files with 155 additions and 52 deletions

View File

@ -1,4 +1,4 @@
import Presentation from './reveal.js'
import Deck from './reveal.js'
/**
* Expose the Reveal class to the window. To create a
@ -10,7 +10,7 @@ import Presentation from './reveal.js'
* // reveal.js is ready
* });
*/
window.Reveal = Presentation;
var Reveal = Deck;
/**
@ -27,15 +27,15 @@ window.Reveal = Presentation;
let enqueuedAPICalls = [];
window.Reveal.initialize = options => {
Reveal.initialize = options => {
// Create our singleton reveal.js instance
window.Reveal = new Presentation( document.querySelector( '.reveal' ), options );
Object.assign( Reveal, new Deck( document.querySelector( '.reveal' ), options ) );
// Invoke any enqueued API calls
enqueuedAPICalls.map( method => method( window.Reveal ) );
enqueuedAPICalls.map( method => method( Reveal ) );
return window.Reveal.initialize();
return Reveal.initialize();
}
@ -46,7 +46,9 @@ window.Reveal.initialize = options => {
* when Reveal.initialize is called.
*/
[ 'on', 'off', 'addEventListener', 'removeEventListener', 'registerPlugin' ].forEach( method => {
window.Reveal[method] = ( ...args ) => {
Reveal[method] = ( ...args ) => {
enqueuedAPICalls.push( deck => deck[method].call( null, ...args ) );
}
} );
} );
export default Reveal;