Changes

Jump to navigation Jump to search
391 bytes added ,  22:52, 19 December 2017
update from sandbox per discussion on talk page
Line 19: Line 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
Line 29: Line 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)
Line 90: Line 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
   Line 97: Line 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
Line 179: Line 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'])
Line 218: Line 232:  
end
 
end
   −
return tostring(root)
+
return tostring(root) .. (child and '[[Category:Pages using sidebar with the child parameter]]' or '')
 
end
 
end
  
Anonymous user

Navigation menu