<commit_before>hqDefine("m4change/javascripts/main", function () {
    var initialPageData = hqImport("hqwebapp/js/initial_page_data");
    $(function () {
        var OPTIONS = {
            users: initialPageData.get("users"),
            groups: initialPageData.get("groups"),
            receiverUrl: initialPageData.reverse('receiver_secure_post'),
            enddate: initialPageData.get("end_date"),
            webUserID: initialPageData.get("user_id"),
            domain: initialPageData.get("domain"),
        };

        var managementModel = new McctProjectReviewPageManagement(OPTIONS);
        function applyBindings() {
            var $mcctProjectReviewPageManagement = $('#mcct_project_review_page_management');
            var element = $mcctProjectReviewPageManagement[0];
            element.koApplyBindings(managementModel);

            $mcctProjectReviewPageManagement.find('a.select-all').click(function () {
                $mcctProjectReviewPageManagement.find('input.selected-element').prop('checked', true).change();
                return false;
            });

            $mcctProjectReviewPageManagement.find('a.select-none').click(function() {selectNone(); return false;});
            $mcctProjectReviewPageManagement.find('.dataTables_paginate a').mouseup(selectNone);
            $mcctProjectReviewPageManagement.find('.dataTables_length select').change(selectNone);

            function selectNone() {
                $mcctProjectReviewPageManagement.find('input.selected-element:checked').prop('checked', false).change();<commit_msg>Moved js logic from document ready handler to ajaxComplete handler<commit_after>hqDefine("m4change/javascripts/main", function () {
    var initialPageData = hqImport("hqwebapp/js/initial_page_data");
    $(document).on("ajaxComplete", function (e, xhr, options) {
        var fragment = "async/",
            pageUrl = window.location.href.split('?')[0],
            ajaxUrl = options.url.split('?')[0];
        if (ajaxUrl.indexOf(fragment) === -1 || !pageUrl.endsWith(ajaxUrl.replace(fragment, ''))) {
            return;
        }
        var OPTIONS = {
            users: initialPageData.get("users"),
            groups: initialPageData.get("groups"),
            receiverUrl: initialPageData.reverse('receiver_secure_post'),
            enddate: initialPageData.get("end_date"),
            webUserID: initialPageData.get("user_id"),
            domain: initialPageData.get("domain"),
        };

        var managementModel = new McctProjectReviewPageManagement(OPTIONS);
        function applyBindings() {
            var $mcctProjectReviewPageManagement = $('#mcct_project_review_page_management');
            var element = $mcctProjectReviewPageManagement[0];
            element.koApplyBindings(managementModel);

            $mcctProjectReviewPageManagement.find('a.select-all').click(function () {
                $mcctProjectReviewPageManagement.find('input.selected-element').prop('checked', true).change();
                return false;
            });

            $mcctProjectReviewPageManagement.find('a.select-none').click(function() {selectNone(); return false;});
            $mcctProjectReviewPageManagement.find('.dataTables_paginate a').mouseup(selectNone);
            $mcctProjectReviewPageManagement.find('.dataTables_length select').change(selectNone);

            function selectNone() {
                $mcctProjectReviewPageManagement.find('input.selected-element:checked').prop('checked', false).change();
{'fraction_non_alphanumeric': 0.12794995735001422, 'fraction_numerical': 0.00199033266988911, 'mean_word_length': 3.1485849056603774, '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': '7315094', 'n_tokens_mistral': 916, 'n_tokens_neox': 897, 'n_words': 124}