mirror of
https://github.com/astefanutti/decktape.git
synced 2024-11-30 10:34:30 +03:00
38 lines
749 B
JavaScript
38 lines
749 B
JavaScript
exports.create = page => new WebSlides(page);
|
|
|
|
class WebSlides {
|
|
|
|
constructor(page) {
|
|
this.page = page;
|
|
}
|
|
|
|
getName() {
|
|
return 'WebSlides';
|
|
}
|
|
|
|
configure() {
|
|
return this.page.evaluate(_ => {
|
|
const style = document.createElement('style');
|
|
const css = document.createTextNode('#counter, #navigation {display: none !important}');
|
|
style.appendChild(css);
|
|
document.body.appendChild(style);
|
|
});
|
|
}
|
|
|
|
isActive() {
|
|
return this.page.evaluate(_ => typeof ws === 'object');
|
|
}
|
|
|
|
slideCount() {
|
|
return this.page.evaluate(_ => ws.maxSlide_);
|
|
}
|
|
|
|
nextSlide() {
|
|
return this.page.evaluate(_ => ws.goNext());
|
|
}
|
|
|
|
currentSlideIndex() {
|
|
return this.page.evaluate(_ => ws.currentSlideI_);
|
|
}
|
|
}
|