diff options
author | Martin Jurča | 2018-02-18 21:30:17 +0100 |
---|---|---|
committer | Martin Jurča | 2018-02-20 10:29:16 +0100 |
commit | 8468d82433cd04952e1fdc0ce68363a2cf618b13 (patch) | |
tree | 1c277269da67a52eb86362916d9ecd9bea5d5956 /plugin/notes/notes.js | |
parent | 325162692ea2de30e4f7ebd8b858da15580844f1 (diff) |
fixed showing speaker's view with timings/pacing while serving the presentation from the file system
Diffstat (limited to 'plugin/notes/notes.js')
-rw-r--r-- | plugin/notes/notes.js | 15 |
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 */ |