Modulo:Infobox/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m versione attuale
Test parametro posizione
 
(4 versioni intermedie di un altro utente non mostrate)
Riga 132:
 
local function renderRows()
local rownums = getArgNums('Valore', 'GruppoOpzionale', 'Gruppo', 'Nodo')
for k, num in ipairs(rownums) do
local skip = false
Riga 139:
for j = k+1, #rownums do
if args['Gruppo' .. rownums[j]] ~= nil or args['GruppoOpzionale' .. rownums[j]]~=nil then break end
if args['Valore' .. rownums[j]] ~= nil or args['Nodo' .. rownums[j]] ~= nil then
skip = false
break
end
end
end
if args['Nodo' .. num] ~= nil then
root:wikitext(args['Nodo' .. num])
skip = true
end
if not skip and args['GruppoOpzionale' .. num] ~= '$fine' then
Riga 188 ⟶ 192:
local function _infobox()
-- Crea l'albero html che rappresenta la tabella del sinottico e restituisce il markup
if args.CreaTable == 'no' or args.Posizione == 'corpo' or args.Posizione == 'coda' then
root = mw.html.create('')
else
Riga 202 ⟶ 206:
renderLastRow()
renderNavBar()
returnlocal res = tostring(root)
if args.Posizione == 'coda' then
res = res .. '</table>';
elseif args.Posizione == 'testa' then
res = mw.ustring.gsub( res, '</table>$', '')
end
return res
end
 
Riga 307 ⟶ 318:
preprocessSingleArg('StileValore')
preprocessArgs({
{prefix = 'Nodo'},
{prefix = 'Gruppo', depend={'GruppoStile'}},
{prefix = 'GruppoOpzionale', depend={'GruppoStile'}},
Riga 316 ⟶ 328:
preprocessSingleArg('LinkWikidata')
preprocessSingleArg('CreaTable')
preprocessSingleArg('Posizione')
preprocessSingleArg('Summary')
return _infobox()