Modulo:Immagine multipla: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
semplifico il codice
Moroboshi (discussione | contributi)
fix per div centrato
Riga 136:
for c=1,perrow[r] do
k = k + 1
if( k <= imagecount ) then
local iwidths[k] = getWidth(args['larghezza' .. imagenumbers[k]], width)
widths[k] = getWidth(width, args['larghezza' .. i])
widthsum[r] = widthsum[r] + widths[k]
end
Line 189 ⟶ 188:
 
-- start building the array of images, if there are images
if( imagecount > 0 ) then
-- compute width of outer div
local bodywidth = 0
for r=1,rowcount do
if(local widthmaxbw == widthsum[r] + 4 * (perrow[r] - 1) then+ 12
bodywidth = widthmax + 4 * math.max(perrow[r]bodywidth, - 1bw) + 12
end
end
-- The body has a min-width of 100, which needs to be taken into account on specific widths
Line 204 ⟶ 202:
local root = mw.html.create('div')
root:addClass('thumb')
--root:addClass('tmulti')
root:addClass(thumbclass[align] or 'tright')
root:css('width', tostring(bodywidth) .. 'px')
root:css('clear', 'both')
root:css('text-align', 'center')
 
if( align == 'center' or align == 'centre' or align == 'centro') then
root:addClasscss('centermargin', '0 auto')
--root:addClass('center')
end
if( bg ~= '' ) then