Skip to content

Instantly share code, notes, and snippets.

@erichsu
Last active January 23, 2016 18:34
Show Gist options
  • Select an option

  • Save erichsu/967f959386b7d37200e8 to your computer and use it in GitHub Desktop.

Select an option

Save erichsu/967f959386b7d37200e8 to your computer and use it in GitHub Desktop.
slide.js
var w = $('#whiteboard iframe')[0].contentWindow;
$('#whiteboard iframe').load(function() {
// $(this).focus();
if (window.location.search.substring(1) == 'con=yes') {
w.Reveal.addEventListener('slidechanged', function(event) {
// event.previousSlide, event.currentSlide, event.indexh, event.indexv
socket.emit('slide', w.Reveal.getIndices());
});
w.Reveal.addEventListener('fragmentshown', function() {
socket.emit('slide', w.Reveal.getIndices());
});
w.Reveal.addEventListener('fragmenthidden', function() {
socket.emit('slide', w.Reveal.getIndices());
});
}
$("#slide-left").click(function() {
// $(w).focus();
w.Reveal.prev();
// $(w).blur();
});
$("#slide-right").click(function() {
// $(w).focus();
w.Reveal.next();
// $(w).blur();
});
});
if (window.location.search.substring(1) != 'con=yes') {
socket.on('slide', function(slide) {
w.Reveal.slide(slide.h, slide.v, slide.f);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment