]> _ Git - cubeextranet.git/commitdiff
Improve tooltip links
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 17 Jul 2015 09:26:22 +0000 (09:26 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 17 Jul 2015 09:26:22 +0000 (09:26 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/class.ws.html5.links.php

index c9a9881a7b3a6859462f190b30e50aaa31a5ec0a..4799e22605d49855136893a53b1f46095134d0da 100644 (file)
@@ -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);
index cc1f9fbd4f623aa4127402125ebb2359545ef455..5abda243fa7947d121f23dda6d8153167d3c1887 100644 (file)
@@ -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 = '<iframe width="' . $iw . '" height="' . $ih . '" src="' . $this->_url . '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
                        }