mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-06 06:10:54 +00:00
4.23.0
* Added: Setting to change how international display names are rendered in chat. * Fixed: Minor appearance issue with select box settings. * API Changed: Expose slightly more data through the built-in auto-completion handlers.
This commit is contained in:
parent
5ddc0c47e6
commit
a74faa95d3
8 changed files with 59 additions and 31 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "frankerfacez",
|
"name": "frankerfacez",
|
||||||
"version": "4.20.71",
|
"version": "4.22.9",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "frankerfacez",
|
"name": "frankerfacez",
|
||||||
"author": "Dan Salvato LLC",
|
"author": "Dan Salvato LLC",
|
||||||
"version": "4.22.9",
|
"version": "4.23.0",
|
||||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|
|
@ -182,6 +182,21 @@ export default class Chat extends Module {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.settings.add('chat.name-format', {
|
||||||
|
default: 0,
|
||||||
|
ui: {
|
||||||
|
path: 'Chat > Appearance >> Usernames',
|
||||||
|
title: 'Display Style',
|
||||||
|
description: 'Change how usernames are displayed in chat when users have an international display name set.',
|
||||||
|
component: 'setting-select-box',
|
||||||
|
data: [
|
||||||
|
{value: 0, title: 'International Name (Username) <Default>'},
|
||||||
|
{value: 1, title: 'International Name'},
|
||||||
|
{value: 2, title: 'Username'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.settings.add('chat.lines.emote-alignment', {
|
this.settings.add('chat.lines.emote-alignment', {
|
||||||
default: 0,
|
default: 0,
|
||||||
ui: {
|
ui: {
|
||||||
|
@ -1740,6 +1755,30 @@ export default class Chat extends Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format a user block. This uses our use "chat.name-format" style.
|
||||||
|
*
|
||||||
|
* @param {Object} user The user object we're rendering.
|
||||||
|
* @param {Function} e createElement method, either from React or utilities/dom.
|
||||||
|
* @returns {Array} Array of rendered elements.
|
||||||
|
*/
|
||||||
|
formatUser(user, e) {
|
||||||
|
const setting = this.context.get('chat.name-format');
|
||||||
|
const name = setting === 2 && user.isIntl ? user.login : (user.displayName || user.login);
|
||||||
|
|
||||||
|
const out = [e('span', {
|
||||||
|
className: 'chat-author__display-name'
|
||||||
|
}, name)];
|
||||||
|
|
||||||
|
if ( setting === 0 && user.isIntl )
|
||||||
|
out.push(e('span', {
|
||||||
|
className: 'chat-author__intl-login'
|
||||||
|
}, ` (${user.login})`));
|
||||||
|
|
||||||
|
return [out];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
formatTime(time) {
|
formatTime(time) {
|
||||||
if (!( time instanceof Date ))
|
if (!( time instanceof Date ))
|
||||||
time = new Date(time);
|
time = new Date(time);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
:class="{inherits: isInherited, default: isDefault}"
|
:class="{inherits: isInherited, default: isDefault}"
|
||||||
class="ffz--widget ffz--select-box"
|
class="ffz--widget ffz--select-box"
|
||||||
>
|
>
|
||||||
<div class="tw-flex tw-align-items-start">
|
<div class="tw-flex tw-align-items-center">
|
||||||
<label :for="item.full_key" class="tw-mg-y-05">
|
<label :for="item.full_key" class="tw-mg-y-05">
|
||||||
{{ t(item.i18n_key, item.title) }}
|
{{ t(item.i18n_key, item.title) }}
|
||||||
<span v-if="unseen" class="tw-pill">{{ t('setting.new', 'New') }}</span>
|
<span v-if="unseen" class="tw-pill">{{ t('setting.new', 'New') }}</span>
|
||||||
|
|
|
@ -46,6 +46,7 @@ export default class Line extends Module {
|
||||||
this.chat.context.on('changed:chat.rich.hide-tokens', this.updateLines, this);
|
this.chat.context.on('changed:chat.rich.hide-tokens', this.updateLines, this);
|
||||||
this.chat.context.on('changed:chat.rich.all-links', this.updateLines, this);
|
this.chat.context.on('changed:chat.rich.all-links', this.updateLines, this);
|
||||||
this.chat.context.on('changed:chat.rich.minimum-level', this.updateLines, this);
|
this.chat.context.on('changed:chat.rich.minimum-level', this.updateLines, this);
|
||||||
|
this.chat.context.on('changed:chat.name-format', this.updateLines, this);
|
||||||
this.chat.context.on('changed:tooltip.link-images', this.maybeUpdateLines, this);
|
this.chat.context.on('changed:tooltip.link-images', this.maybeUpdateLines, this);
|
||||||
this.chat.context.on('changed:tooltip.link-nsfw-images', this.maybeUpdateLines, this);
|
this.chat.context.on('changed:tooltip.link-nsfw-images', this.maybeUpdateLines, this);
|
||||||
|
|
||||||
|
@ -94,13 +95,10 @@ export default class Line extends Module {
|
||||||
t.chat.badges.render(msg, createElement)
|
t.chat.badges.render(msg, createElement)
|
||||||
}</span>
|
}</span>
|
||||||
<a
|
<a
|
||||||
class="clip-chat__message-author tw-font-size-5 ffz-link notranslate"
|
class="clip-chat__message-author tw-font-size-5 ffz-link notranslate tw-strong"
|
||||||
href={`https://www.twitch.tv/${user.login}/clips`}
|
href={`https://www.twitch.tv/${user.login}/clips`}
|
||||||
style={{color}}
|
style={{color}}
|
||||||
>
|
>{ t.chat.formatUser(user, createElement) }</a>
|
||||||
<span class="tw-strong chat-author__display_name">{ user.displayName }</span>
|
|
||||||
{user.isIntl && <span class="chat-author__intl-login"> ({user.login}) </span>}
|
|
||||||
</a>
|
|
||||||
<div class="tw-inline-block tw-mg-r-05">{
|
<div class="tw-inline-block tw-mg-r-05">{
|
||||||
is_action ? '' : ':'
|
is_action ? '' : ':'
|
||||||
}</div>
|
}</div>
|
||||||
|
|
|
@ -670,6 +670,7 @@ export default class Input extends Module {
|
||||||
if ( inst.doesEmoteMatchTerm(emote, search) ) {
|
if ( inst.doesEmoteMatchTerm(emote, search) ) {
|
||||||
const element = {
|
const element = {
|
||||||
current: input,
|
current: input,
|
||||||
|
emote,
|
||||||
replacement: emote.token,
|
replacement: emote.token,
|
||||||
element: inst.renderEmoteSuggestion(emote),
|
element: inst.renderEmoteSuggestion(emote),
|
||||||
favorite: emote.favorite,
|
favorite: emote.favorite,
|
||||||
|
@ -718,15 +719,20 @@ export default class Input extends Module {
|
||||||
|
|
||||||
if ( emoji && (style === 0 || source.has[style]) && ! included.has(source.raw) ) {
|
if ( emoji && (style === 0 || source.has[style]) && ! included.has(source.raw) ) {
|
||||||
included.add(source.raw);
|
included.add(source.raw);
|
||||||
|
|
||||||
|
const srcSet = this.emoji.getFullImageSet(source.image, style);
|
||||||
|
|
||||||
const favorite = favorites.includes(emoji.code);
|
const favorite = favorites.includes(emoji.code);
|
||||||
results.push({
|
results.push({
|
||||||
current: input,
|
current: input,
|
||||||
|
emoji: source,
|
||||||
|
srcSet,
|
||||||
replacement: source.raw,
|
replacement: source.raw,
|
||||||
element: inst.renderFFZEmojiSuggestion({
|
element: inst.renderFFZEmojiSuggestion({
|
||||||
token: `:${name}:`,
|
token: `:${name}:`,
|
||||||
id: `emoji-${emoji.code}`,
|
id: `emoji-${emoji.code}`,
|
||||||
src: this.emoji.getFullImage(source.image, style),
|
src: this.emoji.getFullImage(source.image, style),
|
||||||
srcSet: this.emoji.getFullImageSet(source.image, style),
|
srcSet,
|
||||||
favorite
|
favorite
|
||||||
}),
|
}),
|
||||||
favorite
|
favorite
|
||||||
|
@ -817,6 +823,7 @@ export default class Input extends Module {
|
||||||
if ( inst.doesEmoteMatchTerm(emote, search) )
|
if ( inst.doesEmoteMatchTerm(emote, search) )
|
||||||
results.push({
|
results.push({
|
||||||
current: input,
|
current: input,
|
||||||
|
emote,
|
||||||
replacement: emote.token,
|
replacement: emote.token,
|
||||||
element: inst.renderEmoteSuggestion(emote),
|
element: inst.renderEmoteSuggestion(emote),
|
||||||
favorite: emote.favorite,
|
favorite: emote.favorite,
|
||||||
|
|
|
@ -60,6 +60,7 @@ export default class ChatLine extends Module {
|
||||||
this.on('chat:update-lines', this.updateLines, this);
|
this.on('chat:update-lines', this.updateLines, this);
|
||||||
this.on('i18n:update', this.updateLines, this);
|
this.on('i18n:update', this.updateLines, this);
|
||||||
|
|
||||||
|
this.chat.context.on('changed:chat.name-format', this.updateLines, this);
|
||||||
this.chat.context.on('changed:chat.me-style', this.updateLines, this);
|
this.chat.context.on('changed:chat.me-style', this.updateLines, this);
|
||||||
this.chat.context.on('changed:chat.emotes.enabled', this.updateLines, this);
|
this.chat.context.on('changed:chat.emotes.enabled', this.updateLines, this);
|
||||||
this.chat.context.on('changed:chat.emotes.2x', this.updateLines, this);
|
this.chat.context.on('changed:chat.emotes.2x', this.updateLines, this);
|
||||||
|
@ -301,15 +302,7 @@ export default class ChatLine extends Module {
|
||||||
room_id = msg.roomId = r.id;
|
room_id = msg.roomId = r.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
const user_block = [
|
const user_block = t.chat.formatUser(user, e);
|
||||||
e('span', {
|
|
||||||
className: 'chat-author__display-name'
|
|
||||||
}, user.displayName),
|
|
||||||
user.isIntl && e('span', {
|
|
||||||
className: 'chat-author__intl-login'
|
|
||||||
}, ` (${user.login})`)
|
|
||||||
];
|
|
||||||
|
|
||||||
const override_name = t.overrides.getName(user.id);
|
const override_name = t.overrides.getName(user.id);
|
||||||
|
|
||||||
return e('span', {
|
return e('span', {
|
||||||
|
@ -505,15 +498,7 @@ other {# messages were deleted by a moderator.}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const user_block = [
|
const user_block = t.chat.formatUser(user, e);
|
||||||
e('span', {
|
|
||||||
className: 'chat-author__display-name'
|
|
||||||
}, user.displayName),
|
|
||||||
user.isIntl && e('span', {
|
|
||||||
className: 'chat-author__intl-login'
|
|
||||||
}, ` (${user.login})`)
|
|
||||||
];
|
|
||||||
|
|
||||||
const override_name = t.overrides.getName(user.id);
|
const override_name = t.overrides.getName(user.id);
|
||||||
|
|
||||||
const user_bits = [
|
const user_bits = [
|
||||||
|
|
|
@ -311,10 +311,9 @@ export default class VideoChatHook extends Module {
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
style={{color}}
|
style={{color}}
|
||||||
>
|
>{
|
||||||
<span class="chat-author__display-name" data-a-target="chat-message-username" data-a-user={user.login} data-test-selector="message-username">{ user.displayName }</span>
|
t.chat.formatUser(user, createElement)
|
||||||
{user.isIntl && <span class="chat-author__intl-login" data-test-selector="message-username-canonical"> ({ user.login})</span>}
|
}</a>
|
||||||
</a>
|
|
||||||
<div data-test-selector="comment-message-selector" class="tw-inline video-chat__message">
|
<div data-test-selector="comment-message-selector" class="tw-inline video-chat__message">
|
||||||
<span>{is_action ? ' ' : ': '}</span>
|
<span>{is_action ? ' ' : ': '}</span>
|
||||||
<span
|
<span
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue