Module:FlexGallery: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 9: | Line 9: | ||
for k, v in pairs(frame.args) do | for k, v in pairs(frame.args) do | ||
-- v = v:gsub("[\n\r]", "") seems unnecessary.. | -- v = v:gsub("[\n\r]", "") seems unnecessary.. | ||
v = tostring(v) | |||
if k == 1 then | if k == 1 then | ||
width = tonumber(v) | width = tonumber(v) | ||
elseif (k % 2) == 0 then | elseif (k % 2) == 0 then | ||
images.insert(tostring( | images.insert(images, tostring(v)) | ||
else | else | ||
thumbnails.insert(tostring( | thumbnails.insert(thumbnails, tostring(v)) | ||
end | end | ||
end | end | ||
Revision as of 20:24, 20 August 2025
Documentation for this module may be created at Module:FlexGallery/doc
local p = {}
local width
local images = {}
local thumbnails = {}
-- frame.args
p.hi = function(frame)
for k, v in pairs(frame.args) do
-- v = v:gsub("[\n\r]", "") seems unnecessary..
v = tostring(v)
if k == 1 then
width = tonumber(v)
elseif (k % 2) == 0 then
images.insert(images, tostring(v))
else
thumbnails.insert(thumbnails, tostring(v))
end
end
return images
end
return p