From b1451ad367d998650d45f064efffb3cf737767e9 Mon Sep 17 00:00:00 2001 From: LucasC Date: Wed, 7 May 2025 11:19:31 +0200 Subject: [PATCH 1/6] XWIKI-12824: Add buttons to hide/show panels * Changed the nature of the hint fgor panel toggles. * Added controls on the standalone edition sheet. * Made sure everything that worked with rightPanels also works with editPanels. --- .../src/main/resources/flamingo/flamingo.js | 2 +- .../src/main/resources/flamingo/less/layout.less | 10 ++++++++-- .../src/main/resources/templates/editpanels.vm | 9 ++++++++- .../src/main/resources/templates/leftpanels.vm | 2 +- .../src/main/resources/templates/rightpanels.vm | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/flamingo.js b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/flamingo.js index 9a817cd62c58..e14f6e6a30bb 100644 --- a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/flamingo.js +++ b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/flamingo.js @@ -174,7 +174,7 @@ require(['jquery', 'jquery-ui'], function($) { // We set the one we want when displayed in the flex layout. document.body.style.setProperty('--panel-column-' + side + '-width', ui.size.width + 'px'); }; - $("#rightPanels").resizable({ + $("#rightPanels, #editPanels").resizable({ handles: 'w', resize: resizeCustomFunction.bind(null, right) }); diff --git a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/layout.less b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/layout.less index 487e639a61d3..b90d5c05e412 100644 --- a/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/layout.less +++ b/xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/less/layout.less @@ -86,7 +86,7 @@ -/**/-panel-column-left-width: 0; -/**/-panel-column-right-width: 0; - & #leftPanels, & #rightPanels { + & #leftPanels, & #rightPanels, & #editPanels { display: none; } } @@ -205,6 +205,7 @@ again or the page is reloaded (because the toggler is hidden until then). */ #rightPanelsToggle[aria-expanded="false"], #contentcontainer:hover #contentcolumn:not(:hover) ~ #rightPanelsToggle, #rightPanelsToggle:has(+ #rightPanels:focus-within), + #rightPanelsToggle:has(+ #editPanels:focus-within), #rightPanelsToggle:hover, #rightPanelsToggle:focus { opacity: 1; } @@ -244,6 +245,7 @@ body#body #leftPanelsToggle { /* Resize handles */ #rightPanels > .ui-resizable-w, +#editPanels > .ui-resizable-w, #leftPanels > .ui-resizable-e { position: absolute; top: 0; @@ -270,7 +272,7 @@ body#body #leftPanelsToggle { background-image: linear-gradient( 90deg, transparent 0%, transparent 90%, @navbar-default-bg 90%, @navbar-default-bg 90%); } -#rightPanels > .ui-resizable-w { +#rightPanels > .ui-resizable-w, #editPanels > .ui-resizable-w { left: 0; /* We want the click zone to be large, but the display to be discreete. 90% of the button is transparent and the 10% on the left are highlighted on hover. */ @@ -281,6 +283,10 @@ body#body #leftPanelsToggle { #rightPanels > .ui-resizable-w:hover, #rightPanels > .ui-resizable-w:active, #rightPanels.ui-resizable-resizing > .ui-resizable-w, +#editPanels > .ui-resizable-w:focus, +#editPanels > .ui-resizable-w:hover, +#editPanels > .ui-resizable-w:active, +#editPanels.ui-resizable-resizing > .ui-resizable-w, #leftPanels > .ui-resizable-e:focus, #leftPanels > .ui-resizable-e:hover, #leftPanels > .ui-resizable-e:active, diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/editpanels.vm b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/editpanels.vm index 11ac79f504a5..2cc0d63e774b 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/editpanels.vm +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/editpanels.vm @@ -35,6 +35,11 @@ #set ($editorPanels = $editorPanelsHistory) #end #if ($!editorPanels != '') + ## Similar to the toggle defined in rightpanels.vm + #set ($editorPanels = $editorPanels.split(','))
@@ -57,7 +62,9 @@ $services.rendering.render($panelUIExtension.execute(), "xhtml/1.0") #end #end - + ## Similar to the resize handle defined in rightpanels.vm +
#end #end \ No newline at end of file diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/leftpanels.vm b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/leftpanels.vm index f1bdfc16f353..996e8d6a1efe 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/leftpanels.vm +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/leftpanels.vm @@ -21,7 +21,7 @@ #if(!$request.getParameter("forceLeftPanels")) #end