Module:Sandbox/BrandonXLF/3: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 8:
local function pictureWikitext(frame, route, division, roadInfo, args)
local existingFile = ''
local size = args['size'] or 'x20px' -- DefaultImage size
 
if roadInfo['pic'] then
Line 24 ⟶ 25:
end
end
 
if mw.title.new('File:' .. fileName).file.exists then -- Check if the file exists and record it if it does
existingFile = fileName
 
-- Override default size with exceptions
elseif if route:upper() == '407ETR' then
size = '24px'
elseif division == 'kawartha lakes' then
size = '21px'
elseif routeNum and routeNum >= 800 and division == 'highway' then
size = '20px'
elseif args['shield'] == 'yes' and division == 'highway' then
size = 'x25px'
elseif division == 'toll' then
size = 'x30px'
end
end
end
Line 40 ⟶ 54:
if existingFile == '' then
return '' -- Return nothing if no existing file was found
end
 
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 routeNum and routeNum >= 800 then
size = '20px'
elseif args['shield'] == 'yes' and division == 'highway' then
size = 'x25px'
elseif division == 'toll' then
size = 'x30px'
end