https://wikiminecraft.es/index.php?title=M%C3%B3dulo:Sprite&feed=atom&action=history
Módulo:Sprite - Historial de revisiones
2024-03-29T07:17:31Z
Historial de revisiones para esta página en el wiki
MediaWiki 1.29.0
https://wikiminecraft.es/index.php?title=M%C3%B3dulo:Sprite&diff=8425&oldid=prev
Xstela en 08:34 8 jul 2014
2014-07-08T08:34:34Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='es'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Revisión anterior</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revisión del 08:34 8 jul 2014</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l50" >Línea 50:</td>
<td colspan="2" class="diff-lineno">Línea 50:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> local styles = {}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> local styles = {}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> if args.stylesheet or default.stylesheet then</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> if args.stylesheet or default.stylesheet then</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> class = ( className or mw.ustring.lower( name ) .. '-sprite ' ) .. class</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> class = ( className or mw.ustring.lower( name<ins class="diffchange diffchange-inline">:gsub( ' ', '-' ) </ins>) .. '-sprite ' ) .. class</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> else</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> else</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> table.insert( styles, 'background-image:{{FileUrl|' .. ( args.image or default.image or name .. 'Sprite.png' ) .. '}}' )</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> table.insert( styles, 'background-image:{{FileUrl|' .. ( args.image or default.image or name .. 'Sprite.png' ) .. '}}' )</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l92" >Línea 92:</td>
<td colspan="2" class="diff-lineno">Línea 92:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> else</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> else</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> -- Internal link</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> -- Internal link</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return '[[' .. link .. '|' .. sprite .. text .. ']]'</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline"> local linkPrefix = args.linkprefix or default.linkprefix or ''</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return '[[' <ins class="diffchange diffchange-inline">.. linkPrefix </ins>.. link .. '|' .. sprite .. text .. ']]'</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> end</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> end</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> else</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> else</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l118" >Línea 118:</td>
<td colspan="2" class="diff-lineno">Línea 119:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> local id = mw.text.trim( args[1] or '' )</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> local id = mw.text.trim( args[1] or '' )</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )]</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )]</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if not pos then</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> if not pos <ins class="diffchange diffchange-inline">and not mw.title.getCurrentTitle().isSubpage </ins>then</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> category = '[[Category:Pages with missing sprites]]'</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> category = '[[Category:Pages with missing sprites]]'</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> end</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div> end</div></td></tr>
</table>
Xstela
https://wikiminecraft.es/index.php?title=M%C3%B3dulo:Sprite&diff=3062&oldid=prev
MinedNugget: Protegió «Módulo:Sprite» ([Editar=Solo permitir administradores] (indefinido) [Pueden trasladar=Solo permitir administradores] (indefinido))
2014-04-20T14:43:03Z
<p>Protegió «<a href="/M%C3%B3dulo:Sprite" title="Módulo:Sprite">Módulo:Sprite</a>» ([Editar=Solo permitir administradores] (indefinido) [Pueden trasladar=Solo permitir administradores] (indefinido))</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<tr style='vertical-align: top;' lang='es'>
<td colspan='1' style="background-color: white; color:black; text-align: center;">← Revisión anterior</td>
<td colspan='1' style="background-color: white; color:black; text-align: center;">Revisión del 14:43 20 abr 2014</td>
</tr><tr><td colspan='2' style='text-align: center;' lang='es'><div class="mw-diff-empty">(Sin diferencias)</div>
</td></tr></table>
MinedNugget
https://wikiminecraft.es/index.php?title=M%C3%B3dulo:Sprite&diff=1052&oldid=prev
MinedNugget: 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...»
2014-04-11T16:34:51Z
<p>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...»</p>
<p><b>Página nueva</b></p><div>local p = {}<br />
function p.base( f )<br />
local args = f<br />
if f == mw.getCurrentFrame() then <br />
args = require( 'Module:ProcessArgs' ).merge( true )<br />
end<br />
<br />
-- Default settings<br />
local default = {<br />
scale = 1,<br />
sheetsize = 256,<br />
size = 16,<br />
pos = 1,<br />
link = '',<br />
align = 'text-top',<br />
class = '',<br />
text = '',<br />
title = ''<br />
}<br />
<br />
local defaultStyle = mw.clone( default )<br />
if args.settings then<br />
local settings = mw.loadData( 'Module:' .. args.settings )<br />
for k, v in pairs( settings ) do<br />
default[k] = v<br />
if settings.stylesheet then<br />
defaultStyle[k] = v<br />
end<br />
end<br />
end<br />
<br />
local name = args.name or default.name<br />
local scale = args.scale or default.scale<br />
local autoScale = args.autoscale or default.autoscale<br />
local sheetWidth = args.sheetsize or default.sheetsize<br />
local size = args.size or default.size<br />
local pos = math.abs( args.pos or default.pos ) - 1<br />
local link = args.link or default.link<br />
local align = args.align or default.align<br />
local class = args.class or default.class<br />
local text = args.text or default.text<br />
local title = args.title or default.title<br />
local css = args.css or default.css<br />
local className = args.classname or default.classname<br />
<br />
local tiles = sheetWidth / size<br />
local left = pos % tiles * size<br />
local top = math.floor( pos / tiles ) * size<br />
<br />
local styles = {}<br />
if args.stylesheet or default.stylesheet then<br />
class = ( className or mw.ustring.lower( name ) .. '-sprite ' ) .. class<br />
else<br />
table.insert( styles, 'background-image:{{FileUrl|' .. ( args.image or default.image or name .. 'Sprite.png' ) .. '}}' )<br />
end<br />
if left > 0 or top > 0 then<br />
table.insert( styles, 'background-position:-' .. left * scale .. 'px -' .. top * scale .. 'px' )<br />
end<br />
if not autoScale and scale ~= defaultStyle.scale then<br />
table.insert( styles, 'background-size:' .. sheetWidth * scale .. 'px auto' )<br />
end<br />
if size ~= defaultStyle.size or ( not autoScale and scale ~= defaultStyle.scale ) then<br />
table.insert( styles, 'height:' .. size * scale .. 'px;width:' .. size * scale .. 'px' )<br />
end<br />
if align ~= defaultStyle.align then<br />
table.insert( styles, 'vertical-align:' .. align )<br />
end<br />
if css then<br />
table.insert( styles, css )<br />
end<br />
if title ~= '' then<br />
title = ' title="' .. title .. '"'<br />
end<br />
<br />
local sprite = table.concat( {<br />
'<span',<br />
'class="sprite ' .. class .. '"',<br />
'style="' .. table.concat( styles, ';' ) .. '"',<br />
title,<br />
'><br></span>'<br />
}, ' ' )<br />
sprite = sprite:gsub( '%s+([">])', '%1' )<br />
<br />
if text ~= '' then<br />
text = '<span class="sprite-text nowrap"' .. title .. '>' .. text .. '</span>'<br />
end<br />
<br />
if link ~= '' then<br />
if link:find( '//' ) then<br />
-- External link<br />
return '[' .. link .. ' ' .. sprite .. text .. ']'<br />
else<br />
-- Internal link<br />
return '[[' .. link .. '|' .. sprite .. text .. ']]'<br />
end<br />
else<br />
return sprite .. text<br />
end<br />
end<br />
<br />
function p.sprite( f )<br />
local args = f<br />
if f == mw.getCurrentFrame() then<br />
args = require( 'Module:ProcessArgs' ).merge( true )<br />
end<br />
<br />
local category = ''<br />
if tonumber( args[1] ) then<br />
args.pos = args[1]<br />
else<br />
local default = {}<br />
if args.settings then<br />
default = mw.loadData( 'Module:' .. args.settings )<br />
end<br />
<br />
local name = args.name or default.name<br />
local ids = mw.loadData( 'Module:' .. ( args.ids or default.ids or 'Sprite/' .. name ) )<br />
local id = mw.text.trim( args[1] or '' )<br />
local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )]<br />
if not pos then<br />
category = '[[Category:Pages with missing sprites]]'<br />
end<br />
args.pos = pos<br />
end<br />
<br />
return p.base( args ) .. category<br />
end<br />
<br />
function p.link( f )<br />
local args = f<br />
if f == mw.getCurrentFrame() then<br />
args = require( 'Module:ProcessArgs' ).merge( true )<br />
end<br />
<br />
local link = args[1]<br />
if args[1] and not args.id then<br />
link = args[1]:match( '^(.-)%+' ) or args[1]<br />
end<br />
local text = args.text or args[2] or link<br />
<br />
args[1] = args.id or args[1]<br />
args.link = link<br />
args.text = text<br />
<br />
return p.sprite( args )<br />
end<br />
<br />
function p.doc( f )<br />
local settings = mw.loadData( 'Module:' .. f.args[1] )<br />
local idTable = mw.title.new( 'Module:' .. ( settings.ids or 'Sprite/' .. settings.name ) ):getContent()<br />
idTable = idTable:gsub( '(\n%s*%-%-%s*.-%s*%-%-%s*\n)', '%1,' ):gsub( '^return {', '' ):gsub( '}$', '' )<br />
<br />
local html = {}<br />
local ids = {}<br />
local posKeys = {}<br />
local section = ''<br />
for line in mw.text.gsplit( idTable, ',' ) do<br />
line = mw.text.trim( line )<br />
id = line:match( '^%[[\'"](.+)[\'"]%]' ) or line:match( '^%w+' ) or ''<br />
pos = line:match( '=%s*(%d+)%s*,?$' ) or ''<br />
section = line:match( '^%-%-%s*(.+)%s*%-%-$' ) or section<br />
<br />
if id ~= '' and pos ~= '' then<br />
if ids[pos] then<br />
if type( ids[pos].id ) == 'table' then<br />
table.insert( ids[pos].id, id )<br />
else<br />
ids[pos].id = { ids[pos].id, id }<br />
end<br />
else<br />
ids[pos] = { id = id, section = section }<br />
table.insert( posKeys, pos )<br />
end<br />
end<br />
end<br />
<br />
local list = {}<br />
local listHead = '<ul class="spritedoc-multicolumn">'<br />
local listFoot = '</ul>'<br />
local lastSection = ''<br />
for i, pos in ipairs( posKeys ) do<br />
local id = ids[pos].id<br />
local newSection = mw.text.trim( ids[pos].section )<br />
<br />
if newSection ~= lastSection or i == 1 then<br />
if newSection ~= lastSection then<br />
if lastSection ~= '' then<br />
table.insert( list, listFoot )<br />
end<br />
<br />
table.insert( list, '\n===' .. newSection .. '===\n' )<br />
lastSection = newSection<br />
end<br />
table.insert( list, listHead )<br />
end<br />
table.insert( list, '<li><table><tr><td data-pos="' .. pos .. '">' )<br />
if type( id ) == 'table' then<br />
for i, id2 in ipairs( id ) do<br />
if i == 1 then<br />
table.insert( list, p.sprite{ id2, settings = f.args[1] } .. '</td><td><div class="sprite-id"><code>' .. id2 .. '</code></div>' )<br />
else<br />
table.insert( list, '<div class="sprite-id"><code>' .. id2 .. '</code></div>' )<br />
end<br />
end<br />
else<br />
table.insert( list, p.sprite{ id, settings = f.args[1] } .. '</td><td><div class="sprite-id"><code>' .. id .. '</code></div>' )<br />
end<br />
table.insert( list, '</td></tr></table></li>' )<br />
<br />
if i == #posKeys then<br />
table.insert( list, listFoot )<br />
end<br />
end<br />
<br />
local out = table.concat( list )<br />
if not f.args.refresh then<br />
out = f:preprocess( '{{#widget:stylesheet|page=Sprite doc}}' ) .. '<div id="sprite-doc" data-settings="' .. f.args[1] .. '">' .. out .. '</div>'<br />
end<br />
<br />
return out<br />
end<br />
return p</div>
MinedNugget