mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-05 18:48:31 +00:00
4.0.0-rc13.15
* Fixed: Viewer Cards not opening when clicking usernames in chat. (Twitch renamed the method.) * Fixed: BetterTTV compatibility regarding BetterTTV's "hat" emotes not appearing positioned correctly. (Fixes #553)
This commit is contained in:
parent
f2700db821
commit
9117ac89d2
3 changed files with 24 additions and 10 deletions
|
@ -149,7 +149,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`
|
|||
FrankerFaceZ.Logger = Logger;
|
||||
|
||||
const VER = FrankerFaceZ.version_info = {
|
||||
major: 4, minor: 0, revision: 0, extra: '-rc13.14',
|
||||
major: 4, minor: 0, revision: 0, extra: '-rc13.15',
|
||||
commit: __git_commit__,
|
||||
build: __webpack_hash__,
|
||||
toString: () =>
|
||||
|
|
|
@ -10,7 +10,7 @@ import {has, split_chars} from 'utilities/object';
|
|||
import {TWITCH_EMOTE_BASE, REPLACEMENT_BASE, REPLACEMENTS} from 'utilities/constants';
|
||||
|
||||
|
||||
const EMOTE_CLASS = 'chat-line__message--emote',
|
||||
const EMOTE_CLASS = 'chat-image chat-line__message--emote',
|
||||
LINK_REGEX = /([^\w@#%\-+=:~])?((?:(https?:\/\/)?(?:[\w@#%\-+=:~]+\.)+[a-z]{2,6}(?:\/[\w./@#%&()\-+=:?~]*)?))([^\w./@#%&()\-+=:?~]|\s|$)/g,
|
||||
MENTION_REGEX = /([^\w@#%\-+=:~])?(@([^\u0000-\u007F]+|\w+)+)([^\w./@#%&()\-+=:?~]|\s|$)/g; // eslint-disable-line no-control-regex
|
||||
|
||||
|
@ -595,7 +595,7 @@ export const CheerEmotes = {
|
|||
// Addon Emotes
|
||||
// ============================================================================
|
||||
|
||||
const render_emote = (token, createElement) => {
|
||||
const render_emote = (token, createElement, wrapped) => {
|
||||
const mods = token.modifiers || [], ml = mods.length,
|
||||
emote = createElement('img', {
|
||||
class: `${EMOTE_CLASS} ffz-tooltip${token.provider === 'ffz' ? ' ffz-emote' : token.provider === 'emoji' ? ' ffz-emoji' : ''}`,
|
||||
|
@ -614,17 +614,26 @@ const render_emote = (token, createElement) => {
|
|||
}
|
||||
});
|
||||
|
||||
if ( ! ml )
|
||||
return emote;
|
||||
if ( ! ml ) {
|
||||
if ( wrapped )
|
||||
return emote;
|
||||
|
||||
return createElement('span', {
|
||||
attrs: {
|
||||
'data-a-target': 'emote-name'
|
||||
}
|
||||
}, [emote]);
|
||||
}
|
||||
|
||||
return createElement('span', {
|
||||
class: `${EMOTE_CLASS} modified-emote`,
|
||||
attrs: {
|
||||
'data-a-target': 'emote-name',
|
||||
'data-provider': token.provider,
|
||||
'data-id': token.id,
|
||||
'data-set': token.set
|
||||
}
|
||||
}, [emote, mods.map(x => createElement('span', {key: x.text}, render_emote(x, createElement)))])
|
||||
}, [emote, mods.map(x => createElement('span', {key: x.text}, render_emote(x, createElement, true)))])
|
||||
}
|
||||
|
||||
|
||||
|
@ -639,7 +648,7 @@ export const AddonEmotes = {
|
|||
}
|
||||
},
|
||||
|
||||
render(token, createElement) {
|
||||
render(token, createElement, wrapped) {
|
||||
const mods = token.modifiers || [], ml = mods.length,
|
||||
emote = (<img
|
||||
class={`${EMOTE_CLASS} ffz-tooltip${token.provider === 'ffz' ? ' ffz-emote' : token.provider === 'emoji' ? ' ffz-emoji' : ''}`}
|
||||
|
@ -657,11 +666,16 @@ export const AddonEmotes = {
|
|||
onClick={this.emotes.handleClick}
|
||||
/>);
|
||||
|
||||
if ( ! ml )
|
||||
return emote;
|
||||
if ( ! ml ) {
|
||||
if ( wrapped )
|
||||
return emote;
|
||||
|
||||
return (<span data-a-target="emote-name">{emote}</span>);
|
||||
}
|
||||
|
||||
return (<span
|
||||
class={`${EMOTE_CLASS} modified-emote`}
|
||||
data-a-target="emote-name"
|
||||
data-provider={token.provider}
|
||||
data-id={token.id}
|
||||
data-set={token.set}
|
||||
|
|
|
@ -284,7 +284,7 @@ export default class ChatLine extends Module {
|
|||
bg_css = msg.mentioned && msg.mention_color ? t.parent.inverse_colors.process(msg.mention_color) : null;
|
||||
|
||||
if ( ! this.ffz_user_click_handler )
|
||||
this.ffz_user_click_handler = this.usernameClickHandler; //event => event.ctrlKey ? this.usernameClickHandler(event) : t.viewer_cards.openCard(r, user, event);
|
||||
this.ffz_user_click_handler = this.openViewerCard || this.usernameClickHandler; //event => event.ctrlKey ? this.usernameClickHandler(event) : t.viewer_cards.openCard(r, user, event);
|
||||
|
||||
let cls = `chat-line__message${show_class ? ' ffz--deleted-message' : ''}`,
|
||||
out = (tokens.length || ! msg.ffz_type) ? [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue