Module:Timeline of release years: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
rm unused parameters
Jackmcbarn (talk | contribs)
only create one builder and pass it around
Line 18:
end
 
local function titleItem(builder, content)
if content ~= nil then
return mw.html.createbuilder:tag( 'span' ):wikitext( '– ' .. content .. '<br />' )
end
end
 
local function left(builder, year)
return mw.html.createbuilder:tag( 'td' ):wikitext( year .. ' –' )
end
 
local function center(builder, args, year)
return mw.html.createbuilder:tag( 'td' )
:css( 'width', '10px' )
:css( 'border', '1px solid black' )
Line 35:
end
 
local function right(builder, args, year)
if isYearReleased(args, year) == nil then return nil end
builder = builder:tag('td')
local ret
:node titleItem(builder, titleItem(args[year]) or titleItem(args[year .. 'a' ]) )
ret = mw.html.create( 'td' )
:node( titleItem(args[year]) or titleItem(args[year .. 'a' ]) )
 
for i = 98, 106 do
ret:nodetitleItem(builder, titleItem(args[year .. string.char(i)]) )
end
 
return ret
end
 
local function row(builder, args, year)
returnbuilder mw.html.create= builder:tag('tr')
:node left(builder, left(year) )
:node center(builder, center(args, year) )
:node right(builder, right(args, year) )
end
 
Line 104 ⟶ 101:
 
for year = firstyear, lastyear do
row(ret:node(, row(args, year) )
end