<canvas id="pscanvas" width="4096" height="4096"></canvas>
<div id="loader"></div>
<div id="hiddencontents"><!-- $hiddenContents --></div>
-<div id="splash" style="background-color:#<!-- $bgcolor -->;"><!-- $splash --></div>
+<div id="splash" style="background-color:#<!-- $bgcolor -->;<!-- $splashstyles -->"><!-- $splash --></div>
<div id="popinOverlay"></div>
<div id="landingPage"></div>
<div id="loadedcontents"></div>
this.landingpage = new FluidbookLandingPage(this);
}
+ this.splash = new FluidbookSplash(this);
this.contentlock = new FluidbookContentLock(this);
this.menu = new FluidbookMenu(this);
this.support = new FluidbookSupport(this);
this.slideshow = new FluidbookSlideshow(this);
this.printing = new FluidbookPrint(this);
+
if (this.settings.basket) {
this.cart = new FluidbookCart(this);
}
});
// See fluidbook.audiodescription.js for specific shortcuts
},
- hideSplash: function () {
- if ($("#splash").length == 0) {
- return;
- }
- try {
- navigator.splashscreen.hide();
- } catch (err) {
- }
- $(this).trigger('fluidbook.splash.beforehide');
- var $this = this;
- if (this.support.transitions3dacc && this.settings.mobileTransitions === 'flip3d' && !this.mobilefirst.enabled) {
- $("#main,#viewOverlay,#view").css('visibility', 'visible');
- resize();
- this.networkControl.pause(4000);
- setTimeout(function () {
- this.fluidbook.pagetransitions.flip3d.performancesTest(function () {
- $this.networkControl.resume();
- $this._hideSplash();
- })
- }, 500);
- } else {
- this._hideSplash();
- }
- },
-
-
- _hideSplash: function () {
- var $this = this;
- var timeout = 700;
- this.resize.resize(false, true);
- setTimeout(function () {
- $this.__hideSplash();
- }, timeout);
- },
-
- __hideSplash: function () {
-
- $("#main,#viewOverlay,#view").css('visibility', 'visible');
- this.resize.resize(false);
- this.hideLoader(0, true);
-
- if (this.support.transitions2d && !this.support.iOS) {
- $("#splash").css('opacity', 0).one('transitionend', function () {
- $(this).remove();
- });
- } else {
- $("#splash").fadeOut(500, function () {
- $(this.remove());
- })
- }
-
- setTimeout(function () {
- $("#splash").remove();
- }, 1500);
-
- this.allowChangePage();
- $(this).trigger('fluidbook.splash.hide');
- },
allowChangePage: function () {
var $this = this;
}
$this.zoom.resetZoom();
- $this.hideSplash();
+ $this.splash.hide();
}, true);
} else if (args[1] === 'landing') {
- $this.hideSplash();
+ $this.splash.hide();
if (this.landingpage !== undefined) {
this.landingpage.show();
}
$this.pagetransitions.pageTransition(this.currentPage);
}
this.menu.openView(view, args[2], args[3], function () {
- $this.hideSplash();
+ $this.splash.hide();
});
}
return;
--- /dev/null
+function FluidbookSplash(fluidbook) {
+ this.fluidbook = fluidbook;
+ this.init();
+}
+
+FluidbookSplash.prototype = {
+ init: function () {
+ this.waitForTimer = true;
+ this.waitForReady = true;
+
+ var $this = this;
+ this.initTime = Date.now();
+ setTimeout(function () {
+ $this.waitForTimer = false;
+ $this.hideIfPossible();
+ }, parseFloat(this.fluidbook.settings.splashMinimalTime) * 1000);
+
+ },
+
+ hide: function () {
+ if ($("#splash").length == 0) {
+ return;
+ }
+ this.waitForReady = false;
+ try {
+ navigator.splashscreen.hide();
+ } catch (err) {
+ }
+ $(this.fluidbook).trigger('fluidbook.splash.beforehide');
+ var $this = this;
+ if (this.fluidbook.support.transitions3dacc && this.fluidbook.settings.mobileTransitions === 'flip3d' && !this.fluidbook.mobilefirst.enabled) {
+ $("#main,#viewOverlay,#view").css('visibility', 'visible');
+ resize();
+ this.fluidbook.networkControl.pause(4000);
+ setTimeout(function () {
+ this.fluidbook.pagetransitions.flip3d.performancesTest(function () {
+ $this.fluidbook.networkControl.resume();
+ $this.hideIfPossible();
+ })
+ }, 500);
+ } else {
+ this.hideIfPossible();
+ }
+ },
+
+ hideIfPossible: function () {
+ if (!this.waitForReady && !this.waitForTimer) {
+ this._hide();
+ }
+ },
+
+ _hide: function () {
+ var $this = this;
+ var timeout = 700;
+ this.fluidbook.resize.resize(false, true);
+ setTimeout(function () {
+ $this.__hide();
+ }, timeout);
+ },
+
+ __hide: function () {
+
+ $("#main,#viewOverlay,#view").css('visibility', 'visible');
+ this.fluidbook.resize.resize(false);
+ this.fluidbook.hideLoader(0, true);
+
+ if (this.fluidbook.support.transitions2d && !this.fluidbook.support.iOS) {
+ $("#splash").css('opacity', 0).one('transitionend', function () {
+ $(this).remove();
+ });
+ } else {
+ $("#splash").fadeOut(500, function () {
+ $(this.remove());
+ })
+ }
+
+ setTimeout(function () {
+ $("#splash").remove();
+ }, 1500);
+
+ this.fluidbook.allowChangePage();
+ $(this.fluidbook).trigger('fluidbook.splash.hide');
+ },
+
+}
\ No newline at end of file