13,398
edits
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
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, w, h) | ||
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', w .. 'px') | |||
:css('height', h .. 'px') | |||
:css('margin-left', 'auto') | |||
:css('margin-right', 'auto') | |||
:wikitext(mw.ustring.format('[[File:%s|%dx%dpx%s|%s]]', | |||
img, w, h, alt .. link .. border, text)) | |||
cell:tag('div') | |||
:css('padding', '1px') | |||
:wikitext(c) | |||
end | |||
return tostring(cell) | |||
end | end | ||
edits