<commit_before>'use strict';

angular.module('streama').controller('modalFileCtrl', [
  '$scope', '$uibModalInstance', 'apiService', 'uploadService', 'video', 'localStorageService',
  function ($scope, $uibModalInstance, apiService, uploadService, video, localStorageService) {
    $scope.loading = false;
    $scope.localFilesEnabled = false;
    $scope.localFiles = [];
    $scope.activeTab = 'upload';
    var localFileLastPath = localStorageService.get('localFileLastPath')|| '';
		$scope.localDir = localFileLastPath.split('/') || [];
    $scope.video = video;

    $scope.loadLocalFiles = loadLocalFiles;
		$scope.backLocalDirectory = backLocalDirectory;
		$scope.openLocalDirectory = openLocalDirectory;


		$scope.loadLocalFiles(localFileLastPath);
		function loadLocalFiles(path) {
			apiService.file.localFiles(path).success(function(data) {<commit_msg>feature: make fileModal remember the last active Tab via LocalStorage (#403)<commit_after>'use strict';

angular.module('streama').controller('modalFileCtrl', [
  '$scope', '$uibModalInstance', 'apiService', 'uploadService', 'video', 'localStorageService',
  function ($scope, $uibModalInstance, apiService, uploadService, video, localStorageService) {
    $scope.loading = false;
    $scope.localFilesEnabled = false;
    $scope.localFiles = [];
    $scope.activeTab = localStorageService.get('activeFileModalTab')|| 'upload';

    var localFileLastPath = localStorageService.get('localFileLastPath')|| '';
		$scope.localDir = localFileLastPath.split('/') || [];
    $scope.video = video;

    $scope.loadLocalFiles = loadLocalFiles;
		$scope.backLocalDirectory = backLocalDirectory;
		$scope.openLocalDirectory = openLocalDirectory;


		$scope.loadLocalFiles(localFileLastPath);


		$scope.$watch('activeTab', function (newVal, oldVal) {
      localStorageService.set('activeFileModalTab', newVal);
    });

		function loadLocalFiles(path) {
			apiService.file.localFiles(path).success(function(data) {
{'fraction_non_alphanumeric': 0.14336553126588714, 'fraction_numerical': 0.001525165226232842, 'mean_word_length': 5.857142857142857, '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': '6036208', 'n_tokens_mistral': 592, 'n_tokens_neox': 565, 'n_words': 97}