From 33217c760052d7128ceb376e296b75001835c6c2 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 10 Jun 2025 16:03:07 +0200 Subject: [PATCH] wip #7467 @2 --- .../js/linkeditor.accessibility.js | 4 ++-- .../linkeditor-stable/js/linkeditor.links.js | 12 +++++------ .../linkeditor-stable/js/linkeditor.panels.js | 21 +++++++++++++------ .../linkeditor-stable/style/inc/_links.sass | 17 +++++++++++++++ .../link_editor.blade.php | 4 ++-- 5 files changed, 42 insertions(+), 16 deletions(-) diff --git a/resources/linkeditor-stable/js/linkeditor.accessibility.js b/resources/linkeditor-stable/js/linkeditor.accessibility.js index 292a05748..1feab45f4 100644 --- a/resources/linkeditor-stable/js/linkeditor.accessibility.js +++ b/resources/linkeditor-stable/js/linkeditor.accessibility.js @@ -136,9 +136,9 @@ LinkeditorAccessibility.prototype = { let xdiff = xa - xb; let ydiff = ya - yb; - if (way === 'horizontal') { + if (way === 'columns') { return Math.abs(xdiff) > xTolerance ? xdiff : ydiff; - } else if (way === 'vertical') { + } else if (way === 'lines') { return Math.abs(ydiff) > yTolerance ? ydiff : xdiff; } }); diff --git a/resources/linkeditor-stable/js/linkeditor.links.js b/resources/linkeditor-stable/js/linkeditor.links.js index 057302d9e..f222a5dbb 100644 --- a/resources/linkeditor-stable/js/linkeditor.links.js +++ b/resources/linkeditor-stable/js/linkeditor.links.js @@ -376,13 +376,13 @@ LinkeditorLinks.prototype = { res.items = $.extend(res.items, { "order_selection": { name: (TRANSLATIONS.reorder_selection) + '', items: { - 'reorder_horizontal': { - name: TRANSLATIONS.reorder_horizontal, callback: function () { - $this.reorderSelection('horizontal'); + 'reorder_lines': { + name: TRANSLATIONS.reorder_lines, callback: function () { + $this.reorderSelection('lines'); } - }, 'reorder_vertical': { - name: TRANSLATIONS.reorder_vertical, callback: function () { - $this.reorderSelection('vertical'); + }, 'reorder_columns': { + name: TRANSLATIONS.reorder_columns, callback: function () { + $this.reorderSelection('columns'); } }, } diff --git a/resources/linkeditor-stable/js/linkeditor.panels.js b/resources/linkeditor-stable/js/linkeditor.panels.js index e9150c8af..c0d8b5741 100644 --- a/resources/linkeditor-stable/js/linkeditor.panels.js +++ b/resources/linkeditor-stable/js/linkeditor.panels.js @@ -48,7 +48,8 @@ LinkeditorPanels.prototype = { if ($(this).prop('checked')) { $this.linkeditor.links.selectLink(link); - } else {$this.linkeditor.links.deselectLink(link); + } else { + $this.linkeditor.links.deselectLink(link); } return true; @@ -147,15 +148,20 @@ LinkeditorPanels.prototype = { toggleVersions: function () { this.togglePanel('versions'); - }, toggleLayers: function () { + }, + toggleLayers: function () { this.togglePanel('layers'); - }, toggleForm: function () { + }, + toggleForm: function () { this.togglePanel('form'); - }, toggleAccessibility: function () { + }, + toggleAccessibility: function () { this.togglePanel('accessibility'); - }, togglePanel: function (panel) { + }, + togglePanel: function (panel) { this.setPanelState(panel, 'toggle'); - }, setPanelState: function (panel, newState) { + }, + setPanelState: function (panel, newState) { var $this = this; var panelDiv = $('#linkeditor-panel-' + panel); let container = panelDiv.closest('.linkeditor-panel-side'); @@ -200,6 +206,9 @@ LinkeditorPanels.prototype = { if (newState) { this.linkeditor.settings.set(side + '_tool', panel); + $('body').addClass(panel + '-panel').removeClass('no-' + panel + '-panel'); + } else { + $('body').removeClass(panel + '-panel').addClass('no-' + panel + '-panel'); } this.linkeditor.settings.set(side + '_open', newState); diff --git a/resources/linkeditor-stable/style/inc/_links.sass b/resources/linkeditor-stable/style/inc/_links.sass index 24c38cd6d..bae9e06b4 100644 --- a/resources/linkeditor-stable/style/inc/_links.sass +++ b/resources/linkeditor-stable/style/inc/_links.sass @@ -38,6 +38,23 @@ &.pendingPolygonCreate clip-path: none !important + .accessibility-panel &[fb-orderable="1"]:after + position: absolute + left: 5px + top: 5px + line-height: 30px + display: block + color: #000 + font-weight: bold + font-size: 20px + content: attr(fb-order) + background-color: rgba(255,255,255,0.5) + width: 30px + height: 30px + border-radius: 50% + text-align: center + border: 1px solid #000 + .corners visibility: hidden position: absolute diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index 4844b1816..f19b666fb 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -86,8 +86,8 @@ 'delete_selection'=>__('Supprimer la sélection'), 'edit_link_order'=>__('Modifier l\'ordre'), 'reorder_selection'=>__('Réordonner la sélection'), - 'reorder_horizontal'=>__('Horizontal puis vertical'), - 'reorder_vertical'=>__('Vertical puis horizontal'), + 'reorder_lines'=>__('Par lignes'), + 'reorder_columns'=>__('Par colonnes'), 'move_up'=>__('Avant'), 'move_down'=>__('Après'), 'move_beginning'=>__('Au début'), -- 2.39.5