]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6117 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 7 Jul 2023 09:38:08 +0000 (11:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 7 Jul 2023 09:38:08 +0000 (11:38 +0200)
app/Fluidbook/Link/LinksData.php
resources/linkeditor/js/linkeditor.form.js

index c190989b5a6272bdad33927efc46f02a4877f555..c8bd8ac187359d365d2ec1d0b594aa3e8dc4602d 100644 (file)
@@ -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)
index 6392151e9b0e75b0cc97d32a5a363d9ba7268299..cec7d1aa297aab30fe676f61b0bd6101071b4e3d 100644 (file)
@@ -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',