decktape/plugins/csss.js
Antonin Stefanutti 820176b217 Migrate to ES6
2017-08-25 15:18:07 +02:00

40 lines
868 B
JavaScript

exports.create = page => new CSSS(page);
class CSSS {
constructor(page) {
this.page = page;
}
getName() {
return 'CSSS';
}
isActive() {
// Avoid global variable name collision with remark.js
return this.page.evaluate(_ =>
typeof remark === 'undefined' && typeof slideshow === 'object');
}
configure() {
return this.page.evaluate(_ => document.getElementById('timer').style.display = 'none');
}
slideCount() {
return this.page.evaluate(_ =>
document.querySelectorAll('.slide, .delayed, .delayed-children > *').length);
}
hasNextSlide() {
return this.page.evaluate(_ => slideshow.index + 1 in slideshow.slides);
}
nextSlide() {
return this.page.evaluate(_ => slideshow.next(false));
}
currentSlideIndex() {
return this.page.evaluate(_ => slideshow.slides[slideshow.slide].id);
}
}