Module:Multiple image: Difference between revisions

sync change to alignment/footer code, per tper
m (1 revision imported)
(sync change to alignment/footer code, per tper)
Line 7:
local function isnotempty(s)
return s and s:match( '^%s*(.-)%s*$' ) ~= ''
end
 
local function removepx(s)
return tostring(s or ''):match('^(.*)[Pp][Xx]%s*$') or s
end
 
Line 89 ⟶ 93:
local pargs = frame:getParent().args
local args = frame.args
local width = removepx(pargs['width'] or '')
local dir = pargs['direction'] or ''
local border = pargs['border'] or args['border'] or ''
local align = pargs['align'] or args['align'] or (border == 'infobox' and 'center' or '')
local capalign = pargs['caption_align'] or args['caption_align'] or ''
local totalwidth = removepx(pargs['total_width'] or args['total_width'] or '')
local imgstyle = pargs['image_style'] or args['image_style']
local header = pargs['header'] or pargs['title'] or ''
Line 240 ⟶ 244:
:tag('div')
:addClass('theader')
:css('text-align', pargs['header_align'] or 'center')
:css('background-color', pargs['header_background'] or 'transparent')
:wikitext(header)
end
Line 276 ⟶ 280:
div:tag('div')
:addClass('trow')
:css('display', (falign ~= 'left') and 'flow-root' or 'flex')
:tag('div')
:addClass('thumbcaption' .. (falign == 'center' and '-center' or ''))
:css('text-align', (falign ~= 'left') and falign or nil)
:css('background-color', pargs['footer_background'] or 'transparent')
:wikitext(footer)
end