Make the fragments visible in speaker notes
This commit is contained in:
parent
76a7bd83fa
commit
296242f8d3
2 changed files with 67 additions and 23 deletions
|
@ -109,12 +109,15 @@
|
|||
|
||||
window.addEventListener( 'message', function( event ) {
|
||||
var data = JSON.parse( event.data );
|
||||
|
||||
if( data.markdown ) {
|
||||
notes.innerHTML = (new Showdown.converter()).makeHtml( data.notes );
|
||||
}
|
||||
else {
|
||||
notes.innerHTML = data.notes;
|
||||
console.log(data);
|
||||
// No need for updating the notes in case of fragement changes
|
||||
if ( data.notes !== undefined) {
|
||||
if( data.markdown ) {
|
||||
notes.innerHTML = (new Showdown.converter()).makeHtml( data.notes );
|
||||
}
|
||||
else {
|
||||
notes.innerHTML = data.notes;
|
||||
}
|
||||
}
|
||||
|
||||
// Kill the slide listeners while responding to the event
|
||||
|
@ -124,6 +127,14 @@
|
|||
currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv );
|
||||
nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv );
|
||||
|
||||
// Showing and hiding fragments
|
||||
if (data.fragment === 'next') {
|
||||
currentSlide.contentWindow.Reveal.nextFragment();
|
||||
}
|
||||
else if (data.fragment === 'prev') {
|
||||
currentSlide.contentWindow.Reveal.prevFragment();
|
||||
}
|
||||
|
||||
// Resume listening on the next cycle
|
||||
setTimeout( addSlideListeners, 1 );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue