]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7650
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Jul 2025 14:56:40 +0000 (16:56 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Jul 2025 14:56:40 +0000 (16:56 +0200)
app/Fluidbook/Compiler/Links.php
app/Fluidbook/Link/Custom/InpesPopinLink.php
app/Fluidbook/Link/LinksData.php
app/SubForms/Link/Base.php
app/SubForms/Link/Tooltip.php
package.json
resources/linkeditor-stable/js/linkeditor.form.js
resources/linkeditor/js/linkeditor.form.js

index 7c4b6b045e07d192e4cb964c2ab23b8012b89a7c..b3cf91c020f33c35b34fb430b0987f4679627c7e 100644 (file)
@@ -80,7 +80,7 @@ trait Links
                 }
                 if ($init['type'] == Link::CUSTOM) {
                     $init['image'] = '';
-                    $init['display_area'] = false;
+                    $init['display_area'] = 'none';
                     $links[$k] = $init;
                 }
             }
@@ -336,7 +336,7 @@ trait Links
                 $linksToAdd[] = $link->getRightClone();
             }
 
-            if ($dupLinkAreaColor !== false && $link instanceof NormalLink && $link->display_area && !$link->isOutsidePage()) {
+            if ($dupLinkAreaColor !== false && $link instanceof NormalLink && $link->display_area!=='none' && !$link->isOutsidePage()) {
                 $linksToAdd[] = $link->getDisplayAreaLink($dupLinkAreaColor, $dupLinkAreaOpacity, $dupLinkAreaDuration, $link->blinkdelay ? $link->blinkdelay / 1000 : 0.5);
             }
 
index b7077f70ac627285a8dfea522f2c98e98e591188..dfddaaba0cd21f0504f151bc1a7fcbf38df390d3 100644 (file)
@@ -12,7 +12,7 @@ class InpesPopinLink extends HTMLMultimediaLink
         $c = parent::getHTMLContent();
 
         $class = $this->getClasses();
-        if ($this->display_area) {
+        if ($this->display_area!=="none") {
             $class[] = 'displayArea';
         }
         $c = '';
index 6a91c62a7878aaa7bd69f20819a0d42a4bc76339..95ca34a37f773d7d5d2dfb4988b2e5e8adda5b6a 100644 (file)
@@ -458,7 +458,7 @@ class LinksData
                     $j++;
                 }
                 if ($link['display_area'] == '' || !$link['display_area']) {
-                    $link['display_area'] = '0';
+                    $link['display_area'] = 'none';
                 }
                 if (isset($link['infobulle'])) {
                     $link['tooltip'] = $link['infobulle'];
@@ -533,7 +533,7 @@ class LinksData
                 'page' => $page,
                 'left' => $left, 'top' => $top, 'width' => $width, 'height' => $height, 'rot' => '',
                 'type' => $type, 'to' => $to, 'target' => $target,
-                'tooltip' => '', 'numerotation' => $numerotation, 'display_area' => '1');
+                'tooltip' => '', 'numerotation' => $numerotation, 'display_area' => 'fill');
         }
 
         self::_fixLinks($links);
@@ -745,7 +745,7 @@ class LinksData
                     $link['to'] = $webvideo['id'];
                 }
 
-                $link['display_area'] = '1';
+                $link['display_area'] = 'fill';
                 $link['page'] = $page;
                 $link['uid'] = self::generateUID();
                 $links[] = $link;
index e695e5d30c9352ad51208af6407327f6c6575aad..0c759fd251c44862ce766a3a7bc3efcee1eb3606 100644 (file)
@@ -189,7 +189,13 @@ 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') . '.<br>' . __('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->addAreaFields();
+    }
+
+    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('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']);
     }
 
index dbd7e3872be79fca26ab28d6b2a83ae9f64bcbac..d3808231dd985a0bdf2f2fa44909a70cdd7d287d 100644 (file)
@@ -5,6 +5,7 @@ namespace App\SubForms\Link;
 use App\Fluidbook\Link\Link;
 use Cubist\Backpack\Magic\Fields\CheckboxBasic;
 use Cubist\Backpack\Magic\Fields\FormSection;
+use Cubist\Backpack\Magic\Fields\SelectFromArray;
 use Cubist\Backpack\Magic\Fields\Textarea;
 
 // __('!! Editeur de liens')
@@ -27,6 +28,6 @@ class Tooltip extends Base
         }
         $this->addField('header_tooltip', FormSection::class, __('Paramètres'));
         $this->addField('tooltip', Textarea::class, __('Texte de l\'infobulle'));
-        $this->addField('display_area', CheckboxBasic::class, __('Afficher la zone de couleur au survol'), ['default' => true]);
+        $this->addAreaFields();
     }
 }
index 3ac00ed3fc15bc1cb280a1ab3c1241bfd70c7985..c2e7f2153ede79d6e7b4ddb2ea98bf569dd616d5 100644 (file)
@@ -16,7 +16,7 @@
         "linkeditor-beta": "cross-env process.env.section=linkeditor mix --production"
     },
     "devDependencies": {
-        "axios": "^1.3.5",
+        "axios": "^1.8.4",
         "cross-env": "^7.0.3",
         "gsap": "npm:@gsap/business@^3.12.3",
         "jquery": "^3.6.4",
index 71de8a470a9cfd79bd03f2a72473648da5c5a349..9cd5d10a7c774356539e575b3c0f851089f39f03 100644 (file)
@@ -194,7 +194,7 @@ LinkeditorForm.prototype = {
             value = '';
         }
         var number = ['top', 'left', 'width', 'height', 'rot', 'x', 'y', 'h', 'w'];
-        var bool = ['display_area'];
+        var bool = [];
         var integers = ['zindex'];
         if (k === 'zindex' && (value === undefined || value === null || value === '')) {
             value = -1;
@@ -216,6 +216,14 @@ LinkeditorForm.prototype = {
             value = (value === true || value === 'true' || value === "1" || value === 1) ? '1' : '0';
         }
 
+        if (k === 'display_area') {
+            if (value === undefined || value === null || value == "1" || value == 'true') {
+                value = 'fill';
+            } else if (value == 'false' || value == '0') {
+                value = 'none';
+            }
+        }
+
         value = value.toString()
         value = value.replace(new RegExp("\r\n", 'g'), "\n");
         value = value.replace(new RegExp("\r", 'g'), "\n");
index 88782a3800d618cb0fcfe25135b3536af4f86e9f..d06d3dc87a30abd0b26aaa91defcd1969475049c 100644 (file)
@@ -189,7 +189,7 @@ LinkeditorForm.prototype = {
             value = '';
         }
         var number = ['top', 'left', 'width', 'height', 'rot', 'x', 'y', 'h', 'w'];
-        var bool = ['display_area'];
+        var bool = [];
         var integers = ['zindex'];
         if (k === 'zindex' && (value === undefined || value === null || value === '')) {
             value = -1;