<commit_before>var addon = self;

var sidebarApp = angular.module('sidebarApp', ["ngRoute", "ngSanitize"]).config(['$provide', function($provide) {
  $provide.decorator('$sniffer', ['$delegate', function($delegate) {
    $delegate.history = false;
    return $delegate;
  }]);
}]);


sidebarApp.controller("SidebarCtrl", function($scope, $document, $interval) {
  $scope.teamSpinner = true;
  $scope.headerPartial = "partials/header-partial.html";
  $scope.createTrailPartial = "partials/trail-modal-partial.html";
  $scope.createDomainPartial = "partials/domain-modal-partial.html";
  $scope.createTeamPartial = "partials/team-modal-partial.html"
  if (!$scope.domains) $scope.domains = [];
  $scope.trails = []

  addon.port.on("ready", function(prefs) {
    console.log("Got Ready")
    $scope.datawake = prefs.datawakeInfo;

    $scope.datawake.domain = {}
    $scope.datawake.domain.name = 'memex';
    $scope.datawake.trail = {}

    addon.port.emit("infochanged", $scope.datawake);
    addon.port.emit("refreshTrails", $scope.datawake.domain);

    addon.port.emit("refreshEntities");
    addon.port.emit("refreshWebPages");

    $scope.current_url = prefs.current_url;
    $scope.versionNumber = prefs.versionNumber;
    $scope.user = prefs.userInfo;
  });

  addon.port.on("infosaved", function(datawakeinfo) {
    $scope.datawake = datawakeinfo;
    $scope.$apply();
    addon.port.emit("refreshEntities");
    addon.port.emit("refreshWebPages");
    console.log("ON INFO SAVED");
    console.log($scope.datawake);
  });

  // TRAILS
  $scope.trails = [];
  $scope.selectedTrail = ($scope.datawake && $scope.datawake.trail) ? $scope.datawake.trail : null;
<commit_msg>Fixing ready behavior to not load links/entities before a trail is loaded.<commit_after>var addon = self;

var sidebarApp = angular.module('sidebarApp', ["ngRoute", "ngSanitize"]).config(['$provide', function($provide) {
  $provide.decorator('$sniffer', ['$delegate', function($delegate) {
    $delegate.history = false;
    return $delegate;
  }]);
}]);


sidebarApp.controller("SidebarCtrl", function($scope, $document, $interval) {
  $scope.teamSpinner = true;
  $scope.headerPartial = "partials/header-partial.html";
  $scope.createTrailPartial = "partials/trail-modal-partial.html";
  $scope.createDomainPartial = "partials/domain-modal-partial.html";
  $scope.createTeamPartial = "partials/team-modal-partial.html"
  if (!$scope.domains) $scope.domains = [];
  $scope.trails = []

  addon.port.on("ready", function(prefs) {
    console.log("Got Ready")
    $scope.datawake = prefs.datawakeInfo;

    $scope.datawake.domain = {}
    $scope.datawake.domain.name = 'memex';
    $scope.datawake.trail = {}

    addon.port.emit("refreshTrails", $scope.datawake.domain);

    $scope.current_url = prefs.current_url;
    $scope.versionNumber = prefs.versionNumber;
    $scope.user = prefs.userInfo;
  });

  addon.port.on("infosaved", function(datawakeinfo) {
    $scope.datawake = datawakeinfo;
    $scope.$apply();
    addon.port.emit("refreshEntities");
    addon.port.emit("refreshWebPages");
    console.log("ON INFO SAVED");
    console.log($scope.datawake);
  });

  // TRAILS
  $scope.trails = [];
  $scope.selectedTrail = ($scope.datawake && $scope.datawake.trail) ? $scope.datawake.trail : null;

{'fraction_non_alphanumeric': 0.1742308863844045, 'fraction_numerical': 0.0, 'mean_word_length': 4.366013071895424, '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': '1874905', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1129, 'n_words': 155}