Module:Gallery: Difference between revisions

Jump to navigation Jump to search
merge tracking
(Let's track cellwidth as well)
(merge tracking)
Line 18:
k:match('^alt%d+$') or k:match('^%d+$') then
-- valid
elseif k == 'cellwidth' then
tracking = tracking .. '[[Category:Pages using gallery with the cellwidth parameter]]'
elseif k == 'captionstyle' then
tracking = tracking .. '[[Category:Pages using gallery with the captionstyle parameter]]'
elseif k:match('^width%d+$') then
-- deprecated
k = mw.ustring.gsub(k, '^width(%d+)$', '%1')
tracking = tracking .. '[[Category:Pages using gallery with custom width parameters|' .. k .. ']]'
else
-- invalid
Line 94 ⟶ 88:
local imageCount = math.ceil(#args / 2)
local cellWidth = tonumber(args.cellwidth) or tonumber(args.width) or 180
local imgHeight = tonumber(args.height) or 180
local lines = tonumber(args.lines) or 2
Line 102 ⟶ 96:
local img = trim(args[i*2 - 1] or '')
local caption = trim(args[i*2] or '')
local imgWidth = tonumber(args['width' .. i]) or tonumber(args.width) or 180
local alt = args['alt' .. i] or ''
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu