Module:Sprite: Difference between revisions
Add settings file to prevent settings having to be duplicated; smarter default styling to reduce inline styling when possible. |
No edit summary |
||
| Line 116: | Line 116: | ||
args.pos = args[1] | args.pos = args[1] | ||
else | else | ||
local | local default | ||
if settings then | if args.settings then | ||
default = mw.loadData( 'Module:' .. args.settings ) | |||
end | end | ||
local name = args.name or | local name = args.name or default.name | ||
local ids = mw.loadData( 'Module:' .. ( args.ids or | local ids = mw.loadData( 'Module:' .. ( args.ids or default.ids or 'Sprite/' .. name ) ) | ||
local id = mw.text.trim( args[1] or '' ) | local id = mw.text.trim( args[1] or '' ) | ||
local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )] | local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )] | ||