|
@@ -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);
|
|
|
} );
|
|
|
-}());
|
|
|
+}());
|