<commit_before>import React, {Component, PropTypes} from "react";

// actions
import ImageActions from '../../actions/ImageActions';

// stores
import ImageStore from '../../stores/ImageStore';
import UserStore from '../../stores/UserStore';

// components
import AuthorityButtonCreate from '../common/authority/AuthorityButtonCreate.react.js';
import AuthorityButtonDelete from '../common/authority/AuthorityButtonDelete.react.js';

// constatns
import Constants from '../../constants/NoteeConstants';

// utils
import AuthorityUtil from '../../utils/AuthorityUtil';

export default class ImageSection extends Component {

    constructor(props) {
        super(props);
        this.state = {
            images: [],
            upload_file: null,
            tap_image: "",
            now_user: ""
        };

        // imageSection
        this.setImages = this.setImages.bind(this);
        this.clickImage = this.clickImage.bind(this);
        this.uploadImage = this.uploadImage.bind(this);
        this.deleteImage = this.deleteImage.bind(this);

        // eventemit
        this.deleteSuccessed = this.deleteSuccessed.bind(this);

        // ajax
        this.ajaxLoaded = this.ajaxLoaded.bind(this);
        this.ajaxNowUserLoaded = this.ajaxNowUserLoaded.bind(this);

        // handles
        this.handleChangeImage = this.handleChangeImage.bind(this);
    }

    componentDidMount() {
        ImageStore.addChangeListener(Constants.IMAGE_CREATE, this.setImages);
        ImageStore.addChangeListener(Constants.IMAGE_DELETE, this.setImages);
    }

    componentWillMount() {
        ImageStore.loadImages(this.ajaxLoaded);
        UserStore.loadUserByToken(this.ajaxNowUserLoaded);
    }

    ajaxLoaded(content){<commit_msg>integrate eventemitter stores -> EventUtil file & add remove Image EventListener<commit_after>import React, {Component, PropTypes} from "react";

// actions
import ImageActions from '../../actions/ImageActions';

// stores
import ImageStore from '../../stores/ImageStore';
import UserStore from '../../stores/UserStore';

// components
import AuthorityButtonCreate from '../common/authority/AuthorityButtonCreate.react.js';
import AuthorityButtonDelete from '../common/authority/AuthorityButtonDelete.react.js';

// constatns
import Constants from '../../constants/NoteeConstants';

// utils
import AuthorityUtil from '../../utils/AuthorityUtil';
import EventUtil from '../../utils/EventUtil';

export default class ImageSection extends Component {

    constructor(props) {
        super(props);
        this.state = {
            images: [],
            upload_file: null,
            tap_image: "",
            now_user: ""
        };

        // imageSection
        this.setImages = this.setImages.bind(this);
        this.clickImage = this.clickImage.bind(this);
        this.uploadImage = this.uploadImage.bind(this);
        this.deleteImage = this.deleteImage.bind(this);

        // eventemit
        this.deleteSuccessed = this.deleteSuccessed.bind(this);

        // ajax
        this.ajaxLoaded = this.ajaxLoaded.bind(this);
        this.ajaxNowUserLoaded = this.ajaxNowUserLoaded.bind(this);

        // handles
        this.handleChangeImage = this.handleChangeImage.bind(this);
    }

    componentDidMount() {
        EventUtil.addChangeListener(Constants.IMAGE_CREATE, this.setImages);
        EventUtil.addChangeListener(Constants.IMAGE_DELETE, this.setImages);
    }

    componentWillUnmount(){
        EventUtil.removeChangeListener(Constants.IMAGE_CREATE, this.setImages);
        EventUtil.removeChangeListener(Constants.IMAGE_DELETE, this.setImages);
    }

    componentWillMount() {
        ImageStore.loadImages(this.ajaxLoaded);
        UserStore.loadUserByToken(this.ajaxNowUserLoaded);
    }

    ajaxLoaded(content){
{'fraction_non_alphanumeric': 0.12166798627606229, 'fraction_numerical': 0.0, 'mean_word_length': 2.9072164948453607, 'pattern_counts': {'":': 0, '<': 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': '1371708', 'n_tokens_mistral': 1012, 'n_tokens_neox': 1006, 'n_words': 180}