Modul:Navbox: Unterschied zwischen den Versionen
navigation div instead of single-cell table wrapper
(Kill nowikis) |
(navigation div instead of single-cell table wrapper) |
||
Zeile 116: | Zeile 116: | ||
titleCell | titleCell | ||
:tag('div') | |||
:attr('id', mw.uri.anchorEncode(args.title)) | |||
:addClass(args.titleclass) | |||
:css('font-size', '114%') | |||
:wikitext(addNewline(args.title)) | |||
end | end | ||
Zeile 360: | Zeile 361: | ||
local res = mw.html.create() | local res = mw.html.create() | ||
if border == 'none' then | if border == 'none' then | ||
res:node(tbl) | local nav = res:tag('div') | ||
:attr('role', 'navigation') | |||
:node(tbl) | |||
if args.title then | |||
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title)) | |||
else | |||
nav:attr('aria-label', 'Navbox') | |||
end | |||
elseif border == 'subgroup' or border == 'child' then | elseif border == 'subgroup' or border == 'child' then | ||
-- We assume that this navbox is being rendered in a list cell of a parent navbox, and is | -- We assume that this navbox is being rendered in a list cell of a parent navbox, and is | ||
Zeile 370: | Zeile 378: | ||
:wikitext('<div>') -- XXX: hack due to lack of unclosed support in mw.html. | :wikitext('<div>') -- XXX: hack due to lack of unclosed support in mw.html. | ||
else | else | ||
res | local nav = res:tag('div') | ||
:attr('role', 'navigation') | |||
:addClass('navbox') | |||
:cssText(args.bodystyle) | |||
:cssText(args.style) | |||
:css('padding', '3px') | |||
:node(tbl) | |||
if args.title then | |||
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title)) | |||
else | |||
nav:attr('aria-label', 'Navbox') | |||
end | |||
end | end | ||