get 'fragmentdata' and react by showing/hiding the corresponding fragments
authorMichael Kühnel <mail@michael-kuehnel.de>
Thu, 18 Oct 2012 22:07:26 +0000 (00:07 +0200)
committerMichael Kühnel <mail@michael-kuehnel.de>
Thu, 18 Oct 2012 22:07:26 +0000 (00:07 +0200)
plugin/speakernotes/notes.html

index c051879c6bcb86d161c5551f1d4e8d0d00c7bcfc..af42480cbdf0898d0ba6ca8f45b3cf94cc10aa91 100644 (file)
 
                socket.on('slidedata', function(data) {
                        // ignore data from sockets that aren't ours
+                       console.dir(data);
                        if (data.socketId !== socketId) { return; }
 
                        if (data.markdown) {
                        currentSlide.contentWindow.Reveal.slide(data.indexh, data.indexv);
                        nextSlide.contentWindow.Reveal.slide(data.nextindexh, data.nextindexv);
                });
+               socket.on('fragmentdata', function(data) {
+                       // ignore data from sockets that aren't ours
+                       console.dir(data);
+                       if (data.socketId !== socketId) { return; }
+
+                       if (data.showFragment === true) {
+                               currentSlide.contentWindow.Reveal.nextFragment();
+                       }
+                       else if (data.hideFragment === true) {
+                               currentSlide.contentWindow.Reveal.previousFragment();
+                       }
+               });
                </script>
 
        </body>