1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-03 00:18:31 +00:00
* Added: Support for Twitch's replies and threads system. The experiment is currently disabled, but if it returns we want to support it.
* Added: Option to automatically skip channel trailers.
* Fixed: Incorrect appearance of aspect-ratio controlled elements, due to Twitch removing their aspect ratio CSS.
* Fixed: Incorrect color applied to text buttons with a custom accent color set.
* API Added: `chat:get-tab-commands` event for adding custom chat commands to tab-completion.
* API Added: `reply` icon.
This commit is contained in:
SirStendec 2020-08-12 16:10:06 -04:00
parent 6c0c421d0a
commit 463c9f9a45
30 changed files with 536 additions and 40 deletions

View file

@ -232,6 +232,61 @@ Links.tooltip.delayHide = function(target) {
}*/
// ============================================================================
// Replies (Styled Like Mentions)
// ============================================================================
export const Replies = {
type: 'reply',
priority: 0,
component: () => null,
render(token, createElement) {
let color = token.color;
if ( color ) {
const chat = this.resolve('site.chat');
color = chat ? chat.colors.process(color) : color;
}
return (<strong
class={`chat-line__message-mention ffz-tooltip ffz--reply-mention ffz-i-reply${token.me ? ' ffz--mention-me' : ''}`}
style={{color}}
data-tooltip-type="reply"
data-login={token.recipient}
onClick={this.handleReplyClick}
>
{token.text}
</strong>)
},
tooltip(target) {
const fine = this.resolve('site.fine');
if ( ! target || ! fine )
return null;
const chat = fine.searchParent(target, n => n.props && n.props.reply && n.setOPCardTray),
reply = chat?.props?.reply;
if ( ! reply )
return null;
return [
createElement('strong', {}, this.i18n.t('chat.reply-to', 'Replying To:')),
'\n\n',
createElement('div', {className: 'tw-align-left'}, [
createElement('strong', {}, reply.parentDisplayName),
': ',
reply.parentMessageBody
])
];
},
process(tokens) {
return tokens;
}
}
// ============================================================================
// Mentions
// ============================================================================