From: Vincent Vanwaelscappel Date: Fri, 12 Jan 2024 09:59:32 +0000 (+0100) Subject: wip #6625 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=de29004813bd0f5f293917a0995d55433458a198;p=fluidbook-toolbox.git wip #6625 @0.5 --- diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index 889e3655b..34909bc7f 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -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;