Modulo:Citazione: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
m una versione importata |
||
(5 versioni intermedie di 2 utenti non mostrate) | |||
Riga 413:
options.pattern = mw.ustring.gsub( options.pattern, '([^%[]%[[^%[]%S+)$1(.-%])', '%1$2%2' );
end
return mw.ustring.format( '[[wikipedia:it:%s|%s]]%s%s',
options.link, options.label, options.separator or " ",
substitute( options.pattern, {mw.text.nowiki(options.id), url_string} )
Riga 517:
if ( code == "A" ) then
return link_id({link=handler.link, label=handler.label,
pattern="[
encode = handler.encode})
elseif ( code == "M" ) then
return link_id({link=handler.link, label=handler.label,
pattern="[
encode = handler.encode})
elseif ( code == "W" ) then
return link_id({link=handler.link, label=handler.label,
pattern= "[
encode = handler.encode})
else
return link_id({link=handler.link, label=handler.label,
pattern= "[
encode = handler.encode}) ..
' ' .. set_error( 'bad_ol' );
Riga 764:
if is_set(first) then
if invertorder then first, last = last, first end
fullname =
else
fullname =
end
if is_set(person.link) then fullname = table.concat({"[[", person.link, "|", fullname, "]]"}) end
Riga 799:
Estrae una lista di nomi (autori o editori) dalla lista argomenti
===============================================================================]]
local function extract_names(args, list_name, parent_name)
local names = {};
local i = 1;
local last;
local parameters = {
first = cfg.aliases[list_name .. '-First'],
last = cfg.aliases[list_name .. '-Last'],
link = cfg.aliases[list_name .. '-Link'],
}
for k, t in pairs(parameters) do
local new_values = {}
for _, v in ipairs(t) do
table.insert( new_values, substitute(v, parent_name) )
end▼
parameters[k] = new_values
end▼
end▼
while true do
last = select_one( args,
if not is_set(last) then
local first = select_one( args,
if not is_set(first) then
break;
Line 814 ⟶ 829:
last = first,
first = '',
link = select_one( args,
}
end
Line 820 ⟶ 835:
names[i] = {
last = last,
first = select_one( args,
link = select_one( args,
};
end
Line 827 ⟶ 842:
end
return names;
▲end
▲ if is_set(title) then
title, is_set(chapter) and ("/" .. chapter) or "" ,▼
▲ end
end
Line 950 ⟶ 954:
local Others = A['Others'];
local Editors = A['Editors'];
local e = extract_names( args, 'EditorList' );
Line 1 249 ⟶ 1 252:
------------------------------------------------------------------------------
-- Aggiunge
------------------------------------------------------------------------------
if
-- se s=1 usa lo stesso valore di titolo/capitolo
if is_set(TitleLink) then▼
if source == "1" then
elseif is_set(Title) then▼
▲ end
end
source = "s:" .. (is_set(first_language) and (first_language .. ":") or "") .. source
if is_set(Chapter) then ChapterLink = source
else TitleLink = source end
end
Riga 1 318:
Authors = Editors
Editors = ""
end
------------------------------------------------------------------------------
-- Recupero e formatto lista autori di un singolo capitolo dell'opera citata
------------------------------------------------------------------------------
local Contributors
local c = extract_names( args, 'ContributorList', A:ORIGIN('Chapter') );
control.etal = false
Contributors = list_people(control, c)
end
Line 1 590 ⟶ 1 600:
elseif is_set(PublisherName) then
PublisherName = PublisherName .. " " .. OrigDate
elseif is_set(
Place = Place .. " " .. OrigDate
else
Line 1 639 ⟶ 1 649:
fragment_citation:appends({fragment_Title, Editors})
else
if is_set(msg_editors
if is_set(Editors) then
Editors = wrap(msg_editors, Editors)
Line 1 645 ⟶ 1 655:
Authors = wrap(msg_editors, Authors)
end
▲ elseif is_set(Contributors) and is_set(Title) then
Authors, Editors = Contributors, Authors
end
fragment_citation = Fragment.new({Authors, Chapter}, sepc)
Line 1 673 ⟶ 1 685:
fragment_citation:start(" ")
local text = Language_code .. tostring(fragment_citation)
-- aggiungo l'icona per
if config.CitationClass == "video" then text = cfg.messages['icon_video'] .. ' ' .. text end
if config.CitationClass == "audio" then text = cfg.messages['icon_audio'] .. ' ' .. text end
-- Now enclose the whole thing in a <span/> element
|