<commit_before>/**
 * NAVBAR
 *
 * The navbar controller manages the bar at the top of the screen.
 */

var Amount = ripple.Amount,
    settings = require('../util/settings'),
    rewriter = require('../util/jsonrewriter');

var module = angular.module('navbar', []);

module.controller('NavbarCtrl', ['$scope', '$element', '$compile', 'rpId',
                                 'rpNetwork', '$location',
                                 function ($scope, el, $compile, id,
                                           network, $location)
{
  $scope.loading = true;
  var queue = [];
  var tickInterval = 4000;
  var tickUpcoming = false;

  var tplAccount = require('../../jade/notification/account.jade');

  // Activate #status panel
  $scope.toggle_secondary = function () {
    $scope.show_secondary = !$scope.show_secondary;
  };

  $scope.page_reload = function () {
      // Reload
      location.reload();
  };

  $scope.$watch('fee', function(){
    $scope.currentFee = ripple.Amount.from_json($scope.fee).to_human(); 

    if(!$scope.connected && $scope.userCredentials.username) {
      $scope.serverStatus = 'disconnected';
    }
    else if ($scope.currentFee && $scope.connected && $scope.currentFee > Options.low_load_threshold && $scope.currentFee < ripple.Amount.from_json(Options.max_tx_network_fee).to_human()) {
      $scope.serverLoad = 'mediumLoad';
      $scope.serverStatus = 'mediumLoad';
    } 
    else if ($scope.currentFee && $scope.connected && $scope.currentFee >= ripple.Amount.from_json(Options.max_tx_network_fee).to_human()) {
      $scope.serverLoad = 'highLoad';
      $scope.serverStatus = 'highLoad';
    }
    else if ($scope.currentFee && $scope.connected) {
      $scope.serverLoad = '';
      $scope.serverStatus = 'lowLoad';
    }
    else {
      $scope.serverStatus = 'connected';
    } 
  }, true);

  // Username
  $scope.$watch('userCredentials', function(){
    var username = $scope.userCredentials.username;
    if(username) $scope.loading = false;
    $scope.shortUsername = null;
<commit_msg>[FIX] Status icon for unfunded wallet (RT-3322)<commit_after>/**
 * NAVBAR
 *
 * The navbar controller manages the bar at the top of the screen.
 */

var Amount = ripple.Amount,
    settings = require('../util/settings'),
    rewriter = require('../util/jsonrewriter');

var module = angular.module('navbar', []);

module.controller('NavbarCtrl', ['$scope', '$element', '$compile', 'rpId',
                                 'rpNetwork', '$location',
                                 function ($scope, el, $compile, id,
                                           network, $location)
{
  $scope.loading = true;
  var queue = [];
  var tickInterval = 4000;
  var tickUpcoming = false;

  var tplAccount = require('../../jade/notification/account.jade');

  // Activate #status panel
  $scope.toggle_secondary = function () {
    $scope.show_secondary = !$scope.show_secondary;
  };

  $scope.page_reload = function () {
      // Reload
      location.reload();
  };

  $scope.$watch('fee', function(){
    $scope.currentFee = ripple.Amount.from_json($scope.fee).to_human(); 

    if(!$scope.connected && $scope.userCredentials.username) {
      $scope.serverStatus = 'disconnected';
    }
    else if ($scope.currentFee && $scope.connected && ($scope.currentFee > Options.low_load_threshold) && ($scope.currentFee < ripple.Amount.from_json(Options.max_tx_network_fee).to_human())) {
      $scope.serverLoad = 'mediumLoad';
      $scope.serverStatus = 'mediumLoad';
    } 
    else if ($scope.currentFee && $scope.connected && ($scope.currentFee >= ripple.Amount.from_json(Options.max_tx_network_fee).to_human())) {
      $scope.serverLoad = 'highLoad';
      $scope.serverStatus = 'highLoad';
    }
    else if ($scope.currentFee && $scope.connected) {
      $scope.serverLoad = '';
      $scope.serverStatus = 'lowLoad';
    }
    else {
      $scope.serverStatus = 'connected';
    } 
  }, true);

  // Username
  $scope.$watch('userCredentials', function(){
    var username = $scope.userCredentials.username;
    if(username) $scope.loading = false;
    $scope.shortUsername = null;

{'fraction_non_alphanumeric': 0.1587493940862821, 'fraction_numerical': 0.00290838584585555, 'mean_word_length': 2.849813432835821, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3092045', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1234, 'n_words': 234}