🐛 fix(hyvor-talk): switch from ID to class selector for initialisation (#196)
parent
228f1ea6e5
commit
040a46dc4b
@ -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();
|
||||||
|
Loading…
Reference in New Issue