mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-25 03:58:30 +00:00
4.20.85
* Added: Option to display modified Twitch emotes in the emote menu. * Fixed: Use parenthesis counting to ensure links surrounded in `)` don't include the `)`, matching Twitch behavior. Closes #1015 * Fixed: Issue with Native Sorting for the emote menu where the first emote is sent to the end of the list. * Fixed: Emote Menu not appearing correctly in whispers. * Fixed: Favorites section not appearing in the Emote Menu when emoji are disabled. * Fixed: The Stream Latency and Up-time metadata unnecessarily changing width due to Twitch's default font.
This commit is contained in:
parent
1cdff0ec67
commit
c03c2e48b5
6 changed files with 183 additions and 209 deletions
|
@ -162,41 +162,39 @@ export const Links = {
|
|||
const text = token.text;
|
||||
let idx = 0, match;
|
||||
|
||||
//if ( use_new ) {
|
||||
while((match = NEW_LINK_REGEX.exec(text))) {
|
||||
const nix = match.index;
|
||||
if ( idx !== nix )
|
||||
out.push({type: 'text', text: text.slice(idx, nix)});
|
||||
|
||||
let url = match[0];
|
||||
if ( url.endsWith(')') ) {
|
||||
let open = 1, i = url.length - 1;
|
||||
while(i--) {
|
||||
const chr = url[i];
|
||||
if ( chr === ')' )
|
||||
open++;
|
||||
else if ( chr === '(' )
|
||||
open--;
|
||||
|
||||
if ( ! open )
|
||||
break;
|
||||
}
|
||||
|
||||
if ( open )
|
||||
url = url.slice(0, url.length - 1);
|
||||
}
|
||||
|
||||
out.push({
|
||||
type: 'link',
|
||||
url: `${match[1] ? '' : 'https://'}${match[0]}`,
|
||||
url: `${match[1] ? '' : 'https://'}${url}`,
|
||||
is_mail: false,
|
||||
text: match[0]
|
||||
text: url
|
||||
});
|
||||
|
||||
idx = nix + match[0].length;
|
||||
idx = nix + url.length;
|
||||
}
|
||||
|
||||
/*} else {
|
||||
while((match = LINK_REGEX.exec(text))) {
|
||||
const nix = match.index + (match[1] ? match[1].length : 0);
|
||||
if ( idx !== nix )
|
||||
out.push({type: 'text', text: text.slice(idx, nix)});
|
||||
|
||||
const is_mail = ! match[3] && match[2].indexOf('/') === -1 && match[2].indexOf('@') !== -1;
|
||||
|
||||
out.push({
|
||||
type: 'link',
|
||||
url: (match[3] ? '' : is_mail ? 'mailto:' : 'https://') + match[2],
|
||||
is_mail,
|
||||
text: match[2]
|
||||
});
|
||||
|
||||
idx = nix + match[2].length;
|
||||
}
|
||||
}*/
|
||||
|
||||
if ( idx < text.length )
|
||||
out.push({type: 'text', text: text.slice(idx)});
|
||||
}
|
||||
|
@ -1521,6 +1519,16 @@ export const AddonEmotes = {
|
|||
}
|
||||
}
|
||||
|
||||
/*AddonEmotes.tooltip.interactive = function(target) {
|
||||
const mods = target.dataset.modifiers;
|
||||
return mods && mods.length > 0;
|
||||
}
|
||||
|
||||
AddonEmotes.tooltip.delayHide = function(target) {
|
||||
const mods = target.dataset.modifiers;
|
||||
return mods && mods.length > 0 ? 100 : 0;
|
||||
}*/
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// Emoji
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue