From e044d99df2a9f3b14f48169e4216668be9fd30a6 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 17 Jul 2025 14:50:21 +0200 Subject: [PATCH] wip #7647 @0.25 --- app/Fluidbook/Link/LinksData.php | 2 +- app/Models/FluidbookTheme.php | 7 ++++++- app/SubForms/Link/Base.php | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Fluidbook/Link/LinksData.php b/app/Fluidbook/Link/LinksData.php index 9663ad33e..3efcabb9e 100644 --- a/app/Fluidbook/Link/LinksData.php +++ b/app/Fluidbook/Link/LinksData.php @@ -43,7 +43,7 @@ class LinksData 'left' => __('x'), 'top' => __('y'), 'width' => __('Largeur'), 'height' => __('Hauteur'), 'rot' => __('Rotation'), 'type' => __('Type'), 'to' => __('Destination'), 'target' => __('Cible'), 'tooltip' => __('Infobulle'), 'numerotation' => __('Numérotation'), - 'display_area' => __('Activer la surbrillance'), + 'display_area' => __('Activer la surbrillance'), 'animate_area' => __('Animer à l\'apparition de la page'), 'animation_type' => __('Type de l\'animation'), 'tracks' => __('Sous-titres'), 'video_loop' => __('Video : boucle'), 'video_auto_start' => __('Video : démarrage automatique'), 'video_controls' => __('Vidéo : afficher les contrôles'), 'video_sound_on' => __('Vidéo : activer le son'), 'video_cc' => __('Vidéo : afficher les sous-titres'), 'inline' => __('Vidéo : afficher dans la page'), 'video_width' => __('Vidéo : Largeur du popup'), 'video_height' => __('Vidéo : Hauteur du popup'), diff --git a/app/Models/FluidbookTheme.php b/app/Models/FluidbookTheme.php index ce9ef869a..b9b1f59ff 100644 --- a/app/Models/FluidbookTheme.php +++ b/app/Models/FluidbookTheme.php @@ -333,7 +333,7 @@ class FluidbookTheme extends ToolboxModel 'name' => 'linksAnimation', 'label' => __('Animation à l\'apparition'), 'type' => SelectFromArray::class, - 'options' => ['fade' => __('Opacité'), 'highlight' => __('Surligner')], + 'options' => self::getLinksAnimationTypes(), 'default' => 'fade', ]); $this->addField([ @@ -924,4 +924,9 @@ class FluidbookTheme extends ToolboxModel ksort($a); return substr(sha1(json_encode($a)), 0, 8); } + + public static function getLinksAnimationTypes() + { + return ['fade' => __('Opacité'), 'highlight' => __('Surligner')]; + } } diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index e44671f9f..1e6ed0f0b 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -10,6 +10,7 @@ use App\Fields\FluidbookLinkEditor\WebvideoIntegration; use App\Fluidbook\Compiler\Compiler; use App\Fluidbook\Link\Link; use App\Models\FluidbookPublication; +use App\Models\FluidbookTheme; use Cubist\Backpack\Magic\Fields\Checkbox; use Cubist\Backpack\Magic\Fields\CheckboxBasic; use Cubist\Backpack\Magic\Fields\FieldGroupEnd; @@ -189,6 +190,8 @@ class Base extends Form $this->addField('header_tooltip', FormSection::class, __('Infobulle')); $this->addField('tooltip', Text::class, __('Texte de l\'infobulle'), ['hint' => __('Laisser vide pour conserver le texte par défaut') . '.
' . __('Taper un tiret (-) pour ne pas afficher d\'infobulle')]); $this->addField('display_area', CheckboxBasic::class, __('Afficher la zone de couleur au survol'), ['default' => true]); + $this->addField('animate_area', CheckboxBasic::class, __('Animer la zone à l\'apparition de la page'), ['default' => true]); + $this->addField('animation_type', SelectFromArray::class, __('Type de l\'animation'), ['ajax'=>false,'options' => array_merge(['default' => __('Animation par défaut')], FluidbookTheme::getLinksAnimationTypes()), 'default' => 'default']); } public function addTypeField() -- 2.39.5