<commit_before>/**
 * @jsx React.DOM
 */

(function($) {

  var SearchBox = React.createClass({
    search: function() {
      this.props.onSearch({
        term: this.refs.term.getDOMNode().value.trim()
      });
    },
    render: function() {
      return (
        <input type="text" placeholder="Search..."
          onKeyUp={_.debounce(this.search, 250)} ref="term" />
      );
    }
  });

  var Charity = React.createClass({
    select: function() {
      this.props.onSelect({ ein: this.props.data.ein });
    },
    render: function() {
      return (
        <li onClick={this.select}>{this.props.data.charity_name}</li>
      )
    }
  });

  var CharityList = React.createClass({
    render: function() {
      var self = this;
      var nodes = _.map(this.props.data, function(charity) {
        return <Charity key={charity.ein} data={charity} onSelect={self.props.onSelect} />;
      });
      return (
        <ul>
          {nodes}
        </ul>
      )
    }
  });

  var Snippet = React.createClass({
    select: function() {
      $("#snippet").select();
    },
    render: function() {
      var tmpl = _.template($("#tmpl-snippet").html())({
        ein: this.props.ein == '' ? "362423707" : this.props.ein
      }).replace(/&lt;/g, '<').replace(/&gt;/g, '>');

      return (
        <textarea id="snippet" rows="2" readOnly onClick={this.select}>
          {tmpl}
        </textarea>
      )
    }
  })

  var CharitySelector = React.createClass({
    getInitialState: function() {
      return {
        data: [],
        selected: []
      };
    },<commit_msg>react doesn't like textarea children<commit_after>/**
 * @jsx React.DOM
 */

(function($) {

  var SearchBox = React.createClass({
    search: function() {
      this.props.onSearch({
        term: this.refs.term.getDOMNode().value.trim()
      });
    },
    render: function() {
      return (
        <input type="text" placeholder="Search..."
          onKeyUp={_.debounce(this.search, 250)} ref="term" />
      );
    }
  });

  var Charity = React.createClass({
    select: function() {
      this.props.onSelect({ ein: this.props.data.ein });
    },
    render: function() {
      return (
        <li onClick={this.select}>{this.props.data.charity_name}</li>
      )
    }
  });

  var CharityList = React.createClass({
    render: function() {
      var self = this;
      var nodes = _.map(this.props.data, function(charity) {
        return <Charity key={charity.ein} data={charity} onSelect={self.props.onSelect} />;
      });
      return (
        <ul>
          {nodes}
        </ul>
      )
    }
  });

  var Snippet = React.createClass({
    select: function() {
      $("#snippet").select();
    },
    render: function() {
      var tmpl = _.template($("#tmpl-snippet").html())({
        ein: this.props.ein == '' ? "362423707" : this.props.ein
      }).replace(/&lt;/g, '<').replace(/&gt;/g, '>');
      tmpl = _.map(tmpl.trim().split('\n'), function(l) {
        return l.trim()
      }).join('\n');

      return (
        <textarea id="snippet" rows="2" readOnly onClick={this.select} value={tmpl}>
        </textarea>
      )
    }
  })

  var CharitySelector = React.createClass({
    getInitialState: function() {
      return {
        data: [],
        selected: []
      };
    },
{'fraction_non_alphanumeric': 0.18677986658580958, 'fraction_numerical': 0.007883565797453002, 'mean_word_length': 2.088951310861423, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '3890848', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1073, 'n_words': 186}