@@ -16,6 +16,7 @@ function Base() {
1616 setMenuIntroduceTId : null , // 菜单设置-个人信息定时器ID
1717 setMenuCalendarTId : null , // 菜单设置-日历定时器ID
1818 setSidebarSearchTId : null , // 菜单设置-找找看定时器ID
19+ setSidebarScorerankTId : null , // 菜单设置-积分与排名定时器ID
1920 setMenuSidebarTId : null , // 菜单设置-最新随笔定时器ID
2021 setMenuToptagsTId : null , // 菜单设置-我的标签定时器ID
2122 setMenuClassifyTId : null , // 菜单设置-随笔分类定时器ID
@@ -96,6 +97,7 @@ function Base() {
9697 timeIds . setMenuIntroduceTId = window . setInterval ( setMenuData . setIntroduce , 1000 ) ;
9798 timeIds . setMenuCalendarTId = window . setInterval ( setMenuData . setCalendar , 1000 ) ;
9899 timeIds . setSidebarSearchTId = window . setInterval ( setMenuData . setSidebarSearch , 1000 ) ;
100+ timeIds . setSidebarScorerankTId = window . setInterval ( setMenuData . setSidebarScorerank , 1000 ) ;
99101 timeIds . setMenuSidebarTId = window . setInterval ( setMenuData . setSidebar , 1000 ) ;
100102 timeIds . setMenuToptagsTId = window . setInterval ( setMenuData . setToptags , 1000 ) ;
101103 timeIds . setMenuClassifyTId = window . setInterval ( setMenuData . setClassify , 1000 ) ;
@@ -383,6 +385,7 @@ function Base() {
383385 calendar = $ ( '#blog-calendar' ) , // 日历
384386 calendarTable = $ ( '#blogCalendar' ) , // 日历
385387 sidebarSearch = $ ( '#sidebar_search_box' ) , // 找找看
388+ scorerank = $ ( '#sidebar_scorerank ul li' ) , // 积分与排名
386389 sidebar = $ ( '#sidebar_recentposts ul li' ) , // 最新随笔
387390 toptags = $ ( '#sidebar_toptags ul li' ) , // 我的标签
388391 sbClassify = $ ( '#sidebar_postcategory ul li' ) , // 随笔分类
@@ -392,6 +395,7 @@ function Base() {
392395 topDiggPosts = $ ( '#TopDiggPostsBlock ul li' ) , // 推荐排行
393396 menuIntroduce = $ ( '#introduce' ) ,
394397 menuCalendar = $ ( '#calendar-box' ) ,
398+ menuScorerank = $ ( '#sb-sidebarScorerank' ) ,
395399 menuSearchBox = $ ( '#sb-sidebarSearchBox' ) ,
396400 menuArticle = $ ( '#sb-articlearchive' ) ,
397401 menuSidebar = $ ( '#sb-sidebarRecentposts' ) ,
@@ -428,6 +432,14 @@ function Base() {
428432 }
429433 }
430434
435+ // 添加积分与排名
436+ function setSidebarScorerank ( ) {
437+ if ( scorerank . length > 0 && menuScorerank . html ( ) === '' ) {
438+ menuScorerank . html ( getMenuData ( scorerank , 'icon-collection_fill' ) ) . prev ( '.m-list-title' ) . show ( ) ;
439+ bndongJs . clearIntervalTimeId ( timeIds . setSidebarScorerankTId ) ;
440+ }
441+ }
442+
431443 // 添加最新随笔
432444 function setSidebar ( ) {
433445 if ( sidebar . length > 0 && menuSidebar . html ( ) === '' ) {
@@ -513,8 +525,8 @@ function Base() {
513525 if ( ret . test ( textArr [ 0 ] ) ) textArr . splice ( 0 , 1 ) ;
514526 var text = $ . trim ( textArr . join ( '.' ) ) ,
515527 iconHtml = '<span class="iconfont ' + icon + '" style="color: #888;font-size: 14px;margin-right: 5px;"></span>' ;
516- o . html ( iconHtml + text ) ;
517- html += '<li>' + o . prop ( "outerHTML" ) + '</li>' ;
528+ o . length > 0 && o . html ( iconHtml + text ) ;
529+ html += '<li>' + ( o . length > 0 ? o . prop ( "outerHTML" ) : "<a href='javascript:void(0);'>" + iconHtml + text + "</a> ") + '</li>' ;
518530 } ) ;
519531 html += '</ul></div>' ;
520532 return html ;
@@ -524,6 +536,7 @@ function Base() {
524536 setIntroduce : setIntroduce ,
525537 setCalendar : setCalendar ,
526538 setSidebarSearch : setSidebarSearch ,
539+ setSidebarScorerank : setSidebarScorerank ,
527540 setSidebar : setSidebar ,
528541 setToptags : setToptags ,
529542 setClassify : setClassify ,
@@ -551,8 +564,11 @@ function Base() {
551564 * 添加页脚
552565 */
553566 this . addFooter = function ( ) {
554- const footer = $ ( '#footer' ) ;
555- var pvHtml = '' ;
567+ const footer = $ ( '#footer' ) ,
568+ rHref = 'https://github.com/' + window . cnblogsConfig . GhUserName + '/' + window . cnblogsConfig . GhRepositories + '/tree/' + window . cnblogsConfig . CnVersions ,
569+ lHref = 'https://github.com/' + window . cnblogsConfig . GhUserName + '/' + window . cnblogsConfig . GhRepositories + '/tree/' + window . cnblogsConfig . GhVersions ;
570+
571+ var pvHtml = '' , bgFooter = '' ;
556572
557573 if ( window . cnblogsConfig . bottomText . left || window . cnblogsConfig . bottomText . right )
558574 pvHtml += '<div>【' + window . cnblogsConfig . bottomText . left + '<span id="footerTextIcon">' + window . cnblogsConfig . bottomText . icon + '</span>' + window . cnblogsConfig . bottomText . right + '】</div>' ;
@@ -562,28 +578,71 @@ function Base() {
562578 '<div id="cnzzInfo"></div>' +
563579 '<div id="themeInfo"></div>' ;
564580
565- var bgFooter = '<footer>' +
566- '<footer-background>' +
567- '<figure class="clouds"></figure>' +
568- '<figure class="background"></figure>' +
569- '<figure class="foreground"></figure>' +
570- '<figure class="poof"></figure>' +
571- '</footer-background>' +
572- '</footer>' ,
581+ switch ( parseInt ( window . cnblogsConfig . footerStyle ) ) {
582+ case 1 :
583+ init_t1 ( ) ;
584+ break ;
573585
574- rHref = 'https://github.com/' + window . cnblogsConfig . GhUserName + '/' + window . cnblogsConfig . GhRepositories + '/tree/' + window . cnblogsConfig . CnVersions ,
575- lHref = 'https://github.com/' + window . cnblogsConfig . GhUserName + '/' + window . cnblogsConfig . GhRepositories + '/tree/' + window . cnblogsConfig . GhVersions ;
586+ case 2 :
587+ default :
588+ init_t2 ( ) ;
589+ break ;
590+ }
576591
577- addFooterHtml ( ) ;
578592 setBlogroll ( ) ;
579593 setTheme ( ) ;
580594 window . setInterval ( setRunTime , 500 ) ;
581595 timeIds . setCnzzTId = window . setInterval ( setCnzz , 1000 ) ;
582596
597+ // v1.0 页脚
598+ function init_t1 ( ) {
599+ pvHtml = '<div class="footer-image"></div>' + pvHtml ;
600+ addFooterHtml ( ) ;
601+ $ ( '#footer' ) . css ( {
602+ 'min-height' : '130px' ,
603+ '_height' : '15px' ,
604+ 'position' : 'absolute' ,
605+ 'margin' : '200px 0 0 0' ,
606+ 'left' : '0' ,
607+ 'right' : '0' ,
608+ 'background' : '#232323' ,
609+ 'padding' : '17px 0 27px' ,
610+ 'text-align' : 'center' ,
611+ 'color' : '#888' ,
612+ 'font-size' : '12px' ,
613+ 'line-height' : '1.5' ,
614+ } ) ;
615+
616+ $ ( '.footer-image' ) . css ( {
617+ 'background' : 'url(https://raw.githubusercontent.com/BNDong/Cnblogs-Theme-SimpleMemory/master/img/footer.png) no-repeat 50%' ,
618+ 'height' : '368px' ,
619+ 'z-index' : '1' ,
620+ 'position' : 'absolute' ,
621+ 'bottom' : '100px' ,
622+ 'width' : '100%' ,
623+ 'pointer-events' : 'none'
624+ } ) ;
625+ }
626+
627+ // v1.1+ 页脚
628+ function init_t2 ( ) {
629+
630+ bgFooter = '<footer>' +
631+ '<footer-background>' +
632+ '<figure class="clouds"></figure>' +
633+ '<figure class="background"></figure>' +
634+ '<figure class="foreground"></figure>' +
635+ '<figure class="poof"></figure>' +
636+ '</footer-background>' +
637+ '</footer>' ;
638+
639+ addFooterHtml ( ) ;
640+ }
641+
583642 // 添加页脚
584643 function addFooterHtml ( ) {
585644 const poweredby = $ ( '#poweredby' ) ;
586- footer . prepend ( bgFooter ) ;
645+ bgFooter && footer . prepend ( bgFooter ) ;
587646 if ( poweredby . length > 0 ) {
588647 poweredby . before ( pvHtml ) ;
589648 } else {
@@ -908,7 +967,7 @@ function Base() {
908967 $ ( '#cb_post_title_url' ) . addClass ( 'post-del-title' ) ;
909968
910969 if ( window . cnblogsConfig . essayTopAnimationRendered )
911- require ( [ 'TweenMax' , 'MyTween '] , function ( ) {
970+ require ( [ 'TweenMax_MyTween ' ] , function ( ) {
912971 $ ( '#notHomeTopCanvas' ) . css ( {
913972 'margin' : 'auto' ,
914973 'width' : '100%' ,
@@ -927,7 +986,7 @@ function Base() {
927986 * 设置图片灯箱效果
928987 */
929988 this . baguetteBox = function ( ) {
930- require ( [ 'baguetteBox' , 'marvin' , 'articleStatement '] , function ( baguetteBox ) {
989+ require ( [ 'baguetteBox' , 'title_marvin_articleStatement ' ] , function ( baguetteBox ) {
931990
932991 // 设置图片点击查看
933992 const cpb = $ ( '#cnblogs_post_body' )
0 commit comments