From c98167fe3246166e43b59e51ef9809dc47176fa5 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 26 Apr 2013 14:09:31 +0800 Subject: [PATCH] compress --- community/css/community.min.css | 4 ++-- ease/js/ease.min.js | 21 ++++++++++++++++++++- ease/macro-head.ftl | 2 +- ease/skin.properties | 2 +- neoease/js/neoease.min.js | 21 ++++++++++++++++++++- 5 files changed, 44 insertions(+), 6 deletions(-) diff --git a/community/css/community.min.css b/community/css/community.min.css index 34ad079..0df4a13 100644 --- a/community/css/community.min.css +++ b/community/css/community.min.css @@ -7,8 +7,8 @@ a:hover{text-decoration:underline;} .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;} .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']: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']{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');} .marginBottom40{margin-bottom:40px;} .header-user{background-color:#DEDEDE;padding-top:1px;} .header-navi{background:url("../images/icon.png") 0px -130px repeat-x #333333;margin-bottom:50px;} diff --git a/ease/js/ease.min.js b/ease/js/ease.min.js index 60ae32a..3ccd9d9 100644 --- a/ease/js/ease.min.js +++ b/ease/js/ease.min.js @@ -1 +1,20 @@ -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($("#tag").length===1){var pathnames=location.pathname.split("/");path="/articles/tags/"+pathnames[pathnames.length-1]+"/"}else if($("#archive").length===1){var pathnames=location.pathname.split("/");path="/articles/archives/"+pathnames[pathnames.length-2]+"/"+pathnames[pathnames.length-1]+"/"}else if($("#author").length===1){var pathnames=location.pathname.split("/");path="/articles/authors/"+pathnames[pathnames.length-1]+"/"}$.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'+'
'+"

"+''+article.articleTitle+"";if(article.hasUpdated){articlesHTML+=""+Label.updatedLabel+""}if(article.articlePutTop){articlesHTML+=""+Label.topArticleLabel+""}articlesHTML+="

"+'"+'
'+"
"+'
'+'
'+article.articleAbstract+"
"+'
'+"
"+'
';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+=' '+article.authorName+""+"
"+'
'+Label.tag1Label+" ";var articleTags=article.articleTags.split(",");for(var j=0;j
'+""}$(".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[j]+"

"+monthsHTML+""}$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 +/* + * 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 ease js. + * + * @author Liyuan Li + * @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'+'
'+"

"+''+o.articleTitle+"",o.hasUpdated&&(r+=""+Label.updatedLabel+""),o.articlePutTop&&(r+=""+Label.topArticleLabel+""),r+='

"+'
'+"
"+'
'+'
'+o.articleAbstract+"
"+'
'+"
"+'
',o.hasUpdated?r+=Util.toDate(o.articleUpdateTime,"yy-MM-dd HH:mm"):r+=Util.toDate(o.articleCreateTime,"yy-MM-dd HH:mm"),r+=' '+o.authorName+""+"
"+'
'+Label.tag1Label+" ";var a=o.articleTags.split(",");for(var f=0;f
"}e.html(r);var a=$(".archives>div"),f=0,l=0,c=[];for(var h=0;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()})(); \ No newline at end of file diff --git a/ease/macro-head.ftl b/ease/macro-head.ftl index accb52e..59e1297 100644 --- a/ease/macro-head.ftl +++ b/ease/macro-head.ftl @@ -4,9 +4,9 @@ <#nested> + - diff --git a/ease/skin.properties b/ease/skin.properties index aaec19b..3d999bc 100644 --- a/ease/skin.properties +++ b/ease/skin.properties @@ -23,5 +23,5 @@ name=ease version=1.0.4 -forSolo=0.6.0 +forSolo=0.5.6 memo=\u56de\u5f52\u606c\u9759 diff --git a/neoease/js/neoease.min.js b/neoease/js/neoease.min.js index 0775676..a2252f5 100644 --- a/neoease/js/neoease.min.js +++ b/neoease/js/neoease.min.js @@ -1 +1,20 @@ -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("
  • "+year+" 年
  • ")}});$(".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"})}})})(); \ No newline at end of file +/* + * 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 Liyuan Li + * @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("
  • "+t+" 年
  • "))}),$(".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"})})})(); \ No newline at end of file