summaryrefslogtreecommitdiffhomepage
path: root/plugin/notes-server/client.js
diff options
context:
space:
mode:
authorMichael Kühnel2012-10-24 17:48:50 +0200
committerMichael Kühnel2012-10-24 17:48:50 +0200
commit5af915adaf0f03ea936323e827e86fab6b0bb4e9 (patch)
tree0e72e9c726ed96105ccc3ef7364ee782bf412306 /plugin/notes-server/client.js
parentaefe981040ea8c5c7875d9da1ac860def44a19e8 (diff)
parent379f5d38ff8c66c10c22a0a18227b481e945dc02 (diff)
Merge branch 'refs/heads/fix-fragments-in-speakernotes' into fragments-in-notes-server
Conflicts: js/reveal.min.js Need to generate a new minified version afterwards.
Diffstat (limited to 'plugin/notes-server/client.js')
-rw-r--r--plugin/notes-server/client.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/plugin/notes-server/client.js b/plugin/notes-server/client.js
index d805601..156cb9a 100644
--- a/plugin/notes-server/client.js
+++ b/plugin/notes-server/client.js
@@ -6,8 +6,27 @@
var socketId = Math.random().toString().slice(2);
console.log('View slide notes at ' + window.location.origin + '/notes/' + socketId);
- window.open(window.location.origin + '/notes/' + socketId, 'notes-' + socketId)
+ window.open(window.location.origin + '/notes/' + socketId, 'notes-' + socketId);
+ // Fires when a fragment is shown
+ Reveal.addEventListener( 'fragmentshown', function( event ) {
+ var fragmentData = {
+ fragment : 'next',
+ socketId : socketId
+ };
+ socket.emit('fragmentchanged', fragmentData);
+ } );
+
+ // Fires when a fragment is hidden
+ Reveal.addEventListener( 'fragmenthidden', function( event ) {
+ var fragmentData = {
+ fragment : 'previous',
+ socketId : socketId
+ };
+ socket.emit('fragmentchanged', fragmentData);
+ } );
+
+ // Fires when slide is changed
Reveal.addEventListener( 'slidechanged', function( event ) {
var nextindexh;
var nextindexv;
@@ -35,4 +54,4 @@
socket.emit('slidechanged', slideData);
} );
-}()); \ No newline at end of file
+}());