Merge remote-tracking branch 'upstream/master'
# Conflicts: # README.md
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -209,6 +209,10 @@ const Plugin = () => {
|
||||
deck.on( 'overviewshown', post );
|
||||
deck.on( 'paused', post );
|
||||
deck.on( 'resumed', post );
|
||||
deck.on( 'previewiframe', post );
|
||||
deck.on( 'previewimage', post );
|
||||
deck.on( 'previewvideo', post );
|
||||
deck.on( 'closeoverlay', post );
|
||||
|
||||
// Post the initial state
|
||||
post();
|
||||
@@ -229,7 +233,7 @@ const Plugin = () => {
|
||||
openSpeakerWindow();
|
||||
}
|
||||
else {
|
||||
// Keep listening for speaker view hearbeats. If we receive a
|
||||
// Keep listening for speaker view heartbeats. If we receive a
|
||||
// heartbeat from an orphaned window, reconnect it. This ensures
|
||||
// that we remain connected to the notes even if the presentation
|
||||
// is reloaded.
|
||||
|
||||
@@ -414,14 +414,24 @@
|
||||
}
|
||||
// Messages sent by the reveal.js inside of the current slide preview
|
||||
else if( data && data.namespace === 'reveal' ) {
|
||||
const supportedEvents = [
|
||||
'slidechanged',
|
||||
'fragmentshown',
|
||||
'fragmenthidden',
|
||||
'paused',
|
||||
'resumed',
|
||||
'previewiframe',
|
||||
'previewimage',
|
||||
'previewvideo',
|
||||
'closeoverlay'
|
||||
];
|
||||
|
||||
if( /ready/.test( data.eventName ) ) {
|
||||
// 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|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
|
||||
|
||||
else if( supportedEvents.includes( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
|
||||
dispatchStateToMainWindow( data.state );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,9 +504,12 @@
|
||||
notes.classList.add( 'hidden' );
|
||||
}
|
||||
|
||||
// Don't show lightboxes in the upcoming slide
|
||||
const { previewVideo, previewImage, previewIframe, ...upcomingState } = data.state;
|
||||
|
||||
// Update the note slides
|
||||
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
|
||||
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
|
||||
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ upcomingState ] }), '*' );
|
||||
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'next' }), '*' );
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user