Module:ImageSequence: Difference between revisions
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
function p.render(frame) | function p.render(frame) | ||
local args = frame:getParent().args | local args = frame:getParent().args | ||
local size = args["size"] | local size = args["size"] or "200px" | ||
local output = "" | local output = "" | ||
local outer_div_style = string.format(' style="width:%s;"', size) | |||
output = output .. '<div class="outer-container"' .. outer_div_style .. '>\n<div class="image-sequence">\n' | |||
output = output .. '<div class=" | |||
local index = 1 | local index = 1 | ||
| Line 20: | Line 19: | ||
local imageName = args[paramName] | local imageName = args[paramName] | ||
if not imageName then | if not imageName then | ||
break | break | ||
end | end | ||
output = output .. string.format('[[File:%s|thumb|%s]]\n', imageName, size) | |||
index = index + 1 | index = index + 1 | ||
end | end | ||
output = output .. '</div>\n</div>' | |||
output = output .. '</div></div>' | |||
return output | return output | ||
Revision as of 00:48, 23 November 2025
Documentation for this module may be created at Module:ImageSequence/doc
local p = {}
function p.render(frame)
local args = frame:getParent().args
local size = args["size"] or "200px"
local output = ""
local outer_div_style = string.format(' style="width:%s;"', size)
output = output .. '<div class="outer-container"' .. outer_div_style .. '>\n<div class="image-sequence">\n'
local index = 1
while true do
local paramName
if index == 1 then
paramName = "image"
else
paramName = "image" .. index
end
local imageName = args[paramName]
if not imageName then
break
end
output = output .. string.format('[[File:%s|thumb|%s]]\n', imageName, size)
index = index + 1
end
output = output .. '</div>\n</div>'
return output
end
return p