<commit_before>angular.module('Aggie')

.controller('SourcesIndexController', [
  '$scope',
  '$rootScope',
  'FlashService',
  'sources',
  'Source',
  function($scope, $rootScope, flash, sources, Source) {
    $scope.sources = sources;

    $scope.saveSource = function(source) {
      Source.save({ id: source._id }, source, function() {
      }, function() {
        flash.setAlertNow('source.save.error');
        source.enabled = !source.enabled;
      });
    };

    $scope.refresh = function() {
      Source.query(function(sources) {
        $scope.sources = sources;
      });
    };

    $scope.target = function(source) {
      return source.media == 'twitter' ? source.keywords : source.url;
    };

    $scope.sourceClass = function(source) {
      var mediaOptions = ['twitter', 'facebook', 'rss', 'elmo', 'smsgh'];
      if (mediaOptions.indexOf(source.media) !== -1) {
        return source.media + '-source';
      } else {
        return 'unknown-source';
      }
    };

    $scope.viewSource = function(event, source) {
      $rootScope.$state.go('source', { id: source._id });
    };
  }
]);<commit_msg>target field shows 'keywords' for SMSGH source.<commit_after>angular.module('Aggie')

.controller('SourcesIndexController', [
  '$scope',
  '$rootScope',
  'FlashService',
  'sources',
  'Source',
  function($scope, $rootScope, flash, sources, Source) {
    $scope.sources = sources;

    $scope.saveSource = function(source) {
      Source.save({ id: source._id }, source, function() {
      }, function() {
        flash.setAlertNow('source.save.error');
        source.enabled = !source.enabled;
      });
    };

    $scope.refresh = function() {
      Source.query(function(sources) {
        $scope.sources = sources;
      });
    };

    $scope.target = function(source) {
      return source.media == 'twitter' || source.media == 'smsgh' ? source.keywords : source.url;
    };

    $scope.sourceClass = function(source) {
      var mediaOptions = ['twitter', 'facebook', 'rss', 'elmo', 'smsgh'];
      if (mediaOptions.indexOf(source.media) !== -1) {
        return source.media + '-source';
      } else {
        return 'unknown-source';
      }
    };

    $scope.viewSource = function(event, source) {
      $rootScope.$state.go('source', { id: source._id });
    };
  }
]);
{'fraction_non_alphanumeric': 0.17639429312581065, 'fraction_numerical': 0.0008646779074794639, 'mean_word_length': 2.774877650897227, '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': '245395', 'n_tokens_mistral': 720, 'n_tokens_neox': 701, 'n_words': 130}