}
if ($init['type'] == Link::CUSTOM) {
$init['image'] = '';
- $init['display_area'] = false;
+ $init['display_area'] = 'none';
$links[$k] = $init;
}
}
$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);
}
$c = parent::getHTMLContent();
$class = $this->getClasses();
- if ($this->display_area) {
+ if ($this->display_area!=="none") {
$class[] = 'displayArea';
}
$c = '';
$j++;
}
if ($link['display_area'] == '' || !$link['display_area']) {
- $link['display_area'] = '0';
+ $link['display_area'] = 'none';
}
if (isset($link['infobulle'])) {
$link['tooltip'] = $link['infobulle'];
'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);
$link['to'] = $webvideo['id'];
}
- $link['display_area'] = '1';
+ $link['display_area'] = 'fill';
$link['page'] = $page;
$link['uid'] = self::generateUID();
$links[] = $link;
}
$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']);
}
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')
}
$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();
}
}
"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",
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;
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");
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;