Modulo:Navbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nuovo modulo
 
fix controllo navboxMaxList/subgroupMaxList
Riga 13:
-- Ritorna true se il nome dell'argomento è valido
local function isValidArg(name, isSubgroup)
local ret, acceptedArgs
 
acceptedArgs =if isSubgroup and cfg.subgroupArgs or cfg.navboxArgsthen
ret = acceptedArgscfg.subgroupArgs[name]
else
ret = cfg.navboxArgs[name]
end
if not ret then
local id = name:match("^list(%d+)$") or name:match("^group(%d+)$") or
Line 22 ⟶ 25:
if id then
id = tonumber(id)
ret =if isSubgroup and id <= cfg.subgroupMaxList or id <= cfg.navboxMaxListthen
ret = id <= cfg.subgroupMaxList
else
ret = id <= cfg.navboxMaxList
end
end
end
Line 73 ⟶ 80:
function Navbox:new(args)
local self = {}
 
local thNode
local thStyle = {
Line 81 ⟶ 87:
["font-size"] = "90%"
}
 
setmetatable(self, { __index = Navbox,
__tostring = function(t) return self:__tostring() end })