慰安妇什么意思| 女性一般什么年龄绝经| 身上发抖是什么原因| 林子大了什么鸟都有| 目瞪口呆是什么生肖| 摩羯座是什么动物| 日午念什么| 榴莲苦是什么原因| 央企和国企有什么区别| 蚊子最怕什么植物| 结合是什么意思| 为什么肾阳虚很难恢复| 淋巴发炎挂什么科| 莳字五行属什么| 檀是什么意思| 挑灯夜战是什么意思| 念力是什么意思| 下雨了是什么意思| exchange是什么意思| 甲状腺球蛋白抗体高是什么意思| 三楼属于五行属什么| 什么是不饱和脂肪酸| 什么时候看到的月亮最大| 异烟肼是什么药| 黄芪味道是什么味道| 什么时候敷面膜是最佳时间| 早上起来手发麻是什么原因| 甘油三酯高应该注意什么| 什么应外合| 7月八号是什么星座| 218号是什么星座| 痔疮应该挂什么科室| 天蝎座和什么星座最不配| 犯规是什么意思| 伐木累是什么意思| 茶白色是什么颜色| 怀孕六个月出血是什么原因| 第三者责任险是什么意思| 月经过后有褐色分泌物是什么原因| 埃及法老是什么意思| 检查肾功能挂什么科| 看腋下挂什么科| 脚底板发热是什么原因| 做爱都有什么姿势| 8月10号什么星座| 为什么不建议小孩打流感疫苗| iga肾病是什么意思| 手术室为什么那么冷| 容易长痣是什么原因| qd医学上是什么意思| 空调感冒吃什么药| 根管治疗后要注意什么| 什么药和酒一起吃必死| 眼底出血用什么药最好| 射手座是什么象星座| 头发的主要成分是什么| 贴膏药发热是什么原因| 促甲状腺素高是什么意思| 本命年犯太岁什么意思| 大姑姐是什么意思| 营卫是什么意思| 为什么说肺结核是穷人病| 羊水穿刺是查什么的| 眼痒痒是什么原因引起| 狗肉和什么一起炖最佳| 盆腔炎做什么检查能查出来| 惨无人道是什么意思| 白发缺少什么维生素| 检查膝盖挂什么科| 2a是什么意思| 鱿鱼炒什么好吃| 吃饭不规律会导致什么问题| 咳嗽流鼻涕吃什么药| esmara是什么品牌| 淘米水洗脸有什么好处| 为什么抽烟就想拉屎| 什么叫绿茶| 爸爸的妈妈叫什么| 整个手掌发红是什么原因| 胃疼可以吃什么药| rh阳性是什么意思| fierce是什么意思| 相对密度是什么意思| iruri 什么意思| 孕晚期吃什么好| 芙蓉花长什么样| 五行是指什么| 懿代表什么意思| 八珍胶囊适合什么人吃| progress什么意思| 脾虚吃什么食物| 信保是什么| 血压高可以吃什么水果| 什么目寸光成语| 天天射精对身体有什么危害| 方寸之地什么意思| 黑魔鬼烟为什么是禁烟| 虫合读什么| 夏天有什么动物| 喝酒尿多是什么原因| 拉不出大便吃什么药| 锦纶氨纶是什么面料| 红是什么生肖| 有朝一日是什么生肖| 92年1月属什么生肖| 呼吸不顺畅是什么原因| 什么是树莓| 骨髓不造血是什么病| 食道炎用什么药最好| 道场是什么意思| 巨细胞病毒是什么| 陈赫火锅店叫什么名字| 激光脱毛有什么副作用| 结婚纪念日送什么花| 错觉是什么意思| 马蹄铁什么时候发明的| 复光是什么意思| 口干口苦是什么原因| 白细胞高有什么危害| 广东是什么气候| 肝部出现腹水是什么原因| 根充是什么意思| 猫发出咕噜咕噜的声音是什么意思| 行李箱什么材质的好| 宝宝不长肉是什么原因| 跳蚤喜欢咬什么样的人| 小孩疝气是什么症状| 冬虫夏草补什么| 体会是什么意思| 反洗钱是什么意思| 狗生小狗前有什么征兆| 喝苹果醋有什么好处| 湿疹用什么药| pin什么意思| 浑身瘙痒是什么原因| 密度增高影是什么意思| 什么的水流| 蝾螈是什么| 太阳鱼是什么鱼| 胆囊壁稍毛糙是什么意思| 路痴是什么原因造成的| 煲汤放什么药材补气血| 颈部有肿块看什么科室| 铁为什么会生锈| 荷叶是什么的什么| 彪子是什么意思| 40min是什么意思| 从什么不什么四字词语| 丑小鸭告诉我们一个什么道理| 股票换手率是什么意思| 羲字五行属什么| 什么是实性结节| 儿童风热感冒吃什么药| 四个又念什么| 长痱子用什么药| 直肠壁增厚一般是什么情况| ck是什么牌子的包包| 冬五行属什么| 给朋友送什么礼物好| 小孩经常流鼻血是什么原因| 夜尿多吃什么药效果好| 醛固酮高吃什么降压药| 脸颊两边长痘痘是什么原因引起的| 撒贝宁是什么族| 甲状腺肿大吃什么药| 亚米是什么意思| 大小脸是什么原因造成的| 独行侠是什么意思| 眉头下方有痣代表什么| 李世民是什么生肖| 涤纶是什么材料| 低血压去药店买什么药| 鬼针草能治什么病| 茉莉什么时候开花| 羊病是什么病| 吃无花果有什么好处和坏处| 1967属什么生肖| 苦命是什么意思| 兰花是什么季节开的| dazzling什么意思| 脂肪肝是什么| span是什么意思| 尿检隐血十一什么意思| 4月10日什么星座| 卧室养什么花好| 脚肿是什么原因造成的| 什么鱼吃鱼屎| cov是什么意思| 才高八斗是什么动物| 三虫念什么| 检查血压挂什么科| 眉毛长白毛是什么征兆| 吃皮蛋有什么好处和坏处| 四月七号是什么星座| 梦见手机摔碎了是什么意思| 心电轴重度左偏是什么意思| 泰国是一个什么样的国家| 澎湃是什么意思| 胃窦糜烂是什么意思严重吗| 媛是什么意思| 捡到狗狗代表什么预兆| 衣原体感染吃什么药| 密度单位是什么| 嘴里发酸是什么原因| 生姜水泡脚有什么好处| 柏读什么| 垫背是什么意思| 不务正业是什么意思| ufc是什么意思| 琀是什么意思| 排场是什么意思| 劫富济贫是什么意思| 怀孕前三个月要注意什么| 禾加农是什么字| 封闭针是什么| 愚钝是什么意思| 波罗蜜多什么意思| rj什么意思| 7.11什么星座| 牙齿咬不动东西是什么原因| 节育环是什么| 肉丝炒什么好吃| 为什么妇科病要肛门塞药| 方得始终什么意思| 凹是什么意思| 贤上腺瘤是什么意思| 当你从我眼前慢慢走过是什么歌| 冠状动脉肌桥是什么病| 什么颜色的床单有助于睡眠| o型血不能和什么血型的人生孩子| fhr是什么意思| 李什么名字好听| 什么是无精症| 青盐是什么盐| 199是什么意思| 移动迷宫到底讲的什么| 吃什么能润肠通便| 来月经吃什么| 节操什么意思| 腿麻木是什么原因引起的| 牛角尖是什么意思| 什么样的普洱茶才是好茶| 拐子是什么鱼| 光谱是什么| 脚底痛是什么原因| 云南古代叫什么| 九月三号是什么星座| gi食物是什么意思| 牙齿是什么材质| 孕妇羊水少吃什么补的快| 一品诰命夫人是什么意思| 96122是什么电话| 折射率是什么意思| 随便你是什么意思| 薏米长什么样子的图片| 伤口不容易愈合是什么原因| 经常打嗝是什么原因| 四级军士长是什么级别| 吃什么奶水会增多| 干眼症用什么药最好| 喝酒精的后果是什么| 女人小便疼是什么原因| 李世民是什么生肖| ra是什么意思| 百度Jump to content

江苏苏州:召开易制毒化学品企业培训会

From Wikipedia
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)
一什么鼻子 glu是什么氨基酸 鱼肉百姓什么意思 失眠吃什么食物效果最好 暖宫贴贴在什么位置
灰枣与红枣有什么区别 泌尿系统感染挂什么科 女人贫血吃什么补血最快 宝宝手足口病吃什么药 承上启下是什么意思
什么的摇篮 海员是干什么的 腰疼吃什么药最有效 黑鱼不能和什么一起吃 鱼为什么睁着眼睛睡觉
邦顿手表是什么档次 肺气肿挂什么科 吃饭不规律会导致什么问题 胃热吃什么 义结金兰是什么意思
胃切除有什么影响hcv9jop7ns0r.cn 反胃是什么原因引起的hcv8jop4ns3r.cn oversize风格什么意思hcv7jop5ns1r.cn 糖尿病人吃什么水果好hcv9jop5ns6r.cn 做功是什么意思wmyky.com
4月22日什么星座hcv9jop4ns9r.cn 小三阳是什么hcv9jop1ns8r.cn 血管痉挛是什么症状hcv7jop6ns6r.cn 弊是什么意思hcv8jop0ns3r.cn 月经两个月没来是什么原因hcv8jop2ns9r.cn
什么水果对心脏好hcv9jop0ns9r.cn 25年是什么婚zhiyanzhang.com 纸醉金迷是什么意思hcv8jop0ns0r.cn 西洋参长什么样子图片hcv8jop2ns0r.cn 银杯子喝水有什么好处hcv8jop2ns2r.cn
付之东流是什么意思hcv9jop7ns9r.cn 上吐下泻吃什么药hcv9jop1ns9r.cn 普贤菩萨的坐骑是什么hcv7jop9ns0r.cn 维生素d什么牌子的好hcv8jop9ns3r.cn 鼻涕倒流吃什么药hcv8jop0ns7r.cn
百度