Navigation menu

Module:Infobox: Difference between revisions

From The Kodiak Republic Wiki

simplify (tested in sandbox)
(fixed)
(simplify (tested in sandbox))
Line 113:
end
elseif rowArgs.data then
dvalif not rowArgs.data:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]', ''):match('^%S') then
row_stylerowArgs.rowstyle = 'display:none'
end
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
Line 231 ⟶ 234:
local rownums = union(getArgNums('header'), getArgNums('data'))
table.sort(rownums)
local row_style
for k, num in ipairs(rownums) do
local dval = args['data' .. tostring(num)]
row_style = args['rowstyle' .. tostring(num)]
if args['header' .. tostring(num)] then
row_style = args['rowstyle' .. tostring(num)]
elseif dval and
dval:gsub('%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]', ''):match('%S')
then
row_style = args['rowstyle' .. tostring(num)]
else
row_style = 'display:none'
end
addRow({
header = args['header' .. tostring(num)],
Line 251 ⟶ 242:
class = args['class' .. tostring(num)],
rowclass = args['rowclass' .. tostring(num)],
rowstyle = row_styleargs['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.