Content deleted Content added
BrandonXLF (talk | contribs) spelling |
BrandonXLF (talk | contribs) Restored revision 1241724286 by BrandonXLF (Restorer) |
||
(18 intermediate revisions by the same user not shown) | |||
Line 1:
-- Sandbox, do not delete
require('strict')
local p = {}
-- Parameters that can be numbered
local numeredParams = {
service = true,
dest = true,
note = true
}
-- Labels for platform types
Line 11 ⟶ 20:
-- Generate the HTML to display a service
local function displayService(service, dest,
if not service then return '' end
return '<div class="service">' ..
'<div class="' .. (dir ~= 'left' and 'hidden' or '') .. '">←</div>' ..
'<div>' .. service .. (dest and ' toward ' .. dest or '') .. (
(dir == 'right' and '<div>→</div>' or '') ..
'</div>'
Line 23 ⟶ 32:
-- Generate the HTML to display a track (one or more services)
local function displayTrack(floorPart)
return ''
▲ floorPart.extradest = floorPart.extradest or {}
local out = ''
floorPart.extradesc = floorPart.extradesc or {}▼
▲ end
end
Line 43 ⟶ 53:
if floorPart.name then
return '<div class="track"><div>' .. floorPart.name .. '</div></div>' ..
'<div class="track"><div class="desc"><div>' .. (floorPart.desc or '') .. '</div>' .. displayTrack(floorPart) end
Line 54 ⟶ 65:
platformLabels[floorPart.platform] ..
(floorPart.accessible and ' ' .. mw.getCurrentFrame():expandTemplate{ title = 'access icon' } or '') ..
'</div>'
end
Line 99 ⟶ 111:
level = tonumber(level)
part = tonumber(part)
paramNum = paramNum and tonumber(paramNum) or
addArg(out, level, createArgTable())
addArg(out[level], part, {})
if
if not out[level][part][
end
addArg(out[level][part][param], paramNum, value)
else
out[level][part][param] = value
|