<commit_before><polymer-element name="ceci-button" attributes="volume playsound fontsize textcolor buttoncolor label value" value="Press" extends="ceci-element"
  textcolor="#ffffff"
  fontsize="18"
  volume=".5"
  playsound="true"
  buttoncolor="#3fb58e">
  <ceci-definition>
    {
      "tags": ["button", "click", "tap"],
      "thumbnail": "./thumbnail.png",
      "description": "Responds to your clicks and taps.",
      "name": "Button",
      "broadcasts": {
        "click": {
          "label": "Press",
          "description": "Occurs when button is clicked.",
          "default": true
        }
      },
      "listeners": {},
      "attributes": {
        "label": {
          "label": "Label",
          "description": "Text shown on the button.",
          "editable": "text",
          "listener": true
        },
        "value": {
          "label": "Broadcast Value",
          "description": "Value sent by the button.",
          "editable": "text"
        },
        "textcolor": {
          "label": "Text Color",
          "description": "Color of the text on the button's label.",
          "editable": "color"
        },
        "buttoncolor": {
          "label": "Button Color",
          "description": "Background color of the button.",
          "editable": "color",
          "listener": true
        },
        "fontsize": {
          "label": "Font Size",
          "description": "Button label font size.",
          "editable": "range",
          "min" : "4",
          "max" : "40"
        },
        "playsound": {
          "label": "Play Sound when Pressed",
          "description": "Play a sound when pressed.",
          "editable": "boolean"
        },
        "volume": {
          "label": "Volume",
          "editable": "range",
          "min" : 0,
          "max" : 1,
          "step" : ".01"
        }
      }
    }
  </ceci-definition>
  <template>
    <link rel="stylesheet" href="component.css"></link>
    <div id="buttonwrapper" style="font-size: {{fontsize}}px; background: {{buttoncolor}};" on-ceci-pressdown="{{pressdown}}" on-ceci-pressup="{{pressup}}" class="button-wrapper">
      &nbsp;
      <div class="overlay active-overlay"></div>
      <div id="button" style="color: {{textcolor}};">{{label}}</div>
      <div class="bottom"></div>
    </div>
    <shadow></shadow>
    <!-- Button click sound courtesy of http://www.freesfx.co.uk -->
  </template>
  <script>
    Polymer('ceci-button', {
      ready: function () {
        this.super();
        this.loadSound("tap","sounds/tap.mp3");
        var t = this;

        function resetButtons() {
          t.resetState();
        }

        t.addEventListener('mouseout', resetButtons);
      },
      attached : function(){
        this.super();
      },
      pressdown : function(){
        this.super();
        if(this.playsound === "true") {
          this.playSound("tap",this.volume);
        }
        this.$.buttonwrapper.classList.add("pressdown");
        this.broadcast('click', this.getAttribute('value'));
      },
      pressup : function(){
        this.$.buttonwrapper.classList.remove("pressdown");
        this.$.buttonwrapper.classList.remove("fade");
        this.$.buttonwrapper.offsetWidth = this.$.buttonwrapper.offsetWidth;
        this.$.buttonwrapper.classList.add("fade");
      },
      resetState : function(){
        this.$.buttonwrapper.classList.remove("fade");
        this.$.buttonwrapper.classList.remove("pressdown");
      }
    });
  </script>
</polymer-element><commit_msg>fix #2235 - pressdown state sometimes not turn off<commit_after><polymer-element name="ceci-button" attributes="volume playsound fontsize textcolor buttoncolor label value" value="Press" extends="ceci-element"
  textcolor="#ffffff"
  fontsize="18"
  volume=".5"
  playsound="true"
  buttoncolor="#3fb58e">
  <ceci-definition>
    {
      "tags": ["button", "click", "tap"],
      "thumbnail": "./thumbnail.png",
      "description": "Responds to your clicks and taps.",
      "name": "Button",
      "broadcasts": {
        "click": {
          "label": "Press",
          "description": "Occurs when button is clicked.",
          "default": true
        }
      },
      "listeners": {},
      "attributes": {
        "label": {
          "label": "Label",
          "description": "Text shown on the button.",
          "editable": "text",
          "listener": true
        },
        "value": {
          "label": "Broadcast Value",
          "description": "Value sent by the button.",
          "editable": "text"
        },
        "textcolor": {
          "label": "Text Color",
          "description": "Color of the text on the button's label.",
          "editable": "color"
        },
        "buttoncolor": {
          "label": "Button Color",
          "description": "Background color of the button.",
          "editable": "color",
          "listener": true
        },
        "fontsize": {
          "label": "Font Size",
          "description": "Button label font size.",
          "editable": "range",
          "min" : "4",
          "max" : "40"
        },
        "playsound": {
          "label": "Play Sound when Pressed",
          "description": "Play a sound when pressed.",
          "editable": "boolean"
        },
        "volume": {
          "label": "Volume",
          "editable": "range",
          "min" : 0,
          "max" : 1,
          "step" : ".01"
        }
      }
    }
  </ceci-definition>
  <template>
    <link rel="stylesheet" href="component.css"></link>
    <div id="buttonwrapper" style="font-size: {{fontsize}}px; background: {{buttoncolor}};" on-ceci-pressdown="{{pressdown}}" on-ceci-pressup="{{pressup}}" class="button-wrapper">
      &nbsp;
      <div class="overlay active-overlay"></div>
      <div id="button" style="color: {{textcolor}};">{{label}}</div>
      <div class="bottom"></div>
    </div>
    <shadow></shadow>
    <!-- Button click sound courtesy of http://www.freesfx.co.uk -->
  </template>
  <script>
    Polymer('ceci-button', {
      ready: function () {
        this.super();
        this.loadSound("tap","sounds/tap.mp3");
        this.addEventListener('mouseout', this.resetState);
      },
      attached : function(){
        this.super();
      },
      pressdown : function(){
        this.super();
        if(this.playsound === "true") {
          this.playSound("tap",this.volume);
        }
        this.$.buttonwrapper.classList.add("pressdown");
        this.broadcast('click', this.getAttribute('value'));
      },
      pressup : function(){
        this.$.buttonwrapper.classList.remove("pressdown");
        this.$.buttonwrapper.classList.remove("fade");
        this.$.buttonwrapper.offsetWidth = this.$.buttonwrapper.offsetWidth;
        this.$.buttonwrapper.classList.add("fade");
      },
      resetState : function(){
        this.$.buttonwrapper.classList.remove("fade");
        this.$.buttonwrapper.classList.remove("pressdown");
      }
    });
  </script>
</polymer-element>
{'fraction_non_alphanumeric': 0.17719173200285104, 'fraction_numerical': 0.004561653599429794, 'mean_word_length': 2.1223854027592344, 'pattern_counts': {'":': 80, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7056596', 'n_tokens_mistral': 2049, 'n_tokens_neox': 2014, 'n_words': 424}