<commit_before>
var CountdownView = Backbone.View.extend({
    el: '#countdown',
    initialize: function() {
        this.listenTo(this.model, 'countedDown', this.render);
    },

    render: function() {
        var value = this._prettifySeconds(this.model.get('remainingSeconds'));
        this.$el.html(value);
        return this;
    },

    _prettifySeconds: function(seconds) {
        var minutes = parseInt(seconds/60, 10);
        minutes = _.str.pad(minutes, 2, '0');
        seconds = _.str.pad(seconds % 60, 2, '0');
        return minutes+":"+seconds;
    }

});

var ButtonView = Backbone.View.extend({
    tagName: 'button',
    className: 'ctrlButton',
    events: {
        'click': 'start'
    },
    initialize: function(options) {
        this.title = options.title;
        this.duration = options.duration;
    },
    render: function() {
        this.$el.text(this.title);
        return this;
    },
    start: function() {
        this.model.start(this.duration);
    }
});

var CtrlView = Backbone.View.extend({
    el: '#ctrlView',

    initialize: function() {
        this.pomodoroButton = new ButtonView({
            'model': this.model,
            'title': 'start',
            'duration': 25 * 60
        });

        this.shortBreakButton = new ButtonView({
            'model': this.model,
            'title': 'break',
            'duration': 5 * 60
        });

        this.longBreakButton = new ButtonView({
            'model': this.model,
            'title': 'long break',<commit_msg>ButtonView > StartButtonView<commit_after>
var CountdownView = Backbone.View.extend({
    el: '#countdown',
    initialize: function() {
        this.listenTo(this.model, 'countedDown', this.render);
    },

    render: function() {
        var value = this._prettifySeconds(this.model.get('remainingSeconds'));
        this.$el.html(value);
        return this;
    },

    _prettifySeconds: function(seconds) {
        var minutes = parseInt(seconds/60, 10);
        minutes = _.str.pad(minutes, 2, '0');
        seconds = _.str.pad(seconds % 60, 2, '0');
        return minutes+":"+seconds;
    }

});

var StartButtonView = Backbone.View.extend({
    tagName: 'button',
    className: 'ctrlButton',
    events: {
        'click': 'start'
    },
    initialize: function(options) {
        this.title = options.title;
        this.duration = options.duration;
    },
    render: function() {
        this.$el.text(this.title);
        return this;
    },
    start: function() {
        this.model.start(this.duration);
    }
});

var CtrlView = Backbone.View.extend({
    el: '#ctrlView',

    initialize: function() {
        this.pomodoroButton = new StartButtonView({
            'model': this.model,
            'title': 'start',
            'duration': 25 * 60
        });

        this.shortBreakButton = new StartButtonView({
            'model': this.model,
            'title': 'break',
            'duration': 5 * 60
        });

        this.longBreakButton = new StartButtonView({
            'model': this.model,
            'title': 'long break',
{'fraction_non_alphanumeric': 0.14969285483349498, 'fraction_numerical': 0.010992563853863564, 'mean_word_length': 2.1158106747230616, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 4, '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': '5675310', 'n_tokens_mistral': 950, 'n_tokens_neox': 907, 'n_words': 190}