1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-06 14:47:04 +02:00

add lightbox to reveal.js state, enables syncing with speaker view #3771

This commit is contained in:
Hakim El Hattab
2025-03-24 15:34:51 +01:00
parent 47ee25dd19
commit c69adfb022
6 changed files with 63 additions and 8 deletions

View File

@@ -414,14 +414,25 @@
}
// 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',
'showiframepreview',
'showmediapreview'
];
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( /closeoverlay/.test( data.eventName ) ) {
dispatchStateToMainWindow( data.state );
}
else if( supportedEvents.includes( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
dispatchStateToMainWindow( data.state );
}
}