<commit_before>(function($) {
    'use strict';
    /*START OF GETTING PARAMS*/
    var paramsObject = document.getElementById('parameters');
    var loadMoreTravelsLink = paramsObject.getAttribute('data-loadMoreTravelsLink');
    var isMyTravelsSection = paramsObject.getAttribute('data-isMyTravels');
    var imageLinkAlert = paramsObject.getAttribute('data-imageLinkAlert');
    var imageLinkRemove = paramsObject.getAttribute('data-imageLinkRemove');
    var imageLinkTick = paramsObject.getAttribute('data-imageLinkTick');
    var imageLinkInfo = paramsObject.getAttribute('data-imageLinkInfo');
    var imageLinkTraveler = paramsObject.getAttribute('data-imageLinkTraveler');
    var imageLinkSteeringWheel = paramsObject.getAttribute('data-imageLinkSteeringWheel');
    /*END OF GETTING PARAMS*/
    var lastId = -1;
    var count = 5;

    var modalTitle = 'Klaida';
    var modalText = '';
    var modalImage = imageLinkAlert;
    var currentTravelId = -1;

    var stringYouWereClient = 'Jūs keliautojas';
    var stringYouWereDriver = 'Jūs vairuotojas';
    var stringRemoveThisTravel = 'Panaikinti šią kelionę';
    var stringAcceptThisTravel = 'Priimti šią kelionę';
    var stringTravelWasNotAcceptedAndIsExpired = 'Ši kelionė nebuvo priimta ir nebegalioja';
    /**
     * OnClick - ajax function - load some more travels
     */
    $('#loadMore').click(function()
    {
        $('#loadingMore').show();
        $.ajax({
            url: loadMoreTravelsLink,
            type: 'GET',
            data: { count : count, fromId : lastId },
            contentType: 'application/json; charset=utf-8',
            success: function (response) {
                console.log(response);
                var json = response;
                var obj = JSON && JSON.parse(json) || $.parseJSON(json);
                var travels = obj.travels;
                var tableBody = document.getElementById('travelsTBody');
                if (travels !== null) {
                    for (var i = 0; i < travels.length; i++) {
                        var t = travels[i];
                        var isTravelExpired = travels[i].isTravelExpired;
                        var tr = document.createElement('tr');
                        var td;
                        var img;
                        if (isMyTravelsSection) {
                            //show image is driver or is traveler:
                            td = document.createElement('td');
                            img = document.createElement('img');
                            if (t.isMyTravel) {
                                img.src = imageLinkTraveler;
                                img.title = stringYouWereClient;
                                img.alt = stringYouWereClient;
                            } else {
                                img.src = imageLinkSteeringWheel;
                                img.title = stringYouWereDriver;
                                img.alt = stringYouWereDriver;
                            }
                            td.appendChild(img);
                            tr.appendChild(td);
                        }



                        //time call:
                        td = document.createElement('td');
                        var text = document.createTextNode(t.timeCall);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //source:
                        td = document.createElement('td');
                        text = document.createTextNode(t.sourceAddress);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //destination:
                        td = document.createElement('td');
                        text = document.createTextNode(t.destinationAddress);
                        td.appendChild(text);
                        tr.appendChild(td);

                        var fullName;
                        //client:
                        if (!isMyTravelsSection) {
                            td = document.createElement('td');
                            fullName = t.client.firstName + ' ' + t.client.lastName;
                            text = document.createTextNode(t.client.username + ' (' + fullName + ')');
                            td.appendChild(text);
                            tr.appendChild(td);
                        }

                        //price:
                        td = document.createElement('td');
                        text = document.createTextNode(t.price);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //passenger count:
                        td = document.createElement('td');
                        text = document.createTextNode(t.passengerCount);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //distance:
                        td = document.createElement('td');
                        text = document.createTextNode(t.distance);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //profit:
                        td = document.createElement('td');
                        text = document.createTextNode(t.profit);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //with:
                        //print person, who is a your assocaite - driver or a client
                        if (isMyTravelsSection) {
                            td = document.createElement('td');
                            var name = '';
                            if (t.isMyTravel) {
                                if (t.driver !== null) {
                                    name = '(' + t.driver.username + ') ' + t.driver.firstName + ' ' + t.driver.lastName;
                                } else {
                                    if (isTravelExpired) {
                                        name = ' - ';
                                    }
                                }
                            } else {
                                name = '(' + t.driver.username + ') ' + t.client.firstName + ' ' + t.client.lastName;
                            }
                            text = document.createTextNode(name);
                            if (isTravelExpired) {
                                text.title = stringTravelWasNotAcceptedAndIsExpired;
                            }
                            td.appendChild(text);<commit_msg>My Travels History: incorrect username fix<commit_after>(function($) {
    'use strict';
    /*START OF GETTING PARAMS*/
    var paramsObject = document.getElementById('parameters');
    var loadMoreTravelsLink = paramsObject.getAttribute('data-loadMoreTravelsLink');
    var isMyTravelsSection = paramsObject.getAttribute('data-isMyTravels');
    var imageLinkAlert = paramsObject.getAttribute('data-imageLinkAlert');
    var imageLinkRemove = paramsObject.getAttribute('data-imageLinkRemove');
    var imageLinkTick = paramsObject.getAttribute('data-imageLinkTick');
    var imageLinkInfo = paramsObject.getAttribute('data-imageLinkInfo');
    var imageLinkTraveler = paramsObject.getAttribute('data-imageLinkTraveler');
    var imageLinkSteeringWheel = paramsObject.getAttribute('data-imageLinkSteeringWheel');
    /*END OF GETTING PARAMS*/
    var lastId = -1;
    var count = 5;

    var modalTitle = 'Klaida';
    var modalText = '';
    var modalImage = imageLinkAlert;
    var currentTravelId = -1;

    var stringYouWereClient = 'Jūs keliautojas';
    var stringYouWereDriver = 'Jūs vairuotojas';
    var stringRemoveThisTravel = 'Panaikinti šią kelionę';
    var stringAcceptThisTravel = 'Priimti šią kelionę';
    var stringTravelWasNotAcceptedAndIsExpired = 'Ši kelionė nebuvo priimta ir nebegalioja';
    /**
     * OnClick - ajax function - load some more travels
     */
    $('#loadMore').click(function()
    {
        $('#loadingMore').show();
        $.ajax({
            url: loadMoreTravelsLink,
            type: 'GET',
            data: { count : count, fromId : lastId },
            contentType: 'application/json; charset=utf-8',
            success: function (response) {
                console.log(response);
                var json = response;
                var obj = JSON && JSON.parse(json) || $.parseJSON(json);
                var travels = obj.travels;
                var tableBody = document.getElementById('travelsTBody');
                if (travels !== null) {
                    for (var i = 0; i < travels.length; i++) {
                        var t = travels[i];
                        var isTravelExpired = travels[i].isTravelExpired;
                        var tr = document.createElement('tr');
                        var td;
                        var img;
                        if (isMyTravelsSection) {
                            //show image is driver or is traveler:
                            td = document.createElement('td');
                            img = document.createElement('img');
                            if (t.isMyTravel) {
                                img.src = imageLinkTraveler;
                                img.title = stringYouWereClient;
                                img.alt = stringYouWereClient;
                            } else {
                                img.src = imageLinkSteeringWheel;
                                img.title = stringYouWereDriver;
                                img.alt = stringYouWereDriver;
                            }
                            td.appendChild(img);
                            tr.appendChild(td);
                        }



                        //time call:
                        td = document.createElement('td');
                        var text = document.createTextNode(t.timeCall);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //source:
                        td = document.createElement('td');
                        text = document.createTextNode(t.sourceAddress);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //destination:
                        td = document.createElement('td');
                        text = document.createTextNode(t.destinationAddress);
                        td.appendChild(text);
                        tr.appendChild(td);

                        var fullName;
                        //client:
                        if (!isMyTravelsSection) {
                            td = document.createElement('td');
                            fullName = t.client.firstName + ' ' + t.client.lastName;
                            text = document.createTextNode(t.client.username + ' (' + fullName + ')');
                            td.appendChild(text);
                            tr.appendChild(td);
                        }

                        //price:
                        td = document.createElement('td');
                        text = document.createTextNode(t.price);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //passenger count:
                        td = document.createElement('td');
                        text = document.createTextNode(t.passengerCount);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //distance:
                        td = document.createElement('td');
                        text = document.createTextNode(t.distance);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //profit:
                        td = document.createElement('td');
                        text = document.createTextNode(t.profit);
                        td.appendChild(text);
                        tr.appendChild(td);
                        //with:
                        //print person, who is a your assocaite - driver or a client
                        if (isMyTravelsSection) {
                            td = document.createElement('td');
                            var name = '';
                            if (t.isMyTravel) {
                                if (t.driver !== null) {
                                    name = '(' + t.driver.username + ') ' + t.driver.firstName + ' ' + t.driver.lastName;
                                } else {
                                    if (isTravelExpired) {
                                        name = ' - ';
                                    }
                                }
                            } else {
                                name = '(' + t.client.username + ') ' + t.client.firstName + ' ' + t.client.lastName;
                            }
                            text = document.createTextNode(name);
                            if (isTravelExpired) {
                                text.title = stringTravelWasNotAcceptedAndIsExpired;
                            }
                            td.appendChild(text);
{'fraction_non_alphanumeric': 0.09414681794274551, 'fraction_numerical': 0.000751371252535878, 'mean_word_length': 1.1026856240126381, 'pattern_counts': {'":': 0, '<': 5, '<?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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1868669', 'n_tokens_mistral': 3121, 'n_tokens_neox': 2915, 'n_words': 572}