<commit_before>MainWindow    = require './atox-mainWin'
Notifications = require './atox-notifications'
YesNoQuestion = require './atox-questions'
Chatpanel     = require './atox-chatpanel'
Contact       = require './atox-contact'
Terminal      = require './atox-terminal'
ToxWorker     = require './atox-toxWorker'
{View, $, $$} = require 'atom-space-pen-views'
{Emitter}     = require 'event-kit'
Github        = require './atox-github'

module.exports =
  config:
    showDefault:
      title: "Show on startup"
      description: "Automatically displays the main window on startup"
      type: "boolean"
      default: true
    userAvatar:
      title: "Avatar"
      description: "A full path to your Avatar"
      type: "string"
      default: "none"
    userName:
      title: "Username"
      description: "Your username"
      type: "string"
      default: "User"
    chatColor:
      title: "Your chat's color"
      type:  "color"
      default: "#09c709"
    mainWinTop:
      title: "Main Window Top"
      type: "string"
      default: "60%"
    mainWinLeft:
      title: "Main Window Left"
      type: "string"
      default: "80%"
    debugNotifications:
      title: "Debug Notifications"
      description: "When activated displays debug notifications"
      type:  "boolean"
      default: false
    githubToken:
      title: "Github Access Token"
      description: "Github access token"
      type: "string"
      default: "none"


  activate: ->
    atom.commands.add 'atom-workspace', 'atox:toggle',  => @toggle()
    atom.commands.add 'atom-workspace', 'atox:history', => @toggleHistory()

    @event         = new Emitter
    @mainWin       = new MainWindow    @event
    @notifications = new Notifications @event
    @TOX           = new ToxWorker     {dll: "#{__dirname}\\bin\\libtoxcore.dll", event: @event}
    @term          = new Terminal      {cid: -2, event: @event}
    @github        = new Github


    @mainWin.css 'top',  atom.config.get 'atox.mainWinTop'
    @mainWin.css 'left', atom.config.get 'atox.mainWinLeft'

    @mainWin.mouseup =>
      atom.config.set 'atox.mainWinTop',  @mainWin.css 'top'
      atom.config.set 'atox.mainWinLeft', @mainWin.css 'left'

    atom.config.observe 'atox.mainWinTop',  (newValue) => @mainWin.css 'top',  newValue
    atom.config.observe 'atox.mainWinLeft', (newValue) => @mainWin.css 'left', newValue
    atom.config.observe 'atox.githubToken', (newValue) => @github.setToken newValue

    @internalContactId = 0
    @contactsArray     = []

    @hasOpenChat    = false

    @event.on 'atox.new-contact',       (data) => @addUserHelper      data
    @event.on 'atox.select',            (data) => @contactSelected    data
    @event.on 'getChatID',              (data) => @getChatIDFromName  data

    $ =><commit_msg>Fixed mensinda's last commit<commit_after>MainWindow    = require './atox-mainWin'
Notifications = require './atox-notifications'
YesNoQuestion = require './atox-questions'
Chatpanel     = require './atox-chatpanel'
Contact       = require './atox-contact'
Terminal      = require './atox-terminal'
ToxWorker     = require './atox-toxWorker'
{View, $, $$} = require 'atom-space-pen-views'
{Emitter}     = require 'event-kit'
Github        = require './atox-github'

module.exports =
  config:
    showDefault:
      title: "Show on startup"
      description: "Automatically displays the main window on startup"
      type: "boolean"
      default: true
    userAvatar:
      title: "Avatar"
      description: "A full path to your Avatar"
      type: "string"
      default: "none"
    userName:
      title: "Username"
      description: "Your username"
      type: "string"
      default: "User"
    chatColor:
      title: "Your chat's color"
      type:  "color"
      default: "#09c709"
    mainWinTop:
      title: "Main Window Top"
      type: "string"
      default: "60%"
    mainWinLeft:
      title: "Main Window Left"
      type: "string"
      default: "80%"
    debugNotifications:
      title: "Debug Notifications"
      description: "When activated displays debug notifications"
      type:  "boolean"
      default: false
    githubToken:
      title: "Github Access Token"
      description: "Github access token"
      type: "string"
      default: "none"


  activate: ->
    atom.commands.add 'atom-workspace', 'atox:toggle',  => @toggle()
    atom.commands.add 'atom-workspace', 'atox:history', => @toggleHistory()

    @event         = new Emitter
    @mainWin       = new MainWindow    @event
    @notifications = new Notifications @event
    @TOX           = new ToxWorker     {dll: "#{__dirname}\\..\\bin\\libtox.dll", event: @event}
    @term          = new Terminal      {cid: -2, event: @event}
    @github        = new Github


    @mainWin.css 'top',  atom.config.get 'atox.mainWinTop'
    @mainWin.css 'left', atom.config.get 'atox.mainWinLeft'

    @mainWin.mouseup =>
      atom.config.set 'atox.mainWinTop',  @mainWin.css 'top'
      atom.config.set 'atox.mainWinLeft', @mainWin.css 'left'

    atom.config.observe 'atox.mainWinTop',  (newValue) => @mainWin.css 'top',  newValue
    atom.config.observe 'atox.mainWinLeft', (newValue) => @mainWin.css 'left', newValue
    atom.config.observe 'atox.githubToken', (newValue) => @github.setToken newValue

    @internalContactId = 0
    @contactsArray     = []

    @hasOpenChat    = false

    @event.on 'atox.new-contact',       (data) => @addUserHelper      data
    @event.on 'atox.select',            (data) => @contactSelected    data
    @event.on 'getChatID',              (data) => @getChatIDFromName  data

    $ =>
{'fraction_non_alphanumeric': 0.13229780396357793, 'fraction_numerical': 0.003927870023210141, 'mean_word_length': 2.550063371356147, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '5747555', 'n_tokens_mistral': 1812, 'n_tokens_neox': 1754, 'n_words': 439}