1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00

4.0.0-rc13.22

* Added: Support for clicking Twitch emotes to open information cards.
* Added: Option to allow clicking blocked terms in chat to reveal the term.
* Fixed: Twitch Experiments not being detected properly.
This commit is contained in:
SirStendec 2019-01-18 19:07:57 -05:00
parent 360d19e4bf
commit 9b95efb459
7 changed files with 265 additions and 21 deletions

View file

@ -93,6 +93,33 @@ export default class Emotes extends Module {
}
});
this.settings.add('chat.click-emotes', {
default: true,
ui: {
path: 'Chat > Behavior >> General',
title: 'Open emote information pages by Shift-Clicking them.',
component: 'setting-check-box'
}
});
this.settings.add('chat.sub-emotes', {
default: true,
ui: {
path: 'Chat > Behavior >> General',
title: 'Open Twitch subscription pages by Shift-Clicking emotes when relevant.',
component: 'setting-check-box'
}
});
this.settings.add('chat.emote-dialogs', {
default: true,
ui: {
path: 'Chat > Behavior >> General',
title: 'Open emote information cards for Twitch emotes by clicking them.',
component: 'setting-check-box'
}
});
// Because this may be used elsewhere.
this.handleClick = this.handleClick.bind(this);
@ -303,6 +330,29 @@ export default class Emotes extends Module {
return true;
}
if ( provider === 'twitch' && this.parent.context.get('chat.emote-dialogs') ) {
const fine = this.resolve('site.fine');
if ( ! fine )
return;
const chat = fine.searchParent(target, n => n.props && n.props.onEmoteClick);
if ( ! chat || ! chat.props || ! chat.props.message )
return;
const props = chat.props;
props.onEmoteClick({
channelID: props.channelID || '',
channelLogin: props.channelLogin || '',
emoteID: ds.id,
emoteCode: target.alt,
sourceID: 'chat',
referrerID: '',
initialTopOffset: target.getBoundingClientRect().bottom
});
return true;
}
}