<commit_before>'use strict';

function HeaderController($q, $scope, $location, $document, $element, $rootScope, SwiperService, UserSessionService) {

  // Register callback to slide change which will update heading
  var featureSlideChangeCallback = function() {
    if(!$scope.$$phase) {
      $scope.$digest();
    }
  };
  SwiperService.registerSlideChangeCallback(featureSlideChangeCallback, $scope.feature, 'HeaderController');

  $scope.getLabelWidth = function() {
    if ($scope.currentWidth <= 568){
      // Mobile, leave 78 pixels on both sides
      return $scope.currentWidth - 156;
    }else{
      return 412;
    }
  };

  $scope.getCurrentHeading = function() {
    if ($scope.feature === 'inbox'){
      return 'inbox';
    }else{
      var activeSlide = SwiperService.getActiveSlidePath($scope.feature);
      if (activeSlide){
        if (activeSlide.endsWith('home')){
          if ($scope.feature === 'tasks'){
            return 'dates';
          }else if ($scope.feature === 'notes'){
            return 'recent';
          }
        }else if (activeSlide.endsWith('details')){
          return $scope.feature;
        }else{
          var lastSlashIndex = activeSlide.lastIndexOf('/');
          if (lastSlashIndex !== -1){
            return activeSlide.substring(lastSlashIndex+1);
          }
        }
      }
    }
  };

  $scope.addNew = function() {
    if ($scope.feature === 'inbox'){
      $location.path(UserSessionService.getOwnerPrefix() + '/items/new');
    }else if ($scope.feature === 'tasks'){
      $location.path(UserSessionService.getOwnerPrefix() + '/tasks/new');
    }else if ($scope.feature === 'notes'){
      $location.path(UserSessionService.getOwnerPrefix() + '/notes/new');
    }
  };

}

HeaderController['$inject'] = [
'$q', '$scope', '$location', '$document', '$element', '$rootScope', 'SwiperService', 'UserSessionService'];
angular.module('em.app').controller('HeaderController', HeaderController);<commit_msg>Removed unneeded dependencies from HeaderController.<commit_after>'use strict';

function HeaderController($scope, $location, SwiperService, UserSessionService) {

  // Register callback to slide change which will update heading
  var featureSlideChangeCallback = function() {
    if(!$scope.$$phase) {
      $scope.$digest();
    }
  };
  SwiperService.registerSlideChangeCallback(featureSlideChangeCallback, $scope.feature, 'HeaderController');

  $scope.getLabelWidth = function() {
    if ($scope.currentWidth <= 568){
      // Mobile, leave 78 pixels on both sides
      return $scope.currentWidth - 156;
    }else{
      return 412;
    }
  };

  $scope.getCurrentHeading = function() {
    if ($scope.feature === 'inbox'){
      return 'inbox';
    }else{
      var activeSlide = SwiperService.getActiveSlidePath($scope.feature);
      if (activeSlide){
        if (activeSlide.endsWith('home')){
          if ($scope.feature === 'tasks'){
            return 'dates';
          }else if ($scope.feature === 'notes'){
            return 'recent';
          }
        }else if (activeSlide.endsWith('details')){
          return $scope.feature;
        }else{
          var lastSlashIndex = activeSlide.lastIndexOf('/');
          if (lastSlashIndex !== -1){
            return activeSlide.substring(lastSlashIndex+1);
          }
        }
      }
    }
  };

  $scope.addNew = function() {
    if ($scope.feature === 'inbox'){
      $location.path(UserSessionService.getOwnerPrefix() + '/items/new');
    }else if ($scope.feature === 'tasks'){
      $location.path(UserSessionService.getOwnerPrefix() + '/tasks/new');
    }else if ($scope.feature === 'notes'){
      $location.path(UserSessionService.getOwnerPrefix() + '/notes/new');
    }
  };
}

HeaderController['$inject'] = ['$scope', '$location', 'SwiperService', 'UserSessionService'];
angular.module('em.app').controller('HeaderController', HeaderController);
{'fraction_non_alphanumeric': 0.15848959671204726, 'fraction_numerical': 0.006678653994348831, 'mean_word_length': 3.0817610062893084, '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': '4669756', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1121, 'n_words': 227}