<commit_before>'use strict';

/**
 * @ngdoc function
 * @name berlinVeganMapApp.controller:MainController
 * @description
 * # MainController
 * Controller of the berlinVeganMapApp
 */
app.controller('MainController', function ($scope, $http, $timeout, LocationCleansingService, LocationLogicService, InfoWindowViewService, filterFilter, locationFilter) {
  
    var debugMode = false;
    var allDistricts = "Alle Bezirke";
    var allWeekDays = "Alle Wochentage";
    
    $scope.display = { search: "simple" };
    $scope.query = null;
    $scope.locations = null;
    $scope.districts = null;
    $scope.tags = null;
    $scope.friendlyDayStrings = null;
    $scope.veganCategories = null;
    $scope.geolocation = { show: false, supported: navigator.geolocation ? true : false };
    $scope.orderSelection = "Name";
    
    $http({method: 'GET', url: 'assets/GastroLocations_2016-05-26_formatted.json'})
        .success(function(data, status, headers, config) {
            $scope.locations = data;
            LocationCleansingService.cleanLocations($scope.locations);
            LocationLogicService.enhanceLocations($scope.locations);
            initQuery();
            initMap();
            initDistricts();
            initTags();
            initVeganCategories();
            initFriendlyDayStrings();
            updateMarkers();
            updateOrder();
        })
        .error(function(data, status, headers, config) {
        });

    $scope.updateMarkers = updateMarkers;<commit_msg>Use proper locations URL in production<commit_after>'use strict';

/**
 * @ngdoc function
 * @name berlinVeganMapApp.controller:MainController
 * @description
 * # MainController
 * Controller of the berlinVeganMapApp
 */
app.controller('MainController', function ($scope, $http, $timeout, LocationCleansingService, LocationLogicService, InfoWindowViewService, filterFilter, locationFilter) {
  
    var debugMode = false; // TODO: Set something like that depending on build.
    var allDistricts = "Alle Bezirke";
    var allWeekDays = "Alle Wochentage";
    var locationsUrl = debugMode ? "assets/GastroLocations_2016-05-26_formatted.json" : "http://www.berlin-vegan.de/app/data/GastroLocations.json";
    
    $scope.display = { search: "simple" };
    $scope.query = null;
    $scope.locations = null;
    $scope.districts = null;
    $scope.tags = null;
    $scope.friendlyDayStrings = null;
    $scope.veganCategories = null;
    $scope.geolocation = { show: false, supported: navigator.geolocation ? true : false };
    $scope.orderSelection = "Name";
    
    $http({method: 'GET', url: locationsUrl})
        .success(function(data, status, headers, config) {
            $scope.locations = data;
            LocationCleansingService.cleanLocations($scope.locations);
            LocationLogicService.enhanceLocations($scope.locations);
            initQuery();
            initMap();
            initDistricts();
            initTags();
            initVeganCategories();
            initFriendlyDayStrings();
            updateMarkers();
            updateOrder();
        })
        .error(function(data, status, headers, config) {
        });

    $scope.updateMarkers = updateMarkers;
{'fraction_non_alphanumeric': 0.11970074812967581, 'fraction_numerical': 0.004987531172069825, 'mean_word_length': 2.99626400996264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '6516077', 'n_tokens_mistral': 937, 'n_tokens_neox': 901, 'n_words': 183}