Module:Multiple image: Difference between revisions

fix
m (1 revision imported)
(fix)
Line 26:
end
 
local function renderImageCell(image, width, height, link, alt, thumbtime, caption, textalign, istyle, border)
local root = mw.html.create('')
 
Line 34:
local thumbtimestr = ''
 
if widthstr == '|-nanpx' then
widthstr = ''
end
if isnotempty( thumbtime ) then
thumbtimestr = '|thumbtime=' .. thumbtime
Line 39 ⟶ 42:
 
local imagediv = root:tag('div')
imagediv:addClass((border ~= 'infobox') and 'thumbimage' or nil)
imagediv:cssText(istyle)
if( height ) then
Line 48 ⟶ 51:
if isnotempty(caption) then
local captiondiv = root:tag('div')
captiondiv:addClass((border ~= 'infobox') and 'thumbcaption' or nil)
if isnotempty(textalign) then
captiondiv:addClass('text-align-' .. textalign)
Line 229 ⟶ 232:
 
local div = root:tag('div')
div:addClass((border ~= 'infobox') and 'thumbinner multiimageinner' or 'multiimageinner')
div:css('width', tostring(bodywidth) .. 'px')
:css('max-width', tostring(bodywidth) .. 'px')
Line 270 ⟶ 273:
imagediv:wikitext(renderImageCell(img, w, heights[k],
pargs['link' .. i], pargs['alt' .. i],
pargs['thumbtime' .. i], pargs['caption' .. i], capalign, imgstyle, border))
end
end
Line 276 ⟶ 279:
-- add the footer
if( isnotempty(footer) ) then
local falign = string.lower(pargs['footer_align'] or args['footer_align'] or 'left')
falign = (falign == 'centre') and 'center' or falign
div:tag('div')
:addClass('trow')
:css('display', (falign ~= 'left') and 'flow-root' or 'flex')
:tag('div')
:addClass((border ~= 'infobox') and 'thumbcaption' or nil)
:css('text-align', (falign ~= 'left') and falign or nil)
:css('background-color', pargs['footer_background'])
:wikitext(footer)
Anonymous user