13,398
edits
No edit summary Tag: Reverted |
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) | ||
local alt = isnotempty(a) and ('|alt=' .. a) or '' | local alt = isnotempty(a) and ('|alt=' .. a) or '' | ||
local link = isnotempty(l) and ('|link=' .. l) 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 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 border = isnotempty(b) and '|border' or '' | ||
local cell = mw.html.create('') | local cell = mw.html.create('') | ||
if | if img then | ||
cell:tag('div') | cell:tag('div') | ||
:css('display', 'table-cell') | :css('display', 'table-cell') | ||
:css('vertical-align', 'middle') | :css('vertical-align', 'middle') | ||
:css('width', | :css('width', '140px') -- Set the fixed width | ||
:css('height', | :css('height', '140px') -- Set the fixed height | ||
:css('margin | :css('margin', 'auto') | ||
:wikitext(mw.ustring.format('[[File:%s|140x140px%s|%s]]', img, alt .. link .. border, text)) | |||
:wikitext(mw.ustring.format('[[File:%s| | |||
cell:tag('div') | cell:tag('div') | ||
:css('padding', '1px') | :css('padding', '1px') | ||
Line 30: | Line 29: | ||
return tostring(cell) | return tostring(cell) | ||
end | end | ||
local function imagearray( frame ) | local function imagearray( frame ) |
edits