首页
随机
登录
设置
关于DJMAX中文资料库
免责声明
DJMAX中文资料库
搜索
查看“︁模块:Video”︁的源代码
←
模块:Video
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} local i18n = { trackCategory = '[[Category:嵌入%s视频的页面]]', services = { -- when video embeded with a new service provider, add it here youtube = 'YouTube', vimeo = 'Vimeo', bilibili = 'Bilibili', } } function p.genVideo( provider, id, width, height, align, caption, urlArgs, dimensions ) if not id then return nil end provider = provider and provider:lower() or 'youtube' dimensions = dimensions or tonumber( width ) or 425 height = tonumber( height ) if height then dimensions = dimensions .. 'x' .. height end if urlArgs then return mw.getCurrentFrame():callParserFunction{ name = '#ev', args = { provider, id = id, dimensions = dimensions, alignment = align, description = caption, urlArgs = urlArgs } } else return mw.getCurrentFrame():extensionTag{ name = provider, content = id, args = { dimensions = dimensions, alignment = align, description = caption } } end end function p.main( f ) local args = f if f == mw.getCurrentFrame() then args = require( 'Module:ProcessArgs' ).merge( true ) end local result if args.provider then result = p.genVideo( args.provider, args[ 1 ], args[ 2 ], args[ 3 ], args.align, args.caption, args.urlargs, nil ) else result = p.genVideo( args[ 1 ], args[ 2 ] or args.id, nil, nil, args[ 4 ] or args.alignment, args[ 5 ] or args.description or args.caption, args[ 7 ] or args.urlargs, args[ 3 ] or args.dimensions ) end if result then result = mw.html.create( 'div' ):wikitext( result ) if not args.nocat then result = tostring( result ) .. i18n.trackCategory:format( i18n.services[ args.provider and args.provider:lower() or '' ] or '' ) end end return result end return p
该页面使用的模板:
模块:Video/doc
(
查看源代码
)
返回
模块:Video
。