<commit_before>﻿require([
         'jquery',
         'jquery-ui-core',
         'bootstrap',
         'validate',
         'validate-bootstrap',
         'bootstrap-datepicker',
         'select2',
         'radioButtonsList',
         'styleInputs',
         'resetInput',

         'BForms/plugins/bforms-jquery/bforms-jquery'
], function () {

    //load i18n external plugins
    if (requireConfig.websiteOptions.locale == 'ro') {
        require([
            'validate-ro',
            'bootstrap-datepicker-ro',
            'select2-ro'
        ]);
    }

    var LoginIndex = function (options) {
        this.options = $.extend(true, {}, options);
    };

    LoginIndex.prototype.init = function () {
        this.$loginForm = $('.js-loginForm');
        this.$registerForm = $('.js-registerForm');

        this.$loginForm.styleInputs(this.options.styleInputs);
        this.$registerForm.styleInputs(this.options.styleInputs);

        this.addHandlers();
    };

    LoginIndex.prototype.addHandlers = function () {
        this.$registerForm.on('click', '.js-registerBtn', $.proxy(this.onRegisterSubmit, this));
    };

    LoginIndex.prototype.onRegisterSubmit = function (e) {
        e.stopPropagation();
        e.preventDefault();

        $.validator.unobtrusive.parse(this.$registerForm);
        var validatedForm = this.$registerForm.validate();

        if (this.$registerForm.valid()) {

            var registerData = this.$registerForm.parseForm();

            $.ajax({
                url: this.options.registerUrl,
                data: JSON.stringify(registerData),
                type: 'POST',
                dataType: 'json',
                contentType: 'application/json; charset=utf-8'
            }).then($.proxy(function (response, status, jqXHR) {
                if (response.Status == 2) {//validation error
                    validatedForm.showErrors(response.Data.Errors);
                } else {

                }
            }, this));
        }
    };

    $(document).ready(function () {
        var ctrl = new LoginIndex(requireConfig.pageOptions);
        ctrl.init();
    });
});<commit_msg>ScrollToError quickfix<commit_after>﻿require([
         'jquery',
         'jquery-ui-core',
         'bootstrap',
         'validate',
         'validate-bootstrap',
         'bootstrap-datepicker',
         'select2',
         'radioButtonsList',
         'styleInputs',
         'resetInput',

         'BForms/plugins/bforms-jquery/bforms-jquery'
], function () {

    //load i18n external plugins
    if (requireConfig.websiteOptions.locale == 'ro') {
        require([
            'validate-ro',
            'bootstrap-datepicker-ro',
            'select2-ro'
        ]);
    }

    var LoginIndex = function (options) {
        this.options = $.extend(true, {}, options);
    };

    LoginIndex.prototype.init = function () {
        this.$loginForm = $('.js-loginForm');
        this.$registerForm = $('.js-registerForm');

        this.$loginForm.styleInputs(this.options.styleInputs);
        this.$registerForm.styleInputs(this.options.styleInputs);

        this.addHandlers();
    };

    LoginIndex.prototype.addHandlers = function () {
        this.$registerForm.on('click', '.js-registerBtn', $.proxy(this.onRegisterSubmit, this));
    };

    LoginIndex.prototype.onRegisterSubmit = function (e) {
        e.stopPropagation();
        e.preventDefault();

        $.validator.unobtrusive.parse(this.$registerForm);
        var validatedForm = this.$registerForm.validate();

        if (this.$registerForm.valid()) {

            var registerData = this.$registerForm.parseForm();

            $.ajax({
                url: this.options.registerUrl,
                data: JSON.stringify(registerData),
                type: 'POST',
                dataType: 'json',
                contentType: 'application/json; charset=utf-8'
            }).then($.proxy(function (response, status, jqXHR) {
                if (response.Status == 2) {//validation error
                    validatedForm.showErrors(response.Data.Errors,true);
                } else {

                }
            }, this));
        }
    };

    $(document).ready(function () {
        var ctrl = new LoginIndex(requireConfig.pageOptions);
        ctrl.init();
    });
});
{'fraction_non_alphanumeric': 0.143686165273909, 'fraction_numerical': 0.002785515320334262, 'mean_word_length': 1.9193766937669376, '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': '4906522', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1144, 'n_words': 181}