<commit_before>define([
    'underscore',
    'jquery',
    'backbone',
    'react',
    'cortex',
    'models/user',
    'lib/mediator',
    'templates/body'
], function(
    _,
    $,
    Backbone,
    React,
    Cortex,
    UserModel,
    mediator,
    Body
) {
    'use strict';

    function Application() {
        this.mediator = mediator;

        this.storage  = window.store;

        if ( ! this.storage.enabled) {
            throw "Storage not supported";
        }

        if ((token = this.storage.get('token')) !== undefined) {
            this.token = token;
        }

        var tokenCortex;

        this.start = function() {
            this.react = null;

            tokenCortex = new Cortex(token, _.bind(function(updatedToken) {
                this.react.setProps({ token : updatedToken });
            }, this));

            this.react = React.renderComponent(Body({
                token: tokenCortex
            }), document.body);
        };

        this.clearAuth = function() {
            this.token = null;
            this.storage.remove('token');

            this.mediator.publish('!user:auth', false, false);
        };

        this.setAuth = function(token, user) {
            this.mediator.publish('!user:auth', true, user);

            this.token = token;
            this.storage.set('token', token);
        };

        this.loadUserFromToken = function() {
            if (! this.token) {
                return;
            }<commit_msg>init touch events<commit_after>define([
    'underscore',
    'jquery',
    'backbone',
    'react',
    'cortex',
    'models/user',
    'lib/mediator',
    'templates/body'
], function(
    _,
    $,
    Backbone,
    React,
    Cortex,
    UserModel,
    mediator,
    Body
) {
    'use strict';

    function Application() {
        this.mediator = mediator;

        this.storage  = window.store;

        if ( ! this.storage.enabled) {
            throw "Storage not supported";
        }

        if ((token = this.storage.get('token')) !== undefined) {
            this.token = token;
        }

        var tokenCortex;

        this.start = function() {
            this.react = null;

            tokenCortex = new Cortex(token, _.bind(function(updatedToken) {
                this.react.setProps({ token : updatedToken });
            }, this));

            React.initializeTouchEvents(true);
            this.react = React.renderComponent(Body({
                token: tokenCortex
            }), document.body);
        };

        this.clearAuth = function() {
            this.token = null;
            this.storage.remove('token');

            this.mediator.publish('!user:auth', false, false);
        };

        this.setAuth = function(token, user) {
            this.mediator.publish('!user:auth', true, user);

            this.token = token;
            this.storage.set('token', token);
        };

        this.loadUserFromToken = function() {
            if (! this.token) {
                return;
            }
{'fraction_non_alphanumeric': 0.13403763618355893, 'fraction_numerical': 0.0, 'mean_word_length': 1.587532023911187, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6783780', 'n_tokens_mistral': 877, 'n_tokens_neox': 838, 'n_words': 159}