<commit_before>"use strict";

//*------------------------------------------------------------------*
var React = require('react');
var LocalStorageMixin = require('react-localstorage');
var TimerMixin = require('react-timer-mixin');
var ReactCSSTransitionGroup = require('react-addons-css-transition-group');

var BootstrapButton = require('react-bootstrap/lib/Button');
var BootstrapFormGroup = require('react-bootstrap/lib/FormGroup');
var BootstrapFormControl = require('react-bootstrap/lib/FormControl');

var EmojiSpritesFile = require('../assets/emojione.sprites.png');
var Emoji = require('react-emojione');

require("./gxaFeedback.css");

//*------------------------------------------------------------------*

var FeedbackPersistence = function createFeedbackComponent(FeedbackUIComponent){
  return (
    React.createClass({
      displayName: 'AtlasGXAFeedbackForm',
      mixins: [LocalStorageMixin],

      propTypes: {
        collectionCallback: React.PropTypes.func.isRequired
      },

      getInitialState: function() {
        return {
          created : new Date().toISOString(),
          shownTimes : 0,
          show : true
            };
      },

      _shouldShow: function () {
        var timeDiff = Math.abs(new Date().getTime() - new Date(this.state.created).getTime());
        var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));

        return this.state.show && diffDays >0 && this.state.shownTimes < 50;
      },

      _hide: function () {
        this.setState({show: false});
      },

      _complete : function (userResponse, optionalUserComment) {
        this.setState({show: false});
        this.props.collectionCallback.apply(this, arguments);
      },


      render: function () {
        var it = this._shouldShow()
                  ? <FeedbackUIComponent key={"box"} onComplete={this._complete} onRequestHide={this._hide} />
                  : <div key="nullKey" />;
        return (
          <ReactCSSTransitionGroup transitionName="feedbackBoxTransitionWrapper" transitionEnterTimeout={500} transitionLeaveTimeout={1000} >
            {it}
          </ReactCSSTransitionGroup>

        );
      },


      componentDidMount: function () {
        if(this._shouldShow()){
          this.setState(function(previousState) {
            return {shownTimes: previousState.shownTimes+1};
          });
        }
      }
    })
  );
}
<commit_msg>Change the title of the feedback button, so we can collect it all over again. Append the date to the comment so that they do not aggregate in GoogleAnalytics.<commit_after>"use strict";

//*------------------------------------------------------------------*
var React = require('react');
var LocalStorageMixin = require('react-localstorage');
var TimerMixin = require('react-timer-mixin');
var ReactCSSTransitionGroup = require('react-addons-css-transition-group');

var BootstrapButton = require('react-bootstrap/lib/Button');
var BootstrapFormGroup = require('react-bootstrap/lib/FormGroup');
var BootstrapFormControl = require('react-bootstrap/lib/FormControl');

var EmojiSpritesFile = require('../assets/emojione.sprites.png');
var Emoji = require('react-emojione');

require("./gxaFeedback.css");

//*------------------------------------------------------------------*

var FeedbackPersistence = function createFeedbackComponent(FeedbackUIComponent){
  return (
    React.createClass({
      displayName: 'ExpressionAtlasFeedbackForm',
      mixins: [LocalStorageMixin],

      propTypes: {
        collectionCallback: React.PropTypes.func.isRequired
      },

      getInitialState: function() {
        return {
          created : new Date().toISOString(),
          shownTimes : 0,
          show : true
            };
      },

      _shouldShow: function () {
        var timeDiff = Math.abs(new Date().getTime() - new Date(this.state.created).getTime());
        var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));

        return this.state.show && diffDays >0 && this.state.shownTimes < 50;
      },

      _hide: function () {
        this.setState({show: false});
      },

      _complete : function (userResponse, optionalUserComment) {
        this.setState({show: false});
        this.props.collectionCallback(userResponse, new Date().toISOString()+(optionalUserComment||""));
      },


      render: function () {
        var it = this._shouldShow()
                  ? <FeedbackUIComponent key={"box"} onComplete={this._complete} onRequestHide={this._hide} />
                  : <div key="nullKey" />;
        return (
          <ReactCSSTransitionGroup transitionName="feedbackBoxTransitionWrapper" transitionEnterTimeout={500} transitionLeaveTimeout={1000} >
            {it}
          </ReactCSSTransitionGroup>

        );
      },


      componentDidMount: function () {
        if(this._shouldShow()){
          this.setState(function(previousState) {
            return {shownTimes: previousState.shownTimes+1};
          });
        }
      }
    })
  );
}

{'fraction_non_alphanumeric': 0.17803560712142427, 'fraction_numerical': 0.008801760352070413, 'mean_word_length': 2.3333333333333335, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3403903', 'n_tokens_mistral': 1380, 'n_tokens_neox': 1307, 'n_words': 249}