Content deleted Content added
rm extra text |
add tropical cyclone status icons |
||
Line 11:
color = "ccffff",
name = "Severe tropical storm",
sortkey = 120,
icon = "[[File:Severe tropical storm icon.png|18px]]"
},
mtstorm = {
color = "00faf4", -- Old {{storm colour}} did not support. Value guessed.
name = "Moderate tropical storm",
sortkey = 105,
icon = "[[File:Moderate tropical storm icon.png|18px]]"
},
storm = {
color = "00faf4",
name = "Tropical storm",
sortkey = 100,
icon = "[[File:Tropical storm icon.png|18px]]"
},
severedep = {
Line 36 ⟶ 39:
color = "5ebaff",
name = "Tropical depression",
sortkey = 90,
icon = "[[File:Tropical_Depression.png|25px]]"
},
disturbance = {
color = "80ccff",
name = "Tropical disturbance",
sortkey = 80,
icon = "[[File:Disturbance icon.png|25px]]"
},
subtropicalcyclone = {
Line 51 ⟶ 56:
color = "00faf4",
name = "Subtropical storm",
sortkey = 65,
icon = "[[File:Subtropical storm icon.png|18px]]"
},
subdepression = {
color = "5ebaff",
name = "Subtropical depression",
sortkey = 60,
icon = "[[File:Subtropical Depression icon.png|25px]]"
},
subdisturbance = {
Line 66 ⟶ 73:
color = "cccccc",
name = "Extratropical cyclone",
sortkey = 50,
icon = "[[File:Extratropical cyclone icon.png|18px]]"
},
monsoondepression = {
color = "5ebaff",
name = "Monsoon depression",
sortkey = 30,
icon = "[[File:Monsoon Depression icon.png|25px]]"
},
potential = {
color = "80ccff",
name = "Potential tropical cyclone",
sortkey = 25,
icon = "[[File:Potential tropical cyclone icon.png|25px]]"
},
posttropical = {
color = "cccccc",
name = "Post-tropical depression",
sortkey = 70,
icon = "[[File:Post tropical cyclone icon.png|25px]]"
},
remnant = {
color = "cccccc",
name = "Post-tropical depression",
sortkey = 70,
icon = "[[File:Remnant low icon.png|25px]]"
},
unknown = {
color = "c0c0c0",
name = "Unknown strength tropical cyclone",
sortkey = 0,
icon = "'''?'''"
},
cat5 = {
Line 102 ⟶ 115:
default = "Category 5-equivalent tropical cyclone"
},
sortkey = 80020,
icon = "[[File:Category 5 hurricane icon.png|18px]]"
},
cat4 = {
Line 113 ⟶ 127:
default = "Category 4-equivalent tropical cyclone"
},
sortkey = 80008,
icon = "[[File:Category 4 hurricane icon.png|18px]]"
},
cat3 = {
Line 124 ⟶ 139:
default = "Category 3-equivalent tropical cyclone"
},
sortkey = 80006,
icon = "[[File:Category 3 hurricane icon.png|18px]]"
},
cat2 = {
Line 135 ⟶ 151:
default = "Category 2-equivalent tropical cyclone"
},
sortkey = 80004,
icon = "[[File:Category 2 hurricane icon.png|18px]]"
},
cat1 = {
Line 146 ⟶ 163:
default = "Category 1-equivalent tropical cyclone"
},
sortkey = 80002,
icon = "[[File:Category 1 hurricane icon.png|18px]]"
},
supertyphoon = {
Line 177 ⟶ 195:
color = "ff6060",
name = "Super cyclonic storm",
sortkey = 50020,
icon = "[[File:Super cyclonic storm icon.png|18px]]"
},
esvrcyclstorm = {
color = "ffc140",
name = "Extremely severe cyclonic storm",
sortkey = 50015,
icon = "[[File:Extremely severe cyclonic storm icon.png|18px]]"
},
vsvrcyclstorm = {
color = "ffffcc",
name = "Very severe cyclonic storm",
sortkey = 50010,
icon = "[[File:Very severe cyclonic storm icon.png|18px]]"
},
svrcyclstorm = {
color = "ccffff",
name = "Severe cyclonic storm",
sortkey = 50008,
icon = "[[File:Severe cyclonic storm icon.png|18px]]"
},
niocyclone = {
color = "00faf4",
name = "Cyclonic storm",
sortkey = 50006,
icon = "[[File:Cyclonic storm icon.png|18px]]"
},
deepdepression = {
color = "5ebaff",
name = "Deep depression",
sortkey = 50002,
icon = "[[File:Deep depression icon.png|25px]]"
},
niodepression = {
color = "80ccff",
name = "Depression",
sortkey = 50001,
icon = "[[File:Depression icon.png|25px]]"
},
nioland = {
color = "80ccff",
name = "Land depression",
sortkey = 50000,
icon = "[[File:Land depression icon.png|25px]]"
},
aus5 = {
color = "ff6060",
name = "Category 5 severe tropical cyclone",
sortkey = 40015,
icon = "[[File:Aus 5 icon.png|18px]]"
},
aus4 = {
color = "ffc140",
name = "Category 4 severe tropical cyclone",
sortkey = 40013,
icon = "[[File:Aus 4 icon.png|18px]]"
},
aus3 = {
color = "ffffcc",
name = "Category 3 severe tropical cyclone",
sortkey = 40010,
icon = "[[File:Aus 3 icon.png|18px]]"
},
aus2 = {
color = "ccffff",
name = "Category 2 tropical cyclone",
sortkey = 40008,
icon = "[[File:Aus 2 icon.png|18px]]"
},
aus1 = {
color = "00faf4",
name = "Category 1 tropical cyclone",
sortkey = 40006,
icon = "[[File:Aus 1 icon.png|18px]]"
},
low = {
color = "5ebaff",
name = "Tropical low",
sortkey = 40002,
icon = "[[File:Tropical Low.png|25px]]"
},
sublow = {
Line 252 ⟶ 284:
color = "ff6060",
name = "Very intense tropical cyclone",
sortkey = 30010,
icon = "[[File:Very intense tropical cyclone icon.png|18px]]"
},
intense = {
color = "ffc140",
name = "Intense tropical cyclone",
sortkey = 30008,
icon = "[[File:Intense tropical cyclone icon.png|18px]]"
},
tropicalcyclone = {
color = "ffffcc",
name = "Tropical cyclone",
sortkey = 30006,
icon = "'''TC'''"
},
mstorm = {
Line 272 ⟶ 307:
color = "80ccff",
name = "Zone of disturbed weather",
sortkey = 30000,
icon = "[[File:Disturbed weather icon.png|25px]]"
},
shemsvrtc = {
Line 391 ⟶ 427:
["a1"] = cats["aus1"].color
}
-- Icon overrides for old {{Tropical cyclone status icons}} that don't have a
-- viable category.
local icons = {
["extratropical2"] = "[[File:Extratropical storm icon.png|18px]]",
["typhoon"] = "[[File:Typhoon icon.png|18px]]",
["swiosts"] = "[[File:Severe tropical storm south icon.png|18px]]",
["swiotc"] = "[[File:SWIO tropical cyclone icon.png|18px]]"
}
icons["et2"] = icons["extratropical2"]
icons["ex2"] = icons["extratropical2"]
icons["ty"] = icons["typhoon"]
icons["sts-s"] = icons["swiosts"]
-- Disabled due to improper ambiguity.
-- icons["tc"] = icons["swiosts"]
function p.color(frame)
Line 405 ⟶ 457:
function p.sortkey(frame)
return p._sortkey(frame.args[1] or frame:getParent().args[1])
end
function p.icon(frame)
return p._icon(frame.args[1] or frame:getParent().args[1])
end
Line 438 ⟶ 494:
or defaultCategory
] or cats[defaultCategory]).sortkey
end
function p._icon(iconCode)
-- This looks confusing, but it's actually nested ternaries (for nil checks)
local icon = (iconCode ~= nil and string.len(iconCode) ~= 0) and
string.gsub(string.lower(iconCode), "[^%w]", "")
or defaultCategory
return icons[iconCode] or ((cats[iconCode] or cats[defaultCategory]).icon) or cats["tropicalcyclone"].icon
end
Line 471 ⟶ 536:
:node(
mw.html.create("tr")
:node(mw.html.create("th"):wikitext("Icon")
:attr("class", "unsortable")
:attr("rowspan", "2")
:css("width", "0"))
:node(mw.html.create("th"):wikitext("ID")
:attr("rowspan", "2"))
Line 495 ⟶ 564:
local row = rows[1]
local actualIcon = p._icon(name)
local icon = mw.html.create("td")
:wikitext(actualIcon)
if cat["icon"] ~= nil and actualIcon ~= cat["icon"] then
icon
:wikitext(" ")
:node(
mw.html.create("span")
:css("text-decoration", "underline")
:css("text-decoration-style", "dotted")
:attr("title", "Overriden from original icon (" .. cat["icon"] .. ")")
:wikitext("*")
)
legends["*"] = "Overriden from original icon."
end
local id = mw.html.create("td")
:wikitext(name)
Line 510 ⟶ 595:
:css("text-decoration-style", "dotted")
:attr("title", "Overriden from original color (#" .. cat["color"] .. ")")
:wikitext("**")
)
legends["**"] = "Overriden from original color."
end
Line 578 ⟶ 663:
:attr("colspan", "2")
:wikitext(cat["name"])
row:node(icon)
row:node(id)
row:node(name)
else
local nameTableLength = count(cat["name"])
icon:attr("rowspan", nameTableLength)
id:attr("rowspan", nameTableLength)
colorPreview:attr("rowspan", nameTableLength)
Line 588 ⟶ 675:
sortkey:attr("rowspan", nameTableLength)
row:node(icon)
row:node(id)
local firstDone = false
Line 621 ⟶ 709:
if cats[name] == nil then
local row = mw.html.create("tr")
:node(mw.html.create("td")
:wikitext("''<span style=\"color:gray\">N/A</span>''"))
:node(mw.html.create("td"):wikitext(name))
:node(mw.html.create("td")
Line 631 ⟶ 721:
:node(mw.html.create("td")
:attr("colspan", "2")
:wikitext("''<span style=\"color:gray\">not available</span>''"))
out:node(row)
end
end
for name, icon in TableTools.sortedPairs(icons) do
if cats[name] == nil then
local row = mw.html.create("tr")
:node(mw.html.create("td")
:wikitext(icons[name]))
:node(mw.html.create("td"):wikitext(name))
:node(mw.html.create("td")
:attr("colspan", "6")
:wikitext("''<span style=\"color:gray\">not available</span>''"))
out:node(row)
Line 639 ⟶ 742:
local showLegend = false
legendsCompiled
:css("list-style-
:css("list-style-type", "none")
for legend, details in TableTools.sortedPairs(legends) do
|