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,14 +51,14 @@
</head>
<body>
<#include "header.ftl">
<div id="pjaxArticle">
<#if pjax><!---- pjax {#pjaxArticle} start ----></#if>
<div class="main post__main">
<#if noticeBoard??>
<div id="pjax">
<#if pjax><!---- pjax {#pjax} start ----></#if>
<div class="main post__main">
<#if noticeBoard??>
<div class="board">
${noticeBoard}
</div>
</#if>
</#if>
<div class="wrapper content">
<article class="post">
<header>
@ -131,8 +131,7 @@
</div>
</article>
</div>
</div>
<div class="article__bottom">
<div class="article__bottom">
<div class="wrapper">
<div class="fn-flex footer__tag">
<div class="fn-flex-1" id="externalRelevantArticles"></div>
@ -141,9 +140,9 @@
</div>
<@comments commentList=articleComments article=article></@comments>
</div>
</div>
</div>
<div class="article__toolbar">
<div class="article__toolbar">
<div class="wrapper">
<a class="post__view" href="${servePath}${article.articlePermalink}">
${article.articleViewCount} ${viewLabel}
@ -185,9 +184,9 @@
</#if>
</div>
</div>
</div>
</div>
<div class="post__side">
<div class="post__side">
<span class="pipe-tooltipped pipe-tooltipped--e post__share-icon ft-green"
onclick="$('#comment').focus()"
aria-label="${commentLabel}">
@ -215,9 +214,9 @@
data-url="${servePath}${article.articlePermalink}"
data-avatar="${article.authorThumbnailURL}"></span>
</div>
</div>
<#if pjax><!---- pjax {#pjaxArticle} end ----></#if>
</div>
</div>
<#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,35 +228,36 @@
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}";
@ -273,6 +273,7 @@
}
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');
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();
Skin.initComment($('.post__tags').data('oid'), $('.post__tags').data('tag'))
}
})
},
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) {