<commit_before>
var TipCalcPanel = flocks.createClass({

  update: function() {
    var NewBill = parseFloat(document.getElementById('billAmount').value);
    this.fset('bill', NewBill);
    this.fset('total', NewBill); // TEMPORARY AND WRONG
  },

  render: function() {

    return (

      <div id="panel">

        <label id="amt" htmlFor="billAmount">
          Bill amount: $<input id="billAmount" onChange={this.update}/>
        </label>

        <div id="howHappy">
          <input type="button" value={"25%"}/>
          <input type="button" value={"20%"}/>
          <input type="button" value={"15%"}/>
        </div>

        <div id="result">
          Total: ${this.fctx.total}
        </div>

      </div>

    );

  }

});
<commit_msg>Basic functional app<commit_after>
var TipCalcPanel = flocks.createClass({

  fmt: function(Tip) {
    return ((this.fctx.bill || 0) * Tip).toFixed(2);
  },

  setTotal: function(Becomes) {
    var fset = this.fset,
        fmt  = this.fmt;
    return function() { fset('total', fmt(Becomes)); };
  },

  update: function() {
    var NewBill = parseFloat(document.getElementById('billAmount').value);
    this.fset('bill', NewBill);
    this.fset('total', '');
  },

  render: function() {

    return (

      <div id="panel">

        <label id="amt" htmlFor="billAmount">
          Bill amount: $<input id="billAmount" onChange={this.update}/>
        </label>

        <div id="howHappy">
          <input type="button" value={"25%"} onClick={this.setTotal(1.25)}/>
          <input type="button" value={"20%"} onClick={this.setTotal(1.20)}/>
          <input type="button" value={"15%"} onClick={this.setTotal(1.15)}/>
        </div>

        <div id="result">
          Total: ${this.fctx.total}
        </div>

      </div>

    );

  }

});

{'fraction_non_alphanumeric': 0.19034406215316316, 'fraction_numerical': 0.012763596004439512, 'mean_word_length': 2.4739884393063583, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '4844833', 'n_tokens_mistral': 630, 'n_tokens_neox': 581, 'n_words': 114}