Bureaucrats, editor, Interface administrators, Administrators (Semantic MediaWiki), Curators (Semantic MediaWiki), Editors (Semantic MediaWiki), Administrators
47,327
edits
(Created page with "local p = {} local lang = mw.getContentLanguage() local regions = { misthalin = true, karamja = true, asgarnia = true, desert = true, fremennik = true, kandarin = true, morytania = true, tirannwn = true, wilderness = true, kourend = true, varlamore = true, } function p._main(region, note, link, global_highlight, league) if region == nil or string.lower(region) == "no" then return "None" end local ret = {} for value in string.gmatch(region, "[^,]+") do...") |
No edit summary |
||
Line 162:
local league = frameargs.league
return p._badge(region, note, link, global_highlight, league)
end
-- Parsing function for use in infoboxes. Shows at most 2 full chips; more
-- regions will render as badge icons without text.
function p.regionsForInfobox(arg)
if arg == nil or arg == '' or arg == 'UH OH YOU SHOULDN\'T SEE THIS!' or string.find(arg, "action=edit") then
return nil
end
if string.lower(arg) == 'no' then
return 'N/A'
end
local ret = {}
local comma_count = select(2, string.gsub(arg, ",", ""))
for region in string.gmatch(arg, "[^,]+") do
local trimmed = region:gsub("^%s*(.-)%s*$", "%1")
if comma_count < 2 then
table.insert(ret, p._main(trimmed, nil, nil, nil, 'Raging Echoes League'))
else
table.insert(ret, p._badge(trimmed, nil, nil, nil, 'Raging Echoes League'))
end
end
return table.concat(ret, '')
end
|