aboutsummaryrefslogtreecommitdiff
path: root/plugin/notes/notes.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/notes/notes.js')
-rw-r--r--plugin/notes/notes.js32
1 files changed, 20 insertions, 12 deletions
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js
index 8d58ad0..3d5eac4 100644
--- a/plugin/notes/notes.js
+++ b/plugin/notes/notes.js
@@ -68,7 +68,7 @@ var RevealNotes = (function() {
*/
function callRevealApi( methodName, methodArguments, callId ) {
- var result = Reveal[methodName].call( Reveal, methodArguments );
+ var result = Reveal[methodName].apply( Reveal, methodArguments );
notesPopup.postMessage( JSON.stringify( {
namespace: 'reveal-notes',
type: 'return',
@@ -151,20 +151,28 @@ 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 };
+ }
+
+ },
+
+ open: openNotes
+ };
})();
+
+Reveal.registerPlugin( 'notes', RevealNotes );