<commit_before>define([
    'backbone',
    'underscore',
    'text!js-utils/templates/wizard/wizard.html',
    'jquery-steps'
], function(Backbone, _, template) {

    return Backbone.View.extend({

        template: _.template(template),

        initialize: function(options){
            _.bindAll(this, 'handleStepChange');

            if (options.template) {
                this.template = options.template;
            }

            this.strings = options.strings;
            this.steps = options.steps;
            this.renderOptions = options.renderOptions;

            this.wizardOptions = _.defaults(options.wizardOptions || {}, {
                onStepChanging: this.handleStepChange,
                labels: {
                    finish: this.strings.last,
                    next: this.strings.next,
                    previous: this.strings.prev
                }
            });
        },

        render: function(){
            this.$el.html(this.template({
                renderOptions: this.renderOptions,
                steps: this.steps,
                strings: this.strings
            }));

            this.$wizard = this.$('.wizard');

            this.$wizard.steps(this.wizardOptions);

            _.each(this.steps, function(step){
                var options = step.options || {};

                step.view = new step.constructor(_.defaults({
                    el: this.$('.'+ step.class)
                }, options));
            }, this);
        },

        getStep: function(index) {
            return this.steps[index];
        },

        getCurrentStep: function() {
            return this.getStep(this.$wizard.steps('getCurrentIndex'));
        },
<commit_msg>[javascript-utils] (CCUK-2411)  inserting action buttons after the steps row [rev:alex.scown]<commit_after>define([
    'backbone',
    'underscore',
    'text!js-utils/templates/wizard/wizard.html',
    'jquery-steps'
], function(Backbone, _, template) {

    return Backbone.View.extend({

        template: _.template(template),
        columnClass: 'span12',

        initialize: function(options){
            _.bindAll(this, 'handleStepChange');

            if (options.template) {
                this.template = options.template;
            }

            if(options.columnClass) {
                this.columnClass = options.columnClass;
            }

            this.strings = options.strings;
            this.steps = options.steps;
            this.renderOptions = options.renderOptions;

            this.wizardOptions = _.defaults(options.wizardOptions || {}, {
                onStepChanging: this.handleStepChange,
                labels: {
                    finish: this.strings.last,
                    next: this.strings.next,
                    previous: this.strings.prev
                }
            });
        },

        render: function(){
            this.$el.html(this.template({
                renderOptions: this.renderOptions,
                steps: this.steps,
                strings: this.strings
            }));

            this.$wizard = this.$('.wizard');

            this.$wizard.steps(this.wizardOptions);

            this.$wizard.find('.actions').insertAfter(this.$wizard.find('.steps'));

            this.$wizard.find('.steps').addClass(this.columnClass);
            this.$wizard.find('.actions').addClass(this.columnClass);
            this.$wizard.find('.content').addClass(this.columnClass);

            _.each(this.steps, function(step){
                var options = step.options || {};

                step.view = new step.constructor(_.defaults({
                    el: this.$('.'+ step.class)
                }, options));
            }, this);
        },

        getStep: function(index) {
            return this.steps[index];
        },

        getCurrentStep: function() {
            return this.getStep(this.$wizard.steps('getCurrentIndex'));
        },

{'fraction_non_alphanumeric': 0.12931034482758622, 'fraction_numerical': 0.0015212981744421906, 'mean_word_length': 1.5784313725490196, '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': '131952', 'n_tokens_mistral': 1039, 'n_tokens_neox': 977, 'n_words': 156}