This commit is contained in:
Vanessa 2013-02-23 12:01:30 +08:00
parent 0c7f487c81
commit 096ab6c1f2
6 changed files with 429 additions and 488 deletions

View File

@ -7,8 +7,8 @@ a:hover{text-decoration:underline;}
.content>h2{margin:-20px 0 20px 0;} .content>h2{margin:-20px 0 20px 0;}
.hr{background:url("../images/indentline-light.png") repeat-x scroll left top transparent;margin:20px 0 40px;clear:both;height:2px;} .hr{background:url("../images/indentline-light.png") repeat-x scroll left top transparent;margin:20px 0 40px;clear:both;height:2px;}
.arrow-right{background:url("../images/icon.png") 0px -64px no-repeat;float:left;height:38px;width:14px;} .arrow-right{background:url("../images/icon.png") 0px -64px no-repeat;float:left;height:38px;width:14px;}
input[type='button']{border-radius:5px;box-shadow:0 1px 0 rgba(255, 255, 255, 0.3) inset,0 0 2px rgba(255, 255, 255, 0.3) inset,0 1px 2px rgba(0, 0, 0, 0.29);background-color:#000000;background-image:linear-gradient(top, #333333, #000000);background-image:-moz-linear-gradient(top, #333333, #000000);background-image:-ms-linear-gradient(top, #333333, #000000);background-image:-o-linear-gradient(top, #333333, #000000);background-image:-webkit-gradient(linear, left top, left bottom, from(#333333), to(#000000));filter:progid:dximagetransform.microsoft.gradient(startColorstr='#333333', endColorstr='#000000');border:1px solid #000000;color:white;margin:15px 0 0 200px;padding:7px 13px;height:auto;} input[type='button']{border-radius:5px;box-shadow:0 1px 0 rgba(255, 255, 255, 0.3) inset,0 0 2px rgba(255, 255, 255, 0.3) inset,0 1px 2px rgba(0, 0, 0, 0.29);background-color:#000000;background-image:linear-gradient(top, #333333, #000000);background-image:-moz-linear-gradient(top, #333333, #000000);background-image:-ms-linear-gradient(top, #333333, #000000);background-image:-o-linear-gradient(top, #333333, #000000);background-image:-webkit-gradient(linear, left top, left bottom, from(#333333), to(#000000));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#000000');border:1px solid #000000;color:white;margin:15px 0 0 200px;padding:7px 13px;height:auto;}
input[type='button']:hover{background-color:#333333;background-image:linear-gradient(top, #333333, #212121);background-image:-moz-linear-gradient(top, #333333, #212121);background-image:-ms-linear-gradient(top, #333333, #212121);background-image:-o-linear-gradient(top, #333333, #212121);background-image:-webkit-gradient(linear, left top, left bottom, from(#333333), to(#212121));filter:progid:dximagetransform.microsoft.gradient(startColorstr='#333333', endColorstr='#212121');} input[type='button']:hover{background-color:#333333;background-image:linear-gradient(top, #333333, #212121);background-image:-moz-linear-gradient(top, #333333, #212121);background-image:-ms-linear-gradient(top, #333333, #212121);background-image:-o-linear-gradient(top, #333333, #212121);background-image:-webkit-gradient(linear, left top, left bottom, from(#333333), to(#212121));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#212121');}
.marginBottom40{margin-bottom:40px;} .marginBottom40{margin-bottom:40px;}
.header-user{background-color:#DEDEDE;padding-top:1px;} .header-user{background-color:#DEDEDE;padding-top:1px;}
.header-navi{background:url("../images/icon.png") 0px -130px repeat-x #333333;margin-bottom:50px;} .header-navi{background:url("../images/icon.png") 0px -130px repeat-x #333333;margin-bottom:50px;}

21
ease/js/ease.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,20 +1 @@
/* var goTop=function(acceleration){acceleration=acceleration||.1;var y=$(window).scrollTop();var speed=1+acceleration;window.scrollTo(0,Math.floor(y/speed));if(y>0){var invokeFunction="goTop("+acceleration+")";window.setTimeout(invokeFunction,16)}};var collapseArchive=function(it,year){var tag=true;if(it.className==="collapse-ico"){it.className="expand-ico";tag=false}else{it.className="collapse-ico"}$("#archiveSide li").each(function(){var $this=$(this);if($this.data("year")===year){if(tag){$(this).show()}else{$(this).hide()}}})};var getArticle=function(it,id){var $abstract=$("#abstract"+id),$content=$("#content"+id);if($content.html()===""){$.ajax({url:"/get-article-content?id="+id,type:"GET",dataType:"html",beforeSend:function(){$abstract.css("background","url(/skins/neoease/images/ajax-loader.gif) no-repeat scroll center center transparent")},success:function(result,textStatus){it.className="collapse-ico";$content.html(result);$abstract.hide().css("background","none");$content.fadeIn("slow")}})}else{if(it.className==="expand-ico"){$abstract.hide();$content.fadeIn();it.className="collapse-ico"}else{$content.hide();$abstract.fadeIn();it.className="expand-ico"}}return false};var goTranslate=function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)};(function(){$(window).scroll(function(){var y=$(window).scrollTop();if(y>182){var bodyH=$(window).height();var top=y+bodyH-21;if($("body").height()-58<=y+bodyH){top=$(".footer").offset().top-21}$("#goTop").fadeIn("slow").css("top",top)}else{$("#goTop").hide()}});var currentYear=(new Date).getFullYear(),year=currentYear;$("#archiveSide li").each(function(i){var $this=$(this);if($this.data("year")!==currentYear){$(this).hide()}if(year!==$this.data("year")){year=$this.data("year");$this.before("<li class='archive-year'><div onclick='collapseArchive(this, "+year+")' class='expand-ico'>"+year+"&nbsp;年</div></li>")}});$(".recent-comments .expand-ico").click(function(){if(this.className==="expand-ico"){$(this).parent().next().css({height:"auto","white-space":"normal"});this.className="collapse-ico"}else{$(this).parent().next().animate({height:"18px"},function(){$(this).css("white-space","nowrap")});this.className="expand-ico"}});$(".nav ul li").each(function(){var $a=$(this).find("a");if($a.attr("href")===latkeConfig.servePath+location.pathname){$(this).addClass("current")}else if(/\/[0-9]+$/.test(location.pathname)){$(".nav ul li")[0].className="current"}});Util.init();Util.replaceSideEm($(".recent-comments-content"));Util.buildTags("tagsSide");$(".recent-comments .recent-comments-main").each(function(){if($(this).find(".recent-comments-content>a").height()<30){$(this).find(".expand-ico").remove()}else{$(this).find(".expand-ico").parent().next().css({"white-space":"nowrap"})}})})();
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*//**
* @fileoverview neoease js.
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.8, Sep 6, 2012
*/var goTop=function(e){e=e||.1;var t=$(window).scrollTop(),n=1+e;window.scrollTo(0,Math.floor(t/n));if(t>0){var r="goTop("+e+")";window.setTimeout(r,16)}},collapseArchive=function(e,t){var n=!0;e.className==="collapse-ico"?(e.className="expand-ico",n=!1):e.className="collapse-ico",$("#archiveSide li").each(function(){var e=$(this);e.data("year")===t&&(n?$(this).show():$(this).hide())})},getArticle=function(e,t){var n=$("#abstract"+t),r=$("#content"+t);return r.html()===""?$.ajax({url:"/get-article-content?id="+t,type:"GET",dataType:"html",beforeSend:function(){n.css("background","url(/skins/neoease/images/ajax-loader.gif) no-repeat scroll center center transparent")},success:function(t,i){e.className="collapse-ico",r.html(t),n.hide().css("background","none"),r.fadeIn("slow")}}):e.className==="expand-ico"?(n.hide(),r.fadeIn(),e.className="collapse-ico"):(r.hide(),n.fadeIn(),e.className="expand-ico"),!1},goTranslate=function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)};(function(){$(window).scroll(function(){var e=$(window).scrollTop();if(e>182){var t=$(window).height(),n=e+t-21;$("body").height()-58<=e+t&&(n=$(".footer").offset().top-21),$("#goTop").fadeIn("slow").css("top",n)}else $("#goTop").hide()});var e=(new Date).getFullYear(),t=e;$("#archiveSide li").each(function(n){var r=$(this);r.data("year")!==e&&$(this).hide(),t!==r.data("year")&&(t=r.data("year"),r.before("<li class='archive-year'><div onclick='collapseArchive(this, "+t+")' class='expand-ico'>"+t+"&nbsp;</div></li>"))}),$(".recent-comments .expand-ico").click(function(){this.className==="expand-ico"?($(this).parent().next().css({height:"auto","white-space":"normal"}),this.className="collapse-ico"):($(this).parent().next().animate({height:"18px"},function(){$(this).css("white-space","nowrap")}),this.className="expand-ico")}),$(".nav ul li").each(function(){var e=$(this).find("a");e.attr("href")===latkeConfig.servePath+location.pathname?$(this).addClass("current"):/\/[0-9]+$/.test(location.pathname)&&($(".nav ul li")[0].className="current")}),Util.init(),Util.replaceSideEm($(".recent-comments-content")),Util.buildTags("tagsSide"),$(".recent-comments .recent-comments-main").each(function(){$(this).find(".recent-comments-content>a").height()<30?$(this).find(".expand-ico").remove():$(this).find(".expand-ico").parent().next().css({"white-space":"nowrap"})})})();

View File

@ -56,7 +56,7 @@ img{max-width:100%;border:0;vertical-align:middle;}
.ico-next{float:right;margin:-8px 0 0 10px;} .ico-next{float:right;margin:-8px 0 0 10px;}
a:hover>.ico-next,a:hover>.ico-pre{background-color:#000;} a:hover>.ico-next,a:hover>.ico-pre{background-color:#000;}
.wrapper{min-width:500px;padding:50px 0;background:url("../../timeline/images/bg.png") repeat scroll 0 0 #dee4ea;} .wrapper{min-width:500px;padding:50px 0;background:url("../../timeline/images/bg.png") repeat scroll 0 0 #dee4ea;}
.header{background-color:#BFBFBF;background-image:url("../../timeline/images/nav-bg.png"),linear-gradient(#cccccc, #a9a9a9);background-image:url("../../timeline/images/nav-bg.png"),-ms-linear-gradient(#cccccc, #a9a9a9);background-image:url("../../timeline/images/nav-bg.png"),-o-linear-gradient(#cccccc, #a9a9a9);background-image:url("../../timeline/images/nav-bg.png"),-webkit-linear-gradient(#cccccc, #a9a9a9);filter:progid:dximagetransform.microsoft.gradient(GradientType=0, startColorstr='#CCCCCC', endColorstr='#A9A9A9');border-bottom:1px solid #898989;box-shadow:0 -1px 0 rgba(255, 255, 255, 0.3) inset,0 1px 1px rgba(0, 0, 0, 0.2);height:50px;overflow:hidden;} .header{background-color:#BFBFBF;background-image:url("../../timeline/images/nav-bg.png"),linear-gradient(#cccccc, #a9a9a9);background-image:url("../../timeline/images/nav-bg.png"),-ms-linear-gradient(#cccccc, #a9a9a9);background-image:url("../../timeline/images/nav-bg.png"),-o-linear-gradient(#cccccc, #a9a9a9);background-image:url("../../timeline/images/nav-bg.png"),-webkit-linear-gradient(#cccccc, #a9a9a9);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#CCCCCC', endColorstr='#A9A9A9');border-bottom:1px solid #898989;box-shadow:0 -1px 0 rgba(255, 255, 255, 0.3) inset,0 1px 1px rgba(0, 0, 0, 0.2);height:50px;overflow:hidden;}
.container{width:80%;margin:0 auto;} .container{width:80%;margin:0 auto;}
.footer{border-top:1px solid #232323;padding:20px 0;color:#ddd;font-size:80%;} .footer{border-top:1px solid #232323;padding:20px 0;color:#ddd;font-size:80%;}
.footer a{color:#9CC0DE;} .footer a{color:#9CC0DE;}

View File

@ -1,426 +1,424 @@
/* /*
* 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.1, Feb 20, 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 (parseInt($it.css("top")) !== top) { 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]);
}); });
$(window).resize(); $(window).resize();
$(".module img").imagesLoaded(function () { $(".module img").imagesLoaded(function () {
$(window).resize(); $(window).resize();
}); });
}, },
_initIndexList: function () { _initIndexList: function () {
var $archives = $(".articles > .fn-clear"); var $archives = $(".articles > .fn-clear");
if ($archives.length === 0) { if ($archives.length === 0) {
return; return;
} }
// 如果为 index 页面,重构 archives 结构,使其可收缩 // 如果为 index 页面,重构 archives 结构,使其可收缩
var year = 0; var year = 0;
$(".nav-abs li").each(function (i) { $(".nav-abs li").each(function (i) {
var $this = $(this); var $this = $(this);
$this.hide(); $this.hide();
if (year !== $this.data("year")) { if (year !== $this.data("year")) {
year = $this.data("year"); year = $this.data("year");
$this.before("<li class='close year' onclick='timeline.toggleArchives(this, " + $this.before("<li class='close year' onclick='timeline.toggleArchives(this, " +
year + ")'>" + year + "</li>"); year + ")'>" + year + "</li>");
} }
}); });
// 首次加载时,当没有下一页时,使用 js 隐藏"更多"按钮 // 首次加载时,当没有下一页时,使用 js 隐藏"更多"按钮
if ($(".article-more").parent().data("count") <= $(".article-more").parent().find("article").length) { if ($(".article-more").parent().data("count") <= $(".article-more").parent().find("article").length) {
$(".article-more").remove(); $(".article-more").remove();
} }
$(window).resize(function () { $(window).resize(function () {
console.log("resize"); $archives.each(function () {
$archives.each(function () { var colH = [timeline._COLHA + 60, timeline._COLHB * 4];
var colH = [timeline._COLHA + 60, timeline._COLHB * 4];
var $articles = $(this).find("article");
var $articles = $(this).find("article"); if ($articles.length === 0) {
if ($articles.length === 0) { $(this).find("h2").remove();
$(this).find("h2").remove(); $(this).css("margin-bottom" , 0);
$(this).css("margin-bottom" , 0); } else {
} else { $articles.each(function () {
$articles.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 (parseInt($it.css("top")) !== top) {
if (parseInt($it.css("top")) !== top) { $it.css({
console.log(top); "top": top + "px",
$it.css({ "position": "absolute"
"top": top + "px", });
"position": "absolute"
}); if (isLeft) {
this.className = "l";
if (isLeft) { } else {
this.className = "l"; this.className = "r";
} else { }
this.className = "r"; }
} colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
} });
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true)); $(this).height(colH[0] > colH[1] ? colH[0] : colH[1]);
}); }
$(this).height(colH[0] > colH[1] ? colH[0] : colH[1]); });
} });
});
}); $(window).resize();
$(".module img").imagesLoaded(function () {
$(window).resize(); $(window).resize();
$(".module img").imagesLoaded(function () { });
$(window).resize(); },
});
}, _setNavCurrent: function () {
$(".header li a").each(function () {
_setNavCurrent: function () { if($(this).prop("href") === location.href.split("#")[0]) {
$(".header li a").each(function () { this.className = "current";
if($(this).prop("href") === location.href.split("#")[0]) { } else {
this.className = "current"; this.className = "";
} else { }
this.className = ""; })
} },
})
}, init: function () {
$(window).scroll(function () {
init: function () { if ($(window).scrollTop() > 60) {
$(window).scroll(function () { $(".ico-top").show();
if ($(window).scrollTop() > 60) { } else {
$(".ico-top").show(); $(".ico-top").hide();
} else { }
$(".ico-top").hide(); });
} timeline._initIndexList();
}); timeline._initArticleList();
timeline._initIndexList(); timeline._setNavCurrent();
timeline._initArticleList(); },
timeline._setNavCurrent();
}, translate: function () {
window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href);
translate: function () { },
window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href);
}, getArchive: function (year, month, monthName) {
var archiveDate = year + month,
getArchive: function (year, month, monthName) { archive = year + "/" + month;
var archiveDate = year + month, window.location.hash = "#" + archiveDate;
archive = year + "/" + month; if ($("#" + archiveDate + " > article").length === 0) {
window.location.hash = "#" + archiveDate; var archiveDataTitle = year + " " + Label.yearLabel + " " + month + " " + Label.monthLabel;
if ($("#" + archiveDate + " > article").length === 0) { if (Label.localeString.substring(0, 2) === "en") {
var archiveDataTitle = year + " " + Label.yearLabel + " " + month + " " + Label.monthLabel; archiveDataTitle = monthName + " " + year;
if (Label.localeString.substring(0, 2) === "en") { }
archiveDataTitle = monthName + " " + year; var archiveHTML = '<h2><span class="article-archive">' + archiveDataTitle + '</span></h2>'
} + '<div class="article-more" onclick="timeline.getNextPage(this, \''
var archiveHTML = '<h2><span class="article-archive">' + archiveDataTitle + '</span></h2>' + archive + '\')" data-page="0">' + Label.moreLabel + '</div>';
+ '<div class="article-more" onclick="timeline.getNextPage(this, \''
+ archive + '\')" data-page="0">' + Label.moreLabel + '</div>'; $("#" + archiveDate).html(archiveHTML).css("margin-bottom", "50px");
timeline.getNextPage($("#" + archiveDate).find(".article-more")[0], archive);
$("#" + archiveDate).html(archiveHTML).css("margin-bottom", "50px"); }
timeline.getNextPage($("#" + archiveDate).find(".article-more")[0], archive); },
}
}, getNextPage: function (it, archive) {
var $more = $(it),
getNextPage: function (it, archive) { currentPage = $more.data("page") + 1,
var $more = $(it), path = "/articles/";
currentPage = $more.data("page") + 1, if($("#tag").length === 1) {
path = "/articles/"; var pathnames = location.pathname.split("/");
if($("#tag").length === 1) { path = "/articles/tags/" + pathnames[pathnames.length - 1] + "/";
var pathnames = location.pathname.split("/"); } else if ($("#author").length === 1) {
path = "/articles/tags/" + pathnames[pathnames.length - 1] + "/"; var pathnames = location.pathname.split("/");
} else if ($("#author").length === 1) { path = "/articles/authors/" + pathnames[pathnames.length - 1] + "/";
var pathnames = location.pathname.split("/"); } else if (archive) {
path = "/articles/authors/" + pathnames[pathnames.length - 1] + "/"; path = "/articles/archives/" + archive + "/";
} else if (archive) { }
path = "/articles/archives/" + archive + "/"; $.ajax({
} url: latkeConfig.servePath + path + currentPage,
$.ajax({ type: "GET",
url: latkeConfig.servePath + path + currentPage, beforeSend: function () {
type: "GET", $more.css("background",
beforeSend: function () { "url(" + latkeConfig.staticServePath
$more.css("background", + "/skins/timeline/images/ajax-loader.gif) no-repeat scroll center center #60829F").text("");
"url(" + latkeConfig.staticServePath },
+ "/skins/timeline/images/ajax-loader.gif) no-repeat scroll center center #60829F").text(""); success: function(result, textStatus){
}, if (!result.sc) {
success: function(result, textStatus){ $more.css("background", "none #60829F").text("Error");
if (!result.sc) { return;
$more.css("background", "none #60829F").text("Error"); }
return;
} if (result.rslts.articles.length === 0) {
$more.remove();
if (result.rslts.articles.length === 0) { return;
$more.remove(); }
return;
} var articlesHTML = "",
pagination = result.rslts.pagination;
var articlesHTML = "",
pagination = result.rslts.pagination; // append articles
for (var i = 0; i < result.rslts.articles.length; i++) {
// append articles var article = result.rslts.articles[i];
for (var i = 0; i < result.rslts.articles.length; i++) {
var article = result.rslts.articles[i]; articlesHTML += '<article><div class="module"><div class="dot"></div>'
+ '<div class="arrow"></div><time class="article-time"><span>'
articlesHTML += '<article><div class="module"><div class="dot"></div>' + Util.toDate(article.articleCreateTime, 'yy-MM-dd HH:mm')
+ '<div class="arrow"></div><time class="article-time"><span>' + '</span></time><h3 class="article-title"><a rel="bookmark" href="'
+ Util.toDate(article.articleCreateTime, 'yy-MM-dd HH:mm') + latkeConfig.servePath + article.articlePermalink + '">'
+ '</span></time><h3 class="article-title"><a rel="bookmark" href="' +article.articleTitle + '</a>';
+ latkeConfig.servePath + article.articlePermalink + '">'
+article.articleTitle + '</a>'; if (article.hasUpdated) {
articlesHTML += '<sup>' + Label.updatedLabel + '</sup>';
if (article.hasUpdated) { }
articlesHTML += '<sup>' + Label.updatedLabel + '</sup>';
} if (article.articlePutTop) {
articlesHTML += '<sup>' + Label.topArticleLabel + '</sup>';
if (article.articlePutTop) { }
articlesHTML += '<sup>' + Label.topArticleLabel + '</sup>';
} articlesHTML += '</h3><p>' + article.articleAbstract + '</p>'
+ '<span class="ico-tags ico" title="' + Label.tagLabel + '">';
articlesHTML += '</h3><p>' + article.articleAbstract + '</p>'
+ '<span class="ico-tags ico" title="' + Label.tagLabel + '">'; var articleTags = article.articleTags.split(",");
for (var j = 0; j < articleTags.length; j++) {
var articleTags = article.articleTags.split(","); articlesHTML += '<a rel="category tag" href="' + latkeConfig.servePath
for (var j = 0; j < articleTags.length; j++) { + '/tags/' + encodeURIComponent(articleTags[j]) + '">' + articleTags[j] + '</a>';
articlesHTML += '<a rel="category tag" href="' + latkeConfig.servePath
+ '/tags/' + encodeURIComponent(articleTags[j]) + '">' + articleTags[j] + '</a>'; if (j < articleTags.length - 1) {
articlesHTML += ",";
if (j < articleTags.length - 1) { }
articlesHTML += ","; }
}
} articlesHTML += '</span>&nbsp;<span class="ico-author ico" title="' + Label.authorLabel + '">'
+ '<a rel="author" href="' + latkeConfig.servePath + '/authors/' + article.authorId + '">'
articlesHTML += '</span>&nbsp;<span class="ico-author ico" title="' + Label.authorLabel + '">' + article.authorName + '</a></span>&nbsp;<span class="ico-comment ico" title="'
+ '<a rel="author" href="' + latkeConfig.servePath + '/authors/' + article.authorId + '">' + Label.commentLabel + '"><a rel="nofollow" href="' + latkeConfig.servePath + article.articlePermalink
+ article.authorName + '</a></span>&nbsp;<span class="ico-comment ico" title="' + '#comments">' + (article.articleCommentCount === 0 ? Label.noCommentLabel : article.articleCommentCount)
+ Label.commentLabel + '"><a rel="nofollow" href="' + latkeConfig.servePath + article.articlePermalink + '</a></span>&nbsp;<span class="ico-view ico" title="' + Label.viewLabel + '">'
+ '#comments">' + (article.articleCommentCount === 0 ? Label.noCommentLabel : article.articleCommentCount) + '<a rel="nofollow" href="${servePath}${article.articlePermalink}">' + article.articleViewCount
+ '</a></span>&nbsp;<span class="ico-view ico" title="' + Label.viewLabel + '">' + '</a></span></div></article>';
+ '<a rel="nofollow" href="${servePath}${article.articlePermalink}">' + article.articleViewCount }
+ '</a></span></div></article>';
} $more.before(articlesHTML).data("page", currentPage);
// 最后一页处理
$more.before(articlesHTML).data("page", currentPage); if (pagination.paginationPageCount <= currentPage) {
// 最后一页处理 $more.remove();
if (pagination.paginationPageCount <= currentPage) { } else {
$more.remove(); $more.css("background", "none #60829F").text(Label.moreLabel);
} else { }
$more.css("background", "none #60829F").text(Label.moreLabel);
} $(window).resize();
$(".module img").imagesLoaded(function () {
$(window).resize(); $(window).resize();
$(".module img").imagesLoaded(function () { });
$(window).resize(); }
}); });
} },
});
}, toggleArchives: function (it, year) {
$(".nav-abs li").each(function (i) {
toggleArchives: function (it, year) { var $it = $(this);
$(".nav-abs li").each(function (i) { if (!$it.hasClass("year")) {
var $it = $(this); $it.hide();
if (!$it.hasClass("year")) { if (year === $it.data("year") && $(it).hasClass("close")) {
$it.hide(); $it.show();
if (year === $it.data("year") && $(it).hasClass("close")) { }
$it.show(); }
} });
}
}); $(".nav-abs li.year").each(function () {
if (parseInt($(this).text()) === year) {
$(".nav-abs li.year").each(function () { if ($(it).hasClass("close")) {
if (parseInt($(this).text()) === year) { it.className = "year open";
if ($(it).hasClass("close")) { } else {
it.className = "year open"; it.className = "year close";
} else { }
it.className = "year close"; } else {
} this.className = "year close";
} else { }
this.className = "year close"; });
} }
}); };
}
}; /*!
* jQuery imagesLoaded plugin v2.1.1
/*! * http://github.com/desandro/imagesloaded
* jQuery imagesLoaded plugin v2.1.1 *
* http://github.com/desandro/imagesloaded * MIT License. by Paul Irish et al.
* */
* MIT License. by Paul Irish et al.
*/ /*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
/*global jQuery: false */
/*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
/*global jQuery: false */ ;
(function($, undefined) {
; 'use strict';
(function($, undefined) {
'use strict'; // blank image data-uri bypasses webkit log warning (thx doug jones)
var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
// 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,
$.fn.imagesLoaded = function( callback ) { deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
var $this = this, hasNotify = $.isFunction(deferred.notify),
deferred = $.isFunction($.Deferred) ? $.Deferred() : 0, $images = $this.find('img').add( $this.filter('img') ),
hasNotify = $.isFunction(deferred.notify), loaded = [],
$images = $this.find('img').add( $this.filter('img') ), proper = [],
loaded = [], broken = [];
proper = [],
broken = []; // Register deferred callbacks
if ($.isPlainObject(callback)) {
// Register deferred callbacks $.each(callback, function (key, value) {
if ($.isPlainObject(callback)) { if (key === 'callback') {
$.each(callback, function (key, value) { callback = value;
if (key === 'callback') { } else if (deferred) {
callback = value; deferred[key](value);
} else if (deferred) { }
deferred[key](value); });
} }
});
} function doneLoading() {
var $proper = $(proper),
function doneLoading() { $broken = $(broken);
var $proper = $(proper),
$broken = $(broken); if ( deferred ) {
if ( broken.length ) {
if ( deferred ) { deferred.reject( $images, $proper, $broken );
if ( broken.length ) { } else {
deferred.reject( $images, $proper, $broken ); deferred.resolve( $images );
} else { }
deferred.resolve( $images ); }
}
} if ( $.isFunction( callback ) ) {
callback.call( $this, $images, $proper, $broken );
if ( $.isFunction( callback ) ) { }
callback.call( $this, $images, $proper, $broken ); }
}
} function imgLoadedHandler( event ) {
imgLoaded( event.target, event.type === 'error' );
function imgLoadedHandler( event ) { }
imgLoaded( event.target, event.type === 'error' );
} function imgLoaded( img, isBroken ) {
// don't proceed if BLANK image, or image is already loaded
function imgLoaded( img, isBroken ) { if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) {
// don't proceed if BLANK image, or image is already loaded return;
if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) { }
return;
} // store element in loaded images array
loaded.push( img );
// store element in loaded images array
loaded.push( img ); // keep track of broken and properly loaded images
if ( isBroken ) {
// keep track of broken and properly loaded images broken.push( img );
if ( isBroken ) { } else {
broken.push( img ); proper.push( img );
} else { }
proper.push( img );
} // cache image and its state for future calls
$.data( img, 'imagesLoaded', {
// cache image and its state for future calls isBroken: isBroken,
$.data( img, 'imagesLoaded', { src: img.src
isBroken: isBroken, } );
src: img.src
} ); // trigger deferred progress method if present
if ( hasNotify ) {
// trigger deferred progress method if present deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] );
if ( hasNotify ) { }
deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] );
} // call doneLoading and clean listeners if all images are loaded
if ( $images.length === loaded.length ) {
// call doneLoading and clean listeners if all images are loaded setTimeout( doneLoading );
if ( $images.length === loaded.length ) { $images.unbind( '.imagesLoaded', imgLoadedHandler );
setTimeout( doneLoading ); }
$images.unbind( '.imagesLoaded', imgLoadedHandler ); }
}
} // if no images, trigger immediately
if ( !$images.length ) {
// if no images, trigger immediately doneLoading();
if ( !$images.length ) { } else {
doneLoading(); $images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoadedHandler )
} else { .each( function( i, el ) {
$images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoadedHandler ) var src = el.src;
.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
// find out if this image has been already checked for status var cached = $.data( el, 'imagesLoaded' );
// if it was, and src has not changed, call imgLoaded on it if ( cached && cached.src === src ) {
var cached = $.data( el, 'imagesLoaded' ); imgLoaded( el, cached.isBroken );
if ( cached && cached.src === src ) { return;
imgLoaded( el, cached.isBroken ); }
return;
} // if complete is true and browser supports natural sizes, try
// to check for image status manually
// if complete is true and browser supports natural sizes, try if ( el.complete && el.naturalWidth !== undefined ) {
// to check for image status manually imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );
if ( el.complete && el.naturalWidth !== undefined ) { return;
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
// cached images don't fire load sometimes, so we reset src, but only when // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
// dealing with IE, or image is complete (loaded) and failed manual check if ( el.readyState || el.complete ) {
// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f el.src = BLANK;
if ( el.readyState || el.complete ) { el.src = src;
el.src = BLANK; }
el.src = src; });
} }
});
} return deferred ? deferred.promise( $this ) : $this;
};
return deferred ? deferred.promise( $this ) : $this;
}; })(jQuery);
})(jQuery); (function () {
Util.init();
(function () { Util.replaceSideEm($(".comments .article-body"));
Util.init(); Util.buildTags("tagsSide");
Util.replaceSideEm($(".comments .article-body"));
Util.buildTags("tagsSide"); timeline.init();
timeline.init();
})(); })();

File diff suppressed because one or more lines are too long