client/src/views/channel.js
function(word, colourise) {
        var members, member, nick, nick_re, style = '';

        if (!(members = this.model.get('members')) || !(member = members.getByNick(word))) {
            return;
        }

        nick = member.get('nick');

        if (colourise !== false) {
            // Use the nick from the member object so the style matches the letter casing
            style = this.getNickStyles(nick).asCssString();
        }
        nick_re = new RegExp('(.*)(' + _.escapeRegExp(nick) + ')(.*)', 'i');
        return word.replace(nick_re, function (__, before, nick_in_orig_case, after) {
            return _.escape(before)
                + '<span class="inline-nick" style="' + style + '; cursor:pointer" data-nick="' + _.escape(nick) + '">'
                + _.escape(nick_in_orig_case)
                + '</span>'
                + _.escape(after);
        });
    }
function(word, colourise) {
        var members, member, nick, nick_re, style = '';

        if (!(members = this.model.get('members')) || !(member = members.getByNick(word))) {
            return;
        }

        nick = member.get('nick');

        if (colourise !== false) {
            // Use the nick from the member object so the style matches the letter casing
            style = this.getNickStyles(nick).asCssString();
        }
        nick_re = new RegExp('(.*)(' + _.escapeRegExp(nick) + ')(.*)', 'i');
        return word.replace(nick_re, function (__, before, nick_in_orig_case, after) {
            return _.escape(before)
                + '<span class="inline-nick" style="' + style + '; cursor:pointer" data-nick="' + _.escape(nick) + '">'
                + _.escape(nick_in_orig_case)
                + '</span>'
                + _.escape(after);
        });
    }
function ( word , colourise ) { var members , member , nick , nick_re , style = '' ; if ( ! ( members = this . model . get ( 'members' ) ) || ! ( member = members . getByNick ( word ) ) ) { return ; } nick = member . get ( 'nick' ) ; if ( colourise !== false ) { // Use the nick from the member object so the style matches the letter casing style = this . getNickStyles ( nick ) . asCssString ( ) ; } nick_re = new RegExp ( '(.*)(' + _ . escapeRegExp ( nick ) + ')(.*)' , 'i' ) ; return word . replace ( nick_re , function ( __ , before , nick_in_orig_case , after ) { return _ . escape ( before ) + '<span class="inline-nick" style="' + style + '; cursor:pointer" data-nick="' + _ . escape ( nick ) + '">' + _ . escape ( nick_in_orig_case ) + '</span>' + _ . escape ( after ) ; } ) ; }
Let nicks be clickable + colourise within messages
Let nicks be clickable + colourise within messages