<commit_before>//Traitement Json

var urlRoot = "https://api.anatroc/";
var dev = 1;

var urlApi;

if(dev === 1)
{
    urlApi = urlRoot + "app_dev.php";
}
else
{
    urlApi = urlRoot;
}



function traitementAjax(){
    var addressFrom = $('#search-input-from').val();
    var  addressTo = $('#search-input-to').val();


    $.ajax({
        url : urlApi,
        type : 'POST',
        data : 'addressFrom='+addressFrom + '&addressTo='+addressTo,
        dataType : 'JSON',
        success : function(data)
        {
            console.log(data + 'succes');
            showResultsPage(data);
        },
        error : function(data)
        {
            console.log(data + 'erreur');
        }
    });
}
/**
 *  recupere les info pour la meteo
 * **/
function displayWeather(response) {

    $(".temps").hide();
    $("#"+response.data.weather+"").show();


    $('#temperature').text(response.data.temperature+'°');
    $('#ville').text(response.data.city);
}

/** Get Json DATA transport  **/
function displayTransport(response) {

    $('#distance_result').text(response.data.distance);
    $('#start_address_result').text(response.data.start_address_name);
    $('#end_address_result').text(response.data.end_address_name);
    $('#duration_result').text(response.data.duration);
}

/**
 *  Recuper les valeurs du Json, check les differents types.
 * **/
function ResultResponse(response) {
    var date = new Date();
    var duration;

    console.log(response);
    for (var i in response) {
        if (response[i].hasOwnProperty('type')) {
            var arret;
            if (response[i].type === "transport.google_direction.walking") {

                duration = new Date(response[i].data.duration * 1000);
                duration.setHours(duration.getHours() - 1);
                $('.actual-time-span-walk').text(getFormatedTime(date));
                $('.arrival-time-span-walk').text(getFormatedTime(getDateEnd(response[i].data.duration)));
                $('#walk-range').text(response[i].data.distance);
                $('#walk-time').text(getFormatedTime(duration));
            }
            else if (response[i].type === "transport.google_direction.bicycling") {


                duration = new Date(response[i].data.duration * 1000);
                duration.setHours(duration.getHours() - 1);
                $('.actual-time-span-bike').text(getFormatedTime(date));
                $('.arrival-time-span-bike').text(getFormatedTime(getDateEnd(response[i].data.duration)));
                $('#bike-range').text(response[i].data.distance);
                $('#bike-time').text(getFormatedTime(duration));
            }
            else if (response[i].type === "transport.google_direction.driving") {


                duration = new Date(response[i].data.duration * 1000);<commit_msg>remove console.log<commit_after>//Traitement Json

var urlRoot = "https://api.anatroc/";
var dev = 1;

var urlApi;

if(dev === 1)
{
    urlApi = urlRoot + "app_dev.php";
}
else
{
    urlApi = urlRoot;
}



function traitementAjax(){
    var addressFrom = $('#search-input-from').val();
    var  addressTo = $('#search-input-to').val();


    $.ajax({
        url : urlApi,
        type : 'POST',
        data : 'addressFrom='+addressFrom + '&addressTo='+addressTo,
        dataType : 'JSON',
        success : function(data)
        {
            console.log(data + 'succes');
            showResultsPage(data);
        },
        error : function(data)
        {
            console.log(data + 'erreur');
        }
    });
}
/**
 *  recupere les info pour la meteo
 * **/
function displayWeather(response) {

    $(".temps").hide();
    $("#"+response.data.weather+"").show();


    $('#temperature').text(response.data.temperature+'°');
    $('#ville').text(response.data.city);
}

/** Get Json DATA transport  **/
function displayTransport(response) {

    $('#distance_result').text(response.data.distance);
    $('#start_address_result').text(response.data.start_address_name);
    $('#end_address_result').text(response.data.end_address_name);
    $('#duration_result').text(response.data.duration);
}

/**
 *  Recuper les valeurs du Json, check les differents types.
 * **/
function ResultResponse(response) {
    var date = new Date();
    var duration;

    for (var i in response) {
        if (response[i].hasOwnProperty('type')) {
            var arret;
            if (response[i].type === "transport.google_direction.walking") {

                duration = new Date(response[i].data.duration * 1000);
                duration.setHours(duration.getHours() - 1);
                $('.actual-time-span-walk').text(getFormatedTime(date));
                $('.arrival-time-span-walk').text(getFormatedTime(getDateEnd(response[i].data.duration)));
                $('#walk-range').text(response[i].data.distance);
                $('#walk-time').text(getFormatedTime(duration));
            }
            else if (response[i].type === "transport.google_direction.bicycling") {


                duration = new Date(response[i].data.duration * 1000);
                duration.setHours(duration.getHours() - 1);
                $('.actual-time-span-bike').text(getFormatedTime(date));
                $('.arrival-time-span-bike').text(getFormatedTime(getDateEnd(response[i].data.duration)));
                $('#bike-range').text(response[i].data.distance);
                $('#bike-time').text(getFormatedTime(duration));
            }
            else if (response[i].type === "transport.google_direction.driving") {


                duration = new Date(response[i].data.duration * 1000);
{'fraction_non_alphanumeric': 0.1750979693623085, 'fraction_numerical': 0.0057000356252226575, 'mean_word_length': 2.524795982423101, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6177543', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1663, 'n_words': 257}