From 587be5ee618b4fbe6cc484df009f418f4fef7004 Mon Sep 17 00:00:00 2001 From: janis Date: Tue, 16 Jan 2024 10:25:35 +0100 Subject: [PATCH] Some more progress on comments --- src/impress.ts | 8 +++++--- src/index.html | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/impress.ts b/src/impress.ts index 226ef96..b5e821e 100644 --- a/src/impress.ts +++ b/src/impress.ts @@ -38,8 +38,7 @@ * This function is used to initialize impress. It calls some prep functions and then loads * all plugins that are registered. By default, these are the built-in plugins. You can define * which plugins are loaded by passing in an array of plugin-functions into the init function - * @param {Array|undefined} [pluginsToLoad] An array of plugins to load when initializing impress. - * Defaults to the built-in plugins. + * @param {Array|undefined} [pluginsToLoad] An array of plugins to load when initializing impress. Defaults to the built-in plugins that require explicit initialization. * @returns {undefined} */ const init = ( pluginsToLoad?: Array ): undefined => { @@ -48,6 +47,7 @@ toBeLoadedPlugins = pluginsToLoad; } + // Let's initialize all plugins that have to be initialized for ( let plugin in toBeLoadedPlugins ) { try { toBeLoadedPlugins[ plugin ](); @@ -57,9 +57,11 @@ return; } } + // TODO: Load plugins, check if impress is supported - // Finally, with init done, send out the 'impress:init' event + // Finally, with init done, send out the 'impress:init' event. + // All plugins which use this event to initialize will now be initialized document.dispatchEvent( new Event( 'impress:init' ) ); }; diff --git a/src/index.html b/src/index.html index af634ab..653b1b4 100644 --- a/src/index.html +++ b/src/index.html @@ -22,7 +22,9 @@ - + + \ No newline at end of file