decktape/plugins/shower-1.x.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

function Shower(page) {
this.page = page;
2015-07-03 15:58:11 +03:00
}
Shower.prototype = {
2015-08-09 19:02:49 +03:00
getName: function () {
2016-04-14 12:53:08 +03:00
return 'Shower 1.x';
2015-07-03 15:58:11 +03:00
},
2015-08-09 19:02:49 +03:00
isActive: function () {
return this.page.evaluate(function () {
2016-04-14 12:53:08 +03:00
return typeof shower === 'object' && typeof shower.modules === 'undefined';
});
2015-07-03 15:58:11 +03:00
},
2015-08-09 19:02:49 +03:00
configure: function () {
this.page.evaluate(function () {
shower.showPresenterNotes = function () {};
shower.first();
shower.enterSlideMode();
});
2015-07-03 15:58:11 +03:00
},
2015-08-09 19:02:49 +03:00
slideCount: function () {
return this.page.evaluate(function () {
return shower.slideList.length;
});
2015-07-03 15:58:11 +03:00
},
2015-08-09 19:02:49 +03:00
hasNextSlide: function () {
return this.page.evaluate(function () {
return (shower.getCurrentSlideNumber() + 1) in shower.slideList;
});
2015-07-03 15:58:11 +03:00
},
2015-08-09 19:02:49 +03:00
nextSlide: function () {
this.page.evaluate(function () {
shower.next();
});
2015-07-03 15:58:11 +03:00
},
2015-08-09 19:02:49 +03:00
currentSlideIndex: function () {
return this.page.evaluate(function () {
return shower.getSlideHash(shower.getCurrentSlideNumber()).substring(1);
});
2015-07-03 15:58:11 +03:00
}
};
2015-08-09 19:02:49 +03:00
exports.create = function (page) {
return new Shower(page);
};