四级士官是什么级别| 尉迟恭是什么生肖| ed50是什么意思| 独一无二是什么生肖| 牙根变黑是什么原因| 打车费计入什么科目| 孕妇待产需要准备什么| 韭菜籽配什么壮阳最猛| 头发长的快是什么原因| 承五行属什么| 什么鱼适合做酸菜鱼| 石英表是什么意思| 上海为什么被称为魔都| ed患者是什么意思| 胃消化不良吃什么药| 熬夜到什么程度会猝死| 阴虱用什么药最有效| c7是什么意思| 男人吃六味地黄丸有什么好处| 受惊吓吃什么药| 精液是什么味道的| 蛲虫吃什么药| 属狗与什么属相相合| 送长辈什么礼物合适| 意境是什么意思| 心如刀割是什么意思| 肌肉拉伤看什么科室| 化妆棉是干什么用的| 雾化对小孩有什么影响或者副作用| 观音菩萨的坐骑是什么| 林冲是什么生肖| 5月22是什么星座| 舌苔厚白吃什么药最好| 智齿是什么意思| 末梢神经炎吃什么药| 特效是什么意思| 什么的鸽子| pin什么意思| 广州的市花是什么| 橘子是什么季节| 胃酸胃胀反酸水吃什么药| 尿检粘液丝高什么意思| 缺失是什么意思| 开车穿什么鞋最好| 3月21是什么星座| 黄色是什么颜色组成的| europe是什么意思| 补办身份证要带什么| 50岁今年属什么生肖| 姨妈痛吃什么药| 吃什么补白细胞快| 马属相和什么属相最配| 喝酒为什么会头疼| 贫血严重会导致什么后果| negative是什么意思| 为什么会说梦话| 什么鸟会说话| 为宜是什么意思| 嘴苦是什么原因| 男性阴囊瘙痒是什么病| 臣字五行属什么| 但微颔之的之是什么意思| 梦见打死猫有什么预兆| 女性胆囊炎有什么症状| 天津副市长什么级别| 为什么微信运动总是显示步数为0| 现字五行属什么| soda是什么意思| 头疼头晕去医院挂什么科| 海绵体供血不足吃什么药| 孙五行属什么| 二院是什么医院| 梦见假牙掉了是什么意思| 肝脂肪浸润是什么意思| c2能开什么车| 闲的蛋疼是什么意思| 热水器什么牌子好| 肝硬化挂什么科| 眼睛有眼屎用什么眼药水| 胰腺是什么病| 人是什么结构| 评头论足什么意思| 结婚25年属于什么婚| 狗狗中毒了用什么办法可以解毒| 急性肠胃炎吃什么水果| 什么学习机好| 9月10号是什么星座| 肾阴虚是什么症状| 什么样的伤口需要打破伤风| 比熊吃什么牌子狗粮好| 怀孕时间从什么时候开始算| 内膜厚吃什么药掉内膜| 耵聍是什么东西| 什么是人棉| 梦见屎是什么预兆| 腰疼是什么原因引起的男性| 心慌手抖是什么原因| 曹植字什么| 叶酸每天什么时候吃最好| 什么是麻疹| 梦见吃李子是什么意思| 时柱比肩是什么意思| 有痰吃什么药| 闪亮的什么| 吃什么降尿酸最快| 什么情况下挂疼痛科| xmm是什么意思| 软蛋是什么意思| 什么动物有三个心脏| 心态是什么意思| 大米粉做什么好吃| 单剂量给药是什么意思| 人丹是什么药| 三星堆为什么叫三星堆| 巨蟹座的幸运色是什么颜色| 低血钾吃什么补上来的快| 相思成疾是什么意思| 胎盘低置是什么原因造成的| 宝子是什么意思| 吃什么容易怀女儿| 油头粉面是什么意思| 什么是激光| 保养是什么意思| 颅内出血有什么症状| 3月25号是什么星座| 大嘴巴是什么意思| 铁锈是什么颜色的| 风热感冒吃什么药| 橙色五行属什么| 2007年五行属什么| 七九年属什么的| 检查肾功能挂什么科| 过氧化氢阳性什么意思| 来月经喝红糖水有什么好处| 矫正度数是什么意思| 枕头发黄是什么原因| 农历六月是什么生肖| 米线是什么做的| 什么童话| 党的执政理念是什么| 男人胸前有痣代表什么意思| 25羟维生素d测定是什么| 失眠吃什么| 718是什么星座| 腹部胀痛什么原因| 属狗是什么命| 血小板低是什么引起的| 双顶径是什么意思| 紫玫瑰花语是什么意思| 就坡下驴什么意思| 为什么容易出汗| 女人戴什么手串辟邪| 什么烟最贵| mrna是什么| 春天有什么动物| 夏天吃羊肉有什么好处| 螺旋杆菌有什么症状| 军校毕业是什么军衔| 什么病会通过唾液传播| 什么人不适合做收银员| 阴虚阳亢吃什么中成药| 2003年是什么命| 完美收官是什么意思| 舌苔发白厚吃什么药| 梦见抽血是什么预兆| 吃马齿苋有什么好处| 焦虑症是什么病| 为什么喜欢春天| 慎重的意思是什么| 类风湿不能吃什么食物| 检查肝挂什么科| 什么风什么面| 淋巴滤泡增生用什么药能彻底治愈| 按摩椅什么牌子最好| 人体缺甲是什么症状| 左耳朵痒代表什么预兆| 围度什么意思| 望尘莫及的及是什么意思| 肌酐高什么东西不能吃| 血竭是什么东西| 牙疼是什么原因| 肝阳虚吃什么中成药| ccs医学是什么意思| 圣女是什么意思| 红苋菜不能和什么一起吃| 什么情况下才做冠脉cta| 自食恶果是什么意思| 血脂高吃什么油好| 白月光什么意思| 人参片泡水喝有什么功效和作用| 蜈蚣进家有什么预兆| 耳洞为什么会发臭| 静怡是什么意思| 咳嗽喝什么汤好| 泰斗是什么意思| 甲状腺什么原因引起的| 卡介苗什么时候接种| 咖啡与什么食物相克| 荔枝不能与什么一起吃| 梦见自己生了个女儿是什么预兆| 什么龙戏珠| 肠梗阻什么症状| 肺部结节是什么意思啊| 京酱肉丝用什么酱| 毅力是什么意思| 什么快递可以寄宠物| rv医学上是什么意思| 女人怀孕的最佳时间是什么时间| 做梦抓鱼什么意思周公解梦| 笑死是什么意思| 世界上什么东西最大| 林檎是什么意思| 好景不长是什么意思| 织女是什么意思| 2000年属什么的| 两小无猜是什么意思| 海松茸是什么东西| 功名利禄是什么意思| 喉咙老是有白痰是什么原因| 骑单车锻炼什么好处| 25分贝相当于什么声音| 澎湃是什么意思| 吃鱼生后吃什么打虫药| 吃什么不长胖| 角化异常性疾病是什么| 晚生是什么意思| 囊性灶什么意思| prn是什么医嘱| 指甲凹陷是什么原因引起的| 尿多是什么回事| 八月初十是什么星座| 漂洋过海是什么生肖| 林彪为什么叛逃| 蒹葭是什么| 什么样的季节| 幽门螺杆菌感染有什么症状和表现| 荔枝有什么作用与功效| 孕妇梦见捡鸡蛋是什么意思| 气血不足吃什么调理| 奉天为什么改名沈阳| 老年人总睡觉是什么原因| 保鲜卡是什么原理纸片| 蚊子怕什么颜色| 参保是什么意思| 知天命是什么年纪| 银耳为什么助湿气| 太多的理由太多的借口是什么歌| 鼻子出血挂什么科| 紫色适合什么肤色的人| 肠炎吃什么药效果最好| 高考明天考什么| 桂圆和龙眼有什么区别| 两个百字念什么| 全身检查要挂什么科| 经期洗澡有什么影响| 肺结核有什么症状| 顺风顺水什么意思| 申字五行属什么| 不可磨灭是什么意思| 阴唇肥大是什么原因| 女生被口是什么感觉| 文爱是什么意思| 金国是什么民族| 红茶用什么茶具泡好| 百度

《斗罗大陆神界传说2》评测:这届的斗罗有点猛

Module documentation
This module is copied from the English Wikipedia page en:Module:Message box. It has no documentation, and relevant information may be found at the corresponding English Wikipedia documentation page. For more details see the editing history of the module.
百度 他说,这还包括电子战、通信管理和情报。

The above documentation is transcluded from Module:Message box/doc.


-- This is a meta-module for producing message box templates, including
-- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.

-- Load necessary modules.
require('Module:No globals')
local getArgs
local yesno = require('Module:Yesno')

-- Get a language object for formatDate and ucfirst.
local lang = mw.language.getContentLanguage()

-- Define constants
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}

--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------

local function getTitleObject(...)
	-- Get the title object, passing the function through pcall
	-- in case we are over the expensive function count limit.
	local success, title = pcall(mw.title.new, ...)
	if success then
		return title
	end
end

local function union(t1, t2)
	-- Returns the union of two arrays.
	local vals = {}
	for i, v in ipairs(t1) do
		vals[v] = true
	end
	for i, v in ipairs(t2) do
		vals[v] = true
	end
	local ret = {}
	for k in pairs(vals) do
		table.insert(ret, k)
	end
	table.sort(ret)
	return ret
end

local function getArgNums(args, prefix)
	local nums = {}
	for k, v in pairs(args) do
		local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
		if num then
			table.insert(nums, tonumber(num))
		end
	end
	table.sort(nums)
	return nums
end

--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------

local MessageBox = {}
MessageBox.__index = MessageBox

function MessageBox.new(boxType, args, cfg)
	args = args or {}
	local obj = {}

	-- Set the title object and the namespace.
	obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()

	-- Set the config for our box type.
	obj.cfg = cfg[boxType]
	if not obj.cfg then
		local ns = obj.title.namespace
		-- boxType is "mbox" or invalid input
		if args.demospace and args.demospace ~= '' then
			-- implement demospace parameter of mbox
			local demospace = string.lower(args.demospace)
			if DEMOSPACES[demospace] then
				-- use template from DEMOSPACES
				obj.cfg = cfg[DEMOSPACES[demospace]]
			elseif string.find( demospace, 'talk' ) then
				-- demo as a talk page
				obj.cfg = cfg.tmbox
			else
				-- default to ombox
				obj.cfg = cfg.ombox
			end
		elseif ns == 0 then
			obj.cfg = cfg.ambox -- main namespace
		elseif ns == 6 then
			obj.cfg = cfg.imbox -- file namespace
		elseif ns == 14 then
			obj.cfg = cfg.cmbox -- category namespace
		else
			local nsTable = mw.site.namespaces[ns]
			if nsTable and nsTable.isTalk then
				obj.cfg = cfg.tmbox -- any talk namespace
			else
				obj.cfg = cfg.ombox -- other namespaces or invalid input
			end
		end
	end

	-- Set the arguments, and remove all blank arguments except for the ones
	-- listed in cfg.allowBlankParams.
	do
		local newArgs = {}
		for k, v in pairs(args) do
			if v ~= '' then
				newArgs[k] = v
			end
		end
		for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
			newArgs[param] = args[param]
		end
		obj.args = newArgs
	end

	-- Define internal data structure.
	obj.categories = {}
	obj.classes = {}
	-- For lazy loading of [[Module:Category handler]].
	obj.hasCategories = false

	return setmetatable(obj, MessageBox)
end

function MessageBox:addCat(ns, cat, sort)
	if not cat then
		return nil
	end
	if sort then
		cat = string.format('[[Category:%s|%s]]', cat, sort)
	else
		cat = string.format('[[Category:%s]]', cat)
	end
	self.hasCategories = true
	self.categories[ns] = self.categories[ns] or {}
	table.insert(self.categories[ns], cat)
end

function MessageBox:addClass(class)
	if not class then
		return nil
	end
	table.insert(self.classes, class)
end

function MessageBox:setParameters()
	local args = self.args
	local cfg = self.cfg

	-- Get type data.
	self.type = args.type
	local typeData = cfg.types[self.type]
	self.invalidTypeError = cfg.showInvalidTypeError
		and self.type
		and not typeData
	typeData = typeData or cfg.types[cfg.default]
	self.typeClass = typeData.class
	self.typeImage = typeData.image

	-- Find if the box has been wrongly substituted.
	self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'

	-- Find whether we are using a small message box.
	self.isSmall = cfg.allowSmall and (
		cfg.smallParam and args.small == cfg.smallParam
		or not cfg.smallParam and yesno(args.small)
	)

	-- Add attributes, classes and styles.
	self.id = args.id
	self.name = args.name
	if self.name then
		self:addClass('box-' .. string.gsub(self.name,' ','_'))
	end
	if yesno(args.plainlinks) ~= false then
		self:addClass('plainlinks')
	end
	for _, class in ipairs(cfg.classes or {}) do
		self:addClass(class)
	end
	if self.isSmall then
		self:addClass(cfg.smallClass or 'mbox-small')
	end
	self:addClass(self.typeClass)
	self:addClass(args.class)
	self.style = args.style
	self.attrs = args.attrs

	-- Set text style.
	self.textstyle = args.textstyle

	-- Find if we are on the template page or not. This functionality is only
	-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
	-- and cfg.templateCategoryRequireName are set.
	self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
	if self.useCollapsibleTextFields
		or cfg.templateCategory
		and cfg.templateCategoryRequireName
	then
		if self.name then
			local templateName = mw.ustring.match(
				self.name,
				'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
			) or self.name
			templateName = 'Template:' .. templateName
			self.templateTitle = getTitleObject(templateName)
		end
		self.isTemplatePage = self.templateTitle
			and mw.title.equals(self.title, self.templateTitle)
	end
	
	-- Process data for collapsible text fields. At the moment these are only
	-- used in {{ambox}}.
	if self.useCollapsibleTextFields then
		-- Get the self.issue value.
		if self.isSmall and args.smalltext then
			self.issue = args.smalltext
		else
			local sect
			if args.sect == '' then
				sect = 'This ' .. (cfg.sectionDefault or 'page')
			elseif type(args.sect) == 'string' then
				sect = 'This ' .. args.sect
			end
			local issue = args.issue
			issue = type(issue) == 'string' and issue ~= '' and issue or nil
			local text = args.text
			text = type(text) == 'string' and text or nil
			local issues = {}
			table.insert(issues, sect)
			table.insert(issues, issue)
			table.insert(issues, text)
			self.issue = table.concat(issues, ' ')
		end

		-- Get the self.talk value.
		local talk = args.talk
		-- Show talk links on the template page or template subpages if the talk
		-- parameter is blank.
		if talk == ''
			and self.templateTitle
			and (
				mw.title.equals(self.templateTitle, self.title)
				or self.title:isSubpageOf(self.templateTitle)
			)
		then
			talk = '#'
		elseif talk == '' then
			talk = nil
		end
		if talk then
			-- If the talk value is a talk page, make a link to that page. Else
			-- assume that it's a section heading, and make a link to the talk
			-- page of the current page with that section heading.
			local talkTitle = getTitleObject(talk)
			local talkArgIsTalkPage = true
			if not talkTitle or not talkTitle.isTalkPage then
				talkArgIsTalkPage = false
				talkTitle = getTitleObject(
					self.title.text,
					mw.site.namespaces[self.title.namespace].talk.id
				)
			end
			if talkTitle and talkTitle.exists then
                local talkText
                if self.isSmall then
                    local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
                    talkText = string.format('([[%s|talk]])', talkLink)
                else
                    talkText = 'Relevant discussion may be found on'
                    if talkArgIsTalkPage then
                        talkText = string.format(
                            '%s [[%s|%s]].',
                            talkText,
                            talk,
                            talkTitle.prefixedText
                        )
                    else
                        talkText = string.format(
                            '%s the [[%s#%s|talk page]].',
                            talkText,
                            talkTitle.prefixedText,
                            talk
                        )
                    end
                end
				self.talk = talkText
			end
		end

		-- Get other values.
		self.fix = args.fix ~= '' and args.fix or nil
		local date
		if args.date and args.date ~= '' then
			date = args.date
		elseif args.date == '' and self.isTemplatePage then
			date = lang:formatDate('F Y')
		end
		if date then
			self.date = string.format(" <span class='date-container'>''(<span class='date'>%s</span>)''</span>", date)
		end
		self.info = args.info
		if yesno(args.removalnotice) then
			self.removalNotice = cfg.removalNotice
		end
	end

	-- Set the non-collapsible text field. At the moment this is used by all box
	-- types other than ambox, and also by ambox when small=yes.
	if self.isSmall then
		self.text = args.smalltext or args.text
	else
		self.text = args.text
	end

	-- Set the below row.
	self.below = cfg.below and args.below

	-- General image settings.
	self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
	self.imageEmptyCell = cfg.imageEmptyCell
	if cfg.imageEmptyCellStyle then
		self.imageEmptyCellStyle = 'border:none;padding:0;width:1px'
	end

	-- Left image settings.
	local imageLeft = self.isSmall and args.smallimage or args.image
	if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
		or not cfg.imageCheckBlank and imageLeft ~= 'none'
	then
		self.imageLeft = imageLeft
		if not imageLeft then
			local imageSize = self.isSmall
				and (cfg.imageSmallSize or '30x30px')
				or '40x40px'
			self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
				or 'Imbox notice.png', imageSize)
		end
	end

	-- Right image settings.
	local imageRight = self.isSmall and args.smallimageright or args.imageright
	if not (cfg.imageRightNone and imageRight == 'none') then
		self.imageRight = imageRight
	end
end

function MessageBox:setMainspaceCategories()
	local args = self.args
	local cfg = self.cfg

	if not cfg.allowMainspaceCategories then
		return nil
	end

	local nums = {}
	for _, prefix in ipairs{'cat', 'category', 'all'} do
		args[prefix .. '1'] = args[prefix]
		nums = union(nums, getArgNums(args, prefix))
	end

	-- The following is roughly equivalent to the old {{Ambox/category}}.
	local date = args.date
	date = type(date) == 'string' and date
	local preposition = 'from'
	for _, num in ipairs(nums) do
		local mainCat = args['cat' .. tostring(num)]
			or args['category' .. tostring(num)]
		local allCat = args['all' .. tostring(num)]
		mainCat = type(mainCat) == 'string' and mainCat
		allCat = type(allCat) == 'string' and allCat
		if mainCat and date and date ~= '' then
			local catTitle = string.format('%s %s %s', mainCat, preposition, date)
			self:addCat(0, catTitle)
			catTitle = getTitleObject('Category:' .. catTitle)
			if not catTitle or not catTitle.exists then
				self:addCat(0, 'Articles with invalid date parameter in template')
			end
		elseif mainCat and (not date or date == '') then
			self:addCat(0, mainCat)
		end
		if allCat then
			self:addCat(0, allCat)
		end
	end
end

function MessageBox:setTemplateCategories()
	local args = self.args
	local cfg = self.cfg

	-- Add template categories.
	if cfg.templateCategory then
		if cfg.templateCategoryRequireName then
			if self.isTemplatePage then
				self:addCat(10, cfg.templateCategory)
			end
		elseif not self.title.isSubpage then
			self:addCat(10, cfg.templateCategory)
		end
	end

	-- Add template error categories.
	if cfg.templateErrorCategory then
		local templateErrorCategory = cfg.templateErrorCategory
		local templateCat, templateSort
		if not self.name and not self.title.isSubpage then
			templateCat = templateErrorCategory
		elseif self.isTemplatePage then
			local paramsToCheck = cfg.templateErrorParamsToCheck or {}
			local count = 0
			for i, param in ipairs(paramsToCheck) do
				if not args[param] then
					count = count + 1
				end
			end
			if count > 0 then
				templateCat = templateErrorCategory
				templateSort = tostring(count)
			end
			if self.categoryNums and #self.categoryNums > 0 then
				templateCat = templateErrorCategory
				templateSort = 'C'
			end
		end
		self:addCat(10, templateCat, templateSort)
	end
end

function MessageBox:setAllNamespaceCategories()
	-- Set categories for all namespaces.
	if self.invalidTypeError then
		local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
		self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
	end
	if self.isSubstituted then
		self:addCat('all', 'Pages with incorrectly substituted templates')
	end
end

function MessageBox:setCategories()
	if self.title.namespace == 0 then
		self:setMainspaceCategories()
	elseif self.title.namespace == 10 then
		self:setTemplateCategories()
	end
	self:setAllNamespaceCategories()
end

function MessageBox:renderCategories()
	if not self.hasCategories then
		-- No categories added, no need to pass them to Category handler so,
		-- if it was invoked, it would return the empty string.
		-- So we shortcut and return the empty string.
		return ""
	end
	-- Convert category tables to strings and pass them through
	-- [[Module:Category handler]].
	return require('Module:Category handler')._main{
		main = table.concat(self.categories[0] or {}),
		template = table.concat(self.categories[10] or {}),
		all = table.concat(self.categories.all or {}),
		nocat = self.args.nocat,
		page = self.args.page
	}
end

function MessageBox:export()
	local root = mw.html.create()

	-- Add the subst check error.
	if self.isSubstituted and self.name then
		root:tag('b')
			:addClass('error')
			:wikitext(string.format(
				'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
				mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
			))
	end

	-- Create the box table.
	local boxTable = root:tag('table')
	boxTable:attr('id', self.id or nil)
	for i, class in ipairs(self.classes or {}) do
		boxTable:addClass(class or nil)
	end
	boxTable
		:cssText(self.style or nil)
		:attr('role', 'presentation')

	if self.attrs then
		boxTable:attr(self.attrs)
	end

	-- Add the left-hand image.
	local row = boxTable:tag('tr')
	if self.imageLeft then
		local imageLeftCell = row:tag('td'):addClass('mbox-image')
		if self.imageCellDiv then
			-- If we are using a div, redefine imageLeftCell so that the image
			-- is inside it. Divs use style="width: 52px;", which limits the
			-- image width to 52px. If any images in a div are wider than that,
			-- they may overlap with the text or cause other display problems.
			imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')
		end
		imageLeftCell:wikitext(self.imageLeft or nil)
	elseif self.imageEmptyCell then
		-- Some message boxes define an empty cell if no image is specified, and
		-- some don't. The old template code in templates where empty cells are
		-- specified gives the following hint: "No image. Cell with some width
		-- or padding necessary for text cell to have 100% width."
		row:tag('td')
			:addClass('mbox-empty-cell')
			:cssText(self.imageEmptyCellStyle or nil)
	end

	-- Add the text.
	local textCell = row:tag('td'):addClass('mbox-text')
	if self.useCollapsibleTextFields then
		-- The message box uses advanced text parameters that allow things to be
		-- collapsible. At the moment, only ambox uses this.
		textCell:cssText(self.textstyle or nil)
		local textCellDiv = textCell:tag('div')
		textCellDiv
			:addClass('mbox-text-span')
			:wikitext(self.issue or nil)
		if (self.talk or self.fix) then
			textCellDiv:tag('span')
				:addClass('hide-when-compact')
				:wikitext(self.talk and (' ' .. self.talk) or nil)
				:wikitext(self.fix and (' ' .. self.fix) or nil)
		end
		textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
		if self.info and not self.isSmall then
			textCellDiv
				:tag('span')
				:addClass('hide-when-compact')
				:wikitext(self.info and (' ' .. self.info) or nil)
		end
		if self.removalNotice then
			textCellDiv:tag('span')
				:addClass('hide-when-compact')
				:tag('i')
					:wikitext(string.format(" (%s)", self.removalNotice))
		end
	else
		-- Default text formatting - anything goes.
		textCell
			:cssText(self.textstyle or nil)
			:wikitext(self.text or nil)
	end

	-- Add the right-hand image.
	if self.imageRight then
		local imageRightCell = row:tag('td'):addClass('mbox-imageright')
		if self.imageCellDiv then
			-- If we are using a div, redefine imageRightCell so that the image
			-- is inside it.
			imageRightCell = imageRightCell:tag('div'):css('width', '52px')
		end
		imageRightCell
			:wikitext(self.imageRight or nil)
	end

	-- Add the below row.
	if self.below then
		boxTable:tag('tr')
			:tag('td')
				:attr('colspan', self.imageRight and '3' or '2')
				:addClass('mbox-text')
				:cssText(self.textstyle or nil)
				:wikitext(self.below or nil)
	end

	-- Add error message for invalid type parameters.
	if self.invalidTypeError then
		root:tag('div')
			:css('text-align', 'center')
			:wikitext(string.format(
				'This message box is using an invalid "type=%s" parameter and needs fixing.',
				self.type or ''
			))
	end

	-- Add categories.
	root:wikitext(self:renderCategories() or nil)

	return tostring(root)
end

--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------

local p, mt = {}, {}

function p._exportClasses()
	-- For testing.
	return {
		MessageBox = MessageBox
	}
end

function p.main(boxType, args, cfgTables)
	local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
	box:setParameters()
	box:setCategories()
	return box:export()
end

function mt.__index(t, k)
	return function (frame)
		if not getArgs then
			getArgs = require('Module:Arguments').getArgs
		end
		return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
	end
end

return setmetatable(p, mt)
清真什么意思 土茯苓与茯苓有什么区别 尿液阳性是什么意思 离家出走需要准备什么 牙疼吃什么药管用
芈月和秦始皇什么关系 开化龙顶属于什么茶 征兵初检检查什么 想怀孕需要检查什么项目 什么是钙化点
五味子不适合什么人喝 54年属什么 高同型半胱氨酸血症吃什么药 吃什么容易减肥 肺部有阴影一般是什么病
酷儿是什么意思 leonardo是什么牌子 sg比重是什么意思 信阳毛尖属于什么茶 什么牙膏最好
皮肤过敏有什么好办法hcv7jop5ns1r.cn 听雨是什么意思hcv8jop8ns3r.cn 下缘达宫颈内口是什么意思hcv8jop9ns6r.cn 芜湖有什么大学hcv7jop9ns5r.cn 十二月十四日是什么星座hcv8jop6ns1r.cn
5年生存率是什么意思hcv9jop5ns6r.cn 七月二十号是什么星座hcv8jop5ns5r.cn 唐人是什么意思hcv8jop8ns2r.cn 1月份是什么星座hcv8jop6ns5r.cn 老二是什么意思hcv8jop6ns2r.cn
割包皮有什么好处hcv7jop9ns7r.cn 旮旯是什么意思hcv8jop3ns5r.cn 孕妇用什么牙膏比较好hcv9jop1ns7r.cn 风向是指风什么的方向hcv7jop9ns0r.cn 小产可以吃什么水果aiwuzhiyu.com
辣椒炭疽病用什么药hcv9jop2ns7r.cn 什么刺骨hcv9jop4ns6r.cn 胸口疼痛是什么原因hcv7jop9ns3r.cn 眼睛长黄斑是什么原因hcv8jop6ns6r.cn 同妻是什么意思tiangongnft.com
百度