mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-06 02:58:31 +00:00
4.0.0-rc11
* Added "Chat > Behavior > Deleted Message Style" setting to customize how deleted messages appear when set to always be visible. * Added "Chat > Filtering > Filter your own messages." setting to control whether or not your own chat messages are filtered. Defaults to disabled. * Fixed: Channel Hosting, via better detection of new vs old channel component style.
This commit is contained in:
parent
25069e1298
commit
089bc6d715
9 changed files with 54 additions and 18 deletions
|
@ -100,7 +100,7 @@ class FrankerFaceZ extends Module {
|
|||
FrankerFaceZ.Logger = Logger;
|
||||
|
||||
const VER = FrankerFaceZ.version_info = {
|
||||
major: 4, minor: 0, revision: 0, extra: '-rc10.1',
|
||||
major: 4, minor: 0, revision: 0, extra: '-rc11',
|
||||
commit: __git_commit__,
|
||||
build: __webpack_hash__,
|
||||
toString: () =>
|
||||
|
|
|
@ -140,13 +140,34 @@ export default class Chat extends Module {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
this.settings.add('chat.filtering.show-deleted', {
|
||||
default: false,
|
||||
ui: {
|
||||
path: 'Chat > Behavior >> Deleted Messages',
|
||||
title: 'Always display deleted messages.',
|
||||
description: 'Deleted messages will be faded and displayed with a line through the message text.',
|
||||
description: 'Deleted messages will be displayed differently for differentiation, but never hidden behind <message deleted>.',
|
||||
component: 'setting-check-box'
|
||||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.filtering.deleted-style', {
|
||||
default: 1,
|
||||
ui: {
|
||||
path: 'Chat > Behavior >> Deleted Messages',
|
||||
title: 'Deleted Message Style',
|
||||
component: 'setting-select-box',
|
||||
data: [
|
||||
{value: 0, title: 'Faded'},
|
||||
{value: 1, title: 'Faded, Line Through'}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.filtering.process-own', {
|
||||
default: false,
|
||||
ui: {
|
||||
path: 'Chat > Filtering >> Behavior',
|
||||
title: 'Filter your own messages.',
|
||||
component: 'setting-check-box'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -274,10 +274,13 @@ export const CustomHighlights = {
|
|||
return (<strong class="ffz--highlight">{token.text}</strong>);
|
||||
},
|
||||
|
||||
process(tokens, msg) {
|
||||
process(tokens, msg, user) {
|
||||
if ( ! tokens || ! tokens.length )
|
||||
return tokens;
|
||||
|
||||
if ( user && user.login && user.login == msg.user.login && ! this.context.get('chat.filtering.process-own') )
|
||||
return tokens;
|
||||
|
||||
const colors = this.context.get('chat.filtering.highlight-basic-terms--color-regex');
|
||||
if ( ! colors || ! colors.size )
|
||||
return tokens;
|
||||
|
@ -390,10 +393,13 @@ export const BlockedTerms = {
|
|||
]
|
||||
},
|
||||
|
||||
process(tokens, msg) {
|
||||
process(tokens, msg, user) {
|
||||
if ( ! tokens || ! tokens.length )
|
||||
return tokens;
|
||||
|
||||
if ( user && user.login && user.login == msg.user.login && ! this.context.get('chat.filtering.process-own') )
|
||||
return tokens;
|
||||
|
||||
const regexes = this.context.get('chat.filtering.highlight-basic-blocked--regex');
|
||||
if ( ! regexes )
|
||||
return tokens;
|
||||
|
|
|
@ -62,7 +62,7 @@ export default class MainMenu extends Module {
|
|||
if ( version === window.FrankerFaceZ.version_info.commit )
|
||||
return;
|
||||
|
||||
this.log.info('New Version Available', version);
|
||||
this.log.info('New Version:', version);
|
||||
this.has_update = true;
|
||||
|
||||
const mb = this.resolve('site.menu_button');
|
||||
|
|
|
@ -129,7 +129,7 @@ export default class Channel extends Module {
|
|||
return;
|
||||
|
||||
const t = this,
|
||||
new_style = has(inst.state, 'hostMode');
|
||||
new_style = !!inst.hostModeFromGraphQL;
|
||||
|
||||
inst.ffzGetChannel = () => {
|
||||
const params = inst.props.match.params
|
||||
|
@ -143,14 +143,17 @@ export default class Channel extends Module {
|
|||
inst.setState = function(state, ...args) {
|
||||
try {
|
||||
if ( new_style ) {
|
||||
const expected = inst.ffzGetChannel();
|
||||
if ( has(state, 'hostMode') ) {
|
||||
t.log.info('update-host', state.hostMode)
|
||||
|
||||
inst.ffzExpectedHost = state.hostMode;
|
||||
if ( state.hostMode && ! t.settings.get('channel.hosting.enable') ) {
|
||||
state.hostMode = null;
|
||||
state.videoPlayerSource = inst.ffzGetChannel();
|
||||
state.videoPlayerSource = expected;
|
||||
}
|
||||
|
||||
} else if ( has(state, 'videoPlayerSource') ) {
|
||||
if ( state.videoPlayerSource !== expected && ! t.settings.get('channel.hosting.enable') )
|
||||
state.videoPlayerSource = expected;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -174,13 +177,12 @@ export default class Channel extends Module {
|
|||
|
||||
if ( new_style ) {
|
||||
const hosted = inst.ffzExpectedHost = inst.state.hostMode;
|
||||
t.log.info('Expected Host', hosted);
|
||||
|
||||
if ( hosted && ! this.settings.get('channel.hosting.enable') )
|
||||
if ( hosted && ! this.settings.get('channel.hosting.enable') ) {
|
||||
inst.ffzOldSetState({
|
||||
hostMode: null,
|
||||
videoPlayerSource: inst.props.match.params.channelName
|
||||
videoPlayerSource: inst.ffzGetChannel()
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
inst.ffzOldGetHostedLogin = inst.getHostedChannelLogin;
|
||||
|
|
|
@ -372,6 +372,11 @@ export default class ChatHook extends Module {
|
|||
this.chat.context.on('changed:chat.bits.show-pinned', val =>
|
||||
this.css_tweaks.toggleHide('pinned-cheer', !val));
|
||||
|
||||
this.chat.context.on('changed:chat.filtering.deleted-style', val =>
|
||||
this.css_tweaks.toggle('chat-deleted-strike', val === 1))
|
||||
|
||||
this.css_tweaks.toggle('chat-deleted-strike', this.chat.context.get('chat.filtering.deleted-style') === 1);
|
||||
|
||||
this.css_tweaks.toggleHide('pinned-cheer', !this.chat.context.get('chat.bits.show-pinned'));
|
||||
this.css_tweaks.toggle('hide-bits', !this.chat.context.get('chat.bits.show'));
|
||||
this.css_tweaks.toggle('chat-rows', this.chat.context.get('chat.lines.alternate'));
|
||||
|
|
|
@ -60,6 +60,7 @@ export default class ChatLine extends Module {
|
|||
this.chat.context.on('changed:chat.rich.hide-tokens', this.updateLines, this);
|
||||
this.chat.context.on('changed:chat.actions.inline', this.updateLines, this);
|
||||
this.chat.context.on('changed:chat.filtering.show-deleted', this.updateLines, this);
|
||||
this.chat.context.on('changed:chat.filtering.process-own', this.updateLines, this);
|
||||
this.chat.context.on('changed:chat.filtering.highlight-basic-terms--color-regex', this.updateLines, this);
|
||||
this.chat.context.on('changed:chat.filtering.highlight-basic-blocked--regex', this.updateLines, this);
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
.ffz--deleted-message {
|
||||
.message {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
|
@ -23,10 +23,6 @@
|
|||
&:not(:hover) > * {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.message {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue