<commit_before>var OjsJournalSetup = {
    submissionId: null,
    journalSetupUrl: $('#journalSetupUrl').val(),
    journalId: $('#journalIdInput').val(),
    step: null,
    languages: [],
    activatedSteps: {"step1": true, "step2": false, "step3": false, "step4": false, "step5": false, "step6": false},
    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({}, "Journal Setup", OjsJournalSetup.journalSetupUrl);
        window.location.hash = step;
        this.step = step;
    },
    hideStep: function (step) {
        $("#step" + step + "-container").slideUp("fast", 200, "easeInBack");
    },
    step1: function (actionUrl) {
        form = $("#step1 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success) {
                OjsJournalSetup.hideAllSteps();
                OjsJournalSetup.prepareStep.step2();
            } else {
                OjsCommon.errorModal("Error occured. Check your data and please <b>try again</b>.");
            }
        });
    },
    step2: function (actionUrl) {
        form = $("#step2 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success) {
                OjsJournalSetup.hideAllSteps();
                OjsJournalSetup.prepareStep.step3();
            } else {
                OjsCommon.errorModal("Error occured. Check your data and please <b>try again</b>.");
            }
        });
    },
    step3: function (actionUrl) {
        form = $("#step3 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success) {
                OjsJournalSetup.hideAllSteps();
                OjsJournalSetup.prepareStep.step4();
            } else {
                OjsCommon.errorModal("Error occured. Check your data and please <b>try again</b>.");
            }
        });
    },
    step4: function (actionUrl) {
        form = $("#step4 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success) {
                OjsJournalSetup.hideAllSteps();
                OjsJournalSetup.prepareStep.step5();
            } else {
                OjsCommon.errorModal("Error occured. Check your data and please <b>try again</b>.");
            }
        });
    },
    step5: function (actionUrl) {
        form = $("#step5 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success) {<commit_msg>javascript if clause minor bugfix #752<commit_after>var OjsJournalSetup = {
    submissionId: null,
    journalSetupUrl: $('#journalSetupUrl').val(),
    journalId: $('#journalIdInput').val(),
    step: null,
    languages: [],
    activatedSteps: {"step1": true, "step2": false, "step3": false, "step4": false, "step5": false, "step6": false},
    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({}, "Journal Setup", OjsJournalSetup.journalSetupUrl);
        window.location.hash = step;
        this.step = step;
    },
    hideStep: function (step) {
        $("#step" + step + "-container").slideUp("fast", 200, "easeInBack");
    },
    step1: function (actionUrl) {
        form = $("#step1 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success == 1) {
                OjsJournalSetup.hideAllSteps();
                OjsJournalSetup.prepareStep.step2();
            } else {
                OjsCommon.errorModal("Error occured. Check your data and please <b>try again</b>.");
            }
        });
    },
    step2: function (actionUrl) {
        form = $("#step2 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success == 1) {
                OjsJournalSetup.hideAllSteps();
                OjsJournalSetup.prepareStep.step3();
            } else {
                OjsCommon.errorModal("Error occured. Check your data and please <b>try again</b>.");
            }
        });
    },
    step3: function (actionUrl) {
        form = $("#step3 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success) {
                OjsJournalSetup.hideAllSteps();
                OjsJournalSetup.prepareStep.step4();
            } else {
                OjsCommon.errorModal("Error occured. Check your data and please <b>try again</b>.");
            }
        });
    },
    step4: function (actionUrl) {
        form = $("#step4 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success == 1) {
                OjsJournalSetup.hideAllSteps();
                OjsJournalSetup.prepareStep.step5();
            } else {
                OjsCommon.errorModal("Error occured. Check your data and please <b>try again</b>.");
            }
        });
    },
    step5: function (actionUrl) {
        form = $("#step5 form");
        if (!form.validationEngine('validate')) {
            hasError = true;
            return;
        }
        journalParams = [];
        journalParams.postUrl = actionUrl;
        journalParams.data = form.serializeObject();
        journalParams.data.journalId = OjsJournalSetup.journalId;

        OjsCommon.waitModal();
        $.post(journalParams.postUrl, journalParams.data, function (response) {
            OjsCommon.hideallModals();
            if (response.success == 1) {
{'fraction_non_alphanumeric': 0.13655883194961352, 'fraction_numerical': 0.00620288195438496, 'mean_word_length': 2.1414868105515588, 'pattern_counts': {'":': 12, '<': 19, '<?xml version=': 0, '>': 19, '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': '4439043', 'n_tokens_mistral': 2886, 'n_tokens_neox': 2839, 'n_words': 527}