2015-07-08 18:22:39 +03:00
|
|
|
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-08 18:22:39 +03:00
|
|
|
});
|
2015-07-01 16:35:53 +03:00
|
|
|
},
|
|
|
|
|
2015-08-09 19:02:49 +03:00
|
|
|
configure: function () {
|
|
|
|
this.page.evaluate(function () {
|
2015-07-08 18:22:39 +03:00
|
|
|
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 () {
|
2015-07-08 18:22:39 +03:00
|
|
|
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 () {
|
2015-07-08 18:22:39 +03:00
|
|
|
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-08 18:22:39 +03:00
|
|
|
});
|
2015-07-01 16:35:53 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-08-09 19:02:49 +03:00
|
|
|
exports.create = function (page) {
|
2015-07-08 18:22:39 +03:00
|
|
|
return new Flowtime(page);
|
|
|
|
};
|