From 3d27081316743e8a8bcb87f0583a2904d75544bf Mon Sep 17 00:00:00 2001 From: diya Date: Tue, 31 Oct 2023 01:34:07 +0700 Subject: [PATCH 1/3] Allow toggling colons in username and removing Mixer references --- CustomChat/widget.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/CustomChat/widget.js b/CustomChat/widget.js index c76afcb..84e5207 100644 --- a/CustomChat/widget.js +++ b/CustomChat/widget.js @@ -88,14 +88,11 @@ window.addEventListener('onEventReceived', function (obj) { if (ignoredUsers.indexOf(data.nick) !== -1) return; let message = attachEmotes(data); let badges = "", badge; - if (provider === 'mixer') { - data.badges.push({url: data.avatar}); - } for (let i = 0; i < data.badges.length; i++) { badge = data.badges[i]; badges += ` `; } - let username = data.displayName + ":"; + let username = ((showColon) ? data.displayName + ":" : data.displayName); if (nickColor === "user") { const color = data.displayColor !== "" ? data.displayColor : "#" + (md5(username).slice(26)); username = `${username}`; @@ -119,6 +116,7 @@ window.addEventListener('onWidgetLoad', function (obj) { nickColor = fieldData.nickColor; customNickColor = fieldData.customNickColor; hideCommands = fieldData.hideCommands; + showColon = fieldData.showColon; channelName = obj.detail.channel.username; fetch('https://api.streamelements.com/kappa/v2/channels/' + obj.detail.channel.id + '/').then(response => response.json()).then((profile) => { provider = profile.provider; @@ -166,15 +164,6 @@ function attachEmotes(message) { let width = "{emoteSize}px"; let height = "auto"; - if (provider === "mixer") { - console.log(result[0]); - if (result[0].coords.width) { - width = `${result[0].coords.width}px`; - } - if (result[0].coords.height) { - height = `${result[0].coords.height}px`; - } - } return `
`; } } else return key; From a7b0f374d607445b24ea2345b5e0d08067d19031 Mon Sep 17 00:00:00 2001 From: diya Date: Tue, 31 Oct 2023 01:39:44 +0700 Subject: [PATCH 2/3] forgot the if conditions --- CustomChat/widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CustomChat/widget.js b/CustomChat/widget.js index 84e5207..68a9535 100644 --- a/CustomChat/widget.js +++ b/CustomChat/widget.js @@ -92,7 +92,7 @@ window.addEventListener('onEventReceived', function (obj) { badge = data.badges[i]; badges += ` `; } - let username = ((showColon) ? data.displayName + ":" : data.displayName); + let username = ((showColon == "true") ? data.displayName + ":" : data.displayName); if (nickColor === "user") { const color = data.displayColor !== "" ? data.displayColor : "#" + (md5(username).slice(26)); username = `${username}`; From 67e4f50ceafe8210467e9e43ffa2e7124f054566 Mon Sep 17 00:00:00 2001 From: diya Date: Tue, 31 Oct 2023 01:40:58 +0700 Subject: [PATCH 3/3] Add option to toggle colons --- CustomChat/widget.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CustomChat/widget.json b/CustomChat/widget.json index 7ca7065..681c398 100644 --- a/CustomChat/widget.json +++ b/CustomChat/widget.json @@ -59,6 +59,16 @@ }, "group": "Typography" }, + "showColon": { + "type": "dropdown", + "label": "Show colon in usernames", + "value": "true", + "options": { + "true": "Yes", + "false": "No" + }, + "group": "Typography" + }, "nickColor": { "type": "dropdown", "label": "Nickname color:",