diff options
author | Hakim El Hattab | 2012-10-25 09:42:33 -0400 |
---|---|---|
committer | Hakim El Hattab | 2012-10-25 09:42:33 -0400 |
commit | 6794f543e0d8ff589fe5258a6923f1afffc1e0da (patch) | |
tree | 4e01bc032d6959ebb6af9d6ac898dddfe80338e5 /plugin/notes-server/client.js | |
parent | 5d1bac5790086cbd28fbcacd8a4cadb6c6e2e403 (diff) | |
parent | b838522be43062bfeca2953506f514f5f88996fc (diff) |
merge in support for stepped fragments in notes server
Diffstat (limited to 'plugin/notes-server/client.js')
-rw-r--r-- | plugin/notes-server/client.js | 23 |
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 +}()); |