Module:Sprite: Difference between revisions
Update to support merging settings and IDs module into a single data module, and specifying an inline URL in the settings for instant cache busting. The sprite documentation will be broken until the modules are merged. |
Remove settings/ids compatibility |
||
| Line 9: | Line 9: | ||
local data = args.data and mw.loadData( 'Module:' .. args.data ) or {} | local data = args.data and mw.loadData( 'Module:' .. args.data ) or {} | ||
local settings = data. | local settings = data.settings | ||
-- Default settings | -- Default settings | ||
| Line 135: | Line 134: | ||
end | end | ||
local data = args.data and mw.loadData( 'Module:' .. args.data ) or {} | local data = args.data and mw.loadData( 'Module:' .. args.data ) or {} | ||
local categories = {} | local categories = {} | ||
local idData = args.iddata | local idData = args.iddata | ||
if not idData then | if not idData then | ||
local name = args.name or default.name | local name = args.name or default.name | ||
local id = mw.text.trim( tostring( args[1] or '' ) ) | local id = mw.text.trim( tostring( args[1] or '' ) ) | ||
idData = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )] | idData = data.ids[id] or data.ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )] | ||
end | end | ||