<commit_before>(function(angular, $, _) {

  angular.module('sandbox').config(function($routeProvider) {
      $routeProvider.when('/sandbox', {
        reloadOnSearch: false,
        controller: 'SandboxFooCtrl',
        templateUrl: '~/sandbox/FooCtrl.html'
      });
    }
  );

  angular.module('sandbox').controller('SandboxFooCtrl', function($scope, crmApi, crmStatus, crmUiHelp) {
    // The ts() and hs() functions help load strings for this module.
    var ts = $scope.ts = CRM.ts('civicase');
    var hs = $scope.hs = crmUiHelp({file: 'CRM/sandbox/FooCtrl'}); // See: templates/CRM/sandbox/FooCtrl.hlp

    $scope.$bindToRoute('contactFilters', 'contacts', {
      contact_type: 'Individual'
    });

    $scope.$bindValueToRoute('activeTab', 'tab', 'summary');
    $scope.selectTab = function(name) { $scope.activeTab = name; };
    $scope.tabs = [
      {name: 'summary', label: 'Summary'},
      {name: 'activities', label: 'Activities'},
      {name: 'people', label: 'People'},
      {name: 'files', label: 'Files'}
    ];

    $scope.$bindValueToRoute('activeCid', 'cid');
    $scope.$watch('activeCid', function(){
      if ($scope.activeCid) {
        crmApi('Contact', 'getsingle', {
          id: $scope.activeCid
        }).then(function(result){
          $scope.myContact = result;
        });
      } else {
        $scope.myContact = {};
      }
      refreshActivities();
    });

    $scope.$bindToRoute('activityFilters', 'aj', {});
    $scope.$watchCollection('activityFilters', refreshActivities);
    function refreshActivities(){
      if ($scope.activeCid) {
        var p = angular.extend({contact_id: $scope.activeCid}, $scope.activityFilters);
        if (p.activity_type_id == '') delete p.activity_type_id;
        crmApi('Activity', 'get', p).then(function(r){
          $scope.activities = r;
        });
      }
      else {
        $scope.activities = [];
      }
    }

    $scope.openContact = function(cid) {
      $scope.activeCid = cid;
    };

    $scope.CRM = CRM;
  });

})(angular, CRM.$, CRM._);<commit_msg>CRM-20426 - Update sandbox to latest crmRouteBinder<commit_after>(function(angular, $, _) {

  angular.module('sandbox').config(function($routeProvider) {
      $routeProvider.when('/sandbox', {
        reloadOnSearch: false,
        controller: 'SandboxFooCtrl',
        templateUrl: '~/sandbox/FooCtrl.html'
      });
    }
  );

  angular.module('sandbox').controller('SandboxFooCtrl', function($scope, crmApi, crmStatus, crmUiHelp) {
    // The ts() and hs() functions help load strings for this module.
    var ts = $scope.ts = CRM.ts('civicase');
    var hs = $scope.hs = crmUiHelp({file: 'CRM/sandbox/FooCtrl'}); // See: templates/CRM/sandbox/FooCtrl.hlp

    $scope.$bindToRoute({
      expr: 'contactFilters',
      param: 'contacts', 
      default: {contact_type: 'Individual'}
    });

    $scope.$bindToRoute({expr:'activeTab', param:'tab', default:'summary', format: 'raw'});
    $scope.selectTab = function(name) { $scope.activeTab = name; };
    $scope.tabs = [
      {name: 'summary', label: 'Summary'},
      {name: 'activities', label: 'Activities'},
      {name: 'people', label: 'People'},
      {name: 'files', label: 'Files'}
    ];

    $scope.$bindToRoute({expr:'activeCid', param:'cid', format: 'raw'});
    $scope.$watch('activeCid', function(){
      if ($scope.activeCid) {
        crmApi('Contact', 'getsingle', {
          id: $scope.activeCid
        }).then(function(result){
          $scope.myContact = result;
        });
      } else {
        $scope.myContact = {};
      }
      refreshActivities();
    });

    $scope.$bindToRoute({expr:'activityFilters', param:'aj', default:{}});
    $scope.$watchCollection('activityFilters', refreshActivities);
    function refreshActivities(){
      if ($scope.activeCid) {
        var p = angular.extend({contact_id: $scope.activeCid}, $scope.activityFilters);
        if (p.activity_type_id == '') delete p.activity_type_id;
        crmApi('Activity', 'get', p).then(function(r){
          $scope.activities = r;
        });
      }
      else {
        $scope.activities = [];
      }
    }

    $scope.openContact = function(cid) {
      $scope.activeCid = cid;
    };

    $scope.CRM = CRM;
  });

})(angular, CRM.$, CRM._);
{'fraction_non_alphanumeric': 0.17970946579194003, 'fraction_numerical': 0.0011715089034676663, 'mean_word_length': 2.8844404003639674, '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': '5862827', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1364, 'n_words': 239}