<commit_before>App.recommend = {
	api : {
		add : 'suggestion/restaurant'
	},
	itIsSending : false
}

App.recommend.init = function(){
	$( document ).on( 'click', '.home-recommend-button', function() {
		App.recommend.send();
	} );	
	$( document ).on( 'click', '.home-recommend-message-create-account', function(){
		App.signup.show( false );
	} );
}

App.recommend.send = function(){
	if ( $.trim( $( '.home-recommend-text' ).val() ) == '' ){
		alert( "Please enter the restaurant\'s name." );
		$( '.home-recommend-text' ).focus();
		return;
	}

	var content = 'Geocode city: ' + App.loc.reverseGeocodeCity + 
								'\n' + 
								'City name: ' + App.loc.city_name +
								'\n' + 
								'Lat: ' + App.loc.lat + 
								'\n' + 
								'Lon: ' + App.loc.lon;
	var data = {
		name: $( '.home-recommend-text' ).val(),
		content : content
	};

	if (!App.recommend.itIsSending){
		App.recommend.itIsSending = true;
		$.ajax({
			type: 'POST',
			dataType: 'json',
			data: data,
			url:  App.service + App.recommend.api.add,
			success: function(content) {
				App.recommend.itIsSending = false;
				App.recommend.showThankYou();	
			}
		});
	}<commit_msg>issue #811<commit_after>App.recommend = {
	api : {
		add : 'suggestion/restaurant'
	},
	itIsSending : false,
	recommendations : false
}

App.recommend.init = function(){
	$( document ).on( 'click', '.home-recommend-button', function() {
		App.recommend.send();
	} );	

	$( document ).on( 'keyup', '.home-recommend-text', function( e ) {
		if (e.which == 13) {
			App.recommend.send();
		}
	} );

	$( document ).on( 'click', '.home-recommend-message-create-account', function(){
		App.signup.show( false );
	} );
}

App.recommend.send = function(){
	if ( $.trim( $( '.home-recommend-text' ).val() ) == '' ){
		alert( "Please enter the restaurant\'s name." );
		$( '.home-recommend-text' ).focus();
		return;
	}

	var content = 'Geocode city: ' + App.loc.reverseGeocodeCity + 
								'\n' + 
								'City name: ' + App.loc.city_name +
								'\n' + 
								'Lat: ' + App.loc.lat + 
								'\n' + 
								'Lon: ' + App.loc.lon;
	var data = {
		name: $( '.home-recommend-text' ).val(),
		content : content
	};

	if (!App.recommend.itIsSending){
		App.recommend.showThankYou();	
		App.recommend.itIsSending = true;
		$.ajax({
			type: 'POST',
			dataType: 'json',
			data: data,
			url:  App.service + App.recommend.api.add,
			success: function( json ) {
				App.recommend.itIsSending = false;
				if( !App.recommend.recommendations ){
					App.recommend.recommendations = [];
				}
				App.recommend.recommendations.push( json.id_suggestion );
			}
		});
	}
{'fraction_non_alphanumeric': 0.19877909194963755, 'fraction_numerical': 0.0019076688286913392, 'mean_word_length': 2.7403708987161197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5688483', 'n_tokens_mistral': 1188, 'n_tokens_neox': 978, 'n_words': 173}