From: Vincent Vanwaelscappel Date: Fri, 7 Jul 2023 09:38:08 +0000 (+0200) Subject: wip #6117 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6dee49f864345c9985b83db8bffe1f6ff3be2109;p=fluidbook-toolbox.git wip #6117 @0.25 --- diff --git a/app/Fluidbook/Link/LinksData.php b/app/Fluidbook/Link/LinksData.php index c190989b5..c8bd8ac18 100644 --- a/app/Fluidbook/Link/LinksData.php +++ b/app/Fluidbook/Link/LinksData.php @@ -6,6 +6,7 @@ use App\Models\FluidbookPublication; use App\Models\User; use App\SubForms\Link\Base; use Cubist\Util\Files\Files; +use Cubist\Util\Graphics\Color; use Cubist\Util\Gzip; use Cubist\Util\Str; use Cubist\Util\WebVideo; @@ -261,6 +262,16 @@ class LinksData self::_fixWebVideoServices($links); self::_fixMultimedia($links); self::_fixCloseButton($links); + self::_fixColors($links); + } + + protected static function _fixColors(&$links) + { + foreach ($links as $k => $link) { + if ($link['type'] == Link::COLOR) { + $links[$k]['to'] = Color::colorToCSS($link['to']); + } + } } protected static function _fixTypes(&$links) diff --git a/resources/linkeditor/js/linkeditor.form.js b/resources/linkeditor/js/linkeditor.form.js index 6392151e9..cec7d1aa2 100644 --- a/resources/linkeditor/js/linkeditor.form.js +++ b/resources/linkeditor/js/linkeditor.form.js @@ -36,6 +36,7 @@ LinkeditorForm.prototype = { }); + $(document).on('change', "#linkeditor-panel-form input,#linkeditor-panel-form select,#linkeditor-panel-form textarea", function () { if ($this._maskChangeEvent) { return; @@ -277,7 +278,7 @@ LinkeditorForm.prototype = { }, initSpectrum: function () { - $("#linkeditor-panel-form .spectrum:not(.init)").each(function () { + $("#linkeditor-panel-form .colorpicker:not(.init)").each(function () { var t = $(this); $(this).spectrum({ preferredFormat: 'hex3',