From d780352b7f78e16635ce9fabf2dbb53639610f18 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 4 Mar 2019 14:11:21 +0100 Subject: reveal.js plugin flow now uses promises, refactor markdown plugin to use promises --- plugin/notes/notes.js | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'plugin/notes/notes.js') diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index 8d58ad0..718d149 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -151,20 +151,30 @@ var RevealNotes = (function() { } - if( !/receiver/i.test( window.location.search ) ) { + return { + init: function() { - // If the there's a 'notes' query set, open directly - if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { - openNotes(); - } + if( !/receiver/i.test( window.location.search ) ) { + + // If the there's a 'notes' query set, open directly + if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { + openNotes(); + } - // Open the notes when the 's' key is hit - Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() { - openNotes(); - } ); + // Open the notes when the 's' key is hit + Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() { + openNotes(); + } ); - } + } + + return Promise.resolve(); - return { open: openNotes }; + }, + + open: openNotes + }; })(); + +Reveal.registerPlugin( 'notes', RevealNotes ); -- cgit v1.2.3