1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 10:06:54 +00:00
This commit is contained in:
J. Akbary 2022-05-20 00:00:58 -04:00 committed by GitHub
commit 785eb10980
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 1 deletions

View file

@ -17,6 +17,23 @@ export default class ViewerCards extends Module {
this.last_login = null;
this.settings.add('chat.viewer-cards.viewer-card-gift-subscribe-button', {
requires: ['channel.hide-all-sub-gifting'],
default: null,
process(ctx, val) {
if ( val != null )
return val;
return ctx.get('channel.hide-all-sub-gifting')
},
ui: {
path: 'Chat > Viewer Cards >> Appearance',
title: 'Hide "Gift a Sub" button on viewer cards',
description: 'By default, this inherits its value from [Channel > Appearance > Hide all "Gift a Sub" button](~channel.appearance)',
component: 'setting-check-box'
},
});
this.settings.add('chat.viewer-cards.highlight-chat', {
default: false,
ui: {
@ -52,6 +69,9 @@ export default class ViewerCards extends Module {
onEnable() {
this.chat.context.on('changed:chat.viewer-cards.highlight-chat', this.refreshStyle, this);
this.chat.context.on('changed:chat.viewer-cards.color', this.refreshStyle, this);
this.chat.context.getChanges('chat.viewer-cards.viewer-card-gift-subscribe-button', val =>
this.css_tweaks.toggleHide('viewer-card-gift-subscribe-button', val)
);
this.on('..:update-colors', this.refreshStyle, this);
this.ViewerCard.on('mount', this.updateCard, this);

View file

@ -46,7 +46,9 @@ const CLASSES = {
'not-live-bar': 'div[data-test-selector="non-live-video-banner-layout"]',
'channel-live-ind': '.channel-header__user .tw-channel-status-text-indicator,.channel-info-content .tw-halo__indicator',
'celebration': 'body .celebration__overlay',
'mod-view': '.chat-input__buttons-container a[href*="/moderator"]'
'mod-view': '.chat-input__buttons-container a[href*="/moderator"]',
'viewer-card-gift-subscribe-button': '.viewer-card button[data-test-selector="gift-subscribe-button"]'
};
@ -405,6 +407,16 @@ export default class CSSTweaks extends Module {
changed: val => this.toggle('hide-unfollow-button', val)
});
this.settings.add('channel.hide-all-sub-gifting', {
default: false,
ui: {
path: 'Channel > Appearance >> General',
title: 'Hide all "Gift a Sub" button.',
component: 'setting-check-box'
},
changed: val => this.toggle('hide-all-sub-gifting', val)
});
this.settings.add('channel.hide-live-indicator', {
requires: ['context.route.name'],
process(ctx, val) {
@ -459,6 +471,7 @@ export default class CSSTweaks extends Module {
this.toggleHide('prime-offers', !this.settings.get('layout.prime-offers'));
this.toggleHide('top-discover', !this.settings.get('layout.discover'));
this.toggle('hide-unfollow-button', this.settings.get('channel.hide-unfollow'));
this.toggle('hide-all-sub-gifting', this.settings.get('channel.hide-all-sub-gifting'));
this.toggle('square-avatars', ! this.settings.get('channel.round-avatars'));
//this.toggleHide('not-live-bar', this.settings.get('channel.hide-not-live-bar'));

View file

@ -0,0 +1,4 @@
.support-panel > div:not(.scrollable-area) button:not(.tw-interactable):not(.tw-purchase-button),
button[data-test-selector="gift-subscribe-button"] {
display: none !important;
}