-
Notifications
You must be signed in to change notification settings - Fork 176
/
remark.js
45 lines (37 loc) · 1.08 KB
/
remark.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function Remark(page) {
this.page = page;
}
// TODO: improve backward compatibility (e.g. getCurrentSlideIndex was getCurrentSlideNo in earlier versions)
Remark.prototype = {
getName: function () {
return 'Remark JS';
},
isActive: function () {
return this.page.evaluate(function () {
return typeof remark === 'object' && typeof slideshow === 'object';
});
},
slideCount: function () {
return this.page.evaluate(function () {
return slideshow.getSlideCount();
});
},
hasNextSlide: function () {
return this.page.evaluate(function () {
return slideshow.getCurrentSlideIndex() + 1 < slideshow.getSlideCount();
});
},
nextSlide: function () {
this.page.evaluate(function () {
slideshow.gotoNextSlide();
});
},
currentSlideIndex: function () {
return this.page.evaluate(function () {
return slideshow.getCurrentSlideIndex() + 1;
});
}
};
exports.create = function (page) {
return new Remark(page);
};