Commit 7df58422 authored by Vanessa's avatar Vanessa

添加前端小工具,

parent 4f1927cd
var fs = require("fs"),
exec = require("child_process").exec;
// js compress
var jsPaths = ["ease"];
for (var i = 0; i < jsPaths.length; i++) {
var content = "";
exec("uglifyjs ../../skins/" + jsPaths[i] + "/js/" + jsPaths[i] + ".js > ../../skins/" + jsPaths[i] + "/js/" + jsPaths[i] + ".min.js", function (error, stdout, stderr) {
if (error !== null) {
console.log(error);
}
});
}
// css compress
var csses = ["ease", "ease-ie8"];
for (var i = 0; i < csses.length; i++) {
var content = "";
exec("lessc -compress ../../skins/ease/css/" + csses[i] + ".css > ../../skins/ease/css/" + csses[i] + ".min.css", function (error, stdout, stderr) {
if (error !== null) {
console.log(error);
}
});
}
\ No newline at end of file
var version = "",
newVersion = "";
process.argv.forEach(function (val, index, array) {
if (index === 2) {
version = val;
}
if (index === 3) {
newVersion = val;
}
});
var fs = require("fs");
var skins = ["ease", "mobile"];
for (var i = 0; i < skins.length; i++) {
var fileName = "../../skins/" + skins[i] + "/skin.properties";
var file = fs.readFileSync(fileName, "UTF-8");
fs.writeFileSync(fileName, file.replace("forSolo=" + version, "forSolo=" + newVersion), "UTF-8");
}
\ No newline at end of file
.nav{border-top:1px solid #e2e2e2;border-bottom:1px solid #e2e2e2;}
.article-next{border:1px solid #e2e2e2;border-top-color:#fefefe;}
.article-next:hover{background-color:#f2f2f2;border:1px solid #e2e2e2;}
#tags a,.archives > div,.dynamic .module,.form input[type=text],.form input[type=password],.form textarea,.article-relative{border:1px solid #f2f2f2;}
.article-relative{width:363px;}
.comment-body-ref,#tags a:hover,.archives>div:hover,.dynamic .module:hover,.form input:focus,.form textarea:focus,.article-relative:hover{border:1px solid #e2e2e2;}
\ No newline at end of file
.nav{border-top:1px solid #e2e2e2;border-bottom:1px solid #e2e2e2;}
.article-next{border:1px solid #e2e2e2;border-top-color:#fefefe;}
.article-next:hover{background-color:#f2f2f2;border:1px solid #e2e2e2;}
.comment-body-ref{border:1px solid #e2e2e2;}
#tags a,.archives>div,.dynamic .module,.form input[type="text"],.form input[type="password"],.form textarea,.article-relative{border:1px solid #f2f2f2;}
#tags a:hover,.archives>div:hover,.dynamic .module:hover,.form input:focus,.form textarea:focus,.article-relative:hover{border:1px solid #e2e2e2;}
.article-relative{width:363px;}
......@@ -17,7 +17,7 @@
* skin ease style
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.1.6, Jul 24, 2012
* @version 1.0.1.7, Jul 25, 2012
*/
/* start base */
html, body, div, ul, li {
......@@ -185,7 +185,7 @@ sup {
cursor: pointer;
float: right;
height: 16px;
margin: -3px 0 0 15px;;
margin: -3px 0 0 15px;
padding: 1px;
width: 16px;
}
......
html,body,div,ul,li{margin:0;padding:0;}
body{font-family:Verdana,arial,\5fae\8f6f\96c5\9ed1;font-size:12px;}
a{outline:none;color:#009EB8;text-decoration:none;}
a:visited{color:#00b4d2;}
a:hover{text-decoration:underline;}
a:active{color:#00889f;}
img{vertical-align:middle;border:0;}
textarea,input{outline:none;}
sup{font-size:10px;font-weight:normal;-webkit-text-size-adjust:none;}
.left{float:left;}
.right{float:right;}
.clear{background-color:transparent;border:0;clear:both;display:block;font-size:0;height:0;line-height:0;overflow:hidden;}
.none{display:none;}
.ft-gray{color:#808080;}
.ft-gray:visited{color:#9a9a9a;}
.ft-gray:hover{color:#676767;text-decoration:none;}
.fn-mgtb10{margin:10px 0;}
.logo{padding:0 5px;text-shadow:0 0 1px #D5D5D5;}
.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;}
#search,.translate-ico{background-image:url(/skins/ease/images/icons.png);}
.translate-ico{background-position:1px -125px;background-repeat:no-repeat;border:1px solid #D5D5D5;border-radius:3px;cursor:pointer;float:right;height:16px;margin:-3px 0 0 15px;padding:1px;width:16px;}
.translate-ico:hover{border-color:#9a9a9a;box-shadow:0 0 1px #808080;background-color:#FCFCFC;}
.wrapper{margin:0 auto;width:990px;}
.header{width:100%;background-color:#FCFCFC;z-index:1;}
.header .title{border-bottom:1px solid #808080;font-size:26px;font-weight:normal;}
.header .sub-title{font-size:11px;}
#search{background-position:7px -99px;background-repeat:no-repeat;background-color:#FFF;border:1px solid #D5D5D5;border-radius:2px 2px 2px 2px;box-shadow:0 1px 1px rgba(0,0,0,0.1) inset;color:#808080;float:right;font-size:14px;height:19px;line-height:145%;padding:4px 10px 4px 28px;width:24px;-moz-transition:width .4s ease, background .4s ease;-webkit-transition:width .4s ease, background .4s ease;transition:width .4s ease, background .4s ease;}
#search:focus{background-color:#FCFCFC;width:196px;}
.banner{margin-bottom:20px;}
.banner .notice{float:left;margin:20px 0 0 50px;}
.nav{background-color:#2C2C2C;box-shadow:0 2px 2px #D5D5D5, 0 3px 3px -3px #D5D5D5 inset;height:29px;top:0;width:100%;z-index:1;}
.nav ul{list-style:none;float:left;}
.nav li{float:left;}
.nav a{color:#C9C9C9;display:block;float:left;font-size:14px;font-weight:700;line-height:29px;margin-right:20px;padding:0 10px;text-decoration:none;transition:color .4s ease, background-color .8s ease;-webkit-transition:color .4s ease, background-color .8s ease;-moz-transition:color .4s ease, background-color .8s ease;}
.nav a:hover{color:#FFF;background-color:#535353;}
.nav a.current{background-color:#FFF;box-shadow:0 -1px 1px rgba(0,0,0,0.1) inset, 0 1px 1px rgba(0,0,0,0.1) inset;color:#808080;}
.nav img{margin-left:3px;}
.footer{background-color:#FCFCFC;border-top:2px solid #D5D5D5;font-size:11px;padding:12px 0;-webkit-text-size-adjust:none;margin-top:50px;}
#goTop{background:url(/skins/ease/images/icons.png) no-repeat scroll 5px -51px #D5D5D5;border-radius:2px 2px 0 0;cursor:pointer;font-size:11px;height:21px;line-height:21px;padding:0 10px 0 23px;position:absolute;right:50px;display:none;}
#goTop:hover{background-color:#D5D5D5;}
.wrapper > ul{list-style:none;}
.article{border-bottom:1px solid #f6f6f6;padding:30px 50px;}
.article:hover{border-bottom-color:#D5D5D5;box-shadow:0 0 1px #f6f6f6 inset;background-color:#FCFCFC;}
.article-body{line-height:145%;overflow:hidden;word-wrap:break-word;margin-bottom:10px;}
.article-body ol,.article-body ul{margin-left:40px;}
.article-body a{color:#808080;text-decoration:underline;}
.article-body a:vidited{color:#9a9a9a;}
.article-body a:hover{color:#676767;}
.article-body>div{min-height:32px;}
.article-title h2{display:inline;}
.article-title span{cursor:pointer;}
.article-next{background-color:#FCFCFC;box-shadow:0 0 3px #D5D5D5 inset;cursor:pointer;font-size:14px;line-height:36px;text-align:center;}
.article-next:hover{box-shadow:0 0 3px #D5D5D5, 0 0 3px #D5D5D5 inset;}
.article-relative{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;float:left;margin:10px 0;padding:0 20px 10px;width:385px;}
.article-relative:hover{background-color:#fff;box-shadow:0 0 4px #D5D5D5;}
.article-relative ul{list-style:none;}
#relevantArticles{margin-right:40px;}
#externalRelevantArticles{width:357px;margin-top:0;}
#comments{padding:20px 50px;position:relative;}
.comment-header{float:left;background-color:#FFF;border:1px solid #DEDEDE;padding:2px;height:60px;width:60px;}
.comment-panel{float:left;line-height:16px;margin:0 0 20px 10px;min-height:64px;overflow:hidden;width:814px;}
.comment-body-ref{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;display:block;left:127px;padding:10px;opacity:0.9;filter:alpha(opacity=90);position:absolute;}
.comment-body-ref > .comment-header{border:0 none;float:right;height:48px;width:48px;padding:0;}
.comment-body-ref > .comment-panel{margin:0 20px 0 0;min-height:48px;width:725px;}
.comment-body-ref > .comment-panel > .right{display:none;}
#replyForm{margin-left:25px;}
.form{padding:0 50px 20px;}
.wrapper > .form{float:left;}
.form th{text-align:right;white-space:nowrap;}
.form input[type=text],.form input[type=password],.form textarea{background-color:#FCFCFC;border-width:0;box-shadow:0 0 2px #BCBCBC;font-family:Verdana,arial,\5fae\8f6f\96c5\9ed1;font-size:12px;margin:0 5px 10px 0;outline:medium none;padding:0 3px;height:28px;line-height:28px;width:260px;}
.form input:focus,.form textarea:focus{box-shadow:0 0 4px #D5D5D5;}
.form textarea{height:120px;overflow:auto;width:426px;line-height:16px;}
.form button{background-color:#F6F6F6;border:0 none;box-shadow:0 0 2px #D5D5D5;height:28px;line-height:28px;padding:0 12px;color:#808080;}
.form button:hover{box-shadow:0 0 4px #D5D5D5;text-shadow:0 0 2px;}
.form img{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;cursor:pointer;height:24px;padding:1px;}
#tags.other-main{margin:47px 44px 0;width:902px;}
#tags li{float:left;height:38px;}
#tags a{margin:3px 6px;padding:3px 12px;background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;float:left;}
#tags a:hover{text-shadow:0 0 2px;text-decoration:none;box-shadow:0 0 4px #D5D5D5;}
.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;}
.archives{position:relative;}
.archives > div{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;padding-bottom:20px;line-height:20px;margin:20px;width:270px;position:absolute;top:0;}
.archives h3{text-align:center;}
.archives > div:hover{box-shadow:0 0 4px #D5D5D5;}
.archives a{display:block;margin-left:77px;}
.dynamic ul{list-style:none;}
.dynamic h3{text-align:center;}
.dynamic .module{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;float:left;line-height:20px;margin:20px;padding:10px 20px 20px;width:385px;}
.dynamic .module:hover{box-shadow:0 0 4px #D5D5D5;}
.dynamic .side-comments{width:600px;}
.dynamic .side-comments .comment-panel{width:510px;}
.dynamic .side-tags{width:170px;}
.dynamic .side-tags li{float:left;margin:0 5px;}
.dynamic .side-most-comment,.dynamic .side-most-view{margin-bottom:0;}
.other-main.links{margin-top:45px;}
.links li{float:left;line-height:22px;margin:0 20px;width:270px;}
.other-main{display:inline-block;margin:30px 30px 0;width:930px;}
\ No newline at end of file
html,body,div,ul,li{margin:0;padding:0;}
body{font-family:Verdana,arial,\5fae\8f6f\96c5\9ed1;font-size:12px;}
a{outline:none;color:#009EB8;text-decoration:none;}
a:visited{color:#00b4d2;}
a:hover{text-decoration:underline;}
a:active{color:#00889f;}
img{vertical-align:middle;border:0;}
textarea,input{outline:none;}
sup{font-size:10px;font-weight:normal;-webkit-text-size-adjust:none;}
.left{float:left;}
.right{float:right;}
.clear{background-color:transparent;border:0;clear:both;display:block;font-size:0;height:0;line-height:0;overflow:hidden;}
.none{display:none;}
.ft-gray{color:#808080;}
.ft-gray:visited{color:#9a9a9a;}
.ft-gray:hover{color:#676767;text-decoration:none;}
.fn-mgtb10{margin:10px 0;}
.logo{padding:0 5px;text-shadow:0 0 1px #D5D5D5;}
.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);}
.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;}
#search,.translate-ico{background-image:url("/skins/ease/images/icons.png");}
.translate-ico{background-position:1px -125px;background-repeat:no-repeat;border:1px solid #D5D5D5;border-radius:3px;cursor:pointer;float:right;height:16px;margin:-3px 0 0 15px;padding:1px;width:16px;}
.translate-ico:hover{border-color:#9a9a9a;box-shadow:0 0 1px #808080;background-color:#FCFCFC;}
.wrapper{margin:0 auto;width:990px;}
.header{width:100%;background-color:#FCFCFC;z-index:1;}
.header .title{border-bottom:1px solid #808080;font-size:26px;font-weight:normal;}
.header .sub-title{font-size:11px;}
#search{background-position:7px -99px;background-repeat:no-repeat;background-color:#FFF;border:1px solid #D5D5D5;border-radius:2px 2px 2px 2px;box-shadow:0 1px 1px rgba(0, 0, 0, 0.1) inset;color:#808080;float:right;font-size:14px;height:19px;line-height:145%;padding:4px 10px 4px 28px;width:24px;-moz-transition:width 0.4s ease, background 0.4s ease;-webkit-transition:width 0.4s ease, background 0.4s ease;transition:width 0.4s ease, background 0.4s ease;}
#search:focus{background-color:#FCFCFC;width:196px;}
.banner{margin-bottom:20px;}
.banner .notice{float:left;margin:20px 0 0 50px;}
.nav{background-color:#2C2C2C;box-shadow:0 2px 2px #d5d5d5,0 3px 3px -3px #d5d5d5 inset;height:29px;top:0;width:100%;z-index:1;}
.nav ul{list-style:none;float:left;}
.nav li{float:left;}
.nav a{color:#C9C9C9;display:block;float:left;font-size:14px;font-weight:700;line-height:29px;margin-right:20px;padding:0 10px;text-decoration:none;transition:color 0.4s ease,background-color 0.8s ease;-webkit-transition:color 0.4s ease,background-color 0.8s ease;-moz-transition:color 0.4s ease,background-color 0.8s ease;}
.nav a:hover{color:#FFF;background-color:#535353;}
.nav a.current{background-color:#FFF;box-shadow:0 -1px 1px rgba(0, 0, 0, 0.1) inset,0 1px 1px rgba(0, 0, 0, 0.1) inset;color:#808080;}
.nav img{margin-left:3px;}
.footer{background-color:#FCFCFC;border-top:2px solid #D5D5D5;font-size:11px;padding:12px 0;-webkit-text-size-adjust:none;margin-top:50px;}
#goTop{background:url("/skins/ease/images/icons.png") no-repeat scroll 5px -51px #d5d5d5;border-radius:2px 2px 0 0;cursor:pointer;font-size:11px;height:21px;line-height:21px;padding:0 10px 0 23px;position:absolute;right:50px;display:none;}
#goTop:hover{background-color:#D5D5D5;}
.wrapper>ul{list-style:none;}
.article{border-bottom:1px solid #f6f6f6;padding:30px 50px;}
.article:hover{border-bottom-color:#D5D5D5;box-shadow:0 0 1px #f6f6f6 inset;background-color:#FCFCFC;}
.article-body{line-height:145%;overflow:hidden;word-wrap:break-word;margin-bottom:10px;}
.article-body ol,.article-body ul{margin-left:40px;}
.article-body a{color:#808080;text-decoration:underline;}
.article-body a:vidited{color:#9a9a9a;}
.article-body a:hover{color:#676767;}
.article-body>div{min-height:32px;}
.article-title h2{display:inline;}
.article-title span{cursor:pointer;}
.article-next{background-color:#FCFCFC;box-shadow:0 0 3px #D5D5D5 inset;cursor:pointer;font-size:14px;line-height:36px;text-align:center;}
.article-next:hover{box-shadow:0 0 3px #D5D5D5, 0 0 3px #D5D5D5 inset;}
.article-relative{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;float:left;margin:10px 0;padding:0 20px 10px;width:385px;}
.article-relative:hover{background-color:#fff;box-shadow:0 0 4px #D5D5D5;}
.article-relative ul{list-style:none;}
#relevantArticles{margin-right:40px;}
#externalRelevantArticles{width:357px;margin-top:0;}
#comments{padding:20px 50px;position:relative;}
.comment-header{float:left;background-color:#FFF;border:1px solid #DEDEDE;padding:2px;height:60px;width:60px;}
.comment-panel{float:left;line-height:16px;margin:0 0 20px 10px;min-height:64px;overflow:hidden;width:814px;}
.comment-body-ref{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;display:block;left:127px;padding:10px;opacity:0.9;filter:alpha(opacity=90);position:absolute;}
.comment-body-ref>.comment-header{border:0 none;float:right;height:48px;width:48px;padding:0;}
.comment-body-ref>.comment-panel{margin:0 20px 0 0;min-height:48px;width:725px;}
.comment-body-ref>.comment-panel>.right{display:none;}
#replyForm{margin-left:25px;}
.form{padding:0 50px 20px;}
.wrapper>.form{float:left;}
.form th{text-align:right;white-space:nowrap;}
.form input[type="text"],.form input[type="password"],.form textarea{background-color:#FCFCFC;border-width:0;box-shadow:0 0 2px #BCBCBC;font-family:Verdana,arial,\5fae\8f6f\96c5\9ed1;font-size:12px;margin:0 5px 10px 0;outline:medium none;padding:0 3px;height:28px;line-height:28px;width:260px;}
.form input:focus,.form textarea:focus{box-shadow:0 0 4px #D5D5D5;}
.form textarea{height:120px;overflow:auto;width:426px;line-height:16px;}
.form button{background-color:#F6F6F6;border:0 none;box-shadow:0 0 2px #D5D5D5;height:28px;line-height:28px;padding:0 12px;color:#808080;}
.form button:hover{box-shadow:0 0 4px #D5D5D5;text-shadow:0 0 2px;}
.form img{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;cursor:pointer;height:24px;padding:1px;}
#tags.other-main{margin:47px 44px 0;width:902px;}
#tags li{float:left;height:38px;}
#tags a{margin:3px 6px;padding:3px 12px;background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;float:left;}
#tags a:hover{text-shadow:0 0 2px;text-decoration:none;box-shadow:0 0 4px #D5D5D5;}
.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;}
.archives{position:relative;}
.archives>div{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;padding-bottom:20px;line-height:20px;margin:20px;width:270px;position:absolute;top:0;}
.archives h3{text-align:center;}
.archives>div:hover{box-shadow:0 0 4px #D5D5D5;}
.archives a{display:block;margin-left:77px;}
.dynamic ul{list-style:none;}
.dynamic h3{text-align:center;}
.dynamic .module{background-color:#FCFCFC;box-shadow:0 0 2px #D5D5D5;float:left;line-height:20px;margin:20px;padding:10px 20px 20px;width:385px;}
.dynamic .module:hover{box-shadow:0 0 4px #D5D5D5;}
.dynamic .side-comments{width:600px;}
.dynamic .side-comments .comment-panel{width:510px;}
.dynamic .side-tags{width:170px;}
.dynamic .side-tags li{float:left;margin:0 5px;}
.dynamic .side-most-comment,.dynamic .side-most-view{margin-bottom:0;}
.other-main.links{margin-top:45px;}
.links li{float:left;line-height:22px;margin:0 20px;width:270px;}
.other-main{display:inline-block;margin:30px 30px 0;width:930px;}
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 tagsPathnaem=location.pathname.split("/tags/");var tags=tagsPathnaem[1].split("/");path="/articles/tags/"+tags[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]+"/"}$.ajax({url:latkeConfig.staticServePath+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];articlesHTML+='<li class="article">'+'<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.articleUpdateDate,'yy-MM-dd HH:mm')}else{articlesHTML+=Util.toDate(article.articleCreateDate,'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>'}$("body>.wrapper>ul").append(articlesHTML);if(pagination.paginationPageCount===currentPage){$more.remove()}else{$more.css("background","none")}}})};var ease={$header:$(".header"),headerH:$(".header").height(),$body:$("body > .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();if(y>=_it.headerH+$("#top").height()){_it.$nav.css("position","fixed");_it.$body.css("marginTop","58px")}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())})}};(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 <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.1.2, Jul 24, 2012
*/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(location.pathname.indexOf("tags")>-1){var n=location.pathname.split("/tags/"),r=n[1].split("/");t="/articles/tags/"+r[0]+"/"}else if(location.pathname.indexOf("archives")>-1){var i=location.pathname.split("/archives/"),s=i[1].split("/");t="/articles/archives/"+s[0]+"/"+s[1]+"/"}$.ajax({url:latkeConfig.staticServePath+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];r+='<li class="article"><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.articleUpdateDate,"yy-MM-dd HH:mm"):r+=Util.toDate(o.articleCreateDate,"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 u=o.articleTags.split(",");for(var a=0;a<u.length;a++)r+='<a rel="tag" href="'+latkeConfig.servePath+"/tags/"+encodeURIComponent(u[a])+'">'+u[a]+"</a>",a<u.length-1&&(r+=", ");r+='</div><div class="clear"></div></li>'}$("body>.wrapper>ul").append(r),i.paginationPageCount===currentPage?e.remove():e.css("background","none")}})},ease={$header:$(".header"),headerH:$(".header").height(),$body:$("body > .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();t>=e.headerH+$("#top").height()?(e.$nav.css("position","fixed"),e.$body.css("marginTop","58px")):(e.$nav.css("position","inherit"),e.$body.css("marginTop","0"));if(t>e.headerH){var n=$(window).height(),r=t+n-21;$("body").height()-58<=t+n&&(r=$(".footer").offset().top-21),$("#goTop").fadeIn("slow").css("top",r)}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())})}};(function(){ease.getCurrentPage(),ease.initCommon(),ease.scrollEvent(),ease.setNavCurrent(),ease.initArchives(),ease.setDynamic()})();
\ No newline at end of file
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