최신화
잔글편집 요약 없음 |
(최신화) |
||
11번째 줄: | 11번째 줄: | ||
local args | local args | ||
local border | local border | ||
local listnums | local listnums | ||
local ODD_EVEN_MARKER = '\127_ODDEVEN_\127' | local ODD_EVEN_MARKER = '\127_ODDEVEN_\127' | ||
local RESTART_MARKER = '\127_ODDEVEN0_\127' | local RESTART_MARKER = '\127_ODDEVEN0_\127' | ||
86번째 줄: | 86번째 줄: | ||
args.name, | args.name, | ||
mini = 1, | mini = 1, | ||
fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;' | fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none; padding:0;' | ||
}) | }) | ||
end | end | ||
135번째 줄: | 135번째 줄: | ||
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) | ||
164번째 줄: | 165번째 줄: | ||
: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 | ||
202번째 줄: | 205번째 줄: | ||
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 | ||
208번째 줄: | 217번째 줄: | ||
:addClass(args.groupclass) | :addClass(args.groupclass) | ||
:cssText(args.basestyle) | :cssText(args.basestyle) | ||
:css('width', args.groupwidth or '1%') -- If groupwidth not specified, minimize width | |||
groupCell | groupCell | ||
252번째 줄: | 261번째 줄: | ||
:addClass('navbox-' .. oddEven) | :addClass('navbox-' .. oddEven) | ||
:addClass(args.listclass) | :addClass(args.listclass) | ||
:addClass(args['list' .. listnum .. 'class']) | |||
:tag('div') | :tag('div') | ||
:css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em') | :css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em') | ||
376번째 줄: | 386번째 줄: | ||
function p._navbox(navboxArgs) | function p._navbox(navboxArgs) | ||
args = navboxArgs | args = navboxArgs | ||
listnums = {} | |||
for k, _ in pairs(args) do | for k, _ in pairs(args) do | ||
406번째 줄: | 417번째 줄: | ||
:attr('role', 'navigation') | :attr('role', 'navigation') | ||
:node(tbl) | :node(tbl) | ||
if args.title then | -- aria-labelledby title, otherwise above, otherwise lone group | ||
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title)) | if args.title or args.above or (args.group1 and not args.group2) then | ||
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') | ||
427번째 줄: | 439번째 줄: | ||
:css('padding', '3px') | :css('padding', '3px') | ||
:node(tbl) | :node(tbl) | ||
if args.title then | -- aria-labelledby title, otherwise above, otherwise lone group | ||
nav:attr('aria-labelledby', mw.uri.anchorEncode(args.title)) | if args.title or args.above or (args.group1 and not args.group2) then | ||
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') | ||
434번째 줄: | 447번째 줄: | ||
end | end | ||
renderTrackingCategories(res) | if (args.nocat or 'false'):lower() == 'false' then | ||
renderTrackingCategories(res) | |||
end | |||
return striped(tostring(res)) | return striped(tostring(res)) |