Module:Navbox: Difference between revisions
From Test Wiki
Content deleted Content added
bodystyle fix |
correct fix for empty args |
||
| Line 16: | Line 16: | ||
return (mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")) |
return (mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1")) |
||
end |
end |
||
function addTableRow(tbl) |
function addTableRow(tbl) |
||
-- If any other rows have already been added, then we add a 2px gutter row. |
-- If any other rows have already been added, then we add a 2px gutter row. |
||
| Line 264: | Line 264: | ||
-- |
-- |
||
function renderTrackingCategories(builder) |
function renderTrackingCategories(builder) |
||
local frame = mw.getCurrentFrame() |
|||
if not frame then return end |
if not frame then return end |
||
| Line 351: | Line 353: | ||
for k, v in pairs(args) do |
for k, v in pairs(args) do |
||
local listnum = ('' .. k):match('^list(%d+)$') |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
local listnum = ('' .. k):match('^list(%d+)$') |
|||
| ⚫ | |||
| ⚫ | |||
end |
end |
||
table.sort(listnums) |
table.sort(listnums) |
||
| Line 400: | Line 395: | ||
end |
end |
||
function p.navbox( |
function p.navbox(frame) |
||
| ⚫ | |||
frame = frm |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
local args = {} |
|||
for k, v in pairs(frame:getParent().args) do |
|||
if v ~= '' then |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
end |
end |
||