1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-09 07:40:53 +00:00
* Added: Support for combined emoji using a workaround that compensates for Twitch chat eating unicode it shouldn't. (See #1147 for more details)
* Added: Setting to change how emotes are sorted when using tab completion. Applies to the In-Line Tab Completion add-on as well as the default tab completion.
* Added: Setting to disable a browser's "automatic dark theme" features when supported. This primarily applies to Chromium browsers.
* Added: Ability to make emoji larger in addition to emotes using the "Larger Emotes" setting.
* Fixed: Better handling of community introduction messages.
* Fixed: Catch more chat line rendering errors to prevent chat from breaking entirely.
* Fixed: Chat on Videos not appearing with the chat background color.
* API Changed: Rich Tokens now support `ref` tokens in `header` tokens.
* API Changed: Rich Tokens now support `link` tokens with no content, automatically setting their content to their URLs.
This commit is contained in:
SirStendec 2022-02-11 15:17:32 -05:00
parent feae6bcb89
commit 969ed29668
11 changed files with 360 additions and 81 deletions

View file

@ -249,9 +249,17 @@ export default renderTokens;
// Token Type: Reference
// ============================================================================
function resolveToken(token, ctx) {
if ( token?.type === 'ref' ) {
return ctx.fragments?.[token.name] ?? null;
}
return token;
}
TOKEN_TYPES.ref = function(token, createElement, ctx) {
const frag = ctx.fragments?.[token.name];
if (frag )
if ( frag )
return renderTokens(frag, createElement, ctx);
}
@ -561,9 +569,10 @@ function header_vue(token, h, ctx) {
]
}, content);
let imtok = token.sfw_image;
if ( token.image && canShowImage(token.image, ctx) )
imtok = token.image;
let imtok = resolveToken(token.sfw_image, ctx);
const nsfw_token = resolveToken(token.image, ctx);
if ( nsfw_token && canShowImage(nsfw_token, ctx) )
imtok = nsfw_token;
if ( imtok ) {
const aspect = imtok.aspect;
@ -651,9 +660,10 @@ function header_normal(token, createElement, ctx) {
className: `tw-flex tw-full-width tw-overflow-hidden ${token.compact ? 'ffz--rich-header ffz--compact-header tw-align-items-center' : 'tw-justify-content-center tw-flex-column tw-flex-grow-1'}`
}, content);
let imtok = token.sfw_image;
if ( token.image && canShowImage(token.image, ctx) )
imtok = token.image;
let imtok = resolveToken(token.sfw_image, ctx);
const nsfw_token = resolveToken(token.image, ctx);
if ( nsfw_token && canShowImage(nsfw_token, ctx) )
imtok = nsfw_token;
if ( imtok ) {
const aspect = imtok.aspect;
@ -839,6 +849,9 @@ TOKEN_TYPES.i18n = function(token, createElement, ctx) {
// ============================================================================
TOKEN_TYPES.link = function(token, createElement, ctx) {
if ( token.content === undefined )
token.content = token.url;
const content = renderTokens(token.content, createElement, ctx, token.markdown);
const klass = [];