]> _ Git - fluidbook_tools.git/commitdiff
wait #6611 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Jan 2024 16:44:28 +0000 (17:44 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 Jan 2024 16:44:28 +0000 (17:44 +0100)
.idea/deployment.xml
src/Links/Link.php
src/Links/LottieLink.php

index 8993858864669b1d1309e1ebf412865f903e130d..1fdb47f1959ebfcbcced6104fe10d489feafe1f6 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="PublishConfigData" autoUpload="Always" serverName="alphaville.cubedesigners.com" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false" autoUploadExternalChanges="true" showAutoUploadSettingsWarning="false">
+  <component name="PublishConfigData" autoUpload="Always" serverName="toolbox.fluidbook.com" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false" autoUploadExternalChanges="true" showAutoUploadSettingsWarning="false">
     <option name="confirmBeforeUploading" value="false" />
     <serverData>
       <paths name="alpha.toolbox.fluidbook.com">
           </mappings>
         </serverdata>
       </paths>
+      <paths name="extranet.cubedesigners.com (Host)">
+        <serverdata>
+          <mappings>
+            <mapping local="$PROJECT_DIR$" web="/" />
+          </mappings>
+        </serverdata>
+      </paths>
       <paths name="extranet.preventicom.com">
         <serverdata>
           <mappings>
index 089eb3f724d6c7d9c7ed830591d53e0144d0df50..dda4ad7aecfa4992ffd3c3337b17545393232c62 100644 (file)
@@ -8,6 +8,7 @@ use Cubist\Util\Crypt;
 use Cubist\Util\CSS;
 use Cubist\Util\Files\Files;
 use Cubist\Util\Files\RecursiveDirectoryIterator;
+use Cubist\Util\Graphics\Lottie;
 use Cubist\Util\Json;
 use Cubist\Util\ObjectUtil;
 use Cubist\Util\Text;
@@ -848,14 +849,12 @@ class Link
     {
         $f = $this->compiler->working_path($html);
         if (Files::isNotEmpty($f)) {
-            $c = file_get_contents($f);
             $res = array('width' => $this->video_width, 'height' => $this->video_height);
-            if (stristr($c, '<div id="lottie"></div>')) {
-                if (preg_match('/var animationData = (\{.*\})/', $c, $m)) {
-                    $ad = json_decode(trim($m[1]), true);
-                    $res['width'] = $ad['w'];
-                    $res['height'] = $ad['h'];
-                }
+
+            $lottie = Lottie::getAnimationDataFromHTMLFile($f);
+            if ($lottie) {
+                $res['width'] = $lottie['w'];
+                $res['height'] = $lottie['h'];
             }
             $r = ['type' => 'html', 'html' => $html, 'inject' => array(), 'injectcss' => array(), 'injectjs' => array()];
 
index 64a8789b99845f1dced91b8bf3e6cf8cf1d8553b..f303819476052d90c070ea93c3c06524a3f70605 100644 (file)
@@ -6,6 +6,7 @@ use Cubist\Util\CSS;
 use Cubist\Util\Files\Files;
 use Cubist\Util\Graphics\Color;
 use Cubist\Util\Json;
+use Cubist\Util\Text;
 use Illuminate\Support\Facades\Cache;
 use SplFileInfo;
 
@@ -49,7 +50,7 @@ class LottieLink extends HTMLMultimediaLink
             } else if ($ext === 'json') {
 
                 $jsonFile = $this->compiler->working_path($this->to);
-                $jsonContent = file_get_contents($jsonFile);
+                $jsonContent = Text::fileGetContentsNormalizedLines($jsonFile);
                 $o = json_decode($jsonContent, true);
                 $fdir = 'data/links';
                 $d = array('fdir' => $fdir, 'dir' => $this->compiler->working_path());
@@ -63,7 +64,7 @@ class LottieLink extends HTMLMultimediaLink
             }
 
             if ($replaceHTML) {
-                $html = file_get_contents($htmlfile);
+                $html = Text::fileGetContentsNormalizedLines($htmlfile);
 
                 $html = preg_replace('/background-color:.*$/m', 'background-color:' . $data['background'] . ';', $html);
                 $html = preg_replace('/loop:\s*(true|false),\s*$/m', 'loop: ' . $data['loop'] . ',', $html);