aboutsummaryrefslogtreecommitdiffstats
path: root/docs/com/plugin/multiplex/master.js
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-06-01 14:42:03 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-01 14:42:03 +0000
commita574679f7b2636e74e6a262f4badad0445d10c3a (patch)
tree466429721c3454a9236b033a788ca72f9f4f4507 /docs/com/plugin/multiplex/master.js
parent70b96b8719b48c51b59182162fe8e018c55e7364 (diff)
parentbb522c6efd9a02e611014038566b15feb28da0c8 (diff)
Merge "Add framework for presentations"
Diffstat (limited to 'docs/com/plugin/multiplex/master.js')
-rwxr-xr-xdocs/com/plugin/multiplex/master.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/com/plugin/multiplex/master.js b/docs/com/plugin/multiplex/master.js
new file mode 100755
index 000000000..4becad0df
--- /dev/null
+++ b/docs/com/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