Módulo:PetOutfitsVisualizer: mudanças entre as edições
Ir para navegação
Ir para pesquisar
Sem resumo de edição |
Sem resumo de edição |
||
| Linha 3: | Linha 3: | ||
function p.render(frame) | function p.render(frame) | ||
local outfitsStr = frame.args.outfits or "" | local outfitsStr = frame.args.outfits or "" | ||
local html | local container = mw.html.create('div') | ||
:addClass('pet-outfit-gallery') | |||
:css({ | |||
display = 'flex', | |||
flexWrap = 'wrap', | |||
gap = '5px' | |||
}) | |||
for outfitPair in outfitsStr:gmatch("[^;]+") do | for outfitPair in outfitsStr:gmatch("[^;]+") do | ||
local file, caption = outfitPair:match("^%s*(.-)%s*,%s*(.-)%s*$") | local file, caption = outfitPair:match("^%s*(.-)%s*,%s*(.-)%s*$") | ||
if file then | if file then | ||
local item = mw.html.create('div') | |||
:css({textAlign = 'center'}) | |||
:wikitext(string.format('[[File:%s|height=72px|%s]]', file, caption or file)) | |||
) | container:node(item) | ||
end | end | ||
end | end | ||
return tostring(container) | |||
return | |||
end | end | ||
return p | return p | ||
Edição das 19h10min de 16 de agosto de 2025
A documentação para este módulo pode ser criada em Módulo:PetOutfitsVisualizer/doc
local p = {}
function p.render(frame)
local outfitsStr = frame.args.outfits or ""
local container = mw.html.create('div')
:addClass('pet-outfit-gallery')
:css({
display = 'flex',
flexWrap = 'wrap',
gap = '5px'
})
for outfitPair in outfitsStr:gmatch("[^;]+") do
local file, caption = outfitPair:match("^%s*(.-)%s*,%s*(.-)%s*$")
if file then
local item = mw.html.create('div')
:css({textAlign = 'center'})
:wikitext(string.format('[[File:%s|height=72px|%s]]', file, caption or file))
container:node(item)
end
end
return tostring(container)
end
return p