<commit_before>/**
 * ui.ts
 *
 * Common User Interface state holder and changer.
 * TODO: firefox bindings.
 */
/// <reference path='user.ts' />
/// <reference path='core_connector.ts' />
/// <reference path='../../uproxy.ts'/>
/// <reference path='../../interfaces/ui.d.ts'/>
/// <reference path='../../interfaces/persistent.d.ts'/>
/// <reference path='../../interfaces/browser-api.d.ts'/>
/// <reference path='../../networking-typings/communications.d.ts' />

// Singleton model for data bindings.
var model :UI.Model = {
  networkNames: [],
  onlineNetwork: null,
  contacts: {
    getAccessContacts: {
      onlinePending: [],
      offlinePending: [],
      onlineTrustedUproxy: [],
      offlineTrustedUproxy: [],
      onlineUntrustedUproxy: [],
      offlineUntrustedUproxy: []
    },
    shareAccessContacts: {
      onlinePending: [],
      offlinePending: [],
      onlineTrustedUproxy: [],
      offlineTrustedUproxy: [],
      onlineUntrustedUproxy: [],
      offlineUntrustedUproxy: []
    }
  },
  globalSettings: {
    description: '',
    stunServers: [],
    hasSeenSharingEnabledScreen: false,
    hasSeenWelcome: false,
    mode : uProxy.Mode.GET
  }
};

// TODO: currently we have a UI object (typescript module, i.e. namespace)
// and a ui object (singleton intance of UI.UserInterface).  We should
// change the names of these to avoid confusion.
module UI {

  // Filenames for icons.
  // Two important things about using these strings:
  // 1) When updating the icon strings below, default values in the Chrome
  // manifests and Firefox main.js should also be changed to match.
  // 2) These are only the suffixes of the icon names. Because we have
  // different sizes of icons, the actual filenames have the dimension
  // as a prefix. E.g. "19_online.gif" for the 19x19 pixel version.

  // Icons for browser bar, also used for notifications.
  export var DEFAULT_ICON :string = 'online.gif';
  export var LOGGED_OUT_ICON :string = 'offline.gif';
  export var SHARING_ICON :string = 'sharing.gif';
  export var GETTING_ICON :string = 'getting.gif';
  export var ERROR_ICON :string = 'error.gif';
  export var GETTING_SHARING_ICON :string = 'gettingandsharing.gif';

  export var DEFAULT_USER_IMG = '../icons/contact-default.png';

  export interface Contacts {
    getAccessContacts : {
      onlinePending :UI.User[];
      offlinePending :UI.User[];
      onlineTrustedUproxy :UI.User[];
      offlineTrustedUproxy :UI.User[];
      onlineUntrustedUproxy :UI.User[];
      offlineUntrustedUproxy :UI.User[];
    };
    shareAccessContacts : {
      onlinePending :UI.User[];
      offlinePending :UI.User[];
      onlineTrustedUproxy :UI.User[];
      offlineTrustedUproxy :UI.User[];
      onlineUntrustedUproxy :UI.User[];
      offlineUntrustedUproxy :UI.User[];
    }
  }

  export interface Model {
    networkNames :string[];
    onlineNetwork :UI.Network;
    contacts : Contacts;
    globalSettings : Core.GlobalSettings;
  }

   export interface UserCategories {
     getTab :string;
     shareTab :string;
   }

  /**
   * Specific to one particular Social network.
   */
  export interface Network {
    name   :string;
    // TODO(salomegeo): Add more information about the user.
    userId :string;
    imageData ?:string;
    userName ?:string;
    roster :{ [userId:string] :User };
    hasContacts ?:boolean;
  }

  /**
   * The User Interface class.
   *
   * Keeps persistent state between the popup opening and closing.
   * Manipulates the payloads received from UPDATES from the Core in preparation
   * for UI interaction.
   * Any COMMANDs from the UI should be directly called from the 'core' object.
   */
  export class UserInterface implements uProxy.UIAPI {
    public DEBUG = false;  // Set to true to show the model in the UI.

    public view :uProxy.View;  // Appearance.

    // Current state within the splash (onboarding).  Needs to be part
    // of the ui object so it can be saved/restored when popup closes and opens.
    public splashState :number = 0;

    // Instance you are getting access from.
    // Null if you are not getting access.
    private instanceGettingAccessFrom_ = null;

    // The instances you are giving access to.
    // Remote instances to add to this set are received in messages from Core.
    public instancesGivingAccessTo = {};

    private mapInstanceIdToUser_ :{[instanceId :string] :UI.User} = {};

    public gettingStatus :string = null;
    public sharingStatus :string = null;

    public copyPasteGettingState :GettingState = GettingState.NONE;
    public copyPasteSharingState :SharingState = SharingState.NONE;<commit_msg>remove a comment<commit_after>/**
 * ui.ts
 *
 * Common User Interface state holder and changer.
 * TODO: firefox bindings.
 */
/// <reference path='user.ts' />
/// <reference path='core_connector.ts' />
/// <reference path='../../uproxy.ts'/>
/// <reference path='../../interfaces/ui.d.ts'/>
/// <reference path='../../interfaces/persistent.d.ts'/>
/// <reference path='../../interfaces/browser-api.d.ts'/>
/// <reference path='../../networking-typings/communications.d.ts' />

// Singleton model for data bindings.
var model :UI.Model = {
  networkNames: [],
  onlineNetwork: null,
  contacts: {
    getAccessContacts: {
      onlinePending: [],
      offlinePending: [],
      onlineTrustedUproxy: [],
      offlineTrustedUproxy: [],
      onlineUntrustedUproxy: [],
      offlineUntrustedUproxy: []
    },
    shareAccessContacts: {
      onlinePending: [],
      offlinePending: [],
      onlineTrustedUproxy: [],
      offlineTrustedUproxy: [],
      onlineUntrustedUproxy: [],
      offlineUntrustedUproxy: []
    }
  },
  globalSettings: {
    description: '',
    stunServers: [],
    hasSeenSharingEnabledScreen: false,
    hasSeenWelcome: false,
    mode : uProxy.Mode.GET
  }
};

// TODO: currently we have a UI object (typescript module, i.e. namespace)
// and a ui object (singleton intance of UI.UserInterface).  We should
// change the names of these to avoid confusion.
module UI {

  // Filenames for icons.
  // Two important things about using these strings:
  // 1) When updating the icon strings below, default values in the Chrome
  // manifests and Firefox main.js should also be changed to match.
  // 2) These are only the suffixes of the icon names. Because we have
  // different sizes of icons, the actual filenames have the dimension
  // as a prefix. E.g. "19_online.gif" for the 19x19 pixel version.

  // Icons for browser bar, also used for notifications.
  export var DEFAULT_ICON :string = 'online.gif';
  export var LOGGED_OUT_ICON :string = 'offline.gif';
  export var SHARING_ICON :string = 'sharing.gif';
  export var GETTING_ICON :string = 'getting.gif';
  export var ERROR_ICON :string = 'error.gif';
  export var GETTING_SHARING_ICON :string = 'gettingandsharing.gif';

  export var DEFAULT_USER_IMG = '../icons/contact-default.png';

  export interface Contacts {
    getAccessContacts : {
      onlinePending :UI.User[];
      offlinePending :UI.User[];
      onlineTrustedUproxy :UI.User[];
      offlineTrustedUproxy :UI.User[];
      onlineUntrustedUproxy :UI.User[];
      offlineUntrustedUproxy :UI.User[];
    };
    shareAccessContacts : {
      onlinePending :UI.User[];
      offlinePending :UI.User[];
      onlineTrustedUproxy :UI.User[];
      offlineTrustedUproxy :UI.User[];
      onlineUntrustedUproxy :UI.User[];
      offlineUntrustedUproxy :UI.User[];
    }
  }

  export interface Model {
    networkNames :string[];
    onlineNetwork :UI.Network;
    contacts : Contacts;
    globalSettings : Core.GlobalSettings;
  }

   export interface UserCategories {
     getTab :string;
     shareTab :string;
   }

  /**
   * Specific to one particular Social network.
   */
  export interface Network {
    name   :string;
    // TODO(salomegeo): Add more information about the user.
    userId :string;
    imageData ?:string;
    userName ?:string;
    roster :{ [userId:string] :User };
    hasContacts ?:boolean;
  }

  /**
   * The User Interface class.
   *
   * Keeps persistent state between the popup opening and closing.
   * Manipulates the payloads received from UPDATES from the Core in preparation
   * for UI interaction.
   * Any COMMANDs from the UI should be directly called from the 'core' object.
   */
  export class UserInterface implements uProxy.UIAPI {
    public DEBUG = false;  // Set to true to show the model in the UI.

    public view :uProxy.View;

    // Current state within the splash (onboarding).  Needs to be part
    // of the ui object so it can be saved/restored when popup closes and opens.
    public splashState :number = 0;

    // Instance you are getting access from.
    // Null if you are not getting access.
    private instanceGettingAccessFrom_ = null;

    // The instances you are giving access to.
    // Remote instances to add to this set are received in messages from Core.
    public instancesGivingAccessTo = {};

    private mapInstanceIdToUser_ :{[instanceId :string] :UI.User} = {};

    public gettingStatus :string = null;
    public sharingStatus :string = null;

    public copyPasteGettingState :GettingState = GettingState.NONE;
    public copyPasteSharingState :SharingState = SharingState.NONE;
{'fraction_non_alphanumeric': 0.11310359727773577, 'fraction_numerical': 0.001944474451766231, 'mean_word_length': 2.9922380336351875, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '898547', 'n_tokens_mistral': 2790, 'n_tokens_neox': 2736, 'n_words': 848}