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.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js
index 3f00eb6..dd7df8e 100644
--- a/plugin/notes/notes.js
+++ b/plugin/notes/notes.js
@@ -21,8 +21,6 @@ var RevealNotes = (function() {
var notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
- // Allow popup window access to Reveal API
- notesPopup.Reveal = this.Reveal;
/**
* Connect to the notes window through a postmessage handshake.
@@ -47,9 +45,22 @@ var RevealNotes = (function() {
clearInterval( connectInterval );
onConnected();
}
+ if( data && data.namespace === 'reveal-notes' && data.type === 'call' ) {
+ callRevealApi( data.methodName, data.arguments, data.callId );
+ }
} );
}
+ function callRevealApi( methodName, methodArguments, callId ) {
+ var result = Reveal[methodName].call(Reveal, methodArguments);
+ notesPopup.postMessage( JSON.stringify( {
+ namespace: 'reveal-notes',
+ type: 'return',
+ result: result,
+ callId: callId
+ } ), '*' );
+ }
+
/**
* Posts the current slide data to the notes window
*/