<commit_before>angular.module('app.directives', [])
.directive('hackhappinesAddhackhappines', function(Happinesses) {
    return {
      restrict: 'E',
      replace: true,
      templateUrl: 'templates/addHappiness.html',
      compile: function(element, attr) {
        return function($scope)
        {
          // Perform the action when the user submits the login form
          $scope.addHappiness = function() {
            Happinesses.save($scope.happinessData, function(newHappiness){
              $scope.happinesses.unshift(newHappiness);
              $scope.closeAddHappiness();
            });
          };
          
          var interval;
          $scope.startHappiness = function()
          {
            _increaseHappinessLevel();
            interval = setInterval(_increaseHappinessLevel, _increaseHappinessInterval);
          };
          $scope.stopHappiness = function()
          {
            clearInterval(interval);
            $scope.isHappinessLevelSet = true;
          };

          var _increaseHappinessInterval = 500;
          var _increaseHappinessLevel = function(){
            if( $scope.happinessData.level < $scope.happinessRangeMax )
            {
              $scope.happinessData.level++;
            }
          };
          $scope.initHappinesData = function()
          {
            $scope.happinessData = {
              level: 0,
              message: ''
            };
            $scope.isHappinessLevelSet = false;
          };
          $scope.initHappinesData();
        };
      }
    };
});<commit_msg>fix add happiness<commit_after>angular.module('app.directives', [])
.directive('hackhappinesAddhackhappines', function(Happinesses) {
    return {
      restrict: 'E',
      replace: true,
      templateUrl: 'templates/addHappiness.html',
      compile: function(element, attr) {
        return function($scope)
        {
          // Perform the action when the user submits the login form
          $scope.addHappiness = function() {
            var happiness = new Happinesses($scope.happinessData);
            happiness.$save(function(newHappiness){
              $scope.happinesses.unshift(newHappiness);
              $scope.closeAddHappiness();
            });
          };
          
          var interval;
          $scope.startHappiness = function()
          {
            _increaseHappinessLevel();
            interval = setInterval(_increaseHappinessLevel, _increaseHappinessInterval);
          };
          $scope.stopHappiness = function()
          {
            clearInterval(interval);
            $scope.isHappinessLevelSet = true;
          };

          var _increaseHappinessInterval = 500;
          var _increaseHappinessLevel = function(){
            if( $scope.happinessData.level < $scope.happinessRangeMax )
            {
              $scope.happinessData.level++;
            }
          };
          $scope.initHappinesData = function()
          {
            $scope.happinessData = {
              level: 0,
              message: ''
            };
            $scope.isHappinessLevelSet = false;
          };
          $scope.initHappinesData();
        };
      }
    };
});
{'fraction_non_alphanumeric': 0.10566037735849057, 'fraction_numerical': 0.0025157232704402514, 'mean_word_length': 1.6889264581572274, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2185335', 'n_tokens_mistral': 889, 'n_tokens_neox': 854, 'n_words': 131}