Content deleted Content added
m Steel1943 moved page Module:VG timeline to Module:Release timeline without leaving a redirect: Revert self |
m tweak |
||
Line 8:
table.insert(itemList, args[year] or args[year .. 'a'])
end
for asciiletter = 98, 106 do -- 98
if args[year .. string.char(asciiletter)] then
table.insert(itemList, args[year .. string.char(asciiletter)])
Line 32:
if year >= beginyear and year <= endyear then
local _, _, color1, color2 = string.find( args['range' .. yearrange .. '_color'], '^(%S*)%s*(%S*)$' )
color2 =
return
end
end
end
return
end
local function left(builder, args, year, itemNum)
builder = builder:tag(
:attr('scope', 'row')
:css('text-align', 'right') -- For year = 'TBA'
:css('border', 'none')
:css('padding', '
:css('border-right', '
:wikitext(year)
if itemNum > 1 then
Line 55 ⟶ 56:
local function right(builder, args, year, itemNum, itemList)
local outerPadding, innerPadding = '5px', '2px'
if itemNum == 0 then return end
if itemNum == 1 then
builder:tag('td')
:css('padding',
:css('border', 'none')
:wikitext(itemList[1])
Line 68 ⟶ 70:
builder:tag('td')
:css('border', 'none')
:css('padding', outerPadding .. '
:wikitext(itemList[1])
Line 75 ⟶ 77:
:tag('td')
:css('border', 'none')
:css('padding',
:wikitext(itemList[key])
end
Line 82 ⟶ 84:
:tag('td')
:css('border', 'none')
:css('padding',
:wikitext(itemList[itemNum])
Line 105 ⟶ 107:
local ret
local firstyear, lastyear
local TBA =
ret = mw.html.create( 'table' )
:addClass('wikitable')
:css('border', 'none')
:css('float', args.align == 'left' and 'left' or 'right')
:css('clear', args.align == 'left' and 'left' or 'right')
:css('margin', args.align == 'left' and '0 1em 0.5ex 0' or '0 0 0.5ex 1em')
:css('font-size', '80%')
:css('line-height', '90%')
Line 119 ⟶ 122:
ret:tag('caption')
:css('padding', '5px 5px 0px') -- See outerPadding in function right()
:css('font-size', '112.5%') -- 90% / 80%
:wikitext(args.title and args.title or 'Timeline of release years')▼
:addClass('nowrap')
if args.subtitle then
ret:tag('tr'):tag('td')
:attr('colspan', '2')
:css('padding', '0px 5px 5px') -- See outerPadding in function right()
:css('border', 'none')
:css('text-align', 'center')
:wikitext(args.subtitle)
end
if tonumber(args.first) then
firstyear = tonumber(args.first)
else
for i = 1940, os.date('%Y') do
if
firstyear = i
break
Line 138 ⟶ 151:
else
for i = os.date('%Y') + 3, TBA and os.date('%Y') or firstyear, -1 do
if
lastyear = i
break
|