]> _ Git - fluidbook_tools.git/commitdiff
wip #5908 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 May 2023 06:50:25 +0000 (08:50 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 5 May 2023 06:50:25 +0000 (08:50 +0200)
src/Links/ColorLink.php
src/Links/ContentLink.php
src/Links/Link.php

index 5f35e5f69f442579ab0809e55edce64000762053..0801bc781c023ab5dd424aad670ee34071acd130 100644 (file)
@@ -4,19 +4,16 @@ namespace Fluidbook\Tools\Links;
 
 use Cubist\Util\Graphics\Color;
 
-class ColorLink extends ContentLink
-{
+class ColorLink extends ContentLink {
     protected $role = '';
 
-    public function getCSS()
-    {
+    public function getCSS() {
         $res = parent::getCSS();
         $res .= 'background-color:' . Color::colorToCSS($this->to, 1) . ';';
         return $res;
     }
 
-    public function getAdditionnalContent()
-    {
+    public function getAdditionnalContent() {
         $res = parent::getAdditionnalContent();
         $res .= ' data-color="' . Color::colorToCSS($this->to, 1) . '"';
         return $res;
index 088f347ce1c3b99d4a128425e2a7c631f7911f87..91d535f981eb4726e4073fa48e6d83ceff45fcbb 100644 (file)
@@ -28,12 +28,14 @@ class ContentLink extends Link {
                     $this->addzindex = $animation['addzindex'];
                 }
             }
-            $res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" ';
-            if ($this->_isHiddenFirst($animations)) {
-                $res .= ' data-animation-hide ';
-            }
-            if ($this->_isFinallyHidden($animations)) {
-                $res .= ' data-animation-hide-on-leave ';
+            if($animations) {
+                $res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" ';
+                if ($this->_isHiddenFirst($animations)) {
+                    $res .= ' data-animation-hide ';
+                }
+                if ($this->_isFinallyHidden($animations)) {
+                    $res .= ' data-animation-hide-on-leave ';
+                }
             }
         }
         if ($this->forceTexture && $this->getDepth() >= 40) {
index 10bab6da3761becc30c059ee5802c4731cfe02c0..69f2f968302398dfef3854443e2c4f954e3a37c3 100644 (file)
@@ -18,6 +18,54 @@ use stdClass;
 
 class Link {
 
+    const WEB_INFOS = 1;
+    const PRODUCT = 1;
+    const WEB = 2;
+    const GENERAL = 2;
+    const EMAIL = 3;
+    const VIDEO = 4;
+    const INTERNAL = 5;
+    const MULTIMEDIA = 6;
+    const PERSO = 7;
+    const CUSTOM = 7;
+    const PAGE_CORNER = 8;
+    const OBJECT3D = 9;
+    const WEBVIDEO = 10;
+    const ACTION = 11;
+    const CART = 12;
+    const BASKET = 12;
+    const ZOOM = 13;
+    const COLOR = 14;
+    const IMAGE = 15;
+    const FILE = 16;
+    const AUDIO = 17;
+    const TOOLTIP = 18;
+    const CALL = 19;
+    const BOOKMARKGROUP = 20;
+    const HTML5MULTIMEDIA = 21;
+    const BOOKMARK_CORNER = 22;
+    const STATSTAG = 23;
+    const PHONE = 24;
+    const AUDIODESCRIPTION = 25;
+    const PAGE_LABEL = 26;
+    const EVENT_OVERLAY = 27;
+    const ARTICLE = 28;
+    const LIKE = 29;
+    const SLIDESHOW = 30;
+    const IFRAME = 31;
+    const SHOWLINK = 32;
+    const ZOOMHD = 33;
+    const LOCK_CONTENTS = 34;
+    const TEXT = 35;
+    const ARTICLE_OPEN = 36;
+    const DOWNLOAD_PORTION = 37;
+    const TRIGGERSLINK = 38;
+    const LAYER = 39;
+    const ANCHOR = 40;
+    const FLIPCARD = 41;
+    const PDF=42;
+
+
     protected static string|false|null $_linksKey = null;
     public $left;
     public $top;
@@ -291,7 +339,7 @@ class Link {
 
         foreach ($anims as $animation) {
             $animation = trim($animation);
-            if (!$animation) {
+            if (!$animation || $animation === 'none') {
                 continue;
             }
             $extras = self::parseExtras($animation, true);
@@ -363,6 +411,7 @@ class Link {
      */
     public function __construct($id, $init, &$compiler) {
         $this->_init = $init;
+
         foreach ($init as $k => $v) {
             if ($k == 'extra') {
                 if (Json::isJson($v)) {