<commit_before>require([
    'configuration/admin/plugin',
    'util/formatters',
    'd3'
], function(
    defineLumifyAdminPlugin,
    F,
    d3
    ) {
    'use strict';

    return defineLumifyAdminPlugin(PluginList, {
        section: 'Plugin',
        name: 'List',
        subtitle: 'Loaded plugins'
    });

    function PluginList() {

        this.after('initialize', function() {
            var self = this;

            this.$node.html(
                '<ul class="nav nav-list">' +
                  '<li class="nav-header">Plugins<span class="badge loading"></span></li>' +
                '</ul>'
            );
            this.adminService.plugins()
                .always(function() {
                    self.$node.find('.badge').remove();
                })
                .done(this.renderPlugins.bind(this))
                .fail(this.showError.bind(this));
        });

        this.renderPlugins = function(plugins) {
            var self = this,
                $list = this.$node.empty();

            d3.select($list.get(0))
                .selectAll('section.collapsible')
                .data(
                    _.chain(plugins)
                    .pairs()
                    .map(function(pair) {
                        return [
                            pair[0].replace(/[A-Z]/g, function(cap) {
                                return ' ' + cap;
                            }),
                            pair[1]
                        ];
                    })
                    .sortBy(function(pair) {
                        return pair[0].toLowerCase();
                    })
                    .value()
                )
                .call(function() {
                    this.enter()
                        .append('section').attr('class', 'collapsible has-badge-number')
                        .call(function() {
                            this.append('h1')
                                .call(function() {
                                    this.append('span').attr('class', 'badge');
                                    this.append('strong');
                                })
                            this.append('div').append('ol').attr('class', 'inner-list');
                        });

                    this.classed('expanded', function(d) {
                        return d[1].length > 0;
                    });
                    this.select('h1 strong').text(function(d) {
                        return d[0];
                    });
                    this.select('.badge').text(function(d) {
                        return F.number.pretty(d[1].length);
                    });
                    this.select('ol.inner-list')
                        .selectAll('li')
                        .data(function(d) {
                            return d[1];
                        })
                        .call(function() {
                            this.enter()
                                .append('li')
                                .append('a')
                                    .attr('title', 'Search in Github')
                                    .attr('target', 'github');

                            this.select('a')
                                .attr('href', function(d) {
                                    return 'https://github.com/lumifyio/lumify/search?q=' + d.className + '.java';
                                })
                                .text(function(d) {
                                    return d.className;
                                })
                        });

                })
                .exit().remove();
        };

    }
});<commit_msg>General github search for classnames not starting io.lumify<commit_after>require([
    'configuration/admin/plugin',
    'util/formatters',
    'd3'
], function(
    defineLumifyAdminPlugin,
    F,
    d3
    ) {
    'use strict';

    return defineLumifyAdminPlugin(PluginList, {
        section: 'Plugin',
        name: 'List',
        subtitle: 'Loaded plugins'
    });

    function PluginList() {

        this.after('initialize', function() {
            var self = this;

            this.$node.html(
                '<ul class="nav nav-list">' +
                  '<li class="nav-header">Plugins<span class="badge loading"></span></li>' +
                '</ul>'
            );
            this.adminService.plugins()
                .always(function() {
                    self.$node.find('.badge').remove();
                })
                .done(this.renderPlugins.bind(this))
                .fail(this.showError.bind(this));
        });

        this.renderPlugins = function(plugins) {
            var self = this,
                $list = this.$node.empty();

            d3.select($list.get(0))
                .selectAll('section.collapsible')
                .data(
                    _.chain(plugins)
                    .pairs()
                    .map(function(pair) {
                        return [
                            pair[0].replace(/[A-Z]/g, function(cap) {
                                return ' ' + cap;
                            }),
                            pair[1]
                        ];
                    })
                    .sortBy(function(pair) {
                        return pair[0].toLowerCase();
                    })
                    .value()
                )
                .call(function() {
                    this.enter()
                        .append('section').attr('class', 'collapsible has-badge-number')
                        .call(function() {
                            this.append('h1')
                                .call(function() {
                                    this.append('span').attr('class', 'badge');
                                    this.append('strong');
                                })
                            this.append('div').append('ol').attr('class', 'inner-list');
                        });

                    this.classed('expanded', function(d) {
                        return d[1].length > 0;
                    });
                    this.select('h1 strong').text(function(d) {
                        return d[0];
                    });
                    this.select('.badge').text(function(d) {
                        return F.number.pretty(d[1].length);
                    });
                    this.select('ol.inner-list')
                        .selectAll('li')
                        .data(function(d) {
                            return d[1];
                        })
                        .call(function() {
                            this.enter()
                                .append('li')
                                .append('a')
                                    .attr('title', 'Search in Github')
                                    .attr('target', 'github');

                            this.select('a')
                                .attr('href', function(d) {
                                    if ((/^io\.lumify\./).test(d.className)) {
                                        return 'https://github.com/lumifyio/lumify/search?q=' + d.className + '.java';
                                    }
                                    return 'https://github.com/search?q=' + d.className + '.java&type=Code';
                                })
                                .text(function(d) {
                                    return d.className;
                                })
                        });

                })
                .exit().remove();
        };

    }
});
{'fraction_non_alphanumeric': 0.1289817232375979, 'fraction_numerical': 0.0036553524804177544, 'mean_word_length': 0.7979347570992724, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4547637', 'n_tokens_mistral': 1854, 'n_tokens_neox': 1713, 'n_words': 241}