Module:Bka
Appearance
| This module is rated as beta. It is considered ready for widespread use, but as it is still relatively new, it should be applied with some caution to ensure results are as expected. |
| Editing of this module by new or unregistered users is currently disabled. See the protection policy and protection log for more details. If you cannot edit this module and you wish to make a change, you can submit an edit request, discuss changes on the talk page, request unprotection, log in, or create an account. |
| This module depends on the following other modules: |
Implements {{Bkaicon}} and {{Bkaicon/list}}.
Usage
- {{Bkaicon}} →
{{#invoke:Bka|icon}} - {{Bkaicon/list}} →
{{#invoke:Bka|list}}
local p = {}
local list = mw.loadData('Module:Bka/list')
local getArgs -- lazy load
local flagg -- lazy load
local notblank = function(v) return (v or '') ~= '' end
local ifblank = function(a, b) return notblank(a) and a or b end
function p._core(options, args, frame)
flagg = flagg or require('Module:Flagg').luaMain
frame = frame or mw.getCurrentFrame()
local alias = flagg(frame, {'xxue', args[1]})
local name = ifblank(args.name, alias)
local link = list[alias] or alias
return flagg(frame, {
[1] = options,
[2] = args[1],
variant = ifblank(args.variant, args[2]),
size = args.size,
altvar = 'basketball',
link = link,
name = (name == 'full') and link or name
})
end
function p.icon(frame)
getArgs = getArgs or require('Module:Arguments').getArgs
return p._core('cxxlo', getArgs(frame), frame)
end
function p.main(frame)
getArgs = getArgs or require('Module:Arguments').getArgs
return p._core('unc', getArgs(frame), frame)
end
p[''] = p.main
function p._list(item)
return list[item] or ''
end
function p.list(frame)
getArgs = getArgs or require('Module:Arguments').getArgs
return p._list(getArgs(frame)[1])
end
return p