Bureaucrats, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, translator, Widget editors
154
edits
(Better inlining that actually works) |
No edit summary |
||
Line 51: | Line 51: | ||
end | end | ||
local | local Sprite = require([[Module:Sprite]]) | ||
local sprite | |||
local image = args['image'] or args['Image'] | |||
if image then | |||
sprite = Sprite.Custom:new(args[1], image) | |||
else | |||
local spriteSheet = args['spriteSheet'] or | |||
args['SpriteSheet'] or | |||
"inventory" | |||
sprite = Sprite | |||
:new(spriteSheet) | |||
:setItem(mw.text.trim(args[1] or "")) | |||
end | |||
if args['small'] or args['Small'] then | if args['small'] or args['Small'] then | ||
sprite:SetSize(16) | sprite:SetSize(16) | ||
else | |||
sprite:SetSize(args['size'] or args['Size'] or 32) | |||
end | end | ||
local | local inline = args['inline'] or args['Inline'] | ||
local spriteDiv | |||
if inline then | |||
spriteDiv = sprite:GenerateHTML("css") | |||
spriteDiv:css("display","inline-block") | spriteDiv:css("display","inline-block") | ||
spriteDiv:css("vertical-align","middle") | spriteDiv:css("vertical-align","middle") | ||
else | |||
spriteDiv = sprite:GenerateHTML() | |||
end | end | ||
edits