From ef12852d302e38ea55ca2da343b680c6f6580e83 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 17 Nov 2021 15:59:20 +0000 Subject: [PATCH] wait #4888 @0.5 --- .../html5/master/class.ws.html5.compiler.php | 2 +- .../html5/master/class.ws.html5.links.php | 45 ++++++++++--------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 851d51e0e..62fcfb0ec 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1872,7 +1872,7 @@ height="0" width="0" style="display:none;visibility:hidden"> $dupData['image'] = ''; $dupData['animation'] = ''; $dupData['to'] = $linkData['image']; - $dupData['rollover'] = $linkData['image_rollover']; + $dupData['image_rollover'] =''; $dupData['type'] = 15; $dupData['uid'] = 'i_' . $linkData['uid']; if (wsHTML5Link::isScorm($linkData)) { diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 25fcc75a4..35ad72fb5 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -52,6 +52,8 @@ class wsHTML5Link public $tooltipBackgroundColor = null; public $parallax = 0; public $attachLeft = false; + public $allowsAnimation = false; + protected $role = 'button'; protected $_init; @@ -1024,6 +1026,7 @@ class htmlMultimediaPopupImage extends normalLink class contentLink extends wsHTML5Link { public $defaultZIndex = 30; + public $allowsAnimation = true; public function getHTMLContainerClass() { @@ -1033,30 +1036,32 @@ class contentLink extends wsHTML5Link public function getAdditionnalContent() { $res = parent::getAdditionnalContent(); - $animations = self::parseAnimations($this->image_rollover); - foreach ($animations as $animation) { - if (isset($animation['blendmode'])) { - $this->blendmode = $animation['blendmode']; - unset($animation['blendmode']); - } - if (isset($animation['zindex'])) { - $this->zindex = $animation['zindex']; + if ($this->allowsAnimation) { + $animations = self::parseAnimations($this->image_rollover); + foreach ($animations as $animation) { + if (isset($animation['blendmode'])) { + $this->blendmode = $animation['blendmode']; + unset($animation['blendmode']); + } + if (isset($animation['zindex'])) { + $this->zindex = $animation['zindex']; + } + if (isset($animation['addzindex'])) { + $this->addzindex = $animation['addzindex']; + } + if (isset($animation['parallax'])) { + $this->parallax = $animation['parallax']; + unlink($animation['parallax']); + } } - if (isset($animation['addzindex'])) { - $this->addzindex = $animation['addzindex']; + $res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" '; + if ($this->_isHiddenFirst($animations)) { + $res .= ' data-animation-hide '; } - if (isset($animation['parallax'])) { - $this->parallax = $animation['parallax']; - unlink($animation['parallax']); + if ($this->_isFinallyHidden($animations)) { + $res .= ' data-animation-hide-on-leave '; } } - $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 '; - } return $res; } -- 2.39.5