17,101
edits
No edit summary Tag: Manual revert |
(Use inline-flex instead of inline-block; reverse order of amount & image for _Currency) |
||
Line 789: | Line 789: | ||
if menu then | if menu then | ||
return '{| class="articletable" style="display:inline- | return '{| class="articletable" style="display:inline-flex;vertical-align:middle;"\r\n|-\r\n|' .. expIcon .. resultText .. '\r\n|}' | ||
elseif not noicon and not nospan then | elseif not noicon and not nospan then | ||
return '<span style="display:inline- | return '<span style="display:inline-flex">' .. expIcon .. resultText .. '</span>' | ||
else | else | ||
return resultText | return resultText | ||
Line 810: | Line 810: | ||
result = result.." Level "..level | result = result.." Level "..level | ||
result = '<span style="display:inline- | result = '<span style="display:inline-flex">'..result..'</span>' | ||
return result | return result | ||
end | end | ||
Line 837: | Line 837: | ||
result = result..p.Icon({linkname, img=iconname, type='item', notext=true, nospan=true, alt=altTextItem})..p.Icon({'Mastery', notext=true, nospan=true, alt=altTextMastery}) | result = result..p.Icon({linkname, img=iconname, type='item', notext=true, nospan=true, alt=altTextItem})..p.Icon({'Mastery', notext=true, nospan=true, alt=altTextMastery}) | ||
if showText then result = result..'[['..linkname..']] [[Mastery]]' end | if showText then result = result..'[['..linkname..']] [[Mastery]]' end | ||
result = '<span style="display:inline- | result = '<span style="display:inline-flex">'..result..'</span>' | ||
return result | return result | ||
end | end | ||
Line 851: | Line 851: | ||
function p._Currency(fileName, link, altText, amount, maxAmount) | function p._Currency(fileName, link, altText, amount, maxAmount) | ||
local ret = {} | local ret = {} | ||
table.insert(ret, '<span style="display:inline- | table.insert(ret, '<span style="display:inline-flex">') | ||
local sep = '' | |||
-- Currency amounts | -- Currency amounts | ||
if tonumber(amount) ~= nil then | if tonumber(amount) ~= nil then | ||
sep = ' ' | |||
local function numColour(amount) | local function numColour(amount) | ||
if tonumber(amount) < 0 then | if tonumber(amount) < 0 then | ||
Line 869: | Line 863: | ||
end | end | ||
end | end | ||
table.insert(ret, | table.insert(ret, numColour(amount)) | ||
if (tonumber(maxAmount) ~= nil and maxAmount > amount) then | if (tonumber(maxAmount) ~= nil and maxAmount > amount) then | ||
table.insert(ret, ' - ' .. numColour(maxAmount)) | table.insert(ret, ' - ' .. numColour(maxAmount)) | ||
end | end | ||
end | |||
-- Currency icon | |||
if fileName ~= nil then | |||
table.insert(ret, sep .. '[[File:' .. fileName .. '|25px') | |||
if link ~= nil then | |||
table.insert(ret, '|link=' .. link) | |||
end | |||
table.insert(ret, '|alt=' .. ((altText == nil and '') or altText) .. ']]') | |||
end | end | ||
table.insert(ret, '</span>') | table.insert(ret, '</span>') |