Open main menu

EUSwiki β

Changes

Module:Navbox

791 bytes added, 11:03, 26 October 2018
per discussion at WT:Lua, this needs to be initialized in a non-global context
local args
local border
local listnums = {}
local ODD_EVEN_MARKER = '\127_ODDEVEN_\127'
local RESTART_MARKER = '\127_ODDEVEN0_\127'
args.name,
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; padding:0;'
})
end
titleCell
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args.title))
:addClass(args.titleclass)
:attr('colspan', getAboveBelowColspan())
: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))
end
if args['group' .. listnum] then
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
:addClass(args.groupclass)
:cssText(args.basestyle)
:css('width', args.groupwidth or '1%') -- If groupwidth not specified, minimize width
groupCell
:addClass('navbox-' .. oddEven)
:addClass(args.listclass)
:addClass(args['list' .. listnum .. 'class'])
:tag('div')
:css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em')
function p._navbox(navboxArgs)
args = navboxArgs
listnums = {}
for k, _ in pairs(args) do
:attr('role', 'navigation')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group if args.title or args.above or (args.group1 and not args.group2) then nav:attr('aria-labelledby', mw.uri.anchorEncode(args.titleor args.above or args.group1))
else
nav:attr('aria-label', 'Navbox')
:css('padding', '3px')
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group if args.title or args.above or (args.group1 and not args.group2) then nav:attr('aria-labelledby', mw.uri.anchorEncode(args.titleor args.above or args.group1))
else
nav:attr('aria-label', 'Navbox')
end
if (args.nocat or 'false'):lower() == 'false' then renderTrackingCategories(res) end
return striped(tostring(res))
end
Anonymous user