Module:Infobox: Difference between revisions

No edit summary
No edit summary
Line 22: Line 22:
args.image1size = args.image1size or args.imagesize
args.image1size = args.image1size or args.imagesize
args.image1class = args.image1class or args.imageclass
args.image1class = args.image1class or args.imageclass
args.image1caption = args.image1caption or args.imagecaption or ''
args.invimage1 = args.invimage1 or args.invimage or 'none'
args.invimage1 = args.invimage1 or args.invimage or 'none'
args.group1 = args.group1 or args.group
args.group1 = args.group1 or args.group
args.group1size = args.group1size or args.groupsize
args.group1size = args.group1size or args.groupsize
args.group1class = args.group1class or args.groupclass
args.group1class = args.group1class or args.groupclass
args.group1caption = args.group1caption or args.groupcaption or ''
local imgCount = {}
local imgCount = {}
Line 65: Line 67:
local groupSize = args['group' .. v .. 'size'] or defaultImageSize
local groupSize = args['group' .. v .. 'size'] or defaultImageSize
local groupClass = args['group' .. v .. 'class'] or defaultImageClass
local groupClass = args['group' .. v .. 'class'] or defaultImageClass
local groupCaption = args['group' .. v .. 'caption'] or ''
local groupImages = {}
local groupImages = {}
Line 72: Line 75:
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
local caption = args[v .. '-' .. w .. 'caption'] or ''
if string.match( image, 'UNIQ%-%-gallery%-' ) then
if string.match( image, 'UNIQ%-%-gallery%-' ) then
Line 86: Line 90:
end
end
table.insert( groupImages, '<div>' .. image .. '</div>' )
if caption ~= '' then
caption = '<div class="infobox-imagecaption">' .. caption .. '</div>'
end
table.insert( groupImages, '<div>' .. image .. caption .. '</div>' )
end
if groupCaption ~= '' then
groupCaption = '<div class="infobox-imagecaption">' .. groupCaption .. '</div>'
end
end
table.insert( tabber, '|-|' .. group .. '=\n' .. table.concat( groupImages, '\n' ) )
table.insert( tabber, '|-|' .. group .. '=\n' .. table.concat( groupImages, '\n' ) .. groupCaption )
end
end
table.insert( images, '<div>' .. f:extensionTag( 'tabber', table.concat( tabber, '\n' ) ) .. '</div>' )
table.insert( images, '<div>' .. f:extensionTag( 'tabber', table.concat( tabber, '\n' ) ) .. '</div>' )
Line 99: Line 111:
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
local caption = args['image' .. v .. 'caption'] or ''
if image == 'title' then
if image == 'title' then
Line 129: Line 142:
end
end
table.insert( images, '<div>' .. image .. '</div>' )
if caption ~= '' then
caption = '<div class="infobox-imagecaption">' .. caption .. '</div>'
end
table.insert( images, '<div>' .. image .. caption .. '</div>' )
end
end