convert plugins to ES modules, transpile es5 versions backwards compatibility

This commit is contained in:
Hakim El Hattab
2020-04-15 10:23:51 +02:00
parent 9522357349
commit a55cd813be
36 changed files with 3018 additions and 886 deletions

7
plugin/notes/notes.es5 Normal file
View File

@ -0,0 +1,7 @@
/**
* This is used to compile a self-registering
* es5 compatible version of the plugin.
*/
import plugin from './notes.js'
Reveal.registerPlugin( plugin );

View File

@ -23,9 +23,10 @@ var RevealNotes = (function() {
}
if( !notesFilePath ) {
var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
notesFilePath = jsFileLocation + 'notes.html';
// var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
// jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
// notesFilePath = jsFileLocation + 'notes.html';
notesFilePath = 'plugin/notes/notes.html'
}
notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
@ -156,9 +157,9 @@ var RevealNotes = (function() {
return {
id: 'notes',
init: function( revealInstance ) {
init: function( reveal ) {
deck = revealInstance;
deck = reveal;
if( !/receiver/i.test( window.location.search ) ) {
@ -181,4 +182,4 @@ var RevealNotes = (function() {
})();
Reveal.registerPlugin( RevealNotes );
export default RevealNotes;