<commit_before>var OjsArticleSubmission = {
    submissionId: null,
    step: null,
    languages: [],
    activatedSteps: {"step0": true, "step1": false, "step2": false, "step3": false, "step4": false},
    showResumeNote: function () {

        var html = '<a href="/author/article/submit/resume/' + this.submissionId + '#' + this.step + '">' + this.submissionId + '</a>';
        $("#resumeNote").html(html);
    },
    loadStepTemplate: function (step) {
        if (!this.activatedSteps["step" + step]) {
            $("#step" + step).append(Mustache.render($("#step" + step + "_tpl").html()));
            this.activatedSteps["step" + step] = true;
        }
    },
    backTo: function (step) {
        this.configureProgressBar(step);
        this.hideAllSteps();
        this.configureProgressBar(step);
        this.showStep(step);
    },
    configureProgressBar: function (step) {
        $("ul.submission-progress li").removeClass("active");
        $("ul.submission-progress li#submission-progress-step" + step).addClass("active");
    },
    hideAllSteps: function () {
        $(".step").addClass("hide", 200, "easeInBack");
    },
    showStep: function (step) {
        $("#step" + step + "-container").removeClass("hide", 200, "easeInBack");
        history.pushState({}, "Article Submission", "/author/article/submit/resume/" + $("input[name=submissionId]").val());
        window.location.hash = step;
        this.step = step;
        this.showResumeNote();
    },
    hideStep: function (step) {
        $("#step" + step + "-container").slideUp("fast", 200, "easeInBack");
    },
    addAuthorForm: function (params) {
        $("#step2").append(Mustache.render($("#step2_tpl").html(), params));
        OjsArticleSubmission.setupUi();
        function formatResult(item) {
            return item.name;
        }
        function formatSelection(item) {
            return '<b>' + item.name + '</b>';
        }
        $(".select2-institution-search-element").select2({
            multiple: false,
            //Allow manually entered text in drop down.
            createSearchChoice: function (term, data) {
                if ($(data).filter(function () {
                    return this.text.localeCompare(term) === 0;
                }).length === 0) {
                    return {id: term, text: term};
                }
            },
            ajax: {
                url: '/api/public/search/institution',
                dataType: 'json',
                type: "GET",
                delay: 300,
                data: function (params) {
                    return {
                        q: '(.*)'+params+'(.*)'
                    };
                },
                results: function (data) {
                    return {
                        results: $.map(data, function (item) {
                            return {
                                text: item.name,
                                slug: item.name,
                                id: item.id
                            };
                        })
                    };
                },
                cache: true
            },<commit_msg>inst. public search api action modified<commit_after>var OjsArticleSubmission = {
    submissionId: null,
    step: null,
    languages: [],
    activatedSteps: {"step0": true, "step1": false, "step2": false, "step3": false, "step4": false},
    showResumeNote: function () {

        var html = '<a href="/author/article/submit/resume/' + this.submissionId + '#' + this.step + '">' + this.submissionId + '</a>';
        $("#resumeNote").html(html);
    },
    loadStepTemplate: function (step) {
        if (!this.activatedSteps["step" + step]) {
            $("#step" + step).append(Mustache.render($("#step" + step + "_tpl").html()));
            this.activatedSteps["step" + step] = true;
        }
    },
    backTo: function (step) {
        this.configureProgressBar(step);
        this.hideAllSteps();
        this.configureProgressBar(step);
        this.showStep(step);
    },
    configureProgressBar: function (step) {
        $("ul.submission-progress li").removeClass("active");
        $("ul.submission-progress li#submission-progress-step" + step).addClass("active");
    },
    hideAllSteps: function () {
        $(".step").addClass("hide", 200, "easeInBack");
    },
    showStep: function (step) {
        $("#step" + step + "-container").removeClass("hide", 200, "easeInBack");
        history.pushState({}, "Article Submission", "/author/article/submit/resume/" + $("input[name=submissionId]").val());
        window.location.hash = step;
        this.step = step;
        this.showResumeNote();
    },
    hideStep: function (step) {
        $("#step" + step + "-container").slideUp("fast", 200, "easeInBack");
    },
    addAuthorForm: function (params) {
        $("#step2").append(Mustache.render($("#step2_tpl").html(), params));
        OjsArticleSubmission.setupUi();
        function formatResult(item) {
            return item.name;
        }
        function formatSelection(item) {
            return '<b>' + item.name + '</b>';
        }
        $(".select2-institution-search-element").select2({
            multiple: false,
            //Allow manually entered text in drop down.
            createSearchChoice: function (term, data) {
                if ($(data).filter(function () {
                    return this.text.localeCompare(term) === 0;
                }).length === 0) {
                    return {id: term, text: term};
                }
            },
            ajax: {
                url: '/api/public/search/institution',
                dataType: 'json',
                type: "GET",
                delay: 300,
                data: function (params) {
                    return {
                        q: '(.*)'+params+'(.*)',
                        verified: true
                    };
                },
                results: function (data) {
                    return {
                        results: $.map(data, function (item) {
                            return {
                                text: item.name,
                                slug: item.name,
                                id: item.id
                            };
                        })
                    };
                },
                cache: true
            },
{'fraction_non_alphanumeric': 0.1563380281690141, 'fraction_numerical': 0.007198748043818467, 'mean_word_length': 1.5594713656387664, 'pattern_counts': {'":': 10, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5043431', 'n_tokens_mistral': 1763, 'n_tokens_neox': 1696, 'n_words': 331}