Modulo:Tracce/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
test parametro durata |
aggiunto parametro durata |
||
Riga 1:
if Durata then▼
local string_minuti, string_secondi = mw.ustring.match(Durata, "(%d+:%d%d")▼
minuti = tonumber(string_minuti) or 0▼
secondi = tonumber(string_secondi) or 0▼
else▼
minuti = tonumber(args["Minuti" .. i]) or 0▼
secondi = tonumber(args["Secondi" .. i]) or 0▼
end▼
-- Protects a string that will be wrapped in wiki italic markup '' ... ''
local function safeforitalics( str )
Line 43 ⟶ 28:
local note = args["Note" .. i] or ""
if note ~= "" then table.insert(row_elements, " <small>(" .. note .. ")</small>") end
local
▲ minuti = tonumber(string_minuti) or 0
▲ secondi = tonumber(string_secondi) or 0
▲ else
▲ minuti = tonumber(args["Minuti" .. i]) or 0
▲ secondi = tonumber(args["Secondi" .. i]) or 0
▲ end
local durata = minuti * 60 + secondi
if durata > 0 then
Line 84 ⟶ 76:
local ListaMedley = args["ListaMedley" .. i] or ""
if ListaMedley ~= "" then table.insert(row_elements, '<div style="padding: 0.3em 0px 0.5em 2.5em;">\n' .. ListaMedley .. '</div>') end
return table.concat(row_elements), durata
else
return nil
Line 130 ⟶ 122:
--estrae le tracce dai parametri e inserisci i valori nella tabella tracks
while true do
local new_track, durata_track = track(args, i)
if new_track==nil then break end
table.insert(tracks, new_track)
if somma_durata then durata = durata +
i = i + 1
end
|