<commit_before>(function($) {
    var Cwizard = function(element, options)  {
        this.initialize(element, options);
    };

    Cwizard.prototype = {
        constructor: Cwizard,

        initialize: function(element, options) {
            this.$element = $(element);
            this.options = $.extend({}, $.fn.cwizard.defaults, options);
            this.$element.carousel({pause: true});
            this.$element.carousel("pause");
            this.listen();
            this.titles = {};
            $('input:text:visible:first').focus();
        },

        listen: function() {
            $(".next").on("click", $.proxy(this.next, this));
            $(".prev").on("click", $.proxy(this.prev, this));
            $(".submit").on("click", $.proxy(this.submit, this));
        },

        get_current_step_id: function() {
            return $(".item.active").attr("id");
        },

        get_current_title: function() {
            return $(".modal-header").find("small").html();
        },

        set_current_title: function(title) {
            $(".modal-header").find("small").html(title);
        },

        post: function(last) {
            var $form = (this.options.formid) ? $('#' + this.options.formid) : $('form');
            var data = $form.serialize() + "&stepid=" + this.get_current_step_id();

            $.ajax({
                type: 'POST', url: $form.attr("action"), data: data, global: false
            }).done($.proxy(function(resp) {
                if (!last) {
                    $('input:text:visible:first').focus();
                    this.set_current_title(resp.title);
                    if (this.options.transition_callbacks[resp.stepid] !== undefined) {
                        this.options.transition_callbacks[resp.stepid]();
                    }
                    this.$element.carousel('next');
                } else {
                    $("#modalbox").modal('hide');
                    if (this.options.success_callback !== undefined) {
                        this.options.success_callback(resp);
                    } else {
                        window.location.reload();
                    }
                }
            }, this)).fail($.proxy(function(jqxhr) {
                var resp = $.parseJSON(jqxhr.responseText);
                if (resp.stepid !== undefined) {
                    var stepid = resp.stepid;
                    display_form_errors("step" + stepid, resp);
                    if (this.options.error_callbacks[stepid] !== undefined) {
                        this.options.error_callbacks[stepid]();
                    }
                    $('input:text:visible:first').focus();
                    if (resp.respmsg) {
                        $(".modal-body").prepend(build_error_alert(resp.respmsg));
                    }
                    return;
                }
                $(".modal-body").prepend(build_error_alert(resp));
            }, this));
        },

        update_buttons: function() {
            $('.bset.active').removeClass("active");
            $("#" + $(".item.active").attr("id") + "_buttons").addClass("active");
        },

        next: function(evt) {
            evt.preventDefault();
            var step_id = this.get_current_step_id();
            this.titles[step_id] = this.get_current_title();
            this.$element.on('slid.bs.carousel', this.update_buttons);
            this.post(false);
        },

        prev: function(evt) {
            evt.preventDefault();
            this.$element.on('slid.bs.carousel', this.update_buttons);<commit_msg>Set the overflow property using JS...<commit_after>(function($) {
    var Cwizard = function(element, options)  {
        this.initialize(element, options);
    };

    Cwizard.prototype = {
        constructor: Cwizard,

        initialize: function(element, options) {
            this.$element = $(element);
            this.options = $.extend({}, $.fn.cwizard.defaults, options);
            this.$element.carousel({pause: true});
            this.$element.carousel("pause");
            this.listen();
            this.titles = {};
            $('input:text:visible:first').focus();
        },

        listen: function() {
            $(".next").on("click", $.proxy(this.next, this));
            $(".prev").on("click", $.proxy(this.prev, this));
            $(".submit").on("click", $.proxy(this.submit, this));
        },

        get_current_step_id: function() {
            return $(".item.active").attr("id");
        },

        get_current_title: function() {
            return $(".modal-header").find("small").html();
        },

        set_current_title: function(title) {
            $(".modal-header").find("small").html(title);
        },

        post: function(last) {
            var $form = (this.options.formid) ? $('#' + this.options.formid) : $('form');
            var data = $form.serialize() + "&stepid=" + this.get_current_step_id();

            $.ajax({
                type: 'POST', url: $form.attr("action"), data: data, global: false
            }).done($.proxy(function(resp) {
                if (!last) {
                    $('input:text:visible:first').focus();
                    this.set_current_title(resp.title);
                    if (this.options.transition_callbacks[resp.stepid] !== undefined) {
                        this.options.transition_callbacks[resp.stepid]();
                    }
                    $(".carousel-inner").css("overflow", "hidden");
                    this.$element.carousel('next');
                } else {
                    $("#modalbox").modal('hide');
                    if (this.options.success_callback !== undefined) {
                        this.options.success_callback(resp);
                    } else {
                        window.location.reload();
                    }
                }
            }, this)).fail($.proxy(function(jqxhr) {
                var resp = $.parseJSON(jqxhr.responseText);
                if (resp.stepid !== undefined) {
                    var stepid = resp.stepid;
                    display_form_errors("step" + stepid, resp);
                    if (this.options.error_callbacks[stepid] !== undefined) {
                        this.options.error_callbacks[stepid]();
                    }
                    $('input:text:visible:first').focus();
                    if (resp.respmsg) {
                        $(".modal-body").prepend(build_error_alert(resp.respmsg));
                    }
                    return;
                }
                $(".modal-body").prepend(build_error_alert(resp));
            }, this));
        },

        update_buttons: function() {
            $(".carousel-inner").css("overflow", "visible");
            $('.bset.active').removeClass("active");
            $("#" + $(".item.active").attr("id") + "_buttons").addClass("active");
        },

        next: function(evt) {
            evt.preventDefault();
            var step_id = this.get_current_step_id();
            this.titles[step_id] = this.get_current_title();
            this.$element.on('slid.bs.carousel', this.update_buttons);
            this.post(false);
        },

        prev: function(evt) {
            evt.preventDefault();
            this.$element.on('slid.bs.carousel', this.update_buttons);
            $(".carousel-inner").css("overflow", "hidden");
{'fraction_non_alphanumeric': 0.1653840961252869, 'fraction_numerical': 0.0, 'mean_word_length': 1.5740097289784574, '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': '2475006', 'n_tokens_mistral': 2000, 'n_tokens_neox': 1928, 'n_words': 272}