<commit_before># Waits for the DOM to be ready
window.onload = ->

    window.__DEV__ = window.location.hostname is 'localhost'

    # expose an API
    window.cozyMails = require './utils/api_utils'

    # use Cozy instance locale or navigator language or "en" by default
    if not window.settings?
        window.settings = {}
    locale =
        window.settings.lang or
        window.locale or
        window.navigator.language or
        "en"

    window.cozyMails.setLocale locale

    # init plugins
    PluginUtils = require("./utils/plugin_utils")
    if not window.settings.plugins?
        window.settings.plugins = {}
    PluginUtils.merge window.settings.plugins
    PluginUtils.init()

    # Flux initialization (must be called at the begining)
    AccountStore  = require './stores/account_store'
    LayoutStore   = require './stores/layout_store'
    MessageStore  = require './stores/message_store'
    SettingsStore = require './stores/settings_store'
    SearchStore   = require './stores/search_store'

    # Routing management
    Router = require './router'
    @router = new Router()
    window.router = @router

    # Binds the router and flux to the React application
    Application = require './components/application'
    application = Application router: @router
    React.renderComponent application, document.body

    # Starts the application by initializing the router
    Backbone.history.start()

    # begin realtime
    require './utils/socketio_utils'<commit_msg>Fix plugins loading<commit_after># Waits for the DOM to be ready
window.onload = ->

    window.__DEV__ = window.location.hostname is 'localhost'

    # expose an API
    window.cozyMails = require './utils/api_utils'

    # use Cozy instance locale or navigator language or "en" by default
    if not window.settings?
        window.settings = {}
    locale =
        window.settings.lang or
        window.locale or
        window.navigator.language or
        "en"

    window.cozyMails.setLocale locale

    # init plugins
    PluginUtils = require "./utils/plugin_utils"
    if not window.settings.plugins?
        window.settings.plugins = {}
    PluginUtils.merge window.settings.plugins
    PluginUtils.init()

    window.cozyMails.setSetting 'plugins', window.settings.plugins

    # Flux initialization (must be called at the begining)
    AccountStore  = require './stores/account_store'
    LayoutStore   = require './stores/layout_store'
    MessageStore  = require './stores/message_store'
    SettingsStore = require './stores/settings_store'
    SearchStore   = require './stores/search_store'

    # Routing management
    Router = require './router'
    @router = new Router()
    window.router = @router

    # Binds the router and flux to the React application
    Application = require './components/application'
    application = Application router: @router
    React.renderComponent application, document.body

    # Starts the application by initializing the router
    Backbone.history.start()

    # begin realtime
    require './utils/socketio_utils'
{'fraction_non_alphanumeric': 0.08860759493670886, 'fraction_numerical': 0.0, 'mean_word_length': 2.90126582278481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5258528', 'n_tokens_mistral': 846, 'n_tokens_neox': 820, 'n_words': 243}