add new getSlides() API
This can be used by plugins which are concerned with helping the presenter with their pace.
This commit is contained in:
parent
40912ace1f
commit
ef9cbbbbb9
2 changed files with 17 additions and 4 deletions
|
@ -494,10 +494,11 @@ Reveal.getScale();
|
||||||
Reveal.getPreviousSlide();
|
Reveal.getPreviousSlide();
|
||||||
Reveal.getCurrentSlide();
|
Reveal.getCurrentSlide();
|
||||||
|
|
||||||
Reveal.getIndices(); // { h: 0, v: 0 } }
|
Reveal.getIndices(); // { h: 0, v: 0 } }
|
||||||
Reveal.getPastSlideCount();
|
Reveal.getPastSlideCount();
|
||||||
Reveal.getProgress(); // (0 == first slide, 1 == last slide)
|
Reveal.getProgress(); // (0 == first slide, 1 == last slide)
|
||||||
Reveal.getTotalSlides(); // total number of slides
|
Reveal.getSlides(); // Array of all slides
|
||||||
|
Reveal.getTotalSlides(); // total number of slides
|
||||||
|
|
||||||
// Returns the speaker notes for the current slide
|
// Returns the speaker notes for the current slide
|
||||||
Reveal.getSlideNotes();
|
Reveal.getSlideNotes();
|
||||||
|
|
14
js/reveal.js
14
js/reveal.js
|
@ -3673,6 +3673,15 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all slides in this presentation.
|
||||||
|
*/
|
||||||
|
function getSlides() {
|
||||||
|
|
||||||
|
return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the total number of slides in this presentation.
|
* Retrieves the total number of slides in this presentation.
|
||||||
*
|
*
|
||||||
|
@ -3680,7 +3689,7 @@
|
||||||
*/
|
*/
|
||||||
function getTotalSlides() {
|
function getTotalSlides() {
|
||||||
|
|
||||||
return dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ).length;
|
return getSlides().length;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4984,6 +4993,9 @@
|
||||||
// Returns the indices of the current, or specified, slide
|
// Returns the indices of the current, or specified, slide
|
||||||
getIndices: getIndices,
|
getIndices: getIndices,
|
||||||
|
|
||||||
|
// Returns an Array of all slides
|
||||||
|
getSlides: getSlides,
|
||||||
|
|
||||||
// Returns the total number of slides
|
// Returns the total number of slides
|
||||||
getTotalSlides: getTotalSlides,
|
getTotalSlides: getTotalSlides,
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue