13,400
edits
m (1 revision imported) |
No edit summary Tag: Reverted |
||
Line 7: | Line 7: | ||
end | end | ||
local function renderArrayCell( img, c, a, b, l, tc, t, | local function renderArrayCell(img, c, a, b, l, tc, t, width, height) | ||
local alt = isnotempty(a) and ('|alt=' .. a) or '' | |||
local link = isnotempty(l) and ('|link=' .. l) or '' | |||
local text = (isnotempty(tc) and not isnotempty(t)) and mw.text.unstrip(c) or mw.text.unstrip(t or '') | |||
local border = isnotempty(b) and '|border' or '' | |||
local cell = mw.html.create('') | |||
if (img) then | |||
cell:tag('div') | |||
:css('display', 'table-cell') | |||
:css('vertical-align', 'middle') | |||
:css('width', width .. 'px') -- Set the same width for all images | |||
:css('height', height .. 'px') -- Set the same height for all images | |||
:css('margin-left', 'auto') | |||
:css('margin-right', 'auto') | |||
:wikitext(mw.ustring.format('[[File:%s|%dx%dpx%s|%s]]', img, width, height, alt .. link .. border, text)) | |||
cell:tag('div') | |||
:css('padding', '1px') | |||
:wikitext(c) | |||
end | |||
return tostring(cell) | |||
end | end | ||
local function imagearray( frame ) | local function imagearray( frame ) |
edits