diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2019-03-04 14:11:21 +0100 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2019-03-04 14:11:21 +0100 |
commit | d780352b7f78e16635ce9fabf2dbb53639610f18 (patch) | |
tree | 7c1cfa30946071779d65819a4c43bbace1cd7942 /plugin/notes | |
parent | 46f8f86fa1d682e913459c13b5131f2baa25bcb5 (diff) | |
download | perl-software-in-gnu-guix-d780352b7f78e16635ce9fabf2dbb53639610f18.tar perl-software-in-gnu-guix-d780352b7f78e16635ce9fabf2dbb53639610f18.tar.gz |
reveal.js plugin flow now uses promises, refactor markdown plugin to use promises
Diffstat (limited to 'plugin/notes')
-rw-r--r-- | plugin/notes/notes.js | 32 |
1 files changed, 21 insertions, 11 deletions
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 ); |