Web-Applications-with-Node.js/NodeJs-Homeworks & Exams/TelerikNodeJs/socket.io/examples/chat/public/main.js
//   all other messages (default = false)
all other messages (default = false)
all other messages ( default = false )
function addMessageElement(el, options) {
        let $el = $(el);
        if (!options) {
            options = {};
        }
        if (typeof options.fade === 'undefined') {
            options.fade = true;
        }
        if (typeof options.prepend === 'undefined') {
            options.prepend = false;
        }
        if (options.fade) {
            $el.hide().fadeIn(FADE_TIME);
        }
        if (options.prepend) {
            $messages.prepend($el);
        } else {
            $messages.append($el);
        }
        $messages[0].scrollTop = $messages[0].scrollHeight;
    }
function addMessageElement ( el , options ) { let $el = $ ( el ) ; if ( ! options ) { options = { } ; } if ( typeof options . fade === 'undefined' ) { options . fade = true ; } if ( typeof options . prepend === 'undefined' ) { options . prepend = false ; } if ( options . fade ) { $el . hide ( ) . fadeIn ( FADE_TIME ) ; } if ( options . prepend ) { $messages . prepend ( $el ) ; } else { $messages . append ( $el ) ; } $messages [ 0 ] . scrollTop = $messages [ 0 ] . scrollHeight ; }
all other messages (default = false)
all other messages ( default = false )
// Setup default options // Apply options