Modulo:Tracce: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Moroboshi (discussione | contributi)
Nessun oggetto della modifica
Moroboshi (discussione | contributi)
aggiungo anche gestione della testata
Riga 1:
local function estrai_durata(args, i)
return (tonumber(args["Minuti" .. i]) and 0) * 60 + tonumber(args["Secondi" .. i]) and 0
end
 
Riga 9:
(i.e. unitalicized) in the resulting references. In addition, <i> and ''
tend to interact poorly under Mediawiki's HTML tidy. ]]
 
if str == nil or str == '' then
return str;
Riga 22:
local function track(args, i)
local titolo = args["Titolo" .. i] or ""
if ( titolo ~="" ) then
local row_elements = {}
table.insert(row_elements, '<li value="' .. tostring(i) .. '">')
Riga 43:
local secondi = tonumber(args["Secondi" .. i]) or 0
local durata = minuti * 60 + secondi
if durata > 0 then
table.insert(row_elements, " - ")
table.insert(row_elements, string.format("%02.f:%02.f", minuti, secondi))
end
local AutoreTesto = args["Autore testo" .. i] or ""
local AutoreMusica = args["Autore musica" .. i] or ""
Riga 100:
 
local function componi_tracce(args, primo_titolo)
-- compone testata
local i = primo_titolo
local tracks = {}
local testata = ""
autoreTestoeMusica = args["Autore testi e musiche"]
if autoreTestoeMusica ~= nil then
testata = "Testi e musiche di " .. autoreTestoeMusica
else
autoreTesti = args["Autore testi"] or ""
autoreMusiche = args["Autore musiche"] or ""
if autoreTesti ~= "" then
testata = "Testi di " .. autoreTesti
if autoreMusiche ~= "" then testata = testata .. ", musiche di " .. autoreMusiche end
elseif autoreMusiche ~= "" then
testata = "Musiche di " .. autoreMusiche
else
noAutore = true
end
end
local edizioni = args["Edizioni"]
if edizioni ~= nil then
if noAutore then
testata = "Edizioni musicali " .. edizioni
else
testata = testata .. "; edizioni musicali " .. edizioni
end
end
table.insert(tracks, testata)
-- compone la lista dei parametri
local i = primo_titolo
table.insert(tracks, "<ol>")
local visualizza_durata = args["Visualizza durata totale"] or ""
Riga 147 ⟶ 173:
end
end
 
return p