<commit_before># expose trifl in global scope
trifl = require 'trifl'
trifl.expose window

dispatcher = require './dispatcher'

# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split(' '))...

ipc = require 'ipc'

{applayout}    = require './views'
{viewstate}    = require './models'

# tie layout to DOM
document.body.appendChild applayout.el

# intercept every event we listen to
# to make an 'alive' action to know
# the server is alive
do ->
    ipcon = ipc.on.bind(ipc)
    ipc.on = (n, fn) ->
        ipcon n, (as...) ->
            action 'alive', Date.now()
            fn as...

# wire up stuff from server
ipc.on 'init', (e) -> dispatcher.init e
# events from hangupsjs
require('./events').forEach (n) -> ipc.on n, (e) -> action n, e
# response from getentity
ipc.on 'getentity:result', (r) -> action 'addentities', r.entities
ipc.on 'resize', (dim) -> action 'resize', dim
ipc.on 'moved', (pos)  -> action 'moved', pos
ipc.on 'searchentities:result', (r) ->
  action 'setsearchedentities', r.entity
ipc.on 'createconversation:result', (c) ->
    action 'createconversationdone', c
    action 'setstate', viewstate.STATE_NORMAL

# init dispatcher/controller
require './dispatcher'
require './views/controller'

# request init this is not happening when
# the server is just connecting, but for
# dev mode when we reload the page
action 'reqinit'<commit_msg>fix conversation payload<commit_after># expose trifl in global scope
trifl = require 'trifl'
trifl.expose window

dispatcher = require './dispatcher'

# expose some selected tagg functions
trifl.tagg.expose window, ('ul li div span a i b u s button p label
input table thead tbody tr td th textarea br pass img h1 h2 h3 h4
hr'.split(' '))...

ipc = require 'ipc'

{applayout}    = require './views'
{viewstate}    = require './models'

# tie layout to DOM
document.body.appendChild applayout.el

# intercept every event we listen to
# to make an 'alive' action to know
# the server is alive
do ->
    ipcon = ipc.on.bind(ipc)
    ipc.on = (n, fn) ->
        ipcon n, (as...) ->
            action 'alive', Date.now()
            fn as...

# wire up stuff from server
ipc.on 'init', (e) -> dispatcher.init e
# events from hangupsjs
require('./events').forEach (n) -> ipc.on n, (e) -> action n, e
# response from getentity
ipc.on 'getentity:result', (r) -> action 'addentities', r.entities
ipc.on 'resize', (dim) -> action 'resize', dim
ipc.on 'moved', (pos)  -> action 'moved', pos
ipc.on 'searchentities:result', (r) ->
  action 'setsearchedentities', r.entity
ipc.on 'createconversation:result', (c) ->
    c.conversation_id = c.id # fix conversation payload
    action 'createconversationdone', c
    action 'setstate', viewstate.STATE_NORMAL

# init dispatcher/controller
require './dispatcher'
require './views/controller'

# request init this is not happening when
# the server is just connecting, but for
# dev mode when we reload the page
action 'reqinit'
{'fraction_non_alphanumeric': 0.13019299967288192, 'fraction_numerical': 0.0026169447170428526, 'mean_word_length': 3.4707602339181287, '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': '6768996', 'n_tokens_mistral': 1012, 'n_tokens_neox': 1011, 'n_words': 368}