mirror of
https://github.com/astefanutti/decktape.git
synced 2024-11-30 10:34:30 +03:00
39 lines
773 B
JavaScript
39 lines
773 B
JavaScript
exports.create = page => new Inspire(page);
|
|
|
|
class Inspire {
|
|
|
|
constructor(page) {
|
|
this.page = page;
|
|
}
|
|
|
|
getName() {
|
|
return 'Inspire';
|
|
}
|
|
|
|
isActive() {
|
|
return this.page.evaluate(_ =>
|
|
typeof Inspire === '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(_ => Inspire.index + 1 in Inspire.slides);
|
|
}
|
|
|
|
nextSlide() {
|
|
return this.page.evaluate(_ => Inspire.next(false));
|
|
}
|
|
|
|
currentSlideIndex() {
|
|
return this.page.evaluate(_ => Inspire.slides[Inspire.slide].id);
|
|
}
|
|
}
|