Zum Inhalt springen

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 = {
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 k, t in pairs(data) do
for code, iconData in pairs(data) do
if t.aliases then
iconData.canonicalCode = code
for i, alias in ipairs(t.aliases) do
if iconData.aliases then
ret[alias] = t
for _, alias in ipairs(iconData.aliases) do
ret[alias] = iconData
end
end
t.aliases = nil
iconData.aliases = nil
end
end
ret[k] = t
ret[code] = iconData
end
end


return ret
return ret
Anonymer Benutzer