Anonymous user
Module:Gallery: Difference between revisions
more templatestyles
No edit summary |
(more templatestyles) |
||
Line 9:
end
local tracking, preview
local function checkarg(k,v)
Line 20:
elseif k == 'captionstyle' then
if not v:match('^text%-align%s*:%s*center[;%s]*$') then
table.insert(tracking
end
else
Line 27:
k = mw.ustring.sub(k, 1, (vlen < 25) and vlen or 25)
k = mw.ustring.gsub(k, '[^%w\-_ ]', '?')
table.insert(tracking
table.insert(preview
end
end
Line 43:
-- them false too.
local args = {}
tracking, preview = {}, {}
for k, v in pairs(origArgs) do
if v ~= '' then
Line 50 ⟶ 51:
end
local tbl = mw.html.create('div
tbl:addClass('
if args.state then
tbl
:
:addClass('collapsible')
:addClass(args.state)
Line 63 ⟶ 64:
tbl:cssText(args.style)
else
tbl:addClass('mod-gallery-default')
:css('margin-top', '0.5em')▼
end
if args.align then
end
if args.title then
tbl:tag('div')
:addClass('title')
:tag('div
:wikitext(args.title)
end
Line 109 ⟶ 100:
tbl:tag('div')
:addClass('main')
:tag('div')
:wikitext(
frame:extensionTag{ name = 'gallery', content = '\n' .. table.concat(gallery,'\n'), args = gargs}
Line 117 ⟶ 107:
if args.footer then
tbl:tag('div')
:addClass('footer')
:tag('div
:wikitext(args.footer)
end
tracking = (#tracking > 0) and table.concat(tracking, '') or ''
:addClass('hatnote')
:tag('strong'):wikitext('Warning:'):done()
:wikitext('Unknown parameters: ' .. table.concat(preview, '; '))
end
|