$(document).ready(function(){
  $("#textarea1").focus();
  Materialize.toast('Listening for tweets...');
  $(".toast").hide();
  var map = initializeMap();
  var socket = new Socket();
  socket.makeMarkerFromTweet(map);
  $("#search-form").on('submit', function(event){
    event.preventDefault();
    var searchWord = $('#textarea1').val();
    if (searchWord.match(/,.+,/)){
      Materialize.toast('You can only search for one or two terms', 2000);
    }
    else
    {
      $(".toast").show();
      // var doTimer = function(){return 5000};
      socket.listenForFirstTweet();
      // clear the map
      clearMarkers();
      socket.performNewSearch(searchWord);
    }
  });

  socket.listenForGeocode(map);
  socket.listenForError();
});






$(document).ready(function(){
  $("#textarea1").focus();
  Materialize.toast('Listening for tweets...');
  $(".toast").hide();
  var map = initializeMap();
  var socket = new Socket();
  socket.makeMarkerFromTweet(map);
  $("#search-form").on('submit', function(event){
    event.preventDefault();
    var searchWord = $('#textarea1').val();
    if (searchWord.match(/,.*,/)){
      Materialize.toast('You can only search for one or two terms', 2000);
    }
    else
    {
      $(".toast").show();
      // var doTimer = function(){return 5000};
      socket.listenForFirstTweet();
      // clear the map
      clearMarkers();
      socket.performNewSearch(searchWord);
    }
  });

  socket.listenForGeocode(map);
  socket.listenForError();
});






Handle situation where someone just tries inputting in two commas in the same row
Handle situation where someone just tries inputting in two commas in the same row
