Module:Navbox: Difference between revisions

Jump to navigation Jump to search
416 bytes added ,  18:52, 15 December 2025
sync from sandbox per request
m (1 revision imported)
En:Wp>Pigsonthewing
(sync from sandbox per request)
Line 774: Line 774:
col:cssText(concatstyles({
col:cssText(concatstyles({
(k > 1) and 'border-left:2px solid #fdfdfd' or '',
(k > 1) and 'border-left:2px solid #fdfdfd' or '',
'font-weight:bold',
pargs[cfg.arg.colheaderstyle] or '',
pargs[cfg.arg.colheaderstyle] or '',
pargs[andnum('colheaderstyle', n)] or ''
pargs[andnum('colheaderstyle', n)] or ''
Line 851: Line 852:
function p.navbox (frame, boxtype)
function p.navbox (frame, boxtype)
local function readArgs(args, prefix)
local function readArgs(args, prefix)
local function readSubgroups(element, i)
if inArray(cfg.keyword.subgroups, args[prefix .. andnum(element, i)]) then
for _, v in ipairs(cfg.arg.subgroups_and_num) do
readArgs(args, prefix .. string.format(v, i) .. "_")
end
readArgs(args, prefix .. andnum('col', i) .. "_")
end
end
-- Read the arguments in the order they'll be output in, to make references
-- Read the arguments in the order they'll be output in, to make references
-- number in the right order.
-- number in the right order.
Line 858: Line 867:
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because
-- Limit this to 20 as covering 'most' cases (that's a SWAG) and because
-- iterator approach won't work here
-- iterator approach won't work here
local boxtype = args.type or cfg.keyword[boxtype]
if boxtype == cfg.keyword.with_columns then
for i = 1, 20 do
_ = args[prefix .. andnum('colheader', i)]
end
for i = 1, 20 do
readSubgroups('col', i)
end
for i = 1, 20 do
_ = args[prefix .. andnum('colfooter', i)]
end
end
for i = 1, 20 do
for i = 1, 20 do
_ = args[prefix .. andnum('group', i)]
_ = args[prefix .. andnum('group', i)]
if inArray(cfg.keyword.subgroups, args[prefix .. andnum('list', i)]) then
readSubgroups('list', i)
for _, v in ipairs(cfg.arg.subgroups_and_num) do
readArgs(args, prefix .. string.format(v, i) .. "_")
end
readArgs(args, prefix .. andnum('col', i) .. "_")
end
end
end
_ = args[prefix .. cfg.arg.below]
_ = args[prefix .. cfg.arg.below]
Anonymous user

Navigation menu