Module:Infobox: Difference between revisions
Simplify the table_class param
(Slowly starting a bit of cleanup) |
(Simplify the table_class param) |
||
Line 149:
paramnames = {}, -- parameter names
dupeable = {}, -- parameters that are allowed to have duplicated switch data
switchfo = false, -- switch infobox? or not?
switchfoattr = {}, -- switch data class changes
Line 184:
--[[
use before :create()
--]]
function Infobox:
if type(arg) == 'string' then
self.table_class = new_class
end▼
end
Line 279 ⟶ 281:
self.rtable = mw.html.create('table')
:addClass('plainlinks')
:addClass(table_class)
▲ end
-- Add necessary class if switch infobox
if self.switchfo then
Line 290:
-- Defines an infobox name ({{Template:arg}})
-- Used to create a link at the bottom of pages and for css
function Infobox:defineName(arg)
self.infoboxname = arg
Line 1,097:
-- Sees if this needs to be a switch infobox
-- Returns extra version count (even if already run)
-- Sets the smw subobject names from version or smwname
--]]
function Infobox.maxVersion(box)
Line 1,120 ⟶ 1,121:
-- add to appliesto
if box.args['smwname
table.insert(smwappliesto, mw.text.split(box.args['smwname
else
table.insert(smwappliesto, {label})
Line 1,137 ⟶ 1,138:
else
-- single version, check for appliesto
if box.args['smwname
box._smwSubobjectAppliesTo = {mw.text.split(box.args['smwname
end
end
|