Module:Sidebar: Difference between revisions

m
1 revision imported: timelines
m (1 revision imported: Templates)
m (1 revision imported: timelines)
 
(5 intermediate revisions by 3 users not shown)
Line 19:
else
return s
end
end
 
local function hasSubgroup(s)
if mw.ustring.find(s, 'vertical%-navbox%-subgroup') then
return true
else
return false
end
end
Line 29 ⟶ 37:
local child = args.child and mw.text.trim(args.child) == 'yes'
 
root = root:tag('table')
if not child then
root = root
:tag('table')
:addClass('vertical-navbox')
:addClass(args.wraplinks ~= 'true' and 'nowraplinks' or nil)
Line 39 ⟶ 47:
:css('width', args.width or '22.0em')
:css('margin', args.float == 'left' and '0 1.0em 1.0em 0' or '0 0 1.0em 1.0em')
:css('background', '#f9f9f9f8f9fa')
:css('border', '1px solid #aaa')
:css('padding', '0.2em')
Line 90 ⟶ 98:
:wikitext(args.pretitle)
end
else
 
root
:addClass('vertical-navbox-subgroup')
:css('width', '100%')
:css('margin', '0px')
:css('border-spacing', '0px')
:addClass(args.bodyclass or args.class)
:cssText(args.bodystyle or args.style)
end
 
Line 97 ⟶ 112:
root
:wikitext(args.title)
:wikitext('</th></tr>') -- @todo replace this with unclosed again once mw.html gets it
else
root
Line 179 ⟶ 193:
:tag('td')
:addClass(args.contentclass)
:css('padding', hasSubgroup(content) and '0.1em 0 0.2em' or '0 0.1em 0.4em')
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
Line 218 ⟶ 232:
end
 
return tostring(root) .. (child and '[[Category:Pages using sidebar with the child parameter]]' or '')
end