<commit_before>/* Defines the chat panel UI elements.
 *
 * Requires:
 *   Handlebars.js
 *   js/sound.js
 *   js/error.js
 */

// jQuery selectors
var _chatTextEntry = $('#chatTextEntry');
var _chatHistoryPane = $('.chatHistoryPane');

var resizeChatPanes = function () {
    var historyPaneHeight = $('.sidePanelContent').height() - $('.chatControlPane').height() - 10;
    _chatHistoryPane.css('height', historyPaneHeight + 'px');
};

var getRandomColor = function () {
    var h = Math.floor((Math.random() * 360) / 24) * 24;
    return 'hsl(' + h + ', 100%, 25%)';
};

var Chat = function (roomName) {
    // An Object storing mappings of peerId : String => userName : String
    var _peerIdMap = {};
    
    var _audio = new SoundClip($('#chatAlertSound')[0]);

    // Default color palette for chatTextEntry. 'Idle' means that the text entry element does
    // not contain any text worth saving.
    this.kIdleTextColor = '#c0c0c0';
    this.kActiveTextColor = _chatTextEntry.css('color');
    
    // Default time-to-live for notifications (in seconds)
    this.kDefaultNotificationTimeout = 6.5;
    
    this._appendLine = function (content) {
        _chatHistoryPane
            .append(content)
            .stop(true, false)
            .animate({
                scrollTop : _chatHistoryPane.prop('scrollHeight')
            }, 'slow');
    };

    // Stores mappings of peerId : String -> hsvColor : String pairs
    this.peerColorMap = {};

    // Stores a list of hsvColor strings
    this.colorsUsed = [];
    
    this.roomName = roomName;<commit_msg>Changed notification duration to 3 seconds<commit_after>/* Defines the chat panel UI elements.
 *
 * Requires:
 *   Handlebars.js
 *   js/sound.js
 *   js/error.js
 */

// jQuery selectors
var _chatTextEntry = $('#chatTextEntry');
var _chatHistoryPane = $('.chatHistoryPane');

var resizeChatPanes = function () {
    var historyPaneHeight = $('.sidePanelContent').height() - $('.chatControlPane').height() - 10;
    _chatHistoryPane.css('height', historyPaneHeight + 'px');
};

var getRandomColor = function () {
    var h = Math.floor((Math.random() * 360) / 24) * 24;
    return 'hsl(' + h + ', 100%, 25%)';
};

var Chat = function (roomName) {
    // An Object storing mappings of peerId : String => userName : String
    var _peerIdMap = {};
    
    var _audio = new SoundClip($('#chatAlertSound')[0]);

    // Default color palette for chatTextEntry. 'Idle' means that the text entry element does
    // not contain any text worth saving.
    this.kIdleTextColor = '#c0c0c0';
    this.kActiveTextColor = _chatTextEntry.css('color');
    
    // Default time-to-live for notifications (in seconds)
    this.kDefaultNotificationTimeout = 3;
    
    this._appendLine = function (content) {
        _chatHistoryPane
            .append(content)
            .stop(true, false)
            .animate({
                scrollTop : _chatHistoryPane.prop('scrollHeight')
            }, 'slow');
    };

    // Stores mappings of peerId : String -> hsvColor : String pairs
    this.peerColorMap = {};

    // Stores a list of hsvColor strings
    this.colorsUsed = [];
    
    this.roomName = roomName;
{'fraction_non_alphanumeric': 0.1352032776552159, 'fraction_numerical': 0.012606366214938543, 'mean_word_length': 2.7385159010600706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6566815', 'n_tokens_mistral': 993, 'n_tokens_neox': 926, 'n_words': 250}