<commit_before><!--
Copyright 2013 The Toolkitchen Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<element name="tk-abstract-editor">
  <script>
    Toolkit.register(this, {
      property: null,
      liveValue: null,
      propertyChanged: function() {
        Toolkit.bindProperties(this, 'liveValue', this.property.obj, 
          this.property.name);
      },
      liveValueChanged: function() {
        if (this.liveValue !== this.property.obj[this.property.name]) {
          //this.send('property-changed');
        }
      },
      inputChange: function(e) {
        this.liveValue = e.target.value;
        this.send('property-changed');
      },
      focus: function() {
        if (this.$.input) {
          this.$.input.focus();
        }
      }
    });
  </script>
</element>

<element name="tk-string-editor" extends="tk-abstract-editor">
  <template>
    <style>
      @host {
        * {
          display: inline-block;
          width: 95%;
          position: relative;
        }
      }
      input {
        padding: 6px;
        margin-left: 0;
        width: 100%; 
        box-sizing: border-box;
        -webkit-user-select: all; 
        -moz-user-select: all;
        user-select: all;
      }
    </style>
    <input id="input" type="{{type}}" value="{{inputValue}}" on-change="inputChange">
  </template>
  <script>
    Toolkit.register(this, {
      type: "text",
      liveValueChanged: function() {
        this.inputValue = this.liveValue;
        this.super();
      }
    });
  </script>
</element>

<element name="tk-color-editor" extends="tk-string-editor">
  <script>
    Toolkit.register(this, {
      type: 'color',
      ready: function() {
        // box-sizing: border-box doesn't play nice with color type inputs
        this.$.input.style.boxSizing = 'content-box';
        this.$.input.style.width = '95%';
        this.$.input.style.padding = '5px';
        // TODO(dfreedm): Workaround for http://crbug.com/234801, colorpicker
        // does not update swatch when in shadowdom because of focus issues
        this.$.input.tabindex = -1;<commit_msg>- send 'property-change' via inputChange method rather than liveValueChanged.<commit_after><!--
Copyright 2013 The Toolkitchen Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<element name="tk-abstract-editor">
  <script>
    Toolkit.register(this, {
      property: null,
      liveValue: null,
      propertyChanged: function() {
        Toolkit.bindProperties(this, 'liveValue', this.property.obj, 
          this.property.name);
      },
      inputChange: function(e) {
        this.liveValue = e.target.value;
        this.send('property-changed');
      },
      focus: function() {
        if (this.$.input) {
          this.$.input.focus();
        }
      }
    });
  </script>
</element>

<element name="tk-string-editor" extends="tk-abstract-editor">
  <template>
    <style>
      @host {
        * {
          display: inline-block;
          width: 95%;
          position: relative;
        }
      }
      input {
        padding: 6px;
        margin-left: 0;
        width: 100%; 
        box-sizing: border-box;
        -webkit-user-select: all; 
        -moz-user-select: all;
        user-select: all;
      }
    </style>
    <input id="input" type="{{type}}" value="{{inputValue}}" on-change="inputChange">
  </template>
  <script>
    Toolkit.register(this, {
      type: "text",
      liveValueChanged: function() {
        this.inputValue = this.liveValue;
      }
    });
  </script>
</element>

<element name="tk-color-editor" extends="tk-string-editor">
  <script>
    Toolkit.register(this, {
      type: 'color',
      ready: function() {
        // box-sizing: border-box doesn't play nice with color type inputs
        this.$.input.style.boxSizing = 'content-box';
        this.$.input.style.width = '95%';
        this.$.input.style.padding = '5px';
        // TODO(dfreedm): Workaround for http://crbug.com/234801, colorpicker
        // does not update swatch when in shadowdom because of focus issues
        this.$.input.tabindex = -1;
{'fraction_non_alphanumeric': 0.14605418138987045, 'fraction_numerical': 0.009893992932862191, 'mean_word_length': 2.1405325443786984, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '2714759', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1275, 'n_words': 294}