decktape/plugins/flowtime.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

function Flowtime(page) {
this.page = page;
2015-07-01 16:35:53 +03:00
}
Flowtime.prototype = {
2015-08-09 19:02:49 +03:00
getName: function () {
2016-02-22 12:43:33 +03:00
return 'Flowtime JS';
2015-07-01 16:35:53 +03:00
},
2015-08-09 19:02:49 +03:00
isActive: function () {
return this.page.evaluate(function () {
2016-02-22 12:43:33 +03:00
return typeof Flowtime === 'object';
});
2015-07-01 16:35:53 +03:00
},
2015-08-09 19:02:49 +03:00
configure: function () {
this.page.evaluate(function () {
Flowtime.showProgress(false);
Flowtime.loop(false);
});
2015-07-01 16:35:53 +03:00
},
2015-08-09 19:02:49 +03:00
slideCount: function () {
2015-07-01 16:35:53 +03:00
return undefined;
},
2015-08-09 19:02:49 +03:00
hasNextSlide: function () {
return this.page.evaluate(function () {
return Flowtime.getNextPage() || Flowtime.getNextSection();
});
2015-07-01 16:35:53 +03:00
},
2015-08-09 19:02:49 +03:00
nextSlide: function () {
this.page.evaluate(function () {
Flowtime.next();
});
2015-07-01 16:35:53 +03:00
},
2015-08-09 19:02:49 +03:00
currentSlideIndex: function () {
return this.page.evaluate(function () {
2016-02-22 12:43:33 +03:00
return '/section-' + (Flowtime.getSectionIndex() + 1) + '/page-' + (Flowtime.getPageIndex() + 1);
});
2015-07-01 16:35:53 +03:00
}
};
2015-08-09 19:02:49 +03:00
exports.create = function (page) {
return new Flowtime(page);
};