decktape/plugins/deck.js

38 lines
779 B
JavaScript
Raw Normal View History

function Deck(page) {
this.page = page;
2015-07-01 12:20:48 +03:00
}
Deck.prototype = {
getName : function() {
return "Deck JS";
},
isActive : function() {
return this.page.evaluate(function() {
return typeof $ === "function" && typeof $.deck === "function";
});
2015-07-01 12:20:48 +03:00
},
slideCount : function() {
return this.page.evaluate(function() {
return $.deck("getSlides").length;
});
2015-07-01 12:20:48 +03:00
},
nextSlide : function() {
this.page.evaluate(function() {
$.deck("next");
});
2015-07-01 12:20:48 +03:00
},
currentSlideIndex : function() {
return this.page.evaluate(function() {
return $.deck("getSlide").attr("id");
});
2015-07-01 12:20:48 +03:00
}
};
exports.create = function(page) {
return new Deck(page);
};