Commit 674c44ad authored by Vanessa's avatar Vanessa

bug timeline

parent c047f532
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* *
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.2, May 4, 2012 * @version 1.0.1.3, Jan 30, 2013
*/ */
/* article-list 相关操作 */ /* article-list 相关操作 */
...@@ -135,6 +135,7 @@ admin.articleList = { ...@@ -135,6 +135,7 @@ admin.articleList = {
} }
$it.html(tip); $it.html(tip);
$("#loadMsg").text("");
} }
}); });
} }
......
...@@ -1542,7 +1542,7 @@ admin.comment = { ...@@ -1542,7 +1542,7 @@ admin.comment = {
* *
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.2, May 4, 2012 * @version 1.0.1.3, Jan 30, 2013
*/ */
/* article-list 相关操作 */ /* article-list 相关操作 */
...@@ -1659,6 +1659,7 @@ admin.articleList = { ...@@ -1659,6 +1659,7 @@ admin.articleList = {
} }
$it.html(tip); $it.html(tip);
$("#loadMsg").text("");
} }
}); });
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<#include "header.ftl"> <#include "header.ftl">
<div class="main"> <div class="main">
<div class="wrapper"> <div class="wrapper">
<h2>${archive1Label} <h2 id="archive">${archive1Label}
<#if "en" == localeString?substring(0, 2)> <#if "en" == localeString?substring(0, 2)>
${archiveDate.archiveDateMonth} ${archiveDate.archiveDateYear} (${archiveDate.archiveDatePublishedArticleCount}) ${archiveDate.archiveDateMonth} ${archiveDate.archiveDateYear} (${archiveDate.archiveDatePublishedArticleCount})
<#else> <#else>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<#include "header.ftl"> <#include "header.ftl">
<div class="main"> <div class="main">
<div class="wrapper"> <div class="wrapper">
<h2>${author1Label}${authorName}</h2> <h2 id="author">${author1Label}${authorName}</h2>
<#include "article-list.ftl"> <#include "article-list.ftl">
</div> </div>
</div> </div>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
${topBarReplacement} ${topBarReplacement}
<#include "header.ftl"> <#include "header.ftl">
<div class="main"> <div class="main">
<div class="wrapper"> <div class="wrapper" id="index">
<#include "article-list.ftl"> <#include "article-list.ftl">
</div> </div>
</div> </div>
......
...@@ -28,16 +28,15 @@ var getNextPage = function () { ...@@ -28,16 +28,15 @@ var getNextPage = function () {
var $more = $(".article-next"); var $more = $(".article-next");
currentPage += 1; currentPage += 1;
var path = "/articles/"; var path = "/articles/";
if(location.pathname.indexOf("tags") === 1) { if($("#tag").length === 1) {
var pathnames = location.pathname.split("/tags/"); var pathnames = location.pathname.split("/");
path = "/articles/tags/" + pathnames[1].split("/")[0] + "/"; path = "/articles/tags/" + pathnames[pathnames.length - 1] + "/";
} else if (location.pathname.indexOf("archives") > -1) { } else if ($("#archive").length === 1) {
var archivesPathname = location.pathname.split("/archives/"); var pathnames = location.pathname.split("/");
var archives = archivesPathname[1].split("/"); path = "/articles/archives/" + pathnames[pathnames.length - 2] + "/" + pathnames[pathnames.length - 1] + "/";
path = "/articles/archives/" + archives[0] + "/" + archives[1] + "/"; } else if ($("#author").length === 1) {
} else if (location.pathname.indexOf("authors") === 1) { var pathnames = location.pathname.split("/");
var pathnames = location.pathname.split("/authors/"); path = "/articles/authors/" + pathnames[pathnames.length - 1] + "/";
path = "/articles/authors/" + pathnames[1].split("/")[0] + "/";
} }
$.ajax({ $.ajax({
......
/* /*
* 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 ease js. * @fileoverview ease 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.5, Jan 29, 2013 * @version 1.0.1.5, Jan 29, 2013
*/ */var goTranslate=function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},getNextPage=function(){var e=$(".article-next");currentPage+=1;var t="/articles/";if($("#tag").length===1){var n=location.pathname.split("/");t="/articles/tags/"+n[n.length-1]+"/"}else if($("#archive").length===1){var n=location.pathname.split("/");t="/articles/archives/"+n[n.length-2]+"/"+n[n.length-1]+"/"}else if($("#author").length===1){var n=location.pathname.split("/");t="/articles/authors/"+n[n.length-1]+"/"}$.ajax({url:latkeConfig.servePath+t+currentPage,type:"GET",beforeSend:function(){e.css("background","url("+latkeConfig.staticServePath+"/skins/ease/images/ajax-loader.gif) no-repeat scroll center center #fefefe")},success:function(t,n){if(!t.sc)return;var r="",i=t.rslts.pagination;for(var s=0;s<t.rslts.articles.length;s++){var o=t.rslts.articles[s],u="";t.rslts.articles.length-1===s&&(u=" article-last"),r+='<li class="article'+u+'">'+'<div class="article-title">'+"<h2>"+'<a rel="bookmark" class="ft-gray" href="'+latkeConfig.servePath+o.articlePermalink+'">'+o.articleTitle+"</a>",o.hasUpdated&&(r+="<sup>"+Label.updatedLabel+"</sup>"),o.articlePutTop&&(r+="<sup>"+Label.topArticleLabel+"</sup>"),r+='</h2><div class="right"><a rel="nofollow" class="ft-gray" href="'+latkeConfig.servePath+o.articlePermalink+'#comments">'+ +o.articleCommentCount+"&nbsp;&nbsp;"+Label.commentLabel+"</a>&nbsp;&nbsp;"+'<a rel="nofollow" class="ft-gray" href="'+latkeConfig.servePath+o.articlePermalink+'">'+o.articleViewCount+"&nbsp;&nbsp;"+Label.viewLabel+"</a>"+"</div>"+'<div class="clear"></div>'+"</div>"+'<div class="article-body">'+'<div id="abstract'+o.oId+'">'+o.articleAbstract+"</div>"+'<div id="content'+o.oId+'" class="none"></div>'+"</div>"+'<div class="right ft-gray">',o.hasUpdated?r+=Util.toDate(o.articleUpdateTime,"yy-MM-dd HH:mm"):r+=Util.toDate(o.articleCreateTime,"yy-MM-dd HH:mm"),r+=' <a href="'+latkeConfig.servePath+"/authors/"+o.authorId+'">'+o.authorName+"</a>"+"</div>"+'<div class="left ft-gray">'+Label.tag1Label+" ";var a=o.articleTags.split(",");for(var f=0;f<a.length;f++)r+='<a rel="tag" href="'+latkeConfig.servePath+"/tags/"+encodeURIComponent(a[f])+'">'+a[f]+"</a>",f<a.length-1&&(r+=", ");r+='</div><div class="clear"></div></li>'}$(".article-last").removeClass("article-last"),$(".main>.wrapper>ul").append(r),i.paginationPageCount===currentPage?e.remove():e.css("background","none")}})},ease={$header:$(".header"),headerH:103,$body:$(".main > .wrapper"),$nav:$(".nav"),getCurrentPage:function(){var e=$(".article-next");e.length>0&&(window.currentPage=e.data("page"))},setNavCurrent:function(){$(".nav ul a").each(function(){var e=$(this);e.attr("href")===latkeConfig.servePath+location.pathname?e.addClass("current"):/\/[0-9]+$/.test(location.pathname)&&($(".nav ul li")[0].className="current")})},initCommon:function(){Util.init(),Util.replaceSideEm($(".recent-comments-content")),Util.buildTags("tagsSide")},initArchives:function(){var e=$(".archives");if(e.length<1)return;$(".footer").css("marginTop","30px");var t=[],n=e.find("span").each(function(){var e=$(this).data("year"),n=!0;for(var r=0;r<t.length;r++)if(e===t[r]){n=!1;break}n&&t.push(e)}),r="";for(var i=0;i<t.length;i++){var s="";for(var o=0;o<n.length;o++){var u=$(n[o]);u.data("year")===t[i]&&(s+=u.html())}r+="<div><h3 class='ft-gray'>"+t[i]+"</h3>"+s+"</div>"}e.html(r);var a=$(".archives>div"),f=0,l=0,c=[];for(var h=0;h<a.length;h++){for(var p=0;p<3;p++){if(h>=a.length)break;a[h].style.left=p*310+"px",f>0?(a[h-3].style.top!==""&&(l=parseInt(a[h-3].style.top)),a[h].style.top=$(a[h-3]).height()+60+l+"px",c[p]=parseInt(a[h].style.top)+$(a[h]).height()+60):c[p]=$(a[h]).height()+60,p<2&&(h+=1)}f+=1}e.height(c.sort()[c.length-1])},scrollEvent:function(){var e=this;$(window).scroll(function(){var t=$(window).scrollTop(),n=0;$("#top").css("display")==="block"&&(n=$("#top").height()),t>=e.headerH+n?(e.$nav.css("position","fixed"),e.$body.css("marginTop","55px")):(e.$nav.css("position","inherit"),e.$body.css("marginTop","0"));if(t>e.headerH){var r=$(window).height(),i=t+r-21;$("body").height()-58<=t+r&&(i=$(".footer").offset().top-21),$("#goTop").fadeIn("slow").css("top",i)}else $("#goTop").hide()})},setDynamic:function(){var e=$(".dynamic");if($(".dynamic").length<1)return;var t=e.find(".side-comments"),n=e.find(".side-tags"),r=e.find(".side-most-comment"),i=e.find(".side-most-view");t.height()>n.height()?n.height(t.height()):t.height(n.height()),r.height()>i.height()?i.height(r.height()):r.height(i.height()),$(".article-body").each(function(){this.innerHTML=Util.replaceEmString($(this).html())})},scrollToCmt:function(){$(window.location.hash).length==1&&$(window).scrollTop($(window.location.hash).offset().top-60)}};(function(){ease.getCurrentPage(),ease.initCommon(),ease.scrollEvent(),ease.setNavCurrent(),ease.initArchives(),ease.setDynamic()})();
var goTranslate=function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)};var getNextPage=function(){var $more=$(".article-next");currentPage+=1;var path="/articles/";if(location.pathname.indexOf("tags")===1){var pathnames=location.pathname.split("/tags/");path="/articles/tags/"+pathnames[1].split("/")[0]+"/"}else if(location.pathname.indexOf("archives")>-1){var archivesPathname=location.pathname.split("/archives/");var archives=archivesPathname[1].split("/");path="/articles/archives/"+archives[0]+"/"+archives[1]+"/"}else if(location.pathname.indexOf("authors")===1){var pathnames=location.pathname.split("/authors/");path="/articles/authors/"+pathnames[1].split("/")[0]+"/"}$.ajax({url:latkeConfig.servePath+path+currentPage,type:"GET",beforeSend:function(){$more.css("background","url("+latkeConfig.staticServePath+"/skins/ease/images/ajax-loader.gif) no-repeat scroll center center #fefefe")},success:function(result,textStatus){if(!result.sc){return}var articlesHTML="",pagination=result.rslts.pagination;for(var i=0;i<result.rslts.articles.length;i++){var article=result.rslts.articles[i],lastClass="";if(result.rslts.articles.length-1===i){lastClass=" article-last"}articlesHTML+='<li class="article'+lastClass+'">'+'<div class="article-title">'+'<h2>'+'<a rel="bookmark" class="ft-gray" href="'+latkeConfig.servePath+article.articlePermalink+'">'+article.articleTitle+'</a>';if(article.hasUpdated){articlesHTML+='<sup>'+Label.updatedLabel+'</sup>'}if(article.articlePutTop){articlesHTML+='<sup>'+Label.topArticleLabel+'</sup>'}articlesHTML+='</h2>'+'<div class="right">'+'<a rel="nofollow" class="ft-gray" href="'+latkeConfig.servePath+article.articlePermalink+'#comments">'+ +article.articleCommentCount+'&nbsp;&nbsp;'+Label.commentLabel+'</a>&nbsp;&nbsp;'+'<a rel="nofollow" class="ft-gray" href="'+latkeConfig.servePath+article.articlePermalink+'">'+article.articleViewCount+'&nbsp;&nbsp;'+Label.viewLabel+'</a>'+'</div>'+'<div class="clear"></div>'+'</div>'+'<div class="article-body">'+'<div id="abstract'+article.oId+'">'+article.articleAbstract+'</div>'+'<div id="content'+article.oId+'" class="none"></div>'+'</div>'+'<div class="right ft-gray">';if(article.hasUpdated){articlesHTML+=Util.toDate(article.articleUpdateTime,'yy-MM-dd HH:mm')}else{articlesHTML+=Util.toDate(article.articleCreateTime,'yy-MM-dd HH:mm')}articlesHTML+=' <a href="'+latkeConfig.servePath+'/authors/'+article.authorId+'">'+article.authorName+'</a>'+'</div>'+'<div class="left ft-gray">'+Label.tag1Label+" ";var articleTags=article.articleTags.split(",");for(var j=0;j<articleTags.length;j++){articlesHTML+='<a rel="tag" href="'+latkeConfig.servePath+'/tags/'+encodeURIComponent(articleTags[j])+'">'+articleTags[j]+'</a>';if(j<articleTags.length-1){articlesHTML+=", "}}articlesHTML+='</div>'+'<div class="clear"></div>'+'</li>'}$(".article-last").removeClass("article-last");$(".main>.wrapper>ul").append(articlesHTML);if(pagination.paginationPageCount===currentPage){$more.remove()}else{$more.css("background","none")}}})};var ease={$header:$(".header"),headerH:103,$body:$(".main > .wrapper"),$nav:$(".nav"),getCurrentPage:function(){var $next=$(".article-next");if($next.length>0){window.currentPage=$next.data("page")}},setNavCurrent:function(){$(".nav ul a").each(function(){var $this=$(this);if($this.attr("href")===latkeConfig.servePath+location.pathname){$this.addClass("current")}else if(/\/[0-9]+$/.test(location.pathname)){$(".nav ul li")[0].className="current"}})},initCommon:function(){Util.init();Util.replaceSideEm($(".recent-comments-content"));Util.buildTags("tagsSide")},initArchives:function(){var $archives=$(".archives");if($archives.length<1){return}$(".footer").css("marginTop","30px");var years=[],$archiveList=$archives.find("span").each(function(){var year=$(this).data("year"),tag=true;for(var i=0;i<years.length;i++){if(year===years[i]){tag=false;break}}if(tag){years.push(year)}});var yearsHTML="";for(var j=0;j<years.length;j++){var monthsHTML="";for(var l=0;l<$archiveList.length;l++){var $month=$($archiveList[l]);if($month.data("year")===years[j]){monthsHTML+=$month.html()}}yearsHTML+="<div><h3 class='ft-gray'>"+years[j]+"</h3>"+monthsHTML+"</div>"}$archives.html(yearsHTML);var $items=$(".archives>div"),line=0,top=0,heights=[];for(var m=0;m<$items.length;m++){for(var n=0;n<3;n++){if(m>=$items.length){break}$items[m].style.left=(n*310)+"px";if(line>0){if($items[m-3].style.top!==""){top=parseInt($items[m-3].style.top)}$items[m].style.top=$($items[m-3]).height()+60+top+"px";heights[n]=parseInt($items[m].style.top)+$($items[m]).height()+60}else{heights[n]=$($items[m]).height()+60}if(n<2){m+=1}}line+=1}$archives.height(heights.sort()[heights.length-1])},scrollEvent:function(){var _it=this;$(window).scroll(function(){var y=$(window).scrollTop(),topH=0;if($("#top").css("display")==="block"){topH=$("#top").height()}if(y>=_it.headerH+topH){_it.$nav.css("position","fixed");_it.$body.css("marginTop","55px")}else{_it.$nav.css("position","inherit");_it.$body.css("marginTop","0")}if(y>_it.headerH){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()}})},setDynamic:function(){var $dynamic=$(".dynamic");if($(".dynamic").length<1){return}var $comments=$dynamic.find(".side-comments"),$tags=$dynamic.find(".side-tags"),$mostComment=$dynamic.find(".side-most-comment"),$mostView=$dynamic.find(".side-most-view");if($comments.height()>$tags.height()){$tags.height($comments.height())}else{$comments.height($tags.height())}if($mostComment.height()>$mostView.height()){$mostView.height($mostComment.height())}else{$mostComment.height($mostView.height())}$(".article-body").each(function(){this.innerHTML=Util.replaceEmString($(this).html())})},scrollToCmt:function(){if($(window.location.hash).length==1){$(window).scrollTop($(window.location.hash).offset().top-60)}}};(function(){ease.getCurrentPage();ease.initCommon();ease.scrollEvent();ease.setNavCurrent();ease.initArchives();ease.setDynamic()})(); \ No newline at end of file
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="main"> <div class="main">
<div class="wrapper"> <div class="wrapper">
<h2> <h2>
<a rel="alternate" href="${servePath}/tag-articles-feed.do?oId=${tag.oId}"> <a id="tag" rel="alternate" href="${servePath}/tag-articles-feed.do?oId=${tag.oId}">
${tag1Label} ${tag1Label}
${tag.tagTitle} ${tag.tagTitle}
(${tag.tagPublishedRefCount}) (${tag.tagPublishedRefCount})
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<body> <body>
${topBarReplacement} ${topBarReplacement}
<#include "header.ftl"> <#include "header.ftl">
<h3 class="nav-abs"> <h3 class="nav-abs" id="author">
<img style="border-radius: 45px;" width="90" title="${authorName}" src="${authorThumbnailURL}"/> <img style="border-radius: 45px;" width="90" title="${authorName}" src="${authorThumbnailURL}"/>
<br/> <br/>
${authorName} ${authorName}
......
/* html,body{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;margin:0;padding:0;height:100%;}
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team body{font:0.81em Verdana,arial,'\5fae\8f6f\96c5\9ed1';color:#666666;background-color:#363A3D;}
* button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;font-family:Verdana,arial,'\5fae\8f6f\96c5\9ed1';outline:none;}
* Licensed under the Apache License, Version 2.0 (the "License"); a{color:#6599C6;outline:medium none;text-decoration:none;transition:color 1s ease 0s;}
* you may not use this file except in compliance with the License. a:hover{color:#000;}
* You may obtain a copy of the License at img{max-width:100%;border:0;vertical-align:middle;}
* ::selection{background-color:#D5D5D5;color:#FCFCFC;}
* http://www.apache.org/licenses/LICENSE-2.0 ::-moz-selection{background-color:#D5D5D5;color:#FCFCFC;}
* .left{float:left;}
* Unless required by applicable law or agreed to in writing, software .right{float:right;}
* distributed under the License is distributed on an "AS IS" BASIS, .clear{background-color:transparent;border:0;clear:both;display:block;font-size:0;height:0;line-height:0;overflow:hidden;}
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. .none{display:none;}
* See the License for the specific language governing permissions and .fn-clear:before,.fn-clear:after{display:table;content:"";}
* limitations under the License. .fn-clear:after{clear:both;}
*/ .em00,.em01,.em02,.em03,.em04,.em05,.em06,.em07,.em08,.em09,.em10,.em11,.em12,.em13,.em14{cursor:pointer;background-image:url("../../ease/images/emotions/emotions-ease.png");float:left;height:24px;margin-right:5px;width:24px;transition:all 0.2s ease-out;-webkit-transition:all 0.2s ease-out;-moz-transition:all 0.2s ease-out;}
/* #emotions span:hover{transform:scale(1.2) rotate(360deg);-webkit-transform:scale(1.2) rotate(360deg);-moz-transform:scale(1.2) rotate(360deg);}
* timeline skin style. .em01{background-position:-24px 0;}
* .em02{background-position:-48px 0;}
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> .em03{background-position:-72px 0;}
* @version 1.0.0.8, Jan 14, 2013 .em04{background-position:-96px 1px;}
*/ .em05{background-position:0 -24px;}
/* start reset */ .em06{background-position:-24px -24px;}
html, body { .em07{background-position:-48px -24px;}
-webkit-text-size-adjust: 100%; .em08{background-position:-72px -24px;}
-ms-text-size-adjust: 100%; .em09{background-position:-96px -24px;}
margin: 0; .em10{background-position:0 -48px;}
padding: 0; .em11{background-position:-24px -48px;}
height: 100%; .em12{background-position:-48px -48px;}
} .em13{background-position:-72px -48px;}
.em14{background-position:-96px -48px;}
body { #tags{margin:0;}
font: 0.81em Verdana, arial, '\5fae\8f6f\96c5\9ed1'; #tags li{float:left;list-style-type:none;}
color: #666666; #tags a{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;display:block;margin:5px 10px;padding:5px 10px;}
background-color: #363A3D; #tags a:hover{text-shadow:0 0 2px;text-decoration:none;box-shadow:0 0 4px #D5D5D5;}
} #tags b{font-size:70%;opacity:0.6;}
.tags1,.tags1:visited{font-size:12px;color:#a7a7a7;}
button, .tags2,.tags2:visited{font-size:14px;color:#808080;}
input, .tags3,.tags3:visited{font-size:16px;color:#595959;}
select, .tags4,.tags4:visited{font-size:18px;color:#323232;}
textarea { .tags5,.tags5:visited{font-size:20px;color:#0a0a0a;}
margin: 0; .module{background-color:#FFFFFF;border:1px solid #BEC3C7;border-radius:5px 5px 5px 5px;box-shadow:0 1px 1px rgba(0, 0, 0, 0.1);margin-bottom:30px;padding:15px;word-wrap:break-word;position:relative;}
font-size: 100%; .module>h3{margin:0 0 10px 0;color:#444;}
vertical-align: middle; .module>ul{list-style-type:none;padding-left:0;margin:0;overflow:hidden;}
font-family: Verdana, arial,'\5fae\8f6f\96c5\9ed1'; .module>ul>li{border-top:1px solid #EEEEEE;padding:6px 0;}
outline: none; .articles .arrow,.ico-author,.ico-tags,.ico-comment,.ico-top,.ico-view,.ico-reply,.ico-translate,#search{background-repeat:no-repeat;background-image:url("../../timeline/images/icons.png");}
} .ico-author,.ico-tags,.ico-comment,.ico-view,.ico-reply{padding-left:20px;background-position:-1px -63px;margin-right:10px;}
.ico-tags{background-position:-1px -83px;}
a { .ico-comment{background-position:-1px -41px;}
color: #6599C6; .ico-view{background-position:0 -122px;}
outline: medium none; .ico-reply{background-position:0 -162px;}
text-decoration: none; .ico-translate{background-position:0 -186px;cursor:pointer;float:right;height:16px;margin-left:10px;width:16px;}
transition: color 1s ease 0s; #search{background-position:5px -138px;border:medium none;border-radius:12px 12px 12px 12px;box-shadow:0 1px 0 rgba(0, 0, 0, 0.4) inset,0 1px 0 rgba(255, 255, 255, 0.1);color:#A5A099;height:22px;margin-top:13px;padding-left:25px;transition:width 0.7s ease 0s;width:60px;}
} #search:focus{color:#333;width:140px;}
.ico-top{background-color:#363A3D;background-position:4px -100px;border-radius:20em 20em 20em 20em;bottom:60px;box-shadow:0 -1px 2px rgba(0, 0, 0, 0.3) inset,0 1px 0 rgba(255, 255, 255, 0.15);height:25px;position:fixed;left:90%;width:25px;cursor:pointer;}
a:hover { .ico-next,.ico-pre{background:none repeat scroll 0 0 #6599C6;border-radius:10em 10em 10em 10em;color:#FFFFFF;display:block;float:left;font:20px/100% "Times New Roman",Times,serif;height:28px;margin:-8px 10px 0 0;padding:4px 0 0;text-align:center;transition:background 1s ease 0s;width:32px;}
color: #000; .ico-next{float:right;margin:-8px 0 0 10px;}
} 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;}
img { .header{background-color:#BFBFBF;background-image:url("../../timeline/images/nav-bg.png"),linear-gradient(to bottom, #cccccc 0%, #a9a9a9 100%);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;}
max-width: 100%; .container{width:80%;margin:0 auto;}
border: 0; .footer{border-top:1px solid #232323;padding:20px 0;color:#ddd;font-size:80%;}
vertical-align: middle; .footer a{color:#9CC0DE;}
} .footer a:hover{text-decoration:underline;}
.header .title{font-size:150%;margin:3px 0 0;}
::selection { .header .title a{color:#414141;text-shadow:0 1px 0 rgba(255, 255, 255, 0.7);}
background-color: #D5D5D5; .header li a{color:#444;padding:19px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.7);white-space:nowrap;}
color: #FCFCFC; .header li a.current{border-bottom:2px solid #D26911;}
} .header a:hover{color:#000;}
.header li{float:left;list-style-type:none;}
::-moz-selection { .articles{position:relative;margin-top:11px;}
background-color: #D5D5D5; .articles>div.fn-clear{position:relative;margin-bottom:50px;}
color: #FCFCFC; .articles>div.fn-clear>h2{margin:0;text-align:center;height:28px;}
} .articles>.vertical{background-color:#9EB5C6;border-radius:20em 20em 20em 20em;box-shadow:0 0 1px 0 rgba(0, 0, 0, 0.5) inset,0 0 1px 0 rgba(255, 255, 255, 0.6);height:100%;left:50%;margin-left:-3px;position:absolute;top:0;width:6px;}
/* end reset */ .articles article{width:50%;}
.articles article.l>div.module{margin-right:30px;left:0;}
/* start function */ .articles article.r{left:50%;}
.left { .articles article.r>div{margin-left:30px;position:relative;}
float: left; .articles .dot{background-color:#FFFFFF;border:3px solid #60829F;border-radius:20em 20em 20em 20em;height:6px;position:absolute;right:-37px;top:22px;width:6px;}
} .articles .r .dot{left:-37px;right:inherit;}
.articles .arrow{height:15px;position:absolute;right:-9px;top:21px;width:9px;}
.right { .articles .r .arrow{background-position:0 -22px;left:-9px;right:inherit;}
float: right; 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;}
article .article-title{margin:0;}
.clear { article .article-title>sup{color:#6599C6;font-size:70%;}
background-color: transparent; article .article-title a{color:#000;text-decoration:none;}
border: 0; .ico>a{color:#999999;font-size:80%;text-decoration:none;}
clear: both; .ico>a:hover{color:#000;}
display: block; .article-more{background-color:#60829F;border-radius:20em 20em 20em 20em;box-shadow:0 1px 0 rgba(0, 0, 0, 0.2) inset,0 1px 0 rgba(255, 255, 255, 0.6);color:#FFFFFF;cursor:pointer;font-weight:bold;height:19px;left:50%;margin-left:-38px;padding:5px 20px;position:absolute;text-align:center;top:100%;width:36px;}
font-size: 0; .article-archive{background-color:#60829F;border-radius:20em 20em 20em 20em;box-shadow:0 1px 0 rgba(0, 0, 0, 0.2) inset,0 1px 0 rgba(255, 255, 255, 0.6);color:#FFFFFF;font-size:80%;font-weight:normal;padding:5px 20px;}
height: 0; .dynamic-l{float:left;width:70%;}
line-height: 0; .dynamic-l>div{margin-right:30px;}
overflow: hidden; .dynamic-r{float:right;width:30%;}
} .dynamic-r .tags a,.links a{line-height:24px;}
#comments{margin:30px 0 50px;position:relative;}
.none { .comments>li>img{height:60px;width:60px;border-radius:30px;float:left;margin-right:15px;}
display: none; .comments .author{font-size:130%;font-style:italic;}
} .module>ul>li.comment-body-ref{background-color:#FFFFFF;border:1px solid #ddd;left:76px;opacity:0.8;padding:10px;position:absolute;width:74%;border-radius:10px;}
.comment-body-ref .ico-reply{display:none;}
.fn-clear:before, .comment-form{width:100%;margin:30px 0;}
.fn-clear:after { #commentForm{margin-top:0;}
display: table; .comment-form input[type='text'],.comment-form textarea{background:url("../../timeline/images/bg.png") repeat scroll 0 0 #e5e8ea;border:1px solid #BCBDBE;border-radius:5px 5px 5px 5px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.1) inset;margin:5px 5px 5px 0;padding:6px;}
content: ""; .comment-form input[type='text']:focus,.comment-form textarea:focus{background-color:#EFEFEF;outline:medium none;}
} #submitCommentButton,#submitCommentButtonReply{background:none repeat scroll 0 0 #868889;border:1px solid #5D6265;border-radius:10em 10em 10em 10em;box-shadow:0 1px 0 rgba(255, 255, 255, 0.3) inset,0 1px 1px rgba(0, 0, 0, 0.3);color:#FFFFFF;cursor:pointer;padding:5px 20px;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.3);}
#submitCommentButton:hover,#submitCommentButtonReply:hover{color:#fff;background-color:#444;}
.fn-clear:after { .nav-abs{background-color:#6B6B6B;border:1px solid #898989;border-radius:5px 5px 5px 5px;box-shadow:0 1px 3px rgba(0, 0, 0, 0.4) inset,0 1px 0 rgba(255, 255, 255, 0.7),0 -1px 0 rgba(255, 255, 255, 0.6);color:#CCCCCC;padding:5px 10px;position:absolute;right:30px;top:61px;z-index:1;text-align:center;white-space:nowrap;}
clear: both; .nav-abs li{cursor:pointer;height:20px;list-style-type:none;min-width:120px;padding:3px 10px;text-align:left;background-color:#DEDDDD;color:#616161;}
} .nav-abs li.year{color:#CCCCCC;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.5);background-color:#6B6B6B;padding:5px 10px;}
/* end function */ .nav-abs li:hover{background-color:#EFEEEE;color:#000;}
.nav-abs li.year:hover{background-color:#353535;color:#fff;}
/* start common */
.em00, .em01, .em02, .em03, .em04, .em05, .em06, .em07, .em08, .em09,
.em10, .em11, .em12, .em13, .em14 {
cursor: pointer;
background-image: url("../../ease/images/emotions/emotions-ease.png");
float: left;
height: 24px;
margin-right: 5px;
width: 24px;
transition: all .2s ease-out;
-webkit-transition: all .2s ease-out;
-moz-transition: all .2s ease-out;
}
#emotions span:hover {
transform: scale(1.2) rotate(360deg);
-webkit-transform: scale(1.2) rotate(360deg);
-moz-transform: scale(1.2) rotate(360deg);
}
.em01 {
background-position: -24px 0;
}
.em02 {
background-position: -48px 0;
}
.em03 {
background-position: -72px 0;
}
.em04 {
background-position: -96px 1px;
}
.em05 {
background-position: 0 -24px;
}
.em06 {
background-position: -24px -24px;
}
.em07 {
background-position: -48px -24px;
}
.em08 {
background-position: -72px -24px;
}
.em09 {
background-position: -96px -24px;
}
.em10 {
background-position: 0 -48px;
}
.em11 {
background-position: -24px -48px ;
}
.em12 {
background-position: -48px -48px;
}
.em13 {
background-position: -72px -48px;
}
.em14 {
background-position: -96px -48px;
}
#tags {
margin: 0;
}
#tags li {
float: left;
list-style-type: none;
}
#tags a {
background-color: #FCFCFC;
box-shadow: 0 0 2px #D5D5D5;
display: block;
margin: 5px 10px;
padding: 5px 10px;
}
#tags a:hover {
text-shadow: 0 0 2px;
text-decoration: none;
box-shadow: 0 0 4px #D5D5D5;
}
#tags b {
font-size: 70%;
opacity: 0.6;
}
.tags1, .tags1:visited {
font-size: 12px;
color: #a7a7a7;
}
.tags2, .tags2:visited {
font-size: 14px;
color: #808080;
}
.tags3, .tags3:visited {
font-size: 16px;
color: #595959;
}
.tags4, .tags4:visited {
font-size: 18px;
color: #323232;
}
.tags5, .tags5:visited {
font-size: 20px;
color: #0a0a0a;
}
.module {
background-color: #FFFFFF;
border: 1px solid #BEC3C7;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
margin-bottom: 30px;
padding: 15px;
word-wrap: break-word;
position: relative;
}
.module > h3 {
margin: 0 0 10px 0;
color: #444;
}
.module > ul {
list-style-type: none;
padding-left: 0;
margin: 0;
overflow: hidden;
}
.module > ul > li {
border-top: 1px solid #EEEEEE;
padding: 6px 0;
}
/* end common */
/* start icon */
.articles .arrow,
.ico-author,
.ico-tags,
.ico-comment,
.ico-top,
.ico-view,
.ico-reply,
.ico-translate,
#search {
background-repeat: no-repeat;
background-image: url("../../timeline/images/icons.png");
}
.ico-author,
.ico-tags,
.ico-comment,
.ico-view,
.ico-reply {
padding-left: 20px;
background-position: -1px -63px;
margin-right: 10px;
}
.ico-tags {
background-position: -1px -83px;
}
.ico-comment {
background-position: -1px -41px;
}
.ico-view {
background-position: 0 -122px;
}
.ico-reply {
background-position: 0 -162px;
}
.ico-translate {
background-position: 0 -186px;
cursor: pointer;
float: right;
height: 16px;
margin-left: 10px;
width: 16px;
}
#search {
background-position: 5px -138px;
border: medium none;
border-radius: 12px 12px 12px 12px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4) inset, 0 1px 0 rgba(255, 255, 255, 0.1);
color: #A5A099;
height: 22px;
margin-top: 13px;
padding-left: 25px;
transition: width 0.7s ease 0s;
width: 60px;
}
#search:focus {
color: #333;
width: 140px;
}
.ico-top {
background-color: #363A3D;
background-position: 4px -100px;
border-radius: 20em 20em 20em 20em;
bottom: 60px;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.3) inset, 0 1px 0 rgba(255, 255, 255, 0.15);
height: 25px;
position: fixed;
left: 90%;
width: 25px;
cursor: pointer;
}
.ico-next,
.ico-pre {
background: none repeat scroll 0 0 #6599C6;
border-radius: 10em 10em 10em 10em;
color: #FFFFFF;
display: block;
float: left;
font: 20px/100% "Times New Roman",Times,serif;
height: 28px;
margin: -8px 10px 0 0;
padding: 4px 0 0;
text-align: center;
transition: background 1s ease 0s;
width: 32px;
}
.ico-next {
float: right;
margin: -8px 0 0 10px;
}
a:hover > .ico-next,
a:hover > .ico-pre {
background-color: #000;
}
/* end icon */
/* start framework */
.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(to bottom, #CCCCCC 0%, #A9A9A9 100%);
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;
}
.footer {
border-top: 1px solid #232323;
padding: 20px 0;
color: #ddd;
font-size: 80%;
}
.footer a {
color: #9CC0DE;
}
.footer a:hover {
text-decoration: underline;
}
/* end framework */
/* start header */
.header .title {
font-size: 150%;
margin: 3px 0 0;
}
.header .title a {
color: #414141;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}
.header li a {
color: #444;
padding: 19px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
white-space: nowrap;
}
.header li a.current {
border-bottom: 2px solid #D26911;
}
.header a:hover {
color: #000;
}
.header li {
float: left;
list-style-type: none;
}
/* end header */
/* start article list */
.articles {
position: relative;
margin-top: 11px;
}
.articles > div.fn-clear {
position: relative;
margin-bottom: 50px;
}
.articles > div.fn-clear > h2 {
margin: 0;
text-align: center;
height: 28px;
}
.articles > .vertical {
background-color: #9EB5C6;
border-radius: 20em 20em 20em 20em;
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5) inset, 0 0 1px 0 rgba(255, 255, 255, 0.6);
height: 100%;
left: 50%;
margin-left: -3px;
position: absolute;
top: 0;
width: 6px
}
.articles article {
width: 50%;
}
.articles article.l > div.module {
margin-right: 30px;
left: 0;
}
.articles article.r {
left: 50%;
}
.articles article.r > div {
margin-left: 30px;
position: relative;
}
.articles .dot {
background-color: #FFFFFF;
border: 3px solid #60829F;
border-radius: 20em 20em 20em 20em;
height: 6px;
position: absolute;
right: -37px;
top: 22px;
width: 6px;
}
.articles .r .dot {
left: -37px;
right: inherit;
}
.articles .arrow {
height: 15px;
position: absolute;
right: -9px;
top: 21px;
width: 9px;
}
.articles .r .arrow {
background-position: 0 -22px;
left: -9px;
right: inherit
}
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;
}
article .article-title {
margin: 0;
}
article .article-title > sup {
color: #6599C6;
font-size: 70%;
}
article .article-title a {
color: #000;
text-decoration: none;
}
.ico > a {
color: #999999;
font-size: 80%;
text-decoration: none;
}
.ico > a:hover {
color: #000;
}
.article-more {
background-color: #60829F;
border-radius: 20em 20em 20em 20em;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset, 0 1px 0 rgba(255, 255, 255, 0.6);
color: #FFFFFF;
cursor: pointer;
font-weight: bold;
height: 19px;
left: 50%;
margin-left: -38px;
padding: 5px 20px;
position: absolute;
text-align: center;
top: 100%;
width: 36px;
}
.article-archive {
background-color: #60829F;
border-radius: 20em 20em 20em 20em;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) inset, 0 1px 0 rgba(255, 255, 255, 0.6);
color: #FFFFFF;
font-size: 80%;
font-weight: normal;
padding: 5px 20px;
}
/* end article list */
/* start dynamic */
.dynamic-l {
float: left;
width: 70%;
}
.dynamic-l > div {
margin-right: 30px;
}
.dynamic-r {
float: right;
width: 30%;
}
.dynamic-r .tags a,
.links a {
line-height: 24px;
}
/* end dynamic */
/* start comments */
#comments {
margin: 30px 0 50px;
position: relative;
}
.comments > li > img {
height: 60px;
width: 60px;
border-radius: 30px;
float: left;
margin-right: 15px;
}
.comments .author {
font-size: 130%;
font-style: italic;
}
.module > ul > li.comment-body-ref {
background-color: #FFFFFF;
border: 1px solid #ddd;
left: 76px;
opacity: 0.8;
padding: 10px;
position: absolute;
width: 74%;
border-radius: 10px;
}
.comment-body-ref .ico-reply {
display: none;
}
.comment-form {
width: 100%;
margin: 30px 0;
}
#commentForm {
margin-top: 0;
}
.comment-form input[type='text'],
.comment-form textarea {
background: url("../../timeline/images/bg.png") repeat scroll 0 0 #E5E8EA;
border: 1px solid #BCBDBE;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
margin: 5px 5px 5px 0;
padding: 6px;
}
.comment-form input[type='text']:focus,
.comment-form textarea:focus {
background-color: #EFEFEF;
outline: medium none;
}
#submitCommentButton,
#submitCommentButtonReply {
background: none repeat scroll 0 0 #868889;
border: 1px solid #5D6265;
border-radius: 10em 10em 10em 10em;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 1px rgba(0, 0, 0, 0.3);
color: #FFFFFF;
cursor: pointer;
padding: 5px 20px;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}
#submitCommentButton:hover,
#submitCommentButtonReply:hover {
color: #fff;
background-color: #444;
}
/* end comments */
/* start others */
.nav-abs {
background-color: #6B6B6B;
border: 1px solid #898989;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) inset, 0 1px 0 rgba(255, 255, 255, 0.7), 0 -1px 0 rgba(255, 255, 255, 0.6);
color: #CCCCCC;
padding: 5px 10px;
position: absolute;
right: 30px;
top: 61px;
z-index: 1;
text-align: center;
white-space: nowrap;
}
.nav-abs li {
cursor: pointer;
height: 20px;
list-style-type: none;
min-width: 120px;
padding: 3px 10px;
text-align: left;
background-color: #DEDDDD;
color: #616161;
}
.nav-abs li.year {
color: #CCCCCC;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
background-color: #6B6B6B;
padding: 5px 10px;
}
.nav-abs li:hover {
background-color: #EFEEEE;
color: #000;
}
.nav-abs li.year:hover {
background-color: #353535;
color: #fff;
}
/* end others */
\ No newline at end of file
...@@ -60,7 +60,10 @@ ...@@ -60,7 +60,10 @@
"em11Label": "${em11Label}", "em11Label": "${em11Label}",
"em12Label": "${em12Label}", "em12Label": "${em12Label}",
"em13Label": "${em13Label}", "em13Label": "${em13Label}",
"em14Label": "${em14Label}" "em14Label": "${em14Label}",
"localeString": "${localeString}",
"yearLabel": "${yearLabel}",
"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>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<ul class="nav-abs" style="padding: 0;position: fixed"> <ul class="nav-abs" style="padding: 0;position: fixed">
<#list archiveDates as archiveDate> <#list archiveDates as archiveDate>
<li data-year="${archiveDate.archiveDateYear}" <li data-year="${archiveDate.archiveDateYear}"
onclick="timeline.getArchive('${archiveDate.archiveDateYear}/${archiveDate.archiveDateMonth}')"> onclick="timeline.getArchive('${archiveDate.archiveDateYear}', '${archiveDate.archiveDateMonth}'<#if "en" == localeString?substring(0, 2)>, '${archiveDate.monthName}'</#if>)">
<#if "en" == localeString?substring(0, 2)> <#if "en" == localeString?substring(0, 2)>
${archiveDate.monthName} ${archiveDate.archiveDateYear}(${archiveDate.archiveDatePublishedArticleCount}) ${archiveDate.monthName} ${archiveDate.archiveDateYear}(${archiveDate.archiveDatePublishedArticleCount})
<#else> <#else>
......
...@@ -135,12 +135,17 @@ var timeline = { ...@@ -135,12 +135,17 @@ var timeline = {
window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href); window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href);
}, },
getArchive: function (archive) { getArchive: function (year, month, monthName) {
var archiveDate = archive.replace("/", ""); var archiveDate = year + month,
archive = year + "/" + month;
if ($("#" + archiveDate + " > article").length > 0) { if ($("#" + archiveDate + " > article").length > 0) {
window.location.hash = "#" + archiveDate; window.location.hash = "#" + archiveDate;
} else { } else {
var archiveHTML = '<h2><span class="article-archive">' + archiveDate + '</span></h2>' var archiveDataTitle = year + " " + Label.yearLabel + " " + month + " " + Label.monthLabel;
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, \'' + '<div class="article-more" onclick="timeline.getNextPage(this, \''
+ archive + '\')" data-page="0">' + Label.moreLabel + '</div>'; + archive + '\')" data-page="0">' + Label.moreLabel + '</div>';
...@@ -153,12 +158,12 @@ var timeline = { ...@@ -153,12 +158,12 @@ var timeline = {
var $more = $(it), var $more = $(it),
currentPage = $more.data("page") + 1, currentPage = $more.data("page") + 1,
path = "/articles/"; path = "/articles/";
if(location.pathname.indexOf("tags") === 1) { if($("#tag").length === 1) {
var pathnames = location.pathname.split("/tags/"); var pathnames = location.pathname.split("/");
path = "/articles/tags/" + pathnames[1].split("/")[0] + "/"; path = "/articles/tags/" + pathnames[pathnames.length - 1] + "/";
} else if (location.pathname.indexOf("authors") === 1) { } else if ($("#author").length === 1) {
var pathnames = location.pathname.split("/authors/"); var pathnames = location.pathname.split("/");
path = "/articles/authors/" + pathnames[1].split("/")[0] + "/"; path = "/articles/authors/" + pathnames[pathnames.length - 1] + "/";
} else if (archive) { } else if (archive) {
path = "/articles/archives/" + archive + "/"; path = "/articles/archives/" + archive + "/";
} }
...@@ -174,6 +179,11 @@ var timeline = { ...@@ -174,6 +179,11 @@ var timeline = {
if (!result.sc) { if (!result.sc) {
return; return;
} }
if (result.rslts.articles.length === 0) {
$more.remove();
return;
}
var articlesHTML = "", var articlesHTML = "",
pagination = result.rslts.pagination; pagination = result.rslts.pagination;
...@@ -220,30 +230,33 @@ var timeline = { ...@@ -220,30 +230,33 @@ var timeline = {
+ '</a></span></div></article>'; + '</a></span></div></article>';
} }
var colHA = parseInt($(".article-more").prev().prev().css("top")) + $(".article-more").prev().prev().outerHeight(true), var colHA = 0,
colHB = parseInt($(".article-more").prev().css("top")) + $(".article-more").prev().outerHeight(true); colHB = 0,
colH = [colHA, colHB];
if (archive) { if (archive && $more.prev()[0].tagName.toLowerCase() === "h2") {
// 前面无 article // 前面无 article
if ($(".article-more").prev()[0].tagName.toLowerCase() === "h2") { colHA = timeline._COLHA + 60;
colHA = timeline._COLHA + 60; colHB = timeline._COLHB * 4;
colHB = timeline._COLHB * 4; colH = [colHA, colHB];
} } else if (archive && $more.prev()[0].tagName.toLowerCase() === "article"
&& $more.prev().prev()[0].tagName.toLowerCase() === "h2") {
// 前面只有1篇文章 // 前面只有1篇文章
if ($(".article-more").prev()[0].tagName.toLowerCase() === "article" colHA = parseInt($more.prev().css("top")) + $more.prev().outerHeight(true);
&& $(".article-more").prev().prev()[0].tagName.toLowerCase() === "h2") { colHB = timeline._COLHB * 4;
colHA = parseInt($(".article-more").prev().css("top")) + $(".article-more").prev().outerHeight(true); colH = [colHA, colHB];
colHB = timeline._COLHB * 4; } else {
colHA = parseInt($more.prev().prev().css("top")) + $more.prev().prev().outerHeight(true);
colHB = parseInt($more.prev().css("top")) + $more.prev().outerHeight(true);
colH = [colHA, colHB];
if ($more.prev().prev().hasClass("r")) {
colH = [colHB, colHA];
} }
} }
var colH = [colHA, colHB];
$more.before(articlesHTML).data("page", currentPage); $more.before(articlesHTML).data("page", currentPage);
// 最后一页处理 // 最后一页处理
if (pagination.paginationPageCount === currentPage) { if (pagination.paginationPageCount <= currentPage) {
$more.remove(); $more.remove();
} else { } else {
$more.css("background", "none #60829F").text(Label.moreLabel); $more.css("background", "none #60829F").text(Label.moreLabel);
......
/* /*
* 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>
* * @version 1.0.0.1, Jan 14, 2013
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> */var timeline={_COLHA:0,_COLHB:20,_initArticleList:function(){var e=$(".articles");if(e.length===0||$(".articles > .fn-clear").length>0)return;$(window).resize(function(){var t=[timeline._COLHA,timeline._COLHB];e.find("article").each(function(){var e=$(this),n=t[1]>t[0],r=n?t[0]:t[1];e.css({top:r+"px",position:"absolute"}),n?this.className="l":this.className="r",t[n?"0":"1"]+=parseInt(e.outerHeight(!0))}),e.height(t[0]>t[1]?t[0]:t[1])}),$(window).resize()},_initIndexList:function(){var e=$(".articles > .fn-clear");if(e.length===0)return;var t=0;$(".nav-abs li").each(function(e){var n=$(this);n.hide(),t!==n.data("year")&&(t=n.data("year"),n.before("<li class='year' onclick='timeline.toggleArchives("+t+")'>"+t+"</div></li>"))}),$(window).resize(function(){e.each(function(){var e=[timeline._COLHA+60,timeline._COLHB*4],t=$(this).find("article");t.length===0?($(this).find("h2").remove(),$(this).css("margin-bottom",0)):(t.each(function(){var t=$(this),n=e[1]>e[0],r=n?e[0]:e[1];t.css({top:r+"px",position:"absolute"}),n?this.className="l":this.className="r",e[n?"0":"1"]+=parseInt(t.outerHeight(!0))}),$(this).height(e[0]>e[1]?e[0]:e[1]))})}),$(window).resize()},_setNavCurrent:function(){$(".header li a").each(function(){$(this).attr("href")===location.href.split("#")[0]?this.className="current":this.className=""})},init:function(){$(window).scroll(function(){$(window).scrollTop()>60?$(".ico-top").show():$(".ico-top").hide()}),timeline._initIndexList(),timeline._initArticleList(),timeline._setNavCurrent()},translate:function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},getArchive:function(e,t,n){var r=e+t,i=e+"/"+t;if($("#"+r+" > article").length>0)window.location.hash="#"+r;else{var s=e+" "+Label.yearLabel+" "+t+" "+Label.monthLabel;Label.localeString.substring(0,2)==="en"&&(s=n+" "+e);var o='<h2><span class="article-archive">'+s+"</span></h2>"+'<div class="article-more" onclick="timeline.getNextPage(this, \''+i+'\')" data-page="0">'+Label.moreLabel+"</div>";$("#"+r).html(o).css("margin-bottom","50px"),timeline.getNextPage($("#"+r).find(".article-more")[0],i)}},getNextPage:function(e,t){var n=$(e),r=n.data("page")+1,i="/articles/";if($("#tag").length===1){var s=location.pathname.split("/");i="/articles/tags/"+s[s.length-1]+"/"}else if($("#author").length===1){var s=location.pathname.split("/");i="/articles/authors/"+s[s.length-1]+"/"}else t&&(i="/articles/archives/"+t+"/");$.ajax({url:latkeConfig.servePath+i+r,type:"GET",beforeSend:function(){n.css("background","url("+latkeConfig.staticServePath+"/skins/timeline/images/ajax-loader.gif) no-repeat scroll center center #60829F").text("")},success:function(e,i){if(!e.sc)return;if(e.rslts.articles.length===0){n.remove();return}var s="",o=e.rslts.pagination;for(var u=0;u<e.rslts.articles.length;u++){var a=e.rslts.articles[u];s+='<article><div class="module"><div class="dot"></div><div class="arrow"></div><time class="article-time"><span>'+Util.toDate(a.articleCreateTime,"yy-MM-dd HH:mm")+'</span></time><h3 class="article-title"><a rel="bookmark" href="'+latkeConfig.servePath+a.articlePermalink+'">'+a.articleTitle+"</a>",a.hasUpdated&&(s+="<sup>"+Label.updatedLabel+"</sup>"),a.articlePutTop&&(s+="<sup>"+Label.topArticleLabel+"</sup>"),s+="</h3><p>"+a.articleAbstract+"</p>"+'<span class="ico-tags ico" title="'+Label.tagLabel+'">';var f=a.articleTags.split(",");for(var l=0;l<f.length;l++)s+='<a rel="category tag" href="'+latkeConfig.servePath+"/tags/"+encodeURIComponent(f[l])+'">'+f[l]+"</a>",l<f.length-1&&(s+=",");s+='</span>&nbsp;<span class="ico-author ico" title="'+Label.authorLabel+'">'+'<a rel="author" href="'+latkeConfig.servePath+"/authors/"+a.authorId+'">'+a.authorName+'</a></span>&nbsp;<span class="ico-comment ico" title="'+Label.commentLabel+'"><a rel="nofollow" href="'+latkeConfig.servePath+a.articlePermalink+'#comments">'+(a.articleCommentCount===0?Label.noCommentLabel:a.articleCommentCount)+'</a></span>&nbsp;<span class="ico-view ico" title="'+Label.viewLabel+'">'+'<a rel="nofollow" href="${servePath}${article.articlePermalink}">'+a.articleViewCount+"</a></span></div></article>"}var c=0,h=0,p=[c,h];t&&n.prev()[0].tagName.toLowerCase()==="h2"?(c=timeline._COLHA+60,h=timeline._COLHB*4,p=[c,h]):t&&n.prev()[0].tagName.toLowerCase()==="article"&&n.prev().prev()[0].tagName.toLowerCase()==="h2"?(c=parseInt(n.prev().css("top"))+n.prev().outerHeight(!0),h=timeline._COLHB*4,p=[c,h]):(c=parseInt(n.prev().prev().css("top"))+n.prev().prev().outerHeight(!0),h=parseInt(n.prev().css("top"))+n.prev().outerHeight(!0),p=[c,h],n.prev().prev().hasClass("r")&&(p=[h,c])),n.before(s).data("page",r),o.paginationPageCount<=r?n.remove():n.css("background","none #60829F").text(Label.moreLabel),$((t?"#"+t.replace("/",""):".articles")+" article").each(function(){if(this.className!=="r"&&this.className!=="l"){var e=$(this),t=p[1]>p[0],n=t?p[0]:p[1];e.css({top:n+"px",position:"absolute"}),t?this.className="l":this.className="r",p[t?"0":"1"]+=parseInt(e.outerHeight(!0))}}),$(t?"#"+t.replace("/",""):".articles").height(p[0]>p[1]?p[0]:p[1])}})},toggleArchives:function(e){$(".nav-abs li").each(function(t){var n=$(this);this.className!=="year"&&(n.hide(),e===n.data("year")&&n.show())})}};(function(){Util.init(),Util.replaceSideEm($(".recent-comments-content")),Util.buildTags("tagsSide"),timeline.init()})();
* @version 1.0.0.1, Jan 14, 2013 \ No newline at end of file
*/
var timeline = {
_COLHA: 0,
_COLHB: 20,
_initArticleList: function () {
var $articles = $(".articles");
if ($articles.length === 0 || $(".articles > .fn-clear").length > 0) {
return;
}
$(window).resize(function () {
var colH = [timeline._COLHA, timeline._COLHB];
$articles.find("article").each(function () {
var $it = $(this),
isLeft = colH[1] > colH[0],
top = isLeft ? colH[0] : colH[1];
$it.css({
"top": top + "px",
"position": "absolute"
});
if (isLeft) {
this.className = "l";
} else {
this.className = "r";
}
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
});
$articles.height(colH[0] > colH[1] ? colH[0] : colH[1]);
});
$(window).resize();
},
_initIndexList: function () {
var $archives = $(".articles > .fn-clear");
if ($archives.length === 0) {
return;
}
// 如果为 index 页面,重构 archives 结构,使其可收缩
var year = 0;
$(".nav-abs li").each(function (i) {
var $this = $(this);
$this.hide();
if (year !== $this.data("year")) {
year = $this.data("year");
$this.before("<li class='year' onclick='timeline.toggleArchives(" +
year + ")'>" + year + "</div></li>");
}
});
$(window).resize(function () {
$archives.each(function () {
var colH = [timeline._COLHA + 60, timeline._COLHB * 4];
var $articles = $(this).find("article");
if ($articles.length === 0) {
$(this).find("h2").remove();
$(this).css("margin-bottom" , 0);
} else {
$articles.each(function () {
var $it = $(this),
isLeft = colH[1] > colH[0],
top = isLeft ? colH[0] : colH[1];
$it.css({
"top": top + "px",
"position": "absolute"
});
if (isLeft) {
this.className = "l";
} else {
this.className = "r";
}
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
});
$(this).height(colH[0] > colH[1] ? colH[0] : colH[1]);
}
});
});
$(window).resize();
},
_setNavCurrent: function () {
$(".header li a").each(function () {
if($(this).attr("href") === location.href.split("#")[0]) {
this.className = "current";
} else {
this.className = "";
}
})
},
init: function () {
$(window).scroll(function () {
if ($(window).scrollTop() > 60) {
$(".ico-top").show();
} else {
$(".ico-top").hide();
}
});
timeline._initIndexList();
timeline._initArticleList();
timeline._setNavCurrent();
},
translate: function () {
window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href);
},
getArchive: function (archive) {
var archiveDate = archive.replace("/", "");
if ($("#" + archiveDate + " > article").length > 0) {
window.location.hash = "#" + archiveDate;
} else {
var archiveHTML = '<h2><span class="article-archive">' + archiveDate + '</span></h2>'
+ '<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);
}
},
getNextPage: function (it, archive) {
var $more = $(it),
currentPage = $more.data("page") + 1,
path = "/articles/";
if(location.pathname.indexOf("tags") === 1) {
var pathnames = location.pathname.split("/tags/");
path = "/articles/tags/" + pathnames[1].split("/")[0] + "/";
} else if (location.pathname.indexOf("authors") === 1) {
var pathnames = location.pathname.split("/authors/");
path = "/articles/authors/" + pathnames[1].split("/")[0] + "/";
} else if (archive) {
path = "/articles/archives/" + archive + "/";
}
$.ajax({
url: latkeConfig.servePath + path + currentPage,
type: "GET",
beforeSend: function () {
$more.css("background",
"url(" + latkeConfig.staticServePath
+ "/skins/timeline/images/ajax-loader.gif) no-repeat scroll center center #60829F").text("");
},
success: function(result, textStatus){
if (!result.sc) {
return;
}
var articlesHTML = "",
pagination = result.rslts.pagination;
// append articles
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>'
+ Util.toDate(article.articleCreateTime, 'yy-MM-dd HH:mm')
+ '</span></time><h3 class="article-title"><a rel="bookmark" href="'
+ latkeConfig.servePath + article.articlePermalink + '">'
+article.articleTitle + '</a>';
if (article.hasUpdated) {
articlesHTML += '<sup>' + Label.updatedLabel + '</sup>';
}
if (article.articlePutTop) {
articlesHTML += '<sup>' + Label.topArticleLabel + '</sup>';
}
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++) {
articlesHTML += '<a rel="category tag" href="' + latkeConfig.servePath
+ '/tags/' + encodeURIComponent(articleTags[j]) + '">' + articleTags[j] + '</a>';
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 + '">'
+ article.authorName + '</a></span>&nbsp;<span class="ico-comment ico" title="'
+ Label.commentLabel + '"><a rel="nofollow" href="' + latkeConfig.servePath + article.articlePermalink
+ '#comments">' + (article.articleCommentCount === 0 ? Label.noCommentLabel : article.articleCommentCount)
+ '</a></span>&nbsp;<span class="ico-view ico" title="' + Label.viewLabel + '">'
+ '<a rel="nofollow" href="${servePath}${article.articlePermalink}">' + article.articleViewCount
+ '</a></span></div></article>';
}
var colHA = parseInt($(".article-more").prev().prev().css("top")) + $(".article-more").prev().prev().outerHeight(true),
colHB = parseInt($(".article-more").prev().css("top")) + $(".article-more").prev().outerHeight(true);
if (archive) {
// 前面无 article
if ($(".article-more").prev()[0].tagName.toLowerCase() === "h2") {
colHA = timeline._COLHA + 60;
colHB = timeline._COLHB * 4;
}
// 前面只有1篇文章
if ($(".article-more").prev()[0].tagName.toLowerCase() === "article"
&& $(".article-more").prev().prev()[0].tagName.toLowerCase() === "h2") {
colHA = parseInt($(".article-more").prev().css("top")) + $(".article-more").prev().outerHeight(true);
colHB = timeline._COLHB * 4;
}
}
var colH = [colHA, colHB];
$more.before(articlesHTML).data("page", currentPage);
// 最后一页处理
if (pagination.paginationPageCount === currentPage) {
$more.remove();
} else {
$more.css("background", "none #60829F").text(Label.moreLabel);
}
$((archive ? "#" + archive.replace("/", "") : ".articles") + " article").each(function () {
if (this.className !== "r" && this.className !== "l") {
var $it = $(this),
isLeft = colH[1] > colH[0],
top = isLeft ? colH[0] : colH[1];
$it.css({
"top": top + "px",
"position": "absolute"
});
if (isLeft) {
this.className = "l";
} else {
this.className = "r";
}
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
}
});
$(archive ? "#" + archive.replace("/", "") : ".articles").height(colH[0] > colH[1] ? colH[0] : colH[1]);
}
});
},
toggleArchives: function (year) {
$(".nav-abs li").each(function (i) {
var $it = $(this);
if (this.className !== "year") {
$it.hide();
if (year === $it.data("year")) {
$it.show();
}
}
});
}
};
(function () {
Util.init();
Util.replaceSideEm($(".recent-comments-content"));
Util.buildTags("tagsSide");
timeline.init();
})();
\ No newline at end of file
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<body> <body>
${topBarReplacement} ${topBarReplacement}
<#include "header.ftl"> <#include "header.ftl">
<h3 style="cursor: pointer" class="nav-abs" onclick="window.location.href='${servePath}/tag-articles-feed.do?oId=${tag.oId}'"> <h3 id="tag" style="cursor: pointer" class="nav-abs"
onclick="window.location.href='${servePath}/tag-articles-feed.do?oId=${tag.oId}'">
${tag.tagTitle} ${tag.tagTitle}
(${tag.tagPublishedRefCount}) (${tag.tagPublishedRefCount})
<img src="${staticServePath}/images/feed.png" alt="Atom"/> <img src="${staticServePath}/images/feed.png" alt="Atom"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment