From bd637308db60f8608925a4d63913ff6849b703b5 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 21 Jul 2025 13:53:47 +0200 Subject: [PATCH] wip #7650 @4 --- app/Models/FluidbookTheme.php | 12 ++++++++++++ app/SubForms/Link/Base.php | 2 +- resources/linkeditor-stable/js/linkeditor.form.js | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/Models/FluidbookTheme.php b/app/Models/FluidbookTheme.php index b9b1f59ff..2c56dd7d4 100644 --- a/app/Models/FluidbookTheme.php +++ b/app/Models/FluidbookTheme.php @@ -343,6 +343,13 @@ class FluidbookTheme extends ToolboxModel 'options' => ['top' => __('Par dessus les contenus'), 'under' => __('Sous la couche de texte')], 'default' => 'top', ]); + $this->addField([ + 'name' => 'linksDisplayArea', + 'label' => __('Afficher la zone du lien au survol'), + 'type' => SelectFromArray::class, + 'options' => self::getLinksRolloverEffects(), + 'default' => 'fill', + ]); $this->addField([ 'type' => 'FormSeparator', ]); @@ -929,4 +936,9 @@ class FluidbookTheme extends ToolboxModel { return ['fade' => __('Opacité'), 'highlight' => __('Surligner')]; } + + public static function getLinksRolloverEffects() + { + return ['fill' => __('Oui'), 'stroke' => __('Uniquement le contour'), 'none' => __('Non')]; + } } diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index 0c759fd25..bc2b090a4 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -195,7 +195,7 @@ class Base extends Form public function addAreaFields() { $this->addField('header_zone', FormSection::class, __('Zone')); - $this->addField('display_area', SelectFromArray::class, __('Afficher la zone de couleur au survol'), ['ajax' => false, 'options' => ['fill' => __('Oui'), 'stroke' => __('Uniquement le contour'), 'none' => __('Non')], 'default' => '1']); + $this->addField('display_area', SelectFromArray::class, __('Afficher la zone de couleur au survol'), ['ajax' => false, 'options' =>array_merge(['default'=>__('Par défaut')],FluidbookTheme::getLinksRolloverEffects()), 'default' => 'default']); $this->addField('animation_type', SelectFromArray::class, __('Animation à l\'affichage de la page'), ['ajax' => false, 'options' => array_merge(['default' => __('Animation par défaut'), 'none' => __('Pas d\'animation')], FluidbookTheme::getLinksAnimationTypes()), 'default' => 'default']); } diff --git a/resources/linkeditor-stable/js/linkeditor.form.js b/resources/linkeditor-stable/js/linkeditor.form.js index 9cd5d10a7..8a6bdeb9e 100644 --- a/resources/linkeditor-stable/js/linkeditor.form.js +++ b/resources/linkeditor-stable/js/linkeditor.form.js @@ -218,7 +218,7 @@ LinkeditorForm.prototype = { if (k === 'display_area') { if (value === undefined || value === null || value == "1" || value == 'true') { - value = 'fill'; + value = 'default'; } else if (value == 'false' || value == '0') { value = 'none'; } -- 2.39.5