diff --git a/plugins/GmeekBSZ.js b/plugins/GmeekBSZ.js new file mode 100644 index 0000000..0a33ec1 --- /dev/null +++ b/plugins/GmeekBSZ.js @@ -0,0 +1,32 @@ +function loadResource(type, attributes, callback) { + var element; + if (type === 'script') { + element = document.createElement('script'); + element.src = attributes.src; + element.onload = callback; + } else if (type === 'link') { + element = document.createElement('link'); + element.rel = attributes.rel; + element.href = attributes.href; + } else if (type === 'style') { + element = document.createElement('style'); + element.rel = 'stylesheet'; + element.appendChild(document.createTextNode(attributes.css)); + } + document.head.appendChild(element); +} + +function createBSZ() { + var postBody = document.getElementById('postBody'); + if (postBody){ + postBody.insertAdjacentHTML('afterend','
'); + } + var runday = document.getElementById('runday'); + runday.insertAdjacentHTML('afterend', ''); +} + +document.addEventListener("DOMContentLoaded", function() { + createBSZ(); + loadResource('script', { src: '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js' }); + console.log("\n %c GmeekBSZ Plugins https://github.com/Meekdai/Gmeek \n","padding:5px 0;background:#bc4c00;color:#fff"); +}); diff --git a/plugins/GmeekTOC.js b/plugins/GmeekTOC.js index d076779..4ba9551 100644 --- a/plugins/GmeekTOC.js +++ b/plugins/GmeekTOC.js @@ -55,4 +55,5 @@ document.addEventListener("DOMContentLoaded", function() { var footerPlaceholder = document.createElement('div'); footerPlaceholder.style.height = window.innerHeight + 'px'; document.body.appendChild(footerPlaceholder); + console.log("\n %c GmeekTOC Plugins https://github.com/Meekdai/Gmeek \n","padding:5px 0;background:#C333D0;color:#fff"); }); diff --git a/templates/base.html b/templates/base.html index 5066103..7d8fabe 100644 --- a/templates/base.html +++ b/templates/base.html @@ -57,7 +57,7 @@ function utterancesTheme(theme){ } if(themeSettings[theme]){changeTheme(...themeSettings[theme]);} {%- endif %} -console.log("\n %c Gmeek {{ blogBase['GMEEK_VERSION'] }} https://github.com/Meekdai/Gmeek \n\n","padding:5px 0;background:#02d81d;color:#fff"); +console.log("\n %c Gmeek {{ blogBase['GMEEK_VERSION'] }} https://github.com/Meekdai/Gmeek \n","padding:5px 0;background:#02d81d;color:#fff"); {% block script %}{% endblock %}