decktape/plugins/flowtime.js

41 lines
759 B
JavaScript
Raw Normal View History

2017-08-21 01:43:32 +03:00
exports.create = page => new Flowtime(page);
class Flowtime {
constructor(page) {
this.page = page;
2017-08-21 01:43:32 +03:00
}
getName() {
return 'Flowtime JS';
}
isActive() {
return this.page.evaluate(_ => typeof Flowtime === 'object');
}
configure() {
return this.page.evaluate(_ => {
Flowtime.showProgress(false);
Flowtime.loop(false);
});
}
slideCount() {
return undefined;
}
hasNextSlide() {
return this.page.evaluate(_ => Flowtime.getNextPage() || Flowtime.getNextSection());
}
nextSlide() {
return this.page.evaluate(_ => Flowtime.next());
}
currentSlideIndex() {
return this.page.evaluate(_ =>
`/section-${Flowtime.getSectionIndex() + 1}/page-${Flowtime.getPageIndex() + 1}`);
}
2015-07-01 16:35:53 +03:00
}