timeline 更新
This commit is contained in:
parent
be06efb65e
commit
fb07b16453
@ -1,99 +1,99 @@
|
|||||||
<#include "macro-head.ftl">
|
<#include "macro-head.ftl">
|
||||||
<#include "macro-comments.ftl">
|
<#include "macro-comments.ftl">
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<@head title="${article.articleTitle} - ${blogTitle}">
|
<@head title="${article.articleTitle} - ${blogTitle}">
|
||||||
<meta name="keywords" content="${article.articleTags}" />
|
<meta name="keywords" content="${article.articleTags}" />
|
||||||
<meta name="description" content="${article.articleAbstract?html}" />
|
<meta name="description" content="${article.articleAbstract?html}" />
|
||||||
</@head>
|
</@head>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
${topBarReplacement}
|
${topBarReplacement}
|
||||||
<#include "header.ftl">
|
<#include "header.ftl">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="module">
|
<div class="module">
|
||||||
<article class="article">
|
<article class="article">
|
||||||
<time class="article-time">
|
<time class="article-time">
|
||||||
<span>
|
<span>
|
||||||
<#if article.hasUpdated>
|
<#if article.hasUpdated>
|
||||||
${article.articleUpdateDate?string("yy-MM-dd HH:mm")}
|
${article.articleUpdateDate?string("yy-MM-dd HH:mm")}
|
||||||
<#else>
|
<#else>
|
||||||
${article.articleCreateDate?string("yy-MM-dd HH:mm")}
|
${article.articleCreateDate?string("yy-MM-dd HH:mm")}
|
||||||
</#if>
|
</#if>
|
||||||
</span>
|
</span>
|
||||||
</time>
|
</time>
|
||||||
<h2 class="article-title">
|
<h2 class="article-title">
|
||||||
<a href="${servePath}${article.articlePermalink}">
|
<a href="${servePath}${article.articlePermalink}">
|
||||||
${article.articleTitle}
|
${article.articleTitle}
|
||||||
</a>
|
</a>
|
||||||
<#if article.hasUpdated>
|
<#if article.hasUpdated>
|
||||||
<sup>
|
<sup>
|
||||||
${updatedLabel}
|
${updatedLabel}
|
||||||
</sup>
|
</sup>
|
||||||
</#if>
|
</#if>
|
||||||
<#if article.articlePutTop>
|
<#if article.articlePutTop>
|
||||||
<sup>
|
<sup>
|
||||||
${topArticleLabel}
|
${topArticleLabel}
|
||||||
</sup>
|
</sup>
|
||||||
</#if>
|
</#if>
|
||||||
</h2>
|
</h2>
|
||||||
<div class="article-body">
|
<div class="article-body">
|
||||||
${article.articleContent}
|
${article.articleContent}
|
||||||
</div>
|
</div>
|
||||||
<#if "" != article.articleSign.signHTML?trim>
|
<#if "" != article.articleSign.signHTML?trim>
|
||||||
<p>
|
<p>
|
||||||
${article.articleSign.signHTML}
|
${article.articleSign.signHTML}
|
||||||
</p>
|
</p>
|
||||||
</#if>
|
</#if>
|
||||||
<span class="ico-tags ico" title="${tagLabel}">
|
<span class="ico-tags ico" title="${tagLabel}">
|
||||||
<#list article.articleTags?split(",") as articleTag><a rel="tag" href="${servePath}/tags/${articleTag?url('UTF-8')}">${articleTag}</a><#if articleTag_has_next>,</#if></#list>
|
<#list article.articleTags?split(",") as articleTag><a rel="tag" href="${servePath}/tags/${articleTag?url('UTF-8')}">${articleTag}</a><#if articleTag_has_next>,</#if></#list>
|
||||||
</span>
|
</span>
|
||||||
<span class="ico-author ico" title="${authorLabel}">
|
<span class="ico-author ico" title="${authorLabel}">
|
||||||
<a rel="author" href="${servePath}/authors/${article.authorId}">${article.authorName}</a>
|
<a rel="author" href="${servePath}/authors/${article.authorId}">${article.authorName}</a>
|
||||||
</span>
|
</span>
|
||||||
<span class="ico-comment ico" title="${commentLabel}">
|
<span class="ico-comment ico" title="${commentLabel}">
|
||||||
|
|
||||||
<a rel="nofollow" href="${servePath}${article.articlePermalink}#comments">
|
<a rel="nofollow" href="${servePath}${article.articlePermalink}#comments">
|
||||||
<#if article.articleCommentCount == 0>
|
<#if article.articleCommentCount == 0>
|
||||||
${noCommentLabel}
|
${noCommentLabel}
|
||||||
<#else>
|
<#else>
|
||||||
${article.articleCommentCount}
|
${article.articleCommentCount}
|
||||||
</#if>
|
</#if>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span class="ico-view ico" title="${viewLabel}">
|
<span class="ico-view ico" title="${viewLabel}">
|
||||||
<a rel="nofollow" href="${servePath}${article.articlePermalink}">
|
<a rel="nofollow" href="${servePath}${article.articlePermalink}">
|
||||||
${article.articleViewCount}
|
${article.articleViewCount}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</article>
|
</article>
|
||||||
<div class="fn-clear" style="margin-top: 30px;">
|
<div class="fn-clear" style="margin-top: 30px;">
|
||||||
<#if nextArticlePermalink??>
|
<#if nextArticlePermalink??>
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<a href="${servePath}${nextArticlePermalink}">
|
<a href="${servePath}${nextArticlePermalink}">
|
||||||
<span class="ico-pre">«</span>
|
<span class="ico-pre">«</span>
|
||||||
${nextArticleTitle}
|
${nextArticleTitle}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</#if>
|
</#if>
|
||||||
<#if previousArticlePermalink??>
|
<#if previousArticlePermalink??>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<a href="${servePath}${previousArticlePermalink}">
|
<a href="${servePath}${previousArticlePermalink}">
|
||||||
${previousArticleTitle}
|
<span class="left">${previousArticleTitle}</span>
|
||||||
<span class="ico-next">»</span>
|
<span class="ico-next">»</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</#if>
|
</#if>
|
||||||
</div>
|
</div>
|
||||||
<@comments commentList=articleComments article=article></@comments>
|
<@comments commentList=articleComments article=article></@comments>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<#include "footer.ftl">
|
<#include "footer.ftl">
|
||||||
<@comment_script oId=article.oId>
|
<@comment_script oId=article.oId>
|
||||||
page.tips.externalRelevantArticlesDisplayCount = "${externalRelevantArticlesDisplayCount}";
|
page.tips.externalRelevantArticlesDisplayCount = "${externalRelevantArticlesDisplayCount}";
|
||||||
</@comment_script>
|
</@comment_script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
File diff suppressed because it is too large
Load Diff
1
timeline/css/timeline.min.css
vendored
1
timeline/css/timeline.min.css
vendored
@ -79,6 +79,7 @@ a:hover>.ico-next,a:hover>.ico-pre{background-color:#000;}
|
|||||||
.articles .r .dot{left:-37px;right:inherit;}
|
.articles .r .dot{left:-37px;right:inherit;}
|
||||||
.articles .arrow{height:15px;position:absolute;right:-9px;top:21px;width:9px;}
|
.articles .arrow{height:15px;position:absolute;right:-9px;top:21px;width:9px;}
|
||||||
.articles .r .arrow{background-position:0 -22px;left:-9px;right:inherit;}
|
.articles .r .arrow{background-position:0 -22px;left:-9px;right:inherit;}
|
||||||
|
.articles pre{background-color:#F5F5F5;border:1px solid #ddd;border-radius:4px 4px 4px 4px;padding:9.5px;white-space:pre-wrap;word-wrap:break-word;}
|
||||||
time.article-time{top:-8px;left:50%;position:absolute;}
|
time.article-time{top:-8px;left:50%;position:absolute;}
|
||||||
time.article-time>span{background-color:#FFFFFF;border:1px solid #A8A9A9;border-radius:20em 20em 20em 20em;font-size:80%;margin-left:-56px;padding:5px 10px;}
|
time.article-time>span{background-color:#FFFFFF;border:1px solid #A8A9A9;border-radius:20em 20em 20em 20em;font-size:80%;margin-left:-56px;padding:5px 10px;}
|
||||||
article .article-title{margin:10px 0 0 0;}
|
article .article-title{margin:10px 0 0 0;}
|
||||||
|
@ -1,74 +1,74 @@
|
|||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="container fn-clear">
|
<div class="container fn-clear">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<span>© ${year}</span> - <a href="${servePath}">${blogTitle}</a>
|
<span>© ${year}</span> - <a href="${servePath}">${blogTitle}</a>
|
||||||
Powered by
|
Powered by
|
||||||
<a href="http://b3log.org" target="_blank">
|
<a href="http://b3log.org" target="_blank">
|
||||||
${b3logLabel}
|
${b3logLabel}
|
||||||
<b style="color: orangered;">Solo</b></a>,
|
<b style="color: orangered;">Solo</b></a>,
|
||||||
ver ${version}
|
ver ${version}
|
||||||
Theme by <a rel="friend" rel="friend" href="http://vanessa.b3log.org" target="_blank">Vanessa</a>.
|
Theme by <a rel="friend" href="http://themify.me/demo/themes/postline/">postline</a> & <a rel="friend" href="http://vanessa.b3log.org" target="_blank">Vanessa</a>.
|
||||||
</div>
|
</div>
|
||||||
<div class="right fn-clear">
|
<div class="right fn-clear">
|
||||||
<span class="left">
|
<span class="left">
|
||||||
${viewCount1Label}
|
${viewCount1Label}
|
||||||
${statistic.statisticBlogViewCount}
|
${statistic.statisticBlogViewCount}
|
||||||
|
|
||||||
${articleCount1Label}
|
${articleCount1Label}
|
||||||
${statistic.statisticPublishedBlogArticleCount}
|
${statistic.statisticPublishedBlogArticleCount}
|
||||||
|
|
||||||
${commentCount1Label}
|
${commentCount1Label}
|
||||||
${statistic.statisticPublishedBlogCommentCount}
|
${statistic.statisticPublishedBlogCommentCount}
|
||||||
</span>
|
</span>
|
||||||
<span class="ico-translate" onclick="timeline.translate()"></span>
|
<span class="ico-translate" onclick="timeline.translate()"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ico-top none" onclick="Util.goTop()" title="TOP"></div>
|
<div class="ico-top none" onclick="Util.goTop()" title="TOP"></div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var latkeConfig = {
|
var latkeConfig = {
|
||||||
"servePath": "${servePath}",
|
"servePath": "${servePath}",
|
||||||
"staticServePath": "${staticServePath}"
|
"staticServePath": "${staticServePath}"
|
||||||
};
|
};
|
||||||
|
|
||||||
var Label = {
|
var Label = {
|
||||||
"tagLabel": "${tagLabel}",
|
"tagLabel": "${tagLabel}",
|
||||||
"viewLabel": "${viewLabel}",
|
"viewLabel": "${viewLabel}",
|
||||||
"commentLabel": "${commentLabel}",
|
"commentLabel": "${commentLabel}",
|
||||||
"noCommentLabel": "${noCommentLabel}",
|
"noCommentLabel": "${noCommentLabel}",
|
||||||
"topArticleLabel": "${topArticleLabel}",
|
"topArticleLabel": "${topArticleLabel}",
|
||||||
"authorLabel": "${authorLabel}",
|
"authorLabel": "${authorLabel}",
|
||||||
"updatedLabel": "${updatedLabel}",
|
"updatedLabel": "${updatedLabel}",
|
||||||
"contentLabel": "${contentLabel}",
|
"contentLabel": "${contentLabel}",
|
||||||
"abstractLabel": "${abstractLabel}",
|
"abstractLabel": "${abstractLabel}",
|
||||||
"clearAllCacheLabel": "${clearAllCacheLabel}",
|
"clearAllCacheLabel": "${clearAllCacheLabel}",
|
||||||
"clearCacheLabel": "${clearCacheLabel}",
|
"clearCacheLabel": "${clearCacheLabel}",
|
||||||
"moreLabel": "${moreLabel}",
|
"moreLabel": "${moreLabel}",
|
||||||
"adminLabel": "${adminLabel}",
|
"adminLabel": "${adminLabel}",
|
||||||
"logoutLabel": "${logoutLabel}",
|
"logoutLabel": "${logoutLabel}",
|
||||||
"skinDirName": "${skinDirName}",
|
"skinDirName": "${skinDirName}",
|
||||||
"loginLabel": "${loginLabel}",
|
"loginLabel": "${loginLabel}",
|
||||||
"em00Label": "${em00Label}",
|
"em00Label": "${em00Label}",
|
||||||
"em01Label": "${em01Label}",
|
"em01Label": "${em01Label}",
|
||||||
"em02Label": "${em02Label}",
|
"em02Label": "${em02Label}",
|
||||||
"em03Label": "${em03Label}",
|
"em03Label": "${em03Label}",
|
||||||
"em04Label": "${em04Label}",
|
"em04Label": "${em04Label}",
|
||||||
"em05Label": "${em05Label}",
|
"em05Label": "${em05Label}",
|
||||||
"em06Label": "${em06Label}",
|
"em06Label": "${em06Label}",
|
||||||
"em07Label": "${em07Label}",
|
"em07Label": "${em07Label}",
|
||||||
"em08Label": "${em08Label}",
|
"em08Label": "${em08Label}",
|
||||||
"em09Label": "${em09Label}",
|
"em09Label": "${em09Label}",
|
||||||
"em10Label": "${em10Label}",
|
"em10Label": "${em10Label}",
|
||||||
"em11Label": "${em11Label}",
|
"em11Label": "${em11Label}",
|
||||||
"em12Label": "${em12Label}",
|
"em12Label": "${em12Label}",
|
||||||
"em13Label": "${em13Label}",
|
"em13Label": "${em13Label}",
|
||||||
"em14Label": "${em14Label}",
|
"em14Label": "${em14Label}",
|
||||||
"localeString": "${localeString}",
|
"localeString": "${localeString}",
|
||||||
"yearLabel": "${yearLabel}",
|
"yearLabel": "${yearLabel}",
|
||||||
"monthLabel": "${monthLabel}"
|
"monthLabel": "${monthLabel}"
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="${staticServePath}/js/lib/jquery/jquery.min.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
|
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
|
<script type="text/javascript" src="${staticServePath}/skins/${skinDirName}/js/${skinDirName}${miniPostfix}.js?${staticResourceVersion}" charset="utf-8"></script>
|
||||||
${plugins}
|
${plugins}
|
||||||
|
@ -1,291 +1,426 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team
|
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview timeline js.
|
* @fileoverview timeline js.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
|
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
|
||||||
* @version 1.0.1.0, Jan 30, 2013
|
* @version 1.0.1.1, Feb 20, 2013
|
||||||
*/
|
*/
|
||||||
var timeline = {
|
var timeline = {
|
||||||
_COLHA: 0,
|
_COLHA: 0,
|
||||||
_COLHB: 20,
|
_COLHB: 20,
|
||||||
_initArticleList: function () {
|
_initArticleList: function () {
|
||||||
var $articles = $(".articles");
|
var $articles = $(".articles");
|
||||||
if ($articles.length === 0 || $(".articles > .fn-clear").length > 0) {
|
if ($articles.length === 0 || $(".articles > .fn-clear").length > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(window).resize(function () {
|
$(window).resize(function () {
|
||||||
var colH = [timeline._COLHA, timeline._COLHB];
|
var colH = [timeline._COLHA, timeline._COLHB];
|
||||||
$articles.find("article").each(function () {
|
$articles.find("article").each(function () {
|
||||||
var $it = $(this),
|
var $it = $(this),
|
||||||
isLeft = colH[1] > colH[0],
|
isLeft = colH[1] > colH[0],
|
||||||
top = isLeft ? colH[0] : colH[1];
|
top = isLeft ? colH[0] : colH[1];
|
||||||
if (!$it.hasClass("r") && !$it.hasClass("l")) {
|
if (parseInt($it.css("top")) !== top) {
|
||||||
$it.css({
|
$it.css({
|
||||||
"top": top + "px",
|
"top": top + "px",
|
||||||
"position": "absolute"
|
"position": "absolute"
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isLeft) {
|
if (isLeft) {
|
||||||
this.className = "l";
|
this.className = "l";
|
||||||
} else {
|
} else {
|
||||||
this.className = "r";
|
this.className = "r";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
|
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
$articles.height(colH[0] > colH[1] ? colH[0] : colH[1]);
|
$articles.height(colH[0] > colH[1] ? colH[0] : colH[1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(function () {
|
$(window).resize();
|
||||||
$(window).resize();
|
$(".module img").imagesLoaded(function () {
|
||||||
}, 500);
|
$(window).resize();
|
||||||
},
|
});
|
||||||
|
},
|
||||||
|
|
||||||
_initIndexList: function () {
|
|
||||||
var $archives = $(".articles > .fn-clear");
|
_initIndexList: function () {
|
||||||
if ($archives.length === 0) {
|
var $archives = $(".articles > .fn-clear");
|
||||||
return;
|
if ($archives.length === 0) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
// 如果为 index 页面,重构 archives 结构,使其可收缩
|
|
||||||
var year = 0;
|
// 如果为 index 页面,重构 archives 结构,使其可收缩
|
||||||
$(".nav-abs li").each(function (i) {
|
var year = 0;
|
||||||
var $this = $(this);
|
$(".nav-abs li").each(function (i) {
|
||||||
$this.hide();
|
var $this = $(this);
|
||||||
if (year !== $this.data("year")) {
|
$this.hide();
|
||||||
year = $this.data("year");
|
if (year !== $this.data("year")) {
|
||||||
$this.before("<li class='close year' onclick='timeline.toggleArchives(this, " +
|
year = $this.data("year");
|
||||||
year + ")'>" + year + "</li>");
|
$this.before("<li class='close year' onclick='timeline.toggleArchives(this, " +
|
||||||
}
|
year + ")'>" + year + "</li>");
|
||||||
});
|
}
|
||||||
|
});
|
||||||
// 首次加载时,当没有下一页时,使用 js 隐藏"更多"按钮
|
|
||||||
if ($(".article-more").parent().data("count") <= $(".article-more").parent().find("article").length) {
|
// 首次加载时,当没有下一页时,使用 js 隐藏"更多"按钮
|
||||||
$(".article-more").remove();
|
if ($(".article-more").parent().data("count") <= $(".article-more").parent().find("article").length) {
|
||||||
}
|
$(".article-more").remove();
|
||||||
|
}
|
||||||
$(window).resize(function () {
|
|
||||||
$archives.each(function () {
|
$(window).resize(function () {
|
||||||
var colH = [timeline._COLHA + 60, timeline._COLHB * 4];
|
console.log("resize");
|
||||||
|
$archives.each(function () {
|
||||||
var $articles = $(this).find("article");
|
var colH = [timeline._COLHA + 60, timeline._COLHB * 4];
|
||||||
if ($articles.length === 0) {
|
|
||||||
$(this).find("h2").remove();
|
var $articles = $(this).find("article");
|
||||||
$(this).css("margin-bottom" , 0);
|
if ($articles.length === 0) {
|
||||||
} else {
|
$(this).find("h2").remove();
|
||||||
$articles.each(function () {
|
$(this).css("margin-bottom" , 0);
|
||||||
var $it = $(this),
|
} else {
|
||||||
isLeft = colH[1] > colH[0],
|
$articles.each(function () {
|
||||||
top = isLeft ? colH[0] : colH[1];
|
var $it = $(this),
|
||||||
|
isLeft = colH[1] > colH[0],
|
||||||
if (!$it.hasClass("r") && !$it.hasClass("l")) {
|
top = isLeft ? colH[0] : colH[1];
|
||||||
$it.css({
|
|
||||||
"top": top + "px",
|
if (parseInt($it.css("top")) !== top) {
|
||||||
"position": "absolute"
|
console.log(top);
|
||||||
});
|
$it.css({
|
||||||
|
"top": top + "px",
|
||||||
if (isLeft) {
|
"position": "absolute"
|
||||||
this.className = "l";
|
});
|
||||||
} else {
|
|
||||||
this.className = "r";
|
if (isLeft) {
|
||||||
}
|
this.className = "l";
|
||||||
}
|
} else {
|
||||||
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
|
this.className = "r";
|
||||||
});
|
}
|
||||||
$(this).height(colH[0] > colH[1] ? colH[0] : colH[1]);
|
}
|
||||||
}
|
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
|
||||||
});
|
});
|
||||||
});
|
$(this).height(colH[0] > colH[1] ? colH[0] : colH[1]);
|
||||||
|
}
|
||||||
setTimeout(function () {
|
});
|
||||||
$(window).resize();
|
});
|
||||||
}, 500);
|
|
||||||
},
|
$(window).resize();
|
||||||
|
$(".module img").imagesLoaded(function () {
|
||||||
_setNavCurrent: function () {
|
$(window).resize();
|
||||||
$(".header li a").each(function () {
|
});
|
||||||
if($(this).prop("href") === location.href.split("#")[0]) {
|
},
|
||||||
this.className = "current";
|
|
||||||
} else {
|
_setNavCurrent: function () {
|
||||||
this.className = "";
|
$(".header li a").each(function () {
|
||||||
}
|
if($(this).prop("href") === location.href.split("#")[0]) {
|
||||||
})
|
this.className = "current";
|
||||||
},
|
} else {
|
||||||
|
this.className = "";
|
||||||
init: function () {
|
}
|
||||||
$(window).scroll(function () {
|
})
|
||||||
if ($(window).scrollTop() > 60) {
|
},
|
||||||
$(".ico-top").show();
|
|
||||||
} else {
|
init: function () {
|
||||||
$(".ico-top").hide();
|
$(window).scroll(function () {
|
||||||
}
|
if ($(window).scrollTop() > 60) {
|
||||||
});
|
$(".ico-top").show();
|
||||||
timeline._initIndexList();
|
} else {
|
||||||
timeline._initArticleList();
|
$(".ico-top").hide();
|
||||||
timeline._setNavCurrent();
|
}
|
||||||
},
|
});
|
||||||
|
timeline._initIndexList();
|
||||||
translate: function () {
|
timeline._initArticleList();
|
||||||
window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href);
|
timeline._setNavCurrent();
|
||||||
},
|
},
|
||||||
|
|
||||||
getArchive: function (year, month, monthName) {
|
translate: function () {
|
||||||
var archiveDate = year + month,
|
window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href);
|
||||||
archive = year + "/" + month;
|
},
|
||||||
window.location.hash = "#" + archiveDate;
|
|
||||||
if ($("#" + archiveDate + " > article").length === 0) {
|
getArchive: function (year, month, monthName) {
|
||||||
var archiveDataTitle = year + " " + Label.yearLabel + " " + month + " " + Label.monthLabel;
|
var archiveDate = year + month,
|
||||||
if (Label.localeString.substring(0, 2) === "en") {
|
archive = year + "/" + month;
|
||||||
archiveDataTitle = monthName + " " + year;
|
window.location.hash = "#" + archiveDate;
|
||||||
}
|
if ($("#" + archiveDate + " > article").length === 0) {
|
||||||
var archiveHTML = '<h2><span class="article-archive">' + archiveDataTitle + '</span></h2>'
|
var archiveDataTitle = year + " " + Label.yearLabel + " " + month + " " + Label.monthLabel;
|
||||||
+ '<div class="article-more" onclick="timeline.getNextPage(this, \''
|
if (Label.localeString.substring(0, 2) === "en") {
|
||||||
+ archive + '\')" data-page="0">' + Label.moreLabel + '</div>';
|
archiveDataTitle = monthName + " " + year;
|
||||||
|
}
|
||||||
$("#" + archiveDate).html(archiveHTML).css("margin-bottom", "50px");
|
var archiveHTML = '<h2><span class="article-archive">' + archiveDataTitle + '</span></h2>'
|
||||||
timeline.getNextPage($("#" + archiveDate).find(".article-more")[0], archive);
|
+ '<div class="article-more" onclick="timeline.getNextPage(this, \''
|
||||||
}
|
+ archive + '\')" data-page="0">' + Label.moreLabel + '</div>';
|
||||||
},
|
|
||||||
|
$("#" + archiveDate).html(archiveHTML).css("margin-bottom", "50px");
|
||||||
getNextPage: function (it, archive) {
|
timeline.getNextPage($("#" + archiveDate).find(".article-more")[0], archive);
|
||||||
var $more = $(it),
|
}
|
||||||
currentPage = $more.data("page") + 1,
|
},
|
||||||
path = "/articles/";
|
|
||||||
if($("#tag").length === 1) {
|
getNextPage: function (it, archive) {
|
||||||
var pathnames = location.pathname.split("/");
|
var $more = $(it),
|
||||||
path = "/articles/tags/" + pathnames[pathnames.length - 1] + "/";
|
currentPage = $more.data("page") + 1,
|
||||||
} else if ($("#author").length === 1) {
|
path = "/articles/";
|
||||||
var pathnames = location.pathname.split("/");
|
if($("#tag").length === 1) {
|
||||||
path = "/articles/authors/" + pathnames[pathnames.length - 1] + "/";
|
var pathnames = location.pathname.split("/");
|
||||||
} else if (archive) {
|
path = "/articles/tags/" + pathnames[pathnames.length - 1] + "/";
|
||||||
path = "/articles/archives/" + archive + "/";
|
} else if ($("#author").length === 1) {
|
||||||
}
|
var pathnames = location.pathname.split("/");
|
||||||
$.ajax({
|
path = "/articles/authors/" + pathnames[pathnames.length - 1] + "/";
|
||||||
url: latkeConfig.servePath + path + currentPage,
|
} else if (archive) {
|
||||||
type: "GET",
|
path = "/articles/archives/" + archive + "/";
|
||||||
beforeSend: function () {
|
}
|
||||||
$more.css("background",
|
$.ajax({
|
||||||
"url(" + latkeConfig.staticServePath
|
url: latkeConfig.servePath + path + currentPage,
|
||||||
+ "/skins/timeline/images/ajax-loader.gif) no-repeat scroll center center #60829F").text("");
|
type: "GET",
|
||||||
},
|
beforeSend: function () {
|
||||||
success: function(result, textStatus){
|
$more.css("background",
|
||||||
if (!result.sc) {
|
"url(" + latkeConfig.staticServePath
|
||||||
$more.css("background", "none #60829F").text("Error");
|
+ "/skins/timeline/images/ajax-loader.gif) no-repeat scroll center center #60829F").text("");
|
||||||
return;
|
},
|
||||||
}
|
success: function(result, textStatus){
|
||||||
|
if (!result.sc) {
|
||||||
if (result.rslts.articles.length === 0) {
|
$more.css("background", "none #60829F").text("Error");
|
||||||
$more.remove();
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
if (result.rslts.articles.length === 0) {
|
||||||
var articlesHTML = "",
|
$more.remove();
|
||||||
pagination = result.rslts.pagination;
|
return;
|
||||||
|
}
|
||||||
// append articles
|
|
||||||
for (var i = 0; i < result.rslts.articles.length; i++) {
|
var articlesHTML = "",
|
||||||
var article = result.rslts.articles[i];
|
pagination = result.rslts.pagination;
|
||||||
|
|
||||||
articlesHTML += '<article><div class="module"><div class="dot"></div>'
|
// append articles
|
||||||
+ '<div class="arrow"></div><time class="article-time"><span>'
|
for (var i = 0; i < result.rslts.articles.length; i++) {
|
||||||
+ Util.toDate(article.articleCreateTime, 'yy-MM-dd HH:mm')
|
var article = result.rslts.articles[i];
|
||||||
+ '</span></time><h3 class="article-title"><a rel="bookmark" href="'
|
|
||||||
+ latkeConfig.servePath + article.articlePermalink + '">'
|
articlesHTML += '<article><div class="module"><div class="dot"></div>'
|
||||||
+article.articleTitle + '</a>';
|
+ '<div class="arrow"></div><time class="article-time"><span>'
|
||||||
|
+ Util.toDate(article.articleCreateTime, 'yy-MM-dd HH:mm')
|
||||||
if (article.hasUpdated) {
|
+ '</span></time><h3 class="article-title"><a rel="bookmark" href="'
|
||||||
articlesHTML += '<sup>' + Label.updatedLabel + '</sup>';
|
+ latkeConfig.servePath + article.articlePermalink + '">'
|
||||||
}
|
+article.articleTitle + '</a>';
|
||||||
|
|
||||||
if (article.articlePutTop) {
|
if (article.hasUpdated) {
|
||||||
articlesHTML += '<sup>' + Label.topArticleLabel + '</sup>';
|
articlesHTML += '<sup>' + Label.updatedLabel + '</sup>';
|
||||||
}
|
}
|
||||||
|
|
||||||
articlesHTML += '</h3><p>' + article.articleAbstract + '</p>'
|
if (article.articlePutTop) {
|
||||||
+ '<span class="ico-tags ico" title="' + Label.tagLabel + '">';
|
articlesHTML += '<sup>' + Label.topArticleLabel + '</sup>';
|
||||||
|
}
|
||||||
var articleTags = article.articleTags.split(",");
|
|
||||||
for (var j = 0; j < articleTags.length; j++) {
|
articlesHTML += '</h3><p>' + article.articleAbstract + '</p>'
|
||||||
articlesHTML += '<a rel="category tag" href="' + latkeConfig.servePath
|
+ '<span class="ico-tags ico" title="' + Label.tagLabel + '">';
|
||||||
+ '/tags/' + encodeURIComponent(articleTags[j]) + '">' + articleTags[j] + '</a>';
|
|
||||||
|
var articleTags = article.articleTags.split(",");
|
||||||
if (j < articleTags.length - 1) {
|
for (var j = 0; j < articleTags.length; j++) {
|
||||||
articlesHTML += ",";
|
articlesHTML += '<a rel="category tag" href="' + latkeConfig.servePath
|
||||||
}
|
+ '/tags/' + encodeURIComponent(articleTags[j]) + '">' + articleTags[j] + '</a>';
|
||||||
}
|
|
||||||
|
if (j < articleTags.length - 1) {
|
||||||
articlesHTML += '</span> <span class="ico-author ico" title="' + Label.authorLabel + '">'
|
articlesHTML += ",";
|
||||||
+ '<a rel="author" href="' + latkeConfig.servePath + '/authors/' + article.authorId + '">'
|
}
|
||||||
+ article.authorName + '</a></span> <span class="ico-comment ico" title="'
|
}
|
||||||
+ Label.commentLabel + '"><a rel="nofollow" href="' + latkeConfig.servePath + article.articlePermalink
|
|
||||||
+ '#comments">' + (article.articleCommentCount === 0 ? Label.noCommentLabel : article.articleCommentCount)
|
articlesHTML += '</span> <span class="ico-author ico" title="' + Label.authorLabel + '">'
|
||||||
+ '</a></span> <span class="ico-view ico" title="' + Label.viewLabel + '">'
|
+ '<a rel="author" href="' + latkeConfig.servePath + '/authors/' + article.authorId + '">'
|
||||||
+ '<a rel="nofollow" href="${servePath}${article.articlePermalink}">' + article.articleViewCount
|
+ article.authorName + '</a></span> <span class="ico-comment ico" title="'
|
||||||
+ '</a></span></div></article>';
|
+ Label.commentLabel + '"><a rel="nofollow" href="' + latkeConfig.servePath + article.articlePermalink
|
||||||
}
|
+ '#comments">' + (article.articleCommentCount === 0 ? Label.noCommentLabel : article.articleCommentCount)
|
||||||
|
+ '</a></span> <span class="ico-view ico" title="' + Label.viewLabel + '">'
|
||||||
$more.before(articlesHTML).data("page", currentPage);
|
+ '<a rel="nofollow" href="${servePath}${article.articlePermalink}">' + article.articleViewCount
|
||||||
// 最后一页处理
|
+ '</a></span></div></article>';
|
||||||
if (pagination.paginationPageCount <= currentPage) {
|
}
|
||||||
$more.remove();
|
|
||||||
} else {
|
$more.before(articlesHTML).data("page", currentPage);
|
||||||
$more.css("background", "none #60829F").text(Label.moreLabel);
|
// 最后一页处理
|
||||||
}
|
if (pagination.paginationPageCount <= currentPage) {
|
||||||
|
$more.remove();
|
||||||
setTimeout(function () {
|
} else {
|
||||||
$(window).resize();
|
$more.css("background", "none #60829F").text(Label.moreLabel);
|
||||||
}, 500);
|
}
|
||||||
}
|
|
||||||
});
|
$(window).resize();
|
||||||
},
|
$(".module img").imagesLoaded(function () {
|
||||||
|
$(window).resize();
|
||||||
toggleArchives: function (it, year) {
|
});
|
||||||
$(".nav-abs li").each(function (i) {
|
}
|
||||||
var $it = $(this);
|
});
|
||||||
if (!$it.hasClass("year")) {
|
},
|
||||||
$it.hide();
|
|
||||||
if (year === $it.data("year") && $(it).hasClass("close")) {
|
toggleArchives: function (it, year) {
|
||||||
$it.show();
|
$(".nav-abs li").each(function (i) {
|
||||||
}
|
var $it = $(this);
|
||||||
}
|
if (!$it.hasClass("year")) {
|
||||||
});
|
$it.hide();
|
||||||
|
if (year === $it.data("year") && $(it).hasClass("close")) {
|
||||||
$(".nav-abs li.year").each(function () {
|
$it.show();
|
||||||
if (parseInt($(this).text()) === year) {
|
}
|
||||||
if ($(it).hasClass("close")) {
|
}
|
||||||
it.className = "year open";
|
});
|
||||||
} else {
|
|
||||||
it.className = "year close";
|
$(".nav-abs li.year").each(function () {
|
||||||
}
|
if (parseInt($(this).text()) === year) {
|
||||||
} else {
|
if ($(it).hasClass("close")) {
|
||||||
this.className = "year close";
|
it.className = "year open";
|
||||||
}
|
} else {
|
||||||
});
|
it.className = "year close";
|
||||||
}
|
}
|
||||||
};
|
} else {
|
||||||
|
this.className = "year close";
|
||||||
(function () {
|
}
|
||||||
Util.init();
|
});
|
||||||
Util.replaceSideEm($(".recent-comments-content"));
|
}
|
||||||
Util.buildTags("tagsSide");
|
};
|
||||||
|
|
||||||
timeline.init();
|
/*!
|
||||||
|
* jQuery imagesLoaded plugin v2.1.1
|
||||||
|
* http://github.com/desandro/imagesloaded
|
||||||
|
*
|
||||||
|
* MIT License. by Paul Irish et al.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
|
||||||
|
/*global jQuery: false */
|
||||||
|
|
||||||
|
;
|
||||||
|
(function($, undefined) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// blank image data-uri bypasses webkit log warning (thx doug jones)
|
||||||
|
var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
|
||||||
|
|
||||||
|
$.fn.imagesLoaded = function( callback ) {
|
||||||
|
var $this = this,
|
||||||
|
deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
|
||||||
|
hasNotify = $.isFunction(deferred.notify),
|
||||||
|
$images = $this.find('img').add( $this.filter('img') ),
|
||||||
|
loaded = [],
|
||||||
|
proper = [],
|
||||||
|
broken = [];
|
||||||
|
|
||||||
|
// Register deferred callbacks
|
||||||
|
if ($.isPlainObject(callback)) {
|
||||||
|
$.each(callback, function (key, value) {
|
||||||
|
if (key === 'callback') {
|
||||||
|
callback = value;
|
||||||
|
} else if (deferred) {
|
||||||
|
deferred[key](value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function doneLoading() {
|
||||||
|
var $proper = $(proper),
|
||||||
|
$broken = $(broken);
|
||||||
|
|
||||||
|
if ( deferred ) {
|
||||||
|
if ( broken.length ) {
|
||||||
|
deferred.reject( $images, $proper, $broken );
|
||||||
|
} else {
|
||||||
|
deferred.resolve( $images );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $.isFunction( callback ) ) {
|
||||||
|
callback.call( $this, $images, $proper, $broken );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function imgLoadedHandler( event ) {
|
||||||
|
imgLoaded( event.target, event.type === 'error' );
|
||||||
|
}
|
||||||
|
|
||||||
|
function imgLoaded( img, isBroken ) {
|
||||||
|
// don't proceed if BLANK image, or image is already loaded
|
||||||
|
if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// store element in loaded images array
|
||||||
|
loaded.push( img );
|
||||||
|
|
||||||
|
// keep track of broken and properly loaded images
|
||||||
|
if ( isBroken ) {
|
||||||
|
broken.push( img );
|
||||||
|
} else {
|
||||||
|
proper.push( img );
|
||||||
|
}
|
||||||
|
|
||||||
|
// cache image and its state for future calls
|
||||||
|
$.data( img, 'imagesLoaded', {
|
||||||
|
isBroken: isBroken,
|
||||||
|
src: img.src
|
||||||
|
} );
|
||||||
|
|
||||||
|
// trigger deferred progress method if present
|
||||||
|
if ( hasNotify ) {
|
||||||
|
deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] );
|
||||||
|
}
|
||||||
|
|
||||||
|
// call doneLoading and clean listeners if all images are loaded
|
||||||
|
if ( $images.length === loaded.length ) {
|
||||||
|
setTimeout( doneLoading );
|
||||||
|
$images.unbind( '.imagesLoaded', imgLoadedHandler );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if no images, trigger immediately
|
||||||
|
if ( !$images.length ) {
|
||||||
|
doneLoading();
|
||||||
|
} else {
|
||||||
|
$images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoadedHandler )
|
||||||
|
.each( function( i, el ) {
|
||||||
|
var src = el.src;
|
||||||
|
|
||||||
|
// find out if this image has been already checked for status
|
||||||
|
// if it was, and src has not changed, call imgLoaded on it
|
||||||
|
var cached = $.data( el, 'imagesLoaded' );
|
||||||
|
if ( cached && cached.src === src ) {
|
||||||
|
imgLoaded( el, cached.isBroken );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if complete is true and browser supports natural sizes, try
|
||||||
|
// to check for image status manually
|
||||||
|
if ( el.complete && el.naturalWidth !== undefined ) {
|
||||||
|
imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// cached images don't fire load sometimes, so we reset src, but only when
|
||||||
|
// dealing with IE, or image is complete (loaded) and failed manual check
|
||||||
|
// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
|
||||||
|
if ( el.readyState || el.complete ) {
|
||||||
|
el.src = BLANK;
|
||||||
|
el.src = src;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return deferred ? deferred.promise( $this ) : $this;
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
Util.init();
|
||||||
|
Util.replaceSideEm($(".recent-comments-content"));
|
||||||
|
Util.buildTags("tagsSide");
|
||||||
|
|
||||||
|
timeline.init();
|
||||||
})();
|
})();
|
4
timeline/js/timeline.min.js
vendored
4
timeline/js/timeline.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user