<commit_before>/**
 * APP
 *
 * The app controller manages the global scope.
 */

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

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

module.controller('AppCtrl', ['$rootScope', '$compile', 'rpId', 'rpNetwork',
                              'rpKeychain', '$location', '$timeout',
                              function ($scope, $compile, $id, $net,
                                        keychain, $location, $timeout)
{
  reset();

  var account;

  // For announcement banner

  $scope.showAnnouncement = store.get('announcement');

  if('undefined' === typeof $scope.showAnnouncement) $scope.showAnnouncement = true;

  $scope.dismissBanner = function() {
    store.set('announcement', false);
    $scope.showAnnouncement = store.get('announcement');
  }

  // Global reference for debugging only (!)
  if ("object" === typeof rippleclient) {<commit_msg>[TASK] Open all external links in the real browswer (DC-1)<commit_after>/**
 * APP
 *
 * The app controller manages the global scope.
 */

var rewriter = require('../util/jsonrewriter'),
  genericUtils = require('../util/generic'),
  Amount = ripple.Amount,
  gui = require('nw.gui'),
  win = gui.Window.get();

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

module.controller('AppCtrl', ['$rootScope', '$compile', 'rpId', 'rpNetwork',
                              'rpKeychain', '$location', '$timeout',
                              function ($scope, $compile, $id, $net,
                                        keychain, $location, $timeout)
{
  // To open external links in the real browser
  win.on('new-win-policy', function(frame, url, policy) {
    gui.Shell.openExternal(url);
    policy.ignore();
  });

  reset();

  var account;

  // For announcement banner

  $scope.showAnnouncement = store.get('announcement');

  if('undefined' === typeof $scope.showAnnouncement) $scope.showAnnouncement = true;

  $scope.dismissBanner = function() {
    store.set('announcement', false);
    $scope.showAnnouncement = store.get('announcement');
  }

  // Global reference for debugging only (!)
  if ("object" === typeof rippleclient) {
{'fraction_non_alphanumeric': 0.16098226466575716, 'fraction_numerical': 0.00045475216007276033, 'mean_word_length': 2.8596491228070176, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5293045', 'n_tokens_mistral': 661, 'n_tokens_neox': 626, 'n_words': 153}