Modulo:InfoboxImage: Malsamoj inter versioj

[kontrolita revizio][kontrolita revizio]
Enhavo forigita Enhavo aldonita
e ŝanĝo de def_ending resp. def-ending al endingdefault, laŭ sizedefault
aktualigo laŭ la ŝablona provejo
Linio 11:
-- center - set to yes, if the image has to be centered
-- upright - upright image param
-- link - page to visit when clicking on image
-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
-- Outputs:
Linio 55 ⟶ 56:
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
-- remove file: or image: or dosiero: prefix if exists
local allNames = mw.site.namespaces[6].aliases
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "file:" then
allNames[#allNames + image1] = mw.ustringsite.sub(image,namespaces[6);].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
end
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "image:" then
image =if mw.ustring.lower(mw.ustring.sub(image,7 1, mw.ustring.len(name); + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image,9 mw.ustring.len(name) + 2);
end
end break
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "dosiero:" then
end
image = mw.ustring.sub(image,9);
end
-- Trim spaces
Linio 118 ⟶ 119:
return image;
end
if frame.args["suppressplaceholder"] =~= "yesno" then
if i.IsPlaceholder(image) == true then
return "";
Linio 164 ⟶ 165:
local sizedefault = frame.args["sizedefault"];
local alt = frame.args["alt"];
local link = frame.args["link"];
local title = frame.args["title"];
local border = frame.args["border"];
local upright = frame.args["upright"] or "";
local thumbtime = frame.args["thumbtime"] or "";
local center = frame.args["center"]
-- remove file: or image: or dosiero: prefix if exists
local allNames = mw.site.namespaces[6].aliases
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "file:" then
allNames[#allNames + image1] = mw.ustringsite.sub(image,namespaces[6);].name
allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
end
for i, name in ipairs(allNames) do
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "image:" then
image =if mw.ustring.lower(mw.ustring.sub(image,7 1, mw.ustring.len(name); + 1)) == mw.ustring.lower(name .. ":") then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
end
break
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "dosiero:" then
image = mw.ustring.sub(image,9);end
end
 
if maxsize ~= "" and maxsize ~= nil then
Linio 214 ⟶ 217:
result = result .. "|alt=" .. alt;
end
if link ~= "" and link ~= nil then
result = result .. "|link=" .. link;
end
if border == "yes" then
result = result .. "|border";
Linio 220 ⟶ 226:
result = result .. "|upright=" .. upright;
end
if thumbtime ~= "" then
result = result .. "|thumbtime=" .. thumbtime;
end
if title ~= "" and title ~= nil then
result = result .. "|" .. title;