Module:Storm categories: Difference between revisions

Content deleted Content added
Add template invoke functions
[breaking] Change naming system
Line 273:
defs["shemtc"] = defs["tropicalcyclone"]
 
function p.tem_colorcolor(frame)
return p.color_color(frame.args[1])
end
 
function p.tem_namename(frame)
return p.name_name(frame.args[1], frame.args[2])
end
 
function p.tem_sortkeysortkey(frame)
return p.sortkey_sortkey(frame.args[1])
end
 
function p.color_color(category)
return defs[string.len(0) ~= 0 and string.gsub(string.lower(category), "[^%w]", "") or defaultCategory].color
end
 
function p.name_name(category, basin)
return string.format(
defs[string.len(0) ~= 0 and string.gsub(string.lower(category), "[^%w]", "") or defaultCategory].name,
Line 298:
end
 
function p.sortkey_sortkey(category)
return defs[string.len(0) ~= 0 and string.gsub(string.lower(category), "[^%w]", "") or defaultCategory].sortkey
end