diff --git a/Gmeek.js b/Gmeek.js deleted file mode 100644 index 836f7b6..0000000 --- a/Gmeek.js +++ /dev/null @@ -1,73 +0,0 @@ - -document.getElementById("themeSwitch").setAttribute("d",value=IconList["sun"]); -if(localStorage.getItem("meek_theme")==null){localStorage.setItem("meek_theme","light")} -else if(localStorage.getItem("meek_theme")=="dark"){changeDark();} -else if(localStorage.getItem("meek_theme")=="light"){changeLight();} - -var utterancesLoad=0 -if(localStorage.getItem("meek_theme")==null){localStorage.setItem("meek_theme","light")} -else if(localStorage.getItem("meek_theme")=="dark"){changeDark();} -else if(localStorage.getItem("meek_theme")=="light"){changeLight();} - -function changeDark(){ - document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="dark"; - document.getElementById("themeSwitch").attributes.getNamedItem("d").value=IconList["moon"]; - if(utterancesLoad==1){utterancesTheme("dark-blue");} -} -function changeLight(){ - document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="light"; - document.getElementById("themeSwitch").attributes.getNamedItem("d").value=IconList["sun"]; - if(utterancesLoad==1){utterancesTheme("github-light");} -} -function modeSwitch(){ - if(document.getElementsByTagName("html")[0].attributes[0].value=="light"){changeDark();localStorage.setItem("meek_theme","dark");} - else{changeLight();localStorage.setItem("meek_theme","light");} -} -function utterancesTheme(theme){ - const message = {type: 'set-theme',theme: theme}; - const iframe = document.getElementsByClassName('utterances-frame')[0]; - iframe.contentWindow.postMessage(message, 'https://utteranc.es'); -} - -iconTOP=document.getElementsByClassName("svgTop1"); -iconPost=document.getElementsByClassName("svgTop0"); -for(var i=0;i{% include 'footer.html' %} - {% block script %}{% endblock %} diff --git a/templates/plist.html b/templates/plist.html index cb038b0..6a9d302 100644 --- a/templates/plist.html +++ b/templates/plist.html @@ -1,7 +1,5 @@ {% extends 'base.html' %} - {% block title%}{{ blogBase['title'] }}{% endblock %} - {% block style %} {% endblock %} - {% block header %}

{{ blogBase['postTitle'] }} @@ -51,5 +48,38 @@ h1 a:not([href]){color:inherit;text-decoration:none;vertical-align: bottom;font- document.getElementById("pathHome").setAttribute("d",IconList["home"]); document.getElementById("pathIssue").setAttribute("d",IconList["github"]); +function openComments(){ + cm=document.getElementById("comments"); + cmButton=document.getElementById("cmButton"); + cmButton.innerHTML="loading"; + span=document.createElement("span"); + span.setAttribute("class","AnimatedEllipsis"); + cmButton.appendChild(span); + + script=document.createElement("script"); + script.setAttribute("src","https://utteranc.es/client.js"); + script.setAttribute("repo",cmButton.value); + script.setAttribute("issue-term","title"); + if(localStorage.getItem("meek_theme")=="dark"){script.setAttribute("theme","dark-blue");} + else{script.setAttribute("theme","github-light");} + script.setAttribute("crossorigin","anonymous"); + script.setAttribute("async",""); + cm.appendChild(script); + + int=self.setInterval("iFrameLoading()",200); +} + +function iFrameLoading(){ + var utterances=document.getElementsByClassName('utterances'); + if(utterances.length==1){ + if(utterances[0].style.height!=""){ + utterancesLoad=1; + int=window.clearInterval(int); + document.getElementById("cmButton").style.display="none"; + console.log("utterances Load OK"); + } + } +} + {% endblock %}