Modul:Icon/data: Unterschied zwischen den Versionen
add icon data for WP:GOCE per Special:Diff/1022892230, and record the canonical code for each icon
(add a "link" field which determines whether links should be displayed or suppressed, and copy data into a new table before returning to avoid undefined behaviour) |
(add icon data for WP:GOCE per Special:Diff/1022892230, and record the canonical code for each icon) |
||
Zeile 303: | Zeile 303: | ||
link = false, | link = false, | ||
}, | }, | ||
portal = { | |||
image = "Symbol portal class.svg", | image = "Symbol portal class.svg", | ||
tooltip = "Portal", | tooltip = "Portal", | ||
Zeile 405: | Zeile 405: | ||
tooltip = "WikiProject", | tooltip = "WikiProject", | ||
link = false, | link = false, | ||
}, | |||
goce = { | |||
image = "Writing Magnifying.PNG", | |||
tooltip = "Guild of Copy Editors", | |||
link = true, | |||
}, | }, | ||
wikipedia = { | wikipedia = { | ||
Zeile 497: | Zeile 502: | ||
-- Make aliases work the same as normal keys, and remove the "aliases" subtables. | -- Make aliases work the same as normal keys, and remove the "aliases" subtables. | ||
local ret = {} | local ret= {} | ||
for | for code, iconData in pairs(data) do | ||
if | iconData.canonicalCode = code | ||
for | if iconData.aliases then | ||
ret[alias] = | for _, alias in ipairs(iconData.aliases) do | ||
ret[alias] = iconData | |||
end | end | ||
iconData.aliases = nil | |||
end | end | ||
ret[ | ret[code] = iconData | ||
end | end | ||
return ret | return ret |