Module:Infobox: Difference between revisions

No edit summary
Tag: Reverted
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 67: Line 67:
for _, w in ipairs( groupImgList['group' .. v] ) do
for _, w in ipairs( groupImgList['group' .. v] ) do
local image = args[v .. '-' .. w]
local image = args[v .. '-' .. w]
image = string.gsub(string.gsub(image, "^[Ff][Ii][Ll][Ee]:", ""), "^[Ii][Mm][Aa][Gg][Ee]:", "")
local size = args[v .. '-' .. w .. 'size'] or groupSize
local size = args[v .. '-' .. w .. 'size'] or groupSize
local class = args[v .. '-' .. w .. 'class'] or groupClass
local class = args[v .. '-' .. w .. 'class'] or groupClass
Line 94: Line 95:
for k, v in ipairs( imgCount ) do
for k, v in ipairs( imgCount ) do
local image = args['image' .. v]
local image = args['image' .. v]
image = string.gsub(string.gsub(image, "^[Ff][Ii][Ll][Ee]:", ""), "^[Ii][Mm][Aa][Gg][Ee]:", "")
local size = args['image' .. v .. 'size'] or defaultImageSize
local size = args['image' .. v .. 'size'] or defaultImageSize
local class = args['image' .. v .. 'class'] or defaultImageClass
local class = args['image' .. v .. 'class'] or defaultImageClass
Line 145: Line 147:
end
end
headerArea = imageArea .. extraText
headerArea = imageArea.. '' ..extraText
local footer = args.footer
local footer = args.footer
if footer then
if footer then
Line 155: Line 157:
local html = {
local html = {
'<div class="infobox">',
'<div class="infobox">',
'<div class="infobox-title">' .. title .. '</div>',
'<div class="infobox-title">' .. title .. '</div>',
headerArea,
headerArea,
'{| class="infobox-rows" cellspacing="1" cellpadding="4"',
'{| class="infobox-rows" cellspacing="1" cellpadding="4"',
'|-',
'|-',
args.rows or '',
args.rows or '',
footer or '',
footer or '',
'|}',
'|}',
'</div>',
'</div>'
f:callParserFunction( '#tag', { 'pre', class = 'history-json noexcerpt navigation-not-searchable',
}
mw.text.jsonEncode( json, mw.text.JSON_PRETTY )
 
} )
return table.concat( html, '\n' )
}
return table.concat( html, '\n' )
end
end


return p
return p