From 0338f280d3942094782da57ea3b5b72bdb833e9d Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 10 Sep 2015 08:28:52 +0200 Subject: [PATCH] add getSlideNotes API method and tests --- README.md | 3 +++ js/reveal.js | 46 ++++++++++++++++++++++++++++++---------------- test/test.html | 3 ++- test/test.js | 10 +++++++++- 4 files changed, 44 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 8d25fa7..9011605 100644 --- a/README.md +++ b/README.md @@ -372,6 +372,9 @@ Reveal.getIndices(); // { h: 0, v: 0 } } Reveal.getProgress(); // 0-1 Reveal.getTotalSlides(); +// Returns the speaker notes for the current slide +Reveal.getSlideNotes(); + // State checks Reveal.isFirstSlide(); Reveal.isLastSlide(); diff --git a/js/reveal.js b/js/reveal.js index 83c180b..2b8fec7 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2475,22 +2475,7 @@ if( config.showNotes && dom.speakerNotes && currentSlide && !isPrintingPDF() ) { - var notes = ''; - - // Notes can be specified via the data-notes attribute... - if( currentSlide.hasAttribute( 'data-notes' ) ) { - notes = currentSlide.getAttribute( 'data-notes' ); - } - - // ... or using an