Module:Navbox with collapsible groups: Difference between revisions
debug
No edit summary |
(debug) |
||
Line 6: | Line 6: | ||
-- helper functions | -- helper functions | ||
local function concatstrings( | local function concatstrings(s) | ||
local | local r = table.concat(s, '') | ||
if | if r:match('^%s*$') then r = nil end | ||
return | return r | ||
end | end | ||
local function concatstyles( | local function concatstyles(s) | ||
local | local r = table.concat(s, ';') | ||
while | while r:match(';%s*;') do | ||
r = mw.ustring.gsub(r, ';%s*;', ';') | |||
end | end | ||
if | if r:match('^%s*;%s*$') then r = nil end | ||
return | return r | ||
end | end | ||
function p._navbox(args) | function p._navbox(args) | ||
local tracking = '' | |||
-- table for args passed to navbox | -- table for args passed to navbox | ||
local targs = {} | local targs = {} | ||
Line 79: | Line 81: | ||
imageleft = args['imageleft' .. n], | imageleft = args['imageleft' .. n], | ||
listpadding = args['listpadding']}) | listpadding = args['listpadding']}) | ||
tracking = tracking .. '<hr /><center><b>k = ' .. k .. ' args ' .. n .. '</b></center><hr />\n' | |||
for ks,vs in pairs(targs) do | |||
tracking = tracking .. ks .. ' = ' .. vs .. '<br>\n' | |||
end | |||
tracking = tracking .. '\n<hr />\n' | |||
end | end | ||
end | end |