Module:Sandbox/ChaoticShadow/InfoboxBuilder: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 135: | Line 135: | ||
error("name cannot be duplicaate") |
error("name cannot be duplicaate") |
||
end |
end |
||
if type(v.func) ~= 'function' and |
|||
type(v.func) ~= 'table' and |
|||
type(v.func) ~= 'string' |
|||
then |
|||
error("func must be of type \"function\", \"table\", or \"string\"") |
|||
end |
|||
self.params[v.name] = { |
self.params[v.name] = { |
||
Line 193: | Line 187: | ||
elseif argparams['type'] == 'table' then |
elseif argparams['type'] == 'table' then |
||
content = self.params[param].func[arg] |
content = self.params[param].func[arg] |
||
else |
|||
elseif argparams['type'] == 'string' then |
|||
content = arg |
content = arg |
||
end |
end |
||
Line 354: | Line 348: | ||
local links = { |
local links = { |
||
"[[Template:%s|View]]", |
"[[Template:%s|<span style=\"color: %s;\">View</span>]]", |
||
"[[Template talk:%s|Talk]]" |
"[[Template talk:%s|<span style=\"color: %s;\">Talk</span>]]" |
||
} |
} |
||
self:addHeader{ |
self:addHeader{ |
||
tag = 'th', |
tag = 'th', |
||
content = |
content = |
||
⚫ | |||
" • " .. |
.. " • " .. |
||
⚫ | |||
string.format(links[2], self.name, self.headerColors.text) |
|||
} |
} |
||
end |
end |