Modul:Citation/CS1/Utilities: razlika između inačica
Prijeđi na navigaciju
Prijeđi na pretraživanje
Stvorena nova stranica sa sadržajem: » local z = { error_categories = {}; -- for categorizing citations that contain errors error_ids = {}; message_tail = {}; maintenance_cats = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work properties_cats = {}; -- for categorizing citations based on certain properties, language of source for instance }; --[[--------------------------< F O R W A R D D E C L A...«. |
Zamijenjen sadržaj stranice s » -- Modul:Citation/CS1/Utilities -- Minimalna verzija kompatibilna s hrvatskim CS1 modulom local p = {} -- Trim whitespace function p.trim(s) if not s then return nil end return mw.text.trim(s) end -- Provjera je li vrijednost postavljena function p.is_set(v) return v ~= nil and mw.text.trim(v) ~= "" end -- Formatiranje liste s razmacima function p.join(parts, sep) sep = sep or " " local out = {} for _, v in ipairs(parts) do...« Oznaka: zamijenjeno preko 90 % teksta |
||
| Redak 1: | Redak 1: | ||
-- Modul:Citation/CS1/Utilities | |||
-- Minimalna verzija kompatibilna s hrvatskim CS1 modulom | |||
local p = {} | |||
-- | -- Trim whitespace | ||
function p.trim(s) | |||
if not s then return nil end | |||
return mw.text.trim(s) | |||
end | end | ||
-- Provjera je li vrijednost postavljena | |||
function p.is_set(v) | |||
return v ~= nil and mw.text.trim(v) ~= "" | |||
end | end | ||
-- Formatiranje liste s razmacima | |||
function p.join(parts, sep) | |||
sep = sep or " " | |||
local out = {} | |||
for _, v in ipairs(parts) do | |||
if p.is_set(v) then | |||
table.insert(out, v) | |||
end | |||
end | |||
return table.concat(out, sep) | |||
end | end | ||
-- Jednostavne poruke o greškama | |||
function p.error_message(msg) | |||
return '<span class="citation-error" style="color:#b00;">' .. msg .. '</span>' | |||
end | end | ||
return p | |||
Inačica od 12. siječanj 2026. u 08:49
Script error: The function "nonexistent" does not exist.
-- Modul:Citation/CS1/Utilities
-- Minimalna verzija kompatibilna s hrvatskim CS1 modulom
local p = {}
-- Trim whitespace
function p.trim(s)
if not s then return nil end
return mw.text.trim(s)
end
-- Provjera je li vrijednost postavljena
function p.is_set(v)
return v ~= nil and mw.text.trim(v) ~= ""
end
-- Formatiranje liste s razmacima
function p.join(parts, sep)
sep = sep or " "
local out = {}
for _, v in ipairs(parts) do
if p.is_set(v) then
table.insert(out, v)
end
end
return table.concat(out, sep)
end
-- Jednostavne poruke o greškama
function p.error_message(msg)
return '<span class="citation-error" style="color:#b00;">' .. msg .. '</span>'
end
return p