Module:Navbox/sandbox: Difference between revisions

Content deleted Content added
convert navbar args
final conversions besides 'odd', 'even', and 'navbox-' prior to the two
Line 61:
for line in (item .. '\n'):gmatch('([^\n]*)\n') do
local prefix, content = line:match('^([*:;#]+)%s*(.*)')
if prefix and not content:match('^<span class="cfg.pattern.nowrap">') then
line = prefix .format(cfg.nowrap_item, '<span class="nowrap">' ..prefix, content .. '</span>')
end
table.insert(lines, line)
Line 77:
 
if args[cfg.arg.navbar] ~= cfg.keyword.navbar_off and args[cfg.arg.navbar] ~= cfg.keyword.navbar_plain and not
(not args[cfg.arg.name] and mw.getCurrentFrame():getParent():getTitle():gsub('/cfg.pattern.sandbox$', '') == 'Template:Navbox'cfg.pattern.navbox) then
titleCell:wikitext(navbar{
args[cfg.arg.name],
Line 250:
if listText:sub(1, 12) == '</div><table' then
-- Assume list text is for a subgroup navbox so no automatic striping for this row.
oddEven = listText:find('<th[^>]*"navbox%-title"'cfg.pattern.navbox_title) and cfg.marker.restart or 'odd'
end
Line 320:
 
for key, style in pairs(args) do
if tostring(key):match("cfg.pattern.style$") then
if styleratio{mw.text.unstripNoWiki(style)} < 4.5 then
return true
Line 399:
for k, _ in pairs(args) do
if type(k) == 'string' then
local listnum = k:match('^list(%d+)$'cfg.pattern.listnum)
if listnum then table.insert(listnums, tonumber(listnum)) end
end
Line 423:
nav:attr('aria-labelledby', mw.uri.anchorEncode(args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]))
else
nav:attr('aria-label', 'Navbox'cfg.aria_label)
end
elseif border == cfg.keyword.border_subgroup then
Line 446:
nav:attr('aria-labelledby', mw.uri.anchorEncode(args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]))
else
nav:attr('aria-label', 'Navbox'cfg.aria_label)
end
end
Line 460:
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = {'Template:Navbox'cfg.pattern.navbox}})
 
-- Read the arguments in the order they'll be output in, to make references number in the right order.