]> _ Git - fluidbook-html5.git/commitdiff
fix #3988 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 20 Nov 2020 14:21:01 +0000 (15:21 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 20 Nov 2020 14:21:01 +0000 (15:21 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.networkcontrol.js
js/libs/fluidbook/fluidbook.splash.js
js/libs/fluidbook/fluidbook.stats.js

index 21079dfe6d10850f36223e96615bb3e95d0b9a4b..ad63f3b8b0ec9ac87c26a017b1f51a9ec3191bb0 100644 (file)
@@ -147,6 +147,9 @@ Fluidbook.prototype = {
             var map = {1: 'none', 2: 'slide', 3: 'flip', 4: 'flip3d'};
             this.settings.mobileTransitions = map[$_GET['transition']];
         }
+        if (this.nointerface) {
+            this.settings.mobileTransitions = 'none';
+        }
 
         /**
          * @deprecated
index 6fa9a3b7534c3f11bffda83eeb6efb4adb7c97be..efb655d4d18b084919f91ceb9ca1f05aafe92768 100644 (file)
@@ -813,6 +813,7 @@ FluidbookLinks.prototype = {
         var e = $('[data-id="' + iid + '"]');
         e.removeClass('animaterollover');
     },
+
     resizeIframe: function (height) {
         var iframe = $('.link iframe').eq(0);
         var container = iframe.closest('.content');
index 99ff50197d9db5d1c91a0a4256dca4b77fe13d24..39367ceeb3002652b9a4272b5d44719510c09937 100644 (file)
@@ -53,7 +53,11 @@ FluidbookLoader.prototype = {
     },
 
     preloadStart: function (callback) {
-        this.toPreload = [1, 2, 3];
+        if (this.fluidbook.nointerface) {
+            this.toPreload = [1];
+        } else {
+            this.toPreload = [1, 2, 3];
+        }
         this.preloaded = this.toPreload.slice(0);
         this.preloadPages(callback);
     },
@@ -167,6 +171,8 @@ FluidbookLoader.prototype = {
         }
 
         var $__callback = function () {
+
+
             if ($this.getVersionToLoad(page) === 'textasvector' || $this.getVersionToLoad(page) === 'vector') {
                 $this.loadTexts(page, $_callback);
             } else {
@@ -450,7 +456,7 @@ FluidbookLoader.prototype = {
                     $this._preloadPage(page, callback);
                     return;
                 }
-                ctx.drawImage(img, -1, 0, d+2, d);
+                ctx.drawImage(img, -1, 0, d + 2, d);
             } catch (e) {
             }
         }
@@ -628,7 +634,7 @@ FluidbookLoader.prototype = {
                         callbackCalled = true;
                         cb();
                     }
-                }, 10)
+                }, $this.fluidbook.nointerface ? 0 : 10);
             }
         }
 
index 0837b4fb8838e9f617281f29b544875454478908..2f6e5a4cd96a99ac76a9aae7874aeb9e13efb6a8 100644 (file)
@@ -38,6 +38,10 @@ FluidbookNetworkControl.prototype = {
     },
 
     executeWhenNetwork: function (f, highPriority) {
+        if (this.fluidbook.nointerface) {
+            f();
+            return;
+        }
         if (highPriority === undefined) {
             highPriority = false;
         }
index 49f52b1b35221afdb38cb85db52dd5a528fed627..3c0f22dc4ef7c5c53061f24c9c2c903d88fa0e22 100644 (file)
@@ -10,22 +10,24 @@ FluidbookSplash.prototype = {
         this.waitForReady = true;
 
         var defaultMin = 5;
-        if (this.fluidbook.nointerface) {
-            defaultMin = 0;
-        }
 
         var min = parseFloat(this.fluidbook.settings.splashMinimalTime);
         if (min < defaultMin || isNaN(min)) {
             min = defaultMin;
         }
 
+        if (this.fluidbook.nointerface) {
+            min = 0;
+            this.waitForTimer = false;
+            this.hideIfPossible();
+        }
+
         var $this = this;
         this.initTime = Date.now();
         setTimeout(function () {
             $this.waitForTimer = false;
             $this.hideIfPossible();
         }, min * 1000);
-
     },
 
     hide: function () {
@@ -39,7 +41,7 @@ FluidbookSplash.prototype = {
         }
         $(this.fluidbook).trigger('fluidbook.splash.beforehide');
         var $this = this;
-        if (this.fluidbook.support.transitions3dacc && this.fluidbook.settings.mobileTransitions === 'flip3d' && !this.fluidbook.mobilefirst.enabled) {
+        if (this.fluidbook.support.transitions3dacc && this.fluidbook.settings.mobileTransitions === 'flip3d' && !this.fluidbook.mobilefirst.enabled && !this.fluidbook.nointerface) {
             $("#main,#viewOverlay,#view").css('visibility', 'visible');
             resize();
             this.fluidbook.networkControl.pause(4000);
@@ -69,7 +71,7 @@ FluidbookSplash.prototype = {
 
     _hide: function () {
         var $this = this;
-        var timeout = 700;
+        var timeout = this.fluidbook.nointerface?0:700;
         this.fluidbook.resize.resize(false, true);
         setTimeout(function () {
             $this.__hide();
@@ -77,12 +79,13 @@ FluidbookSplash.prototype = {
     },
 
     __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) {
+        if (this.fluidbook.nointerface) {
+            $('#splash').remove();
+        } else if (this.fluidbook.support.transitions2d && !this.fluidbook.support.iOS) {
             $("#splash").css('opacity', 0).one('transitionend', function () {
                 $(this).remove();
             });
index 5ee07f53e77da60979fdf109eb78089e4a9c4c66..64193a20758a7603bc9d7d201fdf60203d7b7d08 100644 (file)
@@ -78,7 +78,7 @@ FluidbookStats.prototype = {
     },\r
 \r
     track: function (type, page, extra) {\r
-        if (!this.fluidbook.support.hasNetwork()) {\r
+        if (!this.fluidbook.support.hasNetwork() || this.fluidbook.nointerface) {\r
             return;\r
         }\r
 \r