mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added toggle for "Highlight Mentions"
This commit is contained in:
@@ -42,6 +42,7 @@ const ignoreChatters = urlParams.get("ignoreChatters") || "";
|
|||||||
const scrollDirection = GetIntParam("scrollDirection", 1);
|
const scrollDirection = GetIntParam("scrollDirection", 1);
|
||||||
const groupConsecutiveMessages = GetBooleanParam("groupConsecutiveMessages", false);
|
const groupConsecutiveMessages = GetBooleanParam("groupConsecutiveMessages", false);
|
||||||
const inlineChat = GetBooleanParam("inlineChat", false);
|
const inlineChat = GetBooleanParam("inlineChat", false);
|
||||||
|
const highlightMentions = GetBooleanParam("highlightMentions", true);
|
||||||
const imageEmbedPermissionLevel = GetIntParam("imageEmbedPermissionLevel", 20);
|
const imageEmbedPermissionLevel = GetIntParam("imageEmbedPermissionLevel", 20);
|
||||||
const showYouTubeLinkPreviews = GetBooleanParam("showYouTubeLinkPreviews", true);
|
const showYouTubeLinkPreviews = GetBooleanParam("showYouTubeLinkPreviews", true);
|
||||||
|
|
||||||
@@ -672,7 +673,7 @@ async function TwitchChatMessage(data) {
|
|||||||
// Highlight mentions
|
// Highlight mentions
|
||||||
const mentionRgx = new RegExp(`(^|\\s)@${twitchUsername}(\\s|$)`, 'i');
|
const mentionRgx = new RegExp(`(^|\\s)@${twitchUsername}(\\s|$)`, 'i');
|
||||||
const mention = mentionRgx.test(data.text);
|
const mention = mentionRgx.test(data.text);
|
||||||
if (mention && showMessage)
|
if (mention && highlightMentions && showMessage)
|
||||||
messageContainerDiv.classList.add("highlightMessage");
|
messageContainerDiv.classList.add("highlightMessage");
|
||||||
|
|
||||||
// Set furry mode
|
// Set furry mode
|
||||||
@@ -1371,7 +1372,7 @@ async function YouTubeMessage(data) {
|
|||||||
// Highlight mentions
|
// Highlight mentions
|
||||||
const mentionRgx = new RegExp(`(^|\\s)@${youtubeUsername}(\\s|$)`, 'i');
|
const mentionRgx = new RegExp(`(^|\\s)@${youtubeUsername}(\\s|$)`, 'i');
|
||||||
const mention = mentionRgx.test(message);
|
const mention = mentionRgx.test(message);
|
||||||
if (mention && showMessage)
|
if (mention && highlightMentions && showMessage)
|
||||||
messageContainerDiv.classList.add("highlightMessage");
|
messageContainerDiv.classList.add("highlightMessage");
|
||||||
|
|
||||||
// Set furry mode
|
// Set furry mode
|
||||||
@@ -2348,7 +2349,7 @@ async function KickChatMessage(data) {
|
|||||||
// Highlight mentions
|
// Highlight mentions
|
||||||
const mentionRgx = new RegExp(`(^|\\s)@${kickUsername}(\\s|$)`, 'i');
|
const mentionRgx = new RegExp(`(^|\\s)@${kickUsername}(\\s|$)`, 'i');
|
||||||
const mention = mentionRgx.test(message);
|
const mention = mentionRgx.test(message);
|
||||||
if (mention && showMessage)
|
if (mention && highlightMentions && showMessage)
|
||||||
messageContainerDiv.classList.add("highlightMessage");
|
messageContainerDiv.classList.add("highlightMessage");
|
||||||
|
|
||||||
// Set furry mode
|
// Set furry mode
|
||||||
|
|||||||
@@ -192,6 +192,14 @@
|
|||||||
"defaultValue": false,
|
"defaultValue": false,
|
||||||
"group": "General"
|
"group": "General"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "highlightMentions",
|
||||||
|
"label": "Highlight Mentions",
|
||||||
|
"description": "Highlight messages that mention the streamer",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": true,
|
||||||
|
"group": "General"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "imageEmbedPermissionLevel",
|
"id": "imageEmbedPermissionLevel",
|
||||||
"label": "Embed Images",
|
"label": "Embed Images",
|
||||||
|
|||||||
Reference in New Issue
Block a user