1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-17 10:16:57 +00:00

Add convenience method for creating CSS variable or setting blocks of CSS directly in css_tweaks. Start using those variables for things like chat width. Add the ability to highlight messages with mentions in them. Fix Sidebar Swap and Theatre Mode. Closes #312

This commit is contained in:
SirStendec 2017-11-17 14:59:46 -05:00
parent a45dc472b7
commit 6da5d4c8b5
14 changed files with 213 additions and 49 deletions

View file

@ -53,8 +53,10 @@ export default class ChatLine extends Module {
cls.prototype.render = function() {
const msg = this.props.message,
is_action = msg.type === 1,
const types = t.chat.chatTypes || {},
msg = this.props.message,
is_action = msg.type === types.Action,
user = msg.user,
color = t.parent.colors.process(user.color),
/*bg_rgb = Color.RGBA.fromHex(user.color),
@ -67,11 +69,11 @@ export default class ChatLine extends Module {
if ( ! msg.message && msg.messageParts )
detokenizeMessage(msg);
const tokens = t.chat.tokenizeMessage(msg),
const tokens = t.chat.tokenizeMessage(msg, {login: this.props.currentUserLogin, display: this.props.currentUserDisplayName}),
fragment = t.chat.renderTokens(tokens, e);
const out = e('div', {
className: 'chat-line__message',
className: `chat-line__message ${msg.mentioned ? 'ffz-mentioned' : ''}`,
//style: { backgroundColor: bg_css },
'data-room-id': this.props.channelID,
'data-room': room,