Content deleted Content added
m prevent duplication of frame call |
m arbitrary parameter numbering |
||
Line 88:
local t = {}
for i = 1, (args.nums[#args.
header = table.concat({'\n|-',▼
'\n!', style['header leftcell'], 'Preceding station',▼
'\n!', style['header midcell'], data[i]['system title'],▼
colour[i] = _line.colour▼
'\n!', style['header rightcell'], 'Following station'})▼
note[i] = args.note[i] or ''▼
if type(_line['left terminus']) == 'string' then▼
_leftTerminus = _line['left terminus']▼
elseif type(_line['left terminus']) == 'table' then▼
_leftTerminus = _line['left terminus'][args.TypeL[i] or 1]▼
end▼
if type(_line['right terminus']) == 'string' then▼
_rightTerminus = _line['right terminus']▼
end
if
local _line = data[i][args.line[i]]
left[i] = "''Terminus''"▼
▲ colour[i] = _line.colour
elseif args.left[i] == _leftTerminus then▼
leftTerminus[i] = subFormat('Terminus')▼
▲ if type(_line['left terminus']) == 'string' then
else▼
▲ _leftTerminus = _line['left terminus'][args.TypeL[i] or 1]
leftTerminus[i] = subFormat('One-way operation')▼
▲ end
▲ if type(_line['right terminus']) == 'string' then
▲ _rightTerminus = _line['right terminus']
end▼
▲ left[i] = "''Terminus''"
leftTerminus[i] = ''
▲ elseif args.left[i] == _leftTerminus then
▲ leftTerminus[i] = subFormat('Terminus')
else
▲ leftTerminus[i] = subFormat('One-way operation')
▲ else
leftTerminus[i] = subFormat('towards ' .. _line['station link'](_leftTerminus))
end
end
elseif args.right[i] == _rightTerminus then
rightTerminus[i] = ''▼
▲ rightTerminus[i] = subFormat('Terminus')
▲ right[i] = _line['station link'](args.right[i])
rightTerminus[i] = subFormat('Terminus')▼
else▼
▲ if args.onewayR[i] == true then
else
if args.onewayR[i] == true then
▲ else
rightTerminus[i] = subFormat('towards ' .. _line['station link'](_rightTerminus))
end
end
table.insert(t, table.concat({'\n|-',
'\n|', style['body leftcell'], left[i], leftTerminus[i],▼
'\n|', style['body banner'], colour[i], '"| ',▼
'\n|', style['body midcell'], lineTitle[i], '<div style="font-size: smaller">', note[i], '</div>' ,▼
'\n|', style['body banner'], colour[i], '"| ',▼
'\n|', style['body rightcell'], right[i] , rightTerminus[i]▼
}))▼
end
▲ if args.system[i] then
▲ header = table.concat({'\n|-',
▲ '\n!', style['header leftcell'], 'Preceding station',
▲ '\n!', style['header midcell'], data[i]['system title'],
▲ '\n!', style['header rightcell'], 'Following station'})
▲ end
▲ table.insert(t, table.concat({header,
▲ '\n|', style['body leftcell'], left[i], leftTerminus[i],
▲ '\n|', style['body banner'], colour[i], '"| ',
▲ '\n|', style['body midcell'], lineTitle[i], '<div style="font-size: smaller">', note[i], '</div>' ,
▲ '\n|', style['body banner'], colour[i], '"| ',
▲ '\n|', style['body rightcell'], right[i] , rightTerminus[i]
▲ }))
end
Line 164 ⟶ 162:
function p.main(frame)
local args = {
circularR = {}
}
local _args = frame:getParent().args
Line 190 ⟶ 189:
if a == 'system' then
args.system[b] = v
table.insert(args.nums, b)
elseif a == 'line' then
args.line[b] = v
table.insert(args.nums, b)
elseif a == 'left' then
args.left[b] = v
Line 218 ⟶ 219:
end
end
table.sort(args.nums)
local data = {}
for i = 1, (args.nums[#args.
if args.system[i] then
data[i] = require('Module:L-rail/' .. args.system[i])
|