Editing Module:Sidebar

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
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 37: Line 29:
 
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 47: Line 39:
 
:css('width', args.width or '22.0em')
 
: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('margin', args.float == 'left' and '0 1.0em 1.0em 0' or '0 0 1.0em 1.0em')
:css('background', '#f8f9fa')
+
:css('background', '#f9f9f9')
 
:css('border', '1px solid #aaa')
 
:css('border', '1px solid #aaa')
 
:css('padding', '0.2em')
 
:css('padding', '0.2em')
Line 98: Line 90:
 
: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 112: Line 97:
 
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 193: Line 179:
 
:tag('td')
 
:tag('td')
 
:addClass(args.contentclass)
 
:addClass(args.contentclass)
:css('padding', hasSubgroup(content) and '0.1em 0 0.2em' or '0 0.1em 0.4em')
+
:css('padding', '0 0.1em 0.4em')
 
:cssText(args.contentstyle)
 
:cssText(args.contentstyle)
 
:cssText(args['content' .. num .. 'style'])
 
:cssText(args['content' .. num .. 'style'])
Line 232: Line 218:
 
end
 
end
  
return tostring(root) .. (child and '[[Category:Pages using sidebar with the child parameter]]' or '')
+
return tostring(root)
 
end
 
end
  

Please note that all contributions to All About Ayrshire may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see All About Ayrshire:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Template used on this page: