<commit_before>/**
 * Search Controller
 */
angular
    .module('SolrHeatmapApp')
    .controller('SearchCtrl', ['Map', 'HeatMapSourceGenerator', '$scope', '$http', function(MapService, HeatMapSourceGeneratorService, $scope, $http) {

        /**
         *
         */
        $scope.searchInput = '';
        /**
         *
         */
        $scope.onKeyPress = function($event) {
            // only fire the search if Enter-key (13) is pressed
            if (getKeyboardCodeFromEvent($event) === 13) {
                $scope.doSearch();
            }
        };

        /**
         *
         */
        $scope.doSearch = function() {
            // if no input is given
            if ($scope.searchInput.length === 0) {
               return false;
          }

          HeatMapSourceGeneratorService.setSearchText($scope.searchInput);
          HeatMapSourceGeneratorService.performSearch();
        };

        $scope.resetSearchInput = function() {
          $scope.searchInput = '';
          HeatMapSourceGeneratorService.setSearchText('');
          HeatMapSourceGeneratorService.performSearch();
        };

        /**
         *
         */
        function getKeyboardCodeFromEvent(keyEvt) {
            return window.event ? keyEvt.keyCode : keyEvt.which;
        }

    }]);<commit_msg>enable search with empty searchinput also<commit_after>/**
 * Search Controller
 */
angular
    .module('SolrHeatmapApp')
    .controller('SearchCtrl', ['Map', 'HeatMapSourceGenerator', '$scope', '$http', function(MapService, HeatMapSourceGeneratorService, $scope, $http) {

        /**
         *
         */
        $scope.searchInput = '';
        /**
         *
         */
        $scope.onKeyPress = function($event) {
            // only fire the search if Enter-key (13) is pressed
            if (getKeyboardCodeFromEvent($event) === 13) {
                $scope.doSearch();
            }
        };

        /**
         *
         */
        $scope.doSearch = function() {
            // if no input is given
            // if ($scope.searchInput.length === 0) {
            //    return false;
            // }

          HeatMapSourceGeneratorService.setSearchText($scope.searchInput);
          HeatMapSourceGeneratorService.performSearch();
        };

        $scope.resetSearchInput = function() {
          $scope.searchInput = '';
          HeatMapSourceGeneratorService.setSearchText('');
          HeatMapSourceGeneratorService.performSearch();
        };

        /**
         *
         */
        function getKeyboardCodeFromEvent(keyEvt) {
            return window.event ? keyEvt.keyCode : keyEvt.which;
        }

    }]);
{'fraction_non_alphanumeric': 0.13012410680707032, 'fraction_numerical': 0.00376081233546446, 'mean_word_length': 1.684157416750757, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6403349', 'n_tokens_mistral': 709, 'n_tokens_neox': 684, 'n_words': 115}