Změny dokumentu XCVID
Naposledy upravil David Brazda 08.04.2021 16:25
Popis verze:
Update document after refactoring.
Přehled
-
Na stránce změněno: (2 změněno, 0 přidáno, 0 odstraněno)
-
Objects (2 změněno, 1 přidáno, 1 odstraněno)
Rozpis
- Na stránce změněno:
-
- Nadpis
-
... ... @@ -1,1 +1,1 @@ 1 -Macro 1 +Macro-xcvid - Obsah
-
... ... @@ -1,7 +1,8 @@ 1 -Macro pro xcvid 1 +**Macro pro xcvid** 2 2 3 -{{xcvid url="sd sfsdfdsf"/}}3 +~{~{xcvid url="https:~/~/xcvid.com/embed.php?flight=2368351#1313"/}} 4 4 5 +{{xcvid url="https://www.xcontest.org/cesko/prelety/detail:davidbrazda/29.1.2021/16:27"/}} 5 5 6 6 7 7
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -3,12 +3,10 @@ 3 3 #set($width = $xcontext.macro.params.get('width')) 4 4 #set($height = $xcontext.macro.params.get('height')) 5 5 #set($flight = $xcontext.macro.params.get('flight')) 6 -#if ($flight == 'nic') 7 - $xcontext.macro.params.set('flight') = 'neco'; 8 - $xcontext.macro.params.flight = 'neco'; 9 -#end 10 - 6 +#set ($discard = $xwiki.jsx.use('BackEnd.Macro-xcvid')) 7 +##set( $xcvidurl = $url.replaceAll('/^https:\/\/www.xcontest.org\/[\w\/]+:([-\w.]+\/\d\d?\.\d\d?\.\d{4}\/\d\d:\d\d)($|\?|#)/', '$2') ) 8 +##set( $xcvidurl = $regextool.find($url, "(?=http*).*\/(.*)|(.*?)\/") ) 11 11 {{html}} 12 -v ysledekje $xcontext.macro.params.flight10 + <iframe onLoad="var match = /^https:\/\/www.xcontest.org\/[\w\/]+:([-\w.]+\/\d\d?\.\d\d?\.\d{4}\/\d\d:\d\d)($|\?|#)/.exec(url); this.src='https://xcvid.com/embed.php?ident=' + match[1];" id="xcvid" width="$!{escapetool.html($width)}" height="$!{escapetool.xml($height)}">$xcontext.macro.content</iframe> 13 13 {{/html}} 14 14 {{/velocity}} - Macro visibility
-
... ... @@ -1,1 +1,1 @@ 1 - Global1 +Current Wiki
- XWiki.WikiMacroParameterClass[0]
-
- Parameter description
-
... ... @@ -1,1 +1,9 @@ 1 -XContest link of the flight ([[https:~~/~~/www.xcontest.org/cesko/prelety/detail:davidbrazda/29.1.2021/16:27>>https://www.xcontest.org/cesko/prelety/detail:davidbrazda/29.1.2021/16:27]]) 1 +Poslední část linku z xcontestu za dvojtečkou např. davidbrazda/29.1.2021/16:27 2 + 3 +(% id="gtx-trans" style="position: absolute; left: 374px; top: 39px;" %) 4 +((( 5 +(% class="gtx-trans-icon" %) 6 +((( 7 + 8 +))) 9 +)))
- XWiki.WikiMacroParameterClass[3]
-
- Parameter default value
-
... ... @@ -1,1 +1,0 @@ 1 -nic - Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -ID of the flight - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -0 - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -flight
- XWiki.JavaScriptExtension[0]
-
- Způsob práce s cache
-
... ... @@ -1,0 +1,1 @@ 1 +long - Kód
-
... ... @@ -1,0 +1,4 @@ 1 +function getAddress(url) { 2 + const match = /^https:\/\/www.xcontest.org\/[\w\/]+:([-\w.]+\/\d\d?\.\d\d?\.\d{4}\/\d\d:\d\d)($|\?|#)/.exec(url); 3 + return 'https://xcvid.com/embed.php?ident=' + match[1]; 4 +} - Jméno
-
... ... @@ -1,0 +1,1 @@ 1 +jsext - Zpracuj obsah
-
... ... @@ -1,0 +1,1 @@ 1 +Ne - Použij tuto příponu
-
... ... @@ -1,0 +1,1 @@ 1 +always