]> _ Git - fluidbook_tools.git/commitdiff
wait #5420 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 29 Aug 2022 13:17:31 +0000 (15:17 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 29 Aug 2022 13:17:31 +0000 (15:17 +0200)
src/Links/ImageLink.php

index 37378fc854a8e9e6b2ec06e7bf6518678f225db6..d50c0b7f92cbd7fd84722ded98d1f0e621f95a9e 100644 (file)
@@ -14,34 +14,9 @@ class ImageLink extends ContentLink
     {
         $res = parent::getCSS();
         $this->copyExternalFile($this->to);
-        $res .= 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;';
         return $res;
     }
 
-    public function getBackgroundPosition()
-    {
-        $animations = self::parseAnimations($this->image_rollover);
-        foreach ($animations as $animation) {
-            if (($animation['type'] === 'zoomout' || $animation['type'] === 'zoomin') && isset($animation['transformorigin'])) {
-                return $animation['transformorigin'];
-            }
-        }
-        return '50% 50%';
-    }
-
-    public function getBackgroundSize()
-    {
-
-        $size = '100%';
-        $animations = self::parseAnimations($this->image_rollover);
-        foreach ($animations as $animation) {
-            if ($animation['type'] === 'zoomout') {
-                $size = round($animation['scale'] * 100) . '%';
-            }
-        }
-        return $size . ' ' . $size;
-    }
-
     public function getAdditionnalContent()
     {
         $res = parent::getAdditionnalContent();
@@ -50,4 +25,13 @@ class ImageLink extends ContentLink
         return $res;
     }
 
+    public function getHTMLContent()
+    {
+        if (stristr($this->rollover, 'type=zoom')) {
+            return '<div class="img" style="background-image:url(' . $this->getImageUrl() . ');"></div>';
+        } else {
+            return '<img src="' . $this->getImageUrl() . '" />';
+        }
+    }
+
 }