Jump to content

Module:Sidebar: Difference between revisions

fix
breaking more wikis
Line 47: Line 47:
--[[
--[[
Finds whether a sidebar has a subgroup sidebar.
Finds whether a sidebar has a subgroup sidebar.
TODO: Remove support for legacy class name
]]
]]
local function hasSubgroup(s)
local function hasSubgroup(s)
if mw.ustring.find(s, cfg.i18n.pattern.subgroup) or
if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then
mw.ustring.find(s, 'vertical%-navbox%-subgroup') then
return true
return true
else
else
Line 77: Line 74:
-- force collapsibleclass to be sidebar-collapse otherwise output nothing
-- force collapsibleclass to be sidebar-collapse otherwise output nothing
:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
:addClass('vertical-navbox') -- legacy class, TODO: Remove after migrating users
:addClass('nomobile')
:addClass('nomobile')
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
Line 256: Line 252:
end
end
local sidebar_templatestyles = mw.getCurrentFrame():extensionTag{
local base_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = cfg.i18n.templatestyles }
name = 'templatestyles', args = { src = cfg.i18n.templatestyles }
}
}
Line 262: Line 258:
local templatestyles = ''
local templatestyles = ''
if args['templatestyles'] and args['templatestyles'] ~= '' then
if args['templatestyles'] and args['templatestyles'] ~= '' then
templatestyles = mw.getCurrentFrame():extensionTag{
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
name = 'templatestyles', args = { src = args['templatestyles'] }
}
}
Line 269: Line 265:
local child_templatestyles = ''
local child_templatestyles = ''
if args['child templatestyles'] and args['child templatestyles'] ~= '' then
if args['child templatestyles'] and args['child templatestyles'] ~= '' then
child_templatestyles = mw.getCurrentFrame():extensionTag{
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
}
Line 276: Line 272:
local grandchild_templatestyles = ''
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then
if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then
grandchild_templatestyles = mw.getCurrentFrame():extensionTag{
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
}
Line 282: Line 278:


return table.concat({
return table.concat({
sidebar_templatestyles,
base_templatestyles,
templatestyles,
templatestyles,
child_templatestyles,
child_templatestyles,