chat/static/js/app.js
// add a user div in list
add a user div in list
add a user div in list
function addUserDiv(user, user_fullname) {
    var userItem = `<div class="item mb-2">
                        <a role="button" user="${user}" class="user btn btn-outline-secondary w-75 p-3"`;
    if (user == currentUser) userItem += `>Scrivi a tutti</a>`;
    else userItem += `>${user_fullname}</a> &nbsp;&nbsp;`;
    if (currentUser != user)
        userItem += `<svg class="icon icon-danger icon-xs item_delete">
                        <use xlink:href="/static/svg/sprite.svg#it-close-circle"></use>
                    </svg>`;
    userItem += `</div>`;
    $(userItem).appendTo(userList);
    addClickEvent();
    addRemoveEvent();
}
function addUserDiv ( user , user_fullname ) { var userItem = ` ${ user } ` ; if ( user == currentUser ) userItem += ` ` ; else userItem += ` ${ user_fullname } ` ; if ( currentUser != user ) userItem += ` ` ; userItem += ` ` ; $ ( userItem ) . appendTo ( userList ) ; addClickEvent ( ) ; addRemoveEvent ( ) ; }
add a user div in list
add a user div in list
// build HTML user element in list