]> _ Git - fluidbook-html5.git/commitdiff
done #2513 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Jan 2019 15:52:15 +0000 (16:52 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Jan 2019 15:52:15 +0000 (16:52 +0100)
js/libs/fluidbook/fluidbook.3dflip.js
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.menu.js
js/libs/fluidbook/fluidbook.nav.js

index 7561413f1be0a48894d856ccb38d608e62738935..31b74822727d5f472906858ee20475eba2ffed61 100644 (file)
@@ -92,8 +92,15 @@ Fluidbook3DFlip.prototype = {
 
         this.container = $(this.jcontainer).get(0);
 
-        this.init3D('performancesTest');
+        var mode;
+        if ($_GET['performance'] == null) {
+            mode = 'performancesTest';
+        } else {
+            var map = {1: 'highPerf', 2: 'lowPerf', 3: 'veryLowPerf'};
+            mode = map[$_GET['performance']];
+        }
 
+        this.init3D(mode);
         this.animate(true);
 
         $(this.fluidbook).on('fluidbook.ready', function () {
@@ -112,6 +119,7 @@ Fluidbook3DFlip.prototype = {
         if (!this.webglEnabled()) {
             return 'veryLowPerf';
         }
+
         if (isNaN(this.benchmark) || this.benchmark === 0) {
             return 'lowPerf';
         }
@@ -226,11 +234,6 @@ Fluidbook3DFlip.prototype = {
         // #2399
         this.animationTime = Math.max(0.4, this.animationTime);
 
-        if (this.performancesMode === 'performancesTest') {
-            this.qualityRatio = Math.min(.75, this.qualityRatio);
-            this.triangles = Math.min(2, this.triangles);
-        }
-
         this.pixelRatio = window.devicePixelRatio * this.qualityRatio;
         this.frames = 0;
 
@@ -447,11 +450,22 @@ Fluidbook3DFlip.prototype = {
     },
 
     performancesTest: function (callback) {
+        var _cb;
         var $this = this;
-        this.prepareTurn({flip: [1, 2]}, function () {
-            $this.playTurn(1, function () {
+
+        if (this.performancesMode !== 'performancesTest') {
+            $("footer").append(' | 3D : forced ' + this.performancesMode);
+            _cb = callback;
+        } else {
+            _cb = function () {
                 $this.performancesEndTime = new Date();
                 $this.adjustPerformancesSettings(callback);
+            }
+        }
+
+        this.prepareTurn({flip: [1, 2]}, function () {
+            $this.playTurn(1, function () {
+                _cb();
             }, 1);
         });
     },
index 4a757fa1942b4e68cb9d4b0f64a35a7f0cb872c5..fa092b4edea2087308fdf61beaf46e6eba2c31d7 100644 (file)
@@ -26,7 +26,7 @@ Fluidbook.prototype = {
         this.networkPauseQueue = [];
         this.canNavigate = false;
 
-        this.datas = datas;
+        this.initSettings(datas);
         this.singleMode = (this.datas.mobileNavigationType === 'portrait');
 
         this.junk = datas.cacheDate;
@@ -110,6 +110,14 @@ Fluidbook.prototype = {
         this.initLoading();
     },
 
+    initSettings: function (datas) {
+        this.datas = datas;
+        if ($_GET['transition'] != null) {
+            var map = {1: 'none', 2: 'slide', 3: 'flip', 4: 'flip3d'};
+            this.datas.mobileTransitions = map[$_GET['transition']];
+        }
+    },
+
     setMaxPage: function (p, allowbackwards) {
         return this.contentlock.setMaxPage(p, allowbackwards);
     },
index 5a60fa7a738b1e2f165ff04ee17091a12f95f808..3ed8460fc10c81e88dfe09aceaaacd15c5b9f0a0 100644 (file)
@@ -297,7 +297,7 @@ FluidbookMenu.prototype = {
         } else if (service == 'vimeo') {
             view += '<iframe class="webvideo" type="text/html" src="https://player.vimeo.com/video/' + video + '?autoplay=1" width="100%" frameborder="0"></iframe>';
         } else if (service == 'brightcove') {
-            view += '<iframe class="webvideo" type="text/html" src="./video/brightcove.html?pid=' + DATAS.brightcovePlayerId + '&pk=' + encodeURIComponent(DATAS.brightcovePlayerSecret) + '&vid=' + video + '" width="100%" frameborder="0"></iframe>'
+            view += '<iframe class="webvideo" type="text/html" src="./video/brightcove.html?pid=' + this.fluidbook.datas.brightcovePlayerId + '&pk=' + encodeURIComponent(DATAS.brightcovePlayerSecret) + '&vid=' + video + '" width="100%" frameborder="0"></iframe>'
         }
         view += '</div>';
         $("#view").append('<div class="mview" data-menu="webvideo">' + view + '</div>');
index 2092bae6120f3494fe685ef787870593f1742f17..584c444992284605f51a355b0a173056630dbafb 100644 (file)
@@ -504,10 +504,10 @@ FluidbookNav.prototype = {
                 }
             } else if (icon.match(/extra\d/)) {
                 var n = icon.substr(5, 1);
-                var extraURL = DATAS['navExtraLink' + n];
-                var extraIcon = DATAS['navExtraIcon' + n];
-                var extraVisibility = DATAS['navExtraVisibility' + n];
-                var extraType = DATAS['navExtraType' + n];
+                var extraURL = this.fluidbook.datas['navExtraLink' + n];
+                var extraIcon = this.fluidbook.datas['navExtraIcon' + n];
+                var extraVisibility = this.fluidbook.datas['navExtraVisibility' + n];
+                var extraType = this.fluidbook.datas['navExtraType' + n];
                 if (extraURL == '' || extraIcon == '') {
                     continue;
                 }
@@ -559,7 +559,7 @@ FluidbookNav.prototype = {
                 if (extraURL.indexOf('link:') === 0) {
                     var linkId = extraURL.split(':', 2)[1];
                     var foundLink;
-                    $.each(DATAS.links, function (page, links) {
+                    $.each(this.fluidbook.datas.links, function (page, links) {
                         var l = $('<root>' + links + '</root>').find('[data-id="' + linkId + '"]');
                         if (l.length == 1) {
                             foundLink = l;