]> _ Git - cubeextranet.git/commitdiff
wait #3612 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 23 Apr 2020 17:39:17 +0000 (17:39 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 23 Apr 2020 17:39:17 +0000 (17:39 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 0e1eb0a49b0d7a83f01fac91f3135e72112ac3aa..dddeca664d1db5d91726ae4556c756eb02c423d9 100644 (file)
@@ -453,7 +453,7 @@ class wsBookParametres extends wsParametres
 
         $this->fields['splashImage'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Image'), 'grade' => 3, 'fileFilter' => $imageFilter];
         $this->fields['splashURL'] = ['type' => 'text', 'default' => '', 'editable' => true, 'label' => __('URL'), 'grade' => 3];
-        $this->fields['splashMinimalTime'] = ['type' => 'float', 'default' => '5', 'editable' => true, 'label' => __('Temps minimal d\'affichage'), 'grade' => 3];
+        $this->fields['splashMinimalTime'] = ['type' => 'float', 'default' => '1', 'editable' => true, 'label' => __('Temps minimal d\'affichage'), 'grade' => 3];
 
         $this->forms['splash'] = ['label' => __('Ecran de chargement'), 'fieldsnames' => ['splashImage', 'splashURL', 'splashMinimalTime']];
 
index d1c581dd8a69ac0d9b1fec960553033def74cfc3..958a1e108f9c17d9038520472b914571e4ffd2ba 100644 (file)
@@ -53,6 +53,7 @@ class wsHTML5Compiler
         'fluidbook' =>
             ['js/libs/fluidbook/fluidbook.utils.js',
                 'js/libs/fluidbook/fluidbook.networkcontrol.js',
+                'js/libs/fluidbook/fluidbook.splash.js',
                 'js/libs/fluidbook/fluidbook.links.js',
                 'js/libs/fluidbook/fluidbook.support.js',
                 'js/libs/fluidbook/fluidbook.video.js',
@@ -934,7 +935,14 @@ class wsHTML5Compiler
             $message = sprintf($this->__('Your browser is not up to date and is not able to run this publication. %sLearn more%s'), '<br /><a href="http://www.whatbrowser.org/intl/' . $this->config->defaultLang . '/" target="_blank">', '</a>');
 
             $splash = '';
-            if ($this->theme->parametres->logoLoader && file_exists($this->themeRoot . $this->theme->parametres->logoLoader)) {
+            $splashstyles = '';
+            if ($this->book->parametres->splashImage) {
+                $this->vdir->copy($this->wdir . '/' . $this->book->parametres->splashImage, 'data/images/' . $this->book->parametres->splashImage);
+                $splashstyles = 'background-image:url(' . 'data/images/' . $this->book->parametres->splashImage . ');background-size:contain;background-position:50% 50%;';
+                if ($this->book->parametres->splashURL !== '') {
+                    $splash = '<a href="' . $this->book->parametres->splashURL . '" style="display:block;position:absolute;top:0;left;0;width:100%;height:100%"></a>';
+                }
+            } else if ($this->theme->parametres->logoLoader && file_exists($this->themeRoot . $this->theme->parametres->logoLoader)) {
                 $dim = CubeIT_Image::getimagesize($this->themeRoot . $this->theme->parametres->logoLoader);
                 if ($dim !== false) {
                     $this->vdir->copy($this->themeRoot . '/' . $this->theme->parametres->logoLoader, 'data/images/' . $this->theme->parametres->logoLoader);
@@ -955,7 +963,7 @@ class wsHTML5Compiler
             if ($this->phonegap) {
                 $csp = "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'self' data: gap: 'unsafe-inline' *; style-src 'self' 'unsafe-inline'; font-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' " . implode(' ', array_unique($this->securityPolicyWhitelist)) . "; img-src * data:\">";
             }
-            $vars = array('credits', 'style', 'script', 'pagesContents', 'print', 'hiddenContents', 'splash', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp', 'opengraph', 'twittercard');
+            $vars = array('credits', 'style', 'script', 'pagesContents', 'print', 'hiddenContents', 'splash', 'splashstyles', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp', 'opengraph', 'twittercard');
 
             $res = [];
             foreach ($vars as $v) {
@@ -1295,7 +1303,7 @@ class wsHTML5Compiler
         $linksCopy = $links;
 
         foreach ($linksCopy as $k => $linkData) {
-            if ($linkData['type'] == 35 || $linkData['type']==15) {
+            if ($linkData['type'] == 35 || $linkData['type'] == 15) {
                 $linkData = wsLinks::decryptLink($linkData);
                 $animation = contentLink::parseAnimation($linkData['image_rollover']);
                 if (isset($animation['backgroundColor']) && $animation['backgroundColor'] != 'transparent') {