Content deleted Content added
No edit summary |
narrow API, construct boxArgs with 3 items directly |
||
Line 1:
local yesno = require('Module:Yesno')
local mList = require('Module:List')
Line 16 ⟶ 15:
end
local function
local
local args = {}▼
for k, v in pairs(origArgs) do▼
v = v:match('^%s*(.-)%s*$')▼
}
if v ~= '' then▼
args[k] = v▼
end▼
end▼
return p._main(args)▼
end▼
function p._main(args, cfg)▼
local tStyles = mTableTools.compressSparseArray(args)▼
local box = p.renderBox(tStyles)▼
local trackingCategories = p.renderTrackingCategories(args, tStyles)▼
return box .. trackingCategories▼
end▼
function p.renderBox(tStyles)▼
if #tStyles < 1 then
boxArgs.text = string.format('<strong class="error">%s</strong>', format('error-emptylist'))
Line 60 ⟶ 44:
'\n' .. tStylesList
end
▲ boxArgs.type = 'notice'
▲ boxArgs.small = true
▲ boxArgs.image = string.format('[[File:Farm-Fresh css add.svg|32px|alt=%s]]', format('logo-alt'))
return mMessageBox.main('mbox', boxArgs)
end
local function
if yesno(args.nocat) then
return ''
Line 114 ⟶ 95:
end
return table.concat(cats)
▲end
▲function p._main(args, cfg)
▲ local tStyles = mTableTools.compressSparseArray(args)
▲ return box .. trackingCategories
▲end
local origArgs = frame:getParent().args
▲ local args = {}
▲ for k, v in pairs(origArgs) do
▲ v = v:match('^%s*(.-)%s*$')
▲ if v ~= '' then
▲ args[k] = v
▲ end
▲ end
▲ return p._main(args)
end
|