<commit_before>$(document).ready(function(){
    //autocomplete for organism search
    $("#search_organism").autocomplete({
        position: {
            my: "right top", at: "right bottom"
        },
        source: function (request, response) {
            var search = request.term;
            $.ajax({
                url: Routing.generate('api', {'namespace': 'listing', 'classname': 'organisms'}),
                data: {term:  request.term, limit: 500, search: search, dbversion: dbversion},
                dataType: "json",
                success: function (data) {
                    response(data);
                }
            });
        },
        minLength: 3
    });

    $("#search_organism").data("ui-autocomplete")._renderItem = function (ul, item) {
            var details = Routing.generate('organism_details', {'dbversion': dbversion, 'fennec_id': item.fennec_id});
            var link = "<a href='"+details+"'><span style='display:inline-block; width: 100%; font-style: italic;'>" + item.scientific_name + "</span></a>";
        var li = $("<li>")
                .append(link)
                .appendTo(ul);
        return li;
    };

    $("#btn_search_organism").click(function(){
        var searchTerm = $("#search_organism").val();
        var resultPage = Routing.generate('organism_result', {'dbversion': dbversion, 'limit': 500, 'search': searchTerm});
        window.location.href = resultPage;
    });
});<commit_msg>Trigger organism search with enter key<commit_after>$(document).ready(function(){
    //autocomplete for organism search
    $("#search_organism").autocomplete({
        position: {
            my: "right top", at: "right bottom"
        },
        source: function (request, response) {
            var search = request.term;
            $.ajax({
                url: Routing.generate('api', {'namespace': 'listing', 'classname': 'organisms'}),
                data: {term:  request.term, limit: 500, search: search, dbversion: dbversion},
                dataType: "json",
                success: function (data) {
                    response(data);
                }
            });
        },
        minLength: 3
    });

    $("#search_organism").data("ui-autocomplete")._renderItem = function (ul, item) {
            var details = Routing.generate('organism_details', {'dbversion': dbversion, 'fennec_id': item.fennec_id});
            var link = "<a href='"+details+"'><span style='display:inline-block; width: 100%; font-style: italic;'>" + item.scientific_name + "</span></a>";
        var li = $("<li>")
                .append(link)
                .appendTo(ul);
        return li;
    };

    $("#btn_search_organism").click(function(){
        var searchTerm = $("#search_organism").val();
        var resultPage = Routing.generate('organism_result', {'dbversion': dbversion, 'limit': 500, 'search': searchTerm});
        window.location.href = resultPage;
    });

    $("#search_organism").keyup(function(event){
        if(event.keyCode == 13){
            $("#btn_search_organism").click();
        }
    });
});
{'fraction_non_alphanumeric': 0.16768982229402263, 'fraction_numerical': 0.007108239095315024, 'mean_word_length': 2.2555205047318614, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '7147151', 'n_tokens_mistral': 898, 'n_tokens_neox': 847, 'n_words': 185}