打开/关闭搜索
搜索
打开/关闭菜单
83
247
21
3.5K
NebulaeWiki
导航
首页
最近更改
特殊页面
上传文件
速览
成员守则
建设标准
玩家指南
编辑指南
交通
地铁
市域铁路
有轨电车
公交系统
活动
第一届星运会
第二届星运会
N20 · 杭州
关于
关于本站
隐私政策
免责声明
系统信息
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁模块:Mbox”︁的源代码
爱来自星云工艺喵!(づ。◕◡◡◕。)づ
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:Mbox
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
此页面已受到保护,以防止编辑或其他操作。
您可以查看和复制此页面的源代码。
local libraryUtil = require( 'libraryUtil' ) local checkType = libraryUtil.checkType local mArguments -- lazily initialise [[Module:Arguments]] local mError -- lazily initialise [[Module:Error]] local p = {} --- Helper function to throw error -- -- @param msg string - Error message -- -- @return string - Formatted error message in wikitext local function makeWikitextError( msg ) mError = require( 'Module:Error' ) return mError.error { message = 'Error: ' .. msg .. '.' } end function p.mbox( frame ) mArguments = require( 'Module:Arguments' ) local args = mArguments.getArgs( frame ) local title = args[ 1 ] or args[ 'title' ] local text = args[ 2 ] or args[ 'text' ] if not title or not text then return makeWikitextError( 'no title or text specified' ) end return p._mbox( title, text, { extraclasses = args.extraclasses, icon = args.icon } ) end function p._mbox( title, text, options ) checkType( '_mbox', 1, title, 'string' ) checkType( '_mbox', 2, text, 'string' ) checkType( '_mbox', 3, options, 'table', true ) options = options or {} local mbox = mw.html.create( 'div' ) local extraclasses if type( options.extraclasses ) == 'string' then extraclasses = options.extraclasses end mbox :attr( 'role', 'presentation' ) :addClass( 'mbox' ) :addClass( extraclasses ) local mboxTitle = mbox:tag( 'div' ):addClass( 'mbox-title' ) if options.icon and type( options.icon ) == 'string' then mboxTitle:tag( 'div' ) :addClass( 'mbox-icon metadata' ) :wikitext( '[[File:' .. options.icon .. '|14px|link=]]' ) :done() :tag( 'div' ) :wikitext( title ) else mboxTitle:wikitext( title ) end mbox:tag( 'div' ) :addClass( 'mbox-text' ) :wikitext( text ) return mw.getCurrentFrame():extensionTag { name = 'templatestyles', args = { src = 'Module:Mbox/styles.css' } } .. tostring( mbox ) end return p
该页面使用的模板:
模块:Mbox/doc
(
查看源代码
)
返回
模块:Mbox
。
我们为您提供服务需要使用Cookie。使用我们的服务即表示您同意我们使用Cookie。
确定