* Retrieves the speaker notes from a slide. Notes can be * defined in two ways: * 1. As a data-notes attribute on the slide * 2. With elements inside the slide * * @param {HTMLElement} [slide=currentSlide] * @return {(string|null)}
( slide = this.Reveal.getCurrentSlide() )
| 101 | * @return {(string|null)} |
| 102 | */ |
| 103 | getSlideNotes( slide = this.Reveal.getCurrentSlide() ) { |
| 104 | |
| 105 | // Notes can be specified via the data-notes attribute... |
| 106 | if( slide.hasAttribute( 'data-notes' ) ) { |
| 107 | return slide.getAttribute( 'data-notes' ); |
| 108 | } |
| 109 | |
| 110 | // ... or using <aside class="notes"> elements |
| 111 | let notesElements = slide.querySelectorAll( 'aside.notes' ); |
| 112 | if( notesElements ) { |
| 113 | return Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\n' ); |
| 114 | } |
| 115 | |
| 116 | return null; |
| 117 | |
| 118 | } |
| 119 | |
| 120 | destroy() { |
| 121 |