<commit_before>/*jQuery.noConflict();
var $j = jQuery;
$j( document ).ready(function() {
    $j.Ajaxy.configure({
        'method': 'get',
        'root_url': 'http://localhost:3001',
        'Controllers': {
            '_generic': {
                request: function(){
                    var Ajaxy = $j.Ajaxy;
                    deactivate_previous_tab();
                    activate_clicking_tab();
                    return true;
                },
                response: function(){
                    var data = this.State.Response.data;
                    var tab_content_id = 'faceted_search_result';
                    $j('#' + tab_content_id).html(data.items_for_facets);
                    $j(document).trigger("scriptsLoaded.exhibit");
                    return true;
                },
                error: function(){
                    // Prepare
                    var Ajaxy = $j.Ajaxy; var data = this.State.Error.data||this.State.Response.data; var state = this.state||'unknown';
                    // Error
                    var error = data.error||data.responseText||'Unknown Error.';
                    var error_message = data.content||error;
                    // Log what is happening
                    window.console.error('$j.Ajaxy.Controllers._generic.error', [this, arguments], error_message);
                    return true;
                }
            },
            'search': {
                classname: 'ajaxy-search',
                matches: /^\/search\/?/,
                request: function(){
                    return true;
                },
                response: function(){
                    return true;
                }
            }
        }
    });

    //Load content for first tab
    var first_tab = document.getElementsByClassName('ajaxy')[0];
    if (first_tab != null){
        first_tab.click();
    }
});*/

function load_tabs() {
    var tabberOptions = {'onLoad':function() {
        displayTabs();
    }};
    tabberAutomatic(tabberOptions);
}

function tab_on_click(resource_type, resource_ids, with_facets) {
    var tab_content_id = 'faceted_search_result';

    var click_tab = document.getElementById('tab_' + resource_type);
    var url = '';
    if (with_facets == true)
        url = items_for_facets_url;
    else
        url = items_for_result_url;

    click_tab.onclick = function () {
        show_large_ajax_loader(tab_content_id);
        deactivate_previous_tab();
        click_tab.className = 'tabberactive';

        Exhibit.SelectionState.currentAssetType = resource_type;

        jQuery.noConflict();
        var $j = jQuery;
        $j.ajax({
            url: url,
            async: false,
            data: { item_ids: resource_ids,
                item_type: resource_type}
        })
            .done(function (data) {
                var tab_content = $j('#' + tab_content_id);
                if (with_facets == true)
                    tab_content.html(data.items_for_facets);
                else
                    tab_content.html(data.items_for_result);
                //$j(document).ready(initializationFunction);
                //$j(document).trigger("scriptsLoaded.exhibit");
            });
    }
}

function deactivate_previous_tab(){
    //First change the color of the previous chosen tab
    var previous_active_tab = document.getElementsByClassName('tabberactive')[0];
    if (previous_active_tab != null)
        previous_active_tab.className = '';
}

function activate_clicking_tab(){
    var clicking_tab_id = "tab_"
    var href = document.location.href;
    var url_elements = href.split('&');
    for (var i=0; i<url_elements.length; i++){
        if (url_elements[i].match('item_type=') != null){
            clicking_tab_id = clicking_tab_id + url_elements[i].split('item_type=')[1] ;
            break;
        }
    }

    var clicking_tab = document.getElementById(clicking_tab_id);
    if (clicking_tab != null)
        clicking_tab.className = 'tabberactive';
}
<commit_msg>remove ajaxy related functions<commit_after>function load_tabs() {
    var tabberOptions = {'onLoad':function() {
        displayTabs();
    }};
    tabberAutomatic(tabberOptions);
}

function tab_on_click(resource_type, resource_ids, with_facets) {
    var tab_content_id = 'faceted_search_result';

    var click_tab = document.getElementById('tab_' + resource_type);
    var url = '';
    if (with_facets == true)
        url = items_for_facets_url;
    else
        url = items_for_result_url;

    click_tab.onclick = function () {
        show_large_ajax_loader(tab_content_id);
        deactivate_previous_tab();
        click_tab.className = 'tabberactive';

        Exhibit.SelectionState.currentAssetType = resource_type;

        jQuery.noConflict();
        var $j = jQuery;
        $j.ajax({
            url: url,
            async: false,
            data: { item_ids: resource_ids,
                item_type: resource_type}
        })
            .done(function (data) {
                var tab_content = $j('#' + tab_content_id);
                if (with_facets == true)
                    tab_content.html(data.items_for_facets);
                else
                    tab_content.html(data.items_for_result);
                //$j(document).ready(initializationFunction);
                //$j(document).trigger("scriptsLoaded.exhibit");
            });
    }
}

function deactivate_previous_tab(){
    //First change the color of the previous chosen tab
    var previous_active_tab = document.getElementsByClassName('tabberactive')[0];
    if (previous_active_tab != null)
        previous_active_tab.className = '';
}


{'fraction_non_alphanumeric': 0.1150520557614258, 'fraction_numerical': 0.0015881418740074113, 'mean_word_length': 1.8756976154236429, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3002003', 'n_tokens_mistral': 1631, 'n_tokens_neox': 1567, 'n_words': 289}