Skip to content

Commit 47a71cc

Browse files
committed
Release v1.1.8
1 parent 4c24a3a commit 47a71cc

File tree

15 files changed

+168
-27
lines changed

15 files changed

+168
-27
lines changed

docs/v1.1/Docs/Customization/config.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,30 @@ prettify、desert、sunburst、obsidian、doxy
696696
697697
## 页脚配置
698698
699+
### footerStyle - 页脚样式
700+
701+
?> 版本 >= v1.1.8
702+
703+
* 类型:```Int```
704+
* 默认值:```2```
705+
706+
页脚样式:
707+
708+
footerStyle: 1
709+
710+
![footer_01](../../Images/footer_01.png)
711+
712+
footerStyle: 2
713+
714+
![footer_02](../../Images/footer_02.png)
715+
716+
```javascript
717+
window.cnblogsConfig = {
718+
footerStyle: 1
719+
}
720+
```
721+
722+
699723
### bottomBlogroll - 友情链接
700724
701725
* 类型:```Array```

docs/v1.1/Docs/GettingStarted/install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ CSS代码位置:```/src/style/base.min.css``` 拷贝此文件代码至页面
5959
```html
6060
<script type="text/javascript">
6161
window.cnblogsConfig = {
62-
GhVersions : 'v1.1.7', // 版本
62+
GhVersions : 'v1.1.8', // 版本
6363
blogUser : "userName", // 用户名
6464
blogAvatar : "https://xxxx.png", // 用户头像
6565
blogStartDate : "2016-11-17", // 入园时间,年-月-日。入园时间查看方法:鼠标停留园龄时间上,会显示入园时间
6666
}
6767
</script>
68-
<script src="https://cdn.jsdelivr.net/gh/BNDong/Cnblogs-Theme-SimpleMemory@v1.1.7/src/script/simpleMemory.min.js"></script>
68+
<script src="https://cdn.jsdelivr.net/gh/BNDong/Cnblogs-Theme-SimpleMemory@v1.1.8/src/script/simpleMemory.min.js"></script>
6969
```
7070

7171
!> 注意:引入的文件 simpleMemory.min.js 版本需要与配置 window.cnblogsConfig.GhVersions 一致!

docs/v1.1/Docs/Guide/menuData.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
- 日历
2020
- 文章档案
2121

22+
**v1.1.8 新增**
23+
24+
- 积分与排名
25+
2226
## 支持数据不显示的调试方法
2327

2428
### 开启对应显示设置

docs/v1.1/Images/footer_01.png

399 KB
Loading

docs/v1.1/Images/footer_02.png

136 KB
Loading

src/script/TweenMax_MyTween.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/script/articleStatement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ $(document).ready(function(){
7979
// 设置关于作者
8080
var aboutHtml = window.cnblogsConfig.essaySuffix.aboutHtml
8181
? window.cnblogsConfig.essaySuffix.aboutHtml
82-
: '热爱生活,爱读书/旅游,喜欢技术,乐于专研。评论和私信会在第一时间回复。或者<a href="https://msg.cnblogs.com/msg/send/'+tmp[3]+'" target="_blank">直接私信</a>我。';
82+
: '热爱生活,爱读书/旅游,乐于专研。评论和私信会在第一时间回复。或者<a href="https://msg.cnblogs.com/msg/send/'+tmp[3]+'" target="_blank">直接私信</a>我。';
8383

8484
bottom_html += '<span class="essaySuffix-right-title">关于博主</span>:' + aboutHtml + '<br>';
8585

src/script/articleTitle.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $(document).ready(function () {
2828
}
2929

3030
function setTh1(th1) {
31-
var th1Text = th1.text();
31+
var th1Text = HTMLEncode(th1.text());
3232

3333
if (!th1set) th1set = true;
3434

@@ -57,7 +57,7 @@ $(document).ready(function () {
5757

5858
function setTh2(th2, index) {
5959

60-
var th2Text = th2.text();
60+
var th2Text = HTMLEncode(th2.text());
6161

6262
th2.wrap('<span title-type="h2" class="header__span"></span>');
6363
th2.text('');
@@ -99,4 +99,15 @@ $(document).ready(function () {
9999
}
100100
) ;
101101
}
102+
103+
/**
104+
* @return {string}
105+
*/
106+
function HTMLEncode(html) {
107+
var temp = document.createElement("div");
108+
(temp.textContent != null) ? (temp.textContent = html) : (temp.innerText = html);
109+
var output = temp.innerHTML;
110+
temp = null;
111+
return output;
112+
}
102113
});

src/script/base.js

Lines changed: 77 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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')

src/script/config.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ require.config({
4949
tools: setFileNameMin('tools', 'js'),
5050
//-- base
5151
base: setFileNameMin('base', 'js'),
52+
53+
// == 合并压缩文件 == //
54+
//-- 菜单滚动条 && 进度条 && 旋转
55+
optiscroll_ToProgress_rotate: setFileNameMin('optiscroll_ToProgress_rotate.min', 'js'),
56+
//-- 文章标题 && 文章目录 && 文章后缀
57+
title_marvin_articleStatement: setFileNameMin('title_marvin_articleStatement.min', 'js'),
58+
//-- 非主页头图动画
59+
TweenMax_MyTween: setFileNameMin('TweenMax_MyTween.min', 'js'),
5260
},
5361
shim:{
5462
optiscroll: {
@@ -91,6 +99,14 @@ require.config({
9199
'css!'+getJsDelivrUrl('footer.css'),
92100
'css!https://at.alicdn.com/t/font_543384_ezv3l7gd9r7.css', // 阿里云字体图标
93101
]
94-
}
102+
},
103+
104+
// == 合并压缩文件 == //
105+
optiscroll_ToProgress_rotate: {
106+
deps: ['css!'+getJsDelivrUrl('optiscroll.css')]
107+
},
108+
title_marvin_articleStatement: {
109+
deps: ['bootstrap', 'css!'+getJsDelivrUrl('marvin.nav2.css')]
110+
},
95111
}
96112
});

0 commit comments

Comments
 (0)