master.js 845 B

1234567891011121314151617181920212223242526272829303132
  1. (function() {
  2. // don't emit events from inside the previews themselves
  3. if ( window.location.search.match( /receiver/gi ) ) { return; }
  4. var socket = io.connect(multiplex.url);
  5. Reveal.addEventListener( 'slidechanged', function( event ) {
  6. var nextindexh;
  7. var nextindexv;
  8. var slideElement = event.currentSlide;
  9. if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') {
  10. nextindexh = event.indexh;
  11. nextindexv = event.indexv + 1;
  12. } else {
  13. nextindexh = event.indexh + 1;
  14. nextindexv = 0;
  15. }
  16. var notes = slideElement.querySelector('aside.notes');
  17. var slideData = {
  18. indexh : event.indexh,
  19. indexv : event.indexv,
  20. nextindexh : nextindexh,
  21. nextindexv : nextindexv,
  22. secret: multiplex.secret,
  23. socketId : multiplex.id
  24. };
  25. socket.emit('slidechanged', slideData);
  26. } );
  27. }());