Content deleted Content added
tabs |
migrate to mw.html; further whitespace normalisation |
||
Line 5:
local p = {}
local navbar = require('Module:Navbar')._navbar
local getArgs -- lazily initialized
Line 30 ⟶ 29:
if tableRowAdded then
tbl
end
tableRowAdded = true
return tbl
end
Line 58 ⟶ 57:
if args.state == 'plain' then spacerSide = 'right' end
titleCell
args.name,
mini = 1,
Line 64 ⟶ 63:
})
end
-- Render the spacer div.
if spacerSide then
titleCell
end
end
Line 82 ⟶ 81:
local titleRow = addTableRow(tbl)
if args.titlegroup then
titleRow
end
local titleCell = titleRow
if args.titlegroup then
titleCell
end
local titleColspan = 2
if args.imageleft then titleColspan = titleColspan + 1 end
if args.image then titleColspan = titleColspan + 1 end
if args.titlegroup then titleColspan = titleColspan - 1 end
titleCell
renderNavBar(titleCell)
titleCell
end
Line 138 ⟶ 137:
addTableRow(tbl)
end
Line 152 ⟶ 151:
addTableRow(tbl)
end
Line 167 ⟶ 166:
local function renderListRow(tbl, listnum)
local row = addTableRow(tbl)
if listnum == 1 and args.imageleft then
row
.wikitext(addNewline(args.imageleft))
end
if args['group' .. listnum] then
local groupCell = row
groupCell
if args.groupwidth then
groupCell
end
groupCell
.wikitext(args['group' .. listnum])
end
local listCell = row
if args['group' .. listnum] then
listCell
else
listCell
end
if not args.groupwidth then
listCell
end
local isOdd = (listnum % 2) == 1
local rowstyle = args.evenstyle
Line 227 ⟶ 226:
listCell
.wikitext(addNewline(args['list' .. listnum]))
if listnum == 1 and args.image then
row
.wikitext(addNewline(args.image))
end
Line 259 ⟶ 258:
local function needsHorizontalLists()
if border == 'child' or border == 'subgroup' or args.tracking == 'no' then return false end
local listClasses = {'plainlist', 'hlist', 'hlist hnum', 'hlist hwrap', 'hlist vcard', 'vcard hlist', 'hlist vevent'}
for i, cls in ipairs(listClasses) do
Line 286 ⟶ 285:
local subpage = title.subpageText
if subpage == 'doc' or subpage == 'sandbox' or subpage == 'testcases' then return end
for i, cat in ipairs(getTrackingCategories()) do
builder.wikitext('[[Category:' .. cat .. ']]')
Line 296 ⟶ 295:
--
local function renderMainTable()
local tbl =
if args.title and (args.state ~= 'plain' and args.state ~= 'off') then
tbl
end
tbl
if border == 'subgroup' or border == 'child' or border == 'none' then
tbl
else -- regular navobx - bodystyle and style will be applied to the wrapper table
tbl
end
tbl
renderTitleRow(tbl)
Line 346 ⟶ 345:
-- render the appropriate wrapper around the navbox, depending on the border param
local res =
if border == 'none' then
res
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
Line 354 ⟶ 353:
-- padding being applied, and at the end add a <div> to balance out the parent's </div>
res
else
res
end
|