<commit_before>define([
    'backbone',
    'underscore',
    'jquery',
    'i18n!find/nls/bundle',
    'find/app/page/search/results/results-view',
    'text!find/templates/app/page/search/results/results-view-container.html',
    'text!find/templates/app/page/search/results/selector.html',
    'text!find/templates/app/page/search/results/content-container.html'
], function(Backbone, _, $, i18n, ResultsView, template, selectorTemplate, contentContainerTemplate) {

    return Backbone.View.extend({
        template: _.template(template),
        selectorTemplate: _.template(selectorTemplate, {variable: 'data'}),
        contentContainerTemplate: _.template(contentContainerTemplate, {variable: 'data'}),

        ResultsView: $.noop,

        initialize: function(options) {
            this.views = [{
                id: 'list',
                selector: {
                    displayNameKey: 'list',
                    icon: 'hp-list'
                },
                content: new this.ResultsView({
                    documentsCollection: options.documentsCollection,
                    entityCollection: options.entityCollection,
                    indexesCollection: options.indexesCollection,
                    queryModel: options.queryModel
                })
            }, {
                id: 'map',
                selector: {
                    displayNameKey: 'map',
                    icon: 'hp-grid'
                },
                content: new (Backbone.View.extend({
                    render: function() {
                        this.$el.html('It works!')
                    }
                }))()
            }];
        },

        render: function() {
            this.$el.html(this.template);

            var $selectorList = this.$('.selector-list');
            var $contentList = this.$('.content-list');

            _.each(this.views, function(view, index) {
                $(this.selectorTemplate({
                    i18n: i18n,
                    id: view.id,
                    selector: view.selector
                })).toggleClass('active', index === 0).appendTo($selectorList);

                var $viewElement = $(this.contentContainerTemplate(view)).toggleClass('active', index === 0).appendTo($contentList);
                view.content.setElement($viewElement).render();
            }, this);

            // Triggers a "selected" event with the id results view type
            this.$('a[data-toggle="tab"]').on('hide.bs.tab', (function (e) {
                this.trigger('selected', $(e.relatedTarget).attr('data-id'));
            }).bind(this))
        }

    });

});<commit_msg>Comment out placeholder to bring dev to a releasable state. [rev: matt.gordon2]<commit_after>define([
    'backbone',
    'underscore',
    'jquery',
    'i18n!find/nls/bundle',
    'find/app/page/search/results/results-view',
    'text!find/templates/app/page/search/results/results-view-container.html',
    'text!find/templates/app/page/search/results/selector.html',
    'text!find/templates/app/page/search/results/content-container.html'
], function(Backbone, _, $, i18n, ResultsView, template, selectorTemplate, contentContainerTemplate) {

    return Backbone.View.extend({
        template: _.template(template),
        selectorTemplate: _.template(selectorTemplate, {variable: 'data'}),
        contentContainerTemplate: _.template(contentContainerTemplate, {variable: 'data'}),

        // Abstract
        ResultsView: null,

        initialize: function(options) {
            this.views = [{
                id: 'list',
                selector: {
                    displayNameKey: 'list',
                    icon: 'hp-list'
                },
                content: new this.ResultsView({
                    documentsCollection: options.documentsCollection,
                    entityCollection: options.entityCollection,
                    indexesCollection: options.indexesCollection,
                    queryModel: options.queryModel
                })
            }/*, {
                id: 'map',
                selector: {
                    displayNameKey: 'map',
                    icon: 'hp-grid'
                },
                content: new (Backbone.View.extend({
                    render: function() {
                        this.$el.html('It works!')
                    }
                }))()
            }*/];
        },

        render: function() {
            this.$el.html(this.template);

            var $selectorList = this.$('.selector-list');
            var $contentList = this.$('.content-list');

            _.each(this.views, function(view, index) {
                $(this.selectorTemplate({
                    i18n: i18n,
                    id: view.id,
                    selector: view.selector
                })).toggleClass('active', index === 0).appendTo($selectorList);

                var $viewElement = $(this.contentContainerTemplate(view)).toggleClass('active', index === 0).appendTo($contentList);
                view.content.setElement($viewElement).render();
            }, this);

            // Triggers a "selected" event with the id results view type
            this.$('a[data-toggle="tab"]').on('hide.bs.tab', (function (e) {
                this.trigger('selected', $(e.relatedTarget).attr('data-id'));
            }).bind(this))
        }

    });

});
{'fraction_non_alphanumeric': 0.13616154131159688, 'fraction_numerical': 0.003890329751759911, 'mean_word_length': 1.6794044665012406, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5278198', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1325, 'n_words': 230}