<commit_before>/**
 * Created by s216121 on 14.03.17.
 */

function appendTraitEntries(domElement, traitEntries, traitFormat){
    $.ajax({
        url: Routing.generate('api_details_trait_entries', {'dbversion': dbversion}),
        data: {
            "trait_entry_ids": traitEntries,
            "trait_format": traitFormat
        },
        method: "GET",
        success: function(result){
            $.each(result, function (key, value) {
                var realValue = value.valueName;
                if(value.valueName === null){
                    realValue = value.valueDefinition;
                }
                let unitString = ""
                if(value.unit != null){
                    unitString = " $"+ value.unit +"$"
                }
                let traitCitationDiv = $('<div class="trait-citation">').text(value.citation).css({'font-size': '11px'})
                let originUrl = $(`<a href="${value.originUrl}">`).text(" origin")
                if(value.originUrl != ""){
                    traitCitationDiv.append(originUrl)
                }
                domElement.append($('<div>').text(realValue+unitString).append(traitCitationDiv));
            });
        }
    });
}

// export function globally
global.appendTraitEntries = appendTraitEntries;<commit_msg>Change GET to POST in ajax call<commit_after>/**
 * Created by s216121 on 14.03.17.
 */

function appendTraitEntries(domElement, traitEntries, traitFormat){
    $.ajax({
        url: Routing.generate('api_details_trait_entries', {'dbversion': dbversion}),
        data: {
            "trait_entry_ids": traitEntries,
            "trait_format": traitFormat
        },
        method: "POST",
        success: function(result){
            $.each(result, function (key, value) {
                var realValue = value.valueName;
                if(value.valueName === null){
                    realValue = value.valueDefinition;
                }
                let unitString = ""
                if(value.unit != null){
                    unitString = " $"+ value.unit +"$"
                }
                let traitCitationDiv = $('<div class="trait-citation">').text(value.citation).css({'font-size': '11px'})
                let originUrl = $(`<a href="${value.originUrl}">`).text(" origin")
                if(value.originUrl != ""){
                    traitCitationDiv.append(originUrl)
                }
                domElement.append($('<div>').text(realValue+unitString).append(traitCitationDiv));
            });
        }
    });
}

// export function globally
global.appendTraitEntries = appendTraitEntries;
{'fraction_non_alphanumeric': 0.1405241169768325, 'fraction_numerical': 0.010634257500949488, 'mean_word_length': 1.8537378114842904, 'pattern_counts': {'":': 4, '<': 9, '<?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': '6199857', 'n_tokens_mistral': 743, 'n_tokens_neox': 693, 'n_words': 123}