get 'fragmentdata' and react by showing/hiding the corresponding fragments

This commit is contained in:
Michael Kühnel 2012-10-19 00:07:26 +02:00
parent c46486b3df
commit d02e64adbd
1 changed files with 13 additions and 0 deletions

View File

@ -110,6 +110,7 @@
socket.on('slidedata', function(data) {
// ignore data from sockets that aren't ours
console.dir(data);
if (data.socketId !== socketId) { return; }
if (data.markdown) {
@ -122,6 +123,18 @@
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>