<commit_before>
/**
 * Creates a new Formats object.
 *  Do not create an indeterminent number of these components or it may result in
 *  memory leaks
 *
 * @constructor
 */
lingcod.panel = function(options){
    
    var defaults = {
        hideOnly: false,
        showCloseButton: true,
        content: false,
        appendTo: window.document.body,
        scrollable: true
    }
    
    var that = {
        options: $.extend({}, defaults, options),
        shown: false
    };
    
    if(lingcod && lingcod.addPanel){
        lingcod.addPanel(that);
    }
    
    var s = '';
    var loader;
    
    if(!that.options.showCloseButton){
        s = 'display:none';
    }
    
    var close = '<a style="'+s+'" class="close" href="#"><img src="'+lingcod.options.media_url+'common/images/close.png" width="17" height="16" /></a>';
    
    var other_classes = that.options.scrollable ? '' : 'marinemap-panel-noscroll';
    var el = $('<div style="display:none;" class="marinemap-panel '+other_classes+'"><div class="loadingMask"><span>Loading</span></div><div class="panelMask"></div>'+close+'<div class="content container_12"><div class="panel"></div></div></div>');
    el.data('panelComponent', that);
    var anotherel = el;
        
    el.find('a.close').click(function(){
        that.close();
    });
    
    var content = el.find('.content');
    
    $(that.options.appendTo).append(el);
    
    if(that.options.content && $(that.options.content).length){
        var c = $(that.options.content);
        c.remove();
        content.append(c);
    }

    that.showContent = function(elements, opts){
        that.addContent(elements);
        if(opts && opts.showClose){
            el.find('a.close').show();
        }
        that.show();
    }
    
    that.addContent = function(elements){
        if(!that.options.content){
            content.html('');
            content.append(elements);            
        }
    }
    
    that.show = function(animate){
        $(el[0]).show();
        $(el[0]).find('.marinemap-table').each(function(){
            lingcod.ui.table(this);
        });
        $(el[0]).scrollTop(0);
        that.shown = true;
        $(that).trigger('panelshow', that);       
    }
    
    that.close = function(){
        if(loader && loader.destroy){
            console.warn('destroying');
            loader.destroy();
        }
        $(el[0]).scrollTop(1).scrollTop(0);
        if(options.showCloseButton === false){
            el.find('a.close').hide();
        }
        if(!that.options.hideOnly){
            el.hide();
            that.shown = false;
            el.find('div.content').html('');
            $(that).trigger('panelclose', that);
        }
    }
    
    that.spin = function(message){
        if(el.is(':visible')){
            el.find('.loadingMask span').text(message || "Loading")
            el.find('.loadingMask').show();
        }else{
            lingcod.showLoadingMask(message);
        }
    };
    
    that.stopSpinning = function(){
        lingcod.hideLoadingMask();
        el.find('.loadingMask').hide();
    };
    
    that.showError = function(title, message){
        
    };
    
    // Returns the names of all open tabs as a list, ie: root->parent->child
    var getActiveTabs = function(element, list){
        var list = list || [];
        var selected = element.find('.ui-tabs:first .ui-tabs-selected:first > a');
        var href = selected.attr('href');
        var name = selected.text()
        list.push(name);
        var panel = $(href);
        if(panel.find('.ui-tabs').length){
            getActiveTabs(panel, list);
        }
        console.log('activeTabs list', list);
        return list;
    };<commit_msg>removing console.log statements<commit_after>
/**
 * Creates a new Formats object.
 *  Do not create an indeterminent number of these components or it may result in
 *  memory leaks
 *
 * @constructor
 */
lingcod.panel = function(options){
    
    var defaults = {
        hideOnly: false,
        showCloseButton: true,
        content: false,
        appendTo: window.document.body,
        scrollable: true
    }
    
    var that = {
        options: $.extend({}, defaults, options),
        shown: false
    };
    
    if(lingcod && lingcod.addPanel){
        lingcod.addPanel(that);
    }
    
    var s = '';
    var loader;
    
    if(!that.options.showCloseButton){
        s = 'display:none';
    }
    
    var close = '<a style="'+s+'" class="close" href="#"><img src="'+lingcod.options.media_url+'common/images/close.png" width="17" height="16" /></a>';
    
    var other_classes = that.options.scrollable ? '' : 'marinemap-panel-noscroll';
    var el = $('<div style="display:none;" class="marinemap-panel '+other_classes+'"><div class="loadingMask"><span>Loading</span></div><div class="panelMask"></div>'+close+'<div class="content container_12"><div class="panel"></div></div></div>');
    el.data('panelComponent', that);
    var anotherel = el;
        
    el.find('a.close').click(function(){
        that.close();
    });
    
    var content = el.find('.content');
    
    $(that.options.appendTo).append(el);
    
    if(that.options.content && $(that.options.content).length){
        var c = $(that.options.content);
        c.remove();
        content.append(c);
    }

    that.showContent = function(elements, opts){
        that.addContent(elements);
        if(opts && opts.showClose){
            el.find('a.close').show();
        }
        that.show();
    }
    
    that.addContent = function(elements){
        if(!that.options.content){
            content.html('');
            content.append(elements);            
        }
    }
    
    that.show = function(animate){
        $(el[0]).show();
        $(el[0]).find('.marinemap-table').each(function(){
            lingcod.ui.table(this);
        });
        $(el[0]).scrollTop(0);
        that.shown = true;
        $(that).trigger('panelshow', that);       
    }
    
    that.close = function(){
        if(loader && loader.destroy){
            loader.destroy();
        }
        $(el[0]).scrollTop(1).scrollTop(0);
        if(options.showCloseButton === false){
            el.find('a.close').hide();
        }
        if(!that.options.hideOnly){
            el.hide();
            that.shown = false;
            el.find('div.content').html('');
            $(that).trigger('panelclose', that);
        }
    }
    
    that.spin = function(message){
        if(el.is(':visible')){
            el.find('.loadingMask span').text(message || "Loading")
            el.find('.loadingMask').show();
        }else{
            lingcod.showLoadingMask(message);
        }
    };
    
    that.stopSpinning = function(){
        lingcod.hideLoadingMask();
        el.find('.loadingMask').hide();
    };
    
    that.showError = function(title, message){
        
    };
    
    // Returns the names of all open tabs as a list, ie: root->parent->child
    var getActiveTabs = function(element, list){
        var list = list || [];
        var selected = element.find('.ui-tabs:first .ui-tabs-selected:first > a');
        var href = selected.attr('href');
        var name = selected.text()
        list.push(name);
        var panel = $(href);
        if(panel.find('.ui-tabs').length){
            getActiveTabs(panel, list);
        }
        return list;
    };
{'fraction_non_alphanumeric': 0.16955110870740941, 'fraction_numerical': 0.003515413737155219, 'mean_word_length': 2.041529605263158, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 39, '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': '3690016', 'n_tokens_mistral': 2213, 'n_tokens_neox': 2194, 'n_words': 390}