Content deleted Content added
BrandonXLF (talk | contribs) No edit summary |
BrandonXLF (talk | contribs) No edit summary |
||
Line 7:
-- Generate the wikitext for the picture
local function pictureWikitext(frame, route, division, roadInfo, args)
local existingFile = ''
if roadInfo['pic'] then
local fileName = roadInfo['pic'][1] .. route .. roadInfo['pic'][2]
Line 29 ⟶ 31:
end
end
if
existingFile = fileName
local size = 'x20px' -- Default size▼
-- Override default size with exceptions▼
if args['size'] then ▼
size = args['size']▼
elseif route:upper() == '407ETR' then▼
size = '24px'▼
elseif division == 'kawartha lakes' then▼
size = '21px'▼
elseif args['shield'] == 'yes' and division == 'highway' then▼
size = 'x25px'▼
elseif division == 'toll' then▼
size = 'x30px'▼
end▼
return '[[File:' .. fileName .. '|alt=|link=|' .. size .. ']]' -- Return the file wikitext▼
end
end
if existingFile ~= '' then
fileName = 'Media:RR ' .. route .. ' jct.svg' -- Try fallback file
if mw.title.makeTitle('Media', fileName).exists then -- Check if the fallback file exists and record if it does
existingFile = fileName
end
if existingFile == '' then
return '' -- Return nothing if no existing file was found
end
end
end
|