User talk:Lucario: Difference between revisions

Jump to navigation Jump to search
m
mNo edit summary
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Exploring ways to deprecate the parameters in [[Template:VideoGallery]] ==
What am I trying to accomplish?
<pre>
{{VideoGallery|
https://www.youtube.com/watch?v=wjzv0KtDXOA Xenoblade JP 1 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=tJtCp8rPXWg Xenoblade PAL 1 [Dolphin Emulator @ 1080p]
http://www.dailymotion.com/video/x1k9hnl Cocoto Platform Jumper HD on Dolphin Emulator (Widescreen Hack) part1
https://www.youtube.com/watch?v=_VLNa9PKT0Y Xenoblade PAL 2 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=dp3QnvFn_Hc Xenoblade PAL 3 (Dolphin Emulator @ 720p)
}}
</pre>
... to produce the familiar layout & random video logic the VideoGallery has been doing.
Remaining issues: list bullets look weird and wonky random logic
{{#vardefine:tl_vg_videocount|{{#vardefineecho:tl_vg_currentvideo|{{#expr:{{#regex:https://www.youtube.com/watch?v=wjzv0KtDXOA Xenoblade JP 1 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=tJtCp8rPXWg Xenoblade PAL 1 [Dolphin Emulator @ 1080p]
http://www.dailymotion.com/video/x1k9hnl Cocoto Platform Jumper HD on Dolphin Emulator (Widescreen Hack) part1
https://www.youtube.com/watch?v=_VLNa9PKT0Y Xenoblade PAL 2 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=dp3QnvFn_Hc Xenoblade PAL 3 (Dolphin Emulator @ 720p)|/(.+)/|+1}}}}}}}}
{{#while:|{{#ifeq:{{#var:tl_vg_currentvideo}}|0||yo}}|{{#vardefine:server{{#var:tl_vg_currentvideo}}|{{#regex:videolist
https://www.youtube.com/watch?v=wjzv0KtDXOA Xenoblade JP 1 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=tJtCp8rPXWg Xenoblade PAL 1 [Dolphin Emulator @ 1080p]
http://www.dailymotion.com/video/x1k9hnl Cocoto Platform Jumper HD on Dolphin Emulator (Widescreen Hack) part1
https://www.youtube.com/watch?v=_VLNa9PKT0Y Xenoblade PAL 2 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=dp3QnvFn_Hc Xenoblade PAL 3 (Dolphin Emulator @ 720p)|/videolist(\n.*){1,{{#var:tl_vg_currentvideo}}}\n(((?!\s).)+(\/{{!}}=))([\s\S]*)/|$2}}}}
{{#vardefine:video{{#var:tl_vg_currentvideo}}|{{#regex:videolist
https://www.youtube.com/watch?v=wjzv0KtDXOA Xenoblade JP 1 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=tJtCp8rPXWg Xenoblade PAL 1 [Dolphin Emulator @ 1080p]
http://www.dailymotion.com/video/x1k9hnl Cocoto Platform Jumper HD on Dolphin Emulator (Widescreen Hack) part1
https://www.youtube.com/watch?v=_VLNa9PKT0Y Xenoblade PAL 2 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=dp3QnvFn_Hc Xenoblade PAL 3 (Dolphin Emulator @ 720p)|/videolist(\n.*){1,{{#var:tl_vg_currentvideo}}}\n(((?!\s).)+(\/{{!}}=))(.*?) ([\s\S]*)/|$5}}}}
{{#vardefine:caption{{#var:tl_vg_currentvideo}}|{{#regex:videolist
https://www.youtube.com/watch?v=wjzv0KtDXOA Xenoblade JP 1 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=tJtCp8rPXWg Xenoblade PAL 1 [Dolphin Emulator @ 1080p]
http://www.dailymotion.com/video/x1k9hnl Cocoto Platform Jumper HD on Dolphin Emulator (Widescreen Hack) part1
https://www.youtube.com/watch?v=_VLNa9PKT0Y Xenoblade PAL 2 (Dolphin Emulator @ 720p)
https://www.youtube.com/watch?v=dp3QnvFn_Hc Xenoblade PAL 3 (Dolphin Emulator @ 720p)|/videolist(\n.*){1,{{#var:tl_vg_currentvideo}}}\n(.+?) (.*)([\s\S]*)/|{{#vardefine:tl_vg_currentvideo|{{#expr:{{#var:tl_vg_currentvideo}}-1}}}}$3}}}}}}
{{#vardefine:tl_vg_luckyvideos|3}}
{{#while:|{{#ifeq:{{#var:tl_vg_luckyvideos}}|0||lucky!}}|{{#vardefine:tl_vg_luckyvideo|{{#expr:{{Mod|{{CURRENTTIMESTAMP}}+({{#vardefineecho:tl_vg_luckyvideos|{{#expr:{{#var:tl_vg_luckyvideos}}-1}}}}*{{NUMBEROFPAGES:R}})|{{#var:tl_vg_videocount}}}}+1}}}}<div style="float:left; margin: .5em 0 1.3em 1.4em;">{{#ev:{{#regex:{{#var:server{{#var:tl_vg_luckyvideo}}}}|/.*(youtube{{!}}dailymotion).*/|$1}}|{{#var:video{{#var:tl_vg_luckyvideo}}}}|302||<span style="text-overflow: ellipsis; display: inline-block; width: 275px; white-space: nowrap; overflow: hidden; vertical-align: top;" title="{{#var:caption{{#var:tl_vg_luckyvideo}}}}">[{{#var:server{{#var:tl_vg_luckyvideo}}}}{{#var:video{{#var:tl_vg_luckyvideo}}}} {{#tag:nowiki|{{#var:caption{{#var:tl_vg_luckyvideo}}}}}}]</span>|frame}}</div>{{#vardefine:video{{#var:tl_vg_luckyvideo}}|}}}}
<div style="clear:left"></div>
{{#vardefine:tl_vg_videocount|{{#expr:{{#var:tl_vg_videocount}}+1}}}}
{{#while:|{{#ifeq:{{#var:tl_vg_videocount}}|0||dang!}}|{{#if:{{#var:video{{#vardefineecho:tl_vg_videocount|{{#expr:{{#var:tl_vg_videocount}}-1}}}}}}|{{#tag:li|[{{#var:server{{#var:tl_vg_videocount}}}}{{#var:video{{#var:tl_vg_videocount}}}}{{#tag:nowiki|{{#var:caption{{#var:tl_vg_videocount}}}}}}]}}|}}}}
=== Currenttimestamp? ===
=== Currenttimestamp? ===
As far as I can see, the CURRENTTIMESTAMP template (i.e. {{CURRENTTIMESTAMP}}) doesn't update per page refresh, it seems to stay stuck at the point when the last edit occurred or the cache page was generated. So I'm not sure it can be used to generate the random value. I think we had determined that some JavaScript is needed to either handle the random selection, or minimally generate an actual random value here. BTW, a parameterless version of things would be nicer, even if it can't handle the random selection. [[User:Kolano|Kolano]] ([[User talk:Kolano|talk]]) 08:42, 27 January 2018 (CET)
As far as I can see, the CURRENTTIMESTAMP template (i.e. {{CURRENTTIMESTAMP}}) doesn't update per page refresh, it seems to stay stuck at the point when the last edit occurred or the cache page was generated. So I'm not sure it can be used to generate the random value. I think we had determined that some JavaScript is needed to either handle the random selection, or minimally generate an actual random value here. BTW, a parameterless version of things would be nicer, even if it can't handle the random selection. [[User:Kolano|Kolano]] ([[User talk:Kolano|talk]]) 08:42, 27 January 2018 (CET)
6,576

edits

Navigation menu