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/search/search.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 './search.js'
Reveal.registerPlugin( plugin );

View File

@ -200,7 +200,22 @@ function Hilitor(id, tag)
toggleSearch();
}
}, false );
if( window.Reveal ) Reveal.registerKeyboardShortcut( 'CTRL + Shift + F', 'Search' );
closeSearch();
return { open: openSearch };
return {
id: 'search',
init: reveal => {
reveal.registerKeyboardShortcut( 'CTRL + Shift + F', 'Search' );
},
open: openSearch
}
})();
export default RevealSearch;