<commit_before>
function ContentBrowser(options) {
    var self = this,
        defaultOptions = {
            cb_actions: {}
        };

    /** Extend the default options **/
    if (typeof options === 'object') {
        options = $.extend(defaultOptions, options);
    } else {
        options = defaultOptions;
    }

    /** Private parts **/

    /** Public parts **/
    this.showLoader = function(container) {
        var loader_path = options.static_prefix + 'contentbrowser/img/ajax-loader.gif';
        django.jQuery(container).empty()
            .html('<div style="text-align:center;"><img src="' + loader_path + '" /></div>');
    }

    this.takeAction = function(action, el) {
        return options.cb_actions[action](django.jQuery(el));
    };
    
    this.loadItems = function(url) {
        self.showLoader('#cb_items_panel');
        django.jQuery.ajax({
            url: url,
            success: function(data) {
                django.jQuery('#cb_items_panel').empty().html(data);
            }
        });
        return false;
    };

}


django.jQuery(document).ready(function() {

    django.jQuery('#cb_toggle_panels').click(function() {
        django.jQuery('#cb_types_panel, #cb_items_panel, #cb_display_panel, #cb_filter_panel')
            .toggle(300);
        return false;
    });

    django.jQuery('#cb_types_panel a').click(function() {
        django.jQuery('#cb_types_panel li a').removeClass('selected');
        django.jQuery(this).addClass('selected');
        return cb.loadItems(django.jQuery(this).attr('href'));<commit_msg>Just use the cb_actions var direcly, without passing it through to our ContentBrowser Object. (experimenting with various workflows atm)<commit_after>
function ContentBrowser(options) {
    var self = this,
        defaultOptions = {};

    /** Extend the default options **/
    if (typeof options === 'object') {
        options = $.extend(defaultOptions, options);
    } else {
        options = defaultOptions;
    }

    /** Private parts **/

    /** Public parts **/
    this.showLoader = function(container) {
        var loader_path = options.static_prefix + 'contentbrowser/img/ajax-loader.gif';
        django.jQuery(container).empty()
            .html('<div style="text-align:center;"><img src="' + loader_path + '" /></div>');
    }

    this.takeAction = function(action, el) {
        return cb_actions[action](django.jQuery(el));
    };
    
    this.loadItems = function(url) {
        self.showLoader('#cb_items_panel');
        django.jQuery.ajax({
            url: url,
            success: function(data) {
                django.jQuery('#cb_items_panel').empty().html(data);
            }
        });
        return false;
    };

}


django.jQuery(document).ready(function() {

    django.jQuery('#cb_toggle_panels').click(function() {
        django.jQuery('#cb_types_panel, #cb_items_panel, #cb_display_panel, #cb_filter_panel')
            .toggle(300);
        return false;
    });

    django.jQuery('#cb_types_panel a').click(function() {
        django.jQuery('#cb_types_panel li a').removeClass('selected');
        django.jQuery(this).addClass('selected');
        return cb.loadItems(django.jQuery(this).attr('href'));
{'fraction_non_alphanumeric': 0.15184381778741865, 'fraction_numerical': 0.0018593120545398203, 'mean_word_length': 2.610738255033557, 'pattern_counts': {'":': 0, '<': 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': '935953', 'n_tokens_mistral': 930, 'n_tokens_neox': 904, 'n_words': 158}