自控能力是什么意思| 得艾滋病的人有什么症状| 三个又读什么| 经常早上肚子疼是什么原因| 香砂六君丸治什么病| 什么是象声词| 痢疾是什么病| 尿糖弱阳性是什么意思| 桃胶有什么作用| 断掌是什么意思| 71年的猪是什么命| 四级残疾证有什么用| 忘年恋是什么意思| 同房时阴道疼痛是什么原因| 婷婷玉立什么意思| cpc是什么| 龟头发红是什么原因| 惊讶表情是什么意思| 不撞南墙不回头是什么意思| 脸上起红疙瘩是什么原因| 开心果树长什么样| 黄茶是什么茶| 什么是沙龙| 开什么玩笑| 秀禾服是什么意思| 长胸毛的男人代表什么| 儿童扁桃体发炎吃什么药| 腰酸痛是什么原因| 决明子泡水喝有什么好处| 女生考什么证书最实用| 小工是什么意思| 心累是什么原因| 转氨酶偏高是什么原因引起的| 相见不如怀念是什么意思| 超敏crp是什么意思| 兰桂齐芳是什么意思| 苯丙酮尿症是什么| 什么书在书店里买不到| 做梦丢钱了什么征兆| 勾魂是什么意思| 谷氨酰基转移酶高是什么原因| 血糖30多有什么危险| 乳房疼挂什么科室| 血清检查能测出什么| 后巩膜葡萄肿是什么意思| 假性宫缩是什么感觉| 猪利是什么| 什么叫跨境电商| 杜松子是什么| 什么食物是养肝的| 五级职员是什么级别| 三晋是什么意思| 热淋是什么意思| 少一个睾丸有什么影响| 什么的云海| 捡什么废品最值钱| 长方脸适合什么样的发型| 甜醋是什么醋| 什么属于发物| 糖耐量受损是什么意思| 川字加一横是什么字| 亚麻籽和什么相克| 蠼螋吃什么| 梦见牛是什么预兆| 胡萝卜不能和什么一起吃| butterfly是什么意思| 全期猫粮什么意思| 安宫牛黄丸为什么那么贵| 人工降雨的原理是什么| 分山念什么| 小孩一到晚上就发烧是什么原因| 什么是桃花劫| 肆意是什么意思| 老鹰茶是什么茶| 二月十九是什么星座| 924是什么星座| 紧张手抖是什么原因| 便秘吃什么水果| 县法院院长是什么级别| 站着说话不腰疼是什么意思| 孩子b型血父母什么血型| 小儿疳积是什么症状| 肠胃炎吃什么药好| 金字旁乐读什么| 七月份怀孕预产期是什么时候| 眉毛上长痘是什么原因| 四月18号是什么星座的| 11月18号是什么星座的| 内膜薄是什么原因| 赵丽颖的真名叫什么| 榨菜是什么菜| 眼睛看什么科| 小钢炮是什么意思| 斯里兰卡说什么语言| 眉毛有什么作用| 软饭是什么意思| 一什么湖面| 男人右眼皮跳是什么预兆| size什么意思| 水杨酸有什么作用| 珊五行属什么| 土豆什么时候种植| 三颗星是什么军衔| 气虚吃什么| 定点医院什么意思| ga是什么牌子| 肚子疼喝什么药| dna是什么| 属马本命佛是什么佛| 女生取什么名字好听| 白带黄吃什么药| 排骨汤用什么排骨| 19点是什么时辰| 虱子长什么样| 打闭经针有什么副作用| 傲慢什么意思| 什么桌椅| 跪乳的动物是什么生肖| 手信是什么东西| 30年婚姻是什么婚| 毒血症是什么病| 男人经常熬夜喝什么汤| 监守自盗什么意思| 火命适合什么颜色| 石榴石一般什么价位| bur什么意思| 双日是什么意思| 怕什么来什么| 梦见前夫是什么兆头| 翘嘴鱼吃什么食物| 轻度郁症有什么表现| 空调开除湿有什么作用| 什么是回南天| 农村适合养殖什么| 乳房疼是什么原因| 梦见婆婆去世预示什么| 双侧筛窦粘膜增厚是什么意思| 什么是梦| 月经不来要吃什么药| 姜黄粉是什么| a型血rh阳性是什么意思| 布衣蔬食是什么意思| 叶黄素是什么| 喜乐是什么意思| 1921年是什么年| 唐玄宗叫什么| 不能晒太阳是什么病| 腹泻吃什么食物好| 鲲是什么意思| h型高血压什么意思| 海誓山盟是什么意思| 足银999是什么意思| 什么的爱心| 最好的洗发水是什么牌子| 十月二十三号是什么星座| 梦见自己被火烧是什么意思| 宝宝手心热是什么原因| 胃炎吃什么药好使| 阴囊湿疹吃什么药| 自白是什么意思| 子宫内膜不典型增生是什么意思| 12月20是什么星座| 液基薄层细胞检测是什么| 蒋介石为什么不杀张学良| 肝内多发低密度灶是什么意思| 阴唇肥大有什么影响| 橘络的功效与作用是什么| 荷尔蒙是什么意思啊| 4月份是什么星座| 什么生肖不能养龟| 经常熬夜喝什么汤好| 我追呀追呀是什么歌曲| 花洒不出水什么原因| 乙肝五项135阳性是什么意思| cc是什么单位| 幽闭是什么意思| 阅字五行属什么| 什么是三焦| 敏感肌是什么样的| 9月21日是什么星座| 什么水果含维生素c最多| 孩子发烧肚子疼是什么原因| 吃多种维生素有什么好处和坏处| 为什么手会麻| 利福喷丁和利福平有什么区别| 面霜是什么| 车牌号选什么数字吉利| 肾阳虚是什么意思| 润肺吃什么| 什么是铅中毒| 奇美拉是什么| cd什么意思| 狗改不了吃屎是什么意思| 咖啡有什么作用和功效| 17楼五行属什么| 纯粹的人是什么性格| 脚背痛什么原因引起的| 湫是什么意思| 上海龙华医院擅长什么| cartoon什么意思| 什么样的黄河| 湿疹有什么特效药| lord什么意思| 头一直疼是什么原因| 官符是什么意思| 白喉采取什么隔离| 1941年是什么年| 超声波是什么意思| 金生水是什么意思| 牛的尾巴有什么作用| fob什么意思| 嗓子发炎吃什么水果| catl是什么意思| 结膜炎用什么眼药水| 气虚什么症状| 哺乳期感冒了能吃什么药| 血管夹层是什么病| 爬灰什么意思| 夜半是什么时辰| 美国人的祖先是什么人| 面肌痉挛吃什么药效果好| 樱桃红是什么颜色| 耳朵响吃什么药| 眼睛看东西模糊是什么原因| 慢性肾炎是什么原因引起的| 三高人群适合吃什么水果| 什么不什么身| 毒龙是什么意思啊| 肺纤维化什么意思| 侏儒症是什么原因引起的| 昆仑玉什么颜色最贵| 什么叫支原体感染| 月经量少吃什么药调理| 馥字五行属什么| 空调什么牌子好| 手发抖是什么原因引起的| 无痛肠镜和普通肠镜有什么区别| 邪魅一笑是什么意思| 2.21是什么星座| 儿童口腔疱疹吃什么药| 潜规则是什么意思| 马虎是什么意思| 手足口一般擦什么药膏| 挪威用什么货币| 喉结肿大是什么原因| 隐翅虫皮炎用什么药| 闰六月有什么讲究| 粥样动脉硬化是什么意思| 一月七号是什么星座| 妈妈的表妹叫什么| 片仔癀有什么功效| 在于是什么意思| 睡觉流口水是什么原因引起的| 缠绵是什么意思| 印刷厂主要做什么| 鼻梁高的男人说明什么| 潦草什么意思| 大便黑色的是什么原因| 武则天是什么星座的| 白色代表什么| 转氨酶偏高吃什么药| 什么实实| 血糖低会出现什么症状| 妇科炎症是什么原因引起的| 百度Перейти до вм?сту

轻松调频 CRI EZfm,from Beijing for China

Матер?ал з В?к?пед?я
百度 如果特朗普对中国600亿美元商品加征关税的计划真实施的话。

Документац?ю к тому модулу може быти створена в Модуль:Infobox/документац?я

local p = {}
local args = {}
local origArgs = {}
local root
local empty_row_categories = {}
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local lists = {
	plainlist_t = {
		patterns = {
			'^plainlist$',
			'%splainlist$',
			'^plainlist%s',
			'%splainlist%s'
		},
		found = false,
		styles = 'Plainlist/styles.css'
	},
	hlist_t = {
		patterns = {
			'^hlist$',
			'%shlist$',
			'^hlist%s',
			'%shlist%s'
		},
		found = false,
		styles = 'Hlist/styles.css'
	}
}

local function has_list_class(args_to_check)
	for _, list in pairs(lists) do
		if not list.found then
			for _, arg in pairs(args_to_check) do
				for _, pattern in ipairs(list.patterns) do
					if mw.ustring.find(arg or '', pattern) then
						list.found = true
						break
					end
				end
				if list.found then break end
			end
		end
	end
end

local function fixChildBoxes(sval, tt)
	local function notempty( s ) return s and s:match( '%S' ) end
	
	if notempty(sval) then
		local marker = '<span class=special_infobox_marker>'
		local s = sval
		-- start moving templatestyles and categories inside of table rows
		local slast = ''
		while slast ~= s do
			slast = s
			s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*%]%])', '%2%1')
			s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>%s*)(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)', '%2%1')
		end
		-- end moving templatestyles and categories inside of table rows
		s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
		s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
		if s:match(marker) then
			s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
			s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
			s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
			s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
			s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
			s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
		end
		if s:match(marker) then
			local subcells = mw.text.split(s, marker)
			s = ''
			for k = 1, #subcells do
				if k == 1 then
					s = s .. subcells[k] .. '</' .. tt .. '></tr>'
				elseif k == #subcells then
					local rowstyle = ' style="display:none"'
					if notempty(subcells[k]) then rowstyle = ''	end
					s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' ..
						subcells[k]
				elseif notempty(subcells[k]) then
					if (k % 2) == 0 then
						s = s .. subcells[k]
					else
						s = s .. '<tr><' .. tt .. ' colspan=2>\n' ..
							subcells[k] .. '</' .. tt .. '></tr>'
					end
				end
			end
		end
		-- the next two lines add a newline at the end of lists for the PHP parser
		-- [[Special:Diff/849054481]]
		-- remove when [[:phab:T191516]] is fixed or OBE
		s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
		s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
		s = mw.ustring.gsub(s, '^([%*#;:])', '\n%1')
		s = mw.ustring.gsub(s, '^(%{%|)', '\n%1')
		return s
	else
		return sval
	end
end

-- Cleans empty tables
local function cleanInfobox()
	root = tostring(root)
	if has_rows == false then
		root = mw.ustring.gsub(root, '<table[^<>]*>%s*</table>', '')
	end
end

-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)

	local vals = {}
	for k, v in pairs(t1) do
		vals[v] = true
	end
	for k, v in pairs(t2) do
		vals[v] = true
	end
	local ret = {}
	for k, v in pairs(vals) do
		table.insert(ret, k)
	end
	return ret
end

-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
	local nums = {}
	for k, v in pairs(args) do
		local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
		if num then table.insert(nums, tonumber(num)) end
	end
	table.sort(nums)
	return nums
end

-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local function addRow(rowArgs)
	
	if rowArgs.header and rowArgs.header ~= '_BLANK_' then
		has_rows = true
		has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
		
		root
			:tag('tr')
				:addClass(rowArgs.rowclass)
				:cssText(rowArgs.rowstyle)
				:tag('th')
					:attr('colspan', '2')
					:addClass('infobox-header')
					:addClass(rowArgs.class)
					:addClass(args.headerclass)
					-- @deprecated next; target .infobox-<name> .infobox-header
					:cssText(args.headerstyle)
					:cssText(rowArgs.rowcellstyle)
					:wikitext(fixChildBoxes(rowArgs.header, 'th'))
		if rowArgs.data then
			root:wikitext(
				'[[Category:Pages using infobox templates with ignored data cells]]'
			)
		end
	elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
		has_rows = true
		has_list_class({ rowArgs.rowclass, rowArgs.class })
		
		local row = root:tag('tr')
		row:addClass(rowArgs.rowclass)
		row:cssText(rowArgs.rowstyle)
		if rowArgs.label then
			row
				:tag('th')
					:attr('scope', 'row')
					:addClass('infobox-label')
					-- @deprecated next; target .infobox-<name> .infobox-label
					:cssText(args.labelstyle)
					:cssText(rowArgs.rowcellstyle)
					:wikitext(rowArgs.label)
					:done()
		end

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', not rowArgs.label and '2' or nil)
			:addClass(not rowArgs.label and 'infobox-full-data' or 'infobox-data')
			:addClass(rowArgs.class)
			-- @deprecated next; target .infobox-<name> .infobox(-full)-data
			:cssText(rowArgs.datastyle)
			:cssText(rowArgs.rowcellstyle)
			:wikitext(fixChildBoxes(rowArgs.data, 'td'))
	else
		table.insert(empty_row_categories, rowArgs.data or '')
	end
end

local function renderTitle()
	if not args.title then return end

	has_rows = true
	has_list_class({args.titleclass})
	
	root
		:tag('caption')
			:addClass('infobox-title')
			:addClass(args.titleclass)
			-- @deprecated next; target .infobox-<name> .infobox-title
			:cssText(args.titlestyle)
			:wikitext(args.title)
	
end

local function renderAboveRow()
	if not args.above then return end

	has_rows = true
	has_list_class({ args.aboveclass })
	
	root
		:tag('tr')
			:tag('th')
				:attr('colspan', '2')
				:addClass('infobox-above')
				:addClass(args.aboveclass)
				-- @deprecated next; target .infobox-<name> .infobox-above
				:cssText(args.abovestyle)
				:wikitext(fixChildBoxes(args.above,'th'))
end

local function renderBelowRow()
	if not args.below then return end

	has_rows = true
	has_list_class({ args.belowclass })
	
	root
		:tag('tr')
			:tag('td')
				:attr('colspan', '2')
				:addClass('infobox-below')
				:addClass(args.belowclass)
				-- @deprecated next; target .infobox-<name> .infobox-below
				:cssText(args.belowstyle)
				:wikitext(fixChildBoxes(args.below,'td'))
end

local function addSubheaderRow(subheaderArgs)
	if subheaderArgs.data and
		subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
		has_rows = true
		has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
		
		local row = root:tag('tr')
		row:addClass(subheaderArgs.rowclass)

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', '2')
			:addClass('infobox-subheader')
			:addClass(subheaderArgs.class)
			:cssText(subheaderArgs.datastyle)
			:cssText(subheaderArgs.rowcellstyle)
			:wikitext(fixChildBoxes(subheaderArgs.data, 'td'))
	else
		table.insert(empty_row_categories, subheaderArgs.data or '')
	end
end

local function renderSubheaders()
	if args.subheader then
		args.subheader1 = args.subheader
	end
	if args.subheaderrowclass then
		args.subheaderrowclass1 = args.subheaderrowclass
	end
	local subheadernums = getArgNums('subheader')
	for k, num in ipairs(subheadernums) do
		addSubheaderRow({
			data = args['subheader' .. tostring(num)],
			-- @deprecated next; target .infobox-<name> .infobox-subheader
			datastyle = args.subheaderstyle,
			rowcellstyle = args['subheaderstyle' .. tostring(num)],
			class = args.subheaderclass,
			rowclass = args['subheaderrowclass' .. tostring(num)]
		})
	end
end

local function addImageRow(imageArgs)

	if imageArgs.data and
		imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then

		has_rows = true
		has_list_class({ imageArgs.rowclass, imageArgs.class })
		
		local row = root:tag('tr')
		row:addClass(imageArgs.rowclass)

		local dataCell = row:tag('td')
		dataCell
			:attr('colspan', '2')
			:addClass('infobox-image')
			:addClass(imageArgs.class)
			:cssText(imageArgs.datastyle)
			:wikitext(fixChildBoxes(imageArgs.data, 'td'))
	else
		table.insert(empty_row_categories, imageArgs.data or '')
	end
end

local function renderImages()
	if args.image then
		args.image1 = args.image
	end
	if args.caption then
		args.caption1 = args.caption
	end
	local imagenums = getArgNums('image')
	for k, num in ipairs(imagenums) do
		local caption = args['caption' .. tostring(num)]
		local data = mw.html.create():wikitext(args['image' .. tostring(num)])
		if caption then
			data
				:tag('div')
					:addClass('infobox-caption')
					-- @deprecated next; target .infobox-<name> .infobox-caption
					:cssText(args.captionstyle)
					:wikitext(caption)
		end
		addImageRow({
			data = tostring(data),
			-- @deprecated next; target .infobox-<name> .infobox-image
			datastyle = args.imagestyle,
			class = args.imageclass,
			rowclass = args['imagerowclass' .. tostring(num)]
		})
	end
end

-- When autoheaders are turned on, preprocesses the rows
local function preprocessRows()
	if not args.autoheaders then return end
	
	local rownums = union(getArgNums('header'), getArgNums('data'))
	table.sort(rownums)
	local lastheader
	for k, num in ipairs(rownums) do
		if args['header' .. tostring(num)] then
			if lastheader then
				args['header' .. tostring(lastheader)] = nil
			end
			lastheader = num
		elseif args['data' .. tostring(num)] and
			args['data' .. tostring(num)]:gsub(
				category_in_empty_row_pattern, ''
			):match('^%S') then
			local data = args['data' .. tostring(num)]
			if data:gsub(category_in_empty_row_pattern, ''):match('%S') then
				lastheader = nil
			end
		end
	end
	if lastheader then
		args['header' .. tostring(lastheader)] = nil
	end
end

-- Gets the union of the header and data argument numbers,
-- and renders them all in order
local function renderRows()

	local rownums = union(getArgNums('header'), getArgNums('data'))
	table.sort(rownums)
	for k, num in ipairs(rownums) do
		addRow({
			header = args['header' .. tostring(num)],
			label = args['label' .. tostring(num)],
			data = args['data' .. tostring(num)],
			datastyle = args.datastyle,
			class = args['class' .. tostring(num)],
			rowclass = args['rowclass' .. tostring(num)],
			-- @deprecated next; target .infobox-<name> rowclass
			rowstyle = args['rowstyle' .. tostring(num)],
			rowcellstyle = args['rowcellstyle' .. tostring(num)]
		})
	end
end

local function renderNavBar()
	if not args.name then return end

	has_rows = true
	root
		:tag('tr')
			:tag('td')
				:attr('colspan', '2')
				:addClass('infobox-navbar')
				:wikitext(require('Module:Navbar')._navbar{
					args.name,
					mini = 1,
				})
end

local function renderItalicTitle()
	local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
	if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
		root:wikitext(require('Module:Italic title')._main({}))
	end
end

-- Categories in otherwise empty rows are collected in empty_row_categories.
-- This function adds them to the module output. It is not affected by
-- args.decat because this module should not prevent module-external categories
-- from rendering.
local function renderEmptyRowCategories()
	for _, s in ipairs(empty_row_categories) do
		root:wikitext(s)
	end
end

-- Render tracking categories. args.decat == turns off tracking categories.
local function renderTrackingCategories()
	if args.decat == 'yes' then return end
	if args.child == 'yes' then
		if args.title then
			root:wikitext(
				'[[Category:Pages using embedded infobox templates with the title parameter]]'
			)
		end
	elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
		root:wikitext('[[Category:Articles using infobox templates with no data rows]]')
	end
end

--[=[
Loads the templatestyles for the infobox.

TODO: FINISH loading base templatestyles here rather than in
MediaWiki:Common.css. There are 4-5000 pages with 'raw' infobox tables.
See [[Mediawiki_talk:Common.css/to_do#Infobox]] and/or come help :).
When we do this we should clean up the inline CSS below too.
Will have to do some bizarre conversion category like with sidebar.

]=]
local function loadTemplateStyles()
	local frame = mw.getCurrentFrame()
	
	local hlist_templatestyles = ''
	if lists.hlist_t.found then
		hlist_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = lists.hlist_t.styles }
		}
	end
	
	local plainlist_templatestyles = ''
	if lists.plainlist_t.found then
		plainlist_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = lists.plainlist_t.styles }
		}
	end
	
	-- See function description
	local base_templatestyles = frame:extensionTag{
		name = 'templatestyles', args = { src = 'Module:Infobox/styles.css' }
	}

	local templatestyles = ''
	if args['templatestyles'] then
		templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['templatestyles'] }
		}
	end
	
	local child_templatestyles = ''
	if args['child templatestyles'] then
		child_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['child templatestyles'] }
		}
	end
	
	local grandchild_templatestyles = ''
	if args['grandchild templatestyles'] then
		grandchild_templatestyles = frame:extensionTag{
			name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
		}
	end
	
	return table.concat({
		-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
		-- this ordering is not a guarantee because the rows of interest invoking
		-- each class may not be on a specific page
		hlist_templatestyles,
		plainlist_templatestyles,
		base_templatestyles,
		templatestyles,
		child_templatestyles,
		grandchild_templatestyles
	})
end

-- common functions between the child and non child cases
local function structure_infobox_common()
	renderSubheaders()
	renderImages()
	preprocessRows()
	renderRows()
	renderBelowRow()
	renderNavBar()
	renderItalicTitle()
	renderEmptyRowCategories()
	renderTrackingCategories()
	cleanInfobox()
end

-- Specify the overall layout of the infobox, with special settings if the
-- infobox is used as a 'child' inside another infobox.
local function _infobox()
	if args.child ~= 'yes' then
		root = mw.html.create('table')

		root
			:addClass(args.subbox == 'yes' and 'infobox-subbox' or 'infobox')
			:addClass(args.bodyclass)
			-- @deprecated next; target .infobox-<name>
			:cssText(args.bodystyle)
		
		has_list_class({ args.bodyclass })

		renderTitle()
		renderAboveRow()
	else
		root = mw.html.create()

		root
			:wikitext(args.title)
	end
	structure_infobox_common()
	
	return loadTemplateStyles() .. root
end

-- If the argument exists and isn't blank, add it to the argument table.
-- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
local function preprocessSingleArg(argName)
	if origArgs[argName] and origArgs[argName] ~= '' then
		args[argName] = origArgs[argName]
	end
end

-- Assign the parameters with the given prefixes to the args table, in order, in
-- batches of the step size specified. This is to prevent references etc. from
-- appearing in the wrong order. The prefixTable should be an array containing
-- tables, each of which has two possible fields, a "prefix" string and a
-- "depend" table. The function always parses parameters containing the "prefix"
-- string, but only parses parameters in the "depend" table if the prefix
-- parameter is present and non-blank.
local function preprocessArgs(prefixTable, step)
	if type(prefixTable) ~= 'table' then
		error("Non-table value detected for the prefix table", 2)
	end
	if type(step) ~= 'number' then
		error("Invalid step value detected", 2)
	end

	-- Get arguments without a number suffix, and check for bad input.
	for i,v in ipairs(prefixTable) do
		if type(v) ~= 'table' or type(v.prefix) ~= "string" or
			(v.depend and type(v.depend) ~= 'table') then
			error('Invalid input detected to preprocessArgs prefix table', 2)
		end
		preprocessSingleArg(v.prefix)
		-- Only parse the depend parameter if the prefix parameter is present
		-- and not blank.
		if args[v.prefix] and v.depend then
			for j, dependValue in ipairs(v.depend) do
				if type(dependValue) ~= 'string' then
					error('Invalid "depend" parameter value detected in preprocessArgs')
				end
				preprocessSingleArg(dependValue)
			end
		end
	end

	-- Get arguments with number suffixes.
	local a = 1 -- Counter variable.
	local moreArgumentsExist = true
	while moreArgumentsExist == true do
		moreArgumentsExist = false
		for i = a, a + step - 1 do
			for j,v in ipairs(prefixTable) do
				local prefixArgName = v.prefix .. tostring(i)
				if origArgs[prefixArgName] then
					-- Do another loop if any arguments are found, even blank ones.
					moreArgumentsExist = true
					preprocessSingleArg(prefixArgName)
				end
				-- Process the depend table if the prefix argument is present
				-- and not blank, or we are processing "prefix1" and "prefix" is
				-- present and not blank, and if the depend table is present.
				if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
					for j,dependValue in ipairs(v.depend) do
						local dependArgName = dependValue .. tostring(i)
						preprocessSingleArg(dependArgName)
					end
				end
			end
		end
		a = a + step
	end
end

-- Parse the data parameters in the same order that the old {{infobox}} did, so
-- that references etc. will display in the expected places. Parameters that
-- depend on another parameter are only processed if that parameter is present,
-- to avoid phantom references appearing in article reference lists.
local function parseDataParameters()

	preprocessSingleArg('autoheaders')
	preprocessSingleArg('child')
	preprocessSingleArg('bodyclass')
	preprocessSingleArg('subbox')
	preprocessSingleArg('bodystyle')
	preprocessSingleArg('title')
	preprocessSingleArg('titleclass')
	preprocessSingleArg('titlestyle')
	preprocessSingleArg('above')
	preprocessSingleArg('aboveclass')
	preprocessSingleArg('abovestyle')
	preprocessArgs({
		{prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
	}, 10)
	preprocessSingleArg('subheaderstyle')
	preprocessSingleArg('subheaderclass')
	preprocessArgs({
		{prefix = 'image', depend = {'caption', 'imagerowclass'}}
	}, 10)
	preprocessSingleArg('captionstyle')
	preprocessSingleArg('imagestyle')
	preprocessSingleArg('imageclass')
	preprocessArgs({
		{prefix = 'header'},
		{prefix = 'data', depend = {'label'}},
		{prefix = 'rowclass'},
		{prefix = 'rowstyle'},
		{prefix = 'rowcellstyle'},
		{prefix = 'class'}
	}, 50)
	preprocessSingleArg('headerclass')
	preprocessSingleArg('headerstyle')
	preprocessSingleArg('labelstyle')
	preprocessSingleArg('datastyle')
	preprocessSingleArg('below')
	preprocessSingleArg('belowclass')
	preprocessSingleArg('belowstyle')
	preprocessSingleArg('name')
	-- different behaviour for italics if blank or absent
	args['italic title'] = origArgs['italic title']
	preprocessSingleArg('decat')
	preprocessSingleArg('templatestyles')
	preprocessSingleArg('child templatestyles')
	preprocessSingleArg('grandchild templatestyles')
end

-- If called via #invoke, use the args passed into the invoking template.
-- Otherwise, for testing purposes, assume args are being passed directly in.
function p.infobox(frame)
	if frame == mw.getCurrentFrame() then
		origArgs = frame:getParent().args
	else
		origArgs = frame
	end
	
	parseDataParameters()
	
	return _infobox()
end

-- For calling via #invoke within a template
function p.infoboxTemplate(frame)
	origArgs = {}
	for k,v in pairs(frame.args) do origArgs[k] = mw.text.trim(v) end
	
	parseDataParameters()
	
	return _infobox()
end
return p
心态好是什么意思 西瓜霜是什么 果脯是什么 形近字什么意思 亲家母是什么意思
前胸贴后背是什么意思 美女的阴暗是什么样的 月经一直不停有什么办法止血 喝白醋有什么好处 当所有的人离开我的时候是什么歌
抽血前喝水有什么影响 小狗能吃什么水果 三大精神是什么 党的性质是什么 627是什么星座
十年什么婚 狗属于什么类动物 hvp是什么 坐飞机要什么证件 肝阳上亢是什么意思
b是什么元素hcv8jop9ns9r.cn 女人梦见猪是什么预兆hcv8jop2ns9r.cn hpv什么时候检查最好ff14chat.com 香兰素是什么东西hcv8jop0ns7r.cn kaws是什么牌子hcv9jop7ns9r.cn
龟头炎用什么软膏hcv8jop2ns1r.cn 什么是羊蝎子hcv9jop4ns2r.cn 牛肉不能和什么一起吃hcv7jop9ns8r.cn 小基数是什么意思hcv8jop6ns7r.cn 急性心力衰竭的急救措施是什么hcv7jop9ns7r.cn
美籍华人是什么意思hcv7jop7ns4r.cn 雨露均沾什么意思hcv9jop3ns4r.cn 月子可以吃什么菜hcv8jop3ns6r.cn 阑尾在人体的什么位置hcv7jop7ns2r.cn 舌苔黄是什么原因引起的hcv9jop3ns9r.cn
hpv是什么东西cl108k.com 孩子吃什么有助于长高hcv9jop0ns1r.cn 寄托是什么意思hcv8jop0ns9r.cn 七月是什么生肖hcv9jop6ns4r.cn 拔罐出水是什么原因hcv8jop0ns5r.cn
百度