<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.tpcmc.top/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3AMessage_box</id>
	<title>模块:Message box - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tpcmc.top/index.php?action=history&amp;feed=atom&amp;title=%E6%A8%A1%E5%9D%97%3AMessage_box"/>
	<link rel="alternate" type="text/html" href="https://wiki.tpcmc.top/index.php?title=%E6%A8%A1%E5%9D%97:Message_box&amp;action=history"/>
	<updated>2026-07-10T09:52:15Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.44.5</generator>
	<entry>
		<id>https://wiki.tpcmc.top/index.php?title=%E6%A8%A1%E5%9D%97:Message_box&amp;diff=1518&amp;oldid=prev</id>
		<title>Harry00025：​Harry00025移动页面模块:Message Box至模块:Message box</title>
		<link rel="alternate" type="text/html" href="https://wiki.tpcmc.top/index.php?title=%E6%A8%A1%E5%9D%97:Message_box&amp;diff=1518&amp;oldid=prev"/>
		<updated>2026-05-28T06:04:24Z</updated>

		<summary type="html">&lt;p&gt;Harry00025移动页面&lt;a href=&quot;/index.php?title=%E6%A8%A1%E5%9D%97:Message_Box&quot; class=&quot;mw-redirect&quot; title=&quot;模块:Message Box&quot;&gt;模块:Message Box&lt;/a&gt;至&lt;a href=&quot;/index.php?title=%E6%A8%A1%E5%9D%97:Message_box&quot; title=&quot;模块:Message box&quot;&gt;模块:Message box&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月28日 (四) 06:04的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Harry00025</name></author>
	</entry>
	<entry>
		<id>https://wiki.tpcmc.top/index.php?title=%E6%A8%A1%E5%9D%97:Message_box&amp;diff=1505&amp;oldid=prev</id>
		<title>Harry00025：​创建页面，内容为“local p = {}  local function commentSprite( pos, link, size ) 	if not pos then 		return &#039;&#039; 	end 	pos = mw.text.trim( pos ) 	if pos == &#039;&#039; then 		return &#039;&#039; 	end 	local icon = &#039;alt=&#039; 	local iconMap = { 		&#039;question&#039;, &#039;warning&#039;, &#039;done&#039;, &#039;undone&#039;, &#039;support&#039;, &#039;oppose&#039;, &#039;doing&#039;, &#039;information&#039;, &#039;disallow&#039;, 		&#039;on hold&#039;, &#039;strong support&#039;, &#039;weak support&#039;, &#039;neutral&#039;, &#039;weak oppose&#039;, &#039;strong oppose&#039;, &#039;transferred&#039;, &#039;withdr…”</title>
		<link rel="alternate" type="text/html" href="https://wiki.tpcmc.top/index.php?title=%E6%A8%A1%E5%9D%97:Message_box&amp;diff=1505&amp;oldid=prev"/>
		<updated>2026-05-28T05:55:11Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“local p = {}  local function commentSprite( pos, link, size ) 	if not pos then 		return &amp;#039;&amp;#039; 	end 	pos = mw.text.trim( pos ) 	if pos == &amp;#039;&amp;#039; then 		return &amp;#039;&amp;#039; 	end 	local icon = &amp;#039;&lt;a href=&quot;/index.php?title=%E6%96%87%E4%BB%B6:Comment_%25s.svg&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;文件:Comment %s.svg（页面不存在）&quot;&gt;%s|class=comment-icon|link=%s|alt=&lt;/a&gt;&amp;#039; 	local iconMap = { 		&amp;#039;question&amp;#039;, &amp;#039;warning&amp;#039;, &amp;#039;done&amp;#039;, &amp;#039;undone&amp;#039;, &amp;#039;support&amp;#039;, &amp;#039;oppose&amp;#039;, &amp;#039;doing&amp;#039;, &amp;#039;information&amp;#039;, &amp;#039;disallow&amp;#039;, 		&amp;#039;on hold&amp;#039;, &amp;#039;strong support&amp;#039;, &amp;#039;weak support&amp;#039;, &amp;#039;neutral&amp;#039;, &amp;#039;weak oppose&amp;#039;, &amp;#039;strong oppose&amp;#039;, &amp;#039;transferred&amp;#039;, &amp;#039;withdr…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
local function commentSprite( pos, link, size )&lt;br /&gt;
	if not pos then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	pos = mw.text.trim( pos )&lt;br /&gt;
	if pos == &amp;#039;&amp;#039; then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	local icon = &amp;#039;[[File:Comment %s.svg|%s|class=comment-icon|link=%s|alt=]]&amp;#039;&lt;br /&gt;
	local iconMap = {&lt;br /&gt;
		&amp;#039;question&amp;#039;, &amp;#039;warning&amp;#039;, &amp;#039;done&amp;#039;, &amp;#039;undone&amp;#039;, &amp;#039;support&amp;#039;, &amp;#039;oppose&amp;#039;, &amp;#039;doing&amp;#039;, &amp;#039;information&amp;#039;, &amp;#039;disallow&amp;#039;,&lt;br /&gt;
		&amp;#039;on hold&amp;#039;, &amp;#039;strong support&amp;#039;, &amp;#039;weak support&amp;#039;, &amp;#039;neutral&amp;#039;, &amp;#039;weak oppose&amp;#039;, &amp;#039;strong oppose&amp;#039;, &amp;#039;transferred&amp;#039;, &amp;#039;withdrawn&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	return icon:format( tonumber( pos ) and iconMap[ tonumber( pos ) ] or pos:lower(), size or &amp;#039;16px&amp;#039;, link or &amp;#039;&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function argAlter( args )&lt;br /&gt;
	if type( args ) ~= &amp;#039;table&amp;#039; then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local defaultAltMethod = function( base, alt ) return alt or base end&lt;br /&gt;
	local altMethods = {&lt;br /&gt;
		class = function( base, alt )&lt;br /&gt;
			local result = mw.text.trim( table.concat( { base or &amp;#039;&amp;#039;, alt or &amp;#039;&amp;#039; }, &amp;#039; &amp;#039; ) )&lt;br /&gt;
			return ( result == &amp;#039;&amp;#039; ) and nil or result&lt;br /&gt;
		end&lt;br /&gt;
	}&lt;br /&gt;
	for k, _ in pairs( args ) do&lt;br /&gt;
		if k:sub( 1, 1 ) == &amp;#039;_&amp;#039; then&lt;br /&gt;
			k = k:sub( 2 )&lt;br /&gt;
		end&lt;br /&gt;
		local v = ( altMethods[ k ] or defaultAltMethod )( args[ k ], args[ &amp;#039;_&amp;#039; .. k ] )&lt;br /&gt;
		if v then&lt;br /&gt;
			args[ k ] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return args&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getStyles( f )&lt;br /&gt;
	local args = f or {}&lt;br /&gt;
	if f == mw.getCurrentFrame() then&lt;br /&gt;
		args = require( &amp;#039;Module:ProcessArgs&amp;#039; ).merge( true )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local loadStyle = require( &amp;#039;Module:TSLoader&amp;#039; ).call&lt;br /&gt;
&lt;br /&gt;
	local styles = loadStyle( args[ 1 ] or args.basic or &amp;#039;Template:Message box/styles.css&amp;#039; )&lt;br /&gt;
	local currentNamespace = mw.title.getCurrentTitle().namespace&lt;br /&gt;
&lt;br /&gt;
	return styles .. ( ( ( not args.nocustom ) and ( currentNamespace == 2 or currentNamespace == 3 ) ) and loadStyle( args[ 2 ] or args.custom or &amp;#039;Template:Message box/custom.css&amp;#039; ) or &amp;#039;&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main( f )&lt;br /&gt;
	local rawTitle = nil&lt;br /&gt;
	local rawText = nil&lt;br /&gt;
&lt;br /&gt;
	local args = f&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	if f == frame then&lt;br /&gt;
		args = argAlter( require( &amp;#039;Module:ProcessArgs&amp;#039; ).merge( true ) )&lt;br /&gt;
	else&lt;br /&gt;
		-- Will not use type() to detect whether f is a table or not, which is an expensive function.&lt;br /&gt;
		-- So, ideally, calling from templates will not cause an error ( f is a frame ), but will occurs when calling from modules if f is not a table.&lt;br /&gt;
		rawTitle = f.title&lt;br /&gt;
		rawText = f.text&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Equivalent to args.title and args.text, but without trimming, to avoid formatting issues.&lt;br /&gt;
	-- Variables args.title or args.text will not use to form a real title or text, just indicates whether respective arguments is set or not.&lt;br /&gt;
	-- Arguments from the parent frame take priority of the current frame, per Module:ProcessArgs.&lt;br /&gt;
	rawTitle = frame:preprocess( rawTitle or ( frame:getParent().args._title or frame.args._title ) or ( frame:getParent().args.title or frame.args.title ) )&lt;br /&gt;
	rawText = frame:preprocess( rawText or ( frame:getParent().args._text or frame.args._text ) or ( frame:getParent().args.text or frame.args.text ) )&lt;br /&gt;
&lt;br /&gt;
	-- Create main frame&lt;br /&gt;
	local result = mw.html.create( &amp;#039;div&amp;#039; ):addClass( &amp;#039;msgbox&amp;#039; )&lt;br /&gt;
	if args.mini then&lt;br /&gt;
		result:addClass( &amp;#039;msgbox-mini&amp;#039; )&lt;br /&gt;
		if not args.width then&lt;br /&gt;
			result:addClass( &amp;#039;msgbox-compat&amp;#039; )&lt;br /&gt;
		end&lt;br /&gt;
	elseif args.compat then&lt;br /&gt;
		if not args.width then&lt;br /&gt;
			result:addClass( &amp;#039;msgbox-compat&amp;#039; )&lt;br /&gt;
		end&lt;br /&gt;
	elseif not args.wide then&lt;br /&gt;
		result:addClass( &amp;#039;msgbox-normal&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
	result:addClass( &amp;#039;searchaux&amp;#039; ):addClass( args.bgclass or &amp;#039;msgbox-&amp;#039; .. ( args.type or &amp;#039;notice&amp;#039; ) ):addClass( args.class ):cssText( args.css ):css{&lt;br /&gt;
		[ &amp;#039;background-color&amp;#039; ] = args.bgcol,&lt;br /&gt;
		[ &amp;#039;border-left-color&amp;#039; ] = args.linecol,&lt;br /&gt;
		[ &amp;#039;font-size&amp;#039; ] = args[ &amp;#039;font-size&amp;#039; ],&lt;br /&gt;
		[ &amp;#039;width&amp;#039; ] = args.width,&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- Create optional icon / image frame&lt;br /&gt;
	if args.icon or args.image then&lt;br /&gt;
		result:addClass( &amp;#039;has-image&amp;#039; )&lt;br /&gt;
		local resultOpt = mw.html.create( &amp;#039;div&amp;#039; ):addClass( &amp;#039;msgbox-icon-image&amp;#039; ):cssText( args.imagecss )&lt;br /&gt;
		local imagefield = &amp;#039;&amp;#039;&lt;br /&gt;
		if args.icon then&lt;br /&gt;
			imagefield = imagefield .. commentSprite( args.icon, args.iconlink, args.iconsize )&lt;br /&gt;
		end&lt;br /&gt;
		if args.image then&lt;br /&gt;
			imagefield = imagefield .. mw.ustring.format(&lt;br /&gt;
				&amp;#039;[[File:%s|%s%s%s|text-top]]&amp;#039;,&lt;br /&gt;
				args.image,&lt;br /&gt;
				args.imagesize or ( args.mini and &amp;#039;16px&amp;#039; or &amp;#039;32px&amp;#039; ),&lt;br /&gt;
				args.imagelink and ( &amp;#039;|link=&amp;#039; .. args.imagelink ) or &amp;#039;&amp;#039;,&lt;br /&gt;
				args.imageclass and ( &amp;#039;|class=&amp;#039; .. args.imageclass ) or &amp;#039;&amp;#039;&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
		resultOpt:wikitext( frame:preprocess( args.imagetextbefore or &amp;#039;&amp;#039; ) .. imagefield .. frame:preprocess( args.imagetextafter or &amp;#039;&amp;#039; ) )&lt;br /&gt;
		result:node( resultOpt )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create displaytext frame&lt;br /&gt;
	local resultNext = mw.html.create( &amp;#039;div&amp;#039; ):addClass( &amp;#039;msgbox-body&amp;#039; ):addClass( &amp;#039;align-&amp;#039; .. ( args[ &amp;#039;text-align&amp;#039; ] or &amp;#039;left&amp;#039; ) ):cssText( args.textcss )&lt;br /&gt;
	-- Create optional title frame inside displaytext frame&lt;br /&gt;
	if args.title then&lt;br /&gt;
		local resultNextTitle = mw.html.create( &amp;#039;div&amp;#039; ):addClass( &amp;#039;msgbox-title&amp;#039; )&lt;br /&gt;
		local resultNextTitleText = &amp;quot;&amp;lt;b&amp;gt;&amp;quot; .. rawTitle .. &amp;quot;&amp;lt;/b&amp;gt;&amp;quot;&lt;br /&gt;
		if args.customaction then&lt;br /&gt;
			resultNextTitleText = resultNextTitleText .. &amp;#039;&amp;lt;sup&amp;gt;&amp;#039; .. frame:preprocess( args.customaction ) .. &amp;#039;&amp;lt;/sup&amp;gt;&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		if args.discuss or args.discussPage or args.discussAnchor then&lt;br /&gt;
			local directLinkTarget = args.discussPage or ( mw.title.getCurrentTitle().talkPageTitle and mw.title.getCurrentTitle().talkPageTitle.fullText )&lt;br /&gt;
			if args.discussAnchor then&lt;br /&gt;
				directLinkTarget = directLinkTarget .. &amp;#039;#&amp;#039; .. args.discussAnchor&lt;br /&gt;
			end&lt;br /&gt;
			local discussText = &amp;#039;&amp;amp;nbsp;&amp;lt;sup&amp;gt;&amp;#039; .. require( &amp;#039;Module:Direct link&amp;#039; ).main{ directLinkTarget, &amp;#039;讨论&amp;#039; } .. &amp;#039;&amp;lt;/sup&amp;gt;&amp;#039;&lt;br /&gt;
			if args.linkshere then&lt;br /&gt;
				discussText = discussText .. &amp;#039;&amp;amp;nbsp;&amp;lt;sup&amp;gt;[[Special:WhatLinksHere/&amp;#039; .. mw.title.getCurrentTitle().fullText .. &amp;#039;|&amp;#039; .. require( &amp;#039;Module:STConversion&amp;#039; ).call{ [ &amp;#039;zh-cn&amp;#039; ] = &amp;#039;链入&amp;#039;, [ &amp;#039;zh-tw&amp;#039; ] = &amp;#039;連入&amp;#039; } .. &amp;#039;]]&amp;lt;/sup&amp;gt;&amp;#039;&lt;br /&gt;
				if mw.title.getCurrentTitle().namespace == 6 then&lt;br /&gt;
					discussText = discussText .. &amp;#039;&amp;amp;nbsp;&amp;lt;sup&amp;gt;[[Special:GlobalUsage/&amp;#039; .. mw.title.getCurrentTitle().text .. &amp;#039;|全域使用]]&amp;lt;/sup&amp;gt;&amp;#039;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			resultNextTitleText = resultNextTitleText .. discussText&lt;br /&gt;
		end&lt;br /&gt;
		resultNextTitle:wikitext( resultNextTitleText )&lt;br /&gt;
		resultNext:node( resultNextTitle )&lt;br /&gt;
	end&lt;br /&gt;
	-- Create optional text frame inside displaytext frame, after optional title frame&lt;br /&gt;
	if args.text then&lt;br /&gt;
		resultNext:tag( &amp;#039;div&amp;#039; ):addClass( &amp;#039;msgbox-text&amp;#039; ):wikitext( &amp;#039;\n&amp;#039; .. rawText .. &amp;#039;\n&amp;#039; )&lt;br /&gt;
		-- Lint: p tag would be auto generated by wikitext parser with the new lines here&lt;br /&gt;
	end&lt;br /&gt;
	-- Add displaytext frame to main frame&lt;br /&gt;
	result:node( resultNext )&lt;br /&gt;
&lt;br /&gt;
	-- Add templatestyles to final result&lt;br /&gt;
	result = ( args.noautoloadstyles and &amp;#039;&amp;#039; or p.getStyles() ) .. tostring( result )&lt;br /&gt;
&lt;br /&gt;
	-- Append tracking categories&lt;br /&gt;
	if args.bgcol then&lt;br /&gt;
		result = result .. &amp;#039;[[Category:使用Message box的bgcol参数的页面]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	if args.linecol then&lt;br /&gt;
		result = result .. &amp;#039;[[Category:使用Message box的linecol参数的页面]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Harry00025</name></author>
	</entry>
</feed>