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
add_infobox_classtable_class = true'infobox', -- ifThe true,base willclass addof the class 'infobox'
switchfo = false, -- switch infobox? or not?
switchfoattr = {}, -- switch data class changes
Line 184:
 
--[[
RemovesChanges the additionclass of the Infobox from 'infobox' classto something else
use before :create()
--]]
function Infobox:removeClassInfoboxsetClass(new_class)
if type(arg) == 'string' then
self.add_infobox_class = false
self.table_class = new_class
end
end
 
Line 279 ⟶ 281:
self.rtable = mw.html.create('table')
:addClass('plainlinks')
:addClass(table_class)
if self.add_infobox_class then
self.rtable:addClass('infobox')
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'..i] or box.args['appliesto'..i] then
table.insert(smwappliesto, mw.text.split(box.args['smwname'..i] or box.args['appliesto'..i], '¦'))
else
table.insert(smwappliesto, {label})
Line 1,137 ⟶ 1,138:
else
-- single version, check for appliesto
if box.args['smwname'] or box.args['appliesto'] then
box._smwSubobjectAppliesTo = {mw.text.split(box.args['smwname'] or box.args['appliesto'], '¦')}
end
end