decktape/plugins/csss.js
astefanutti 591e14155b Add generic plugin to support any kind of presentation frameworks
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
2015-07-08 17:41:40 +02:00

51 lines
1.2 KiB
JavaScript

function CSSS(page) {
this.page = page;
}
CSSS.prototype = {
getName : function() {
return "CSSS";
},
isActive : function() {
return page.evaluate(function() {
// Avoid global variable name collision with remark.js
return typeof remark === "undefined" && typeof slideshow === "object";
});
},
configure : function() {
page.evaluate(function() {
document.getElementById("timer").style.display = "none";
});
},
slideCount : function() {
return page.evaluate(function() {
return document.querySelectorAll(".slide, .delayed, .delayed-children > *").length;
});
},
hasNextSlide : function() {
return page.evaluate(function() {
return (slideshow.index + 1) in slideshow.slides;
});
},
nextSlide : function() {
page.evaluate(function() {
slideshow.next(false);
});
},
currentSlideIndex : function() {
return page.evaluate(function() {
return slideshow.slides[slideshow.slide].id;
});
}
};
exports.create = function(page) {
return new CSSS(page);
};