Modulo:InfoboxImage: Malsamoj inter versioj

[kontrolita revizio][kontrolita revizio]
Enhavo forigita Enhavo aldonita
e korekto, aldono
e ŝanĝo de def_ending resp. def-ending al endingdefault, laŭ sizedefault
Linio 2:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
-- ending - An optional parameter for the file ending, like gif, jpg, jpeg, png, svg.
-- def-endingendingdefault - An optional parameter for the default ending.
-- the local variable is def_ending, because - can't be a part of a variable
-- size - size to display the image
-- maxsize - maximum size for image
Linio 80 ⟶ 79:
 
function i.ValidateEnding (f)
-- analyzes the validatevalid endings for images in the Wikipedia.
-- according to http://commons.wikimedia.org/wiki/Commons:File_types,
-- but not tiff, because browser can have some problems with this format
Linio 90 ⟶ 89:
end
 
function i.AddEnding (image, ending, def_endingendingdefault)
-- analyzes, if an ending already exists in the image
local f = image:gsub("^(.*)%.","")
Linio 102 ⟶ 101:
image = image .. "." .. ending
end
elseif def_endingendingdefault ~="" and def_endingendingdefault ~=nil then
if i.ValidateEnding(def_endingendingdefault) == true then
image = image .. "." .. def_endingendingdefault
end
end
Linio 160 ⟶ 159:
local result = "";
local ending = frame.args["ending"];
local def_endingendingdefault = frame.args["def-endingendingdefault"];
local size = frame.args["size"];
local maxsize = frame.args["maxsize"];
Linio 199 ⟶ 198:
size = size .. "px";
end
image = i.AddEnding (image,ending,def_endingendingdefault)
result = "[[File:" .. image;