this.sound = new FluidbookSound(this);
this.slideshow = new FluidbookSlideshow(this);
this.printing = new FluidbookPrint(this);
+ this.posad = new FluidbookPOSAd(this);
if (this.settings.basket) {
this.cart = new FluidbookCart(this);
}
// fix #3407
- if (target==='_popupiframe' && Modernizr.ios && url.search(/\.pdf$/) >= 0) {
+ if (target === '_popupiframe' && Modernizr.ios && url.search(/\.pdf$/) >= 0) {
target = '_blank';
}
--- /dev/null
+function FluidbookPOSAd(fluidbook) {
+ this.fluidbook = fluidbook;
+ this.enabled = this.fluidbook.settings.plv;
+ this.direction = 1;
+ if (this.enabled) {
+ this.init();
+ }
+}
+
+FluidbookPOSAd.prototype = {
+ init: function () {
+ // Apply styles (hide mouse, menus, interface)
+ $('body').addClass('posad');
+ // Disable links blinking
+ this.fluidbook.settings.bookmarkBlinkOnPageChange = this.fluidbook.settings.mobileLinksRevealAnim = false;
+ // Go to fullscreen in nwjs
+ if (this.fluidbook.support.nwjs) {
+ win = nw.Window.get();
+ win.enterFullscreen();
+ }
+ // Launch automatic pages turning
+ var $this = this;
+ $(this.fluidbook).one('fluidbook.splash.hide', function () {
+ $this.launch();
+ });
+ },
+
+ launch: function () {
+ var $this = this;
+ setTimeout(function () {
+ $this.nextPage();
+ }, this.fluidbook.settings.plvTimer * 1000);
+ },
+
+ nextPage: function () {
+ var bv = this.fluidbook.getButtonsVisibility();
+ if (this.direction === 1) {
+ if (bv.next) {
+ this.fluidbook.goNextPage();
+ } else {
+ if (this.fluidbook.settings.plvMode === 'first') {
+ this.fluidbook.goFirstPage();
+ } else {
+ this.fluidbook.goPreviousPage();
+ this.direction = -1;
+ }
+ }
+ } else {
+ if (bv.previous) {
+ this.fluidbook.goPreviousPage();
+ } else {
+ this.fluidbook.goNextPage();
+ this.direction = 1;
+ }
+ }
+ var $this = this;
+ $(this.fluidbook).one('fluidbook.page.change.end', function () {
+ $this.launch();
+ });
+ },
+};
\ No newline at end of file
--- /dev/null
+body.posad {
+ cursor: none !important;
+
+ #links .container {
+ cursor: none !important;
+ }
+
+ footer, #interface, header, #pagesnumbers {
+ visibility: hidden;
+ pointer-events: none;
+ }
+}
\ No newline at end of file