<commit_before>import React from 'react';
import $ from 'jquery';

import SaveButton from './SaveButton';

const AdminNicety = React.createClass({
    getInitialState: function() {
        return {
            text: this.props.nicety.text,
            noSave: true
        };
    },

    saveNicety: function() {
        const data = {
            text: this.state.text,
            author_id: this.props.nicety.author_id,
            target_id: this.props.target_id
        }
        $.ajax({
            url: this.props.admin_edit_api,
            data: data,
            dataType: 'json',
            type: 'POST',
            cache: false,
            success: function() {
                this.setState({noSave: true});
            }.bind(this),
            error: function(xhr, status, err) {
                console.log(err)
            }
        });
    },

    textareaChange: function() {
        this.setState({ text: event.target.value , noSave: false });<commit_msg>Add explicit event argument to handler<commit_after>import React from 'react';
import $ from 'jquery';

import SaveButton from './SaveButton';

const AdminNicety = React.createClass({
    getInitialState: function() {
        return {
            text: this.props.nicety.text,
            noSave: true
        };
    },

    saveNicety: function() {
        const data = {
            text: this.state.text,
            author_id: this.props.nicety.author_id,
            target_id: this.props.target_id
        }
        $.ajax({
            url: this.props.admin_edit_api,
            data: data,
            dataType: 'json',
            type: 'POST',
            cache: false,
            success: function() {
                this.setState({noSave: true});
            }.bind(this),
            error: function(xhr, status, err) {
                console.log(err)
            }
        });
    },

    textareaChange: function(event) {
        this.setState({ text: event.target.value , noSave: false });
{'fraction_non_alphanumeric': 0.11971830985915492, 'fraction_numerical': 0.0, 'mean_word_length': 1.610236220472441, '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': '6789378', 'n_tokens_mistral': 560, 'n_tokens_neox': 547, 'n_words': 123}