]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5964 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 May 2023 15:39:38 +0000 (17:39 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 May 2023 15:39:38 +0000 (17:39 +0200)
app/Fluidbook/Link/LinksData.php
resources/linkeditor/js/linkeditor.links.js
resources/views/fluidbook_publication/link_editor.blade.php

index 92f2d192712058018b5149e290395490c8c415be..42f2e0f4b24e8c9bb726314f35454b071e35d7bd 100644 (file)
@@ -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) {
index 3189020307fb94b9e6e0b957b94abe5e235dd4a5..7fce58c6ea2102f3983bd6a5c902dd12a56c5304 100644 (file)
@@ -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 () {
index ca2ef37e0bac9868268c48a26616341fabebf5f1..7d4000ce25fc7443c1cc8e1758578bf5479e84a6 100644 (file)
@@ -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);