<commit_before>tchatroomApp = angular.module('tchatroomApp', []);

tchatroomApp.controller('tchatroomCtrl', function ($scope, $window) {

    var socket = io(HOST_URL);

    
    $scope.clearText = function () {
        $scope.mychat = "";
    }

    function init() {
        // 변수 초기화
        $scope.clearText();

        $scope.chatroomid = location.search.substring(1);
        //$scope.chatContent = "";
        console.log($scope.chatroomid);


        // event handler 추가
        socket.on('left', function (nickname) {
            $('#messages').append($('<li>').text(nickname + ': has left'));
        });

        socket.on('history', function (texts) {
            $('#messages').append($('<li>').text('history'));
            for (t of texts) {

                console.log(t);

                $('#messages').append($('<li>').text(t.uid.nickname + ': ' + t.message));
            }
            $('#messages').append($('<li>').text('-----------------------'));
        });

        socket.on('participants', function (participants) {
            $('#messages').append($('<li>').text('list of participants: '));
            for (p of participants) {
                $('#messages').append($('<li>').text(p.nickname));
            }
            $('#messages').append($('<li>').text('-----------------------'));

        });

        socket.on('error', function (msg) {
            $('#messages').append($('<li>').text('error occured on socket!: ' + msg));<commit_msg>error -> errorToCli<commit_after>tchatroomApp = angular.module('tchatroomApp', []);

tchatroomApp.controller('tchatroomCtrl', function ($scope, $window) {

    var socket = io(HOST_URL);

    
    $scope.clearText = function () {
        $scope.mychat = "";
    }

    function init() {
        // 변수 초기화
        $scope.clearText();

        $scope.chatroomid = location.search.substring(1);
        //$scope.chatContent = "";
        console.log($scope.chatroomid);


        // event handler 추가
        socket.on('left', function (nickname) {
            $('#messages').append($('<li>').text(nickname + ': has left'));
        });

        socket.on('history', function (texts) {
            $('#messages').append($('<li>').text('history'));
            for (t of texts) {

                console.log(t);

                $('#messages').append($('<li>').text(t.uid.nickname + ': ' + t.message));
            }
            $('#messages').append($('<li>').text('-----------------------'));
        });

        socket.on('participants', function (participants) {
            $('#messages').append($('<li>').text('list of participants: '));
            for (p of participants) {
                $('#messages').append($('<li>').text(p.nickname));
            }
            $('#messages').append($('<li>').text('-----------------------'));

        });

        socket.on('errorToCli', function (msg) {
            $('#messages').append($('<li>').text('error occured on socket!: ' + msg));
{'fraction_non_alphanumeric': 0.24434694566317922, 'fraction_numerical': 0.0006749915626054674, 'mean_word_length': 1.9580838323353293, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 20, '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': '3722383', 'n_tokens_mistral': 853, 'n_tokens_neox': 840, 'n_words': 124}