首页
随机
登录
设置
关于NeuroWiki
免责声明
NeuroWiki
搜索
查看“Module:Message box”的源代码
←
Module:Message box
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local p = {} function commentSprite( pos, link ) if not pos or mw.text.trim( pos ) == '' then return '' end return require( 'Module:Sprite' ).base{ name = 'Comment', pos = pos, image = 'CommentCSS.png', sheetsize = 48, stylesheet = 1, link = link } end function p.main( f ) local args = f local frame = mw.getCurrentFrame() if f == frame then args = require( 'Module:ProcessArgs' ).merge( true ) end local rawTitle = frame:preprocess( frame:getParent().args.title ) local rawText = frame:preprocess( frame:getParent().args.text ) -- Create main frame local result = mw.html.create( 'div' ):addClass( 'msgbox searchaux' ):addClass( 'msgbox-' .. ( args.type or 'notice' ) ):addClass( args.class ):cssText( args.css ):css{ [ 'background-color' ] = args.bgcol, [ 'border-left-color' ] = args.linecol, [ 'font-size' ] = args[ 'font-size' ], [ 'width' ] = args.width or ( args.compat and 'fit-content' or nil ), } if args.mini then result:addClass( 'msgbox-mini' ) end -- Create optional icon / image frame if args.icon or args.image then result:addClass( 'has-image' ) local resultOpt = mw.html.create( 'div' ):addClass( 'msgbox-icon-image' ):cssText( args.imagecss ) local imagefield = '' if args.icon then imagefield = imagefield .. commentSprite( args.icon, args.iconlink ) end if args.image then imagefield = table.concat{ imagefield, '[[', 'File:', mw.text.split( args.image, '|', true )[ 1 ], '|link=', mw.text.split( args.imagelink or '', '|', true )[ 1 ], '|', args.imagesize or ( args.mini and '16px' or '32px' ), args.imageclass and ( '|class=' .. args.imageclass ) or '', '|', 'text-top', ']]' } end resultOpt:wikitext( frame:preprocess( args.imagetextbefore or '' ) .. imagefield .. frame:preprocess ( args.imagetextafter or '' ) ) result:node( resultOpt ) end -- Create displaytext frame local resultNext = mw.html.create( 'div' ):addClass( 'msgbox-body' ):addClass( 'align-' .. ( args[ 'text-align' ] or 'left' ) ):cssText( args.textcss ) -- Create optional title frame inside displaytext frame if args.title then local resultNextTitle = mw.html.create( 'div' ):addClass( 'msgbox-title' ) local resultNextTitleText = "<b>" .. rawTitle .. "</b>" if args.customaction then resultNextTitleText = resultNextTitleText .. '<sup>' .. frame:preprocess( args.customaction ) .. '</sup>' end if args.discuss or args.discussPage or args.discussAnchor then local directLinkTarget = args.discussPage or mw.title.getCurrentTitle().talkPageTitle.fullText if args.discussAnchor then directLinkTarget = directLinkTarget .. '#' .. args.discussAnchor end local discussText = ' <sup>' .. require( 'Module:Direct link' ).main{ directLinkTarget, '讨论' } .. '</sup>' if args.linkshere then discussText = discussText .. ' <sup>[[Special:WhatLinksHere/' .. mw.title.getCurrentTitle().fullText .. '|' .. require( 'Module:STConversion' ).call{ [ 'zh-cn'] = '链入', [ 'zh-tw' ] = '連入' } .. ']]</sup>' end resultNextTitleText = resultNextTitleText .. discussText end resultNextTitle:wikitext( resultNextTitleText ) resultNext:node( resultNextTitle ) end -- Create optional text frame inside displaytext frame, after optional title frame if args.text then resultNext:tag( 'div' ):addClass( 'msgbox-text' ):wikitext( '<p>\n' .. rawText .. '\n</p>' ) end -- Add displaytext frame to main frame result:node( resultNext ) -- Add templatestyles to final result result = require( 'Module:TSLoader' ).call( 'Template:Message box/styles.css' ) .. tostring( result ) -- Append tracking categories if args.bgcol then result = result .. '[[Category:使用Message box的bgcol参数的页面]]' end if args.linecol then result = result .. '[[Category:使用Message box的linecol参数的页面]]' end return result end return p
该页面使用的模板:
Template:Dd
(
查看源代码
)
Template:Dependency declaration
(
查看源代码
)
Template:Documentation header
(
查看源代码
)
Template:T
(
查看源代码
)
Template:Template link
(
查看源代码
)
Template:Transclude
(
查看源代码
)
Module:Message box/doc
(
查看源代码
)
返回
Module:Message box
。