diff options
-rw-r--r-- | plugin/notes-server/index.js | 2 | ||||
-rw-r--r-- | plugin/notes/notes.html | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/plugin/notes-server/index.js b/plugin/notes-server/index.js index fc66a26..b95f071 100644 --- a/plugin/notes-server/index.js +++ b/plugin/notes-server/index.js @@ -22,10 +22,12 @@ io.on( 'connection', function( socket ) { }); socket.on( 'statechanged', function( data ) { + delete data.state.overview; socket.broadcast.emit( 'statechanged', data ); }); socket.on( 'statechanged-speaker', function( data ) { + delete data.state.overview; socket.broadcast.emit( 'statechanged-speaker', data ); }); diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index d0d88dc..c80e77f 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -188,6 +188,10 @@ var data = JSON.parse( event.data ); + // The overview mode is only useful to the reveal.js instance + // where navigation occurs so we don't sync it + if( data.state ) delete data.state.overview; + // Messages sent by the notes plugin inside of the main window if( data && data.namespace === 'reveal-notes' ) { if( data.type === 'connect' ) { @@ -203,8 +207,10 @@ // Send a message back to notify that the handshake is complete window.opener.postMessage( JSON.stringify({ namespace: 'reveal-notes', type: 'connected'} ), '*' ); } - else if( /slidechanged|fragmentshown|fragmenthidden|overviewshown|overviewhidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) { + else if( /slidechanged|fragmentshown|fragmenthidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) { + window.opener.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ]} ), '*' ); + } } @@ -288,7 +294,7 @@ 'backgroundTransition=none' ].join( '&' ); - var urlSeparator = /?/.test(data.url) ? '&' : '?'; + var urlSeparator = /\?/.test(data.url) ? '&' : '?'; var hash = '#/' + data.state.indexh + '/' + data.state.indexv; var currentURL = data.url + urlSeparator + params + '&postMessageEvents=true' + hash; var upcomingURL = data.url + urlSeparator + params + '&controls=false' + hash; |