姝是什么意思| 黄瓜和什么一起炒好吃| 贱痣是什么意思| 前列腺炎吃什么消炎药好| 152是什么意思| 精神是什么意思| 十一月七号是什么星座| 宝宝什么时候断奶最好| 入殓师是干什么的| 一案双查是什么意思| 01年属蛇的是什么命| 好朋友是什么意思| 糖尿病吃什么食物最好| 出汗多什么原因| 知了猴吃什么长大的| 冬虫夏草有什么好处| 便秘吃什么菜有助排便| 柠檬片泡水喝有什么功效和作用| 李嘉诚属什么生肖| 嘴苦是什么原因引起的| 月关是什么意思| mlf是什么意思| 姊是什么意思| 绝眼是什么原因引起的| 皮下男是什么意思| 胎盘内血池是什么| 椎体终板炎是什么病| 小孩腿抽筋是什么原因引起的| 射进去有什么感觉| 孩子脾胃虚弱吃什么药| 什么是宫颈息肉| kipling是什么牌子| 郑州有什么特产| 阿托品属于什么类药物| 桐字属于五行属什么| 糖尿病人吃什么水果最好| 老婆生日送什么鲜花| 碘过量会导致什么疾病| 鱼上浮的原因是什么| 星链是什么| 香菜吃多了有什么坏处| 甲亢在中医里叫什么病| 1882年属什么生肖| 头晕在医院挂什么科| 全棉和纯棉有什么区别| 妊娠高血压对胎儿有什么影响| 门口放镜子有什么讲究| 为什么蚊子总是咬我| left是什么意思| 手腕疼挂什么科| 喜怒无常是什么意思| 什么叫做红颜知己| 长目飞耳是什么动物| 节哀顺便是什么意思| 小孩低烧吃什么药| 叶凡为什么要找荒天帝| 90年是什么命| 阴是什么生肖| 什么的滋味| 两票制指的是什么| 胃充盈欠佳是什么意思| 达芬奇发明了什么| 大智若愚什么意思| 10.25是什么星座| 巳火是什么火| 大便糊状什么原因| 男性射精是什么感觉| 吉星高照是什么生肖| 急性胃炎吃什么药| 什么防晒霜防晒效果好| 直肠指检能检查出什么| 喉咙肿大是什么原因| 龙虾的血是什么颜色的| 四川九寨沟什么时候去最好| 早博是什么| 骨头是什么垃圾| 牙齿松动什么原因| 孕妇用什么驱蚊最安全| 木堂念什么| 容易口腔溃疡什么原因| 胡言乱语是什么意思| 脖子后面有痣代表什么| 欺世盗名是什么生肖| 做完肠镜需要注意什么| 尧五行属什么| 奚字五行属什么| 14k金是什么意思| 什么是真菌感染| 头眩晕是什么原因引起的| 鼻头出汗是什么原因| 思利及人是什么意思| 狮子的天敌是什么动物| 生姜红糖水有什么作用| 奥美拉唑治什么病| 为什么来完月经下面痒| 牛肉用什么调料| 九月九日是什么日子| 缺黄体酮会有什么症状| 打美国电话前面加什么| 嗓子痒痒老想咳嗽是什么原因| 什么样的礼物| 被动是什么意思| 搓是什么意思| 吃什么减肥瘦肚子| 负责是什么意思| 女生两个月没来月经是什么原因| 喝酒伤什么器官| 施食是什么意思| 尿分叉是什么原因引起的| 为什么会有台风| 素颜霜是什么| 卤门什么时候闭合| 阑尾炎什么症状| 羊水污染是什么原因造成的| 熊猫长什么样| 怀孕了用排卵试纸测会显示什么| 泌尿科主要看什么病| 是什么单位| 垂体催乳素高是什么原因| 嗓子干吃什么药| 血脂高吃什么降血脂| 柠字五行属什么| 耳朵后面长痘痘是什么原因| 小儿惊风是什么症状| 经期吃凉的东西有什么影响| 阴唇为什么会长痘痘| 苹果醋有什么作用| 什么月披星| 不免是什么意思| 田此读什么| 心脏不舒服有什么症状| 拉肚子吃什么水果| 高考什么时候恢复的| 无名指戴戒指什么意思| 内分泌失调是什么| 梦见洗车是什么意思| 三头六臂是什么生肖| 咳嗽能吃什么水果| hpd是什么意思| 捡和拣有什么区别| jordan是什么意思| 10月份是什么星座| 冠状沟是什么位置| 啤酒ipa是什么意思| 什么样的羽毛| 58什么意思| 嘴贱什么意思| 贵人多忘事是什么意思| ct平扫能检查出什么| 东北有什么特产| 女生diy什么意思| iwc手表是什么档次| 九牛一毛是什么生肖| 陶土色大便是什么颜色| 一个合一个页读什么| 省委组织部长是什么级别| 天空为什么会打雷| 乙肝小三阳是什么意思| 农历六月十八是什么日子| 支原体感染咳嗽吃什么药| lu是什么单位| 乳腺结节吃什么好| 什么河水| 破伤风是什么意思| 医保是什么| 纳入是什么意思| 与众不同是什么意思| 肺部纹理增粗是什么意思| 青岛啤酒节是什么时候| 5月26日什么星座| 邮政编码是什么意思| 贫血严重会得什么病| 睾丸肿痛吃什么药| 什么是肝癌| l do是什么意思| 分数值是什么意思| 临官是什么意思| 莫名心慌是什么原因| 水痘疤痕用什么药膏| 砗磲是什么| 女生安全期是什么时候| 3.25是什么星座| 脚面肿是什么原因| 什么相马| 恨不相逢未嫁时什么意思| 肾结石不能吃什么东西| 肩膀疼挂什么科| 阳历六月是什么星座| 什么是频率| 什么是瞬时速度| 什么时候收花生| 分泌物发黄是什么原因| 眼睛模糊用什么眼药水| 孩子百天有什么讲究| 纬字五行属什么| 白炽灯属于什么光源| 是什么字| 腋下黑是什么原因| 绿豆汤是什么颜色| 秋天能干什么| 养老院护工都做些什么| 为什么有眼袋是什么原因引起的| 肚子大了是什么原因造成的| 尿隐血是什么原因| 装藏是什么意思| 陶渊明是什么派诗人| 溢于言表什么意思| 脚抽筋吃什么药| 点痣去医院挂什么科| 什么地流着| 女人什么年龄性最旺| 吃什么对肝最好| 教师节该送什么礼物| qs是什么意思| 吃海参有什么功效| 没有胎心胎芽是什么原因造成的| 9月27是什么星座| 百合花什么时候种植| 1为什么读yao| 什么是人工智能| 大便常规检查能查出什么| 创客是什么意思| 派大星是什么动物| 学痞是什么意思| 天行健下一句是什么| 咳嗽一直不好是什么原因怎么治| 1981属什么生肖| 生姜水洗头有什么好处| 低脂牛奶适合什么人喝| 日在校园讲的是什么| 正财透干是什么意思| 吃什么药| 铁面无私是什么生肖| 阳历1月份是什么星座| 中期唐氏筛查查什么| 12月31号什么星座| 支气管炎能吃什么水果| 为什么呢| 什么充电宝可以带上飞机| 肌肉萎缩吃什么药| 胎位lop是什么意思| 口蜜什么剑| 煞科什么意思| ems是什么意思| 白色糠疹是什么原因引起的| 有胃病的人吃什么最养胃| 网恋是什么意思| 龋齿挂什么科| 吸土是什么意思| 眼睛肿了用什么药| 慢性萎缩性胃炎吃什么药可以根治| 失去味觉是什么原因| 驾驶证b2能开什么车| 金银花洗澡对婴儿有什么好处| kai是什么意思| 对什么感兴趣| 血小板高什么原因| 女猴配什么属相最好| 两肺纹理增多什么意思| 痤疮是什么东西| 性是什么意思| 五月十二号是什么日子| 绿茶妹是什么意思| 大夫古代指什么| 百度Aller au contenu

统帅联手苏宁开启战略合作 推出面向年轻人的“极速”空调

èn ?rtike di Wikipedia.
百度 上人认为,这么好的东西,应该让大家一起分享。

La documentation pour ce module peut être créée à Module:Infobox/doc

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 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
		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(
				'[[Kategori:Halaman dengan sel data kotak info yang dihiraukan]]'
			)
		end
	elseif rowArgs.data and rowArgs.data:gsub(
			category_in_empty_row_pattern, ''
		):match('^%S') then
		has_rows = true
		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
	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
	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
	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
		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
		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('Modul: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(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
	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(
				'[[Kategori:Halaman dengan parameter judul awal kotak info]]'
			)
		end
	elseif #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
		root:wikitext('[[Kategori:Artikel yang menggunakan kotak info yang tidak memiliki kolom data]]')
	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()
	
	-- See function description
	local base_templatestyles = frame:extensionTag{
		name = 'templatestyles', args = { src = 'Modul: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({
		base_templatestyles, -- see function description
		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)

		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
大鱼际疼是什么原因 不耐受和过敏有什么区别 太白金星是什么神 复方板蓝根和板蓝根有什么区别 脑血管堵塞吃什么药最好
甲鱼炖什么好吃 不服是什么意思 grace是什么意思 汛期什么意思 9月25日什么星座
大麦茶有什么功效与作用 破伤风针有什么作用 牛肉饺子馅配什么蔬菜 行号是什么 牛标志的车是什么牌子
西安有什么美食 25度穿什么衣服合适 膀胱炎是什么症状表现 福晋是什么意思 为什么女的会流水怎么回事
为什么叫五七干校hcv7jop4ns6r.cn 消炎痛又叫什么hcv9jop2ns2r.cn pd-l1是什么hcv9jop7ns0r.cn 脑梗会引起什么症状hcv7jop7ns3r.cn 安全生产职责是什么hcv8jop8ns5r.cn
脑膜炎是什么原因引起的hcv9jop1ns5r.cn 惊悸的意思是什么hcv8jop4ns5r.cn 乳腺炎不能吃什么hcv8jop1ns4r.cn 今年37岁属什么生肖hcv7jop5ns5r.cn 白肺是什么hcv7jop7ns4r.cn
印泥用什么能洗掉hcv8jop8ns4r.cn 爱吐口水是什么原因hcv7jop7ns2r.cn 石楠花是什么味道youbangsi.com 岐黄是什么意思hcv9jop3ns9r.cn 烤乳猪用的是什么猪hcv9jop3ns1r.cn
肺痿是什么意思hcv8jop0ns3r.cn 千年修炼是什么生肖hcv9jop7ns3r.cn 梦见摘豆角是什么预兆hcv9jop4ns6r.cn 人头什么动hcv9jop5ns6r.cn 吃什么补白细胞最快hcv8jop1ns0r.cn
百度