Module:NYC bus link and Module:NYC bus link/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
Replace Module:No globals with require( "strict" ) |
use require('strict') instead of require('Module:No globals') |
||
Line 1: | Line 1: | ||
require( |
require('strict'); |
||
local getArgs = require('Module:Arguments').getArgs |
local getArgs = require('Module:Arguments').getArgs |
||
local p = {} |
local p = {} |
||
Line 5: | Line 5: | ||
function p.getLink(frame) |
function p.getLink(frame) |
||
local args = getArgs(frame); |
local args = getArgs(frame); |
||
⚫ | |||
local city; |
local city; |
||
if 'NYC' == args.city then |
|||
⚫ | |||
⚫ | |||
city = 'New York City bus'; |
city = 'New York City bus'; |
||
elseif ' |
elseif 'LI' == args.city then |
||
city = 'Long Island bus'; |
city = 'Long Island bus'; |
||
elseif ' |
elseif 'NJ' == args.city then |
||
city = 'New Jersey bus'; |
city = 'New Jersey bus'; |
||
elseif 'columbia' == args.city then |
|||
city = 'Columbia Transportation' |
|||
elseif 'princeton' == args.city then |
|||
city = 'Tiger Transit' |
|||
else |
|||
return table.concat ({'<span style=\"font-size:100%; font-style:normal;\" class=\"error\">unexpected city: ', args.city, '</span>'}) |
|||
end |
end |
||
⚫ | |||
for _, name in ipairs (args) do |
for _, name in ipairs (args) do |
||
table.insert (result, table.concat ({'[[', name, ' (', city, ')|', name, ']]'})) |
table.insert (result, table.concat ({'[[', name, ' (', city, ')|', name, ']]'})) |
||
end |
end |
||
⚫ | |||
if ('yes' == args.prose) or ('y' == args.prose) then |
|||
local prose; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
else |
else |
||
return table.concat (result, ', '); |
return table.concat (result, ', '); |