Modifications pour le document Expand
Modifié par superadmin le 21/07/2025 - 08:55
Depuis la version 4.1
modifié par Admin
sur 20/08/2024 - 13:51
sur 20/08/2024 - 13:51
Commentaire de modification :
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.21.0]
À la version 10.1
modifié par superadmin
sur 25/05/2025 - 00:00
sur 25/05/2025 - 00:00
Commentaire de modification :
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.26.20]
Résumé
-
Propriétés de la Page (2 modifications, 0 ajouts, 0 suppressions)
-
Objets (3 modifications, 1 ajouts, 0 suppressions)
Détails
- Propriétés de la Page
-
- Auteur du document
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.admin 1 +XWiki.superadmin - Contenu
-
... ... @@ -4,11 +4,12 @@ 4 4 5 5 |=Parameter|=Description|=Required|=Default 6 6 |**title**|Text displayed on the collaspse toggle|No|(empty) 7 +|**expanded**|If selected the expand will be opened automatically when loading the page.|No|False 7 7 8 8 Note: if no title is provided, the title of the first panel or the first header appearing in the content will be used. if there is no such header or panel title, "Click here to expand…" will be used. 9 9 10 10 = Example Usage = 11 11 12 -{{expand}} 13 -Hello 👀13 +{{expand expanded="false"}} 14 +Hello 14 14 {{/expand}}
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -10,7 +10,7 @@ 10 10 11 11 .confluence-expand-macro .panel-title{ 12 12 padding: @panel-heading-padding; 13 - display: block;13 + display: flex; 14 14 } 15 15 16 16 .confluence-expand-macro .panel-body { ... ... @@ -23,6 +23,10 @@ 23 23 24 24 .confluence-expand-macro summary:hover { 25 25 cursor: pointer; 26 +} 27 + 28 +.panel-title:hover .title-text { 29 + cursor: pointer; 26 26 text-decoration: underline; 27 27 } 28 28 ... ... @@ -31,6 +31,11 @@ 31 31 border: none; 32 32 } 33 33 38 +.confluence-expand-macro.panel.panel-default .panel-body ul { 39 + list-style-type: revert; 40 + padding-left: revert; 41 +} 42 + 34 34 .confluence-expand-macro.panel { 35 35 background: unset; 36 36 }
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -1,7 +1,29 @@ 1 1 {{velocity output="false"}} 2 2 #macro (executeMacro) 3 + ## To avoid an issue regarding {{wikimacroparameter}} and {{wikimacrocontent}} that fail to render when in 4 + ## edit mode while inside a HTML macro, we need to manually write the HTML by using XWiki syntax. This way, 5 + ## while the macro will always be expanded when in edit mode, the user will be able to modify the text inline. 6 + #set ($targetSyntaxId = $wikimacro.context.transformationContext.targetSyntax.type.id) 3 3 #set ($discard = $xwiki.ssx.use('Confluence.Macros.Expand')) 4 - #set ($opened = $xcontext.action == 'edit' || $xcontext.action == 'export') 8 + #if ($targetSyntaxId == 'annotatedhtml' || $targetSyntaxId == 'annotatedxhtml' || 9 + $request.outputSyntax == 'annotatedhtml') 10 + (% class="confluence-expand-macro panel panel-default" %) 11 + ((( 12 + ((( 13 + (% class="panel-title" %) 14 + ((( 15 + (% class="glyphicon glyphicon-menu-down" aria-hidden="true" %) 16 + ((())) 17 + {{wikimacroparameter name='title' /}} 18 + ))) 19 + ))) 20 + (% class="panel-body" %) 21 + ((( 22 + {{wikimacrocontent /}} 23 + ))) 24 + ))) 25 + #else 26 + #set ($opened = $xcontext.action == 'edit' || $xcontext.action == 'export' || $wikimacro.parameters.expanded) 5 5 {{html clean="false" wiki="true"}} 6 6 <details class="confluence-expand-macro panel panel-default" #if ($opened)open#end> 7 7 <summary> ... ... @@ -14,8 +14,10 @@ 14 14 #set ($title = $services.localization.render("rendering.macro.expand.defaultexpandtitle")) 15 15 #end 16 16 #end 17 - $services.rendering.escape($escapetool.xml($title), $xwiki.currentContentSyntaxId) 18 - </span> 39 + <span class="title-text"> 40 + $services.rendering.escape($escapetool.xml($title), $xwiki.currentContentSyntaxId) 41 + </span> 42 + </span> 19 19 </summary> 20 20 <div class="panel-body"> 21 21 ... ... @@ -24,6 +24,7 @@ 24 24 </div> 25 25 </details> 26 26 {{/html}} 51 + #end 27 27 #end 28 28 {{/velocity}} 29 29 ... ... @@ -31,7 +31,7 @@ 31 31 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 32 32 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 33 33 ## don't have view right on those pages. 34 -#if ($services. promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))59 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 35 35 #executeMacro 36 36 #else 37 37 {{missingLicenseMessage extensionName="proMacros.extension.name"/}} - Disponibilité du contenu de la macro
-
... ... @@ -1,1 +1,1 @@ 1 - Optional1 +Mandatory - Description de la macro
-
... ... @@ -1,5 +1,0 @@ 1 -Add the Expand macro to your page to provide content in an expandable / collapsible section. 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. 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.
- XWiki.WikiMacroParameterClass[0]
-
- Valeur par défaut du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +Click here to expand... - Description du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -Defines the text that appears next to the expand/collapse icon.
- XWiki.WikiMacroParameterClass[1]
-
- Valeur par défaut du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +0 - Paramètre obligatoire
-
... ... @@ -1,0 +1,1 @@ 1 +Non - Nom du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +expanded - Type du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +java.lang.Boolean