From: Vincent Vanwaelscappel Date: Tue, 30 May 2023 15:39:38 +0000 (+0200) Subject: wait #5964 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ba1572d0cdd5c5c394f031081dd9c22304fe5f5f;p=fluidbook-toolbox.git wait #5964 @0.75 --- diff --git a/app/Fluidbook/Link/LinksData.php b/app/Fluidbook/Link/LinksData.php index 92f2d1927..42f2e0f4b 100644 --- a/app/Fluidbook/Link/LinksData.php +++ b/app/Fluidbook/Link/LinksData.php @@ -270,6 +270,9 @@ class LinksData protected static function _correctImageSpecialLinks(&$links) { foreach ($links as $k => $link) { + if (!isset($link['page'])) { + continue; + } if (preg_match('/^link_(.*)$/', $link['page'], $matches) && strlen($matches[1]) !== 32) { $uid = $matches[1]; foreach ($links as $l) { diff --git a/resources/linkeditor/js/linkeditor.links.js b/resources/linkeditor/js/linkeditor.links.js index 318902030..7fce58c6e 100644 --- a/resources/linkeditor/js/linkeditor.links.js +++ b/resources/linkeditor/js/linkeditor.links.js @@ -414,6 +414,9 @@ LinkeditorLinks.prototype = { } var $this = this; this.emptyClipboard(); + + let nb = 0; + $.each(selection, function () { var item = $(this); clone = $(item).clone(); @@ -421,6 +424,7 @@ LinkeditorLinks.prototype = { $this.deleteLink(item, false); } $("#linkeditor-clipboard").append(clone); + nb++; }); if (cut) { @@ -428,6 +432,10 @@ LinkeditorLinks.prototype = { this.linkeditor.hasChanged(); this.updateLayers(); } + + var msg = cut ? TRANSLATIONS.n_links_cut : TRANSLATIONS.n_links_copied; + msg = msg.replace('%nb%', nb, msg) + this.linkeditor.notification(msg); }, emptyClipboard: function () { @@ -984,7 +992,7 @@ LinkeditorLinks.prototype = { }, getCurrentSelection: function () { - return $('.link.selected:not(.pendingCreate)'); + return $('#linkeditor .link.selected:not(.pendingCreate)'); }, getFirstLinkInSelection: function () { diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index ca2ef37e0..7d4000ce2 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -62,8 +62,9 @@ 'cover_page_0'=>__('Recouvrir la page sans marge'), 'cover_doublepage_0'=>__('Recouvrir la double-page sans marge'), 'cover_page_1'=>__('Recouvrir la page avec une marge de :margin',['margin'=>'1px']), - 'cover_doublepage_1'=>__('Recouvrir la double-page avec une marge de :margin',['margin'=>'1px'] - ), + 'cover_doublepage_1'=>__('Recouvrir la double-page avec une marge de :margin',['margin'=>'1px']), + 'n_links_copied'=>__('%nb% liens copiés'), + 'n_links_cut'=>__('%nb% liens coupés'), ]; $rulers=!count($rulers)?'{}':json_encode($rulers);