break;
case 39:
return new layerLink($id, $init, $compiler);
+ case 41:
+ return new flipcardLink($id, $init, $compiler);
default:
return null;
}
{
return true;
}
-
}
class contentLink extends wsHTML5Link
}
+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)