Module:Solar eclipse/sandbox: Difference between revisions

Content deleted Content added
standardizing
Minor cleanup
Line 20:
end
 
local function ifnotempty(s, a, b)
if return (s and s ~= '') thenand a or b
return a
else
return b
end
end
 
Line 43 ⟶ 39:
 
local function parsecoord(frame, s)
local lat, NS, lon, EW = s:match('^%s*([%d][+%d.]?%d*)%s*([NS])%s*[(%d][+%d.]?%d*)%s*([EW])%s*$')
if( lat and NS and lon and EW ) then
local NS = s:match('^%s*[%d][%d.]*%s*([NS])%s*[%d][%d.]*[EW]%s*$')
return frame:expandTemplate{
local lon = s:match('^%s*[%d][%d.]*%s*[NS]%s*([%d][%d.]*)[EW]%s*$')
title = 'coord',
local EW = s:match('^%s*[%d][%d.]*%s*[NS]%s*[%d][%d.]*([EW])%s*$')
return frame:expandTemplate{ title = 'coord', args = {lat, NS, lon, EW, 'type:landmark'} }
if( lat and NS and lon and EW ) then
}
return frame:expandTemplate{ title = 'coord', args = {lat, NS, lon, EW, 'type:landmark'} }
end
else
return s
end
end
 
Line 243 ⟶ 238:
end
args['previous'] = args['previous']
args['next'] = args['next']
 
return infobox(frame)
end