Editing Module:Navbox

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. Read the Privacy Policy to learn what information we collect about you and how we use it.

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 publish the changes below to finish undoing the edit.

Latest revision Your text
Line 134: Line 134:
titleCell
titleCell
:tag('div')
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args.title))
:attr('id', mw.uri.anchorEncode(args.title))
:addClass(args.titleclass)
:addClass(args.titleclass)
Line 164: Line 163:
:attr('colspan', getAboveBelowColspan())
:attr('colspan', getAboveBelowColspan())
:tag('div')
:tag('div')
-- id for aria-labelledby attribute, if no title
:attr('id', args.title and nil or mw.uri.anchorEncode(args.above))
:wikitext(processItem(args.above, args.nowrapitems))
:wikitext(processItem(args.above, args.nowrapitems))
end
end
Line 205: Line 202:
if args['group' .. listnum] then
if args['group' .. listnum] then
local groupCell = row:tag('th')
local groupCell = row:tag('th')
-- id for aria-labelledby attribute, if lone group with no title or above
if listnum == 1 and not (args.title or args.above or args.group2) then
groupCell
:attr('id', mw.uri.anchorEncode(args.group1))
end


groupCell
groupCell
Line 412: Line 403:
:attr('role', 'navigation')
:attr('role', 'navigation')
:node(tbl)
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args.title then
if args.title or args.above or (args.group1 and not args.group2) then
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title))
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title or args.above or args.group1))
else
else
nav:attr('aria-label', 'Navbox')
nav:attr('aria-label', 'Navbox')
Line 435: Line 425:
:css('padding', '3px')
:css('padding', '3px')
:node(tbl)
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
if args.title then
if args.title or args.above or (args.group1 and not args.group2) then
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title))
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title or args.above or args.group1))
else
else
nav:attr('aria-label', 'Navbox')
nav:attr('aria-label', 'Navbox')
Please note that all contributions to Nonbinary Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see Nonbinary Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, 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. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: