Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
-
Objekte (3 geändert, 0 hinzugefügt, 2 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -1,7 +1,15 @@ 1 -{{apimacro}} 2 -Code 1 +{{aagon.floatingbox/}} 3 3 4 -Code 3 +{{apimacro title="Text"}} 4 +Text 5 +Text 6 +Text 7 +{{/apimacro}} 5 5 9 +{{apimacro title="Code"}} 6 6 Code 7 7 {{/apimacro}} 12 + 13 +{{apimacro title="APIMacro"}} 14 + 15 +{{/apimacro}}
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -3,8 +3,7 @@ 3 3 var header = $(this), 4 4 content = header.next('.showhidecontent'), 5 5 effect = header.attr('data-show-effect'), 6 - duration = parseInt(header.attr('data-show-duration')) || 300, 7 - arrow = header.find('.showhide-arrow'); 6 + duration = parseInt(header.attr('data-show-duration')) || 300; 8 8 9 9 if ($.inArray(effect, ['toggle', 'fadeToggle', 'slideToggle']) === -1) { 10 10 effect = 'toggle'; ... ... @@ -13,12 +13,10 @@ 13 13 var isVisible = content.is(':visible'); 14 14 var newState = !isVisible; 15 15 16 - // Pfeil wechseln 17 - if (arrow.length) { 18 - arrow.text(newState ? '▼' : '►'); 19 - } 15 + // Toggle 'open'-Klasse für Rotation 16 + header.toggleClass('open', newState); 20 20 21 - // Inhalt ein-/ausklappen18 + // Ein-/Ausblenden des Inhalts 22 22 content.stop()[effect](duration); 23 23 } 24 24 - Name
-
... ... @@ -1,1 +1,1 @@ 1 -APIMacro Script1 +APIMacro
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -1,12 +1,24 @@ 1 1 .showhide-header { 2 + overflow: hidden; 2 2 border: 1px solid #ccc; 3 3 background-color: #f7f7f7; 4 4 border-radius: 4px 4px 0 0; 6 + margin: 6px 0 0; 5 5 padding: 10px 12px; 6 6 cursor: pointer; 7 7 user-select: none; 8 8 } 9 9 12 +.showhidecontent { 13 + border: 1px solid #ccc; 14 + overflow: hidden; 15 + margin-bottom: 20px; 16 + border-top: none; 17 + border-radius: 0 0 4px 4px; 18 + padding: 10px; 19 + background-color: #fff; 20 +} 21 + 10 10 .showhide-header-flex { 11 11 display: flex; 12 12 justify-content: space-between; ... ... @@ -20,11 +20,16 @@ 20 20 } 21 21 22 22 .showhide-arrow { 35 + display: inline-block; 36 + transition: transform 0.3s ease; 37 + transform: rotate(0deg); 23 23 font-size: 16px; 24 - font-weight: bold; 25 25 color: #0645ad; 26 - text-align: right; 27 - min-width: 20px; 28 - transition: transform 0.2s ease; 29 29 } 30 30 42 +/* Wenn Container 'open' ist → Pfeil dreht sich */ 43 +.showhide-header.open .showhide-arrow { 44 + transform: rotate(90deg); 45 +} 46 + 47 +
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -1,41 +1,42 @@ 1 1 {{velocity}} 2 -#set($discard = $xwiki.jsx.use("Macros. ShowHideMacro"))2 +#set($discard = $xwiki.jsx.use("Macros.APIMacro")) 3 3 #set($mparams = $wikimacro.parameters) 4 4 #if(!$mparams) 5 5 #set($mparams = $xcontext.macro.params) 6 6 #end 7 -#if($mparams.id) 8 - #set($id = $util.convertToAlphaNumeric($mparams.id)) 9 -#end 10 -#set($showmessage = $escapetool.xml($mparams.showmessage)) 11 -#set($hidemessage = $escapetool.xml($mparams.hidemessage)) 12 -#set($divstyle = $escapetool.xml($mparams.style)) 13 -#set($effect = $escapetool.xml($mparams.effect)) 7 + 8 +#set($id = $util.convertToAlphaNumeric($mparams.id)) 9 +#set($effect = $mparams.effect) 14 14 #if($effect == "appear" || $effect == "fade") 15 15 #set($effect = "fadeToggle") 16 -#elseif ($effect == "blind" || $effect == "slide")12 +#elseif($effect == "blind" || $effect == "slide") 17 17 #set($effect = "slideToggle") 18 18 #end 19 19 #set($effectduration = $mathtool.mul(1000,$mparams.effectduration)) 20 -#set($title = $escapetool.xml($mparams.title)) 21 -(% #if($divstyle && $divstyle!="") style="${divstyle}" #end %) 22 -((( 16 +#set($language = $mparams.language) 17 +#if(!$language || $language == "") 18 + #set($language = "bash") 19 +#end 20 + 21 +#set($codeStart = '{{code language="' + $language + '"}}') 22 +#set($codeEnd = '{{/code}}') 23 +#set($content = $codeStart + $wikimacrocontent + $codeEnd) 23 23 {{html clean=false}} 24 24 <div class="showhide-header" 25 - #if($id&& $id!="") id="showhideheader${id}"#end26 - data-show- duration="$effectduration"27 - data-show- effect="$effect">26 + id="showhideheader${id}" 27 + data-show-effect="$effect" 28 + data-show-duration="$effectduration"> 28 28 <div class="showhide-header-flex"> 29 - <div class="showhide-title">$title</div> 30 - <div class="showhide-arrow"> ►</div>30 + <div class="showhide-title">$mparams.title</div> 31 + <div class="showhide-arrow">▶</div> 31 31 </div> 32 32 </div> 34 + 35 +<div class="showhidecontent" 36 + id="showhidecontent${id}" 37 + style="display: none;"> 38 + $xwiki.renderText($content, $doc.syntaxId) 39 +</div> 33 33 {{/html}} 34 -(% class="showhidecontent" #if($id && $id!="")id="showhidecontent${id}" #end#if($xcontext.action != 'edit') style="display: none;"#end %) 35 -((( 36 -((( 37 -{{wikimacrocontent /}} 38 -))) 39 -))) 40 -))) 41 41 {{/velocity}} 42 + - Makrobeschreibung
-
... ... @@ -1,1 +1,1 @@ 1 - Show/hidecontentwith animations.1 +Makro für PublicAPI-Commands
- XWiki.WikiMacroParameterClass[3]
-
- Parameter-Vorgabe
-
... ... @@ -1,1 +1,0 @@ 1 -slide - Parameter-Beschreibung
-
... ... @@ -1,1 +1,0 @@ 1 -Scriptaculous Effect - Parameter verpflichtend
-
... ... @@ -1,1 +1,0 @@ 1 -Nein - Parameter-Name
-
... ... @@ -1,1 +1,0 @@ 1 -effect
- XWiki.WikiMacroParameterClass[5]
-
- Parameter-Vorgabe
-
... ... @@ -1,1 +1,0 @@ 1 -0 - Parameter-Beschreibung
-
... ... @@ -1,1 +1,0 @@ 1 -Effect duration - Parameter verpflichtend
-
... ... @@ -1,1 +1,0 @@ 1 -Nein - Parameter-Name
-
... ... @@ -1,1 +1,0 @@ 1 -effectduration

