Jump to content

Module:Sandbox/ChaoticShadow/InfoboxBuilder: Difference between revisions

rename variables
No edit summary
(rename variables)
Line 24:
{ name = 'text color' }
},
paramnamesparam_names = { 'bg color', 'text color' },
argsraw_args = {},
final_argsproc_args = {},
proto_infobox = {},
infobox = mw.html.create('table'):addClass('infobox'),
finished = false
Line 134 ⟶ 133:
end
local raw_param_value = self.argsraw_args[param]
local colors = color_table[raw_param_value]
Line 165 ⟶ 164:
error("name must not be nil or empty")
end
if self.paramnamesparam_names[v.name] then
error("name cannot be duplicate")
end
Line 174 ⟶ 173:
default = v.default
}
table.insert(self.paramnamesparam_names, v.name)
end
Line 188 ⟶ 187:
for k,v in pairs(args) do
if v ~= '' then
self.argsraw_args[k] = v
end
end
if self.argsraw_args['bg color'] then
self:setHeaderBackgroundColor(self.argsraw_args['bg color'])
end
if self.argsraw_args['text color'] then
self:setHeaderTextColor(self.argsraw_args['text color'])
end
Line 212 ⟶ 211:
end
if self.final_argsproc_args[param] then
return self.final_argsproc_args[param]
end
Line 223 ⟶ 222:
end
local raw_param_value = self.argsraw_args[param] or current_param.default
if raw_param_value == nil then
Line 237 ⟶ 236:
end
self.final_argsproc_args[param] = content
return content
439

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.