匿名
未登录
讨论
深色模式
贡献
创建账号
登录
互联网一战博物馆
搜索
编辑“︁
Module:Image area
”︁
来自互联网一战博物馆
命名空间
模块
讨论
更多
更多
页面操作
阅读
编辑
历史
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
local p = {} local function imageLink( name, size, class ) local rows = { 'File:'..name } if size then table.insert(rows, ''..size) end if class then table.insert(rows, 'class='..class) end if name == 'No image.svg' then table.insert(rows, 'link=') end return '[['..table.concat(rows, '|')..']]' end function p.imageArea( f ) local args = require( 'Module:ProcessArgs' ).merge( true ) return p.main( args ) end function p.main( args ) local titleObject = mw.title.getCurrentTitle() local title = args.title or titleObject.baseText local rlinkTriggered = false local titleImageLoaded = false local imageArea local images = {} local invImages = {} local defaultImageSize = args.defaultimagesize or '150px' local defaultImageClass = args.defaultimageclass args.image1 = args.image1 or args.image or 'No image.svg' args.image1size = args.image1size or args.imagesize args.image1class = args.image1class or args.imageclass args.invimage1 = args.invimage1 or args.invimage local imgCount = {} local invImgCount = {} for k, v in pairs( args ) do if type( k ) == 'string' then local image, num = k:match( '^(image)(%d+)$' ) local invImage, invNum = k:match( '^(invimage)(%d+)$' ) if v:lower() ~= 'none' then if image then table.insert( imgCount, tonumber( num ) ) elseif invImage then table.insert( invImgCount, tonumber( invNum ) ) end end end end table.sort( imgCount ) local animate for k, v in ipairs( imgCount ) do local image = args['image' .. v] local size = args['image' .. v .. 'size'] or defaultImageSize local class = args['image' .. v .. 'class'] or defaultImageClass if image:match( ';' ) then if not animate then animate = require( 'Module:Animate' ).animate end image = animate{ image, size, nil, class } elseif image:match( '\\' ) then local trimages = {} for v in mw.text.gsplit(string.gsub( image, ' ', '_' ), '\\' ) do local current_image = imageLink( v, size, class ) if v:match( '_Simplified%.[^.]+$' ) then trimages[1] = current_image elseif v:match ( '_Traditional%.[^.]+$' ) then trimages[2] = current_image elseif v:match ( '_Traditional_HK%.[^.]+$' ) then trimages[3] = current_image end end image = require( 'Module:STConversion' ).call(trimages) else image = imageLink( image, size, class ) end table.insert( images, '<div>' .. image .. '</div>' ) end images = table.concat( images, '\n' ) if #invImgCount > 0 then table.sort( invImgCount ) local slot local invAliases = mw.loadData( 'Module:Inventory slot/Aliases' ) for k, v in ipairs( invImgCount ) do local image = args['invimage' .. v] if image == '----' then table.insert( invImages, '</div><div style="padding-top:.5em">' ) elseif image then if not slot then slot = require( 'Module:Inventory slot' ).slot end table.insert( invImages, slot{ image, link = 'none' } ) end end if slot and #invImages > 0 then invImages = '<div class="infobox-invimages"><div>' .. table.concat( invImages, '' ) .. '</div></div>' else invImages = '' end else invImages = '' end if images ~= '' or invImages ~= '' then imageArea = images .. '\n' .. invImages else imageArea = 'none' end if imageArea and imageArea ~= 'none' then imageArea = '<div class="infobox-imagearea">' .. imageArea .. '</div>' else imageArea = '' end return imageArea end return p
摘要:
请注意,所有对互联网一战博物馆的贡献均被视为依照Creative Commons Attribution Share Alike发表(详情请见
互联网一战博物馆:著作权
)。如果您不希望您的文字作品被随意编辑和分发传播,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
该页面使用的模板:
Module:Image area/doc
(
编辑
)
我们为您提供服务需要使用Cookie。使用我们的服务即表示您同意我们使用Cookie。
更多信息
确定
导航
导航
首页
最近更改
随机页面
目录
起源
时间线
事件
人物
组织
文物馆
媒体文物
文字文物
社区
MediaWiki聊天
聊天中的在线用户
wiki工具
wiki工具
特殊页面
获取短链接
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志