<commit_before>App.addChild('Contribution', {
  el: '#new-contribution',

  events: {
    'click .radio label' : 'clickReward',
    'click .submit-form' : 'submitForm',
    'click .user-reward-value' : 'clearOnFocus',
    'input #contribution_value' : 'restrictChars'
  },

  restrictChars: function(event){
    var $target = $(event.target);
    $target.val($target.val().replace(/[^\d,]/, ''));
  },

  submitForm: function(event){
    var $target_row = $(event.target).parents('.back-reward-money'),
        user_value = this.$('.selected').find('.user-reward-value').val().replace(/\./g,'');
    if(user_value === ''){
      this.$value.val(this.minimumValue());
    }else{
      this.$value.val(user_value);
    }
    if(parseInt(user_value) < parseInt(this.minimumValue())){
      $target_row.find('.user-reward-value').addClass('error');
      $target_row.find('.text-error').slideDown();
    }else{
      this.$('form').submit();
    }

    return false;
  },

  activate: function(){
    this.$('.user-reward-value').mask('000.000.000,00', {reverse: true});
    this.$value = this.$('#contribution_value');
    this.$minimum = this.$('#minimum-value');
    this.clickReward({currentTarget: this.$('input[type=radio]:checked').parent()});
    this.isOnAutoScroll = false;
    this.activateFloattingHeader();
  },

  activateFloattingHeader: function(){
    var that = this,<commit_msg>check if radio exists before clickReward<commit_after>App.addChild('Contribution', {
  el: '#new-contribution',

  events: {
    'click .radio label' : 'clickReward',
    'click .submit-form' : 'submitForm',
    'click .user-reward-value' : 'clearOnFocus',
    'input #contribution_value' : 'restrictChars'
  },

  restrictChars: function(event){
    var $target = $(event.target);
    $target.val($target.val().replace(/[^\d,]/, ''));
  },

  submitForm: function(event){
    var $target_row = $(event.target).parents('.back-reward-money'),
        user_value = this.$('.selected').find('.user-reward-value').val().replace(/\./g,'');
    if(user_value === ''){
      this.$value.val(this.minimumValue());
    }else{
      this.$value.val(user_value);
    }
    if(parseInt(user_value) < parseInt(this.minimumValue())){
      $target_row.find('.user-reward-value').addClass('error');
      $target_row.find('.text-error').slideDown();
    }else{
      this.$('form').submit();
    }

    return false;
  },

  activate: function(){
    this.$('.user-reward-value').mask('000.000.000,00', {reverse: true});
    this.$value = this.$('#contribution_value');
    this.$minimum = this.$('#minimum-value');
    if(this.$('input[type=radio]').length > 0) {
      this.clickReward({currentTarget: this.$('input[type=radio]:checked').parent()});
      this.isOnAutoScroll = false;
      this.activateFloattingHeader();
    }
  },

  activateFloattingHeader: function(){
    var that = this,
{'fraction_non_alphanumeric': 0.21189979123173278, 'fraction_numerical': 0.008002783576896311, 'mean_word_length': 3.6296296296296298, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '3830350', 'n_tokens_mistral': 979, 'n_tokens_neox': 931, 'n_words': 128}