<commit_before>/* globals $ */

import { remote } from 'electron';
import { servers } from './servers';
import { sidebar } from './sidebar';
import { webview } from './webview';
import tray from './tray';
import './menus';

sidebar.on('badge-setted', function() {
    var badge = sidebar.getGlobalBadge();

    if (process.platform === 'darwin') {
        remote.app.dock.setBadge(badge);
    }
    tray.showTrayAlert(badge !== '', badge);
});

export var start = function() {
    var defaultInstance = 'https://demo.rocket.chat';

    // connection check
    if (!navigator.onLine) {
        offline();
    }
    window.addEventListener('online', online);
    window.addEventListener('offline', offline);

    function online() {
        document.body.classList.remove('offline');
    }

    function offline() {
        document.body.classList.add('offline');
    }
    // end connection check

    var form = document.querySelector('form');
    var hostField = form.querySelector('[name="host"]');
    var button = form.querySelector('[type="submit"]');<commit_msg>Closes #68; Show alert only when have mentions<commit_after>/* globals $ */

import { remote } from 'electron';
import { servers } from './servers';
import { sidebar } from './sidebar';
import { webview } from './webview';
import tray from './tray';
import './menus';

sidebar.on('badge-setted', function() {
    var badge = sidebar.getGlobalBadge();

    if (process.platform === 'darwin') {
        remote.app.dock.setBadge(badge);
    }
    tray.showTrayAlert(!isNaN(parseInt(badge)) && badge > 0, badge);
});

export var start = function() {
    var defaultInstance = 'https://demo.rocket.chat';

    // connection check
    if (!navigator.onLine) {
        offline();
    }
    window.addEventListener('online', online);
    window.addEventListener('offline', offline);

    function online() {
        document.body.classList.remove('offline');
    }

    function offline() {
        document.body.classList.add('offline');
    }
    // end connection check

    var form = document.querySelector('form');
    var hostField = form.querySelector('[name="host"]');
    var button = form.querySelector('[type="submit"]');
{'fraction_non_alphanumeric': 0.16826265389876882, 'fraction_numerical': 0.0013679890560875513, 'mean_word_length': 3.2684824902723735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '4851394', 'n_tokens_mistral': 656, 'n_tokens_neox': 640, 'n_words': 146}