<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it">
	<id>https://it.seminaverbi.bibleget.io/w/index.php?action=history&amp;feed=atom&amp;title=Modulo%3AImmagine_multipla</id>
	<title>Modulo:Immagine multipla - Cronologia</title>
	<link rel="self" type="application/atom+xml" href="https://it.seminaverbi.bibleget.io/w/index.php?action=history&amp;feed=atom&amp;title=Modulo%3AImmagine_multipla"/>
	<link rel="alternate" type="text/html" href="https://it.seminaverbi.bibleget.io/w/index.php?title=Modulo:Immagine_multipla&amp;action=history"/>
	<updated>2026-04-23T11:29:54Z</updated>
	<subtitle>Cronologia della pagina su questo sito</subtitle>
	<generator>MediaWiki 1.44.3</generator>
	<entry>
		<id>https://it.seminaverbi.bibleget.io/w/index.php?title=Modulo:Immagine_multipla&amp;diff=2575&amp;oldid=prev</id>
		<title>Johnrdorazio: una versione importata</title>
		<link rel="alternate" type="text/html" href="https://it.seminaverbi.bibleget.io/w/index.php?title=Modulo:Immagine_multipla&amp;diff=2575&amp;oldid=prev"/>
		<updated>2020-08-30T22:53:20Z</updated>

		<summary type="html">&lt;p&gt;una versione importata&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versione delle 22:53, 30 ago 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;it&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Nessuna differenza)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key seminaverbi_it:diff:1.41:old-2574:rev-2575 --&gt;
&lt;/table&gt;</summary>
		<author><name>Johnrdorazio</name></author>
	</entry>
	<entry>
		<id>https://it.seminaverbi.bibleget.io/w/index.php?title=Modulo:Immagine_multipla&amp;diff=2574&amp;oldid=prev</id>
		<title>it&gt;Moroboshi: rimuovo il parametro sfondo come da richiesta in Discussioni_template:Immagine_multipla#Sfondo</title>
		<link rel="alternate" type="text/html" href="https://it.seminaverbi.bibleget.io/w/index.php?title=Modulo:Immagine_multipla&amp;diff=2574&amp;oldid=prev"/>
		<updated>2019-06-30T13:33:41Z</updated>

		<summary type="html">&lt;p&gt;rimuovo il parametro sfondo come da richiesta in Discussioni_template:Immagine_multipla#Sfondo&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nuova pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--=====================================================&lt;br /&gt;
-- Implementazione del  [[template:Immagine multipla]]&lt;br /&gt;
-- Importato e modificato da &lt;br /&gt;
-- https://en.wikipedia.org/w/index.php?title=Module:Multiple_image&amp;amp;oldid=706647916&lt;br /&gt;
--=====================================================&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--=====================================================&lt;br /&gt;
-- Generazione del codice una singola cella contenente&lt;br /&gt;
-- un&amp;#039;immagine&lt;br /&gt;
--=====================================================&lt;br /&gt;
local function renderImageCell(image, width, height, link, alt, caption, textalign, istyle)&lt;br /&gt;
	local root = mw.html.create(&amp;#039;&amp;#039;)&lt;br /&gt;
	&lt;br /&gt;
	local altstr = &amp;#039;|alt=&amp;#039; .. (alt or &amp;#039;&amp;#039;)&lt;br /&gt;
	local linkstr = link and (&amp;#039;|link=&amp;#039; .. link) or &amp;#039;&amp;#039;&lt;br /&gt;
	local widthstr = &amp;#039;|&amp;#039; .. tostring(width) .. &amp;#039;px&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local imagediv = root:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
	imagediv:addClass(&amp;#039;thumbimage&amp;#039;)&lt;br /&gt;
	imagediv:cssText(istyle)&lt;br /&gt;
	if height then&lt;br /&gt;
		imagediv:css(&amp;#039;height&amp;#039;, tostring(height) .. &amp;#039;px&amp;#039;)&lt;br /&gt;
		imagediv:css(&amp;#039;overflow&amp;#039;, &amp;#039;hidden&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	imagediv:wikitext(&amp;#039;[[file:&amp;#039; .. image .. widthstr .. linkstr .. altstr .. &amp;#039;]]&amp;#039;)&lt;br /&gt;
	if caption then&lt;br /&gt;
		local captiondiv = root:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		captiondiv:addClass(&amp;#039;thumbcaption&amp;#039;)&lt;br /&gt;
		captiondiv:css(&amp;#039;clear&amp;#039;, &amp;#039;left&amp;#039;)&lt;br /&gt;
		if textalign then&lt;br /&gt;
			captiondiv:css(&amp;#039;text-align&amp;#039;, textalign)&lt;br /&gt;
		end&lt;br /&gt;
		captiondiv:wikitext(caption)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--=====================================================&lt;br /&gt;
-- Ritorna una tabella che contiene il numero di immagini&lt;br /&gt;
-- per ogni riga.&lt;br /&gt;
-- pstr deve essere una stringa di numeri separati da qualunque&lt;br /&gt;
-- &lt;br /&gt;
--=====================================================&lt;br /&gt;
local function getPerRow(pstr, ic)&lt;br /&gt;
	-- split string into array using any non-digit as a dilimiter&lt;br /&gt;
	local pr = mw.text.split(pstr or &amp;#039;&amp;#039;, &amp;#039;[^%d][^%d]*&amp;#039;)&lt;br /&gt;
	-- if split failed, assume a single row&lt;br /&gt;
	if (#pr &amp;lt; 1) then&lt;br /&gt;
		pr = {tostring(ic)}&lt;br /&gt;
	end&lt;br /&gt;
	-- convert the array of strings to an array of numbers,&lt;br /&gt;
	-- adding any implied/missing numbers at the end of the array&lt;br /&gt;
	local r = 1&lt;br /&gt;
	local thisrow = tonumber(pr[1] or ic) or ic&lt;br /&gt;
	local prownum = {}&lt;br /&gt;
	while( ic &amp;gt; 0 ) do&lt;br /&gt;
		prownum[r] = thisrow&lt;br /&gt;
		ic = ic - thisrow&lt;br /&gt;
		r = r + 1&lt;br /&gt;
		-- use the previous if the next is missing and &lt;br /&gt;
		-- make sure we don&amp;#039;t overstep the number of images&lt;br /&gt;
		thisrow = math.min(tonumber(pr[r] or thisrow) or ic, ic)&lt;br /&gt;
	end&lt;br /&gt;
	return prownum&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--=====================================================&lt;br /&gt;
-- Ritorna le dimensioni dell&amp;#039;immagine (larghezza x altezza)&lt;br /&gt;
-- Se queste non sono passate dai parametri tenta di recuperarle&lt;br /&gt;
-- dalle informazioni del file immagine, altrimenti ricade su&lt;br /&gt;
-- una larghezza pari a 200 e un&amp;#039;altezza pari alla larghezza&lt;br /&gt;
--=====================================================&lt;br /&gt;
&lt;br /&gt;
local function get_dimensions(w, h, name)&lt;br /&gt;
	local wr = w and tonumber(w)&lt;br /&gt;
	local hr = h and tonumber(h)&lt;br /&gt;
	if not(wr and hr) then&lt;br /&gt;
		local page = mw.title.new(name, &amp;#039;Media&amp;#039;)&lt;br /&gt;
		if not wr then &lt;br /&gt;
			wr = page.file and page.file.width&lt;br /&gt;
		end&lt;br /&gt;
		if not hr then&lt;br /&gt;
			hr = page.file and page.file.height&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	wr = wr or 200&lt;br /&gt;
	hr = hr or wr&lt;br /&gt;
	return wr, hr&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Return a sorted array of the index of the parameter immagine1 .. immagine(n)&lt;br /&gt;
-- passed to the template. Index could be not consecutive but the gap between&lt;br /&gt;
-- different index must be five or less&lt;br /&gt;
local function getImageNumbers(args)&lt;br /&gt;
	local imagenumbers = {}&lt;br /&gt;
	local istart = 1&lt;br /&gt;
	local iend = 10&lt;br /&gt;
	local istep = 5&lt;br /&gt;
	while true do&lt;br /&gt;
		local found = false&lt;br /&gt;
		for i=istart, iend do&lt;br /&gt;
			if args[&amp;#039;immagine&amp;#039; .. tostring(i)] then&lt;br /&gt;
				imagenumbers[#imagenumbers+1] = i&lt;br /&gt;
				found = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if found then &lt;br /&gt;
			istart = iend + 1&lt;br /&gt;
			iend = iend + istep&lt;br /&gt;
		else&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(imagenumbers)&lt;br /&gt;
	return imagenumbers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- La funzione effettiva di creazione della galleria&lt;br /&gt;
function p._render(args)&lt;br /&gt;
&lt;br /&gt;
	local width = (args[&amp;#039;larghezza&amp;#039;] and tonumber(args[&amp;#039;larghezza&amp;#039;])) or 200&lt;br /&gt;
	local dir = args[&amp;#039;direzione&amp;#039;]&lt;br /&gt;
	local align = args[&amp;#039;allinea&amp;#039;]&lt;br /&gt;
	local capalign = args[&amp;#039;allinea didascalia&amp;#039;] --NEW&lt;br /&gt;
	local totalwidth = (args[&amp;#039;larghezza totale&amp;#039;] and tonumber(args[&amp;#039;larghezza totale&amp;#039;])) or 0&lt;br /&gt;
	local imgstyle = args[&amp;#039;stile immagine&amp;#039;]&lt;br /&gt;
	local header =  args[&amp;#039;titolo&amp;#039;]&lt;br /&gt;
	local footer = args[&amp;#039;sotto&amp;#039;]&lt;br /&gt;
	local perrow = nil&lt;br /&gt;
	local thumbclass = {&lt;br /&gt;
		[&amp;quot;left&amp;quot;] = &amp;#039;tleft&amp;#039;,&lt;br /&gt;
		[&amp;quot;none&amp;quot;] = &amp;#039;tnone&amp;#039;,&lt;br /&gt;
		[&amp;quot;center&amp;quot;] = &amp;#039;tnone&amp;#039;,&lt;br /&gt;
		[&amp;quot;centre&amp;quot;] = &amp;#039;tnone&amp;#039;,&lt;br /&gt;
		[&amp;quot;right&amp;quot;] = &amp;#039;tright&amp;#039;,&lt;br /&gt;
		[&amp;quot;sinistra&amp;quot;] = &amp;#039;tleft&amp;#039;,&lt;br /&gt;
		[&amp;quot;nessuna&amp;quot;] = &amp;#039;tnone&amp;#039;,&lt;br /&gt;
		[&amp;quot;centro&amp;quot;] = &amp;#039;tnone&amp;#039;,&lt;br /&gt;
		[&amp;quot;destra&amp;quot;] = &amp;#039;tright&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- find all the nonempty images&lt;br /&gt;
	local imagenumbers = getImageNumbers(args)&lt;br /&gt;
	local imagecount = #imagenumbers&lt;br /&gt;
	if imagecount == 0 then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- create an array with the number of images per row&lt;br /&gt;
	if dir == &amp;#039;verticale&amp;#039; or dir == &amp;#039;vertical&amp;#039; then&lt;br /&gt;
		perrow = getPerRow(&amp;#039;1&amp;#039;, imagecount)&lt;br /&gt;
	else&lt;br /&gt;
		perrow = getPerRow(args[&amp;#039;per riga&amp;#039;], imagecount)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- compute the number of rows&lt;br /&gt;
	local rowcount = #perrow&lt;br /&gt;
&lt;br /&gt;
	-- store the image widths and compute row widths and maximum row width&lt;br /&gt;
	local widths = {}&lt;br /&gt;
	local widthmax = 0&lt;br /&gt;
	local widthsum = {}&lt;br /&gt;
	local heights = {}&lt;br /&gt;
	local k = 0&lt;br /&gt;
	for r=1,rowcount do&lt;br /&gt;
		widthsum[r] = 0&lt;br /&gt;
		for c=1,perrow[r] do&lt;br /&gt;
			k = k + 1&lt;br /&gt;
			if k &amp;lt;= imagecount then&lt;br /&gt;
				local w = args[&amp;#039;larghezza&amp;#039; .. imagenumbers[k]]&lt;br /&gt;
				if totalwidth &amp;gt; 0 then&lt;br /&gt;
					local h = args[&amp;#039;altezza&amp;#039; .. imagenumbers[k]]&lt;br /&gt;
					widths[k], heights[k] = get_dimensions(w, h, args[&amp;#039;immagine&amp;#039; .. imagenumbers[k]]) &lt;br /&gt;
				else	&lt;br /&gt;
					widths[k] =  (w and tonumber(w)) or width&lt;br /&gt;
				end&lt;br /&gt;
				widthsum[r] = widthsum[r] + widths[k]&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		widthmax = math.max(widthmax, widthsum[r])&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- if total_width has been specified, rescale the image widths&lt;br /&gt;
	if totalwidth &amp;gt; 0 then&lt;br /&gt;
		widthmax = 0&lt;br /&gt;
		local k = 0&lt;br /&gt;
		for r=1,rowcount do&lt;br /&gt;
			local koffset = k&lt;br /&gt;
			local tw = totalwidth - 4 * (perrow[r] - 1) - 12&lt;br /&gt;
			local ar = {}&lt;br /&gt;
			local arsum = 0&lt;br /&gt;
			for j=1,perrow[r] do&lt;br /&gt;
				k = k + 1&lt;br /&gt;
				if k&amp;lt;= imagecount then&lt;br /&gt;
					if (heights[k] &amp;gt; 0) then&lt;br /&gt;
						ar[j] = widths[k]/heights[k]&lt;br /&gt;
					else&lt;br /&gt;
						ar[j] = widths[k]/100&lt;br /&gt;
					end&lt;br /&gt;
					arsum = arsum + ar[j]&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			local ht = tw/arsum&lt;br /&gt;
			local ws = 0&lt;br /&gt;
			k = koffset&lt;br /&gt;
			for j=1,perrow[r] do&lt;br /&gt;
				k = k + 1&lt;br /&gt;
				if k&amp;lt;= imagecount then&lt;br /&gt;
					local i = imagenumbers[k]&lt;br /&gt;
					widths[k] = math.floor(ar[j]*ht + 0.5)&lt;br /&gt;
					ws = ws + widths[k]&lt;br /&gt;
					if heights[k] then&lt;br /&gt;
						heights[k] = math.floor(ht)&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			widthsum[r] = ws&lt;br /&gt;
			widthmax = math.max(widthmax, widthsum[r])&lt;br /&gt;
		end&lt;br /&gt;
	end	&lt;br /&gt;
&lt;br /&gt;
	-- start building the array of images, if there are images&lt;br /&gt;
	if imagecount &amp;gt; 0 then&lt;br /&gt;
		-- compute width of outer div&lt;br /&gt;
		local bodywidth = 0&lt;br /&gt;
		for r=1,rowcount do&lt;br /&gt;
			local bw = widthsum[r] + 4 * (perrow[r] - 1) + 12&lt;br /&gt;
			bodywidth = math.max(bodywidth, bw)&lt;br /&gt;
		end&lt;br /&gt;
		-- The body has a min-width of 100, which needs to be taken into account on specific widths&lt;br /&gt;
		bodywidth = math.max( 100, bodywidth);&lt;br /&gt;
&lt;br /&gt;
		-- crea il div esterno per la galleria di immagini&lt;br /&gt;
		local root = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
		root:addClass(&amp;#039;thumb&amp;#039;)&lt;br /&gt;
		root:addClass(thumbclass[align] or &amp;#039;tright&amp;#039;)&lt;br /&gt;
		root:css(&amp;#039;width&amp;#039;, tostring(bodywidth+2) .. &amp;#039;px&amp;#039;)&lt;br /&gt;
		--	:css(&amp;#039;max-width&amp;#039;, tostring(bodywidth) .. &amp;#039;px&amp;#039;)&lt;br /&gt;
		if align == &amp;#039;center&amp;#039; or align == &amp;#039;centre&amp;#039; or align == &amp;#039;centro&amp;#039; then&lt;br /&gt;
			root:css(&amp;#039;margin&amp;#039;, &amp;#039;0 auto&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		-- crea il div interno&lt;br /&gt;
		local div = root:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
		div:addClass(&amp;#039;thumbinner&amp;#039;)&lt;br /&gt;
		-- aggiunge il titolo&lt;br /&gt;
		if header then&lt;br /&gt;
			div:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;clear&amp;#039;, &amp;#039;both&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;text-align&amp;#039;, args[&amp;#039;allinea titolo&amp;#039;] or &amp;#039;center&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;background-color&amp;#039;, args[&amp;#039;sfondo titolo&amp;#039;] or &amp;#039;transparent&amp;#039;)&lt;br /&gt;
				:wikitext(header)&lt;br /&gt;
		end&lt;br /&gt;
		-- loop through the images&lt;br /&gt;
		local k = 0&lt;br /&gt;
		for r=1,rowcount do&lt;br /&gt;
			for j=1,perrow[r] do&lt;br /&gt;
				k = k + 1&lt;br /&gt;
				if k &amp;lt;= imagecount then&lt;br /&gt;
					local imagediv = div:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					imagediv:addClass(&amp;#039;tsingle&amp;#039;)&lt;br /&gt;
					if dir ~= &amp;#039;vertical&amp;#039; then&lt;br /&gt;
						imagediv:css(&amp;#039;float&amp;#039;, &amp;#039;left&amp;#039;)&lt;br /&gt;
					end&lt;br /&gt;
					imagediv:css(&amp;#039;margin&amp;#039;, &amp;#039;1px&amp;#039;)&lt;br /&gt;
					local i = imagenumbers[k]&lt;br /&gt;
					local img = args[&amp;#039;immagine&amp;#039; .. i]&lt;br /&gt;
					local w = widths[k]&lt;br /&gt;
					imagediv:css(&amp;#039;width&amp;#039;, tostring(2 + w) .. &amp;#039;px&amp;#039;)&lt;br /&gt;
						--:css(&amp;#039;max-width&amp;#039;, tostring(2 + w) .. &amp;#039;px&amp;#039;)&lt;br /&gt;
						:css(&amp;#039;padding-left&amp;#039;, &amp;#039;0px&amp;#039;)&lt;br /&gt;
						:css(&amp;#039;padding-right&amp;#039;, &amp;#039;0px&amp;#039;)&lt;br /&gt;
					imagediv:wikitext(renderImageCell(img, w, heights[k], &lt;br /&gt;
						args[&amp;#039;collegamento&amp;#039; .. i], args[&amp;#039;alt&amp;#039; .. i],&lt;br /&gt;
						args[&amp;#039;didascalia&amp;#039; .. i], capalign, imgstyle))&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			-- add a clearing div&lt;br /&gt;
			div:tag(&amp;#039;div&amp;#039;):css(&amp;#039;clear&amp;#039;, &amp;#039;left&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		-- add the footer&lt;br /&gt;
		if footer then&lt;br /&gt;
			div:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				:addClass(&amp;#039;thumbcaption&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;clear&amp;#039;, &amp;#039;left&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;text-align&amp;#039;, args[&amp;#039;allinea sotto&amp;#039;] or &amp;#039;left&amp;#039;)&lt;br /&gt;
				:css(&amp;#039;background-color&amp;#039;, args[&amp;#039;sfondo sotto&amp;#039;] or &amp;#039;transparent&amp;#039;)&lt;br /&gt;
            	:wikitext(footer)&lt;br /&gt;
		end&lt;br /&gt;
		return tostring(root)&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--interfaccia verso il template immagine multipla&lt;br /&gt;
function p.render( frame )&lt;br /&gt;
	local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
	--local pargs = getArgs(frame, {parentOnly=true})&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._render( args )&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
--interfaccia verso template più specifici ({{Doppia immagine}}, {{tripla immagine}}...)&lt;br /&gt;
function p.render_frame( frame )&lt;br /&gt;
	local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
	local args = getArgs(frame, {frameOnly=true})&lt;br /&gt;
	return p._render( args )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>it&gt;Moroboshi</name></author>
	</entry>
</feed>