<commit_before>/*

    Easy widget to serve as a tabbed container.

    var $tabs = $('#tabs').kbaseTabs(
        {
            tabPosition : 'bottom', //or left or right or top. Defaults to 'top'
            canDelete : true,       //whether or not the tab can be removed. Defaults to false.
            tabs : [
                {
                    tab : 'T1',                                     //name of the tab
                    content : $('<div></div>').html("I am a tab"),  //jquery object to stuff into the content
                    canDelete : false,                              //override the canDelete param on a per tab basis
                },
                {
                    tab : 'T2',
                    content : $('<div></div>').html("I am a tab 2"),
                },
                {
                    tab : 'T3',
                    content : $('<div></div>').html("I am a tab 3"),
                    show : true,                                    //boolean. This tab gets shown by default. If not specified, the first tab is shown
                },
            ],
        }
    );

    useful methods would be:

    $('#tabs').kbaseTabs('showTab', 'T1');
    $('#tabs').kbaseTabs('addTab', tabObject);  //the tabObject defined up above

*/

(function( $, undefined ) {


    $.KBWidget({

		  name: "kbaseTabs",

        version: "1.0.0",

        _accessors : ['tabsHeight'],

        options: {
            tabPosition : 'top',
            canDelete : false,
            borderColor : 'lightgray',
        },

        init: function(options) {

            this._super(options);

            this.data('tabs', {});
            this.data('nav', {});

            this.appendUI( $( this.$elem ) );

            return this;

        },

        appendUI : function ($elem, tabs) {

            if (tabs == undefined) {
                tabs = this.options.tabs;
            }

            var $block =
                $('<div></div>')
                    .addClass('tabbable')
            ;

            var $tabs = $('<div></div>')
                .addClass('tab-content')
                .attr('id', 'tabs-content')
                .css('height', this.tabsHeight())
            ;
            var $nav = $('<ul></ul>')
                .addClass('nav nav-tabs')
                .attr('id', 'tabs-nav')
            ;
            $block.append($nav).append($tabs);
            /*if (this.options.tabPosition == 'top') {
                $block.addClass('tabs-above');
                $block.append($nav).append($tabs);
            }
            else if (this.options.tabPosition == 'bottom') {
                $block.addClass('tabs-below');
                $block.append($tabs).append($nav);
            }
            else if (this.options.tabPosition == 'left') {
                $block.addClass('tabs-left');
                $block.append($nav).append($tabs);
            }
            else if (this.options.tabPosition == 'right') {
                $block.addClass('tabs-right');
                $block.append($tabs).append($nav);
            }*/

            this._rewireIds($block, this);

            $elem.append($block);

            if (tabs) {
                $.each(
                    tabs,
                    $.proxy(function (idx, tab) {
                        this.addTab(tab);
                    }, this)
                );
            }

        },

        addTab : function (tab) {

            if (tab.canDelete == undefined) {
                tab.canDelete = this.options.canDelete;
            }

            var $tab = $('<div></div>')
                .addClass('tab-pane fade')
                .append(tab.content);

            if (this.options.border) {
                $tab.css('border', 'solid ' + this.options.borderColor);
                $tab.css('border-width', '0px 1px 0px 1px');
                $tab.css('padding', '3px');
            }

            var $that = this;   //thanks bootstrap! You suck!

            var $nav = $('<li></li>')
                .css('white-space', 'nowrap')
                .append(
                    $('<a></a>')<commit_msg>a change to the KBaseTabs that allows for html in the tab title, Jim ok'd this<commit_after>/*

    Easy widget to serve as a tabbed container.

    var $tabs = $('#tabs').kbaseTabs(
        {
            tabPosition : 'bottom', //or left or right or top. Defaults to 'top'
            canDelete : true,       //whether or not the tab can be removed. Defaults to false.
            tabs : [
                {
                    tab : 'T1',                                     //name of the tab
                    content : $('<div></div>').html("I am a tab"),  //jquery object to stuff into the content
                    canDelete : false,                              //override the canDelete param on a per tab basis
                },
                {
                    tab : 'T2',
                    content : $('<div></div>').html("I am a tab 2"),
                },
                {
                    tab : 'T3',
                    content : $('<div></div>').html("I am a tab 3"),
                    show : true,                                    //boolean. This tab gets shown by default. If not specified, the first tab is shown
                },
            ],
        }
    );

    useful methods would be:

    $('#tabs').kbaseTabs('showTab', 'T1');
    $('#tabs').kbaseTabs('addTab', tabObject);  //the tabObject defined up above

*/

(function( $, undefined ) {


    $.KBWidget({

		  name: "kbaseTabs",

        version: "1.0.0",

        _accessors : ['tabsHeight'],

        options: {
            tabPosition : 'top',
            canDelete : false,
            borderColor : 'lightgray',
        },

        init: function(options) {

            this._super(options);

            this.data('tabs', {});
            this.data('nav', {});

            this.appendUI( $( this.$elem ) );

            return this;

        },

        appendUI : function ($elem, tabs) {

            if (tabs == undefined) {
                tabs = this.options.tabs;
            }

            var $block =
                $('<div></div>')
                    .addClass('tabbable')
            ;

            var $tabs = $('<div></div>')
                .addClass('tab-content')
                .attr('id', 'tabs-content')
                .css('height', this.tabsHeight())
            ;
            var $nav = $('<ul></ul>')
                .addClass('nav nav-tabs')
                .attr('id', 'tabs-nav')
            ;
            $block.append($nav).append($tabs);
            /*if (this.options.tabPosition == 'top') {
                $block.addClass('tabs-above');
                $block.append($nav).append($tabs);
            }
            else if (this.options.tabPosition == 'bottom') {
                $block.addClass('tabs-below');
                $block.append($tabs).append($nav);
            }
            else if (this.options.tabPosition == 'left') {
                $block.addClass('tabs-left');
                $block.append($nav).append($tabs);
            }
            else if (this.options.tabPosition == 'right') {
                $block.addClass('tabs-right');
                $block.append($tabs).append($nav);
            }*/

            this._rewireIds($block, this);

            $elem.append($block);

            if (tabs) {
                $.each(
                    tabs,
                    $.proxy(function (idx, tab) {
                        this.addTab(tab);
                    }, this)
                );
            }

        },

        addTab : function (tab) {

            if (tab.canDelete == undefined) {
                tab.canDelete = this.options.canDelete;
            }

            var $tab = $('<div></div>')
                .addClass('tab-pane fade')
                .append(tab.content);

            if (this.options.border) {
                $tab.css('border', 'solid ' + this.options.borderColor);
                $tab.css('border-width', '0px 1px 0px 1px');
                $tab.css('padding', '3px');
            }

            var $that = this;   //thanks bootstrap! You suck!


            var $nav = $('<li></li>')
                .css('white-space', 'nowrap')
                .append(
                    $('<a></a>')
{'fraction_non_alphanumeric': 0.14882381180988957, 'fraction_numerical': 0.003360537686029765, 'mean_word_length': 1.1198168404986009, 'pattern_counts': {'":': 0, '<': 39, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2898611', 'n_tokens_mistral': 2305, 'n_tokens_neox': 2120, 'n_words': 496}