<commit_before>(function () {
  'use strict';

  angular
    .module('app')
    .controller('SpotsController', Spots);

  Spots.$inject = ['$cordovaDevice', '$cordovaFile', '$document', '$ionicActionSheet', '$ionicModal', '$ionicPopup',
    '$log', '$scope', '$state', '$window', 'ImageMapFactory', 'SpotFactory', 'UserFactory'];

  function Spots($cordovaDevice, $cordovaFile, $document, $ionicActionSheet, $ionicModal, $ionicPopup, $log, $scope,
                 $state, $window, ImageMapFactory, SpotFactory, UserFactory) {
    var vm = this;

    vm.clearAllSpots = clearAllSpots;
    vm.closeModal = closeModal;
    vm.exportToCSV = exportToCSV;
    vm.isOnlineLoggedIn = isOnlineLoggedIn;
    vm.newSpot = newSpot;
    vm.openModal = openModal;
    vm.showActionsheet = showActionsheet;
    vm.spots = [];
    vm.sync = sync;

    activate();

    /**
     * Private Functions
     */

    function activate() {
      SpotFactory.clearCurrentSpot();            // Make sure the current spot is empty
      vm.spots = SpotFactory.getSpots();
      createModals();
      cleanupModals();
    }

    function cleanupModals() {
      // Cleanup the modal when we're done with it!
      // Execute action on hide modal
      $scope.$on('syncModal.hidden', function () {
        vm.syncModal.remove();
      });
    }

    function createModals() {<commit_msg>keep newest spot/last modified spot at top of spots list<commit_after>(function () {
  'use strict';

  angular
    .module('app')
    .controller('SpotsController', Spots);

  Spots.$inject = ['$cordovaDevice', '$cordovaFile', '$document', '$ionicActionSheet', '$ionicModal', '$ionicPopup',
    '$log', '$scope', '$state', '$window', 'ImageMapFactory', 'SpotFactory', 'UserFactory'];

  function Spots($cordovaDevice, $cordovaFile, $document, $ionicActionSheet, $ionicModal, $ionicPopup, $log, $scope,
                 $state, $window, ImageMapFactory, SpotFactory, UserFactory) {
    var vm = this;

    vm.clearAllSpots = clearAllSpots;
    vm.closeModal = closeModal;
    vm.exportToCSV = exportToCSV;
    vm.isOnlineLoggedIn = isOnlineLoggedIn;
    vm.newSpot = newSpot;
    vm.openModal = openModal;
    vm.showActionsheet = showActionsheet;
    vm.spots = [];
    vm.sync = sync;

    activate();

    /**
     * Private Functions
     */

    function activate() {
      SpotFactory.clearCurrentSpot();            // Make sure the current spot is empty
      vm.spots = SpotFactory.getSpots().reverse();  // Move newest to top
      createModals();
      cleanupModals();
    }

    function cleanupModals() {
      // Cleanup the modal when we're done with it!
      // Execute action on hide modal
      $scope.$on('syncModal.hidden', function () {
        vm.syncModal.remove();
      });
    }

    function createModals() {
{'fraction_non_alphanumeric': 0.14163090128755365, 'fraction_numerical': 0.0, 'mean_word_length': 3.007163323782235, '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': '4533929', 'n_tokens_mistral': 870, 'n_tokens_neox': 823, 'n_words': 197}