Skip to content

Commit

Permalink
bump to version 20220611
Browse files Browse the repository at this point in the history
  • Loading branch information
baiyuanneko committed Jun 11, 2022
1 parent 39e2108 commit 43b4f00
Show file tree
Hide file tree
Showing 11 changed files with 236 additions and 25 deletions.
2 changes: 1 addition & 1 deletion App/App.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"currentProgramVersion": 20220604,
"currentProgramVersion": 20220611,
"AppName": "Baiyang-lzy's Blog Generator"
}
5 changes: 4 additions & 1 deletion App/blog_source/data/index.english.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,8 @@
"自定义JS": "",
"文章列表中每页的文章数为": 10,
"全站内容授权协议": "reserved",
"不使用全站内容授权协议": false
"不使用全站内容授权协议": false,
"文章页面显示上一篇下一篇文章导航按钮": true,
"提供文章文件下载": false,
"提供复制全文到剪贴板的选项": false
}
5 changes: 4 additions & 1 deletion App/blog_source/data/index.zhcn.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,8 @@
"自定义JS": "",
"文章列表中每页的文章数为": 10,
"全站内容授权协议": "reserved",
"不使用全站内容授权协议": false
"不使用全站内容授权协议": false,
"文章页面显示上一篇下一篇文章导航按钮": true,
"提供文章文件下载": false,
"提供复制全文到剪贴板的选项": false
}
142 changes: 140 additions & 2 deletions App/blog_source/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
border-radius: 12px;
}

.articlebottomnav{
background-color: white;
box-shadow: 0 1px 1px -2px rgb(0 0 0 / 20%),
0 2px 2px 0 rgb(0 0 0 / 36%), 0 1px 5px 0 rgb(0 0 0 / 32%);
opacity: 0.8;
border-radius: 12px;
}

.nav-item-active {
border-bottom: 2px solid white;
}
Expand Down Expand Up @@ -568,6 +576,11 @@
}
}

function copy_full_article_to_clipboard(){
navigator.clipboard.writeText(document.querySelector("#article-content-html").innerText);
document.getElementById("copy_to_clipboard_button").innerHTML=`<i class="fa fa-check"></i> 已复制!`;
}

bootstrap_css_import_finished = false;
content_load_finished = false;

Expand Down Expand Up @@ -876,8 +889,32 @@ <h2> ${blog["文章列表"][article_id]["文章标题"]}</h2>
Date.parse(new Date())
)
.then(function (response) {
document.querySelector("#article-content").innerHTML +=
marked.parse(response.data);
document.querySelector("#article-content").innerHTML +=`
<div id="article-content-html">${marked.parse(response.data)}</div>`;

if(blog["提供文章文件下载"] || blog["提供复制全文到剪贴板的选项"]){
document.getElementById("article-content").innerHTML+=`
<br />
<div style="float:right;font-size:18px" id="article-bottom-bar">
</div><br />
`
}



if(blog["提供文章文件下载"]){
document.getElementById("article-bottom-bar").innerHTML+=`
<a class="btn btn-primary" href="./data/articles/${blog["文章列表"][article_id]["文件名"]}" download="${blog["文章列表"][article_id]["文章标题"]}.md"><i class="fa fa-download"></i> 将该文章下载到你的计算机上</a>
`;
}

if(blog["提供复制全文到剪贴板的选项"]){
document.getElementById("article-bottom-bar").innerHTML+=`
<a class="btn btn-primary" id="copy_to_clipboard_button" onclick="copy_full_article_to_clipboard();"><i class="fa fa-clipboard"></i> 复制全文到剪贴板</a>
`;
}

if (blog["不使用全站内容授权协议"] === false) {
document.querySelector(
"#article-content"
Expand All @@ -890,7 +927,108 @@ <h5 class="alert-heading">版权声明</h5>
`;
}

if(blog["文章页面显示上一篇下一篇文章导航按钮"]){


if(article_id === 0 && blog["文章列表"][article_id+1] != undefined && blog["文章列表"][article_id+1]["是否隐藏"] !== true){
document.getElementById("container").innerHTML += `
<div class="row">
<div class="col">
<div class="card articlebottomnav" style="float:left;width:100%">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted"><i class="fa fa-arrow-left"></i> 上一篇文章</h6>
<h5 class="card-title"><a href="./index.html?type=article&filename=${blog["文章列表"][article_id+1]["文件名"]}">${blog["文章列表"][article_id+1]["文章标题"]}</a></h5>
</div>
</div>
</div>
<div class="col">
<div class="card articlebottomnav" style="float:right;text-align:right;width:100%">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted">下一篇文章 <i class="fa fa-arrow-right"></i></h6>
<h5 class="card-title">没有了</h5>
</div>
</div>
</div>
</div>
`
}

if(article_id === 0 && blog["文章列表"][article_id+1] == undefined){
document.getElementById("container").innerHTML += `
<div class="row">
<div class="col">
<div class="card articlebottomnav" style="float:left;width:100%">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted"><i class="fa fa-arrow-left"></i> 上一篇文章</h6>
<h5 class="card-title">没有了</h5>
</div>
</div>
</div>
<div class="col">
<div class="card articlebottomnav" style="float:right;text-align:right;width:100%">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted">下一篇文章 <i class="fa fa-arrow-right"></i></h6>
<h5 class="card-title">没有了</h5>
</div>
</div>
</div>
</div>
`
}

if(article_id !== 0 && blog["文章列表"][article_id+1] == undefined && blog["文章列表"][article_id-1]["是否隐藏"] !== true){
document.getElementById("container").innerHTML += `
<div class="row">
<div class="col">
<div class="card articlebottomnav" style="float:left;width:100%">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted"><i class="fa fa-arrow-left"></i> 上一篇文章</h6>
<h5 class="card-title">没有了</h5>
</div>
</div>
</div>
<div class="col">
<div class="card articlebottomnav" style="float:right;text-align:right;width:100%">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted">下一篇文章 <i class="fa fa-arrow-right"></i></h6>
<h5 class="card-title"><a href="./index.html?type=article&filename=${blog["文章列表"][article_id-1]["文件名"]}">${blog["文章列表"][article_id-1]["文章标题"]}</a></h5>
</div>
</div>
</div>
</div>
`
}

if(article_id !== 0 && blog["文章列表"][article_id+1] != undefined && blog["文章列表"][article_id+1]["是否隐藏"] !== true && blog["文章列表"][article_id-1]["是否隐藏"] !== true){
document.getElementById("container").innerHTML += `
<div class="row">
<div class="col">
<div class="card articlebottomnav" style="float:left;width:100%">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted"><i class="fa fa-arrow-left"></i> 上一篇文章</h6>
<h5 class="card-title"><a href="./index.html?type=article&filename=${blog["文章列表"][article_id+1]["文件名"]}">${blog["文章列表"][article_id+1]["文章标题"]}</a></h5>
</div>
</div>
</div>
<div class="col">
<div class="card articlebottomnav" style="float:right;text-align:right;width:100%">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted">下一篇文章 <i class="fa fa-arrow-right"></i></h6>
<h5 class="card-title"><a href="./index.html?type=article&filename=${blog["文章列表"][article_id-1]["文件名"]}">${blog["文章列表"][article_id-1]["文章标题"]}</a></h5>
</div>
</div>
</div>
</div>
`
}

}




if (
Expand Down
36 changes: 21 additions & 15 deletions App/check_migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ function addSupportForContentLicense() {
blog["不使用全站内容授权协议"] = false;
}

function addSupportForArticleBottomExternalOptions(){
blog["文章页面显示上一篇下一篇文章导航按钮"] = true;
blog["提供文章文件下载"] = false;
blog["提供复制全文到剪贴板的选项"] = false;
}

module.exports = function () {
let currentBlogVersion = parseInt(
blog["博客程序版本(禁止修改此值,否则会导致跨版本升级异常)"],
Expand Down Expand Up @@ -128,7 +134,6 @@ module.exports = function () {

if (currentBlogVersion <= 20210812) {
thirdPartyThemeReset();
updateBlogIndexHtml();
cleanStaticRes();
addSupportForPublicCommentService();
addSupportOfMultiLanguage();
Expand All @@ -138,11 +143,11 @@ module.exports = function () {
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion <= 20210817 && currentBlogVersion >= 20210813) {
thirdPartyThemeReset();
updateBlogIndexHtml();

cleanStaticRes();
addSupportForPublicCommentService();
Expand All @@ -153,6 +158,7 @@ module.exports = function () {
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (
Expand All @@ -163,7 +169,6 @@ module.exports = function () {
currentBlogVersion === 20210828
) {
thirdPartyThemeReset();
updateBlogIndexHtml();
addSupportForPublicCommentService();
addSupportOfMultiLanguage();
addSupportForAnnouncementBoard();
Expand All @@ -172,102 +177,103 @@ module.exports = function () {
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion === 20210925) {
thirdPartyThemeReset();
updateBlogIndexHtml();
addSupportOfMultiLanguage();
addSupportForAnnouncementBoard();
addSupportOfFriendBook();
addSupportForCDNSetting();
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion === 20211002 || currentBlogVersion === 20211003 || currentBlogVersion === 20211016 || currentBlogVersion === 20211022 || currentBlogVersion === 20211106) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportOfMultiLanguage();
addSupportForAnnouncementBoard();
addSupportOfFriendBook();
addSupportForCDNSetting();
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion === 20211205) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportOfMultiLanguage();
addSupportForAnnouncementBoard();
addSupportOfFriendBook();
addSupportForCDNSetting();
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion === 20220119) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportForAnnouncementBoard();
addSupportOfFriendBook();
addSupportForCDNSetting();
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}
if (currentBlogVersion === 20220123) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportOfFriendBook();
addSupportForCDNSetting();
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion === 20220202) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportForCDNSetting();
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}
if (currentBlogVersion === 20220210) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportForCustomCJ();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}
if (currentBlogVersion === 20220211 || currentBlogVersion === 20220212) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion === 20220213) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportOfArticlePageOrder();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion === 20220304) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportForContentLicense();
addSupportForArticleBottomExternalOptions();
}

if (currentBlogVersion === 20220314 || currentBlogVersion === 20220315 || currentBlogVersion === 20220427 || currentBlogVersion === 20220507 || currentBlogVersion === 20220514 || currentBlogVersion === 20220515) {
if (currentBlogVersion >= 20220314 && currentBlogVersion <= 20220604) {
check_third_party_theme_compatiblity();
updateBlogIndexHtml();
addSupportForArticleBottomExternalOptions();
}

check_third_party_theme_compatiblity();
Expand Down
4 changes: 2 additions & 2 deletions App/render_article_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ module.exports = function () {
<button class="fluentbtn fluentbtn-blue" onclick="edit_article_meta(${i})"><i class="fa fa-info-circle"></i> ${langdata["EDIT_ARTICLE_META"][lang_name]}</button>
<button class="fluentbtn" onclick="delete_article(${i})"><i class="fa fa-trash-o"></i> ${langdata["DELETE_ARTICLE"][lang_name]}</button>
<br /><br />
<button class="fluentbtn" onclick="let_article_up(${i})">上移一格</button>
<button class="fluentbtn" onclick="let_article_down(${i})">下移一格</button>
<button class="fluentbtn" onclick="let_article_up(${i})"><i class="fa fa-arrow-up"></i> 上移一格</button>
<button class="fluentbtn" onclick="let_article_down(${i})"><i class="fa fa-arrow-down"></i> 下移一格</button>
`;
}

Expand Down
12 changes: 12 additions & 0 deletions App/render_blog_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ module.exports = function () {
document.getElementById("blog_settings_enable_custom_js").checked = true;
}

if (blog["文章页面显示上一篇下一篇文章导航按钮"] === true) {
document.getElementById("enable_article_bottom_nav").checked = true;
}

if (blog["提供文章文件下载"] === true) {
document.getElementById("enable_article_file_download").checked = true;
}

if (blog["提供复制全文到剪贴板的选项"] === true) {
document.getElementById("enable_copy_full_article_to_clipboard").checked = true;
}

if (blog["CDN选择"] === 1) {
// 从列表中选择cdn地址
document.getElementById("cdn_cho_1").checked = true;
Expand Down
Loading

0 comments on commit 43b4f00

Please sign in to comment.