欲钱看正月初一是什么生肖| 苏打水喝了有什么好处| mg什么单位| 一家之主是什么意思| 虐狗什么意思| 隐晦是什么意思| 睡觉食管反流什么原因| 沈阳是什么省| 皮肤病吃什么药最好| 秉承是什么意思| 1.15是什么星座| 性无能是什么意思| 回盲肠在什么位置| 八字不合是什么生肖| 什么水果是钙中之王| 为什么有的女人欲太强| 什么红酒好喝| 眼轴是什么| 甲亢吃什么食物好| 硒是什么| 临床是什么意思| 师长是什么级别| 25岁今年属什么生肖| 黄精什么时候种植| 肌钙蛋白高是什么意思| 心眼多是什么意思| 孕妇刚生完孩子吃什么好| sinoer是什么牌子| 脆生生的什么| 头疼吃什么| 女人梦见鱼是什么意思| 湿疹要注意什么| 脚后跟干裂用什么药膏| 胆囊炎吃什么消炎药| 锅烧是什么| exp是什么意思| 风湿性心脏病是什么原因引起的| 下面痒用什么药效果好| 检查肠胃挂什么科| 秋葵是什么| 退行性改变是什么意思| 中元节注意什么| 9.22什么星座| 吃海参有什么好处| 胎盘血池是什么意思| 耳朵尖的人什么命| 护理学和护理有什么区别| 什么是钙化点| 安代表什么生肖| 盆腔炎要做什么检查| 上海有什么特色美食| 牝是什么意思| 什么是射线| 十月初七是什么星座| 脚冰凉吃什么药| 什么的遐想| 叶仙是什么植物| 什么是soho| 全脂乳粉是什么| 子宫形态不规则是什么意思| 吃高血压药有什么副作用| 吉加页读什么| 间隔旁型肺气肿是什么| 室间隔缺损是什么意思| 王羲之的儿子叫什么名字| 白细胞2加号什么意思| 舒克是什么职业| 黄金分割点是什么| 惊恐发作是什么病| 体脂是什么意思| 江诗丹顿属于什么档次| 樵夫是什么生肖| 下午6点半是什么时辰| 七上八下是什么生肖| 常喝蜂蜜水有什么好处和坏处| 一进大门看见什么最好| 天麻泡水喝有什么功效| 胖头鱼是什么鱼| 内心os什么意思| 泪点低是什么意思| 胆结石是什么原因造成的| 社会抚养费是什么意思| 哪些动物的尾巴有什么作用| 时柱亡神是什么意思| 手指缝痒是什么原因| 乌托邦是什么| 12.28是什么星座| 子宫癌有什么症状| 为什么加油站不能打电话| 血红蛋白低吃什么可以补起来| 腿疼去医院挂什么科| 脚真菌感染用什么药| 紧急避孕药什么时候吃最有效| 宝宝缺锌有什么表现和症状| 玉兰油属于什么档次| 梦见狼是什么意思周公解梦| 自然什么意思| 胶质瘤是什么病| 龟头炎有什么症状| 天地银行是什么意思| 农历闰六月有什么讲究| 头晕吃什么药| 双侧骶髂关节致密性骨炎是什么病| 谷维素是什么| 宫腔粘连带是什么意思| 乳房胀痛是什么原因引起的| 红醋是什么醋| 丁羟甲苯是什么| 80岁称什么之年| psv是什么| 梦到离婚是什么征兆| 眼睛发粘是什么原因| 族谱是什么意思| 头晕是什么原因引起| 逆爱是什么意思| 茹什么饮什么| 工字五行属什么| 勤代表什么生肖| 2001年是什么年| 软件开发属于什么行业| 为什么三角形具有稳定性| 菠萝蜜过敏什么症状| lancome是什么牌子的| 红萝卜和胡萝卜有什么区别| 细菌性前列腺炎有什么症状| 大便次数多吃什么药| 什么动物有四个胃| 死心塌地什么意思| 苯丙氨酸是什么| 长长的柳条像什么| 孕妇吃什么盐最好| 什么是cpi| 暗物质是什么东西| 猪肝色是什么颜色| 韶关有什么特产| 半月板是什么部位| 尿臭是什么原因男性| 婴儿长牙有什么症状| 尿味大是什么原因| 公务员是干什么的| 皲裂是什么意思| 喝咖啡困倦是什么原因| 闭口是什么样子| 促甲状腺激素偏高是什么意思| tea是什么意思| 窦骁的父母是干什么的| 九寨沟属于什么市| 四不像长什么样| 梅干菜是什么菜| 肩袖损伤吃什么药效果最好| 平板运动试验阳性是什么意思| oct试验是什么| 淋巴细胞偏低是什么意思| 鸽子喜欢吃什么食物| 肚胀是什么原因| 乙肝五项第二项阳性是什么意思| 空针是什么| 腿纹不对称有什么影响| 牙疼吃什么食物| 中老年喝什么奶粉好| 台湾为什么叫4v| 囹圄是什么意思| 做肠镜要做什么准备| 小清新是什么意思啊| 女人什么时候停经| 辣椒是什么时候传入中国的| 追悔莫及什么意思| 什么原因导致有幽门杆菌| 什么水果营养价值最高| 脂肪最终被消化成什么| 院士相当于什么级别| kamagra是什么药| 什么非常什么| 水肿是什么样子| 原位癌是什么意思| 巩固是什么意思| aep是什么意思| 吃什么去湿气最好最快| 官杀旺是什么意思| 奥美拉唑治什么胃病| 尿道痒痒是什么原因| 看病人送什么花合适| 子宫发炎是什么原因引起的| 乐五行属性是什么| e2是什么意思| 喝酒前喝什么不容易醉| 绿豆芽炒什么好吃| 冰箱eco是什么意思| 牛乳是什么| 肉丝炒什么好吃| 总胆固醇什么意思| 11月26是什么星座| 来月经腰酸腰痛什么原因造成的| 区间放量是什么意思| 电音是什么意思| 绝经前有什么症状| 91年是什么命| 为什么一直下雨| 什么是躯体化| 骨骼肌是什么意思| 双皮奶为什么叫双皮奶| 收心是什么意思| pr是什么意思| 睡觉一直做梦是什么原因| pocky是什么意思| 子宫内膜异位症有什么症状| 月办念什么| 红细胞分布宽度偏高是什么意思| 什么叫放疗| 学分是什么| col是什么的缩写| 胃不好吃什么蔬菜| 吃什么长高| 男生吃菠萝有什么好处| 抗甲状腺球蛋白抗体高是什么原因| 血糖可以吃什么水果| 灻是什么意思| 左眼跳代表什么| 金汤是什么汤| 狡兔三窟什么意思| 绿茶用什么茶具泡好| 女生问你喜欢她什么怎么回答| 中央民族大学什么档次| 赫尔墨斯是什么神| 甲状腺不能吃什么食物| 胎儿左侧侧脑室增宽的原因是什么| 女人吃牛蛙有什么好处| 珠光宝气是什么生肖| 元五行属性是什么| 毕罗是什么食物| 氏是什么意思| 头晕在医院挂什么科| 资深是什么意思| 痱子是什么样的图片| 女生为什么会肾虚| 气短挂什么科| 尿蛋白什么意思| 癌前病变是什么意思| 精子是什么| 头发油是什么原因| 密送是什么意思| bpd是什么意思| 脸大剪什么发型好看| 脸色苍白没有血色是什么原因| 吃马齿苋有什么好处| 英五行属什么| 鱼水之欢是什么意思| agc什么意思| 拔罐对身体有什么好处和坏处| 血氧低吃什么药效果好| 白衬衫配什么裤子好看| 规培是什么意思| 嗷嗷待哺是什么意思| 屁的成分是什么气体| 什么的大圆盘| 锁阳是什么| 胆囊炎不能吃什么| 刻板印象是什么意思| 敢爱敢恨是什么意思| 日加个成念什么| 兑水是什么意思| 咕咚是什么| 淋巴结肿大挂什么科| 什么不已| 百度Jump to content

海南扶持12个重点产业 互联网产业2020年规模超千亿元

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)
冠脉壁钙化是什么意思 会考没过有什么影响 吃什么对卵巢好 未见卵黄囊及胚芽是什么意思 拉肚子吃什么菜
脾胃虚弱吃什么药好 两肺纹理增多是什么意思 偷换概念是什么意思 鱼吐泡泡是什么原因 儿童感冒挂什么科
82年的拉菲是什么意思 飞机杯有什么用 腺苷是什么 高血压有什么症状表现 骨头咔咔响是什么原因
什么蛇不咬人 属狗的本命佛是什么佛 阿司匹林什么时间吃最好 94狗跟什么属相配最好 补血吃什么药最快最好
浮尘是什么意思hcv7jop7ns2r.cn 指甲缝疼是什么原因hcv8jop0ns4r.cn 千山鸟飞绝的绝是什么意思hcv8jop3ns8r.cn 氩弧焊对身体有什么危害sanhestory.com 彩色相片什么时候出现hcv7jop9ns2r.cn
右耳朵发热代表什么预兆wmyky.com 喉咙痛看什么科hcv7jop6ns9r.cn 日新月异什么意思mmeoe.com m是什么单位hcv8jop2ns8r.cn 旭五行属什么hcv9jop3ns0r.cn
早上九点半是什么时辰hcv9jop1ns0r.cn 吃氨糖有什么副作用hcv8jop6ns4r.cn 顽固是什么意思hcv9jop3ns4r.cn 一个王一个番读什么hcv9jop3ns6r.cn 王源粉丝叫什么hcv9jop3ns8r.cn
南极和北极有什么区别hcv7jop5ns4r.cn 300年前是什么朝代hcv8jop7ns8r.cn 机械键盘什么轴最好hcv8jop9ns1r.cn 第二次世界大战是什么时候hcv7jop6ns0r.cn 喝枸杞水有什么好处chuanglingweilai.com
百度