Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: KOB1
Views: 16973(function() {12// don't emit events from inside the previews themselves3if( window.location.search.match( /receiver/gi ) ) { return; }45var socket = io.connect( window.location.origin ),6socketId = Math.random().toString().slice( 2 );78console.log( 'View slide notes at ' + window.location.origin + '/notes/' + socketId );910window.open( window.location.origin + '/notes/' + socketId, 'notes-' + socketId );1112/**13* Posts the current slide data to the notes window14*/15function post() {1617var slideElement = Reveal.getCurrentSlide(),18notesElement = slideElement.querySelector( 'aside.notes' );1920var messageData = {21notes: '',22markdown: false,23socketId: socketId,24state: Reveal.getState()25};2627// Look for notes defined in a slide attribute28if( slideElement.hasAttribute( 'data-notes' ) ) {29messageData.notes = slideElement.getAttribute( 'data-notes' );30}3132// Look for notes defined in an aside element33if( notesElement ) {34messageData.notes = notesElement.innerHTML;35messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';36}3738socket.emit( 'statechanged', messageData );3940}4142// When a new notes window connects, post our current state43socket.on( 'new-subscriber', function( data ) {44post();45} );4647// When the state changes from inside of the speaker view48socket.on( 'statechanged-speaker', function( data ) {49Reveal.setState( data.state );50} );5152// Monitor events that trigger a change in state53Reveal.addEventListener( 'slidechanged', post );54Reveal.addEventListener( 'fragmentshown', post );55Reveal.addEventListener( 'fragmenthidden', post );56Reveal.addEventListener( 'overviewhidden', post );57Reveal.addEventListener( 'overviewshown', post );58Reveal.addEventListener( 'paused', post );59Reveal.addEventListener( 'resumed', post );6061// Post the initial state62post();6364}());656667