Module:Sprite: Difference between revisions

Temporarily patch in the style tag changes to fix invsprite documentation
Add nourl setting, and make documentation use the style tag if available
Line 43: Line 43:
local styles = {}
local styles = {}
if setting( 'url' ) then
if not setting( 'nourl' ) and setting( 'url' ) then
styles[#styles + 1] = 'background-image:' .. ( setting( 'url' ).url or setting( 'url' ) )
styles[#styles + 1] = 'background-image:' .. ( setting( 'url' ).url or setting( 'url' ) )
end
end
Line 234: Line 234:
return table.concat( protections, ',' )
return table.concat( protections, ',' )
end
local spriteStyle = ''
if data.settings.url and data.settings.url.style then
spriteStyle = data.settings.url.style
end
end
Line 285: Line 290:
local box = section.boxes:tag( 'li' ):addClass( 'spritedoc-box' ):attr( 'data-pos', pos )
local box = section.boxes:tag( 'li' ):addClass( 'spritedoc-box' ):attr( 'data-pos', pos )
box:tag( 'div' ):addClass( 'spritedoc-image' )
box:tag( 'div' ):addClass( 'spritedoc-image' )
:wikitext( p.base{ pos = pos, data = dataPage } )
:wikitext( p.base{ pos = pos, data = dataPage, nourl = spriteStyle ~= '' } )
names = box:tag( 'ul' ):addClass( 'spritedoc-names' )
names = box:tag( 'ul' ):addClass( 'spritedoc-names' )
Line 300: Line 305:
if args.refresh then
if args.refresh then
return '', tostring( body )
return '', '', tostring( body )
end
end
return f:callParserFunction( '#widget:SpriteDoc.css' ), tostring( body )
local styles = f:callParserFunction( '#widget:SpriteDoc.css' )
return styles, spriteStyle, tostring( body )
end
end
return p
return p