Content deleted Content added
BrandonXLF (talk | contribs) Restored revision 1042505863 by BrandonXLF (Restorer) |
BrandonXLF (talk | contribs) Undid revision 1042506830 by BrandonXLF (talk) |
||
Line 3:
local p = {}
local getArgs = require('Module:Arguments').getArgs
local yesno = require('Module:Yesno')
local data = mw.loadData('Module:Sandbox/BrandonXLF/4')
Line 21 ⟶ 22:
elseif routeNum and routeNum >= 500 then -- Exception for secondary and tertiary highways
fileName = 'Ontario Highway ' .. route .. '.svg'
elseif yesno(args['shield']
fileName = 'Ontario ' .. route .. '.svg'
end
Line 36 ⟶ 37:
elseif routeNum and routeNum >= 800 and division == 'highway' then
size = '20px'
elseif yesno(args['shield']
size = 'x25px'
elseif division == 'toll' then
Line 75 ⟶ 76:
end
if (
return '[[' .. link .. '|' .. display .. ']]' -- Return the link
else
Line 84 ⟶ 85:
-- Gets the wikitext for a place
local function getPlace(frame, place, args)
if
return '[[' .. place .. ', Ontario|' .. place .. ']]'
else
Line 130 ⟶ 131:
local picture = ''
if yesno(args['ot']) then -- Set correct arguments if output should be only text
args['nosh'] = 'yes'
args['nolink'] = 'yes'
Line 136 ⟶ 137:
-- Define the picture
if not yesno(args['nosh']) then -- If allowed to add shield
picture = pictureWikitext(frame, route, roadType, roadInfo, args) -- Return picture of road 1
Line 149 ⟶ 150:
end
if yesno(args['tch']) then
if picture ~= '' then picture = picture .. ' ' end -- Add a NBSP if there's already a picture
picture = picture .. '[[File:TCH-blank.svg|x20px]]' -- Add the TCH picture
Line 155 ⟶ 156:
end
if not yesno(args['pic aft']) then
export = picture -- Add the picture if it goes first
end
-- Define the text
if not yesno(args['notext']) then -- If allowed to show text
if export ~= '' then export = export .. ' ' end -- Add a NBSP after the picture if it exists
export = export .. getText(frame, route, roadInfo, args) -- Return text of road 1
Line 172 ⟶ 173:
end
if yesno(args['tch']) then
export = export .. ' / [[Trans-Canada Highway|TCH]]' -- Add the TCH text
end
Line 216 ⟶ 217:
end
if yesno(args['pic aft']) and picture then
if export ~= '' then export = export .. ' ' end -- Add a space if export already has text
export = export .. picture -- Add the picture if it goes last
|