Zum Inhalt springen

Modul:Sidebar: Unterschied zwischen den Versionen

update from sandbox per discussion on talk page
(update from sandbox per discussion on talk page)
Zeile 19: Zeile 19:
else
else
return s
return s
end
end
local function hasSubgroup(s)
if mw.ustring.find(s, 'vertical%-navbox%-subgroup') then
return true
else
return false
end
end
end
end
Zeile 29: Zeile 37:
local child = args.child and mw.text.trim(args.child) == 'yes'
local child = args.child and mw.text.trim(args.child) == 'yes'


root = root:tag('table')
if not child then
if not child then
root = root
root  
:tag('table')
:addClass('vertical-navbox')
:addClass('vertical-navbox')
:addClass(args.wraplinks ~= 'true' and 'nowraplinks' or nil)
:addClass(args.wraplinks ~= 'true' and 'nowraplinks' or nil)
Zeile 90: Zeile 98:
:wikitext(args.pretitle)
:wikitext(args.pretitle)
end
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
end


Zeile 97: Zeile 112:
root
root
:wikitext(args.title)
:wikitext(args.title)
:wikitext('</th></tr>') -- @todo replace this with unclosed again once mw.html gets it
else
else
root
root
Zeile 179: Zeile 193:
:tag('td')
:tag('td')
:addClass(args.contentclass)
:addClass(args.contentclass)
:css('padding', '0 0.1em 0.4em')
:css('padding', hasSubgroup(content) and '0.1em 0 0.2em' or '0 0.1em 0.4em')
:cssText(args.contentstyle)
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
:cssText(args['content' .. num .. 'style'])
Anonymer Benutzer