<commit_before>$(document).ready(function() {
	var $email = $('#signature_email');
	var $hint = $("#hint");

	$('.suggested_email').live("click",function() {
        $email.val($(this).html());
        $hint.css('display', 'none');
        return false;
    });

	$('form').on("submit", function(event) {
		mailCheckSuggestions(event);
		return event.go;
    });

	function mailCheckSuggestions(event) {
		$hint.css('display', 'none');
	  	$email.mailcheck({
	    suggested: function(element, suggestion) {
	    	event.go = true;
	       	if(!$hint.html()) {
	        	var suggestion = 'Did you mean <a href="#" id="suggested_email" class="suggested_email">' + suggestion.full + "</a>?";
	     	   	$hint.html(suggestion).fadeIn(150);
      			event.go = false;
	      }
	    }
	  });
	}

	layoutPetitionSidebarAs(VK.signpetition_ask_vs_tell);
});

function layoutPetitionSidebarAs(ask_or_tell)
{
	if ('ask' === ask_or_tell) {
		$('#signature-form').hide();
		$('#ask-to-sign').show();
	}
	else {
		$('#signature-form').show();
		$('#ask-to-sign').hide();
	};
}

jQuery(function(){
	var cookie = $.cookie('signed_petitions') || '';
	var petitionIds = cookie.split("|");
	var currentPetitionId = $('#petitionId').val();
	if ($.inArray(currentPetitionId, petitionIds) > -1) {
    $('#thanks-for-signing-message').show();
    $('#signature-form').hide();
    $('#ask-to-sign').hide();
    $('#thanksModal').modal('toggle');
  }
  $('#petition_description').wysihtml5();
  $('#petition_title').attr('tabIndex', '1');
  $('iframe').attr('tabIndex', '2');
  if ($('#petition_to_send').length) {
    $('#petition_to_send').attr('tabIndex', '3');
    $('#petition_submit').attr('tabIndex', '4');
  }
  else {
    $('#petition_submit').attr('tabIndex', '3');
  }

  $('#petition_title').attr('tabIndex', '1');
  $('iframe').attr('tabIndex', '2');
  if ($('#petition_to_send').length) {
    $('#petition_to_send').attr('tabIndex', '3');
    $('#petition_submit').attr('tabIndex', '4');
  }
  else {
    $('#petition_submit').attr('tabIndex', '3');
  }

});
<commit_msg>removing spaces from email field when signing petition<commit_after>$(document).ready(function() {
	var $email = $('#signature_email');
	var $hint = $("#hint");

	$('.suggested_email').live("click",function() {
        $email.val($(this).html());
        $hint.css('display', 'none');
        return false;
    });

	$('form').on("submit", function(event) {
		mailCheckSuggestions(event);
		return event.go;
    });

	function mailCheckSuggestions(event) {
		$hint.css('display', 'none');
	  	$email.mailcheck({
	    suggested: function(element, suggestion) {
	    	event.go = true;
	       	if(!$hint.html()) {
	        	var suggestion = 'Did you mean <a href="#" id="suggested_email" class="suggested_email">' + suggestion.full + "</a>?";
	     	   	$hint.html(suggestion).fadeIn(150);
      			event.go = false;
	      }
	    }
	  });
	}

	layoutPetitionSidebarAs(VK.signpetition_ask_vs_tell);

    $('#signature_email').change(function() {
        this.value = this.value.replace(/ /g, '');
    });
});

function layoutPetitionSidebarAs(ask_or_tell)
{
	if ('ask' === ask_or_tell) {
		$('#signature-form').hide();
		$('#ask-to-sign').show();
	}
	else {
		$('#signature-form').show();
		$('#ask-to-sign').hide();
	};
}

jQuery(function(){
	var cookie = $.cookie('signed_petitions') || '';
	var petitionIds = cookie.split("|");
	var currentPetitionId = $('#petitionId').val();
	if ($.inArray(currentPetitionId, petitionIds) > -1) {
    $('#thanks-for-signing-message').show();
    $('#signature-form').hide();
    $('#ask-to-sign').hide();
    $('#thanksModal').modal('toggle');
  }
  $('#petition_description').wysihtml5();
  $('#petition_title').attr('tabIndex', '1');
  $('iframe').attr('tabIndex', '2');
  if ($('#petition_to_send').length) {
    $('#petition_to_send').attr('tabIndex', '3');
    $('#petition_submit').attr('tabIndex', '4');
  }
  else {
    $('#petition_submit').attr('tabIndex', '3');
  }

  $('#petition_title').attr('tabIndex', '1');
  $('iframe').attr('tabIndex', '2');
  if ($('#petition_to_send').length) {
    $('#petition_to_send').attr('tabIndex', '3');
    $('#petition_submit').attr('tabIndex', '4');
  }
  else {
    $('#petition_submit').attr('tabIndex', '3');
  }

});

{'fraction_non_alphanumeric': 0.24712778429073856, 'fraction_numerical': 0.007033997655334115, 'mean_word_length': 4.024734982332156, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '503255', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1481, 'n_words': 209}