]> _ Git - odl.git/commitdiff
wip #5084 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 17 Feb 2022 09:43:41 +0000 (10:43 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 17 Feb 2022 09:43:41 +0000 (10:43 +0100)
app/Jobs/ProcessFluidbook.php

index 37e353a4c40417de8a40d65cc21c09727d0e5f03..cd7b87adb05a46baac6f40f9e48b3ad4c273f5cc 100644 (file)
@@ -140,12 +140,13 @@ class ProcessFluidbook extends Compiler
         $links = $this->getLinksFromPDF();
         $this->config->mediaIDToFile = [];
         $res = [];
+
         foreach ($links as $k => $link) {
             $e = explode(':', $link['to']);
             $ee = explode('/', $e[0]);
 
             if ($ee[0] == 'anim') {
-                $base = [['ease' => 'Power2.easeOut', 'duration' => 1.5, 'backgroundColor' => '#ffffff', 'transformOrigin' => 'center', 'delay' => 1], []];
+                $base = [['type'=>'','ease' => 'Power2.easeOut', 'duration' => 1.5, 'transformOrigin' => 'center', 'delay' => 1], []];
                 switch ($ee[1]) {
                     case 'fadein':
                         $link['type'] = 14;
@@ -188,14 +189,13 @@ class ProcessFluidbook extends Compiler
                 $anim = '';
 
                 foreach ($base as $item) {
-                    if (!count($item)) {
-                        continue;
-                    }
-                    foreach ($item as $k => $v) {
-                        $anim .= $k . '=' . $v . "\n";
+                    foreach ($item as $param => $value) {
+                        $anim .= $param . '=' . $value . "\n";
                     }
                     $anim .= '---' . "\n";
                 }
+                $anim = trim($anim, " \t\n\r\0\x0B-");
+
                 $link['image_rollover'] = $anim;
             } else if ($e[0] === 'pdf') {
                 $cc = explode('#', $e[1]);
@@ -231,7 +231,6 @@ class ProcessFluidbook extends Compiler
             }
             $res[$k] = $link;
         }
-
         return $res;
     }