Änderungen von Dokument Expand
Zuletzt geändert von xwikiadmin am 2025/12/11 07:41
Von Version 4.1
bearbeitet von xwikiadmin
am 2024/06/24 14:46
am 2024/06/24 14:46
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.19.4]
Auf Version 1.1
bearbeitet von xwikiadmin
am 2023/03/07 09:54
am 2023/03/07 09:54
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.7]
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
-
Objekte (2 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Übergeordnete Seite
-
... ... @@ -1,1 +1,1 @@ 1 - WebHome1 +Confluence.Macros
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -1,35 +1,38 @@ 1 -.confluence-expand-macro .glyphicon { 2 - margin-right: 0.5rem; 3 - transform: rotate(0deg); 4 - transition: transform 0.3s; 5 -} 1 +.confluence-expand-macro { 6 6 7 -.confluence-expand-macro[open] > summary .glyphicon { 8 - transform: rotate(90deg); 9 -} 3 + .panel-heading { 4 + padding: 0; 5 + .panel-title { 6 + font-size: 1em; 10 10 11 - .confluence-expand-macro.panel-title{12 - padding: @panel-heading-padding;13 - }8 + a { 9 + display: block; 10 + padding: @panel-heading-padding; 14 14 15 - .confluence-expand-macro.panel-body{16 - transition: linear 0.3s;17 -} 12 + p { 13 + display: inline; 14 + } 18 18 19 -.confluence-expand-macro summary { 20 - font-size: 1em; 21 -} 16 + .glyphicon { 17 + margin-right: 0.5rem; 18 + transform: rotate(0deg); 19 + transition: transform 0.1s; 20 + } 21 + &[aria-expanded="true"] .glyphicon { 22 + transform: rotate(90deg); 23 + } 24 + } 25 + } 26 + } 22 22 23 -.confluence-expand-macro summary:hover { 24 - cursor: pointer; 25 - text-decoration: underline; 26 -} 28 + .panel-collapse { 29 + .panel-body { 30 + display: block; 31 + &::before { content: none; } 32 + &::after { content: none; } 27 27 28 -.confluence-expand-macro.panel > .panel-body, .confluence-expand-macro > summary { 29 - background: unset; 30 - border: none; 34 + & > *:first-child { margin-top: 0; } 35 + & > *:last-child { margin-bottom: 0; } 36 + } 37 + } 31 31 } 32 - 33 -.confluence-expand-macro.panel { 34 - background: unset; 35 -}
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -1,32 +23,37 @@ 1 -{{velocity output="false"}} 2 -#macro (executeMacro) 3 - $xwiki.ssx.use('Confluence.Macros.Expand') 4 - #set ($opened = $xcontext.action == 'edit' || $request.getParameter('format') == "html-print") 5 - {{html clean="false" wiki="true"}} 6 - <details class="confluence-expand-macro panel panel-default" #if ($opened)open#end> 7 - <summary> 8 - <div class="panel-title"> 9 - <span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span> 10 - $services.rendering.escape($escapetool.xml("${wikimacro.parameters.title}"), 'xwiki/2.1') 11 - </div> 12 - </summary> 13 - <div class="panel-body"> 14 - 15 - {{wikimacrocontent /}} 16 - 17 - </div> 18 - </details> 19 - {{/html}} 20 -#end 21 -{{/velocity}} 22 - 23 23 {{velocity}} 24 -## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 25 -## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 26 -## don't have view right on those pages. 27 -#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 28 - #executeMacro 2 +$xwiki.ssx.use('Confluence.Macros.Expand') 3 +#if (!$expandMacroColllapseId) 4 + #set ($expandMacroColllapseId = 0) 29 29 #else 30 - {{missingLicenseMessageextensionName="proMacros.extension.name"/}}6 + #set ($expandMacroColllapseId = $expandMacroColllapseId + 1) 31 31 #end 8 +#set ($opened = $xcontext.action == 'edit') 9 +#set ($accordionId = "accordion-$escapetool.xml($expandMacroColllapseId)") 10 +#set ($toggleId = "toggle-$expandMacroColllapseId") 11 +#set ($expandId = "collapse-$expandMacroColllapseId") 12 + 13 +{{html clean="false" wiki="true"}} 14 +<div class="panel-group confluence-expand-macro" id="${accordionId}" role="tablist"> 15 + <div class="panel panel-default"> 16 + <div class="panel-heading" role="tab" id="${toggleId}"> 17 + <h4 class="panel-title"> 18 + <a 19 + role="button" 20 + data-toggle="collapse" 21 + data-parent="#${accordionId}" 22 + href="#${expandId}" 23 + #if($opened)aria-expanded="true"#end 24 + aria-controls="${expandId}" 25 + ><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span>{{wikimacroparameter name="title" /}}</a> 26 + </h4> 27 + </div> 28 + <div id="${expandId}" class="panel-collapse collapse #if($opened)in#end" role="tabpanel" aria-labelledby="${toggleId}"> 29 + <div class="panel-body"> 30 + {{wikimacrocontent /}} 31 + </div> 32 + </div> 33 + </div> 34 + </div> 35 +{{/html}} 36 + 32 32 {{/velocity}} - Makrobeschreibung
-
... ... @@ -1,5 +1,5 @@ 1 -Add the Expand macro to your page to provide content in an expandable / collapsible section. 1 +Add the Expand macro to your page to provide content in an expandable / collapsible section. 2 2 3 -This is one of Confluence's most popular macros. It's great for: visually reducing the amount of information on a page, breaking process information down into clickable steps, hiding background or obsolete information, while still keeping it on the page for future reference.3 +This is one of Confluence's most popular macros. It's great for: visually reducing the amount of information on a page, breaking process information down into clickable steps, hiding background or obsolete information, while still keeping it on the page for future reference. 4 4 5 -The macro is collapsed by default, people need to click each one to expand it. There's no way to expand all macros on a page at once, however all Expand macros are automatically expanded when you print or export the page to PDF.5 +The macro is collapsed by default, people need to click each one to expand it. There's no way to expand all macros on a page at once, however all Expand macros are automatically expanded when you print or export the page to PDF.