Modulo:Immagine multipla: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
fix problema immagini ripetute
Evita background-color: transparent, non funziona bene con la night mode. Impostando il valore a nil la proprietà viene omessa del tutto.
 
(4 versioni intermedie di 3 utenti non mostrate)
Riga 9:
--=====================================================
-- Generazione del codice una singola cella contenente
-- un immmagine'immagine
--=====================================================
local function renderImageCell(image, width, height, link, alt, caption, textalign, istyle)
Riga 227:
local bodywidth = 0
for r=1,rowcount do
local bw = widthsum[r] + 4 * (perrow[r] - 1) + 122
bodywidth = math.max(bodywidth, bw)
end
Riga 233:
bodywidth = math.max( 100, bodywidth);
 
local bg = args['sfondo']
-- crea il div esterno per la galleria di immagini
local root = mw.html.create('div')
root:addClass('thumb')
root:addClass(thumbclass[align] or 'tright')
root:css('width', tostring(bodywidth+2) .. 'px')
-- :css('max-width', tostring(bodywidth) .. 'px')
if align == 'center' or align == 'centre' or align == 'centro' then
root:css('margin', '0 auto')
end
if bg then root:css('background-color', bg) end
-- crea il div interno
local div = root:tag('div')
div:addClass('thumbinner')
if bg then
div:css('background-colorwidth', bgtostring(bodywidth+2) .. 'px')
:css('flex-direction', 'row')
if align == 'center' or align == 'centre' or align == 'centro' then
rootdiv:css('margin', '0 auto')
end
div:addClass('thumbinner')
if bg then div:css('background-color', bg) end
-- aggiunge il titolo
if header then
Line 256 ⟶ 250:
:css('clear', 'both')
:css('text-align', args['allinea titolo'] or 'center')
:css('background-color', args['sfondo titolo'] or 'transparent')
:wikitext(header)
end
Line 269 ⟶ 263:
if dir ~= 'vertical' then
imagediv:css('float', 'left')
end
if bg ~= '' then
imagediv:css('background-color', bg);
end
imagediv:css('margin', '1px')
Line 295 ⟶ 286:
:css('clear', 'left')
:css('text-align', args['allinea sotto'] or 'left')
:css('background-color', args['sfondo sotto'] or 'transparent')
:wikitext(footer)
end