]> _ Git - cubeextranet.git/commitdiff
wip #5087 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 21 Feb 2022 16:53:21 +0000 (16:53 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 21 Feb 2022 16:53:21 +0000 (16:53 +0000)
inc/ws/Util/html5/master/class.ws.html5.links.php

index f662f9a1e87412f544a970da97f8969b692a58a8..dcd06052ff2060241942c916ebfb1baf12d3b8a6 100644 (file)
@@ -275,6 +275,8 @@ class wsHTML5Link
                 break;
             case 39:
                 return new layerLink($id, $init, $compiler);
+            case 41:
+                return new flipcardLink($id, $init, $compiler);
             default:
                 return null;
         }
@@ -1037,7 +1039,6 @@ class htmlMultimediaPopupImage extends normalLink
     {
         return true;
     }
-
 }
 
 class contentLink extends wsHTML5Link
@@ -2186,6 +2187,36 @@ class webVideoPopupLink extends videoPopupLink
 
 }
 
+class flipcardLink extends imageLink
+{
+    public $interactive = true;
+    public $defaultZIndex = 70;
+
+    public function getHTMLContent()
+    {
+        $this->copyExternalFile($this->to);
+        $this->copyExternalFile($this->alternative);
+        $res='<a href="#" '.$this->getTooltipAttribute().'></a>';
+        $res .= '<div class="flipcard">';
+        $res .= '<div class="front"><img src="' . wsHTML5Link::getUniversalLocation($this->to) . '"></div>';
+        $res .= '<div class="back"><img src="' . wsHTML5Link::getUniversalLocation($this->alternative) . '"></div>';
+        $res .= '</div>';
+        return $res;
+    }
+
+    public function getDefaultTooltip()
+    {
+        return 'click to flip';
+    }
+
+    public function getAdditionnalContent()
+    {
+        $res = parent::getAdditionnalContent();
+        $res .= ' data-flipcard="1" ';
+        return $res;
+    }
+}
+
 class audioLink extends wsHTML5Link
 {
     public function __construct($id, $init, &$compiler)