Modul:Citation/CS1/peskovnik: Razlika med redakcijama

Izbrisana vsebina Dodana vsebina
mBrez povzetka urejanja
mBrez povzetka urejanja
Vrstica 18:
local cfg = {}; -- table of configuration tables that are defined in Modul:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Modul:Citation/CS1/Whitelist
 
 
--[[--------------------------< P A G E S C O P E V A R I A B L E S >--------------------------------------
Vrstica 849 ⟶ 850:
return str;
end
 
 
--[[--------------------------< I S _ S U F F I X >------------------------------------------------------------
Vrstica 857 ⟶ 859:
 
local function is_suffix (suffix)
if in_array (suffix, {'Jr', 'Sr', '2nd', '3rd', '3.', '2.'}) or suffix:match ('^%dth$') then
return true;
end
Vrstica 891 ⟶ 893:
 
]]
 
local function is_good_vanc_name (last, first)
local first, suffix = first:match ('(.-),?%s*([%dJS][%drndth]+)%.?$') or first; -- if first has something that looks like a generational suffix, get it
 
if is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error ('suffix');
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%'%.]*$") then
add_vanc_error ('non-Latin character');
return false; -- not a string of latin characters; Vancouver requires Romanization
end;
return true;
end
 
 
local function is_good_vanc_name (last, first)
Vrstica 1.159 ⟶ 1.143:
 
When an author or editor parameter contains some form of 'et al.', the 'et al.' is stripped from the parameter and a flag (etal) returned
that will cause list_people() to add the static 'et al.' text from ModulModule:Citation/CS1/Configuration. This keeps 'et al.' out of the
template's metadata. When this occurs, the page is added to a maintenance category.
 
Vrstica 1.226 ⟶ 1.210:
and the associated code is not two or three characters, this function returns only the Wikimedia language name.
 
Adapted from code taken from Modull:Check ISO 639-1.
 
]]
Vrstica 1.469 ⟶ 1.453:
--[[--------------------------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >------------------------------
 
Adds page to Kategorija:CS1 maintvzdrževanje: extra text if |page= or |pages= has what appears to be some form of p. or pp.
abbreviation in the first characters of the parameter content.
 
Vrstica 1.825 ⟶ 1.809:
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the url parts for evaluation
 
if not is_set(timestamp) or 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = 'timestamp';
Vrstica 1.846 ⟶ 1.830:
else
return '', ''; -- return empty strings for archiveURL and ArchiveDate
end
end -- return empty strings for archiveURL and ArchiveDate
end
 
Vrstica 2.406 ⟶ 2.390:
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {['access-date']=AccessDate, ['archive-date']=ArchiveDate, ['date']=Date, ['doi-broken-date']=DoiBroken,
['embargo']=Embargo, ['lay-date']=LayDate, ['publication-date']=PublicationDate, ['year']=Year};
 
-- AirDate has been promoted to Date so not necessary to check it
anchor_year, Embargo, error_message = dates(date_parameters_list, COinS_date);
 
Vrstica 2.423 ⟶ 2.407:
end
end
 
if not is_set(error_message) then -- error free dates only
local modified = false; -- flag
Vrstica 2.838 ⟶ 2.822:
if is_set (Translators) then
-- Others = sepc .. ' Translated byPrevedel ' .. Translators .. Others;
Others = sepc .. ' ' .. wrap_msg ('translated', Translators, use_lowercase) .. Others;
end
 
Vrstica 3.143 ⟶ 3.128:
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if in_array(config.CitationClass==, {"journal","citation"}) and is_set(Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
Vrstica 3.180 ⟶ 3.165:
namelist = e;
end
idif =#namelist anchor_id> (namelist,0 year);then -- goif makethere theare CITEREFnames anchorin namelist
id = anchor_id (namelist, year); -- go make the CITEREF anchor
else
id = ''; -- unset
end
end
options.id = id;
Vrstica 3.246 ⟶ 3.235:
local validation, utilities, identifiers, metadata;
if nil ~= string.find (frame:getTitle(), 'peskovnik', 1, true) then -- did the {{#invoke:}} use peskovniksandbox version?
cfg = mw.loadData ('Modul:Citation/CS1/Configuration/peskovnik'); -- load peskovniksandbox versions of support modules
whitelist = mw.loadData ('Modul:Citation/CS1/Whitelist/peskovnik');
utilities = require ('Modul:Citation/CS1/Utilities/peskovnik');
Vrstica 3.294 ⟶ 3.283:
COinS = metadata.COinS;
 
Preview_mode = frame:preprocess('{{REVISIONID}}'); -- use magic word to get revision id
if is_set (Preview_mode) then -- if there is a value then this is not a preiview
Preview_mode = false;
else
Preview_mode = true; -- no value (nil or empty string) so this is a preview
end;
local args = {};
Vrstica 3.319 ⟶ 3.315:
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
if nil ~= string.find (frame:getTitle(), 'peskovnik', 1, true) then -- did the {{#invoke:}} use peskovniksandbox version?
suggestions = mw.loadData( 'Modul:Citation/CS1/Suggestions/peskovnik' ); -- use the peskovniksandbox version
else
suggestions = mw.loadData( 'Modul:Citation/CS1/Suggestions' ); -- use the live version