mirror of
https://github.com/astefanutti/decktape.git
synced 2024-12-02 14:49:58 +03:00
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
function Flowtime(page) {
|
|
this.page = page;
|
|
}
|
|
|
|
Flowtime.prototype = {
|
|
|
|
getName: function () {
|
|
return 'Flowtime JS';
|
|
},
|
|
|
|
isActive: function () {
|
|
return this.page.evaluate(function () {
|
|
return typeof Flowtime === 'object';
|
|
});
|
|
},
|
|
|
|
configure: function () {
|
|
this.page.evaluate(function () {
|
|
Flowtime.showProgress(false);
|
|
Flowtime.loop(false);
|
|
});
|
|
},
|
|
|
|
slideCount: function () {
|
|
return undefined;
|
|
},
|
|
|
|
hasNextSlide: function () {
|
|
return this.page.evaluate(function () {
|
|
return Flowtime.getNextPage() || Flowtime.getNextSection();
|
|
});
|
|
},
|
|
|
|
nextSlide: function () {
|
|
this.page.evaluate(function () {
|
|
Flowtime.next();
|
|
});
|
|
},
|
|
|
|
currentSlideIndex: function () {
|
|
return this.page.evaluate(function () {
|
|
return '/section-' + (Flowtime.getSectionIndex() + 1) + '/page-' + (Flowtime.getPageIndex() + 1);
|
|
});
|
|
}
|
|
};
|
|
|
|
exports.create = function (page) {
|
|
return new Flowtime(page);
|
|
}; |