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

var objectHasProperties = function(object) {
   for (var iProperty in object) {
      return true;
   }
   return false;
};

var syncScope;

// needed for sync module
if (typeof window.rootUrl === 'undefined') {
   window.rootUrl = '../';
}

function logError(details) {
   $.post(rootUrl + "sync/jsErrors.php", {"details": details},
      function(data, textStatus) {
      }
   ); 
}

window.onerror = function(message, file, line) {
  logError(file + ':' + line + '\n\n' + message);
};

// TODO: this doesn't work anymore with angular > 1.3, provide a real module
function SyncCtrl($scope, $timeout) {
   $scope.syncStatus = function() {
      var params = [];
      params[SyncQueue.statusIdle] = { strStatus: "I", color: "green"};
      params[SyncQueue.statusWillSend] = { strStatus: "W", color: "green"};
      params[SyncQueue.statusSending] = { strStatus: "S", color: "blue"};
      params[SyncQueue.statusSendingWillSend] = { strStatus: "S", color: "blue"};
<commit_msg>reasonable default for rootUrl<commit_after>(function() {
'use strict';

var objectHasProperties = function(object) {
   for (var iProperty in object) {
      return true;
   }
   return false;
};

var syncScope;

// TODO: clean through instanciation with options
if (typeof window.rootUrl === 'undefined') {
   window.rootUrl = 'commonFramework/';
}

function logError(details) {
   $.post(rootUrl + "sync/jsErrors.php", {"details": details},
      function(data, textStatus) {
      }
   ); 
}

window.onerror = function(message, file, line) {
  logError(file + ':' + line + '\n\n' + message);
};

// TODO: this doesn't work anymore with angular > 1.3, provide a real module
function SyncCtrl($scope, $timeout) {
   $scope.syncStatus = function() {
      var params = [];
      params[SyncQueue.statusIdle] = { strStatus: "I", color: "green"};
      params[SyncQueue.statusWillSend] = { strStatus: "W", color: "green"};
      params[SyncQueue.statusSending] = { strStatus: "S", color: "blue"};
      params[SyncQueue.statusSendingWillSend] = { strStatus: "S", color: "blue"};

{'fraction_non_alphanumeric': 0.16222645099904853, 'fraction_numerical': 0.0019029495718363464, 'mean_word_length': 3.7152466367713006, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '3991107', 'n_tokens_mistral': 680, 'n_tokens_neox': 666, 'n_words': 168}