aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorMichael Kühnel <mail@michael-kuehnel.de>2012-10-19 00:04:40 +0200
committerMichael Kühnel <mail@michael-kuehnel.de>2012-10-19 00:04:40 +0200
commitc46486b3df7db25912bc085c7d84612b0724a7cc (patch)
tree9c11b36797e2ab960d249ed0e78461382f0e8138 /plugin
parent46e270e59f9aae7a3528fcd3f9d2287f341c0be7 (diff)
downloadfreenode-live-2017-presentation-c46486b3df7db25912bc085c7d84612b0724a7cc.tar
freenode-live-2017-presentation-c46486b3df7db25912bc085c7d84612b0724a7cc.tar.gz
Add event listener 'fragmentshown' and 'fragmenthidden'
And emit 'fragmentchanged' with the appropriate fragmentData to show or hide fragments.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/speakernotes/client.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugin/speakernotes/client.js b/plugin/speakernotes/client.js
index 43dc126..757e6cd 100644
--- a/plugin/speakernotes/client.js
+++ b/plugin/speakernotes/client.js
@@ -8,6 +8,25 @@
console.log('View slide notes at ' + window.location.origin + '/notes/' + socketId);
window.open(window.location.origin + '/notes/' + socketId, 'notes-' + socketId);
+ // Fires when a fragment is shown
+ Reveal.addEventListener( 'fragmentshown', function( event ) {
+ var fragmentData = {
+ showFragment : true,
+ socketId : socketId
+ };
+ socket.emit('fragmentchanged', fragmentData);
+ } );
+
+ // Fires when a fragment is hidden
+ Reveal.addEventListener( 'fragmenthidden', function( event ) {
+ var fragmentData = {
+ hideFragment : true,
+ socketId : socketId
+ };
+ socket.emit('fragmentchanged', fragmentData);
+ } );
+
+ // Fires when slide is changed
Reveal.addEventListener( 'slidechanged', function( event ) {
var nextindexh;
var nextindexv;