Diferencia entre revisiones de «Módulo:Centrar/pruebas»

Contenido eliminado Contenido añadido
Prueba para módulo todo terreno personalizable full 100% real no fake
posible implementación de bloque centro
Línea 37:
['letter-spacing']='sp', ['espaciado']='sp',
['offset']='margen',
['id']='anclaje',
['width']='ancho',
['align'] = 'alinear'
}
 
Línea 57 ⟶ 59:
 
local html = mw.html.create() -- cuerpo principal de la plantilla
local div = html:tag(argus['tag'] or 'div')
div:css('text-align', argus['alinear'])
Línea 63 ⟶ 66:
div:css('float', argus['float'])
end
--if argus['tag'] == "h2" then
-- div:css('border-bottom','0 none')
-- end
--if argus['tag'] == "h3" or argus['tag'] == "h4" or argus['tag'] == "h5" then
-- div:css('font-weight','normal')
--end
-- sección de parámetros
Línea 101 ⟶ 97:
end
end
-- div:css('clear','both') — No utilidad aparente?
 
if argus['estilo'] then --estilo personalizado
div:cssText(argus['estilo'])
end
div:css('clear','both')
--texto
div:wikitext(argus[1])
if argus['alinear'] == 'right' then --para reutilizar código en {{derecha}}
div:css('margin-right', argus[2'margen'] or argus['margen'2] or '' )
end
if argus['float'] == 'right' then --asimilar comportamieto de {{float right}} y {{flotador derecha}}
div:css('margin-right', argus[2'margen'] or argus['margen'2] or '0')
div:css('margin-top', argus[3] or '0')
div:css('margin-bottom', argus[3] or '0')
Línea 123 ⟶ 118:
div:css('margin-right', argus[3] or '0')
end
if argus['colgante'] == 's' then --asimilar comportamieto de {{sangría colgante}}
div:css('margin-left', argus[2] or '2em')
div:css('text-indent', '-'..(argus[2] or '2em'))
end
if argus['bloque'] == 'centro' then --asimilar comportamiento de {{bloque centro}}
div:cssText('display: table; margin-right:auto; margin-left:auto')
div:css('width', argus['ancho'] or 'auto')
end
-- anclaje
if argus['anclaje'] then