From e9fa05b0a068fde0197ea01f2ff31e2513b7965f Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 24 Nov 2016 02:01:54 +0100 Subject: copied from git.debian.org/git/reproducible/presentations.git / 2016-11-13-MiniDebConfCambridge there, Copyright & thanks to Chris Lamb Signed-off-by: Holger Levsen --- .../plugin/multiplex/master.js | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 presentations/2016-11-30-Profitbricks/plugin/multiplex/master.js (limited to 'presentations/2016-11-30-Profitbricks/plugin/multiplex/master.js') diff --git a/presentations/2016-11-30-Profitbricks/plugin/multiplex/master.js b/presentations/2016-11-30-Profitbricks/plugin/multiplex/master.js new file mode 100644 index 00000000..4becad0d --- /dev/null +++ b/presentations/2016-11-30-Profitbricks/plugin/multiplex/master.js @@ -0,0 +1,31 @@ +(function() { + + // Don't emit events from inside of notes windows + if ( window.location.search.match( /receiver/gi ) ) { return; } + + var multiplex = Reveal.getConfig().multiplex; + + var socket = io.connect( multiplex.url ); + + function post() { + + var messageData = { + state: Reveal.getState(), + secret: multiplex.secret, + socketId: multiplex.id + }; + + socket.emit( 'multiplex-statechanged', messageData ); + + }; + + // Monitor events that trigger a change in state + Reveal.addEventListener( 'slidechanged', post ); + Reveal.addEventListener( 'fragmentshown', post ); + Reveal.addEventListener( 'fragmenthidden', post ); + Reveal.addEventListener( 'overviewhidden', post ); + Reveal.addEventListener( 'overviewshown', post ); + Reveal.addEventListener( 'paused', post ); + Reveal.addEventListener( 'resumed', post ); + +}()); \ No newline at end of file -- cgit v1.2.3-70-g09d2