aboutsummaryrefslogtreecommitdiff
path: root/static/presentations/2021-11-13/garage/js/index.js
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2021-11-26 15:51:03 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2021-11-26 15:51:03 +0100
commit2b53e3e2ef985a01fecede6a5854428391d83726 (patch)
tree1ca7dcc4edbabb55068a315e57c24b58b00fa920 /static/presentations/2021-11-13/garage/js/index.js
parent888003d72fe33b0a8e8962040d1f759b58f18e6b (diff)
downloadrfid-2b53e3e2ef985a01fecede6a5854428391d83726.tar.gz
rfid-2b53e3e2ef985a01fecede6a5854428391d83726.zip
Ajout présentation et programme du 11/12
Diffstat (limited to 'static/presentations/2021-11-13/garage/js/index.js')
-rw-r--r--static/presentations/2021-11-13/garage/js/index.js58
1 files changed, 58 insertions, 0 deletions
diff --git a/static/presentations/2021-11-13/garage/js/index.js b/static/presentations/2021-11-13/garage/js/index.js
new file mode 100644
index 0000000..57be501
--- /dev/null
+++ b/static/presentations/2021-11-13/garage/js/index.js
@@ -0,0 +1,58 @@
+import Deck, { VERSION } from './reveal.js'
+
+/**
+ * Expose the Reveal class to the window. To create a
+ * new instance:
+ * let deck = new Reveal( document.querySelector( '.reveal' ), {
+ * controls: false
+ * } );
+ * deck.initialize().then(() => {
+ * // reveal.js is ready
+ * });
+ */
+let Reveal = Deck;
+
+
+/**
+ * The below is a thin shell that mimics the pre 4.0
+ * reveal.js API and ensures backwards compatibility.
+ * This API only allows for one Reveal instance per
+ * page, whereas the new API above lets you run many
+ * presentations on the same page.
+ *
+ * Reveal.initialize( { controls: false } ).then(() => {
+ * // reveal.js is ready
+ * });
+ */
+
+let enqueuedAPICalls = [];
+
+Reveal.initialize = options => {
+
+ // Create our singleton reveal.js instance
+ Object.assign( Reveal, new Deck( document.querySelector( '.reveal' ), options ) );
+
+ // Invoke any enqueued API calls
+ enqueuedAPICalls.map( method => method( Reveal ) );
+
+ return Reveal.initialize();
+
+}
+
+/**
+ * The pre 4.0 API let you add event listener before
+ * initializing. We maintain the same behavior by
+ * queuing up premature API calls and invoking all
+ * of them when Reveal.initialize is called.
+ */
+[ 'configure', 'on', 'off', 'addEventListener', 'removeEventListener', 'registerPlugin' ].forEach( method => {
+ Reveal[method] = ( ...args ) => {
+ enqueuedAPICalls.push( deck => deck[method].call( null, ...args ) );
+ }
+} );
+
+Reveal.isReady = () => false;
+
+Reveal.VERSION = VERSION;
+
+export default Reveal; \ No newline at end of file