]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6625 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 12 Jan 2024 09:59:32 +0000 (10:59 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 12 Jan 2024 09:59:32 +0000 (10:59 +0100)
app/Fluidbook/Compiler/Compiler.php

index 889e3655ba29accd6118a2266fd1f0109d74feae..34909bc7fdfa5d39cfd94d3ae1b4412f3a364ffe 100644 (file)
@@ -67,14 +67,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
             ['js/libs/modernizr/modernizr.min.js',
                 'js/libs/modernizr/tests.js',],
         'modifier' => ['js/libs/threejs/modifier.min.js'],
-        'threejs' =>
-            ['js/libs/threejs/legacy/three.min.js',
-                'js/libs/threejs/legacy/Projector.js',
-                'js/libs/threejs/legacy/CanvasRenderer.js',
-            ],
-//             'threejs-latest' =>
-//                     ['js/libs/threejs/latest/three.min.js',
-//                     ],
+
         'jquery' =>
             [
                 'js/libs/jquery/jquery.min.js',
@@ -151,7 +144,6 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
                 'js/libs/fluidbook/fluidbook.sound.js',
                 'js/libs/fluidbook/fluidbook.contentlock.js',
                 'js/libs/fluidbook/fluidbook.scorm.js',
-                'js/libs/fluidbook/fluidbook.3dflip.js',
                 'js/libs/fluidbook/menu/fluidbook.chapters.js',
                 'js/libs/fluidbook/menu/fluidbook.index.js',
                 'js/libs/fluidbook/fluidbook.landingpage.js',
@@ -567,6 +559,11 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
             $this->config->manifest = $this->writeManifest();
         }
 
+        if ($this->config->mobileTransitions === 'flip3d' && !$this->isMobileFirst()) {
+            $this->addThreeJs();
+            $this->addJsLib('transitions3', ['js/libs/fluidbook/fluidbook.3dflip.js',]);
+        }
+
         if ($this->config->form == 'bulle') {
             $this->addJsLib('bulle', 'js/libs/fluidbook/forms/fluidbook.form.bulle.js');
         } else if ($this->config->form == 'bourbon') {
@@ -1037,7 +1034,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
             }
 
             $print = $this->writePDF();
-            $message = '';
+            $message = 'An error occured when trying to show the publication. Please check if JavaScript is enabled or try to update your browser.';
 
             $this->log('Got index vars 4');
 
@@ -2162,6 +2159,18 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
         $this->vdir->copy($source, $dest);
     }
 
+    public function addThreeJs()
+    {
+        $this->addJsLib('threejs',
+            ['js/libs/threejs/legacy/three.min.js',
+                'js/libs/threejs/legacy/Projector.js',
+                'js/libs/threejs/legacy/CanvasRenderer.js',
+            ]);
+//             'threejs-latest' =>
+//                     ['js/libs/threejs/latest/three.min.js',
+//                     ],
+    }
+
     public function addVideoJs()
     {
         $locale = $this->getFluidbook()->lang;