<commit_before>(function () {
    var components = {
        'inline-edit': 'hqwebapp/js/components/inline_edit',
        'pagination': 'hqwebapp/js/components/pagination'
    };

    _.each(components, function(moduleName, elementName) {
        ko.components.register(elementName, hqImport(moduleName));
    });

    $(function() {
        _.each(_.keys(components), function(elementName) {
            _.each($(elementName), function(el) {
                var $el = $(el);
                if (!$el.closest('.ko-template').length) {
                    $(el).koApplyBindings();
                }
            });
        });
    });
}());<commit_msg>Only apply bindings to standalone components<commit_after>(function () {
    // standalone components will have their own knockout bindings. Use
    // standalone: false if you want to mix the component into another model
    var components = {
        'inline-edit': {path: 'hqwebapp/js/components/inline_edit', standalone: true},
        'pagination': {path: 'hqwebapp/js/components/pagination', standalone: false},
    };

    _.each(components, function(module, elementName) {
        ko.components.register(elementName, hqImport(module.path));
    });

    $(function() {
        _.each(components, function(module, elementName) {
            if (module.standalone){
                _.each($(elementName), function(el) {
                    var $el = $(el);
                    if (!$el.closest('.ko-template').length) {
                        $(el).koApplyBindings();
                    }
                });
            }
        });
    });
}());
{'fraction_non_alphanumeric': 0.15121344119477287, 'fraction_numerical': 0.0, 'mean_word_length': 2.0282485875706215, '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': '3105130', 'n_tokens_mistral': 448, 'n_tokens_neox': 427, 'n_words': 81}