Difference between revisions of "Module:IconBar"
Jump to navigation
Jump to search
m |
m (Replaced getArgs with makeInvokeFunc) |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
− | local | + | local makeInvokeFunc = require("Module:Arguments").makeInvokeFunc |
− | |||
− | |||
− | |||
− | |||
− | |||
function p._bar(args) | function p._bar(args) | ||
Line 21: | Line 16: | ||
return s | return s | ||
end | end | ||
+ | |||
+ | p.bar = makeInvokeFunc(p._bar, {inherited = true}) | ||
return p | return p |
Revision as of 18:02, 7 May 2017
local p = {}
local makeInvokeFunc = require("Module:Arguments").makeInvokeFunc
function p._bar(args)
local name = args.name local num = tonumber(args[1]) or 1 if num == 0 then return "16px" end local numFloor = math.floor(num) local s = string.rep("16px", numFloor) if numFloor ~= num then s = s .. "16px" end return s
end
p.bar = makeInvokeFunc(p._bar, {inherited = true})
return p