Jump to content

Module:Navbox with collapsible groups: Difference between revisions

debug
No edit summary
(debug)
Line 6: Line 6:


-- helper functions
-- helper functions
local function concatstrings(t)
local function concatstrings(s)
local res = table.concat(t, '')
local r = table.concat(s, '')
if res:match('^%s*$') then res = nil end
if r:match('^%s*$') then r = nil end
return res
return r
end
end


local function concatstyles(t)
local function concatstyles(s)
local res = table.concat(t, ';')
local r = table.concat(s, ';')
while res:match(';%s*;') do
while r:match(';%s*;') do
res = mw.ustring.gsub(res, ';%s*;', ';')
r = mw.ustring.gsub(r, ';%s*;', ';')
end
end
if res:match('^%s*;%s*$') then res = nil end
if r:match('^%s*;%s*$') then r = nil end
return res
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
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.