From def502e84b76f4fd850109ddc6ea4fdb34f4b9ad Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 17 Jul 2015 09:26:22 +0000 Subject: [PATCH] Improve tooltip links --- inc/ws/Metier/class.ws.book.parametres.php | 3 ++- inc/ws/Util/html5/class.ws.html5.links.php | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index c9a9881a7..4799e2260 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -245,12 +245,13 @@ class wsBookParametres extends wsParametres { $this->fields['linkMultimediaPerformanceMode'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Mode perfomance pour les liens multimédia'), 'grade' => 5); $this->fields['linkMultimediaQuality'] = array('type' => 'float', 'default' => 1.0, 'editable' => true, 'label' => __('Qualité de rendu des animations'), 'grade' => 5); $this->fields['linkCornerSize'] = array('type' => 'integer', 'default' => '10', 'editable' => true, 'label' => __('Taille des liens de coins de page'), 'hint' => __("Pourcentage de la largeur de la page")); + $this->fields['linkTooltipMaxWidth'] = array('type' => 'integer', 'default' => '140', 'editable' => true, 'label' => __('Largeur max des infobulles des liens de type "infobulle"')); $this->fields['videoReset'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Réinitialiser les vidéos après la lecture'), 'grade' => 3); $this->fields['videoBigPlay'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Afficher le gros bouton Play'), 'grade' => 3); $this->fields['brightcovePlayerId'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Id'), 'grade' => 3); $this->fields['brightcovePlayerSecret'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Secret'), 'grade' => 3); $this->forms['multimedia'] = array('label' => __('Liens et multimédia'), - 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret')); + 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret')); //. $this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $imageFilter); diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index cc1f9fbd4..5abda243f 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -97,6 +97,7 @@ class wsHTML5Link { return new audioPopupLink($id, $init, $compiler); } case 18: + return new tooltipLink($id, $init, $compiler); case 19: break; case 20: @@ -302,6 +303,22 @@ class normalLink extends wsHTML5Link { } +class tooltipLink extends normalLink { + public function getClasses() { + return array_merge(array('lazy'), parent::getClasses()); + } + + public function getAdditionnalContent() { + $res = parent::getAdditionnalContent(); + $res .= ' data-tooltip-maxwidth="' . $this->compiler->book->parametres->linkTooltipMaxWidth . '" '; + return $res; + } + + public function getURL() { + return '#'; + } +} + class htmlMultimediaImage extends wsHTML5Link { public function getHTMLContainerClass() { @@ -664,8 +681,8 @@ class htmlMultimediaLink extends wsHTML5Link { $this->_url .= '?' . $this->extra; } - $iw = $this->_config['width']; - $ih = $this->_config['height']; + $iw = $this->_config['width'] * 3; + $ih = $this->_config['height'] * 3; $res = ''; } -- 2.39.5