mirror of
https://github.com/astefanutti/decktape.git
synced 2025-01-07 06:50:28 +03:00
591e14155b
The generic plugin emulates the end-user interaction by pressing the specified key [--keycode] and iterating over the presentation as long as any change to the DOM is detected by observing mutation events to the body element and its subtree. To support the generic plugin feature, the following enhancements are introduced: - Move to promises based navigation scheduling - Build CLI commands directly from available plugins - Enable per plugin CLI help and options - Enable by-command overriding of the selected plugin
49 lines
1.0 KiB
JavaScript
49 lines
1.0 KiB
JavaScript
function Flowtime(page) {
|
|
this.page = page;
|
|
}
|
|
|
|
Flowtime.prototype = {
|
|
|
|
getName : function() {
|
|
return "Flowtime JS";
|
|
},
|
|
|
|
isActive : function() {
|
|
return page.evaluate(function() {
|
|
return typeof Flowtime === "object";
|
|
});
|
|
},
|
|
|
|
configure : function() {
|
|
page.evaluate(function() {
|
|
Flowtime.showProgress(false);
|
|
Flowtime.loop(false);
|
|
});
|
|
},
|
|
|
|
slideCount : function() {
|
|
return undefined;
|
|
},
|
|
|
|
hasNextSlide : function() {
|
|
return page.evaluate(function() {
|
|
return Flowtime.getNextPage() || Flowtime.getNextSection();
|
|
});
|
|
},
|
|
|
|
nextSlide : function() {
|
|
page.evaluate(function() {
|
|
Flowtime.next();
|
|
});
|
|
},
|
|
|
|
currentSlideIndex : function() {
|
|
return page.evaluate(function() {
|
|
return "/section-" + (Flowtime.getSectionIndex() + 1) + "/page-" + (Flowtime.getPageIndex() + 1);
|
|
});
|
|
}
|
|
};
|
|
|
|
exports.create = function(page) {
|
|
return new Flowtime(page);
|
|
}; |