Van 2018-09-25 10:48:28 +08:00
parent 751599e758
commit 73c125c9f0
No known key found for this signature in database
GPG Key ID: 7059B8783A78F16C
2 changed files with 160 additions and 146 deletions

View File

@ -51,64 +51,64 @@
</head>
<body>
<#include "header.ftl">
<div id="pjaxArticle">
<#if pjax><!---- pjax {#pjaxArticle} start ----></#if>
<div class="main post__main">
<#if noticeBoard??>
<div class="board">
${noticeBoard}
</div>
</#if>
<div class="wrapper content">
<article class="post">
<header>
<h1 class="post__title">
${article.articleTitle}
<div id="pjax">
<#if pjax><!---- pjax {#pjax} start ----></#if>
<div class="main post__main">
<#if noticeBoard??>
<div class="board">
${noticeBoard}
</div>
</#if>
<div class="wrapper content">
<article class="post">
<header>
<h1 class="post__title">
${article.articleTitle}
<#if article.articlePutTop>
<sup>
${topArticleLabel}
${topArticleLabel}
</sup>
</#if>
<#if article.hasUpdated>
<sup>
${updatedLabel}
${updatedLabel}
</sup>
</#if>
</h1>
</header>
<section class="content-reset">
${article.articleContent}
</h1>
</header>
<section class="content-reset">
${article.articleContent}
<#if "" != article.articleSign.signHTML?trim>
<div>
${article.articleSign.signHTML}
${article.articleSign.signHTML}
</div>
</#if>
</section>
<footer data-oid="${article.oId}"
class="post__tags"
data-tag="<#list article.articleTags?split(",") as articleTag>${articleTag}<#if articleTag_has_next>,</#if></#list>">
</section>
<footer data-oid="${article.oId}"
class="post__tags"
data-tag="<#list article.articleTags?split(",") as articleTag>${articleTag}<#if articleTag_has_next>,</#if></#list>">
<#list article.articleTags?split(",") as articleTag>
<a class="tag" rel="tag" href="${servePath}/tags/${articleTag?url('UTF-8')}">
${articleTag}</a>
${articleTag}</a>
</#list>
</footer>
<div class="post__share fn-clear">
<time class="ft-gray">
${article.articleCreateDate?string("yyyy-MM-dd")} •
</time>
<a class="post__view" href="${servePath}${article.articlePermalink}">
${article.articleViewCount} ${viewLabel}</a>
<div class="fn-right">
</footer>
<div class="post__share fn-clear">
<time class="ft-gray">
${article.articleCreateDate?string("yyyy-MM-dd")} •
</time>
<a class="post__view" href="${servePath}${article.articlePermalink}">
${article.articleViewCount} ${viewLabel}</a>
<div class="fn-right">
<span class="pipe-tooltipped pipe-tooltipped--n post__share-icon ft-green"
onclick="$('#comment').focus()"
aria-label="${commentLabel}">
<svg>
<use xlink:href="#icon-comment"></use>
</svg>
${article.articleCommentCount} &nbsp; &nbsp;
${article.articleCommentCount} &nbsp; &nbsp;
</span>
<span id="articleShare">
<span id="articleShare">
<span class="post__share-icon" data-type="wechat">
<svg><use xlink:href="#icon-wechat"></use></svg>
</span> &nbsp; &nbsp;
@ -127,97 +127,96 @@
data-url="${servePath}${article.articlePermalink}"
data-avatar="${article.authorThumbnailURL}"></span>
</span>
</div>
</div>
</article>
</div>
<div class="article__bottom">
<div class="wrapper">
<div class="fn-flex footer__tag">
<div class="fn-flex-1" id="externalRelevantArticles"></div>
<div class="fn-flex-1" id="relevantArticles"></div>
<div class="fn-flex-1" id="randomArticles"></div>
</div>
<@comments commentList=articleComments article=article></@comments>
</div>
</div>
<div class="article__toolbar">
<div class="wrapper">
<a class="post__view" href="${servePath}${article.articlePermalink}">
${article.articleViewCount} ${viewLabel}
</a>
<div class="fn-right">
<span class="pipe-tooltipped pipe-tooltipped--n post__share-icon ft-green"
onclick="$('#comment').focus()"
aria-label="${commentLabel}">
<svg>
<use xlink:href="#icon-comment"></use>
</svg>
${article.articleCommentCount} &nbsp; &nbsp;
</span>
<span id="articleBottomShare">
<span class="post__share-icon" data-type="wechat">
<svg><use xlink:href="#icon-wechat"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="weibo">
<svg><use xlink:href="#icon-weibo"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="twitter">
<svg><use xlink:href="#icon-twitter"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="google">
<svg><use xlink:href="#icon-google"></use></svg>
</span>
<span class="article__code"
data-title="${article.articleTitle}"
data-blogtitle="${blogTitle}"
data-url="${servePath}${article.articlePermalink}"
data-avatar="${article.authorThumbnailURL}"></span>
</span>
<#if nextArticlePermalink??>
<a href="${servePath}${nextArticlePermalink}" rel="next" class="article__next">
<span class="ft-12 ft-gray">${nextArticleLabel}</span> <br>
${nextArticleTitle}
</a>
</#if>
</div>
</div>
</article>
</div>
</div>
<div class="article__bottom">
<div class="wrapper">
<div class="fn-flex footer__tag">
<div class="fn-flex-1" id="externalRelevantArticles"></div>
<div class="fn-flex-1" id="relevantArticles"></div>
<div class="fn-flex-1" id="randomArticles"></div>
</div>
<@comments commentList=articleComments article=article></@comments>
</div>
</div>
<div class="article__toolbar">
<div class="wrapper">
<a class="post__view" href="${servePath}${article.articlePermalink}">
${article.articleViewCount} ${viewLabel}
</a>
<div class="fn-right">
<span class="pipe-tooltipped pipe-tooltipped--n post__share-icon ft-green"
onclick="$('#comment').focus()"
aria-label="${commentLabel}">
<svg>
<use xlink:href="#icon-comment"></use>
</svg>
${article.articleCommentCount} &nbsp; &nbsp;
</span>
<span id="articleBottomShare">
<span class="post__share-icon" data-type="wechat">
<svg><use xlink:href="#icon-wechat"></use></svg>
</span> &nbsp; &nbsp;
<div class="post__side">
<span class="pipe-tooltipped pipe-tooltipped--e post__share-icon ft-green"
onclick="$('#comment').focus()"
aria-label="${commentLabel}">
<span class="ft-gray">${article.articleCommentCount}</span>
<svg>
<use xlink:href="#icon-comment"></use>
</svg>
</span>
<div id="articleSideShare">
<span class="post__share-icon" data-type="wechat">
<svg><use xlink:href="#icon-wechat"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="weibo">
<svg><use xlink:href="#icon-weibo"></use></svg>
</span> &nbsp; &nbsp;
<svg><use xlink:href="#icon-weibo"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="twitter">
<svg><use xlink:href="#icon-twitter"></use></svg>
</span> &nbsp; &nbsp;
<svg><use xlink:href="#icon-twitter"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="google">
<svg><use xlink:href="#icon-google"></use></svg>
</span>
<svg><use xlink:href="#icon-google"></use></svg>
</span>
<span class="article__code"
data-title="${article.articleTitle}"
data-blogtitle="${blogTitle}"
data-url="${servePath}${article.articlePermalink}"
data-avatar="${article.authorThumbnailURL}"></span>
</span>
<#if nextArticlePermalink??>
<a href="${servePath}${nextArticlePermalink}" rel="next" class="article__next">
<span class="ft-12 ft-gray">${nextArticleLabel}</span> <br>
${nextArticleTitle}
</a>
</#if>
</div>
</div>
</div>
</div>
<div class="post__side">
<span class="pipe-tooltipped pipe-tooltipped--e post__share-icon ft-green"
onclick="$('#comment').focus()"
aria-label="${commentLabel}">
<span class="ft-gray">${article.articleCommentCount}</span>
<svg>
<use xlink:href="#icon-comment"></use>
</svg>
</span>
<div id="articleSideShare">
<span class="post__share-icon" data-type="wechat">
<svg><use xlink:href="#icon-wechat"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="weibo">
<svg><use xlink:href="#icon-weibo"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="twitter">
<svg><use xlink:href="#icon-twitter"></use></svg>
</span> &nbsp; &nbsp;
<span class="post__share-icon" data-type="google">
<svg><use xlink:href="#icon-google"></use></svg>
</span>
<span class="article__code"
data-title="${article.articleTitle}"
data-blogtitle="${blogTitle}"
data-url="${servePath}${article.articlePermalink}"
data-avatar="${article.authorThumbnailURL}"></span>
</div>
</div>
<#if pjax><!---- pjax {#pjaxArticle} end ----></#if>
<#if pjax><!---- pjax {#pjax} end ----></#if>
</div>
<script type="text/javascript" src="${staticServePath}/js/lib/compress/pjax.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
@ -229,50 +228,52 @@
charset="utf-8"></script>
<script type="text/javascript">
var latkeConfig = {
"servePath": "${servePath}",
"staticServePath": "${staticServePath}",
"isLoggedIn": "${isLoggedIn?string}",
"userName": "${userName}"
};
'servePath': "${servePath}",
'staticServePath': "${staticServePath}",
'isLoggedIn': "${isLoggedIn?string}",
'userName': "${userName}",
}
var Label = {
"skinDirName": "${skinDirName}",
"em00Label": "${em00Label}",
"em01Label": "${em01Label}",
"em02Label": "${em02Label}",
"em03Label": "${em03Label}",
"em04Label": "${em04Label}",
"em05Label": "${em05Label}",
"em06Label": "${em06Label}",
"em07Label": "${em07Label}",
"em08Label": "${em08Label}",
"em09Label": "${em09Label}",
"em10Label": "${em10Label}",
"em11Label": "${em11Label}",
"em12Label": "${em12Label}",
"em13Label": "${em13Label}",
"em14Label": "${em14Label}"
};
'skinDirName': "${skinDirName}",
'em00Label': "${em00Label}",
'em01Label': "${em01Label}",
'em02Label': "${em02Label}",
'em03Label': "${em03Label}",
'em04Label': "${em04Label}",
'em05Label': "${em05Label}",
'em06Label': "${em06Label}",
'em07Label': "${em07Label}",
'em08Label': "${em08Label}",
'em09Label': "${em09Label}",
'em10Label': "${em10Label}",
'em11Label': "${em11Label}",
'em12Label': "${em12Label}",
'em13Label': "${em13Label}",
'em14Label': "${em14Label}",
}
Util.killIE()
Util.parseMarkdown('content-reset');
Skin.initArticle();
Util.parseMarkdown('content-reset')
Skin.initArticle()
</script>
<!---- pjax {#pjax} start ----></#if>
<@comment_script oId=article.oId>
Skin.initComment = function (articleOId, articleTags) {
page.tips.externalRelevantArticlesDisplayCount = "${externalRelevantArticlesDisplayCount}";
<#if 0 != randomArticlesDisplayCount>
<#if 0 != randomArticlesDisplayCount>
page.loadRandomArticles("<div class='module__title'><span>${randomArticlesLabel}</span></div>");
</#if>
<#if 0 != externalRelevantArticlesDisplayCount>
</#if>
<#if 0 != externalRelevantArticlesDisplayCount>
page.loadExternalRelevantArticles(articleTags, "<div class='module__title'><span>${externalRelevantArticlesLabel}</span></div>");
</#if>
<#if 0 != relevantArticlesDisplayCount>
</#if>
<#if 0 != relevantArticlesDisplayCount>
page.loadRelevantArticles(articleOId, '<div class="module__title"><span>${relevantArticlesLabel}</span></div>');
</#if>
</#if>
}
Skin.initComment('${article.oId}', "<#list article.articleTags?split(",") as articleTag>${articleTag}<#if articleTag_has_next>,</#if></#list>")
</@comment_script>
<!---- pjax {#pjax} end ----></#if>
${plugins}
</body>
</html>

View File

@ -51,10 +51,17 @@ var Skin = {
if (location.href === latkeConfig.servePath + '/tags.html') {
Skin.initTags()
}
}, function () {
Util.parseMarkdown('content-reset');
Skin.initArticle();
Skin.initComment($('.post__tags').data('oid'), $('.post__tags').data('tag'))
if (Util.isArticlePage(location.href)) {
if (!$('#articleSideShare .article__code').qrcode) {
$.ajax({
method: "GET",
url: latkeConfig.staticServePath + '/js/jquery.qrcode.min.js',
dataType: "script",
cache: true
});
}
Skin.initArticle();
}
})
},
initTags: function () {
@ -83,6 +90,9 @@ var Skin = {
}));
},
initArticle: function () {
if ($('#articleShare').length === 0) {
return
}
Skin._share('#articleShare')
Skin._share('#articleSideShare')
Skin._share('#articleBottomShare')
@ -96,6 +106,9 @@ var Skin = {
var sideAbsoluteTop = ($(window).height() - 249) / 2 + 125
var beforScrollTop = $(window).scrollTop()
$(window).scroll(function () {
if ($('#articleShare').length === 0) {
return
}
var scrollTop = $(window).scrollTop()
var bottomTop = $('.article__bottom').offset().top
if (scrollTop > 65) {