跳转到内容

模組:Class/data

被永久保护的模块
维基百科,自由的百科全书

这是本页的一个历史版本,由風中的刀劍留言 | 贡献2016年1月26日 (二) 16:30编辑。这可能和当前版本存在着巨大的差异。

-- This module contains data used in [[Module:Class]].

--------------------------------------------------------------------------------
-- Icon data
--------------------------------------------------------------------------------

local icons = {
	fa = {
		aliases = {"特色", "特"},
		title = "特色条目",
		image = "Featured article star.svg",
		tooltip = "特色条目",
	},
	fl = {
		aliases = {"特色列表", "特表"},
		title = "特色列表",
		image = "Featured article star.svg",
		tooltip = "特色列表",
	},
	fm = {
		aliases = {"特色图片", "特色圖片"},
		title = "特色图片",
		image = "Featured article star.svg",
		tooltip = "特色图片",
	},
	a = {
		aliases = {"甲"},
		title = "甲级条目",
		image = "Symbol a class.svg",
		tooltip = "甲级条目",
	},
	al = {
		aliases = {"甲级列表", "甲級列表"},
		title = "甲级列表",
		image = "Symbol a class.svg",
		tooltip = "甲级列表",
	},
	ga = {
		aliases = {"优良", "優良"},
		title = "优良条目",
		image = "Symbol support vote.svg",
		tooltip = "优良条目",
		suppressLink = true,
	},
	b = {
		aliases = {"乙"},
		title = "乙级条目",
		image = "Symbol b class.svg",
		tooltip = "乙级条目",
	},
	bl = {
		aliases = {"乙级列表", "乙級列表"},
		title = "乙级列表",
		image = "Symbol b class.svg",
		tooltip = "乙级列表",
	},
	c = {
		aliases = {"丙"},
		title = "丙级条目",
		image = "Symbol c class.svg",
		tooltip = "丙级条目",
	},
	cl = {
		title = "C-Class List",
		image = "Symbol c class.svg",
		tooltip = "C-Class list",
	},
	start = {
		title = "Start-Class Article",
		image = "Symbol start class.svg",
		tooltip = "Start-Class article",
	},
	sl = {
		title = "Start-Class List",
		image = "Symbol start class.svg",
		tooltip = "Start-Class list",
	},
	stub = {
		title = "Stub-Class Article",
		image = "Symbol stub class.svg",
		tooltip = "Stub-Class article",
	},
	list = {
		title = "List-Class Article",
		image = "Symbol list class.svg",
		tooltip = "List-Class article",
		suppressLink = true,
	},
	bplus = {
		aliases = {"b+"},
		title = "Bplus-Class Article",
		image = "Symbol bplus class.svg",
		tooltip = "Bplus-Class article",
	},
	no = {
		title = "Unknown-Class Article",
		image = "Crystal button cancel.svg",
		tooltip = "Unknown-Class article",
	},
	category = {
		aliases = {"cat", "categ"},
		title = "Category Page",
		image = "Folder Hexagonal Icon.svg",
		tooltip = "Category page",
	},
	disambig = {
		aliases = {"dab", "disamb"},
		title = "Disambiguation Page",
		image = "Symbol dab class.svg",
		tooltip = "Disambiguation page",
	},
	redir = {
		aliases = {"redirect", "red"},
		title = "Redirect Page",
		image = "Symbol redirect vote2.svg",
		tooltip = "Redirect page",
	},
	template = {
		aliases = {"temp", "templ"},
		title = "Template Page",
		image = "Symbol template class.svg",
		tooltip = "Template page",
		suppressLink = true,
	},
	na = {
		title = "Non-article Page",
		image = "Symbol neutral vote.svg",
		tooltip = "Non-article page",
		suppressLink = true,
	},
	file = {
		aliases = {"image"},
		title = "Media File Page",
		image = "Video-x-generic.svg",
		tooltip = "Media file page",
		suppressLink = true,
	},
	portal = {
		title = "Portal Page",
		image = "Portal-puzzle.svg",
		tooltip = "Portal page",
		suppressLink = true,
	},
	project = {
		title = "Project Page",
		image = "Symbol information vote.svg",
		tooltip = "Project page",
		suppressLink = true,
	},
	book = {
		title = "Wikipedia Book",
		image = "Symbol book class2.svg",
		tooltip = "Wikipedia Book",
	},
	draft = {
		title = "Draft Page",
		image = "Symbol neutral vote.svg",
		tooltip = "Draft page",
		suppressLink = true,
	},
	unassessed = {
		aliases = {"¬", "", "current", "future", "merge", "needed"},
		title = "Unknown",
		image = "Symbol question.svg",
		tooltip = "Unrated",
		suppressLink = true,
	},
}

--------------------------------------------------------------------------------
-- Color data
--------------------------------------------------------------------------------

local colors = {
	fa = {
		color = "#6699ff",
	},
	fl = {
		color = "#6699ff",
	},
	fm = {
		color = "#6699ff",
	},
	a = {
		color = "#66ffff",
	},
	al = {
		color = "#66ffff",
	},
	ga = {
		color = "#66ff66",
	},
	b = {
		color = "#b2ff66",
	},
	bl = {
		color = "#b2ff66",
	},
	c = {
		color = "#ffff66",
	},
	cl = {
		color = "#ffff66",
	},
	start = {
		color = "#ffaa66",
	},
	stub = {
		color = "#ff6666",
	},
	list = {
		color = "#aa88ff",
	},
	na = {
		color = "#f5f5f5", -- whitesmoke
	},
	category = {
		aliases = {"cat"},
		color = "#ffdb58", -- orange
	},
	current = {
		color = "#d462ff",
	},
	disambig = {
		aliases = {"dab"},
		color = "#00fa9a", -- mediumspringgreen
	},
	file = {
		aliases = {"image"},
		color = "#ddccff",
	},
	audio = {
		color = "#ddccff",
	},
	future = {
		color = "#8a95c9",
	},
	merge = {
		color = "#add8e6",
	},
	needed = {
		color = "#dcdcdc",
	},
	portal = {
		color = "#cc8899",
	},
	project = {
		color = "#c0c090",
	},
	redirect = {
		color = "#c0c0c0",
	},
	template = {
		color = "#fbceb1",
	},
	bplus = {
		aliases = {"b+"},
		color = "#66ff66",
	},
	sl = {
		color = "#ff6666",
	},
	user = {
		color = "#999900",
	},
	deferred = {
		color = "#999999",
	},
	book = {
		color = "#98FF98",
	},
	draft = {
		color = "#d98159",
	},
	unassessed = {
		color = "transparent",
	},
	_DEFAULT = {
		color = "transparent",
	}
}

--------------------------------------------------------------------------------
-- Substitute aliases
--------------------------------------------------------------------------------

for grade, t in pairs(icons) do
	if t.aliases then
		for i, alias in ipairs(t.aliases) do
			icons[alias] = t
		end
		t.aliases = nil
	end
	icons[grade] = t
end

for grade, t in pairs(colors) do
	if t.aliases then
		for i, alias in ipairs(t.aliases) do
			colors[alias] = t.color
		end
	end
	colors[grade] = t.color
end

return {
	icons = icons,
	colors = colors
}