reveal.js plugin flow now uses promises, refactor markdown plugin to use promises

This commit is contained in:
Hakim El Hattab
2019-03-04 14:11:21 +01:00
parent 46f8f86fa1
commit d780352b7f
3 changed files with 110 additions and 86 deletions

View File

@ -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 ) ) {
// Open the notes when the 's' key is hit
Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() {
openNotes();
} );
// 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();
} );
return { open: openNotes };
}
return Promise.resolve();
},
open: openNotes
};
})();
Reveal.registerPlugin( 'notes', RevealNotes );