template.js
//-- No use time. It is a javaScript effect.
No use time. It is a javaScript effect.
No use time . It is a javaScript effect .
function insertChat(who, text, time){
    if (time === undefined){
        time = 0;
    }
    var control = "";
    var date = formatAMPM(new Date());
    if (who == "me"){
      control = '<li style="width:100%;">' +'<div style="float:right;"class="macro">' +
                        '<div style="flex:30; border-top-right-radius:0;" id="'+id+'" class="msj-rta macro">' +
                            '<div class="text text-r">' +
                                '<p>'+text+'</p>' +
                                '<p><small>'+date+'</small></p>' +
                            '</div>' +
                        '<div class="avatar" style="padding:0px 0px 0px 10px !important"><img class="img-circle" style="width:100%;" src="'+you.avatar+'" ></div></div>' +
                        '<div class="aftermessage" id="'+id+'-'+id+'"></div>'+
                    '</div>'+                                
                  '</li>';
    }else{
      control = '<li style="width:100%">' + '<div class="macro"><div class="beforemessage" id="'+id+'-'+id+'"></div>' +
                        '<div style="flex:30; border-top-left-radius:0;"id="'+id+'" class="msj macro">' +
                        '<div class="avatar"><img class="img-circle" style="width:100%;" src="'+ me.avatar +'" /></div>' +
                            '<div class="text text-l">' +
                                '<p>'+ text +'</p>' +
                                '<p><small>'+date+'</small></p>' +
                            '</div>' +
                        '</div> </div>' +
                    '</li>'; 
    }
    text = text.toLowerCase();
    text = text.replace(/[^a-zöçğışüİ ]/gi, '')
    socket.emit('chat message', text,id);
    id += 1;
    setTimeout(
        function(){                        
            $("ul").append(control).scrollTop($("ul").prop('scrollHeight'));
        }, time);
}
function insertChat ( who , text , time ) { if ( time === undefined ) { time = 0 ; } var control = "" ; var date = formatAMPM ( new Date ( ) ) ; if ( who == "me" ) { control = '<li style="width:100%;">' + '<div style="float:right;"class="macro">' + '<div style="flex:30; border-top-right-radius:0;" id="' + id + '" class="msj-rta macro">' + '<div class="text text-r">' + '<p>' + text + '</p>' + '<p><small>' + date + '</small></p>' + '</div>' + '<div class="avatar" style="padding:0px 0px 0px 10px !important"><img class="img-circle" style="width:100%;" src="' + you . avatar + '" ></div></div>' + '<div class="aftermessage" id="' + id + '-' + id + '"></div>' + '</div>' + '</li>' ; } else { control = '<li style="width:100%">' + '<div class="macro"><div class="beforemessage" id="' + id + '-' + id + '"></div>' + '<div style="flex:30; border-top-left-radius:0;"id="' + id + '" class="msj macro">' + '<div class="avatar"><img class="img-circle" style="width:100%;" src="' + me . avatar + '" /></div>' + '<div class="text text-l">' + '<p>' + text + '</p>' + '<p><small>' + date + '</small></p>' + '</div>' + '</div> </div>' + '</li>' ; } text = text . toLowerCase ( ) ; text = text . replace ( / [^a-zöçğışüİ ]/gi, '' ) socket . emit ( 'chat message' , text , id ) ; id += 1 ; setTimeout ( function ( ) { $ ( "ul" ) . append ( control ) . scrollTop ( $ ( "ul" ) . prop ( 'scrollHeight' ) ) ; } , time ) ; }
No use time.
No use time .