<commit_before>angular.module('lastfm.directives', []);
angular.module('lastfm.services', [])
angular.module('lastfm.filters', [])
angular.module('lastfm.controllers', ['lastfm.services'])

angular.module( 'lastfm', [
  'lastfm.controllers',
  'lastfm.directives',
  'lastfm.services',
  'lastfm.filters',

  'templates-app',
  'templates-common',

  'ui.state',
  'ui.route',
  'ui.event',
  'ui.keypress',

  'ngCookies',
  'titleService',

  'kit',
  'markdown',
  'fuzzy',

  'github'
])

// This is for Angular < 1.1
// for more info see:
// http://stackoverflow.com/questions/16661032/http-get-is-not-allowed-by-access-control-allow-origin-but-ajax-is
.config(function($httpProvider) {
  delete $httpProvider.defaults.headers.common['X-Requested-With'];
})

.config( function myAppConfig ( $stateProvider, $urlRouterProvider ) {
  $urlRouterProvider
    .otherwise( '/404' );

  $stateProvider
  .state( 'content', {
    url: '',
    abstract: true,
    template: '<markdown src="template($state.current.name)"></markdown>',
    controller: function ($scope, $state) {
        $scope.template = function (name) {
            if (name) {
                return '/assets/content/' + name + '.md';
            }
        }
    }
  })
  .state( 'content.intro', {
    url: '',
    onEnter: function(titleService, $state, $rootScope, $window, $location, lastfm, $cookies) {
        var token = $location.search().token;
        if (token) {
            if (!$rootScope.session) {
                $cookies.sessionToken = token;
            }
            $window.location.href = 'http://lastfm.pewpew.nl';
        }

        titleService.setTitle('Intro - Last.fm');
    },
  })
  .state( 'content.jesse', {
    url: '/jesse',
    onEnter: function(titleService) {
        titleService.setTitle('Jesse - Last.fm');
    },
  })
  .state( 'content.thegame', {
    url: '/thegame',
    onEnter: function(titleService) {
        titleService.setTitle('The Game - Last.fm');
    },
  })
  .state( 'content.resume', {
    url: '/resume',
    onEnter: function(titleService) {
        titleService.setTitle('Resume - Last.fm');
    },
  })
  .state( 'content.code', {
    url: '/code',
    onEnter: function(titleService) {
        titleService.setTitle('Code - Last.fm');
    },
  })
  .state( 'content.help', {
    url: '/help',
    onEnter: function(titleService) {
        titleService.setTitle('Help - Last.fm');
    },
  })
  .state( '404', {
    url: '/404',
    templateUrl: '404.tpl.html'
  })
  .state( 'user404', {
    url: '/user404',
    templateUrl: 'lastfm/views/user/404.tpl.html'
  })
  .state( 'user', {
    url: '/user/:user',
    controller: 'UserCtrl',
    abstract: true,
    templateUrl: 'lastfm/views/user/tpl.html',
  })
      .state( 'user.profile', {
        onEnter: function(titleService, $stateParams) {
            titleService.setTitle($stateParams.user + "’s Music Profile - Users at Last.fm");
        },
        url: '',
        views: {
            '': {
                templateUrl: 'lastfm/views/user/profile/tpl.html',
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/scrobbles.tpl.html'
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/badge.tpl.html'
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/taste.tpl.html'
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/friends.tpl.html'
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/top.artists.tpl.html'
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/top.tracks.tpl.html'
            }
        }
      })
      .state( 'user.library', {
        url: '/library',
        abstract: true,
        views: {
          '': {<commit_msg>Add profile view controllers to state router<commit_after>angular.module('lastfm.directives', []);
angular.module('lastfm.services', [])
angular.module('lastfm.filters', [])
angular.module('lastfm.controllers', ['lastfm.services'])

angular.module( 'lastfm', [
  'lastfm.controllers',
  'lastfm.directives',
  'lastfm.services',
  'lastfm.filters',

  'templates-app',
  'templates-common',

  'ui.state',
  'ui.route',
  'ui.event',
  'ui.keypress',

  'ngCookies',
  'titleService',

  'kit',
  'markdown',
  'fuzzy',

  'github'
])

// This is for Angular < 1.1
// for more info see:
// http://stackoverflow.com/questions/16661032/http-get-is-not-allowed-by-access-control-allow-origin-but-ajax-is
.config(function($httpProvider) {
  delete $httpProvider.defaults.headers.common['X-Requested-With'];
})

.config( function myAppConfig ( $stateProvider, $urlRouterProvider ) {
  $urlRouterProvider
    .otherwise( '/404' );

  $stateProvider
  .state( 'content', {
    url: '',
    abstract: true,
    template: '<markdown src="template($state.current.name)"></markdown>',
    controller: function ($scope, $state) {
        $scope.template = function (name) {
            if (name) {
                return '/assets/content/' + name + '.md';
            }
        }
    }
  })
  .state( 'content.intro', {
    url: '',
    onEnter: function(titleService, $state, $rootScope, $window, $location, lastfm, $cookies) {
        var token = $location.search().token;
        if (token) {
            if (!$rootScope.session) {
                $cookies.sessionToken = token;
            }
            $window.location.href = 'http://lastfm.pewpew.nl';
        }

        titleService.setTitle('Intro - Last.fm');
    },
  })
  .state( 'content.jesse', {
    url: '/jesse',
    onEnter: function(titleService) {
        titleService.setTitle('Jesse - Last.fm');
    },
  })
  .state( 'content.thegame', {
    url: '/thegame',
    onEnter: function(titleService) {
        titleService.setTitle('The Game - Last.fm');
    },
  })
  .state( 'content.resume', {
    url: '/resume',
    onEnter: function(titleService) {
        titleService.setTitle('Resume - Last.fm');
    },
  })
  .state( 'content.code', {
    url: '/code',
    onEnter: function(titleService) {
        titleService.setTitle('Code - Last.fm');
    },
  })
  .state( 'content.help', {
    url: '/help',
    onEnter: function(titleService) {
        titleService.setTitle('Help - Last.fm');
    },
  })
  .state( '404', {
    url: '/404',
    templateUrl: '404.tpl.html'
  })
  .state( 'user404', {
    url: '/user404',
    templateUrl: 'lastfm/views/user/404.tpl.html'
  })
  .state( 'user', {
    url: '/user/:user',
    controller: 'UserCtrl',
    abstract: true,
    templateUrl: 'lastfm/views/user/tpl.html',
  })
      .state( 'user.profile', {
        onEnter: function(titleService, $stateParams) {
            titleService.setTitle($stateParams.user + "’s Music Profile - Users at Last.fm");
        },
        url: '',
        views: {
            '': {
                templateUrl: 'lastfm/views/user/profile/tpl.html',
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/scrobbles.tpl.html',
                controller: 'ScrobbleCtrl',
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/badge.tpl.html',
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/taste.tpl.html'
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/friends.tpl.html',
                controller: 'FriendCtrl'
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/top.artists.tpl.html',
                controller: 'TopArtistCtrl'
            },
            '<EMAIL>': {
                templateUrl: 'lastfm/views/user/profile/top.tracks.tpl.html',
                controller: 'TopTrackCtrl'
            }
        }
      })
      .state( 'user.library', {
        url: '/library',
        abstract: true,
        views: {
          '': {
{'fraction_non_alphanumeric': 0.174, 'fraction_numerical': 0.00775, 'mean_word_length': 2.1023652578518806, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '3985422', 'n_tokens_mistral': 2653, 'n_tokens_neox': 2603, 'n_words': 402}