Module:Sprite: Difference between revisions
No edit summary |
No edit summary |
||
| Line 29: | Line 29: | ||
if imgClasses[name] then | if imgClasses[name] then | ||
class = | class = mw.ustring.lower( name ) .. '-sprite ' .. class | ||
else | else | ||
table.insert( styles, 'background-image:{{FileUrl|' .. ( image or name .. 'Sprite.png' ) .. '}}' ) | table.insert( styles, 'background-image:{{FileUrl|' .. ( image or name .. 'Sprite.png' ) .. '}}' ) | ||
| Line 86: | Line 86: | ||
local ids = mw.loadData( 'Module:Sprite/' .. args.name ) | local ids = mw.loadData( 'Module:Sprite/' .. args.name ) | ||
local id = mw.text.trim( args[1] or '' ) | local id = mw.text.trim( args[1] or '' ) | ||
local pos = ids[id] or ids[ | local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )] | ||
if not pos then | if not pos then | ||
category = '[[Category:Pages with missing sprites]]' | category = '[[Category:Pages with missing sprites]]' | ||