Module:SpriteFile: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 79: Line 79:
end
end
local sprite = mw.html.create( 'span' ):addClass( 'sprite-file' )
local sprite = mw.html.create( 'span' ):addClass( 'sprite-file' )
if args.title ~= nil then  -- <------ this part is new
if string.find(args.title, "parallel:") then
if string.find(args.title, "parallel:") then
args.title = mw.ustring.gsub( args.title, "[Pp]arallel:", "" )
args.title = mw.ustring.gsub( args.title, "[Pp]arallel:", "" )
else
args.title = args.title .. ' (Vanilla)'
end
local img = '[[File:' .. file .. '|' .. size .. '|link=' .. link .. '|alt=' .. altText .. '|class=pixel-image|' .. ( args.title ) .. ']]'
else
else
local img = '[[File:' .. file .. '|' .. size .. '|link=' .. link .. '|alt=' .. altText .. '|class=pixel-image|' .. ( '' ) .. ']]'
args.title = args.title .. ' (Vanilla)'
end
end
local img = '[[File:' .. file .. '|' .. size .. '|link=' .. link .. '|alt=' .. altText .. '|class=pixel-image|' .. ( args.title or '' ) .. ']]'
sprite:node( img )
sprite:node( img )

Navigation menu