Module:Infobox: Difference between revisions
Barebones functional infobox module, WIP
(WIP) |
(Barebones functional infobox module, WIP) |
||
Line 215:
self.switch_datatable:tag('span'):wikitext('Default version: '..self.default_version)
end
return self
end
Line 268 ⟶ 269:
end
-- Let's build the datatable
-- Prepend
local name = content.param_name
if content.property == 'args_raw' then
name = '
end
if content.property == 'args_smw' then
name = '
end
data_param = self.switch_datatable:tag('span'):attr('data-attr-param', name)
Line 330 ⟶ 331:
end
local content = Infobox:get_param(v.content, self.default_version)▼
▲ content = Infobox:get_param(v.content, self.default_version)
if content == nil then
content = edit
Line 342 ⟶ 338:
-- Add the switch data if multiple values exist
data_attr_param = self:add_switch_data(v.content)
if data_attr_param then
_cell:attr('data-attr-param', data_attr_param)
Line 358 ⟶ 354:
-- Override tostring
function Infobox:tostring()
error_text = ''
if #self.errors > 0 then
Line 376 ⟶ 367:
function Infobox:dump()
mw.log(mw.dumpObject(self))
mw.log(tostring(self))
end
|