8,438
edits
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
local args = frame.args | local args = frame.args | ||
local i = 0 | local i = 0 | ||
if args['active'] == nil then | |||
active = 1 | |||
else | |||
active = args['active'] | |||
end | |||
if args[1] and args[2] then | if args[1] and args[2] then | ||
local header = mw.html.create( 'div' ):addClass('g-tab-header') | local header = mw.html.create( 'div' ):addClass('g-tab-header') | ||
Line 12: | Line 16: | ||
repeat | repeat | ||
header = header:node(mw.html.create( 'span' ):addClass('g-tab'):wikitext(args[i+2])) | header = header:node(mw.html.create( 'span' ):addClass('g-tab'):wikitext(args[i+2])) | ||
if active == (i + 2) * 0.5 then | |||
header = header:addClass('g-tab-active') | |||
end | |||
contents = contents:node(mw.html.create( 'div' ):addClass('g-tab-content'):wikitext(args[i+1])) | contents = contents:node(mw.html.create( 'div' ):addClass('g-tab-content'):wikitext(args[i+1])) | ||
i = i + 2 | i = i + 2 |