Änderungen von Dokument MicrosoftStream

Zuletzt geändert von xwikiadmin am 2024/06/24 15:04

Von Version 4.1
bearbeitet von xwikiadmin
am 2024/06/24 15:04
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.19.4]
Auf Version 1.1
bearbeitet von xwikiadmin
am 2022/08/11 17:55
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros/1.3]

Zusammenfassung

Details

Seiteneigenschaften
Übergeordnete Seite
... ... @@ -1,1 +1,1 @@
1 -WebHome
1 +xwiki:XWiki.Macros.WebHome
Inhalt
... ... @@ -2,6 +2,7 @@
2 2  = Description =
3 3  
4 4  The Microsoft Stream Macro provides a way for embeding a Microsoft Stream video in a page.
5 +This macro is also a bridge between the Confluence macro and XWiki.
5 5  
6 6  = Parameters =
7 7  
... ... @@ -40,11 +40,6 @@
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
48 48  
49 49  {{/velocity}}
50 50  
... ... @@ -51,5 +51,5 @@
51 51  = Example of usage =
52 52  
53 53  {{code}}
54 -{{msStream url="https://web.microsoftstream.com/video/2113" width="700px" alignment="left" showinfo="true" start="00:05:04"/}}
50 +{{microsoftStream url="https://web.microsoftstream.com/video/2113" width="700px" alignment="left" showinfo="true" start="00:05:04"/}}
55 55  {{/code}}
XWiki.StyleSheetExtension[0]
Code
... ... @@ -5,14 +5,6 @@
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 -
16 16   iframe {
17 17   max-width: 100%;
18 18   border: none;
XWiki.WikiMacroClass[0]
Makro-Code
... ... @@ -1,11 +1,11 @@
1 1  {{velocity output="false"}}
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")
2 +#macro (getAlignmentClass $alignment $alignmentClass)
3 + #if ($alignment == 'left')
4 + #set ($alignmentClass = 'pull-left')
5 + #elseif ($alignment == 'right')
6 + #set ($alignmentClass = 'pull-right')
7 7   #elseif ($alignment == 'center')
8 - #set ($styleClass = 'msStreamMacro-center')
8 + #set ($alignmentClass = 'msStreamMacro-center')
9 9   #end
10 10  #end
11 11  
... ... @@ -38,44 +38,33 @@
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
70 70  {{/velocity}}
71 71  
72 72  {{velocity}}
73 -## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right
74 -## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
75 -## don't have view right on those pages.
76 -#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))
77 - #executeMacro
78 -#else
79 - {{missingLicenseMessage extensionName="proMacros.extension.name"/}}
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))
80 80  #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}}
81 81  {{/velocity}}
Standardkategorie
... ... @@ -1,0 +1,1 @@
1 +Content
XWiki.WikiMacroParameterClass[3]
Parameter-Vorgabe
... ... @@ -1,1 +1,0 @@
1 -NONE
XWiki.WikiMacroParameterClass[7]
Parameter-Vorgabe
... ... @@ -1,1 +1,0 @@
1 -false
Parameter-Name
... ... @@ -1,1 +1,0 @@
1 -textWrap
Parameter-Beschreibung
... ... @@ -1,1 +1,0 @@
1 -Wrap text around the video. This applies only to left and right alignment.
Parameter-Typ
... ... @@ -1,1 +1,0 @@
1 -java.lang.Boolean
Parameter verpflichtend
... ... @@ -1,1 +1,0 @@
1 -Nein