mirror of
https://github.com/astefanutti/decktape.git
synced 2024-11-30 10:34:30 +03:00
29 lines
515 B
JavaScript
29 lines
515 B
JavaScript
exports.create = page => new Deck(page);
|
|
|
|
class Deck {
|
|
|
|
constructor(page) {
|
|
this.page = page;
|
|
}
|
|
|
|
getName() {
|
|
return 'Deck JS';
|
|
}
|
|
|
|
isActive() {
|
|
return this.page.evaluate(_ => typeof $ === 'function' && typeof $.deck === 'function');
|
|
}
|
|
|
|
slideCount() {
|
|
return this.page.evaluate(_ => $.deck('getSlides').length);
|
|
}
|
|
|
|
nextSlide() {
|
|
return this.page.evaluate(_ => $.deck('next'));
|
|
}
|
|
|
|
currentSlideIndex() {
|
|
return this.page.evaluate(_ => $.deck('getSlide').attr('id'));
|
|
}
|
|
}
|