From: Vincent Vanwaelscappel Date: Thu, 27 Oct 2022 09:34:09 +0000 (+0200) Subject: wait #5468 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ac48411ad80fdf6f0b40e2f00e5f279f678b92f4;p=fluidbook-toolbox.git wait #5468 @3 --- diff --git a/app/Models/ToolSVGSprite.php b/app/Models/ToolSVGSprite.php index 83b544a37..abe80aa68 100644 --- a/app/Models/ToolSVGSprite.php +++ b/app/Models/ToolSVGSprite.php @@ -43,7 +43,6 @@ class ToolSVGSprite extends ToolboxModel $icons[$k] = $icon; } $this->icons = $icons; - } public function generate() @@ -54,6 +53,7 @@ class ToolSVGSprite extends ToolboxModel $svg = $matches[4]; if ($this->convertColorsToCurrentColor) { $svg = preg_replace('/#[0-9a-fA-F]{6}/', 'currentColor', $svg); + $svg = preg_replace('/rgba?\([^)]+\)/', 'currentColor', $svg); } $res .= '' . $svg . ''; } else { @@ -65,8 +65,6 @@ class ToolSVGSprite extends ToolboxModel $res .= ''; - return $res; } - } diff --git a/resources/linkeditor/js/linkeditor.js b/resources/linkeditor/js/linkeditor.js index cdab03804..a35d050fa 100644 --- a/resources/linkeditor/js/linkeditor.js +++ b/resources/linkeditor/js/linkeditor.js @@ -126,10 +126,10 @@ LinkEditor.prototype = { $(window).on('mouseup', function (e) { $this.setMouseCoordinates(e); + $this.panels.mouseup(); $this.zoom.mouseUp(); $this.rulers.mouseUp(); $this.links.mouseUp(); - $this.panels.mouseup(); }); if (this.single) { diff --git a/resources/linkeditor/js/linkeditor.links.js b/resources/linkeditor/js/linkeditor.links.js index 42e429af1..282a840ad 100644 --- a/resources/linkeditor/js/linkeditor.links.js +++ b/resources/linkeditor/js/linkeditor.links.js @@ -84,6 +84,7 @@ LinkeditorLinks.prototype = { var link = this.duplicateLinkClick({width: 0, height: 0}); $(link).addClass('pendingCreate'); this.startResizeLink('se'); + this.updateLinkForm(); }, startResizeLink: function (corner) { @@ -92,11 +93,15 @@ LinkeditorLinks.prototype = { }, stopResizeLink: function () { + if (this.resizeLinkPos === null) { + return; + } var $this = this; this.moveResizeLink(); $('.pendingCreate').each(function () { $this.deleteLink($(this), true); }); + this.updateLinkForm(); this.resizeLinkPos = null; }, @@ -240,6 +245,9 @@ LinkeditorLinks.prototype = { }, stopDragLink: function () { + if (this.dragLinkPos === null) { + return; + } this.moveDragLink(); this.dragLinkPos = null; }, @@ -283,9 +291,26 @@ LinkeditorLinks.prototype = { } $(l).addClass('selected'); this.currentSelection.push(l); + this.updateLinkForm(); this.lastSelectedLink = l; }, + updateLinkForm: function () { + var container = $('#linkeditor-panel-form'); + container.html(''); + var links = $('.link.selected:not(.pendingCreate)'); + if (links.length != 1) { + return; + } + console.log(links); + var link = $(links).eq(0); + var type = $(link).attr('fb-type'); + var form = $("#linkeditor-form-template-" + type).clone(); + $(form).attr('id', null); + container.append(form); + console.log(form); + }, + checkLastSelectedLink: function () { if (this.lastSelectedLink === null || $(this.lastSelectedLink).length === 0) { return; @@ -309,6 +334,7 @@ LinkeditorLinks.prototype = { deselectAllLinks: function () { this.currentSelection = []; $(".link.selected").removeClass('selected'); + this.updateLinkForm(); }, offsetSelectedLinks: function (dim, value) { diff --git a/resources/linkeditor/js/linkeditor.rulers.js b/resources/linkeditor/js/linkeditor.rulers.js index e51881da7..8d17ba305 100644 --- a/resources/linkeditor/js/linkeditor.rulers.js +++ b/resources/linkeditor/js/linkeditor.rulers.js @@ -176,6 +176,9 @@ LinkeditorRulers.prototype = { }, stopMoveRuler: function () { + if (this.movingRuler === null || this.movingRuler === undefined) { + return; + } this.moveRuler(); if ($(this.movingRuler).hasClass('pending-delete')) { this.deleteRuler($(this.movingRuler)); diff --git a/resources/linkeditor/js/linkeditor.zoom.js b/resources/linkeditor/js/linkeditor.zoom.js index 9deb85d33..6fd7f7965 100644 --- a/resources/linkeditor/js/linkeditor.zoom.js +++ b/resources/linkeditor/js/linkeditor.zoom.js @@ -31,9 +31,10 @@ LinkeditorZoom.prototype = { }, mouseUp: function () { - if (this.zoomdragging !== false) { - this.moveZoomDrag(); + if (!this.zoomdragging) { + return; } + this.moveZoomDrag(); this.resetZoomDrag(); }, diff --git a/resources/linkeditor/style/form.sass b/resources/linkeditor/style/form.sass index 00af59c33..4cd6926e2 100644 --- a/resources/linkeditor/style/form.sass +++ b/resources/linkeditor/style/form.sass @@ -1,5 +1,5 @@ #linkeditor-form-templates - display: block + display: none .linkeditor-linktype diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index a3d47ed0c..3495b341b 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -66,6 +66,8 @@ data-tooltip="{{__('Importer les liens (Ajouter)')}}"> +