Diferencia entre revisiones de «Módulo:Sprite»
Página creada con «local p = {} function p.base( f ) local args = f if f == mw.getCurrentFrame() then args = require( 'Module:ProcessArgs' ).merge( true ) end -- Default settings lo...» |
Sin resumen de edición |
||
| (No se muestra una edición intermedia de otro usuario) | |||
| Línea 50: | Línea 50: | ||
local styles = {} | local styles = {} | ||
if args.stylesheet or default.stylesheet then | if args.stylesheet or default.stylesheet then | ||
class = ( className or mw.ustring.lower( name ) .. '-sprite ' ) .. class | class = ( className or mw.ustring.lower( name:gsub( ' ', '-' ) ) .. '-sprite ' ) .. class | ||
else | else | ||
table.insert( styles, 'background-image:{{FileUrl|' .. ( args.image or default.image or name .. 'Sprite.png' ) .. '}}' ) | table.insert( styles, 'background-image:{{FileUrl|' .. ( args.image or default.image or name .. 'Sprite.png' ) .. '}}' ) | ||
| Línea 92: | Línea 92: | ||
else | else | ||
-- Internal link | -- Internal link | ||
return '[[' .. link .. '|' .. sprite .. text .. ']]' | local linkPrefix = args.linkprefix or default.linkprefix or '' | ||
return '[[' .. linkPrefix .. link .. '|' .. sprite .. text .. ']]' | |||
end | end | ||
else | else | ||
| Línea 118: | Línea 119: | ||
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%+]', '-' )] | ||
if not pos then | if not pos and not mw.title.getCurrentTitle().isSubpage then | ||
category = '[[Category:Pages with missing sprites]]' | category = '[[Category:Pages with missing sprites]]' | ||
end | end | ||