File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 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+ } ) ;
Original file line number Diff line number Diff 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} ) ;
Original file line number Diff line number Diff line change 5757}
5858if ( 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 >
You can’t perform that action at this time.
0 commit comments