Skip to content

Commit 39ae055

Browse files
committed
添加不蒜子插件
1 parent ffd230c commit 39ae055

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

plugins/GmeekBSZ.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
function loadResource(type, attributes, callback) {
2+
var element;
3+
if (type === 'script') {
4+
element = document.createElement('script');
5+
element.src = attributes.src;
6+
element.onload = callback;
7+
} else if (type === 'link') {
8+
element = document.createElement('link');
9+
element.rel = attributes.rel;
10+
element.href = attributes.href;
11+
} else if (type === 'style') {
12+
element = document.createElement('style');
13+
element.rel = 'stylesheet';
14+
element.appendChild(document.createTextNode(attributes.css));
15+
}
16+
document.head.appendChild(element);
17+
}
18+
19+
function createBSZ() {
20+
var postBody = document.getElementById('postBody');
21+
if (postBody){
22+
postBody.insertAdjacentHTML('afterend','<div id="busuanzi_container_page_pv" style="display:none;float:left;margin-top:8px;font-size:small;">本文浏览量 <span id="busuanzi_value_page_pv"></span>次</div>');
23+
}
24+
var runday = document.getElementById('runday');
25+
runday.insertAdjacentHTML('afterend', '<div id="busuanzi_container_site_pv" style="display:none;">总浏览量<span id="busuanzi_value_site_pv"></span>次 • </div>');
26+
}
27+
28+
document.addEventListener("DOMContentLoaded", function() {
29+
createBSZ();
30+
loadResource('script', { src: '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js' });
31+
console.log("\n %c GmeekBSZ Plugins https://github.com/Meekdai/Gmeek \n","padding:5px 0;background:#bc4c00;color:#fff");
32+
});

plugins/GmeekTOC.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ document.addEventListener("DOMContentLoaded", function() {
5555
var footerPlaceholder = document.createElement('div');
5656
footerPlaceholder.style.height = window.innerHeight + 'px';
5757
document.body.appendChild(footerPlaceholder);
58+
console.log("\n %c GmeekTOC Plugins https://github.com/Meekdai/Gmeek \n","padding:5px 0;background:#C333D0;color:#fff");
5859
});

templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
}
5858
if(themeSettings[theme]){changeTheme(...themeSettings[theme]);}
5959
{%- endif %}
60-
console.log("\n %c Gmeek {{ blogBase['GMEEK_VERSION'] }} https://github.com/Meekdai/Gmeek \n\n","padding:5px 0;background:#02d81d;color:#fff");
60+
console.log("\n %c Gmeek {{ blogBase['GMEEK_VERSION'] }} https://github.com/Meekdai/Gmeek \n","padding:5px 0;background:#02d81d;color:#fff");
6161
</script>
6262
{% block script %}{% endblock %}
6363
</html>

0 commit comments

Comments
 (0)