aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugin/multiplex/master.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/multiplex/master.js')
-rw-r--r--plugin/multiplex/master.js49
1 files changed, 25 insertions, 24 deletions
diff --git a/plugin/multiplex/master.js b/plugin/multiplex/master.js
index 7f4bf45..53a2867 100644
--- a/plugin/multiplex/master.js
+++ b/plugin/multiplex/master.js
@@ -1,34 +1,35 @@
-(function() {
+(function () {
- // Don't emit events from inside of notes windows
- if ( window.location.search.match( /receiver/gi ) ) { return; }
+ // Don't emit events from inside of notes windows
+ if (window.location.search.match(/receiver/gi)) {
+ return;
+ }
- var multiplex = Reveal.getConfig().multiplex;
+ var multiplex = Reveal.getConfig().multiplex;
- var socket = io.connect( multiplex.url );
+ var socket = io.connect(multiplex.url);
- function post() {
+ function post() {
- var messageData = {
- state: Reveal.getState(),
- secret: multiplex.secret,
- socketId: multiplex.id
- };
+ var messageData = {
+ state: Reveal.getState(),
+ secret: multiplex.secret,
+ socketId: multiplex.id
+ };
- socket.emit( 'multiplex-statechanged', messageData );
+ socket.emit('multiplex-statechanged', messageData);
- };
+ }
+ // post once the page is loaded, so the client follows also on "open URL".
+ window.addEventListener('load', post);
- // post once the page is loaded, so the client follows also on "open URL".
- window.addEventListener( 'load', post );
-
- // 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 );
+ // 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);
}());