aboutsummaryrefslogtreecommitdiff
path: root/plugin/notes/notes.js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2019-03-04 14:11:21 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2019-03-04 14:11:21 +0100
commitd780352b7f78e16635ce9fabf2dbb53639610f18 (patch)
tree7c1cfa30946071779d65819a4c43bbace1cd7942 /plugin/notes/notes.js
parent46f8f86fa1d682e913459c13b5131f2baa25bcb5 (diff)
downloadperl-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/notes.js')
-rw-r--r--plugin/notes/notes.js32
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 );