<commit_before>nb.define('input', {
    events: {
        'init': 'oninit',
        'click': 'focus'
    },

    /**
    * Init input
    * @fires 'nb-input_inited'
    */
    oninit: function() {
        var that = this;

        this.data = this.data()
        this.$node = $(this.node);

        if (this.data.type == 'simple'){
            this.$control = this.$node
        } else {
            this.$control = this.$node.find('.nb-input__controller');
        }

        this.disabled = this.$control.prop('disabled');
        this.value = this.$control.val();
        this.focused = false;
        nb.on('nb-input_focusout', function() {
            that.blur();
        });
        this.trigger('nb-input_inited');
    },

    /**
     * Focus the input
     * @fires 'nb-input_focused'
     * @returns {nb.block}
     */
    focus: function() {
        if (this.$node.is('.is-disabled')) {
            return this;
        }

        if (!this.$node.hasClass('nb-input_focus')) {
            nb.trigger('nb-input_focusout');
            this.$node.addClass('nb-input_focus');
            this.focused = true;
            this.$control.get(0).focus();
            this.trigger('nb-input_focused');
            return this;
        }

    },

    /**
     * Blur the input
     * @fires 'nb-input_blured'
     * @returns {nb.block}
     */
    blur: function() {
        this.$node.removeClass('nb-input_focus');
        this.focused = false;
        this.trigger('nb-input_blured');
        return this;
    },

    /**
     * Disables the input
     * @fires 'nb-input_disabled'
     * @returns {nb.block}
     */
    disable: function() {
        this.$node.addClass('is-disabled');
        this.$control.prop('disabled', true);
        this.trigger('nb-input_disabled');
        return this;
    },

    /**
     * Enables the input
     * @fires 'nb-input_enabled'
     * @returns {nb.block}
     */
    enable: function() {
        this.$node.removeClass('is-disabled');
        this.$control.prop('disabled', false);
        this.trigger('nb-input_enabled');
        return this;
    },

    /**
     * Set value of the input
     * @param {String|Object} value
     * @fires 'nb-input_value-setted'
     * @returns {nb.block}
    */
    setValue: function(value) {
        this.value = value;
        this.$control.val(value)
        this.trigger('nb-input_value-setted');
        return this;
    },

    /**
     * Get value of the input
     * @returns {String|Object} value
    */
    getValue: function() {
        return this.value
    },
<commit_msg>#76 nb.input.getValue() returns this.value, not input.value<commit_after>nb.define('input', {
    events: {
        'init': 'oninit',
        'click': 'focus'
    },

    /**
    * Init input
    * @fires 'nb-input_inited'
    */
    oninit: function() {
        var that = this;

        this.data = this.data()
        this.$node = $(this.node);

        if (this.data.type == 'simple'){
            this.$control = this.$node
        } else {
            this.$control = this.$node.find('.nb-input__controller');
        }

        this.disabled = this.$control.prop('disabled');
        this.value = this.$control.val();
        this.focused = false;
        nb.on('nb-input_focusout', function() {
            that.blur();
        });
        this.trigger('nb-input_inited');
    },

    /**
     * Focus the input
     * @fires 'nb-input_focused'
     * @returns {nb.block}
     */
    focus: function() {
        if (this.$node.is('.is-disabled')) {
            return this;
        }

        if (!this.$node.hasClass('nb-input_focus')) {
            nb.trigger('nb-input_focusout');
            this.$node.addClass('nb-input_focus');
            this.focused = true;
            this.$control.get(0).focus();
            this.trigger('nb-input_focused');
            return this;
        }

    },

    /**
     * Blur the input
     * @fires 'nb-input_blured'
     * @returns {nb.block}
     */
    blur: function() {
        this.$node.removeClass('nb-input_focus');
        this.focused = false;
        this.trigger('nb-input_blured');
        return this;
    },

    /**
     * Disables the input
     * @fires 'nb-input_disabled'
     * @returns {nb.block}
     */
    disable: function() {
        this.$node.addClass('is-disabled');
        this.$control.prop('disabled', true);
        this.trigger('nb-input_disabled');
        return this;
    },

    /**
     * Enables the input
     * @fires 'nb-input_enabled'
     * @returns {nb.block}
     */
    enable: function() {
        this.$node.removeClass('is-disabled');
        this.$control.prop('disabled', false);
        this.trigger('nb-input_enabled');
        return this;
    },

    /**
     * Set value of the input
     * @param {String|Object} value
     * @fires 'nb-input_value-setted'
     * @returns {nb.block}
    */
    setValue: function(value) {
        this.value = value;
        this.$control.val(value)
        this.trigger('nb-input_value-setted');
        return this;
    },

    /**
     * Get value of the input
     * @returns {String|Object} value
    */
    getValue: function() {
        // get actual value from <input/> and save it to instance
        this.value = this.$control.val();
        return this.value
    },

{'fraction_non_alphanumeric': 0.16100415251038128, 'fraction_numerical': 0.0007550018875047187, 'mean_word_length': 1.7512980269989615, 'pattern_counts': {'":': 0, '<': 4, '<?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': '2842426', 'n_tokens_mistral': 1654, 'n_tokens_neox': 1602, 'n_words': 291}