From 040a46dc4bec2fb31f5ebd07cdc35ed8e6d04483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Fern=C3=A1ndez?= Date: Wed, 4 Oct 2023 18:02:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(hyvor-talk):=20switch=20from?= =?UTF-8?q?=20ID=20to=20class=20selector=20for=20initialisation=20(#196)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/hyvortalk.js | 2 +- static/js/hyvortalk.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/hyvortalk.js b/static/js/hyvortalk.js index c2091af..a003141 100644 --- a/static/js/hyvortalk.js +++ b/static/js/hyvortalk.js @@ -1,6 +1,6 @@ function initHyvorTalk() { // Get the div that will contain the comments. - const commentsDiv = document.querySelector('#comments'); + const commentsDiv = document.querySelector('.comments'); if (commentsDiv) { // Get the various settings from data attributes on the div. const websiteId = commentsDiv.getAttribute('data-website-id'); diff --git a/static/js/hyvortalk.min.js b/static/js/hyvortalk.min.js index df72cf0..f4ea4f5 100644 --- a/static/js/hyvortalk.min.js +++ b/static/js/hyvortalk.min.js @@ -1 +1 @@ -function initHyvorTalk(){var t=document.querySelector("#comments");if(t){var e=t.getAttribute("data-website-id"),a=t.getAttribute("data-page-id"),i=t.getAttribute("data-page-language"),d=t.getAttribute("data-loading"),r=t.getAttribute("data-page-author"),n=document.createElement("script");n.src="https://talk.hyvor.com/embed/embed.js",n.async=!0,n.type="module",document.head.appendChild(n);const o=document.createElement("hyvor-talk-comments");o.setAttribute("website-id",e),o.setAttribute("page-id",a),o.setAttribute("page-language",i),o.setAttribute("loading",d),o.setAttribute("page-author",r);n=document.documentElement.getAttribute("data-theme")||"light";o.setAttribute("colors",n),t.appendChild(o),window.addEventListener("themeChanged",t=>{t=t.detail.theme;o.setAttribute("colors",t)})}}initHyvorTalk(); +function initHyvorTalk(){var t=document.querySelector(".comments");if(t){var e=t.getAttribute("data-website-id"),a=t.getAttribute("data-page-id"),i=t.getAttribute("data-page-language"),d=t.getAttribute("data-loading"),r=t.getAttribute("data-page-author"),n=document.createElement("script");n.src="https://talk.hyvor.com/embed/embed.js",n.async=!0,n.type="module",document.head.appendChild(n);const o=document.createElement("hyvor-talk-comments");o.setAttribute("website-id",e),o.setAttribute("page-id",a),o.setAttribute("page-language",i),o.setAttribute("loading",d),o.setAttribute("page-author",r);n=document.documentElement.getAttribute("data-theme")||"light";o.setAttribute("colors",n),t.appendChild(o),window.addEventListener("themeChanged",t=>{t=t.detail.theme;o.setAttribute("colors",t)})}}initHyvorTalk();