<commit_before>spacialistApp.controller('headerCtrl', ['$scope', 'langService', 'userService', 'mainService', '$state', '$translate', function($scope, langService, userService, mainService, $state, $translate) {
    var vm = this;
    vm.currentLanguage = {};
    vm.isLangSet = langService.isLangSet;
    $scope.concepts = vm.concepts;
    $scope.getLabelValue = function(label, type) {
        if(vm.concepts[label]) {
            return vm.concepts[label].label;
        }
        var transLabel = $translate.instant(vm.getLabelPrefix(type) + label);
        if(transLabel) {
            return transLabel.toString();
        }
        return label;
    };

    vm.getLabelPrefix = function(type) {
        if(type == 'file') return  'files.properties.file.';
        if(type == 'bibliography') return 'literature.bibtex.';
    };

    vm.onSearchSelect = function($item, $model, $label) {
        switch($model.type) {
            case 'context':
                $state.go('root.spacialist.data', {id: $model.id});
                break;
            case 'layer':
                $state.go('root.editor.layer.edit', {id: $model.id});
                break;
            case 'file':
                $state.go('root.spacialist.file', {id: $model.id});
                break;
            case 'user':
                $state.go('root.user.edit', {id: $model.id});
                break;
        }
    };

    vm.toggleEditMode = function() {
        vm.editMode.enabled = !vm.editMode.enabled;
    };

    vm.initLanguage = function() {
        var initKey = vm.userConfig ? vm.userConfig.language : undefined;
        langService.setInitLanguage(vm.currentLanguage, initKey);
    };

    vm.switchLanguage = function(langKey) {
        langService.switchLanguage(vm.currentLanguage, langKey, vm.concepts);
        vm.currentLanguage.flagCode = langKey;
    };

    vm.logoutUser = function() {
        userService.logoutUser();
    };

    vm.globalSearch = function(term) {
        return mainService.globalSearch(term);
    };

    vm.initLanguage();
}]);<commit_msg>add bibliography state as case for on-select callback<commit_after>spacialistApp.controller('headerCtrl', ['$scope', 'langService', 'userService', 'mainService', '$state', '$translate', function($scope, langService, userService, mainService, $state, $translate) {
    var vm = this;
    vm.currentLanguage = {};
    vm.isLangSet = langService.isLangSet;
    $scope.concepts = vm.concepts;
    $scope.getLabelValue = function(label, type) {
        if(vm.concepts[label]) {
            return vm.concepts[label].label;
        }
        var transLabel = $translate.instant(vm.getLabelPrefix(type) + label);
        if(transLabel) {
            return transLabel.toString();
        }
        return label;
    };

    vm.getLabelPrefix = function(type) {
        if(type == 'file') return  'files.properties.file.';
        if(type == 'bibliography') return 'literature.bibtex.';
    };

    vm.onSearchSelect = function($item, $model, $label) {
        switch($model.type) {
            case 'context':
                $state.go('root.spacialist.data', {id: $model.id});
                break;
            case 'layer':
                $state.go('root.editor.layer.edit', {id: $model.id});
                break;
            case 'file':
                $state.go('root.spacialist.file', {id: $model.id});
                break;
            case 'user':
                $state.go('root.user.edit', {id: $model.id});
                break;
            case 'bibliography':
                $state.go('root.bibliography.edit', {id: $model.id});
        }
    };

    vm.toggleEditMode = function() {
        vm.editMode.enabled = !vm.editMode.enabled;
    };

    vm.initLanguage = function() {
        var initKey = vm.userConfig ? vm.userConfig.language : undefined;
        langService.setInitLanguage(vm.currentLanguage, initKey);
    };

    vm.switchLanguage = function(langKey) {
        langService.switchLanguage(vm.currentLanguage, langKey, vm.concepts);
        vm.currentLanguage.flagCode = langKey;
    };

    vm.logoutUser = function() {
        userService.logoutUser();
    };

    vm.globalSearch = function(term) {
        return mainService.globalSearch(term);
    };

    vm.initLanguage();
}]);
{'fraction_non_alphanumeric': 0.14685967779593742, 'fraction_numerical': 0.0, 'mean_word_length': 2.2454545454545456, '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': '3917364', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1241, 'n_words': 218}