MCPcopy Create free account
hub / github.com/boost-ext/di / post

Function post

doc/cppnow-2016/plugin/notes-server/client.js:16–41  ·  view source on GitHub ↗

* Posts the current slide data to the notes window

()

Source from the content-addressed store, hash-verified

14 * Posts the current slide data to the notes window
15 */
16 function post() {
17
18 var slideElement = Reveal.getCurrentSlide(),
19 notesElement = slideElement.querySelector( 'aside.notes' );
20
21 var messageData = {
22 notes: '',
23 markdown: false,
24 socketId: socketId,
25 state: Reveal.getState()
26 };
27
28 // Look for notes defined in a slide attribute
29 if( slideElement.hasAttribute( 'data-notes' ) ) {
30 messageData.notes = slideElement.getAttribute( 'data-notes' );
31 }
32
33 // Look for notes defined in an aside element
34 if( notesElement ) {
35 messageData.notes = notesElement.innerHTML;
36 messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
37 }
38
39 socket.emit( 'statechanged', messageData );
40
41 }
42
43 // When a new notes window connects, post our current state
44 socket.on( 'new-subscriber', function( data ) {

Callers 1

client.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected