2012-08-05 15:48:55 +02:00
|
|
|
(function() {
|
2015-09-29 10:38:34 +02:00
|
|
|
|
2013-09-15 17:52:40 +02:00
|
|
|
// Don't emit events from inside of notes windows
|
2012-08-05 15:48:55 +02:00
|
|
|
if ( window.location.search.match( /receiver/gi ) ) { return; }
|
2013-09-15 17:52:40 +02:00
|
|
|
|
2013-03-09 01:05:58 +01:00
|
|
|
var multiplex = Reveal.getConfig().multiplex;
|
2012-08-05 15:48:55 +02:00
|
|
|
|
2015-09-29 10:38:34 +02:00
|
|
|
var socket = io.connect( multiplex.url );
|
|
|
|
|
|
|
|
function post() {
|
|
|
|
|
|
|
|
var messageData = {
|
|
|
|
state: Reveal.getState(),
|
|
|
|
secret: multiplex.secret,
|
|
|
|
socketId: multiplex.id
|
|
|
|
};
|
|
|
|
|
|
|
|
socket.emit( 'multiplex-statechanged', messageData );
|
|
|
|
|
2013-04-05 20:45:17 +02:00
|
|
|
};
|
|
|
|
|
2017-06-06 10:36:40 +02:00
|
|
|
// post once the page is loaded, so the client follows also on "open URL".
|
2017-06-12 09:17:46 +02:00
|
|
|
window.addEventListener( 'load', post );
|
2017-06-06 10:36:40 +02:00
|
|
|
|
2015-09-29 10:38:34 +02:00
|
|
|
// Monitor events that trigger a change in state
|
2020-04-07 09:05:56 +02:00
|
|
|
Reveal.on( 'slidechanged', post );
|
|
|
|
Reveal.on( 'fragmentshown', post );
|
|
|
|
Reveal.on( 'fragmenthidden', post );
|
|
|
|
Reveal.on( 'overviewhidden', post );
|
|
|
|
Reveal.on( 'overviewshown', post );
|
|
|
|
Reveal.on( 'paused', post );
|
|
|
|
Reveal.on( 'resumed', post );
|
2015-09-29 10:38:34 +02:00
|
|
|
|
2017-06-06 10:36:40 +02:00
|
|
|
}());
|