<commit_before><app xmlns="http://bender.igel.co.jp" xmlns:f="http://bender.igel.co.jp/f"
  xmlns:svg="http://www.w3.org/2000/svg">
  <title>SVG Button component test</title>

  <component id="svg-button">
    <view>
      <svg:rect id="rect" width="100" height="100" fill="#08f"/>
    </view>
    <watch>
      <get view="rect" dom-event="mousedown"/>
      <get view="rect" dom-event="touchstart"/>
      <set>
        this.views.rect.setAttribute("fill", "#f80");
      </set>
      <watch>
        <get view="rect" dom-event="mouseup"/>
        <get view="rect" dom-event="touchend"/>
        <set>
          this.views.rect.setAttribute("fill", "#08f");
          setTimeout((function() { bender.notify(this, "@pushed") }).bind(this),
            0);
          flexo.log(value);
        </set>
      </watch>
      <watch>
        <get view="rect" dom-event="mouseout"/>
        <get view="rect" dom-event="touchcancel"/>
        <set>
          this.views.rect.setAttribute("fill", "#08f");
        </set>
      </watch>
    </watch>
  </component>

  <view>
    <component ref="svg-button" id="button"/>
  </view>

  <watch>
    <get view="button" event="@pushed">
      alert("button was pushed!");
    </get>
  </watch>

</app><commit_msg>Enable/disable SVG button<commit_after><app xmlns="http://bender.igel.co.jp" xmlns:b="http://bender.igel.co.jp/b"
  xmlns:svg="http://www.w3.org/2000/svg">
  <title>SVG Button component test</title>

  <component id="svg-button" b:enabled="true">
    <view>
      <svg:rect id="rect" width="100" height="100"/>
    </view>

    <watch>
      <get property="enabled"/>
      <set view="rect" attr="fill">
        return value ? "#08f" : "#ccc";
      </set>
    </watch>

    <watch>
      <get view="rect" dom-event="mousedown"/>
      <get view="rect" dom-event="touchstart"/>
      <set>
        if (this.enabled) {
          this.views.rect.setAttribute("fill", "#f80");
          this.__down = true;
        }
      </set>
      <watch>
        <get view="rect" dom-event="mouseup"/>
        <get view="rect" dom-event="touchend"/>
        <set>
          if (this.__down) {
            this.views.rect.setAttribute("fill", "#08f");
            setTimeout((function() { bender.notify(this, "@pushed") })
                .bind(this), 0);
            delete this.__down;
          }
        </set>
      </watch>
      <watch>
        <get view="rect" dom-event="mouseout"/>
        <get view="rect" dom-event="touchcancel"/>
        <set>
          if (this.__down) {
            this.views.rect.setAttribute("fill", "#08f");
            delete this.__down;
          }
        </set>
      </watch>
    </watch>
  </component>

  <view>
    <component ref="svg-button" id="button"/>
  </view>

  <watch>
    <get view="button" event="@pushed">
      alert("button was pushed!");
    </get>
  </watch>

</app>
{'fraction_non_alphanumeric': 0.2013986013986014, 'fraction_numerical': 0.013986013986013986, 'mean_word_length': 2.168327796234773, 'pattern_counts': {'":': 0, '<': 76, '<?xml version=': 0, '>': 76, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, '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': '5253807', 'n_tokens_mistral': 997, 'n_tokens_neox': 959, 'n_words': 174}