<commit_before>'use strict';

/* Controllers */

angular.module('blindMaps.controllers', [])
  .controller('AppCtrl', function($scope, $rootScope, $timeout, user, events) {
    $rootScope.topScope = $rootScope;

    var updateUser = function(data) {
        $rootScope.user = data;
    };
    //user.getUser(updateUser);

    $rootScope.logout = function(){
        $rootScope.user = user.logout(updateUser);
    };

    events.on("pointAdded", function(points) {
        $rootScope.user.points = points;
        
        if (points == 1) {
            $timeout(function(){
                $('#points').tooltip("show");
            },0);
        }
    });
    events.on("questionSetFinished", function(points) {
        if (10 < points && points <= 20) {
            $timeout(function(){
                $('#drop-login').tooltip("show");
            },0);
        }
    });

    $scope.vip = function() {
        return $scope.user && ($scope.user.username == 'Verunka');
    };
  })

  .controller('AppView', function($scope, $routeParams, $filter, 
        places, mapTitle, mapControler) {
    $scope.part = $routeParams.part;
    var user = $routeParams.user || "";<commit_msg>Bugfix: username is not displayed when logged in. closes #39<commit_after>'use strict';

/* Controllers */

angular.module('blindMaps.controllers', [])
  .controller('AppCtrl', function($scope, $rootScope, $timeout, user, events) {
    $rootScope.topScope = $rootScope;

    var updateUser = function(data) {
        $rootScope.user = data;
    };
    user.getUser(updateUser);

    $rootScope.logout = function(){
        $rootScope.user = user.logout(updateUser);
    };

    events.on("pointAdded", function(points) {
        $rootScope.user.points = points;
        
        if (points == 1) {
            $timeout(function(){
                $('#points').tooltip("show");
            },0);
        }
    });
    events.on("questionSetFinished", function(points) {
        if (10 < points && points <= 20) {
            $timeout(function(){
                $('#drop-login').tooltip("show");
            },0);
        }
    });

    $scope.vip = function() {
        return $scope.user && ($scope.user.username == 'Verunka');
    };
  })

  .controller('AppView', function($scope, $routeParams, $filter, 
        places, mapTitle, mapControler) {
    $scope.part = $routeParams.part;
    var user = $routeParams.user || "";
{'fraction_non_alphanumeric': 0.17407561279601164, 'fraction_numerical': 0.006647278770253427, 'mean_word_length': 2.3584379358437935, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2361790', 'n_tokens_mistral': 740, 'n_tokens_neox': 716, 'n_words': 129}