<commit_before>module.exports = React.createClass({
  getInitialState: function() {
    return {};
  },
  SendToServer: function(es) {
    es.preventDefault();
    var data = {
      OldPassword: $("#OldPassword").val(),
      NewPassword: $("#NewPassword").val(),
      ConfirmPassword: $("#ConfPassword").val()
    };
    //console.log(data);
    $.ajax({
      headers: {
        'Authorization': "bearer " + Cookie.load('tokenInfo')
      },
      type: "POST",
      url: this.props.url,
      data: data
    }).success(function () {
      React.unmountComponentAtNode(document.getElementById('Settings'));
    }).fail(function(ee) {
      alert(ee);
    });
  },
  componentDidMount: function() {
    console.log(this.props.url);
  },
  render: function() {
    return (
      <div>

        <form onSubmit={this.SendToServer}>

          <input
            type="password"
            required={true}
            title="Password between 8 and 20 characters, including UPPER/lowercase, numbers and symbols"
            pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,20}$"
            placeholder="Old Password"
            id="OldPassword"
            className="form-control"/>

          <input
            type="password"
            required={true}
            title="Password between 8 and 20 characters, including UPPER/lowercase, numbers and symbols"
            pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,20}$"
            placeholder="<PASSWORD> Password"
            id="NewPassword"
            className="form-control"/>

          <input
            type="password"
            required={true}
            title="Password between 8 and 20 characters, including UPPER/lowercase, numbers and symbols"
            pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,20}$"
            placeholder="Confirm Password"
            id="ConfPassword"
            className="form-control"/>

          <button className="btn btn-success" type="submit">Submit</button>

        </form>

      </div>
    );
  }
});
<commit_msg>Refactoring: Change Password UI to react-way & remove jQuery<commit_after>module.exports = React.createClass({
  getInitialState: function() {
    return {};
  },
  SendToServer: function(es) {
    es.preventDefault();
    var data = {
      OldPassword: this.refs.OldPassword.value,
      NewPassword: this.refs.NewPassword.value,
      ConfirmPassword: this.refs.ConfPassword.value
    };
    $.ajax({
      headers: {
        'Authorization': "bearer " + Cookie.load('tokenInfo')
      },
      type: "POST",
      url: this.props.url,
      data: data
    }).success(function () {
      React.unmountComponentAtNode(document.getElementById('Settings'));
    }).fail(function(ee) {
      alert(ee);
    });
  },
  componentDidMount: function() {
    console.log(this.props.url);
  },
  render: function() {
    return (
      <div>

        <form onSubmit={this.SendToServer}>

          <input
            type="password"
            required={true}
            title="Password between 8 and 20 characters, including UPPER/lowercase, numbers and symbols"
            pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,20}$"
            placeholder="Old Password"
            ref="OldPassword"
            className="form-control"/>

          <input
            type="password"
            required={true}
            title="Password between 8 and 20 characters, including UPPER/lowercase, numbers and symbols"
            pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,20}$"
            placeholder="New Password"
            ref="NewPassword"
            className="form-control"/>

          <input
            type="password"
            required={true}
            title="Password between 8 and 20 characters, including UPPER/lowercase, numbers and symbols"
            pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,20}$"
            placeholder="Confirm Password"
            ref="ConfPassword"
            className="form-control"/>

          <button className="btn btn-success" type="submit">Submit</button>

        </form>

      </div>
    );
  }
});

{'fraction_non_alphanumeric': 0.18862134088762983, 'fraction_numerical': 0.0113314447592068, 'mean_word_length': 2.190512048192771, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '5900957', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1291, 'n_words': 214}