Module:RoleInfobox: Difference between revisions

Content deleted Content added
mNo edit summary
m Updated MainImage width
 
(2 intermediate revisions by the same user not shown)
Line 1:
local Infobox = {}
local HF = require('Module:HF')
 
function Infobox.trimTable ( trimTable )▼
output = {}▼
for i, value in ipairs(trimTable) do▼
output[i] = HF.trim(value)▼
end▼
return output▼
end▼
 
function Infobox.MainImage( field, vars )
local output = field.Value
if not HF.isempty(output) then
output = '[[File:' .. output .. '|250px306px]]'
return output
end
Line 15 ⟶ 23:
local ships = HF.explode(';', field.Value)
 
ships = Infobox.trimTable(ships)
table.sort(ships)
 
Line 35 ⟶ 43:
local upgrades = HF.explode(';', field.Value)
 
upgrades = Infobox.trimTable(upgrades)
table.sort(upgrades)
 
Line 48 ⟶ 56:
return output
end
▲end
 
▲function Infobox.trimTable ( trimTable )
▲ output = {}
▲ for i, value in ipairs(trimTable) do
▲ output[i] = HF.trim(value)
▲ end
▲ return output
end