Änderungen von Dokument MicrosoftStream
Zuletzt geändert von xwikiadmin am 2025/05/21 10:10
Von Version 1.1
bearbeitet von xwikiadmin
am 2022/11/23 13:31
am 2022/11/23 13:31
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.6]
Auf Version 2.1
bearbeitet von xwikiadmin
am 2023/04/25 11:51
am 2023/04/25 11:51
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.7.1]
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
-
Objekte (3 geändert, 1 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -40,6 +40,11 @@ 40 40 $xwiki.currentContentSyntaxId)|$services.rendering.escape( 41 41 $services.localization.render('rendering.macro.microsoftStream.parameter.autoplay.description'), 42 42 $xwiki.currentContentSyntaxId)|No|false 43 +|**textWrap**|$services.rendering.escape( 44 +$services.localization.render('rendering.macro.microsoftStream.parameter.textWrap.name'), 45 +$xwiki.currentContentSyntaxId)|$services.rendering.escape( 46 +$services.localization.render('rendering.macro.microsoftStream.parameter.textWrap.description'), 47 +$xwiki.currentContentSyntaxId)|No|true 43 43 44 44 {{/velocity}} 45 45
- XWiki.StyleSheetExtension[0]
-
- Code
-
... ... @@ -5,6 +5,14 @@ 5 5 text-align: center; 6 6 } 7 7 8 + &-left { 9 + text-align: start; 10 + } 11 + 12 + &-right { 13 + text-align: end; 14 + } 15 + 8 8 iframe { 9 9 max-width: 100%; 10 10 border: none;
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -1,11 +1,11 @@ 1 1 {{velocity output="false"}} 2 -#macro (get AlignmentClass$alignment $alignmentClass)3 - # if($alignment=='left')4 - #set($alignmentClass='pull-left')5 - #el seif($alignment == 'right')6 - #set ($ alignmentClass ='pull-right')2 +#macro (getStyle $alignment $textWrap $styleClass) 3 + ## For left and right alignment, consider if text should be wrapped around the video. If no value is set for textWrap, 4 + ## this will be false by default. 5 + #if ($alignment == 'left' || $alignment == 'right') 6 + #set ($styleClass = "#if ($textWrap == true)pull-${alignment}#{else}msStreamMacro-${alignment}#end") 7 7 #elseif ($alignment == 'center') 8 - #set ($ alignmentClass = 'msStreamMacro-center')8 + #set ($styleClass = 'msStreamMacro-center') 9 9 #end 10 10 #end 11 11 ... ... @@ -38,33 +38,48 @@ 38 38 + $datetool.getValue('SECOND', $dateObj)) 39 39 #end 40 40 #end 41 + 42 +#macro (executeMacro) 43 + #set ($discard = $xwiki.ssx.use('XWiki.Macros.MicrosoftStream')) 44 + #getStyle($stringtool.lowerCase($xcontext.macro.params.alignment) $xcontext.macro.params.textWrap $styleClass) 45 + #getBaseURLAndQueryParams($xcontext.macro.params.url $baseURL $queryParams) 46 + ## Update the query params, if needed, since macro parameters have priority over the parameters extracted from URL. 47 + #set ($autoplay = $xcontext.macro.params.autoplay) 48 + #if ($autoplay) 49 + #set ($discard = $queryParams.put('autoplay', $autoplay)) 50 + #end 51 + #set ($showinfo = $xcontext.macro.params.showinfo) 52 + #if ($showinfo) 53 + #set ($discard = $queryParams.put('showinfo', $showinfo)) 54 + #end 55 + #if ($xcontext.macro.params.start) 56 + #getStartAsSeconds($xcontext.macro.params.start $startSeconds) 57 + #if ($queryParams.st != $startSeconds) 58 + #set ($discard = $queryParams.put('st', $startSeconds)) 59 + #end 60 + #end 61 + #set ($videoURL = $baseURL + '?' + $escapetool.url($queryParams)) 62 + {{html clean=false}} 63 + <p class="msStreamMacro $!escapetool.xml($styleClass)"> 64 + <iframe width="$escapetool.xml($xcontext.macro.params.width)" 65 + height="$escapetool.xml($xcontext.macro.params.height)" src="$escapetool.xml($videoURL)" allowfullscreen> 66 + </iframe> 67 + </p> 68 + {{/html}} 69 +#end 41 41 {{/velocity}} 42 42 72 +{{include reference="Licenses.Code.VelocityMacros"/}} 73 + 43 43 {{velocity}} 44 -#set ($discard = $xwiki.ssx.use('XWiki.Macros.MicrosoftStream')) 45 -#getAlignmentClass($stringtool.lowerCase($xcontext.macro.params.alignment) $alignmentClass) 46 -#getBaseURLAndQueryParams($xcontext.macro.params.url $baseURL $queryParams) 47 -## Update the query params, if needed, since macro parameters have priority over the parameters extracted from URL. 48 -#set ($autoplay = $xcontext.macro.params.autoplay) 49 -#if ($autoplay) 50 - #set ($discard = $queryParams.put('autoplay', $autoplay)) 75 +## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 76 +## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 77 +## don't have view right on those pages. 78 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 79 + #executeMacro 80 +#else 81 + {{error}} 82 + #getMissingLicenseMessage('proMacros.extension.name') 83 + {{/error}} 51 51 #end 52 -#set ($showinfo = $xcontext.macro.params.showinfo) 53 -#if ($showinfo) 54 - #set ($discard = $queryParams.put('showinfo', $showinfo)) 55 -#end 56 -#if ($xcontext.macro.params.start) 57 - #getStartAsSeconds($xcontext.macro.params.start $startSeconds) 58 - #if ($queryParams.st != $startSeconds) 59 - #set ($discard = $queryParams.put('st', $startSeconds)) 60 - #end 61 -#end 62 -#set ($videoURL = $baseURL + '?' + $escapetool.url($queryParams)) 63 -{{html clean=false}} 64 - <p class="msStreamMacro $!escapetool.xml($alignmentClass)"> 65 - <iframe width="$escapetool.xml($xcontext.macro.params.width)" 66 - height="$escapetool.xml($xcontext.macro.params.height)" src="$escapetool.xml($videoURL)" allowfullscreen> 67 - </iframe> 68 - </p> 69 -{{/html}} 70 70 {{/velocity}}
- XWiki.WikiMacroParameterClass[3]
-
- Parameter-Vorgabe
-
... ... @@ -1,0 +1,1 @@ 1 +NONE
- XWiki.WikiMacroParameterClass[7]
-
- Parameter-Vorgabe
-
... ... @@ -1,0 +1,1 @@ 1 +false - Parameter-Beschreibung
-
... ... @@ -1,0 +1,1 @@ 1 +Wrap text around the video. This applies only to left and right alignment. - Parameter verpflichtend
-
... ... @@ -1,0 +1,1 @@ 1 +Nein - Parameter-Name
-
... ... @@ -1,0 +1,1 @@ 1 +textWrap - Parameter-Typ
-
... ... @@ -1,0 +1,1 @@ 1 +java.lang.Boolean