Module:Gallery: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(per talk page) |
(changes requested by User:Great Brightstar) |
||
Line 4: | Line 4: | ||
local templatestyles = 'Template:Gallery/styles.css' |
local templatestyles = 'Template:Gallery/styles.css' |
||
⚫ | |||
local function trim(s) |
local function trim(s) |
||
Line 36: | Line 37: | ||
-- If called via #invoke, use the args passed into the invoking template. |
-- If called via #invoke, use the args passed into the invoking template. |
||
-- Otherwise, for testing purposes, assume args are being passed directly in. |
-- Otherwise, for testing purposes, assume args are being passed directly in. |
||
⚫ | |||
local origArgs = (type(frame.getParent) == 'function') and frame:getParent().args or frame |
local origArgs = (type(frame.getParent) == 'function') and frame:getParent().args or frame |
||
Line 73: | Line 72: | ||
if args.align then |
if args.align then |
||
tbl:addClass('mod-gallery |
tbl:addClass('mod-gallery' .. args.align:lower()) |
||
end |
end |
||
Line 80: | Line 79: | ||
:addClass('title') |
:addClass('title') |
||
:tag('div') |
:tag('div') |
||
:wikitext(args.title) |
:wikitext('<dl><dd>' .. args.title .. '</dd></dl>') |
||
end |
end |
||
Line 87: | Line 86: | ||
gargs['widths'] = tonumber(args.width) or 180 |
gargs['widths'] = tonumber(args.width) or 180 |
||
gargs['heights'] = tonumber(args.height) or 180 |
gargs['heights'] = tonumber(args.height) or 180 |
||
gargs['style'] = |
gargs['style'] = args.captionstyle |
||
gargs['perrow'] = args.perrow |
gargs['perrow'] = args.perrow |
||
gargs['mode'] = args.mode |
gargs['mode'] = args.mode |
||
Line 118: | Line 117: | ||
:addClass('footer') |
:addClass('footer') |
||
:tag('div') |
:tag('div') |
||
:wikitext(args.footer) |
:wikitext('<dl><dd>' .. args.footer .. '</dd></dl>') |
||
end |
end |
||