Fermi LAT observations of cosmic-ray electrons from 7 GeV to 1 TeV