mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-31 23:18:31 +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:
parent
360d19e4bf
commit
9b95efb459
7 changed files with 265 additions and 21 deletions
|
@ -43,6 +43,9 @@ export default class Chat extends Module {
|
|||
|
||||
this._link_info = {};
|
||||
|
||||
// Bind for JSX stuff
|
||||
this.clickToReveal = this.clickToReveal.bind(this);
|
||||
|
||||
this.style = new ManagedStyle;
|
||||
|
||||
this.context = this.settings.context({});
|
||||
|
@ -169,6 +172,15 @@ export default class Chat extends Module {
|
|||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.filtering.click-to-reveal', {
|
||||
default: false,
|
||||
ui: {
|
||||
path: 'Chat > Filtering >> Behavior',
|
||||
title: 'Click to reveal deleted terms.',
|
||||
component: 'setting-check-box'
|
||||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.filtering.show-deleted', {
|
||||
default: false,
|
||||
ui: {
|
||||
|
@ -540,25 +552,6 @@ export default class Chat 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'
|
||||
}
|
||||
});
|
||||
|
||||
const ts = new Date(0).toLocaleTimeString().toUpperCase(),
|
||||
default_24 = ts.lastIndexOf('PM') === -1 && ts.lastIndexOf('AM') === -1;
|
||||
|
||||
|
@ -758,6 +751,21 @@ export default class Chat extends Module {
|
|||
}
|
||||
|
||||
|
||||
clickToReveal(event) {
|
||||
const target = event.target;
|
||||
if ( target ) {
|
||||
if ( target._ffz_visible )
|
||||
target.textContent = '×××';
|
||||
else if ( ! this.context.get('chat.filtering.click-to-reveal') )
|
||||
return;
|
||||
else if ( target.dataset )
|
||||
target.textContent = target.dataset.text;
|
||||
|
||||
target._ffz_visible = ! target._ffz_visible;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
standardizeWhisper(msg) { // eslint-disable-line class-methods-use-this
|
||||
if ( ! msg )
|
||||
return msg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue