From: Vincent Vanwaelscappel Date: Fri, 8 Dec 2023 09:23:20 +0000 (+0100) Subject: wip #6562 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=71e091f50cc7f89adbff0dbed0960f9a3c9fd64c;p=fluidbook-toolbox.git wip #6562 @1 --- diff --git a/resources/linkeditor/js/linkeditor.links.js b/resources/linkeditor/js/linkeditor.links.js index ca609b6db..884c5c7ab 100644 --- a/resources/linkeditor/js/linkeditor.links.js +++ b/resources/linkeditor/js/linkeditor.links.js @@ -292,6 +292,20 @@ LinkeditorLinks.prototype = { $this.paste(); }, }; + res.items.paste_on_left = { + isHtmlName: true, + name: TRANSLATIONS.paste_on_left, + callback: function () { + $this.paste('left'); + }, + }; + res.items.paste_on_right = { + isHtmlName: true, + name: TRANSLATIONS.paste_on_right, + callback: function () { + $this.paste('right'); + }, + }; } } if (hasSelection && !multiple) { @@ -375,7 +389,11 @@ LinkeditorLinks.prototype = { var $this = this; let offset = {x: 0, y: 0}; - if (frommouse !== undefined) { + if (frommouse === 'left') { + offset.x = -this.linkeditor.pw; + } else if (frommouse === 'right') { + offset.x = this.linkeditor.pw; + } else if (frommouse !== undefined) { // Base mouse position should be the start of context menu (and not the mouse position when we click on the Paste in place item menu) offset = this.linkeditor.globalToFluidbook(frommouse.x, frommouse.y, this.linkeditor.single); diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index 4d01bcc3d..41d6873a3 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -89,6 +89,8 @@ 'cut'=>__('Couper'), 'paste_here'=>__('Coller ici'), 'paste_in_place'=>__('Coller en place'), + 'paste_on_left'=>__('Coller en décalant vers la gauche'), + 'paste_on_right'=>__('Coller en décalant vers la droite'), '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']), @@ -98,6 +100,7 @@ 'click_to_copy_id'=>__('Cliquer pour copier l\'identifiant du lien'), 'id_copied'=>__('Identifiant copié !'), 'lock'=>__('Vérouiller'), + 'fix_offset'=>__('Corriger décalage de page'), ]; $rulers=!count($rulers)?'{}':json_encode($rulers); @@ -372,7 +375,7 @@ var DEPTH = @json($depths); + src="/packages/linkeditor/js/linkeditor.js?v={{filemtime(public_path('packages/linkeditor/js/linkeditor.js'))}}"> @endpush @push('linkeditor_styles')