From 4ce757a96a7b5a2b7a125eb0434d732634710dba Mon Sep 17 00:00:00 2001 From: quentinperou <67630351+quentinperou@users.noreply.github.com> Date: Thu, 19 May 2022 20:43:06 +0200 Subject: [PATCH] delete console log --- script.js | 2 +- script.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index c2c5069..f78e42a 100644 --- a/script.js +++ b/script.js @@ -298,7 +298,7 @@ date = new Date(); dateUndefined = true; } - console.log(user, message, flags, self, extra, isArchive); + // console.log(user, message, flags, self, extra, isArchive); let thisMsgId = extra.id; let leMessage = message.toString(); diff --git a/script.min.js b/script.min.js index d27da05..77c2fe9 100644 --- a/script.min.js +++ b/script.min.js @@ -1 +1 @@ -"use strict";(function(){function e(){function e(e){"blue"==e&&(document.documentElement.classList.remove("styleDarkTheme"),document.documentElement.classList.add("styleOriginalTheme")),"dark"==e&&(document.documentElement.classList.remove("styleOriginalTheme"),document.documentElement.classList.add("styleDarkTheme"))}if(console.log("%cHello ! Enjoy πŸ˜ƒ\n 🌸🌸🌸🌸🌸","background: #222; color: #FFF; font-size: 20px;"),document.getElementById("notCoChannelInputSubmit").addEventListener("click",function(){document.getElementById("notCoChannelInput").value&&(window.location.href=`./?channel=${document.getElementById("notCoChannelInput").value.toLowerCase()}`)},{passive:!0}),document.getElementById("notCoChannelInput").focus(),document.getElementById("notCoChannelInput").addEventListener("keydown",e=>{e.repeat||"Enter"==e.key&&document.getElementById("notCoChannelInputSubmit").click()}),document.getElementById("backToHomeButton").addEventListener("click",function(){ComfyJS.Disconnect(),window.location.href="./"},{passive:!0}),null!=sessionStorage.getItem(`${d}onlyHighlightedCheck`)&&(document.getElementById("onlyHighlightedCheck").checked=!1,r=!1),document.getElementById("onlyHighlightedCheck").addEventListener("input",function(){document.getElementById("onlyHighlightedCheck").checked?(r=!0,i('[data-type="normal"]'),sessionStorage.removeItem(`${d}onlyHighlightedCheck`)):(r=!1,sessionStorage.setItem(`${d}onlyHighlightedCheck`,!1))}),document.getElementById("highlightedNotifSound").addEventListener("input",function(){u=!!document.getElementById("highlightedNotifSound").checked}),document.getElementById("enableModCommand").addEventListener("input",function(){p=!!document.getElementById("enableModCommand").checked}),null!=localStorage.getItem(`${d}theme`)&&(document.querySelector(`#choiceTheme input[value="${localStorage.getItem(`${d}theme`)}"]`).checked=!0,e(localStorage.getItem(`${d}theme`))),document.querySelectorAll("#choiceTheme input").forEach(function(t){t.addEventListener("input",function(){t.checked?(localStorage.setItem(`${d}theme`,t.value),console.log("theme:",t.value),e(t.value)):console.log("false",t.value)})}),document.getElementsByClassName("mainContainer")[0].addEventListener("click",function(){document.getElementById("headerBurger").classList.remove("menuVisible"),document.getElementById("headerNav").classList.remove("menuVisible")}),document.getElementById("clearCacheButton").addEventListener("click",function(){l("#popupDivContainer")}),document.getElementById("clearCachePopupDelete").addEventListener("click",function(){sessionStorage.clear(),localStorage.clear(),s("#popupDivContainer"),document.getElementById("headerBurger").classList.remove("menuVisible"),document.getElementById("headerNav").classList.remove("menuVisible"),n("Cache clear !")}),document.getElementById("clearCachePopupCancel").addEventListener("click",function(){s("#popupDivContainer")}),document.getElementById("headerBurger").addEventListener("click",function(){this.classList.toggle("menuVisible"),document.getElementById("headerNav").classList.toggle("menuVisible")}),document.getElementById("chatGoToBottom").addEventListener("click",function(){let e=document.getElementById("hightlitedMessageChatContainer");e.scrollTop=e.scrollHeight,s("#chatGoToBottom"),m=!0},{passive:!0}),console.log(location.search.substr(1)),"channel"==location.search.substr(1).split("=")[0]&&(c=location.search.substr(1).split("=")[1].toLowerCase(),c)){ComfyJS.Init(c);let e=document.querySelector(".titleChat p");e.innerHTML=e.textContent+''+c+"",fetch(`https://decapi.me/twitch/avatar/${c}`).then(function(e){return e.text()}).then(function(e){let t=document.createElement("div"),n=document.createElement("a");n.href=`https://twitch.tv/${c}`,n.target="_blank";let a=document.createElement("img");a.src=e,a.id="channelProfilePicturePic",a.alt="profile picture",t.appendChild(n),n.appendChild(a),document.querySelector(".titleChat").insertBefore(t,document.querySelector(".titleChat p"))}),"ponce"==c&&(e.textContent="🌸 "+e.textContent+" 🌸"),document.title=`${c} - Twitch Highlighted Chat`,t(),ComfyJS.onConnected=((e,t,a)=>{if(n(`Connected to ${c.toUpperCase()} 's chat`),g&&null!=localStorage.getItem(`${d}messagesSave-${c}`)){let e=JSON.parse(localStorage.getItem(`${d}messagesSave-${c}`)),t=[];e.forEach(function(e){let n=new Date(e.date),a=new Date;a.getTime()-n.getTime()>432e6?console.log("delete elements older than 5 day"):t.push(e),e.isRead?o(e.user,e.message,e.flags,e.self,e.extra,!0,new Date(e.date)).setAttribute("read",""):o(e.user,e.message,e.flags,e.self,e.extra,!0,new Date(e.date))}),localStorage.setItem(`${d}messagesSave-${c}`,JSON.stringify(t));let n=document.createElement("span");n.style="display: block; height: 1px; background-color: #fff; margin: 2px 0;",document.getElementById("hightlitedMessageChatContainer").appendChild(n)}}),ComfyJS.onChat=((e,t,n,s,l)=>{r||o(e,t,n,s,l),1==n.highlighted&&(r&&o(e,t,n,s,l),g&&a(e,t,n,s,l))}),ComfyJS.onCommand=((e,t,n,s,l)=>{if(p&&"+hmsg"===t&&(s.broadcaster||s.mod||"quentinperou"==e.toLowerCase()))if(s.highlighted)o(e,"!"+t+" "+n,s,!1,l),g&&a(e,"!"+t+" "+n,s,!1,l);else{let t=o(e,n,s,!1,l,!1);t.style.backgroundColor="var(--main-bg-color0)",t.style.padding="2px 5px"}else r?s.highlighted&&o(e,"!"+t+" "+n,s,!1,l):o(e,"!"+t+" "+n,s,!1,l)}),ComfyJS.onError=(e=>{console.log(e)})}document.getElementById("hightlitedMessageChatContainer").addEventListener("wheel",function(e){e.deltaY<0?this.clientHeight!=this.scrollHeight&&(m=!1,l("#chatGoToBottom")):e.deltaY>0&&this.scrollTop+this.clientHeight==this.scrollHeight&&(m=!0,s("#chatGoToBottom"))},{passive:!0})}function t(){l("#optionsDiv"),l("#optionsDiv div"),l("#choiceTheme"),l("#backToHomeButton"),l("#clearCacheButton"),l(".divConnect"),s(".divNotConnect"),document.getElementById("headerBurger").classList.add("displayOn")}function n(e){var t=Math.floor(Math.random()*Date.now());document.getElementById("notifContainer").innerHTML+=`

${e}

`,setTimeout(function(){document.getElementById(`notifNow${t}`).parentElement.classList.remove("hide")},10),setTimeout(function(){document.getElementById(`notifNow${t}`).parentElement.classList.add("hide"),setTimeout(function(){document.getElementById(`notifNow${t}`).parentElement.remove()},400)},2700)}function a(e,t,n,a,o){if(null==localStorage.getItem(`${d}messagesSave-${c}`)){let s={user:e,message:t,flags:n,self:a,extra:o,isRead:!1,date:new Date};localStorage.setItem(`${d}messagesSave-${c}`,JSON.stringify([s]))}else{let s={user:e,message:t,flags:n,self:a,extra:o,isRead:!1,date:new Date},l=JSON.parse(localStorage.getItem(`${d}messagesSave-${c}`));l.push(s),localStorage.setItem(`${d}messagesSave-${c}`,JSON.stringify(l))}}function o(e,t,n,a,o,s,l){null==s&&(s=!1);let i=!1;null==l&&(l=new Date,i=!0),console.log(e,t,n,a,o,s);let r=o.id,g=t.toString(),p=l,f="0"+p.getHours(),C="0"+p.getMinutes();f=f.substr(-2),C=C.substr(-2);let y="";1==n.subscriber&&null!=o.userBadges.subscriber&&4==o.userBadges.subscriber.length&&(y=`(Tier ${o.userBadges.subscriber.match(/^[0-9]/g)[0]})`);let E=document.createElement("div");E.classList.add("chat-lineMessage");let v=document.createElement("div");if(v.classList.add("chat-lineNameDiv"),E.appendChild(v),v.innerHTML=`${n.mod?'':""}\n ${n.vip?'':""}\n ${n.broadcaster?'':""}\n ${n.subscriber?``:""}\n ${e}`,!s||!i){let e=document.createElement("span");if(e.classList.add("chat-messageTime"),e.textContent=`${f}:${C}`,v.prepend(e),s){let t=document.createElement("span");t.classList.add("chat-messageDate"),t.textContent=`${(p.getDate()+1<10?"0":"")+p.getDate()}/${(p.getMonth()+1<10?"0":"")+(p.getMonth()+1)}/${p.getFullYear()} - `,v.insertBefore(t,e),E.setAttribute("data-archive",!0)}}let I=document.createElement("span");I.classList.add("chat-messageSeparator"),I.textContent=":",v.appendChild(I);let S=document.createElement("span");if(S.classList.add("chat-message"),S.setAttribute("translate","no"),1==n.highlighted){if(S.classList.add("chat-message-highlighted"),E.setAttribute("data-type","highlighted"),S.setAttribute("title","Click to mark as read"),S.addEventListener("click",function(){let e=JSON.parse(localStorage.getItem(`${d}messagesSave-${c}`)),t=e.findIndex(e=>e.extra.id==r);this.hasAttribute("read")?(this.removeAttribute("read"),e[t].isRead=!1):(this.setAttribute("read",""),e[t].isRead=!0),localStorage.setItem(`${d}messagesSave-${c}`,JSON.stringify(e))}),!s&&u){let e=new Audio("sound_notif2.aac");e.volume=.5,"ponce"==c&&(e=new Audio("sound_notif_ponce.aac"),e.volume=.7),e.play()}}else E.setAttribute("data-type","normal");S.textContent=g,E.appendChild(S),document.getElementById("hightlitedMessageChatContainer").appendChild(E);let B=document.getElementById("hightlitedMessageChatContainer");m&&(B.scrollTop=B.scrollHeight);let b=o.messageEmotes;if(null!=b){let e=[],t=S.textContent,n=t;for(const[a,o]of Object.entries(b))for(const[s,l]of Object.entries(o)){let o=l.split("-"),s=t.substring(o[0],parseInt(o[1],10)+1);e.some(e=>e===s)||(e.push(s),n=n.replaceAll(s,`${s}`))}S.innerHTML=n,S.classList.add("chat-message-withEmote")}if(h&&m)for(;document.querySelectorAll('.chat-lineMessage[data-type="normal"]').length>150;)document.querySelector('.chat-lineMessage[data-type="normal"]').remove();return S}function s(e){document.querySelectorAll(e).forEach(e=>e.hidden=!0)}function l(e){document.querySelectorAll(e).forEach(e=>e.hidden=!1)}function i(e){document.querySelectorAll(e).forEach(e=>e.remove())}let c;document.addEventListener("DOMContentLoaded",e);const d="HgltCt-";let r=!0,m=!0,u=!1,g=!0,h=!0,p=!0})(); \ No newline at end of file +"use strict";(function(){function e(){function e(e){"blue"==e&&(document.documentElement.classList.remove("styleDarkTheme"),document.documentElement.classList.add("styleOriginalTheme")),"dark"==e&&(document.documentElement.classList.remove("styleOriginalTheme"),document.documentElement.classList.add("styleDarkTheme"))}if(console.log("%cHello ! Enjoy πŸ˜ƒ\n 🌸🌸🌸🌸🌸","background: #222; color: #FFF; font-size: 20px;"),document.getElementById("notCoChannelInputSubmit").addEventListener("click",function(){document.getElementById("notCoChannelInput").value&&(window.location.href=`./?channel=${document.getElementById("notCoChannelInput").value.toLowerCase()}`)},{passive:!0}),document.getElementById("notCoChannelInput").focus(),document.getElementById("notCoChannelInput").addEventListener("keydown",e=>{e.repeat||"Enter"==e.key&&document.getElementById("notCoChannelInputSubmit").click()}),document.getElementById("backToHomeButton").addEventListener("click",function(){ComfyJS.Disconnect(),window.location.href="./"},{passive:!0}),null!=sessionStorage.getItem(`${d}onlyHighlightedCheck`)&&(document.getElementById("onlyHighlightedCheck").checked=!1,r=!1),document.getElementById("onlyHighlightedCheck").addEventListener("input",function(){document.getElementById("onlyHighlightedCheck").checked?(r=!0,i('[data-type="normal"]'),sessionStorage.removeItem(`${d}onlyHighlightedCheck`)):(r=!1,sessionStorage.setItem(`${d}onlyHighlightedCheck`,!1))}),document.getElementById("highlightedNotifSound").addEventListener("input",function(){u=!!document.getElementById("highlightedNotifSound").checked}),document.getElementById("enableModCommand").addEventListener("input",function(){p=!!document.getElementById("enableModCommand").checked}),null!=localStorage.getItem(`${d}theme`)&&(document.querySelector(`#choiceTheme input[value="${localStorage.getItem(`${d}theme`)}"]`).checked=!0,e(localStorage.getItem(`${d}theme`))),document.querySelectorAll("#choiceTheme input").forEach(function(t){t.addEventListener("input",function(){t.checked?(localStorage.setItem(`${d}theme`,t.value),console.log("theme:",t.value),e(t.value)):console.log("false",t.value)})}),document.getElementsByClassName("mainContainer")[0].addEventListener("click",function(){document.getElementById("headerBurger").classList.remove("menuVisible"),document.getElementById("headerNav").classList.remove("menuVisible")}),document.getElementById("clearCacheButton").addEventListener("click",function(){l("#popupDivContainer")}),document.getElementById("clearCachePopupDelete").addEventListener("click",function(){sessionStorage.clear(),localStorage.clear(),s("#popupDivContainer"),document.getElementById("headerBurger").classList.remove("menuVisible"),document.getElementById("headerNav").classList.remove("menuVisible"),n("Cache clear !")}),document.getElementById("clearCachePopupCancel").addEventListener("click",function(){s("#popupDivContainer")}),document.getElementById("headerBurger").addEventListener("click",function(){this.classList.toggle("menuVisible"),document.getElementById("headerNav").classList.toggle("menuVisible")}),document.getElementById("chatGoToBottom").addEventListener("click",function(){let e=document.getElementById("hightlitedMessageChatContainer");e.scrollTop=e.scrollHeight,s("#chatGoToBottom"),m=!0},{passive:!0}),console.log(location.search.substr(1)),"channel"==location.search.substr(1).split("=")[0]&&(c=location.search.substr(1).split("=")[1].toLowerCase(),c)){ComfyJS.Init(c);let e=document.querySelector(".titleChat p");e.innerHTML=e.textContent+''+c+"",fetch(`https://decapi.me/twitch/avatar/${c}`).then(function(e){return e.text()}).then(function(e){let t=document.createElement("div"),n=document.createElement("a");n.href=`https://twitch.tv/${c}`,n.target="_blank";let a=document.createElement("img");a.src=e,a.id="channelProfilePicturePic",a.alt="profile picture",t.appendChild(n),n.appendChild(a),document.querySelector(".titleChat").insertBefore(t,document.querySelector(".titleChat p"))}),"ponce"==c&&(e.textContent="🌸 "+e.textContent+" 🌸"),document.title=`${c} - Twitch Highlighted Chat`,t(),ComfyJS.onConnected=((e,t,a)=>{if(n(`Connected to ${c.toUpperCase()} 's chat`),g&&null!=localStorage.getItem(`${d}messagesSave-${c}`)){let e=JSON.parse(localStorage.getItem(`${d}messagesSave-${c}`)),t=[];e.forEach(function(e){let n=new Date(e.date),a=new Date;a.getTime()-n.getTime()>432e6?console.log("delete elements older than 5 day"):t.push(e),e.isRead?o(e.user,e.message,e.flags,e.self,e.extra,!0,new Date(e.date)).setAttribute("read",""):o(e.user,e.message,e.flags,e.self,e.extra,!0,new Date(e.date))}),localStorage.setItem(`${d}messagesSave-${c}`,JSON.stringify(t));let n=document.createElement("span");n.style="display: block; height: 1px; background-color: #fff; margin: 2px 0;",document.getElementById("hightlitedMessageChatContainer").appendChild(n)}}),ComfyJS.onChat=((e,t,n,s,l)=>{r||o(e,t,n,s,l),1==n.highlighted&&(r&&o(e,t,n,s,l),g&&a(e,t,n,s,l))}),ComfyJS.onCommand=((e,t,n,s,l)=>{if(p&&"+hmsg"===t&&(s.broadcaster||s.mod||"quentinperou"==e.toLowerCase()))if(s.highlighted)o(e,"!"+t+" "+n,s,!1,l),g&&a(e,"!"+t+" "+n,s,!1,l);else{let t=o(e,n,s,!1,l,!1);t.style.backgroundColor="var(--main-bg-color0)",t.style.padding="2px 5px"}else r?s.highlighted&&o(e,"!"+t+" "+n,s,!1,l):o(e,"!"+t+" "+n,s,!1,l)}),ComfyJS.onError=(e=>{console.log(e)})}document.getElementById("hightlitedMessageChatContainer").addEventListener("wheel",function(e){e.deltaY<0?this.clientHeight!=this.scrollHeight&&(m=!1,l("#chatGoToBottom")):e.deltaY>0&&this.scrollTop+this.clientHeight==this.scrollHeight&&(m=!0,s("#chatGoToBottom"))},{passive:!0})}function t(){l("#optionsDiv"),l("#optionsDiv div"),l("#choiceTheme"),l("#backToHomeButton"),l("#clearCacheButton"),l(".divConnect"),s(".divNotConnect"),document.getElementById("headerBurger").classList.add("displayOn")}function n(e){var t=Math.floor(Math.random()*Date.now());document.getElementById("notifContainer").innerHTML+=`

${e}

`,setTimeout(function(){document.getElementById(`notifNow${t}`).parentElement.classList.remove("hide")},10),setTimeout(function(){document.getElementById(`notifNow${t}`).parentElement.classList.add("hide"),setTimeout(function(){document.getElementById(`notifNow${t}`).parentElement.remove()},400)},2700)}function a(e,t,n,a,o){if(null==localStorage.getItem(`${d}messagesSave-${c}`)){let s={user:e,message:t,flags:n,self:a,extra:o,isRead:!1,date:new Date};localStorage.setItem(`${d}messagesSave-${c}`,JSON.stringify([s]))}else{let s={user:e,message:t,flags:n,self:a,extra:o,isRead:!1,date:new Date},l=JSON.parse(localStorage.getItem(`${d}messagesSave-${c}`));l.push(s),localStorage.setItem(`${d}messagesSave-${c}`,JSON.stringify(l))}}function o(e,t,n,a,o,s,l){null==s&&(s=!1);let i=!1;null==l&&(l=new Date,i=!0);let r=o.id,g=t.toString(),p=l,f="0"+p.getHours(),C="0"+p.getMinutes();f=f.substr(-2),C=C.substr(-2);let y="";1==n.subscriber&&null!=o.userBadges.subscriber&&4==o.userBadges.subscriber.length&&(y=`(Tier ${o.userBadges.subscriber.match(/^[0-9]/g)[0]})`);let E=document.createElement("div");E.classList.add("chat-lineMessage");let v=document.createElement("div");if(v.classList.add("chat-lineNameDiv"),E.appendChild(v),v.innerHTML=`${n.mod?'':""}\n ${n.vip?'':""}\n ${n.broadcaster?'':""}\n ${n.subscriber?``:""}\n ${e}`,!s||!i){let e=document.createElement("span");if(e.classList.add("chat-messageTime"),e.textContent=`${f}:${C}`,v.prepend(e),s){let t=document.createElement("span");t.classList.add("chat-messageDate"),t.textContent=`${(p.getDate()+1<10?"0":"")+p.getDate()}/${(p.getMonth()+1<10?"0":"")+(p.getMonth()+1)}/${p.getFullYear()} - `,v.insertBefore(t,e),E.setAttribute("data-archive",!0)}}let I=document.createElement("span");I.classList.add("chat-messageSeparator"),I.textContent=":",v.appendChild(I);let S=document.createElement("span");if(S.classList.add("chat-message"),S.setAttribute("translate","no"),1==n.highlighted){if(S.classList.add("chat-message-highlighted"),E.setAttribute("data-type","highlighted"),S.setAttribute("title","Click to mark as read"),S.addEventListener("click",function(){let e=JSON.parse(localStorage.getItem(`${d}messagesSave-${c}`)),t=e.findIndex(e=>e.extra.id==r);this.hasAttribute("read")?(this.removeAttribute("read"),e[t].isRead=!1):(this.setAttribute("read",""),e[t].isRead=!0),localStorage.setItem(`${d}messagesSave-${c}`,JSON.stringify(e))}),!s&&u){let e=new Audio("sound_notif2.aac");e.volume=.5,"ponce"==c&&(e=new Audio("sound_notif_ponce.aac"),e.volume=.7),e.play()}}else E.setAttribute("data-type","normal");S.textContent=g,E.appendChild(S),document.getElementById("hightlitedMessageChatContainer").appendChild(E);let B=document.getElementById("hightlitedMessageChatContainer");m&&(B.scrollTop=B.scrollHeight);let b=o.messageEmotes;if(null!=b){let e=[],t=S.textContent,n=t;for(const[a,o]of Object.entries(b))for(const[s,l]of Object.entries(o)){let o=l.split("-"),s=t.substring(o[0],parseInt(o[1],10)+1);e.some(e=>e===s)||(e.push(s),n=n.replaceAll(s,`
${s}`))}S.innerHTML=n,S.classList.add("chat-message-withEmote")}if(h&&m)for(;document.querySelectorAll('.chat-lineMessage[data-type="normal"]').length>150;)document.querySelector('.chat-lineMessage[data-type="normal"]').remove();return S}function s(e){document.querySelectorAll(e).forEach(e=>e.hidden=!0)}function l(e){document.querySelectorAll(e).forEach(e=>e.hidden=!1)}function i(e){document.querySelectorAll(e).forEach(e=>e.remove())}let c;document.addEventListener("DOMContentLoaded",e);const d="HgltCt-";let r=!0,m=!0,u=!1,g=!0,h=!0,p=!0})(); \ No newline at end of file