<commit_before>$(document).on('click', '#chat_button', function() {
    var screen_top = $(window).scrollTop();
    $('#chat_menu').css('top', screen_top);
    $('html').toggleClass('chat_menu_open');
});

$(document).on('click', '.chat_header, .chat_option', function() {
    $('.chat_box').toggleClass('active');
});
$(document).on('submit', '#create_messge_form', function(){
	
	var user = $('#message').data('user');
    $theForm = $(this);
    // send xhr request
    $.ajax({
        type: "post",
        url: "/chat_msg/new",
        beforeSend: function(xhr){
            xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrf"]').attr('content'))
        },
        data: {
			channelId: '0',
			username: user,
            data: $('#message').val()
        },
        success: function (data) {
            $('#create_messge_form input').val('');
        }
    });
	
	
    // prevent submitting again
    return false;
});

//$(function(){
//    var mid = $('.chat_msg').length ? $('.chat_msg:last').data('message-id') : 0;
//    $.ajax({
//        type: "POST",
//        url: "/chat_msg/read",
//        beforeSend: function (xhr) {
//            xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrf"]').attr('content'))
//        },
//        data: {
//            mid: mid,
//        },
//        success: function (data) {
//            $('#chat_conversation').append(data);
//        }
//    });
//});


setInterval(function() {
    var mid = $('.chat_msg').length ? $('.chat_msg:last').data('message-id') : 0;
    $.ajax({
        type: "POST",
        url: "/chat_msg/read",
        beforeSend: function (xhr) {
            xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrf"]').attr('content'))
        },
        data: {
            mid: mid,
        },
        success: function (data) {
            $('#chat_conversation').append(data);
        }
    });
}, 1000);<commit_msg>message ids<commit_after>$(document).on('click', '#chat_button', function() {
    var screen_top = $(window).scrollTop();
    $('#chat_menu').css('top', screen_top);
    $('html').toggleClass('chat_menu_open');
});

$(document).on('click', '.chat_header, .chat_option', function() {
    $('.chat_box').toggleClass('active');
});
$(document).on('submit', '#create_messge_form', function(){
	
	var user = $('#message').data('user');
    $theForm = $(this);
    // send xhr request
    $.ajax({
        type: "post",
        url: "/chat_msg/new",
        beforeSend: function(xhr){
            xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrf"]').attr('content'))
        },
        data: {
			channelId: '0',
			username: user,
            data: $('#message').val()
        },
        success: function (data) {
            $('#create_messge_form input').val('');
        }
    });
	
	
    // prevent submitting again
    return false;
});

$(function(){
    $('#chat_conversation').scrollTop($('#chat_conversation')[0].scrollHeight);
});


setInterval(function() {
    var mid = $('.chat_msg').length ? $('.chat_msg:last').data('message-id') : 0;
    $.ajax({
        type: "POST",
        url: "/chat_msg/read",
        beforeSend: function (xhr) {
            xhr.setRequestHeader('X-CSRF-Token', $('meta[name="_csrf"]').attr('content'))
        },
        data: {
            mid: mid,
        },
        success: function (data) {
            $('#chat_conversation').append(data);
        }
    });
}, 1000);
{'fraction_non_alphanumeric': 0.2262390670553936, 'fraction_numerical': 0.004081632653061225, 'mean_word_length': 2.3703339882121806, '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': '1868204', 'n_tokens_mistral': 1112, 'n_tokens_neox': 1071, 'n_words': 175}