Commit e6ff7899 authored by Liang Ding's avatar Liang Ding

解决冲突

parent c79fbf5d
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
<li><a href="https://github.com/b3log/b3log-solo/issues/23">23 偏好设定关键参数校验</a></li> <li><a href="https://github.com/b3log/b3log-solo/issues/23">23 偏好设定关键参数校验</a></li>
<li><a href="https://github.com/b3log/b3log-solo/issues/27">27 自定义导航后台链接问题</a></li> <li><a href="https://github.com/b3log/b3log-solo/issues/27">27 自定义导航后台链接问题</a></li>
<li><a href="https://github.com/b3log/b3log-solo/issues/32">32 升级 FreeMarker 到 2.3.19</a></li> <li><a href="https://github.com/b3log/b3log-solo/issues/32">32 升级 FreeMarker 到 2.3.19</a></li>
<li><a href="https://github.com/b3log/b3log-solo/issues/34">34 升级 GAE SDK 到 1.7.0</a></li>
<li><a href="https://github.com/b3log/b3log-solo/issues/36">36 加入博客关键信息获取接口</a></li>
</ul> </ul>
<h2>Release 0.4.5 - Jun 1, 2012</h2> <h2>Release 0.4.5 - Jun 1, 2012</h2>
<ul> <ul>
......
...@@ -102,7 +102,6 @@ public final class TagQueryService { ...@@ -102,7 +102,6 @@ public final class TagQueryService {
} }
/** /**
>>>>>>> origin/0.4.6
* Gets all tags. * Gets all tags.
* *
* @return for example, * @return for example,
......
...@@ -131,7 +131,7 @@ public final class Articles { ...@@ -131,7 +131,7 @@ public final class Articles {
return true; return true;
} }
/* /**
* Gets time of the recent updated article. * Gets time of the recent updated article.
* *
* @return time of the recent updated article, returns {@code 0} if not found * @return time of the recent updated article, returns {@code 0} if not found
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<<<<<<< HEAD /*
<<<<<<< HEAD * Copyright (c) 2009, 2010, 2011, 2012, B3log Team
/** *
* admin style * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * You may obtain a copy of the License at
* @version 1.0.3.7, May 23, 2012 *
*/ * http://www.apache.org/licenses/LICENSE-2.0
*
/* start resset */ * Unless required by applicable law or agreed to in writing, software
body, input, textarea { * distributed under the License is distributed on an "AS IS" BASIS,
font-family: sans-serif,\5fae\8f6f\96c5\9ed1; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
} * See the License for the specific language governing permissions and
html, body { * limitations under the License.
height: 100%; */
min-width: 1024px;
background-color: #FAFAFA; /**
} * admin style
a:link { *
color: #21759B; * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
} * @version 1.0.3.9, Jun 26, 2012
a:visited { */
color: #551A8B;
} /* start resset */
a:active { body, input, textarea {
color: #D54121; font-family: sans-serif,\5fae\8f6f\96c5\9ed1;
} }
a:hover { html, body {
color: #D54121; height: 100%;
} min-width: 1024px;
background-color: #FAFAFA;
button.selected { }
background: url("../images/bowknot/completed.png") no-repeat scroll right bottom transparent; a:link {
color: #D54121; color: #21759B;
} }
/* end reset */ a:visited {
color: #551A8B;
/* start ico */ }
.ico-arrow-down, .ico-arrow-up { a:active {
background: url("../images/arrows.png") repeat scroll 0 4px transparent; color: #D54121;
float: right; }
height: 20px; a:hover {
margin: 2px 3px 0 0; color: #D54121;
width: 18px; }
}
.ico-arrow-up { button.selected {
background-position: 0 -30px; background: url("../images/bowknot/completed.png") no-repeat scroll right bottom transparent;
} color: #D54121;
.aboutIcon { }
background-position: -16px -48px; /* end reset */
}
/* end ico */ /* start ico */
.ico-arrow-down, .ico-arrow-up {
/* start frame */ background: url("../images/arrows.png") repeat scroll 0 4px transparent;
#allPanel { float: right;
height: auto; height: 20px;
min-height: 100%; margin: 2px 3px 0 0;
position: relative; width: 18px;
} }
#tabsPanel { .ico-arrow-up {
margin: 30px 0 0 162px; background-position: 0 -30px;
padding: 0 12px; }
} .aboutIcon {
background-position: -16px -48px;
#tabsPanel>div { }
padding-bottom: 36px; /* end ico */
}
#tipMsg, #loadMsg { /* start frame */
background-color: #E5E7EB; #allPanel {
border-radius: 3px; height: auto;
font-weight: bold; min-height: 100%;
left: 48%; position: relative;
margin: 0 auto; }
overflow: hidden; #tabsPanel {
padding: 2px 0; margin: 30px 0 0 162px;
position: fixed; padding: 0 12px;
text-align: center; }
top: 3px;
z-index: 2; #tabsPanel>div {
} padding-bottom: 36px;
#tipMsg { }
top: 33px;
} .tip {
.footer { font-weight: bold;
bottom: 12px; margin: 0 auto;
position: absolute; overflow: hidden;
text-align: center; padding: 2px 0;
width: 100%; position: fixed;
} text-align: center;
/* end frame */ top: 5px;
width: 100%;
/* start top-nav */ z-index: 2;
#top { }
background-image: linear-gradient(top,#666666,#7F7F7F);
background-image: -moz-linear-gradient(top,#666666,#7F7F7F); .tip-msg {
background-image: -ms-linear-gradient(top,#666666,#7F7F7F); top: 33px;
background-image: -o-linear-gradient(top,#666666,#7F7F7F); }
background-image: -webkit-gradient(linear,left top,left bottom,from(#666666),to(#7F7F7F));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#7F7F7F'); #tipMsg, #loadMsg {
} background-color: #E5E7EB;
border-radius: 3px;
#top a, #top span span { padding: 2px 0;
float: left; }
line-height: 18px;
margin: 6px 0; .footer {
padding: 0 6px; bottom: 12px;
text-decoration: none; position: absolute;
text-shadow: 0 -1px 0 #FFFFFF; text-align: center;
font-weight: normal; width: 100%;
border-right: 1px solid #686868; }
color: #CCCCCC; /* end frame */
text-shadow: 0 -1px 0 #555555;
} /* start top-nav */
#top>a { #top {
color: #FFFFFF; background-image: linear-gradient(top,#666666,#7F7F7F);
} background-image: -moz-linear-gradient(top,#666666,#7F7F7F);
background-image: -ms-linear-gradient(top,#666666,#7F7F7F);
#top a:hover, #top a.hover { background-image: -o-linear-gradient(top,#666666,#7F7F7F);
border-radius: 0 13px 13px 0; background-image: -webkit-gradient(linear,left top,left bottom,from(#666666),to(#7F7F7F));
margin: 0px; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#7F7F7F');
line-height: 30px; }
background-color: #4C4C4C;
border-left-color: #707070; #top a, #top span span {
} float: left;
/* end top-nav */ line-height: 18px;
margin: 6px 0;
/* start first tab */ padding: 0 6px;
#tabs { text-decoration: none;
background-color: #ECECEC; text-shadow: 0 -1px 0 #FFFFFF;
border-radius: 0 5px 5px 0; font-weight: normal;
border-right: 1px solid #CCC; border-right: 1px solid #686868;
border-top: 1px solid #DDD; color: #CCCCCC;
bottom: 0; text-shadow: 0 -1px 0 #555555;
box-shadow: 6px 0 6px #ECECEC; }
min-height: 468px; #top>a {
padding: 15px 0; color: #FFFFFF;
position: absolute; }
top: 58px;
width: 145px; #top a:hover, #top a.hover {
} border-radius: 0 13px 13px 0;
margin: 0px;
#tabs ul { line-height: 30px;
list-style: none; background-color: #4C4C4C;
} border-left-color: #707070;
}
#tabs li { /* end top-nav */
margin-left: 0px;
} /* start first tab */
#tabs {
#tabs a, #tabs>ul>li>div { background-color: #ECECEC;
color: #21759B; border-radius: 0 5px 5px 0;
display: block; border-right: 1px solid #CCC;
text-decoration: none; border-top: 1px solid #DDD;
cursor: pointer; bottom: 0;
letter-spacing: 1px; box-shadow: 6px 0 6px #ECECEC;
} min-height: 468px;
#tabs a:hover, #tabs>ul>li>div:hover { padding: 15px 0;
color: #D54121; position: absolute;
} top: 58px;
#tabs>ul>li>div { width: 145px;
border-bottom: 1px solid #DFDFDF; }
border-top: 1px solid #F9F9F9;
font-weight: bold; #tabs ul {
padding-left: 12px; list-style: none;
line-height: 30px; }
height: 30px;
} #tabs li {
margin-left: 0px;
#tabs>ul>li>div>a.tab-current{ }
background-color: #777777;
border-bottom: 1px solid #6D6D6D; #tabs a, #tabs>ul>li>div {
border-top: 1px solid #808080; color: #21759B;
color: #FFFFFF; display: block;
margin-left: -12px; text-decoration: none;
padding-left: 12px; cursor: pointer;
text-shadow: 0 -1px 0 #333333; letter-spacing: 1px;
} }
#tabs a:hover, #tabs>ul>li>div:hover {
#tabs li li a { color: #D54121;
background-color: #FFFFFF; }
padding-left: 36px; #tabs>ul>li>div {
line-height: 28px; border-bottom: 1px solid #DFDFDF;
height: 28px; border-top: 1px solid #F9F9F9;
} font-weight: bold;
padding-left: 12px;
#tabs .tab-current { line-height: 30px;
background-color: #EAF2FA; height: 30px;
color: #333333; }
font-weight: bold;
} #tabs>ul>li>div>a.tab-current{
background-color: #777777;
#tabs li li a:hover { border-bottom: 1px solid #6D6D6D;
background-color: #EAF2FA; border-top: 1px solid #808080;
color: #333333; color: #FFFFFF;
} margin-left: -12px;
padding-left: 12px;
#tabs .commentIcon, #tabs .postIcon, #tabs .preferenceIcon, #tabs .usersIcon, text-shadow: 0 -1px 0 #333333;
#tabs .aboutIcon { }
margin: 6px 9px 0 0;
} #tabs li li a {
/* end first tabs */ background-color: #FFFFFF;
padding-left: 36px;
/* start sub tabs */ line-height: 28px;
.sub-tabs { height: 28px;
height: 30px; }
}
.sub-tabs ul { #tabs .tab-current {
float: right; background-color: #EAF2FA;
list-style: none outside none; color: #333333;
margin-right: 24px; font-weight: bold;
} }
.sub-tabs li {
float: left; #tabs li li a:hover {
} background-color: #EAF2FA;
.sub-tabs li a { color: #333333;
background-color: #ECECEC; }
border: 1px solid #DFDFDF;
border-bottom: 0px; #tabs .commentIcon, #tabs .postIcon, #tabs .preferenceIcon, #tabs .usersIcon,
border-radius: 5px 5px 0 0; #tabs .aboutIcon {
color: #333333; margin: 6px 9px 0 0;
display: block; }
line-height: 29px; /* end first tabs */
padding: 0 12px;
text-decoration: none; /* start sub tabs */
} .sub-tabs {
.sub-tabs .tab-current, .sub-tabs .tab-current:hover { height: 30px;
background-color: #FFFFFF; }
font-weight: bold; .sub-tabs ul {
line-height: 30px; float: right;
} list-style: none outside none;
.sub-tabs a:hover { margin-right: 24px;
background-color: #F5F5F5; }
} .sub-tabs li {
.sub-tabs-main { float: left;
background-color: #FFFFFF; }
border: 1px solid #DFDFDF; .sub-tabs li a {
padding: 12px; background-color: #ECECEC;
border-radius: 6px; border: 1px solid #DFDFDF;
} border-bottom: 0px;
/* end preference tabs*/ border-radius: 5px 5px 0 0;
color: #333333;
/* start form */ display: block;
.form>div { line-height: 29px;
margin: 12px 0; padding: 0 12px;
} text-decoration: none;
.form>div label { }
font-weight: bold; .sub-tabs .tab-current, .sub-tabs .tab-current:hover {
line-height: 28px; background-color: #FFFFFF;
margin-right: 12px; font-weight: bold;
} line-height: 30px;
/* end form */ }
.sub-tabs a:hover {
/* start module */ background-color: #F5F5F5;
.module-panel { }
border: 1px solid #DFDFDF; .sub-tabs-main {
border-radius: 3px 3px 3px 3px; background-color: #FFFFFF;
box-shadow: 0 1px 0 #FFFFFF inset; border: 1px solid #DFDFDF;
background-color: #F5F5F5; padding: 12px;
margin-bottom: 36px; border-radius: 6px;
min-height: 160px; }
} /* end preference tabs*/
.module-header {
background-color: #f1f1f1; /* start form */
background-image: linear-gradient(top,#f9f9f9,#ececec); .form>div {
background-image: -moz-linear-gradient(top,#f9f9f9,#ececec); margin: 12px 0;
background-image: -ms-linear-gradient(top,#f9f9f9,#ececec); }
background-image: -o-linear-gradient(top,#f9f9f9,#ececec); .form>div label {
background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec)); font-weight: bold;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#ececec'); line-height: 28px;
border-bottom-color: #DFDFDF; margin-right: 12px;
box-shadow: 0 1px 0 #FFFFFF; }
text-shadow: 0 1px 0 #FFFFFF; /* end form */
padding: 5px 10px;
} /* start module */
.module-panel {
.module-header h2 { border: 1px solid #DFDFDF;
color: #464646; border-radius: 3px 3px 3px 3px;
font-size: 16px; box-shadow: 0 1px 0 #FFFFFF inset;
} background-color: #F5F5F5;
margin-bottom: 36px;
.module-header a { min-height: 160px;
text-decoration: none; }
} .module-header {
/* end module */ background-color: #f1f1f1;
background-image: linear-gradient(top,#f9f9f9,#ececec);
/* start comments */ background-image: -moz-linear-gradient(top,#f9f9f9,#ececec);
.comment-title { background-image: -ms-linear-gradient(top,#f9f9f9,#ececec);
background-color: #ECECEC; background-image: -o-linear-gradient(top,#f9f9f9,#ececec);
border-bottom: 1px solid #DFDFDF; background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));
border-top: 1px solid #F9F9F9; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#ececec');
padding: 3px 6px 3px 12px; border-bottom-color: #DFDFDF;
} box-shadow: 0 1px 0 #FFFFFF;
text-shadow: 0 1px 0 #FFFFFF;
#comments { padding: 5px 10px;
height: 462px; }
overflow: auto;
} .module-header h2 {
/* end comments */ color: #464646;
font-size: 16px;
/* start article */ }
.markdown-preivew {
background-image: -moz-linear-gradient(top,#FFFFFF,#F3F3F3); .module-header a {
background-image: -ms-linear-gradient(top,#FFFFFF,#F3F3F3); text-decoration: none;
background-image: -o-linear-gradient(top,#FFFFFF,#F3F3F3); }
background-image: -webkit-gradient(linear,left top,left bottom,from(#FFFFFF),to(#F3F3F3)); /* end module */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#F3F3F3');
border-color: #C0C0C0 #D9D9D9 #D9D9D9; /* start comments */
border-style: solid; .comment-title {
border-width: 1px; background-color: #ECECEC;
float: left; border-bottom: 1px solid #DFDFDF;
height: 500px; border-top: 1px solid #F9F9F9;
margin-left: 20px; padding: 3px 6px 3px 12px;
overflow: auto; }
width: 47%;
word-wrap: break-word; #comments {
} height: 462px;
overflow: auto;
.markdown-help.ico-help, .markdown-help.ico-close { }
background-image: url("../images/icon.png"); /* end comments */
background-position: -16px -47px;
cursor: pointer; /* start article */
float: right; .markdown-preivew {
height: 17px; background-image: -moz-linear-gradient(top,#FFFFFF,#F3F3F3);
width: 17px; background-image: -ms-linear-gradient(top,#FFFFFF,#F3F3F3);
} background-image: -o-linear-gradient(top,#FFFFFF,#F3F3F3);
background-image: -webkit-gradient(linear,left top,left bottom,from(#FFFFFF),to(#F3F3F3));
.markdown-help.ico-close { filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#F3F3F3');
height: 16px; border-color: #C0C0C0 #D9D9D9 #D9D9D9;
background-position: -48px -16px; border-style: solid;
} border-width: 1px;
float: left;
.markdown-help-main, .markdown-preview-main { height: 500px;
color: #21759B; margin-left: 20px;
padding: 0 12px overflow: auto;
} width: 47%;
word-wrap: break-word;
.markdown-help-main dt { }
font-size: 14px;
font-weight: bold; .markdown-help.ico-help, .markdown-help.ico-close {
margin: 12px 0 6px 0; background-image: url("../images/icon.png");
} background-position: -16px -47px;
cursor: pointer;
.markdown-help-main dd { float: right;
margin-left: 12px; height: 17px;
} width: 17px;
}
button#submitArticle {
background: none repeat scroll 0 0 #D54121; .markdown-help.ico-close {
box-shadow: 0 0 0 1px #FFFFFF inset, 0 1px 1px rgba(0, 0, 0, 0.1); height: 16px;
text-shadow: 0 1px rgba(0, 0, 0, 0.1); background-position: -48px -16px;
color: #FFF; }
}
/* end article */ .markdown-help-main, .markdown-preview-main {
color: #21759B;
/* start preference */ padding: 0 12px
#skinsPanel { }
min-width: 328px;
width: 99%; .markdown-help-main dt {
} font-size: 14px;
.skinPreview { font-weight: bold;
cursor: pointer; margin: 12px 0 6px 0;
height: 160px; }
margin: 6px;
width: 280px; .markdown-help-main dd {
} margin-left: 12px;
.skinItem { }
background-color: #FAFAFA;
border-radius: 3px; button#submitArticle {
box-shadow: 1px 1px 3px #333333; background: none repeat scroll 0 0 #D54121;
line-height: 16px; box-shadow: 0 0 0 1px #FFFFFF inset, 0 1px 1px rgba(0, 0, 0, 0.1);
margin: 24px 12px; text-shadow: 0 1px rgba(0, 0, 0, 0.1);
padding: 5px; color: #FFF;
text-align: center; }
} /* end article */
#skinMain .skinItem.selected { /* start preference */
background-color: #D54121; #skinsPanel {
} min-width: 328px;
.skinItem:hover { width: 99%;
background-color: #EEE; }
} .skinPreview {
.f-blue, .error-msg { cursor: pointer;
color: #3366CC; height: 160px;
} margin: 6px;
.signs button { width: 280px;
margin: 0 12px; }
} .skinItem {
/* end preference */ background-color: #FAFAFA;
border-radius: 3px;
/* start common list */ box-shadow: 1px 1px 3px #333333;
.small-head { line-height: 16px;
float: left; margin: 24px 12px;
height: 35px; padding: 5px;
margin: 3px 9px 0 3px; text-align: center;
width: 35px; }
}
#skinMain .skinItem.selected {
#commentTable .table-main td { background-color: #D54121;
vertical-align: top; }
} .skinItem:hover {
/* end common list */ background-color: #EEE;
}
/* start about */ .f-blue, .error-msg {
.about-logo { color: #3366CC;
float: left; }
margin: 62px 36px 62px 24px; .signs button {
} margin: 0 12px;
}
.about-margin { /* end preference */
font-size: 20px;
margin: 20px 0; /* start common list */
} .small-head {
float: left;
.ico-alipay-me { height: 35px;
background-image: url("../images/alipay-me.png"); margin: 3px 9px 0 3px;
font-size: 20px; width: 35px;
height: 24px; }
margin: 20px 0;
width: 126px; #commentTable .table-main td {
} vertical-align: top;
/* end about */ }
/* end common list */
/* /* start about */
* jQuly plugin: bowknot style .about-logo {
* float: left;
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> margin: 62px 36px 62px 24px;
* @version 1.0.0.7, Oct 29, 2011 }
*/
.completed-input { .about-margin {
margin: 2px 12px 0 0; font-size: 20px;
} margin: 20px 0;
.completed-panel { }
background-color: #ECECEC;
border: 1px solid #CCCCCC; .ico-alipay-me {
color: #0000CC; background-image: url("../images/alipay-me.png");
display: none; font-size: 20px;
overflow: auto; height: 24px;
padding: 2px; margin: 20px 0;
position: absolute; width: 126px;
z-index: 10; }
} /* end about */
.completed-panel a {
display: block;
text-decoration: none; /*
} * jQuly plugin: bowknot style
.completed-panel a.selected { *
background-color: #FFFFFF; * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
color: #D54121; * @version 1.0.0.7, Oct 29, 2011
} */
.completed-ck { .completed-input {
margin-top: 9px; margin: 2px 12px 0 0;
} }
.completed-ck span { .completed-panel {
background: url(../images/icon.png) repeat center bottom; background-color: #ECECEC;
border: 1px solid; border: 1px solid #CCCCCC;
border-color: #CCC #BBBBBB #A0A0A0; color: #0000CC;
border-radius: 4px; display: none;
color: #21759B; overflow: auto;
cursor: pointer; padding: 2px;
float: left; position: absolute;
height: 28px; z-index: 10;
line-height: 26px; }
margin: 3px 6px; .completed-panel a {
padding: 0 6px; display: block;
vertical-align: top; text-decoration: none;
} }
.completed-ck span:hover { .completed-panel a.selected {
border-color: #BBB; background-color: #FFFFFF;
} color: #D54121;
}
.completed-ck span.selected { .completed-ck {
color: #D54121; margin-top: 9px;
background: url(../images/bowknot/completed.png) no-repeat right bottom; }
} .completed-ck span {
.dialog-background { background: url(../images/icon.png) repeat center bottom;
background-color: #000000; border: 1px solid;
display: none; border-color: #CCC #BBBBBB #A0A0A0;
filter: alpha(opacity=30); border-radius: 4px;
height: 100%; color: #21759B;
left: 0; cursor: pointer;
opacity: .3; float: left;
position: absolute; height: 28px;
top: 0; line-height: 26px;
width: 100%; margin: 3px 6px;
z-index: 90; padding: 0 6px;
} vertical-align: top;
.dialog-panel { }
display: none; .completed-ck span:hover {
moz-user-select: none; border-color: #BBB;
position: absolute; }
z-index: 100;
} .completed-ck span.selected {
.dialog-title { color: #D54121;
color: #FFFFFF; background: url(../images/bowknot/completed.png) no-repeat right bottom;
float: left; }
font-size: 12px; .dialog-background {
line-height: 27px; background-color: #000000;
margin-left: 3px; display: none;
} filter: alpha(opacity=30);
height: 100%;
.dialog-header-bg { left: 0;
background: url("../images/icon.png") repeat scroll center bottom #F1F1F1; opacity: .3;
border-color: #C0C0C0 #D9D9D9 #D9D9D9; position: absolute;
border-radius: 6px 6px 0 0; top: 0;
border-style: solid; width: 100%;
border-width: 1px 1px 0; z-index: 90;
cursor: move; }
height: 34px;
} .dialog-panel {
.dialog-header-middle { display: none;
float: left; position: absolute;
} z-index: 100;
}
.dialog-close-icon { .dialog-title {
background: url("../images/bowknot/dialog-close.png") no-repeat scroll 0 0 transparent; color: #FFFFFF;
cursor: pointer; float: left;
float: right; font-size: 12px;
height: 18px; line-height: 27px;
margin-top: 6px; margin-left: 3px;
padding: 3px; }
width: 22px;
} .dialog-header-bg {
background: url("../images/icon.png") repeat scroll center bottom #F1F1F1;
.dialog-close-icon:hover { border-color: #C0C0C0 #D9D9D9 #D9D9D9;
background-image: url("../images/bowknot/dialog-close-hover.png"); border-radius: 6px 6px 0 0;
} border-style: solid;
border-width: 1px 1px 0;
.dialog-main { cursor: move;
background-color: #FFFFFF; height: 34px;
border: 2px solid #666666; }
border-color: #C0C0C0 #D9D9D9 #D9D9D9;
border-top-width: 0; .dialog-close-icon {
padding: 12px; background: url("../images/bowknot/dialog-close.png") no-repeat scroll 0 0 transparent;
} cursor: pointer;
float: right;
.paginate-paginate div, .paginate-paginate a, .paginate-pageCount{ height: 18px;
float: left; margin-top: 6px;
height: 20px; padding: 3px;
line-height: 20px; width: 22px;
margin: 0 5px; }
text-decoration: none;
} .dialog-close-icon:hover {
.pagination-pages { background-image: url("../images/bowknot/dialog-close-hover.png");
background: url(../images/icon.png) repeat center bottom; }
border: 1px solid;
border-color: #CCC #BBBBBB #A0A0A0; .dialog-main {
border-radius: 4px; background-color: #FFFFFF;
padding: 0 6px; border: 2px solid #666666;
cursor: pointer; border-color: #C0C0C0 #D9D9D9 #D9D9D9;
float: left; border-top-width: 0;
height: 20px; padding: 12px;
line-height: 20px; }
margin: 0 5px;
} .paginate-paginate div, .paginate-paginate a, .paginate-pageCount{
float: left;
.pagination-current-page { height: 20px;
cursor: auto; line-height: 20px;
font-weight: bold; margin: 0 5px;
border-color: #BBB; text-decoration: none;
} }
.pagination-pages {
.paginate-inputPage { background: url(../images/icon.png) repeat center bottom;
height: 14px; border: 1px solid;
width: 24px; border-color: #CCC #BBBBBB #A0A0A0;
} border-radius: 4px;
.table-main { padding: 0 6px;
margin: 0; cursor: pointer;
padding: 0; float: left;
position: relative; height: 20px;
} line-height: 20px;
.table-main table { margin: 0 5px;
word-break: break-all; }
word-wrap: break-word;
} .pagination-current-page {
cursor: auto;
.table-header { font-weight: bold;
border: 1px solid #D0D0D0; border-color: #BBB;
border-bottom: 0px; }
border-radius: 6px 6px 0 0;
} .paginate-inputPage {
height: 14px;
.table-header th { width: 24px;
height: 34px; }
line-height: 34px; .table-main {
text-align: left; margin: 0;
text-indent: 6px; padding: 0;
font-size: 14px; position: relative;
font-weight: normal; }
background: url("../images/icon.png") repeat scroll center bottom #F1F1F1; .table-main table {
} word-break: break-all;
word-wrap: break-word;
.table-main td { }
border-bottom: 1px solid #D0D0D0;
color: #333; .table-header {
padding: 3px 0; border: 1px solid #D0D0D0;
} border-bottom: 0px;
border-radius: 6px 6px 0 0;
.table-lineHover .table-hasExpend td { }
border-bottom: 0px;
} .table-header th {
.table-heiglight td, .table-lineHover td { height: 34px;
background-color: #F3F3F3; line-height: 34px;
border-right-color: #F3F3F3; text-align: left;
} text-indent: 6px;
.table-expendRow td { font-size: 14px;
padding: 0 0 5px 36px; font-weight: normal;
} background: url("../images/icon.png") repeat scroll center bottom #F1F1F1;
.table-expendRow td span { }
margin-left: 60px;
} .table-main td {
.table-expendRow td a { border-bottom: 1px solid #D0D0D0;
background-color: #999; color: #333;
border-radius: 3px; padding: 3px 0;
color: #FFF; }
font-size: 12px;
margin-right: 5px; .table-lineHover .table-hasExpend td {
padding: 1px 6px; border-bottom: 0px;
text-decoration: none; }
} .table-heiglight td, .table-lineHover td {
.table-expendRow td a:hover { background-color: #F3F3F3;
background-color: #BBB; border-right-color: #F3F3F3;
} }
.table-center { .table-expendRow td {
margin: 0 auto; padding: 0 0 5px 36px;
} }
.table-upIcon,.table-downIcon { .table-expendRow td span {
background-image: url("../images/icon.png"); margin-left: 60px;
cursor: pointer; }
float: left; .table-expendRow td a {
height: 16px; background-color: #999;
width: 16px; border-radius: 3px;
background-position: -79px -32px; color: #FFF;
} font-size: 12px;
.table-upIcon { margin-right: 5px;
background-position: -64px -32px; padding: 1px 6px;
margin-right: 6px; text-decoration: none;
} }
.table-expendRow td a:hover {
.table-tag { background-color: #BBB;
color: #D54121; }
font-size: 12px; .table-center {
font-style: italic; margin: 0 auto;
margin-left: 10px; }
} .table-upIcon,.table-downIcon {
background-image: url("../images/icon.png");
.tip-panel { cursor: pointer;
background-color: #FFF; float: left;
box-shadow: 0 3px 10px #8B8B8B; height: 16px;
display: none; width: 16px;
max-height: 500px; background-position: -79px -32px;
max-width: 500px; }
overflow: hidden; .table-upIcon {
padding: 3px; background-position: -64px -32px;
position: absolute; margin-right: 6px;
z-index: 1; }
}
======= .table-tag {
======= color: #D54121;
>>>>>>> origin/0.4.6 font-size: 12px;
/* font-style: italic;
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team margin-left: 10px;
* }
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. .tip-panel {
* You may obtain a copy of the License at background-color: #FFF;
* box-shadow: 0 3px 10px #8B8B8B;
* http://www.apache.org/licenses/LICENSE-2.0 display: none;
* max-height: 500px;
* Unless required by applicable law or agreed to in writing, software max-width: 500px;
* distributed under the License is distributed on an "AS IS" BASIS, overflow: hidden;
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. padding: 3px;
* See the License for the specific language governing permissions and position: absolute;
* limitations under the License. z-index: 1;
*/ }
/**
* admin style
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.3.9, Jun 26, 2012
*/
/* start resset */
body, input, textarea {
font-family: sans-serif,\5fae\8f6f\96c5\9ed1;
}
html, body {
height: 100%;
min-width: 1024px;
background-color: #FAFAFA;
}
a:link {
color: #21759B;
}
a:visited {
color: #551A8B;
}
a:active {
color: #D54121;
}
a:hover {
color: #D54121;
}
button.selected {
background: url("../images/bowknot/completed.png") no-repeat scroll right bottom transparent;
color: #D54121;
}
/* end reset */
/* start ico */
.ico-arrow-down, .ico-arrow-up {
background: url("../images/arrows.png") repeat scroll 0 4px transparent;
float: right;
height: 20px;
margin: 2px 3px 0 0;
width: 18px;
}
.ico-arrow-up {
background-position: 0 -30px;
}
.aboutIcon {
background-position: -16px -48px;
}
/* end ico */
/* start frame */
#allPanel {
height: auto;
min-height: 100%;
position: relative;
}
#tabsPanel {
margin: 30px 0 0 162px;
padding: 0 12px;
}
#tabsPanel>div {
padding-bottom: 36px;
}
.tip {
font-weight: bold;
margin: 0 auto;
overflow: hidden;
padding: 2px 0;
position: fixed;
text-align: center;
top: 5px;
width: 100%;
z-index: 2;
}
.tip-msg {
top: 33px;
}
#tipMsg, #loadMsg {
background-color: #E5E7EB;
border-radius: 3px;
padding: 2px 0;
}
.footer {
bottom: 12px;
position: absolute;
text-align: center;
width: 100%;
}
/* end frame */
/* start top-nav */
#top {
background-image: linear-gradient(top,#666666,#7F7F7F);
background-image: -moz-linear-gradient(top,#666666,#7F7F7F);
background-image: -ms-linear-gradient(top,#666666,#7F7F7F);
background-image: -o-linear-gradient(top,#666666,#7F7F7F);
background-image: -webkit-gradient(linear,left top,left bottom,from(#666666),to(#7F7F7F));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#7F7F7F');
}
#top a, #top span span {
float: left;
line-height: 18px;
margin: 6px 0;
padding: 0 6px;
text-decoration: none;
text-shadow: 0 -1px 0 #FFFFFF;
font-weight: normal;
border-right: 1px solid #686868;
color: #CCCCCC;
text-shadow: 0 -1px 0 #555555;
}
#top>a {
color: #FFFFFF;
}
#top a:hover, #top a.hover {
border-radius: 0 13px 13px 0;
margin: 0px;
line-height: 30px;
background-color: #4C4C4C;
border-left-color: #707070;
}
/* end top-nav */
/* start first tab */
#tabs {
background-color: #ECECEC;
border-radius: 0 5px 5px 0;
border-right: 1px solid #CCC;
border-top: 1px solid #DDD;
bottom: 0;
box-shadow: 6px 0 6px #ECECEC;
min-height: 468px;
padding: 15px 0;
position: absolute;
top: 58px;
width: 145px;
}
#tabs ul {
list-style: none;
}
#tabs li {
margin-left: 0px;
}
#tabs a, #tabs>ul>li>div {
color: #21759B;
display: block;
text-decoration: none;
cursor: pointer;
letter-spacing: 1px;
}
#tabs a:hover, #tabs>ul>li>div:hover {
color: #D54121;
}
#tabs>ul>li>div {
border-bottom: 1px solid #DFDFDF;
border-top: 1px solid #F9F9F9;
font-weight: bold;
padding-left: 12px;
line-height: 30px;
height: 30px;
}
#tabs>ul>li>div>a.tab-current{
background-color: #777777;
border-bottom: 1px solid #6D6D6D;
border-top: 1px solid #808080;
color: #FFFFFF;
margin-left: -12px;
padding-left: 12px;
text-shadow: 0 -1px 0 #333333;
}
#tabs li li a {
background-color: #FFFFFF;
padding-left: 36px;
line-height: 28px;
height: 28px;
}
#tabs .tab-current {
background-color: #EAF2FA;
color: #333333;
font-weight: bold;
}
#tabs li li a:hover {
background-color: #EAF2FA;
color: #333333;
}
#tabs .commentIcon, #tabs .postIcon, #tabs .preferenceIcon, #tabs .usersIcon,
#tabs .aboutIcon {
margin: 6px 9px 0 0;
}
/* end first tabs */
/* start sub tabs */
.sub-tabs {
height: 30px;
}
.sub-tabs ul {
float: right;
list-style: none outside none;
margin-right: 24px;
}
.sub-tabs li {
float: left;
}
.sub-tabs li a {
background-color: #ECECEC;
border: 1px solid #DFDFDF;
border-bottom: 0px;
border-radius: 5px 5px 0 0;
color: #333333;
display: block;
line-height: 29px;
padding: 0 12px;
text-decoration: none;
}
.sub-tabs .tab-current, .sub-tabs .tab-current:hover {
background-color: #FFFFFF;
font-weight: bold;
line-height: 30px;
}
.sub-tabs a:hover {
background-color: #F5F5F5;
}
.sub-tabs-main {
background-color: #FFFFFF;
border: 1px solid #DFDFDF;
padding: 12px;
border-radius: 6px;
}
/* end preference tabs*/
/* start form */
.form>div {
margin: 12px 0;
}
.form>div label {
font-weight: bold;
line-height: 28px;
margin-right: 12px;
}
/* end form */
/* start module */
.module-panel {
border: 1px solid #DFDFDF;
border-radius: 3px 3px 3px 3px;
box-shadow: 0 1px 0 #FFFFFF inset;
background-color: #F5F5F5;
margin-bottom: 36px;
min-height: 160px;
}
.module-header {
background-color: #f1f1f1;
background-image: linear-gradient(top,#f9f9f9,#ececec);
background-image: -moz-linear-gradient(top,#f9f9f9,#ececec);
background-image: -ms-linear-gradient(top,#f9f9f9,#ececec);
background-image: -o-linear-gradient(top,#f9f9f9,#ececec);
background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#ececec');
border-bottom-color: #DFDFDF;
box-shadow: 0 1px 0 #FFFFFF;
text-shadow: 0 1px 0 #FFFFFF;
padding: 5px 10px;
}
.module-header h2 {
color: #464646;
font-size: 16px;
}
.module-header a {
text-decoration: none;
}
/* end module */
/* start comments */
.comment-title {
background-color: #ECECEC;
border-bottom: 1px solid #DFDFDF;
border-top: 1px solid #F9F9F9;
padding: 3px 6px 3px 12px;
}
#comments {
height: 462px;
overflow: auto;
}
/* end comments */
/* start article */
.markdown-preivew {
background-image: -moz-linear-gradient(top,#FFFFFF,#F3F3F3);
background-image: -ms-linear-gradient(top,#FFFFFF,#F3F3F3);
background-image: -o-linear-gradient(top,#FFFFFF,#F3F3F3);
background-image: -webkit-gradient(linear,left top,left bottom,from(#FFFFFF),to(#F3F3F3));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#F3F3F3');
border-color: #C0C0C0 #D9D9D9 #D9D9D9;
border-style: solid;
border-width: 1px;
float: left;
height: 500px;
margin-left: 20px;
overflow: auto;
width: 47%;
word-wrap: break-word;
}
.markdown-help.ico-help, .markdown-help.ico-close {
background-image: url("../images/icon.png");
background-position: -16px -47px;
cursor: pointer;
float: right;
height: 17px;
width: 17px;
}
.markdown-help.ico-close {
height: 16px;
background-position: -48px -16px;
}
.markdown-help-main, .markdown-preview-main {
color: #21759B;
padding: 0 12px
}
.markdown-help-main dt {
font-size: 14px;
font-weight: bold;
margin: 12px 0 6px 0;
}
.markdown-help-main dd {
margin-left: 12px;
}
button#submitArticle {
background: none repeat scroll 0 0 #D54121;
box-shadow: 0 0 0 1px #FFFFFF inset, 0 1px 1px rgba(0, 0, 0, 0.1);
text-shadow: 0 1px rgba(0, 0, 0, 0.1);
color: #FFF;
}
/* end article */
/* start preference */
#skinsPanel {
min-width: 328px;
width: 99%;
}
.skinPreview {
cursor: pointer;
height: 160px;
margin: 6px;
width: 280px;
}
.skinItem {
background-color: #FAFAFA;
border-radius: 3px;
box-shadow: 1px 1px 3px #333333;
line-height: 16px;
margin: 24px 12px;
padding: 5px;
text-align: center;
}
#skinMain .skinItem.selected {
background-color: #D54121;
}
.skinItem:hover {
background-color: #EEE;
}
.f-blue, .error-msg {
color: #3366CC;
}
.signs button {
margin: 0 12px;
}
/* end preference */
/* start common list */
.small-head {
float: left;
height: 35px;
margin: 3px 9px 0 3px;
width: 35px;
}
#commentTable .table-main td {
vertical-align: top;
}
/* end common list */
/* start about */
.about-logo {
float: left;
margin: 62px 36px 62px 24px;
}
.about-margin {
font-size: 20px;
margin: 20px 0;
}
.ico-alipay-me {
background-image: url("../images/alipay-me.png");
font-size: 20px;
height: 24px;
margin: 20px 0;
width: 126px;
}
/* end about */
/*
* jQuly plugin: bowknot style
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.7, Oct 29, 2011
*/
.completed-input {
margin: 2px 12px 0 0;
}
.completed-panel {
background-color: #ECECEC;
border: 1px solid #CCCCCC;
color: #0000CC;
display: none;
overflow: auto;
padding: 2px;
position: absolute;
z-index: 10;
}
.completed-panel a {
display: block;
text-decoration: none;
}
.completed-panel a.selected {
background-color: #FFFFFF;
color: #D54121;
}
.completed-ck {
margin-top: 9px;
}
.completed-ck span {
background: url(../images/icon.png) repeat center bottom;
border: 1px solid;
border-color: #CCC #BBBBBB #A0A0A0;
border-radius: 4px;
color: #21759B;
cursor: pointer;
float: left;
height: 28px;
line-height: 26px;
margin: 3px 6px;
padding: 0 6px;
vertical-align: top;
}
.completed-ck span:hover {
border-color: #BBB;
}
.completed-ck span.selected {
color: #D54121;
background: url(../images/bowknot/completed.png) no-repeat right bottom;
}
.dialog-background {
background-color: #000000;
display: none;
filter: alpha(opacity=30);
height: 100%;
left: 0;
opacity: .3;
position: absolute;
top: 0;
width: 100%;
z-index: 90;
}
.dialog-panel {
display: none;
position: absolute;
z-index: 100;
}
.dialog-title {
color: #FFFFFF;
float: left;
font-size: 12px;
line-height: 27px;
margin-left: 3px;
}
.dialog-header-bg {
background: url("../images/icon.png") repeat scroll center bottom #F1F1F1;
border-color: #C0C0C0 #D9D9D9 #D9D9D9;
border-radius: 6px 6px 0 0;
border-style: solid;
border-width: 1px 1px 0;
cursor: move;
height: 34px;
}
.dialog-close-icon {
background: url("../images/bowknot/dialog-close.png") no-repeat scroll 0 0 transparent;
cursor: pointer;
float: right;
height: 18px;
margin-top: 6px;
padding: 3px;
width: 22px;
}
.dialog-close-icon:hover {
background-image: url("../images/bowknot/dialog-close-hover.png");
}
.dialog-main {
background-color: #FFFFFF;
border: 2px solid #666666;
border-color: #C0C0C0 #D9D9D9 #D9D9D9;
border-top-width: 0;
padding: 12px;
}
.paginate-paginate div, .paginate-paginate a, .paginate-pageCount{
float: left;
height: 20px;
line-height: 20px;
margin: 0 5px;
text-decoration: none;
}
.pagination-pages {
background: url(../images/icon.png) repeat center bottom;
border: 1px solid;
border-color: #CCC #BBBBBB #A0A0A0;
border-radius: 4px;
padding: 0 6px;
cursor: pointer;
float: left;
height: 20px;
line-height: 20px;
margin: 0 5px;
}
.pagination-current-page {
cursor: auto;
font-weight: bold;
border-color: #BBB;
}
.paginate-inputPage {
height: 14px;
width: 24px;
}
.table-main {
margin: 0;
padding: 0;
position: relative;
}
.table-main table {
word-break: break-all;
word-wrap: break-word;
}
.table-header {
border: 1px solid #D0D0D0;
border-bottom: 0px;
border-radius: 6px 6px 0 0;
}
.table-header th {
height: 34px;
line-height: 34px;
text-align: left;
text-indent: 6px;
font-size: 14px;
font-weight: normal;
background: url("../images/icon.png") repeat scroll center bottom #F1F1F1;
}
.table-main td {
border-bottom: 1px solid #D0D0D0;
color: #333;
padding: 3px 0;
}
.table-lineHover .table-hasExpend td {
border-bottom: 0px;
}
.table-heiglight td, .table-lineHover td {
background-color: #F3F3F3;
border-right-color: #F3F3F3;
}
.table-expendRow td {
padding: 0 0 5px 36px;
}
.table-expendRow td span {
margin-left: 60px;
}
.table-expendRow td a {
background-color: #999;
border-radius: 3px;
color: #FFF;
font-size: 12px;
margin-right: 5px;
padding: 1px 6px;
text-decoration: none;
}
.table-expendRow td a:hover {
background-color: #BBB;
}
.table-center {
margin: 0 auto;
}
.table-upIcon,.table-downIcon {
background-image: url("../images/icon.png");
cursor: pointer;
float: left;
height: 16px;
width: 16px;
background-position: -79px -32px;
}
.table-upIcon {
background-position: -64px -32px;
margin-right: 6px;
}
.table-tag {
color: #D54121;
font-size: 12px;
font-style: italic;
margin-left: 10px;
}
.tip-panel {
background-color: #FFF;
box-shadow: 0 3px 10px #8B8B8B;
display: none;
max-height: 500px;
max-width: 500px;
overflow: hidden;
padding: 3px;
position: absolute;
z-index: 1;
}
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
<<<<<<< HEAD /*
<<<<<<< HEAD * Copyright (c) 2009, 2010, 2011, 2012, B3log Team
/** *
* base style * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * You may obtain a copy of the License at
* @version 1.0.2.1, Mar 28, 2012 *
*/ * http://www.apache.org/licenses/LICENSE-2.0
html, body, div, ul, li, h1, h2, h3, h4, h5, h6, p, dd, dl, ol { *
margin: 0; * Unless required by applicable law or agreed to in writing, software
padding: 0; * distributed under the License is distributed on an "AS IS" BASIS,
} * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
body { * See the License for the specific language governing permissions and
background-color: #FFF; * limitations under the License.
color: #000; */
font-family: Helvetica,Arial,sans-serif,\5fae\8f6f\96c5\9ed1;
font-size: small; /**
} * base style
*
img { * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
border: medium none; * @version 1.0.2.1, Mar 28, 2012
margin: 0; */
padding: 0; html, body, div, ul, li, h1, h2, h3, h4, h5, h6, p, dd, dl, ol {
vertical-align: middle; margin: 0;
} padding: 0;
}
h1 { body {
font-size: 160%; background-color: #FFF;
} color: #000;
font-family: Helvetica,Arial,sans-serif,\5fae\8f6f\96c5\9ed1;
h2 { font-size: small;
font-size: 140%; }
}
img {
h3 { border: medium none;
font-size: 120%; margin: 0;
} padding: 0;
vertical-align: middle;
h4 { }
font-size: 110%;
} h1 {
font-size: 160%;
textarea { }
overflow: auto;
} h2 {
font-size: 140%;
li { }
margin-left: 12px;
} h3 {
font-size: 120%;
button, .button { }
background: url(../images/icon.png) repeat center bottom;
border: 1px solid; h4 {
border-color: #CCC #BBBBBB #A0A0A0; font-size: 110%;
border-radius: 4px; }
height: 28px;
margin: 0; textarea {
padding: 0 6px; overflow: auto;
vertical-align: top; }
}
li {
button:hover,.button:hover { margin-left: 12px;
border-color: #BBB; }
}
button, .button {
.padding12 { background: url(../images/icon.png) repeat center bottom;
padding: 12px; border: 1px solid;
} border-color: #CCC #BBBBBB #A0A0A0;
border-radius: 4px;
.paddingBottom12 { height: 28px;
padding-bottom: 12px !important; margin: 0;
} padding: 0 6px;
vertical-align: top;
.paddingTop12 { }
padding-top: 12px !important;
} button:hover,.button:hover {
border-color: #BBB;
.margin12 { }
margin: 12px;
} .padding12 {
padding: 12px;
.marginTop12 { }
margin-top: 12px !important;
} .paddingBottom12 {
padding-bottom: 12px !important;
.marginBottom12 { }
margin-bottom: 12px !important;
} .paddingTop12 {
padding-top: 12px !important;
.marginLeft12 { }
margin-left: 12px !important;;
} .margin12 {
margin: 12px;
.marginLeft6 { }
margin-left: 6px !important;;
} .marginTop12 {
margin-top: 12px !important;
.marginRight12 { }
margin-right: 12px !important;;
} .marginBottom12 {
margin-bottom: 12px !important;
.f-bold { }
font-weight: bold !important;
} .marginLeft12 {
.nowrap { margin-left: 12px !important;;
white-space: nowrap; }
}
.marginLeft6 {
.left { margin-left: 6px !important;;
float: left; }
}
.marginRight12 {
.right { margin-right: 12px !important;;
float: right; }
}
.f-bold {
.clear { font-weight: bold !important;
background-color: transparent; }
border: 0; .nowrap {
clear: both; white-space: nowrap;
display: block; }
font-size: 0;
height: 0; .left {
line-height: 0; float: left;
overflow: hidden; }
}
.right {
.none { float: right;
display: none; }
}
.clear {
.pointer { background-color: transparent;
cursor: pointer; border: 0;
} clear: both;
display: block;
.no-underline { font-size: 0;
text-decoration: none !important; height: 0;
} line-height: 0;
overflow: hidden;
.red { }
color: red;
} .none {
display: none;
.contentBody { }
margin-bottom: 12px;
padding: 3px 12px; .pointer {
} cursor: pointer;
}
/* start form */
.form th { .no-underline {
text-align: right; text-decoration: none !important;
white-space: nowrap; }
}
.red {
.form input[type='text'], .form input[type='password'], .form textarea { color: red;
border-color: #C0C0C0 #D9D9D9 #D9D9D9; }
border-right: 1px solid #D9D9D9;
border-style: solid; .contentBody {
border-width: 1px; margin-bottom: 12px;
font-family: Helvetica,Arial,sans-serif; padding: 3px 12px;
font-size: 12px; }
outline: medium none;
width: 99%; /* start form */
padding: 0 3px; .form th {
} text-align: right;
.form input { white-space: nowrap;
height: 24px; }
}
.form input[type='text'], .form input[type='password'], .form textarea {
.form input[type='checkbox'] { border-color: #C0C0C0 #D9D9D9 #D9D9D9;
border: 0px; border-right: 1px solid #D9D9D9;
vertical-align: middle; border-style: solid;
} border-width: 1px;
font-family: Helvetica,Arial,sans-serif;
.form input.normalInput { font-size: 12px;
width: auto; outline: medium none;
} width: 99%;
padding: 0 3px;
.form input[type='checkbox']:focus { }
border: 0px; .form input {
} height: 24px;
}
.form input:focus, .form textarea:focus {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset; .form input[type='checkbox'] {
} border: 0px;
vertical-align: middle;
.form textarea { }
padding: 3px;
overflow: auto; .form input.normalInput {
resize: vertical; width: auto;
} }
/* end form */
.form input[type='checkbox']:focus {
.logo { border: 0px;
padding: 0 5px; }
text-decoration: none;
text-shadow: 0 0 1px #EEEEEE; .form input:focus, .form textarea:focus {
} box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
}
/* start icon */
.putTopIcon,.notPutTopIcon,.deleteIcon,.updateIcon,.commentIcon, .form textarea {
.homeIcon,.adminIcon,.loginIcon,.logoutIcon,.calendarIcon,.browserIcon, padding: 3px;
.postIcon,.articlesIcon,.draftsIcon,.usersIcon,.linkIcon, overflow: auto;
.preferenceIcon, .pageIcon, .trueIcon,.falseIcon, resize: vertical;
.fileIcon, .othersIcon, .goTopIcon, .goBottomIcon, .cacheIcon, .aboutIcon { }
background-image: url("../images/icon.png"); /* end form */
cursor: pointer;
height: 16px; .logo {
width: 16px; padding: 0 5px;
} text-decoration: none;
text-shadow: 0 0 1px #EEEEEE;
.adminIcon,.loginIcon,.logoutIcon,.homeIcon { }
margin-top: 3px;
} /* start icon */
.putTopIcon,.notPutTopIcon,.deleteIcon,.updateIcon,.commentIcon,
.pageIcon { .homeIcon,.adminIcon,.loginIcon,.logoutIcon,.calendarIcon,.browserIcon,
background-position: -144px 0px; .postIcon,.articlesIcon,.draftsIcon,.usersIcon,.linkIcon,
} .preferenceIcon, .pageIcon, .trueIcon,.falseIcon,
.fileIcon, .othersIcon, .goTopIcon, .goBottomIcon, .cacheIcon, .aboutIcon {
.postIcon { background-image: url("../images/icon.png");
background-position: -16px 0; cursor: pointer;
} height: 16px;
width: 16px;
.linkIcon { }
background-position: -32px 0;
} .adminIcon,.loginIcon,.logoutIcon,.homeIcon {
margin-top: 3px;
.preferenceIcon { }
background-position: -48px 0;
} .pageIcon {
background-position: -144px 0px;
.articlesIcon { }
background-position: -64px 0;
} .postIcon {
background-position: -16px 0;
.trueIcon { }
background-position: -80px 0;
cursor: auto; .linkIcon {
} background-position: -32px 0;
}
.falseIcon {
background-position: -96px 0; .preferenceIcon {
cursor: auto; background-position: -48px 0;
} }
.fileIcon { .articlesIcon {
background-position: -112px 0; background-position: -64px 0;
} }
.deleteIcon { .trueIcon {
background-position: 0 -16px; background-position: -80px 0;
} cursor: auto;
}
.updateIcon {
background-position: -16px -16px; .falseIcon {
} background-position: -96px 0;
cursor: auto;
.commentIcon { }
background-position: -32px -16px;
} .fileIcon {
background-position: -112px 0;
.homeIcon { }
background-position: -64px -16px;
} .deleteIcon {
background-position: 0 -16px;
.adminIcon { }
background-position: -80px -16px;
} .updateIcon {
background-position: -16px -16px;
.logoutIcon { }
background-position: -96px -16px;
} .commentIcon {
background-position: -32px -16px;
.loginIcon { }
background-position: -112px -16px;
} .homeIcon {
background-position: -64px -16px;
.browserIcon { }
background-position: -128px -16px;
} .adminIcon {
background-position: -80px -16px;
.calendarIcon { }
background-position: -144px -16px;
} .logoutIcon {
background-position: -96px -16px;
.putTopIcon { }
background-position: -16px -32px;
float: left; .loginIcon {
} background-position: -112px -16px;
}
.notPutTopIcon {
background-position: -32px -32px; .browserIcon {
float: left; background-position: -128px -16px;
} }
.othersIcon { .calendarIcon {
background-position: -48px -32px; background-position: -144px -16px;
} }
.cacheIcon { .putTopIcon {
background-position: -96px -32px; background-position: -16px -32px;
} float: left;
}
.draftsIcon {
background-position: -96px -32px; .notPutTopIcon {
} background-position: -32px -32px;
float: left;
.usersIcon { }
background-position: -112px -32px;
} .othersIcon {
background-position: -48px -32px;
.goTopIcon { }
background-position: -64px -32px;
position: fixed; .cacheIcon {
right: 20px; background-position: -96px -32px;
top: 45%; }
}
.draftsIcon {
.goBottomIcon { background-position: -96px -32px;
background-position: -80px -32px; }
bottom: 40%;
position: fixed; .usersIcon {
right: 20px; background-position: -112px -32px;
} }
.article-body { .goTopIcon {
overflow: hidden; background-position: -64px -32px;
line-height: 145%; position: fixed;
word-wrap: break-word; right: 20px;
} top: 45%;
}
.article-body blockquote {
border: 1px dotted #98A47F; .goBottomIcon {
font-style: italic; background-position: -80px -32px;
margin: 12px; bottom: 40%;
padding: 12px; position: fixed;
} right: 20px;
}
.article-body h1 {
font-size: 2em; .article-body {
margin: .67em 0; overflow: hidden;
} line-height: 145%;
word-wrap: break-word;
.article-body h2 { }
font-size: 1.5em;
margin: .75em 0; .article-body blockquote {
} border: 1px dotted #98A47F;
font-style: italic;
.article-body h3 { margin: 12px;
font-size: 1.17em; padding: 12px;
margin: .83em 0; }
}
.article-body h1 {
.article-body h4, .article-body p, .article-body blockquote, font-size: 2em;
.article-body ul, .article-body fieldset, .article-body form, .article-body ol, margin: .67em 0;
.article-body dl, .article-body dir, .article-body menu { }
margin: 1.12em 0;
} .article-body h2 {
font-size: 1.5em;
.article-body h5 { margin: .75em 0;
font-size: .83em; }
margin: 1.5em 0;
} .article-body h3 {
font-size: 1.17em;
.article-body h6 { margin: .83em 0;
font-size: .75em; }
margin: 1.67em 0;
} .article-body h4, .article-body p, .article-body blockquote,
.article-body ul, .article-body fieldset, .article-body form, .article-body ol,
.article-body blockquote { .article-body dl, .article-body dir, .article-body menu {
margin-left: 40px; margin: 1.12em 0;
margin-right: 40px; }
}
.article-body h5 {
.article-body ol, .article-body ul, .article-body dir, font-size: .83em;
.article-body menu, .article-body dd { margin: 1.5em 0;
margin-left: 40px; }
}
/* start icon */ .article-body h6 {
font-size: .75em;
/* start emotions */ margin: 1.67em 0;
.em00, .em01, .em02, .em03, .em04, .em05, .em06, .em07, .em08, .em09, }
.em10, .em11, .em12, .em13, .em14 {
background-image: url("../images/emotions/classic/emotions-classic.png"); .article-body blockquote {
float: left; margin-left: 40px;
height: 24px; margin-right: 40px;
margin-right: 5px; }
width: 24px;
} .article-body ol, .article-body ul, .article-body dir,
.article-body menu, .article-body dd {
#emotions span { margin-left: 40px;
cursor: pointer; }
} /* start icon */
.em01 { /* start emotions */
background-position: -24px 0; .em00, .em01, .em02, .em03, .em04, .em05, .em06, .em07, .em08, .em09,
} .em10, .em11, .em12, .em13, .em14 {
background-image: url("../images/emotions/classic/emotions-classic.png");
.em02 { float: left;
background-position: -48px 0; height: 24px;
} margin-right: 5px;
width: 24px;
.em03 { }
background-position: -72px 0;
} #emotions span {
.em04 { cursor: pointer;
background-position: -96px 0; }
}
.em01 {
.em05 { background-position: -24px 0;
background-position: 0px -24px; }
}
.em02 {
.em06 { background-position: -48px 0;
background-position: -24px -24px; }
}
.em03 {
.em07 { background-position: -72px 0;
background-position: -48px -24px; }
} .em04 {
background-position: -96px 0;
.em08 { }
background-position: -72px -24px;
} .em05 {
background-position: 0px -24px;
.em09 { }
background-position: -96px -24px;
} .em06 {
background-position: -24px -24px;
.em10 { }
background-position: 0 -48px;
} .em07 {
background-position: -48px -24px;
.em11 { }
background-position: -24px -48px ;
} .em08 {
background-position: -72px -24px;
.em12 { }
background-position: -48px -48px;
} .em09 {
background-position: -96px -24px;
.em13 { }
background-position: -72px -48px;
} .em10 {
background-position: 0 -48px;
.em14 { }
background-position: -96px -48px;
} .em11 {
/* end emotions */ background-position: -24px -48px ;
}
/* start tags */
#tags { .em12 {
list-style: none; background-position: -48px -48px;
} }
#tags li { .em13 {
float: left; background-position: -72px -48px;
list-style: none; }
height: 38px;
} .em14 {
background-position: -96px -48px;
#tags a:hover { }
text-shadow: 0 0 2px #555555; /* end emotions */
}
/* start tags */
#tags a { #tags {
border-radius: 3px 3px 3px 3px; list-style: none;
box-shadow: 1px 1px 3px #555555; }
float: left;
margin: 3px 6px; #tags li {
padding: 3px 12px; float: left;
text-decoration: none; list-style: none;
} height: 38px;
}
#tags .tags1 {
font-size: 12px; #tags a:hover {
font-weight: normal; text-shadow: 0 0 2px #555555;
} }
#tags .tags2 { #tags a {
font-size: 14px; border-radius: 3px 3px 3px 3px;
font-weight: normal; box-shadow: 1px 1px 3px #555555;
} float: left;
margin: 3px 6px;
#tags .tags3 { padding: 3px 12px;
font-size: 16px; text-decoration: none;
font-weight: normal; }
}
#tags .tags1 {
#tags .tags4 { font-size: 12px;
font-size: 18px; font-weight: normal;
font-weight: bold; }
}
#tags .tags2 {
#tags .tags5 { font-size: 14px;
font-size: 20px; font-weight: normal;
font-weight: bold; }
}
/* end tags */ #tags .tags3 {
font-size: 16px;
/* start comment */ font-weight: normal;
#captcha, #captchaReply { }
cursor: pointer;
} #tags .tags4 {
======= font-size: 18px;
======= font-weight: bold;
>>>>>>> origin/0.4.6 }
/*
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team #tags .tags5 {
* font-size: 20px;
* Licensed under the Apache License, Version 2.0 (the "License"); font-weight: bold;
* you may not use this file except in compliance with the License. }
* You may obtain a copy of the License at /* end tags */
*
* http://www.apache.org/licenses/LICENSE-2.0 /* start comment */
* #captcha, #captchaReply {
* Unless required by applicable law or agreed to in writing, software cursor: pointer;
* 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.
*/
/**
* base style
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.2.1, Mar 28, 2012
*/
html, body, div, ul, li, h1, h2, h3, h4, h5, h6, p, dd, dl, ol {
margin: 0;
padding: 0;
}
body {
background-color: #FFF;
color: #000;
font-family: Helvetica,Arial,sans-serif,\5fae\8f6f\96c5\9ed1;
font-size: small;
}
img {
border: medium none;
margin: 0;
padding: 0;
vertical-align: middle;
}
h1 {
font-size: 160%;
}
h2 {
font-size: 140%;
}
h3 {
font-size: 120%;
}
h4 {
font-size: 110%;
}
textarea {
overflow: auto;
}
li {
margin-left: 12px;
}
button, .button {
background: url(../images/icon.png) repeat center bottom;
border: 1px solid;
border-color: #CCC #BBBBBB #A0A0A0;
border-radius: 4px;
height: 28px;
margin: 0;
padding: 0 6px;
vertical-align: top;
}
button:hover,.button:hover {
border-color: #BBB;
}
.padding12 {
padding: 12px;
}
.paddingBottom12 {
padding-bottom: 12px !important;
}
.paddingTop12 {
padding-top: 12px !important;
}
.margin12 {
margin: 12px;
}
.marginTop12 {
margin-top: 12px !important;
}
.marginBottom12 {
margin-bottom: 12px !important;
}
.marginLeft12 {
margin-left: 12px !important;;
}
.marginLeft6 {
margin-left: 6px !important;;
}
.marginRight12 {
margin-right: 12px !important;;
}
.f-bold {
font-weight: bold !important;
}
.nowrap {
white-space: nowrap;
}
.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;
}
.pointer {
cursor: pointer;
}
.no-underline {
text-decoration: none !important;
}
.red {
color: red;
}
.contentBody {
margin-bottom: 12px;
padding: 3px 12px;
}
/* start form */
.form th {
text-align: right;
white-space: nowrap;
}
.form input[type='text'], .form input[type='password'], .form textarea {
border-color: #C0C0C0 #D9D9D9 #D9D9D9;
border-right: 1px solid #D9D9D9;
border-style: solid;
border-width: 1px;
font-family: Helvetica,Arial,sans-serif;
font-size: 12px;
outline: medium none;
width: 99%;
padding: 0 3px;
}
.form input {
height: 24px;
}
.form input[type='checkbox'] {
border: 0px;
vertical-align: middle;
}
.form input.normalInput {
width: auto;
}
.form input[type='checkbox']:focus {
border: 0px;
}
.form input:focus, .form textarea:focus {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
}
.form textarea {
padding: 3px;
overflow: auto;
resize: vertical;
}
/* end form */
.logo {
padding: 0 5px;
text-decoration: none;
text-shadow: 0 0 1px #EEEEEE;
}
/* start icon */
.putTopIcon,.notPutTopIcon,.deleteIcon,.updateIcon,.commentIcon,
.homeIcon,.adminIcon,.loginIcon,.logoutIcon,.calendarIcon,.browserIcon,
.postIcon,.articlesIcon,.draftsIcon,.usersIcon,.linkIcon,
.preferenceIcon, .pageIcon, .trueIcon,.falseIcon,
.fileIcon, .othersIcon, .goTopIcon, .goBottomIcon, .cacheIcon, .aboutIcon {
background-image: url("../images/icon.png");
cursor: pointer;
height: 16px;
width: 16px;
}
.adminIcon,.loginIcon,.logoutIcon,.homeIcon {
margin-top: 3px;
}
.pageIcon {
background-position: -144px 0px;
}
.postIcon {
background-position: -16px 0;
}
.linkIcon {
background-position: -32px 0;
}
.preferenceIcon {
background-position: -48px 0;
}
.articlesIcon {
background-position: -64px 0;
}
.trueIcon {
background-position: -80px 0;
cursor: auto;
}
.falseIcon {
background-position: -96px 0;
cursor: auto;
}
.fileIcon {
background-position: -112px 0;
}
.deleteIcon {
background-position: 0 -16px;
}
.updateIcon {
background-position: -16px -16px;
}
.commentIcon {
background-position: -32px -16px;
}
.homeIcon {
background-position: -64px -16px;
}
.adminIcon {
background-position: -80px -16px;
}
.logoutIcon {
background-position: -96px -16px;
}
.loginIcon {
background-position: -112px -16px;
}
.browserIcon {
background-position: -128px -16px;
}
.calendarIcon {
background-position: -144px -16px;
}
.putTopIcon {
background-position: -16px -32px;
float: left;
}
.notPutTopIcon {
background-position: -32px -32px;
float: left;
}
.othersIcon {
background-position: -48px -32px;
}
.cacheIcon {
background-position: -96px -32px;
}
.draftsIcon {
background-position: -96px -32px;
}
.usersIcon {
background-position: -112px -32px;
}
.goTopIcon {
background-position: -64px -32px;
position: fixed;
right: 20px;
top: 45%;
}
.goBottomIcon {
background-position: -80px -32px;
bottom: 40%;
position: fixed;
right: 20px;
}
.article-body {
overflow: hidden;
line-height: 145%;
word-wrap: break-word;
}
.article-body blockquote {
border: 1px dotted #98A47F;
font-style: italic;
margin: 12px;
padding: 12px;
}
.article-body h1 {
font-size: 2em;
margin: .67em 0;
}
.article-body h2 {
font-size: 1.5em;
margin: .75em 0;
}
.article-body h3 {
font-size: 1.17em;
margin: .83em 0;
}
.article-body h4, .article-body p, .article-body blockquote,
.article-body ul, .article-body fieldset, .article-body form, .article-body ol,
.article-body dl, .article-body dir, .article-body menu {
margin: 1.12em 0;
}
.article-body h5 {
font-size: .83em;
margin: 1.5em 0;
}
.article-body h6 {
font-size: .75em;
margin: 1.67em 0;
}
.article-body blockquote {
margin-left: 40px;
margin-right: 40px;
}
.article-body ol, .article-body ul, .article-body dir,
.article-body menu, .article-body dd {
margin-left: 40px;
}
/* start icon */
/* start emotions */
.em00, .em01, .em02, .em03, .em04, .em05, .em06, .em07, .em08, .em09,
.em10, .em11, .em12, .em13, .em14 {
background-image: url("../images/emotions/classic/emotions-classic.png");
float: left;
height: 24px;
margin-right: 5px;
width: 24px;
}
#emotions span {
cursor: pointer;
}
.em01 {
background-position: -24px 0;
}
.em02 {
background-position: -48px 0;
}
.em03 {
background-position: -72px 0;
}
.em04 {
background-position: -96px 0;
}
.em05 {
background-position: 0px -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;
}
/* end emotions */
/* start tags */
#tags {
list-style: none;
}
#tags li {
float: left;
list-style: none;
height: 38px;
}
#tags a:hover {
text-shadow: 0 0 2px #555555;
}
#tags a {
border-radius: 3px 3px 3px 3px;
box-shadow: 1px 1px 3px #555555;
float: left;
margin: 3px 6px;
padding: 3px 12px;
text-decoration: none;
}
#tags .tags1 {
font-size: 12px;
font-weight: normal;
}
#tags .tags2 {
font-size: 14px;
font-weight: normal;
}
#tags .tags3 {
font-size: 16px;
font-weight: normal;
}
#tags .tags4 {
font-size: 18px;
font-weight: bold;
}
#tags .tags5 {
font-size: 20px;
font-weight: bold;
}
/* end tags */
/* start comment */
#captcha, #captchaReply {
cursor: pointer;
}
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
/* end comment */ /* end comment */
\ No newline at end of file
<<<<<<< HEAD /*
<<<<<<< HEAD * Copyright (c) 2009, 2010, 2011, 2012, B3log Team
/** *
* 403, 500, article-pwd, init, login and kill-browser page style. * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * You may obtain a copy of the License at
* @version 1.0.1.0, May 11, 2012 *
*/ * http://www.apache.org/licenses/LICENSE-2.0
html { *
height: 100%; * Unless required by applicable law or agreed to in writing, software
overflow: hidden; * 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
*,html,body { * limitations under the License.
margin: 0; */
padding: 0;
} /**
* 403, 404, 500, article-pwd, init, login and kill-browser page style.
body { *
background-color: #F3F1E5; * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
color: #4D505D; * @version 1.0.1.1, Jun 13, 2012
font-family: \5fae\8f6f\96c5\9ed1; */
font-size: small; html {
height: 100%; height: 100%;
} overflow: hidden;
}
button {
background: url(../images/icon.png) repeat center bottom; *,html,body {
border: 1px solid; margin: 0;
border-color: #CCC #BBBBBB #A0A0A0; padding: 0;
border-radius: 4px; }
height: 28px;
margin: 0; body {
padding: 0 6px; background-color: #F3F1E5;
vertical-align: top; color: #4D505D;
float: right; font-family: \5fae\8f6f\96c5\9ed1;
margin: 12px 0 0 24px; font-size: small;
outline: none; height: 100%;
} }
input { button {
background: none repeat scroll 0 0 #FBFBFB; background: url(../images/icon.png) repeat center bottom;
border: 1px solid #E5E5E5; border: 1px solid;
box-shadow: 1px 1px 2px rgba(200, 200, 200, 0.2) inset; border-color: #CCC #BBBBBB #A0A0A0;
color: #4D505D; border-radius: 4px;
font-family: Helvetica,Arial,sans-serif,\5fae\8f6f\96c5\9ed1; height: 28px;
font-size: 20px; margin: 0;
font-weight: 200; padding: 0 6px;
height: 28px; vertical-align: top;
margin-top: 10px; float: right;
outline: medium none; margin: 12px 0 0 24px;
padding: 3px; outline: none;
width: 280px; }
}
input {
input:focus { background: none repeat scroll 0 0 #FBFBFB;
box-shadow: 0px 0px 5px rgba(200, 200, 200, 0.9); border: 1px solid #E5E5E5;
} box-shadow: 1px 1px 2px rgba(200, 200, 200, 0.2) inset;
color: #4D505D;
.clear { font-family: Helvetica,Arial,sans-serif,\5fae\8f6f\96c5\9ed1;
background-color: transparent; font-size: 20px;
border: 0px; font-weight: 200;
clear: both; height: 28px;
display: block; margin-top: 10px;
font-size: 0px; outline: medium none;
height: 0px; padding: 3px;
line-height: 0px; width: 280px;
overflow: hidden; }
}
input:focus {
.none { box-shadow: 0px 0px 5px rgba(200, 200, 200, 0.9);
display: none; }
}
.clear {
.icon { background-color: transparent;
position: absolute; border: 0px;
right: 0px; clear: both;
top: 0px; display: block;
width:16px; font-size: 0px;
height:16px; height: 0px;
} line-height: 0px;
overflow: hidden;
.solo { }
color: orangered;
font-weight: bold; .none {
} display: none;
}
.logo {
float: left; .icon {
padding: 162px 12px 0; position: absolute;
width: 153px; right: 0px;
} top: 0px;
width:16px;
.wrapper { height:16px;
height: auto; }
min-height: 100%;
position: relative; .solo {
} color: orangered;
font-weight: bold;
.wrap { }
border-top: 5px solid #E6E5D9;
min-height: 400px; .logo {
} float: left;
padding: 162px 12px 0;
.content { width: 153px;
background: url("../images/zz.jpg") repeat-x scroll center bottom white; }
border-color: #E6E5D9;
border-style: solid solid none; .wrapper {
border-width: 1px; height: auto;
margin: 0 auto; min-height: 100%;
position: relative; position: relative;
width: 700px; }
top: 60px;
} .wrap {
border-top: 5px solid #E6E5D9;
.main { min-height: 400px;
border-left: 1px solid #E6E5D9; }
float: right;
font-size: 15px; .content {
margin: 24px 0; background: url("../images/zz.jpg") repeat-x scroll center bottom white;
padding: 12px 24px; border-color: #E6E5D9;
width: 470px; border-style: solid solid none;
height: 338px; border-width: 1px;
} margin: 0 auto;
position: relative;
.main a { width: 700px;
text-decoration: none; top: 60px;
} }
.main ul { .main {
margin-bottom: 73px; border-left: 1px solid #E6E5D9;
} float: right;
font-size: 15px;
.main li { margin: 24px 0;
margin: 6px 0 6px 16px; padding: 12px 24px;
} width: 470px;
height: 338px;
.main p { }
margin: 12px 0;
} .main a {
text-decoration: none;
.mian tr { }
height: 54px;
} .main ul {
margin-bottom: 73px;
.footerWrapper { }
background-color: #FFFFFF;
border-top: 1px solid #E6E5D9; .main li {
bottom: 0; margin: 6px 0 6px 16px;
padding: 12px 0; }
position: absolute;
text-align: center; .main p {
width: 100%; margin: 12px 0;
} }
.footerWrapper a { .mian tr {
text-decoration: none; height: 54px;
} }
/* start article-pwd */ .footerWrapper {
.article-pwd > div { background-color: #FFFFFF;
margin-bottom: 10px; border-top: 1px solid #E6E5D9;
max-height: 264px; bottom: 0;
overflow: auto; padding: 12px 0;
word-wrap: break-word; position: absolute;
} text-align: center;
width: 100%;
.article-pwd #confirm { }
margin-top: 6px;
} .footerWrapper a {
/* end article-pwd */ text-decoration: none;
}
/* start error */
/* start article-pwd */
.error { .article-pwd > div {
height: auto; margin-bottom: 10px;
margin: 60px 0pt; max-height: 264px;
} overflow: auto;
word-wrap: break-word;
.error ul { }
width: 50%;
margin: 12px 0 0 12px; .article-pwd #confirm {
float: left; margin-top: 6px;
} }
/* end article-pwd */
.error .img-forbidden {
margin: 38px 10px 0 0; /* start 403/404/500 */
width: 96px; .img-404, .img-403, .img-500 {
height: 96px; box-shadow: 0 0 5px #E6E5D9;
float: right; margin: 20px 0 0 45px;
} padding: 5px;
/* end 500 */ }
/* start login */ .a-404, .a-403, .a-500 {
.login table { margin: 20px 50px 0 0 ;
margin: 66px auto; text-align: right;
} }
/* end login */
.img-403 {
/* start kill */ margin: 20px 0 0 60px;
.kill { }
position: absolute;
right: 40px; .a-403 {
top: 230px; margin: 20px 75px 0 0 ;
} }
/* end kill */
.img-500 {
/* start init and login */ margin: 25px 0 0 25px;
#init { }
position: absolute;
top: 102px; .a-500 {
width: 470px; margin: 25px 35px 0 0 ;
} }
/* end 403/404/500 */
#sys p {
height: 166px; /* start login */
} .login table {
margin: 66px auto;
#initButton { }
margin-right: 10px; /* end login */
}
/* start kill */
#tip { .kill {
color: #21759B; position: absolute;
float: right; right: 40px;
font-weight: bold; top: 230px;
margin-top: 18px; }
} /* end kill */
=======
======= /* start init and login */
>>>>>>> origin/0.4.6 #init {
/* position: absolute;
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team top: 102px;
* width: 470px;
* 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 #sys p {
* height: 166px;
* http://www.apache.org/licenses/LICENSE-2.0 }
*
* Unless required by applicable law or agreed to in writing, software #initButton {
* distributed under the License is distributed on an "AS IS" BASIS, margin-right: 10px;
* 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. #tip {
*/ color: #21759B;
float: right;
/** font-weight: bold;
* 403, 404, 500, article-pwd, init, login and kill-browser page style. margin-top: 18px;
* }
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> /* end init and login */
* @version 1.0.1.1, Jun 13, 2012
*/
html {
height: 100%;
overflow: hidden;
}
*,html,body {
margin: 0;
padding: 0;
}
body {
background-color: #F3F1E5;
color: #4D505D;
font-family: \5fae\8f6f\96c5\9ed1;
font-size: small;
height: 100%;
}
button {
background: url(../images/icon.png) repeat center bottom;
border: 1px solid;
border-color: #CCC #BBBBBB #A0A0A0;
border-radius: 4px;
height: 28px;
margin: 0;
padding: 0 6px;
vertical-align: top;
float: right;
margin: 12px 0 0 24px;
outline: none;
}
input {
background: none repeat scroll 0 0 #FBFBFB;
border: 1px solid #E5E5E5;
box-shadow: 1px 1px 2px rgba(200, 200, 200, 0.2) inset;
color: #4D505D;
font-family: Helvetica,Arial,sans-serif,\5fae\8f6f\96c5\9ed1;
font-size: 20px;
font-weight: 200;
height: 28px;
margin-top: 10px;
outline: medium none;
padding: 3px;
width: 280px;
}
input:focus {
box-shadow: 0px 0px 5px rgba(200, 200, 200, 0.9);
}
.clear {
background-color: transparent;
border: 0px;
clear: both;
display: block;
font-size: 0px;
height: 0px;
line-height: 0px;
overflow: hidden;
}
.none {
display: none;
}
.icon {
position: absolute;
right: 0px;
top: 0px;
width:16px;
height:16px;
}
.solo {
color: orangered;
font-weight: bold;
}
.logo {
float: left;
padding: 162px 12px 0;
width: 153px;
}
.wrapper {
height: auto;
min-height: 100%;
position: relative;
}
.wrap {
border-top: 5px solid #E6E5D9;
min-height: 400px;
}
.content {
background: url("../images/zz.jpg") repeat-x scroll center bottom white;
border-color: #E6E5D9;
border-style: solid solid none;
border-width: 1px;
margin: 0 auto;
position: relative;
width: 700px;
top: 60px;
}
.main {
border-left: 1px solid #E6E5D9;
float: right;
font-size: 15px;
margin: 24px 0;
padding: 12px 24px;
width: 470px;
height: 338px;
}
.main a {
text-decoration: none;
}
.main ul {
margin-bottom: 73px;
}
.main li {
margin: 6px 0 6px 16px;
}
.main p {
margin: 12px 0;
}
.mian tr {
height: 54px;
}
.footerWrapper {
background-color: #FFFFFF;
border-top: 1px solid #E6E5D9;
bottom: 0;
padding: 12px 0;
position: absolute;
text-align: center;
width: 100%;
}
.footerWrapper a {
text-decoration: none;
}
/* start article-pwd */
.article-pwd > div {
margin-bottom: 10px;
max-height: 264px;
overflow: auto;
word-wrap: break-word;
}
.article-pwd #confirm {
margin-top: 6px;
}
/* end article-pwd */
/* start 403/404/500 */
.img-404, .img-403, .img-500 {
box-shadow: 0 0 5px #E6E5D9;
margin: 20px 0 0 45px;
padding: 5px;
}
.a-404, .a-403, .a-500 {
margin: 20px 50px 0 0 ;
text-align: right;
}
.img-403 {
margin: 20px 0 0 60px;
}
.a-403 {
margin: 20px 75px 0 0 ;
}
.img-500 {
margin: 25px 0 0 25px;
}
.a-500 {
margin: 25px 35px 0 0 ;
}
/* end 403/404/500 */
/* start login */
.login table {
margin: 66px auto;
}
/* end login */
/* start kill */
.kill {
position: absolute;
right: 40px;
top: 230px;
}
/* end kill */
/* start init and login */
#init {
position: absolute;
top: 102px;
width: 470px;
}
#sys p {
height: 166px;
}
#initButton {
margin-right: 10px;
}
#tip {
color: #21759B;
float: right;
font-weight: bold;
margin-top: 18px;
}
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
/* end init and login */
\ No newline at end of file
<<<<<<< HEAD /*
<<<<<<< HEAD * 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");
* * you may not use this file except in compliance with the License.
* Licensed under the Apache License, Version 2.0 (the "License"); * You may obtain a copy of the License at
* 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
* *
* 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,
* Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* distributed under the License is distributed on an "AS IS" BASIS, * See the License for the specific language governing permissions and
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * limitations under the License.
* See the License for the specific language governing permissions and */
* limitations under the License. /**
*/ * index for admin
/** *
* index for admin * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* * @version 1.0.1.9, Jun 19, 2012
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> */
* @version 1.0.1.8, May 4, 2012
*/ var Admin = function () {
this.register = {};
var Admin = function () { // 工具栏下的工具
this.register = {}; this.tools = ['#page-list', '#file-list', '#link-list', '#preference',
// 工具栏下的工具 '#user-list', '#plugin-list', '#others'];
this.tools = ['#page-list', '#file-list', '#link-list', '#preference', // 多用户时,一般用户不能使用的功能
'#user-list', '#plugin-list', '#others']; this.adTools = ['link-list', 'preference', 'file-list', 'page-list',
// 多用户时,一般用户不能使用的功能 'user-list', 'plugin-list'];
this.adTools = ['link-list', 'preference', 'file-list', 'page-list', };
'user-list', 'plugin-list'];
}; $.extend(Admin.prototype, {
/*
$.extend(Admin.prototype, { * 登出
/* */
* 登出 logout: function () {
*/ window.location.href = latkeConfig.servePath + "/logout?goto=" + latkeConfig.servePath;
logout: function () { },
window.location.href = latkeConfig.servePath + "/logout?goto=" + latkeConfig.servePath;
}, /*
* 根据当前页数设置 hash
/* * @currentPage {string} 当前页
* 根据当前页数设置 hash */
* @currentPage {string} 当前页 setHashByPage: function (currentPage) {
*/ var hash = window.location.hash,
setHashByPage: function (currentPage) { hashList = hash.split("/");
var hash = window.location.hash, if (/^\d*$/.test(hashList[hashList.length - 1])) {
hashList = hash.split("/"); hashList[hashList.length - 1] = currentPage;
if (/^\d*$/.test(hashList[hashList.length - 1])) { } else {
hashList[hashList.length - 1] = currentPage; hashList.push(currentPage);
} else { }
hashList.push(currentPage); window.location.hash = hashList.join("/");
} },
window.location.hash = hashList.join("/");
}, /*
* 设置某个 tab 被选择
/* * @id tab id
* 设置某个 tab 被选择 */
* @id tab id selectTab: function (id) {
*/ window.location.hash = "#" + id;
selectTab: function (id) { },
window.location.hash = "#" + id;
}, /*
* 根据当前 hash 解析出当前页数及 hash 数组。
/* */
* 根据当前 hash 解析出当前页数及 hash 数组。 analyseHash: function () {
*/ var hash = window.location.hash;
analyseHash: function () { var tag = hash.substr(1, hash.length - 1);
var hash = window.location.hash; var tagList = tag.split("/");
var tag = hash.substr(1, hash.length - 1); var tags = {};
var tagList = tag.split("/"); tags.page = 1,
var tags = {}; tags.hashList = [];
tags.page = 1, for (var i = 0; i < tagList.length; i++) {
tags.hashList = []; if (i === tagList.length - 1 && (/^\d+$/.test(tagList[i]))) {
for (var i = 0; i < tagList.length; i++) { tags.page = tagList[i];
if (i === tagList.length - 1 && (/^\d+$/.test(tagList[i]))) { } else {
tags.page = tagList[i]; tags.hashList.push(tagList[i]);
} else { }
tags.hashList.push(tagList[i]); }
} return tags;
} },
return tags;
}, /*
* 根据当前 hash 设置当前 tab
/* */
* 根据当前 hash 设置当前 tab setCurByHash: function () {
*/ var tags = admin.analyseHash();
setCurByHash: function () { var tab = tags.hashList[1],
var tags = this.analyseHash(); subTab = tags.hashList[2];
var tab = tags.hashList[1],
subTab = tags.hashList[2]; if (tags.hashList.length === 1) {
tab = tags.hashList[0];
if (tags.hashList.length === 1) { }
tab = tags.hashList[0];
} if (tab === "") {
return;
if (tab === "") { }
return;
} // 离开编辑器时进行提示
try {
// 离开编辑器时进行提示 // 除更新、发布、取消发布文章,编辑器中无内容外,离开编辑器需进行提示。
try { if (tab !== "article" && admin.article.isConfirm &&
// 除更新、发布、取消发布文章,编辑器中无内容外,离开编辑器需进行提示。 admin.editorArticle.getContent().replace(/\s/g, '') !== "") {
if (tab !== "article" && admin.article.isConfirm && if (!confirm(Label.editorLeaveLabel)) {
admin.editorArticle.getContent().replace(/\s/g, '') !== "") { window.location.hash = "#article/article";
if (!confirm(Label.editorLeaveLabel)) { return;
window.location.hash = "#article/article"; }
return; }
} // 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
} if (tab === "article" && admin.article.isConfirm &&
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。 admin.editorArticle.getContent().replace(/\s/g, '') !== "") {
if (tab === "article" && admin.article.isConfirm && return;
admin.editorArticle.getContent().replace(/\s/g, '') !== "") { }
return; } catch (e) {
} var $articleContent = $('#articleContent');
} catch (e) { if ($articleContent.length > 0) {
var $articleContent = $('#articleContent'); if (tab !== "article" && admin.article.isConfirm &&
if ($articleContent.length > 0) { $articleContent.val().replace(/\s/g, '') !== "") {
if (tab !== "article" && admin.article.isConfirm && if (!confirm(Label.editorLeaveLabel)) {
$articleContent.val().replace(/\s/g, '') !== "") { window.location.hash = "#article/article";
if (!confirm(Label.editorLeaveLabel)) { return;
window.location.hash = "#article/article"; }
return; }
} // 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
} if (tab === "article" && admin.article.isConfirm &&
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。 $articleContent.val().replace(/\s/g, '') !== "") {
if (tab === "article" && admin.article.isConfirm && return;
$articleContent.val().replace(/\s/g, '') !== "") { }
return; }
} }
}
} // clear article
if (tab !== "article" && admin.editorArticle.setContent) {
// clear article admin.article.clear();
if (tab !== "article" && admin.editorArticle.setContent) { }
admin.article.clear(); admin.article.isConfirm = true;
}
admin.article.isConfirm = true; $("#tabs").tabs("setCurrent", tab);
$("#loadMsg").text(Label.loadingLabel);
$("#tabs").tabs("setCurrent", tab);
$("#loadMsg").text(Label.loadingLabel); if ($("#tabsPanel_" + tab).length === 1) {
if ($("#tabsPanel_" + tab).html().replace(/\s/g, "") === "") {
if ($("#tabsPanel_" + tab).length === 1) { // 还未加载 HTML
if ($("#tabsPanel_" + tab).html().replace(/\s/g, "") === "") { $("#tabsPanel_" + tab).load("admin-" + tab + ".do", function () {
// 还未加载 HTML // 页面加载完后,回调初始函数
$("#tabsPanel_" + tab).load("admin-" + tab + ".do", function () { if (tab === "article" && admin.article.status.id) {
// 页面加载完后,回调初始函数 // 当文章页面编辑器未初始化时,调用更新文章需先初始化编辑器
if (tab === "article" && admin.article.status.id) { admin.register[tab].init.call(admin.register[tab].obj, admin.article.getAndSet);
// 当文章页面编辑器未初始化时,调用更新文章需先初始化编辑器 } else {
admin.register[tab].init.call(admin.register[tab].obj, admin.article.getAndSet); admin.register[tab].init.call(admin.register[tab].obj, tags.page);
} else { }
admin.register[tab].init.call(admin.register[tab].obj, tags.page);
} // 页面包含子 tab,需根据 hash 定位到相应的 tab
if (subTab) {
// 页面包含子 tab,需根据 hash 定位到相应的 tab $("#tab" + tab.substring(0, 1).toUpperCase() + tab.substring(1)).
if (subTab) { tabs("setCurrent", subTab);
$("#tab" + tab.substring(0, 1).toUpperCase() + tab.substring(1)). }
tabs("setCurrent", subTab);
} // 根据 hash 调用现有的插件函数
admin.plugin.setCurByHash(tags);
// 根据 hash 调用现有的插件函数 });
admin.plugin.setCurByHash(tags); } else {
}); if (tab === "article" && admin.article.status.id) {
} else { admin.article.getAndSet();
if (tab === "article" && admin.article.status.id) { }
admin.article.getAndSet();
} // 已加载过 HTML,只需调用刷新函数
if (admin.register[tab] && admin.register[tab].refresh) {
// 已加载过 HTML,只需调用刷新函数 admin.register[tab].refresh.call(admin.register[tab].obj, tags.page);
if (admin.register[tab] && admin.register[tab].refresh) { }
admin.register[tab].refresh.call(admin.register[tab].obj, tags.page);
} // 页面包含子 tab,需根据 hash 定位到相应的 tab
if (subTab) {
// 页面包含子 tab,需根据 hash 定位到相应的 tab $("#tab" + tab.substring(0, 1).toUpperCase() + tab.substring(1)).
if (subTab) { tabs("setCurrent", subTab);
$("#tab" + tab.substring(0, 1).toUpperCase() + tab.substring(1)). }
tabs("setCurrent", subTab);
} // 根据 hash 调用现有的插件函数
admin.plugin.setCurByHash(tags);
// 根据 hash 调用现有的插件函数 }
admin.plugin.setCurByHash(tags); } else {
} $("#tipMsg").text("Error: No tab! " + Label.reportIssueLabel);
} else { $("#loadMsg").text("");
$("#tipMsg").text("Error: No tab! " + Label.reportIssueLabel); }
$("#loadMsg").text(""); },
}
}, /*
* 初始化整个后台
/* */
* 初始化整个后台 init: function () {
*/ //window.onerror = Util.error;
init: function () {
//window.onerror = Util.error; Util.killIE();
$("#loadMsg").text(Label.loadingLabel);
Util.killIE();
$("#loadMsg").text(Label.loadingLabel); // 构建 tabs
$("#tabs").tabs();
// 构建 tabs
$("#tabs").tabs(); // tipMsg
setInterval(function () {
// tipMsg if($("#tipMsg").text() !== "") {
setInterval(function () { setTimeout(function () {
if($("#tipMsg").text() !== "") { $("#tipMsg").text("");
setTimeout(function () { }, 7000);
$("#tipMsg").text(""); }
}, 7000); }, 6000);
} $("#loadMsg").text("");
}, 6000); },
$("#loadMsg").text("");
}, /*
* @description tools and article collapse
/* * @param {bom} it 触发事件对象
* @description tools and article collapse */
* @param {bom} it 触发事件对象 collapseNav: function (it) {
*/ var subNav = $(it).next();
collapseNav: function (it) { subNav.slideToggle("normal", function () {
var subNav = $(it).next(); if (this.style.display !== "none") {
subNav.slideToggle("normal", function () { $(it).find(".ico-arrow-down")[0].className = "ico-arrow-up";
if (this.style.display !== "none") { } else {
$(it).find(".ico-arrow-down")[0].className = "ico-arrow-up"; $(it).find(".ico-arrow-up")[0].className = "ico-arrow-down";
} else { }
$(it).find(".ico-arrow-up")[0].className = "ico-arrow-down"; });
} /*if (subNav.className === "none") {
}); $(it).find(".ico-arrow-down")[0].className = "ico-arrow-up";
/*if (subNav.className === "none") { subNav.className = "collapsed";
$(it).find(".ico-arrow-down")[0].className = "ico-arrow-up"; } else {
subNav.className = "collapsed"; $(it).find(".ico-arrow-up")[0].className = "ico-arrow-down";
} else { subNav.className = "none";
$(it).find(".ico-arrow-up")[0].className = "ico-arrow-down"; }*/
subNav.className = "none"; },
}*/
}, /*
* 后台及当前页面所需插件初始化完后,对权限进行控制及当前页面属于 tools 时,tools 选项需展开。
/* */
* 后台及当前页面所需插件初始化完后,对权限进行控制及当前页面属于 tools 时,tools 选项需展开。 inited: function () {
*/ // Removes functions with the current user role
inited: function () { if (Label.userRole !== "adminRole") {
// Removes functions with the current user role for (var i = 0; i < this.adTools.length; i++) {
if (Label.userRole !== "adminRole") { $("#tabs").tabs("remove", this.adTools[i]);
for (var i = 0; i < this.adTools.length; i++) { }
$("#tabs").tabs("remove", this.adTools[i]); $("#tabs>ul>li").last().remove();
} } else {
$("#tabs>ul>li").last().remove(); // 当前 tab 属于 Tools 时,设其展开
} else { for (var j = 0; j < this.tools.length; j++) {
// 当前 tab 属于 Tools 时,设其展开 if ("#" + window.location.hash.split("/")[1] === this.tools[j]) {
for (var j = 0; j < this.tools.length; j++) { $("#tabToolsTitle").click();
if ("#" + window.location.hash.split("/")[1] === this.tools[j]) { break;
$("#tabToolsTitle").click(); }
break; }
} }
} this.setCurByHash();
} }
this.setCurByHash(); });
}
});
=======
=======
>>>>>>> origin/0.4.6
/*
* 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.
*/
/**
* index for admin
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.1.9, Jun 19, 2012
*/
var Admin = function () {
this.register = {};
// 工具栏下的工具
this.tools = ['#page-list', '#file-list', '#link-list', '#preference',
'#user-list', '#plugin-list', '#others'];
// 多用户时,一般用户不能使用的功能
this.adTools = ['link-list', 'preference', 'file-list', 'page-list',
'user-list', 'plugin-list'];
};
$.extend(Admin.prototype, {
/*
* 登出
*/
logout: function () {
window.location.href = latkeConfig.servePath + "/logout?goto=" + latkeConfig.servePath;
},
/*
* 根据当前页数设置 hash
* @currentPage {string} 当前页
*/
setHashByPage: function (currentPage) {
var hash = window.location.hash,
hashList = hash.split("/");
if (/^\d*$/.test(hashList[hashList.length - 1])) {
hashList[hashList.length - 1] = currentPage;
} else {
hashList.push(currentPage);
}
window.location.hash = hashList.join("/");
},
/*
* 设置某个 tab 被选择
* @id tab id
*/
selectTab: function (id) {
window.location.hash = "#" + id;
},
/*
* 根据当前 hash 解析出当前页数及 hash 数组。
*/
analyseHash: function () {
var hash = window.location.hash;
var tag = hash.substr(1, hash.length - 1);
var tagList = tag.split("/");
var tags = {};
tags.page = 1,
tags.hashList = [];
for (var i = 0; i < tagList.length; i++) {
if (i === tagList.length - 1 && (/^\d+$/.test(tagList[i]))) {
tags.page = tagList[i];
} else {
tags.hashList.push(tagList[i]);
}
}
return tags;
},
/*
* 根据当前 hash 设置当前 tab
*/
setCurByHash: function () {
var tags = admin.analyseHash();
var tab = tags.hashList[1],
subTab = tags.hashList[2];
if (tags.hashList.length === 1) {
tab = tags.hashList[0];
}
if (tab === "") {
return;
}
// 离开编辑器时进行提示
try {
// 除更新、发布、取消发布文章,编辑器中无内容外,离开编辑器需进行提示。
if (tab !== "article" && admin.article.isConfirm &&
admin.editorArticle.getContent().replace(/\s/g, '') !== "") {
if (!confirm(Label.editorLeaveLabel)) {
window.location.hash = "#article/article";
return;
}
}
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
if (tab === "article" && admin.article.isConfirm &&
admin.editorArticle.getContent().replace(/\s/g, '') !== "") {
return;
}
} catch (e) {
var $articleContent = $('#articleContent');
if ($articleContent.length > 0) {
if (tab !== "article" && admin.article.isConfirm &&
$articleContent.val().replace(/\s/g, '') !== "") {
if (!confirm(Label.editorLeaveLabel)) {
window.location.hash = "#article/article";
return;
}
}
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
if (tab === "article" && admin.article.isConfirm &&
$articleContent.val().replace(/\s/g, '') !== "") {
return;
}
}
}
// clear article
if (tab !== "article" && admin.editorArticle.setContent) {
admin.article.clear();
}
admin.article.isConfirm = true;
$("#tabs").tabs("setCurrent", tab);
$("#loadMsg").text(Label.loadingLabel);
if ($("#tabsPanel_" + tab).length === 1) {
if ($("#tabsPanel_" + tab).html().replace(/\s/g, "") === "") {
// 还未加载 HTML
$("#tabsPanel_" + tab).load("admin-" + tab + ".do", function () {
// 页面加载完后,回调初始函数
if (tab === "article" && admin.article.status.id) {
// 当文章页面编辑器未初始化时,调用更新文章需先初始化编辑器
admin.register[tab].init.call(admin.register[tab].obj, admin.article.getAndSet);
} else {
admin.register[tab].init.call(admin.register[tab].obj, tags.page);
}
// 页面包含子 tab,需根据 hash 定位到相应的 tab
if (subTab) {
$("#tab" + tab.substring(0, 1).toUpperCase() + tab.substring(1)).
tabs("setCurrent", subTab);
}
// 根据 hash 调用现有的插件函数
admin.plugin.setCurByHash(tags);
});
} else {
if (tab === "article" && admin.article.status.id) {
admin.article.getAndSet();
}
// 已加载过 HTML,只需调用刷新函数
if (admin.register[tab] && admin.register[tab].refresh) {
admin.register[tab].refresh.call(admin.register[tab].obj, tags.page);
}
// 页面包含子 tab,需根据 hash 定位到相应的 tab
if (subTab) {
$("#tab" + tab.substring(0, 1).toUpperCase() + tab.substring(1)).
tabs("setCurrent", subTab);
}
// 根据 hash 调用现有的插件函数
admin.plugin.setCurByHash(tags);
}
} else {
$("#tipMsg").text("Error: No tab! " + Label.reportIssueLabel);
$("#loadMsg").text("");
}
},
/*
* 初始化整个后台
*/
init: function () {
//window.onerror = Util.error;
Util.killIE();
$("#loadMsg").text(Label.loadingLabel);
// 构建 tabs
$("#tabs").tabs();
// tipMsg
setInterval(function () {
if($("#tipMsg").text() !== "") {
setTimeout(function () {
$("#tipMsg").text("");
}, 7000);
}
}, 6000);
$("#loadMsg").text("");
},
/*
* @description tools and article collapse
* @param {bom} it 触发事件对象
*/
collapseNav: function (it) {
var subNav = $(it).next();
subNav.slideToggle("normal", function () {
if (this.style.display !== "none") {
$(it).find(".ico-arrow-down")[0].className = "ico-arrow-up";
} else {
$(it).find(".ico-arrow-up")[0].className = "ico-arrow-down";
}
});
/*if (subNav.className === "none") {
$(it).find(".ico-arrow-down")[0].className = "ico-arrow-up";
subNav.className = "collapsed";
} else {
$(it).find(".ico-arrow-up")[0].className = "ico-arrow-down";
subNav.className = "none";
}*/
},
/*
* 后台及当前页面所需插件初始化完后,对权限进行控制及当前页面属于 tools 时,tools 选项需展开。
*/
inited: function () {
// Removes functions with the current user role
if (Label.userRole !== "adminRole") {
for (var i = 0; i < this.adTools.length; i++) {
$("#tabs").tabs("remove", this.adTools[i]);
}
$("#tabs>ul>li").last().remove();
} else {
// 当前 tab 属于 Tools 时,设其展开
for (var j = 0; j < this.tools.length; j++) {
if ("#" + window.location.hash.split("/")[1] === this.tools[j]) {
$("#tabToolsTitle").click();
break;
}
}
}
this.setCurByHash();
}
});
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
var admin = new Admin(); var admin = new Admin();
\ No newline at end of file
<<<<<<< HEAD /*
<<<<<<< HEAD * 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");
* * you may not use this file except in compliance with the License.
* Licensed under the Apache License, Version 2.0 (the "License"); * You may obtain a copy of the License at
* 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
* *
* 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,
* Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* distributed under the License is distributed on an "AS IS" BASIS, * See the License for the specific language governing permissions and
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * limitations under the License.
* See the License for the specific language governing permissions and */
* limitations under the License. /**
*/ * @fileoverview KindEditor
/** *
* @fileoverview KindEditor * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* * @version 1.0.0.2, Jun 19, 2012
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> */
* @version 1.0.0.1, May 2, 2012 admin.editors.KindEditor = {
*/ /*
admin.editors.KindEditor = { * @description 初始化编辑器
/* * @param conf 编辑器初始化参数
* @description 初始化编辑器 * @param conf.kind 编辑器类型
* @param conf 编辑器初始化参数 * @param conf.id 编辑器渲染元素 id
* @param conf.kind 编辑器类型 * @param conf.fun 编辑器首次加载完成后回调函数
* @param conf.id 编辑器渲染元素 id */
* @param conf.fun 编辑器首次加载完成后回调函数 init: function (conf) {
*/ var language = "zh_CN";
init: function (conf) { if ("en_US" === Label.localeString) {
var language = "zh_CN"; language = "en"
if ("en_US" === Label.localeString) { }
language = "en"
} if (conf.kind && conf.kind === "simple") {
try {
if (conf.kind && conf.kind === "simple") { this[conf.id] = KindEditor.create('#' + conf.id, {
try { langType : language,
this[conf.id] = KindEditor.create('#' + conf.id, { resizeType: 0,
langType : language, items: ["bold", "italic", "underline", "strikethrough", "|", "undo", "redo", "|",
resizeType: 0, "insertunorderedlist", "insertorderedlist",
items: ["bold", "italic", "underline", "strikethrough", "|", "undo", "redo", "|", ]
"insertunorderedlist", "insertorderedlist", });
] } catch (e) {
}); $("#tipMsg").text("KindEditor load fail");
} catch (e) { }
$("#tipMsg").text("KindEditor load fail"); } else {
} try {
} else { this[conf.id] = KindEditor.create('#' + conf.id, {
try { langType : language,
this[conf.id] = KindEditor.create('#' + conf.id, { items: ["formatblock", "fontname", "fontsize", "|", "bold", "italic", "underline", "strikethrough", "forecolor", "|",
langType : language, "link", "unlink", "image", "media", "|", "pagebreak", "emoticons", "code", "/",
items: ["formatblock", "fontname", "fontsize", "|", "bold", "italic", "underline", "strikethrough", "forecolor", "|", "undo", "redo", "|", "insertunorderedlist", "insertorderedlist", "indent", "outdent", "|",
"link", "unlink", "image", "media", "|", "pagebreak", "emoticons", "code", "/", "justifyleft", "justifycenter", "justifyright", "justifyfull", "|", "plainpaste", "wordpaste", "|",
"undo", "redo", "|", "insertunorderedlist", "insertorderedlist", "indent", "outdent", "|", "clearhtml", "source", "preview"
"justifyleft", "justifycenter", "justifyright", "justifyfull", "|", "plainpaste", "wordpaste", "|", ],
"clearhtml", "source", "preview" afterCreate: function () {
], // TODO: chrome bug
afterCreate: function () { window.onhashchange = admin.setCurByHash;
if (typeof(conf.fun) === "function") { if (typeof(conf.fun) === "function") {
conf.fun(); conf.fun();
} }
} }
}); });
} catch (e) { } catch (e) {
$("#tipMsg").text("KindEditor load fail"); $("#tipMsg").text("KindEditor load fail");
} }
} }
}, },
/* /*
* @description 获取编辑器值 * @description 获取编辑器值
* @param {string} id 编辑器id * @param {string} id 编辑器id
* @returns {string} 编辑器值 * @returns {string} 编辑器值
*/ */
getContent: function (id) { getContent: function (id) {
var content = ""; var content = "";
try { try {
content = this[id].html(); content = this[id].html();
} catch (e) { } catch (e) {
content = $("#" + id).val(); content = $("#" + id).val();
} }
return content; return content;
}, },
/* /*
* @description 设置编辑器值 * @description 设置编辑器值
* @param {string} id 编辑器 id * @param {string} id 编辑器 id
* @param {string} content 设置编辑器值 * @param {string} content 设置编辑器值
*/ */
setContent: function (id, content) { setContent: function (id, content) {
try { try {
this[id].html(content); this[id].html(content);
} catch (e) { } catch (e) {
$("#" + id).val(content); $("#" + id).val(content);
} }
} }
======= };
=======
>>>>>>> origin/0.4.6
/*
* 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 KindEditor
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.2, Jun 19, 2012
*/
admin.editors.KindEditor = {
/*
* @description 初始化编辑器
* @param conf 编辑器初始化参数
* @param conf.kind 编辑器类型
* @param conf.id 编辑器渲染元素 id
* @param conf.fun 编辑器首次加载完成后回调函数
*/
init: function (conf) {
var language = "zh_CN";
if ("en_US" === Label.localeString) {
language = "en"
}
if (conf.kind && conf.kind === "simple") {
try {
this[conf.id] = KindEditor.create('#' + conf.id, {
langType : language,
resizeType: 0,
items: ["bold", "italic", "underline", "strikethrough", "|", "undo", "redo", "|",
"insertunorderedlist", "insertorderedlist",
]
});
} catch (e) {
$("#tipMsg").text("KindEditor load fail");
}
} else {
try {
this[conf.id] = KindEditor.create('#' + conf.id, {
langType : language,
items: ["formatblock", "fontname", "fontsize", "|", "bold", "italic", "underline", "strikethrough", "forecolor", "|",
"link", "unlink", "image", "media", "|", "pagebreak", "emoticons", "code", "/",
"undo", "redo", "|", "insertunorderedlist", "insertorderedlist", "indent", "outdent", "|",
"justifyleft", "justifycenter", "justifyright", "justifyfull", "|", "plainpaste", "wordpaste", "|",
"clearhtml", "source", "preview"
],
afterCreate: function () {
// TODO: chrome bug
window.onhashchange = admin.setCurByHash;
if (typeof(conf.fun) === "function") {
conf.fun();
}
}
});
} catch (e) {
$("#tipMsg").text("KindEditor load fail");
}
}
},
/*
* @description 获取编辑器值
* @param {string} id 编辑器id
* @returns {string} 编辑器值
*/
getContent: function (id) {
var content = "";
try {
content = this[id].html();
} catch (e) {
content = $("#" + id).val();
}
return content;
},
/*
* @description 设置编辑器值
* @param {string} id 编辑器 id
* @param {string} content 设置编辑器值
*/
setContent: function (id, content) {
try {
this[id].html(content);
} catch (e) {
$("#" + id).val(content);
}
}
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
};
\ No newline at end of file
<<<<<<< HEAD /*
<<<<<<< HEAD * 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");
* * you may not use this file except in compliance with the License.
* Licensed under the Apache License, Version 2.0 (the "License"); * You may obtain a copy of the License at
* 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
* *
* 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,
* Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* distributed under the License is distributed on an "AS IS" BASIS, * See the License for the specific language governing permissions and
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * limitations under the License.
* See the License for the specific language governing permissions and */
* limitations under the License. /**
*/ * @fileoverview tinyMCE editor
/** *
* @fileoverview tinyMCE editor * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* * @version 1.0.0.5, Jun 19, 2012
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> */
* @version 1.0.0.4, May 9, 2012 admin.editors.tinyMCE = {
*/ /*
admin.editors.tinyMCE = { * @description 初始化编辑器
/* * @param conf 编辑器初始化参数
* @description 初始化编辑器 * @param conf.kind 编辑器类型
* @param conf 编辑器初始化参数 * @param conf.id 编辑器渲染元素 id
* @param conf.kind 编辑器类型 * @param conf.fun 编辑器首次加载完成后回调函数
* @param conf.id 编辑器渲染元素 id */
* @param conf.fun 编辑器首次加载完成后回调函数 init: function (conf) {
*/ var language = Label.localeString.substring(0, 2);
init: function (conf) { if (language === "zh") {
var language = Label.localeString.substring(0, 2); language = "zh-cn";
if (language === "zh") { }
language = "zh-cn";
} if (conf.kind && conf.kind === "simple") {
try {
if (conf.kind && conf.kind === "simple") { tinyMCE.init({
try { // General options
tinyMCE.init({ language: language,
// General options mode : "exact",
language: language, elements : conf.id,
mode : "exact", theme : "advanced",
elements : conf.id,
theme : "advanced", // Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,undo,redo,|,bullist,numlist",
// Theme options theme_advanced_buttons2 : "",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,undo,redo,|,bullist,numlist", theme_advanced_buttons3 : "",
theme_advanced_buttons2 : "", theme_advanced_toolbar_location : "top",
theme_advanced_buttons3 : "", theme_advanced_toolbar_align : "left",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left", valid_children : "+body[style]"
});
valid_children : "+body[style]" } catch (e) {
}); $("#tipMsg").text("TinyMCE load fail");
} catch (e) { }
$("#tipMsg").text("TinyMCE load fail"); } else {
} try {
} else { tinyMCE.init({
try { // General options
tinyMCE.init({ language: language,
// General options mode : "exact",
language: language, elements : conf.id,
mode : "exact", theme : "advanced",
elements : conf.id, plugins : "autosave,style,advhr,advimage,advlink,preview,inlinepopups,media,paste,syntaxhl,wordcount",
theme : "advanced",
plugins : "autosave,style,advhr,advimage,advlink,preview,inlinepopups,media,paste,syntaxhl,wordcount", // Theme options
theme_advanced_buttons1 : "formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,forecolor,|,advhr,blockquote,syntaxhl,",
// Theme options theme_advanced_buttons2 : "undo,redo,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,pastetext,pasteword,|,link,unlink,image,iespell,media,|,cleanup,code,preview,",
theme_advanced_buttons1 : "formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,forecolor,|,advhr,blockquote,syntaxhl,", theme_advanced_buttons3 : "",
theme_advanced_buttons2 : "undo,redo,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,pastetext,pasteword,|,link,unlink,image,iespell,media,|,cleanup,code,preview,", theme_advanced_toolbar_location : "top",
theme_advanced_buttons3 : "", theme_advanced_toolbar_align : "left",
theme_advanced_toolbar_location : "top", theme_advanced_resizing : true,
theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
theme_advanced_statusbar_location : "bottom", extended_valid_elements: "link[type|rel|href|charset],pre[name|class],iframe[src|width|height|name|align],+a[*]",
extended_valid_elements: "link[type|rel|href|charset],pre[name|class],iframe[src|width|height|name|align],+a[*]", valid_children : "+body[style]",
relative_urls: false,
valid_children : "+body[style]", remove_script_host: false,
relative_urls: false, oninit : function () {
remove_script_host: false, // TODO: chrome bug
oninit : function () { window.onhashchange = admin.setCurByHash;
if (typeof(conf.fun) === "function") { if (typeof(conf.fun) === "function") {
conf.fun(); conf.fun();
} }
} }
}); });
} catch (e) { } catch (e) {
$("#tipMsg").text("TinyMCE load fail"); $("#tipMsg").text("TinyMCE load fail");
} }
} }
}, },
/* /*
* @description 获取编辑器值 * @description 获取编辑器值
* @param {string} id 编辑器id * @param {string} id 编辑器id
* @returns {string} 编辑器值 * @returns {string} 编辑器值
*/ */
getContent: function (id) { getContent: function (id) {
var content = ""; var content = "";
try { try {
content = tinyMCE.get(id).getContent(); content = tinyMCE.get(id).getContent();
} catch (e) { } catch (e) {
content = $("#" + id).val(); content = $("#" + id).val();
} }
return content; return content;
}, },
/* /*
* @description 设置编辑器值 * @description 设置编辑器值
* @param {string} id 编辑器 id * @param {string} id 编辑器 id
* @param {string} content 设置编辑器值 * @param {string} content 设置编辑器值
*/ */
setContent: function (id, content) { setContent: function (id, content) {
try { try {
if (tinyMCE.get(id)) { if (tinyMCE.get(id)) {
tinyMCE.get(id).setContent(content); tinyMCE.get(id).setContent(content);
} else { } else {
$("#" + id).val(content); $("#" + id).val(content);
} }
} catch (e) { } catch (e) {
$("#" + id).val(content); $("#" + id).val(content);
} }
} }
======= };
=======
>>>>>>> origin/0.4.6
/*
* 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 tinyMCE editor
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.5, Jun 19, 2012
*/
admin.editors.tinyMCE = {
/*
* @description 初始化编辑器
* @param conf 编辑器初始化参数
* @param conf.kind 编辑器类型
* @param conf.id 编辑器渲染元素 id
* @param conf.fun 编辑器首次加载完成后回调函数
*/
init: function (conf) {
var language = Label.localeString.substring(0, 2);
if (language === "zh") {
language = "zh-cn";
}
if (conf.kind && conf.kind === "simple") {
try {
tinyMCE.init({
// General options
language: language,
mode : "exact",
elements : conf.id,
theme : "advanced",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,undo,redo,|,bullist,numlist",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
valid_children : "+body[style]"
});
} catch (e) {
$("#tipMsg").text("TinyMCE load fail");
}
} else {
try {
tinyMCE.init({
// General options
language: language,
mode : "exact",
elements : conf.id,
theme : "advanced",
plugins : "autosave,style,advhr,advimage,advlink,preview,inlinepopups,media,paste,syntaxhl,wordcount",
// Theme options
theme_advanced_buttons1 : "formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,forecolor,|,advhr,blockquote,syntaxhl,",
theme_advanced_buttons2 : "undo,redo,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,pastetext,pasteword,|,link,unlink,image,iespell,media,|,cleanup,code,preview,",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_resizing : true,
theme_advanced_statusbar_location : "bottom",
extended_valid_elements: "link[type|rel|href|charset],pre[name|class],iframe[src|width|height|name|align],+a[*]",
valid_children : "+body[style]",
relative_urls: false,
remove_script_host: false,
oninit : function () {
// TODO: chrome bug
window.onhashchange = admin.setCurByHash;
if (typeof(conf.fun) === "function") {
conf.fun();
}
}
});
} catch (e) {
$("#tipMsg").text("TinyMCE load fail");
}
}
},
/*
* @description 获取编辑器值
* @param {string} id 编辑器id
* @returns {string} 编辑器值
*/
getContent: function (id) {
var content = "";
try {
content = tinyMCE.get(id).getContent();
} catch (e) {
content = $("#" + id).val();
}
return content;
},
/*
* @description 设置编辑器值
* @param {string} id 编辑器 id
* @param {string} content 设置编辑器值
*/
setContent: function (id, content) {
try {
if (tinyMCE.get(id)) {
tinyMCE.get(id).setContent(content);
} else {
$("#" + id).val(content);
}
} catch (e) {
$("#" + id).val(content);
}
}
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
};
\ No newline at end of file
<<<<<<< HEAD /*
<<<<<<< HEAD * 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");
* * you may not use this file except in compliance with the License.
* Licensed under the Apache License, Version 2.0 (the "License"); * You may obtain a copy of the License at
* 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
* *
* 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,
* Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* distributed under the License is distributed on an "AS IS" BASIS, * See the License for the specific language governing permissions and
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * limitations under the License.
* See the License for the specific language governing permissions and */
* limitations under the License. /**
*/ * page list for admin
/** *
* page list for admin * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * @version 1.0.2.1, Jun 20, 2012
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> */
* @version 1.0.1.9, May 4, 2012
*/ /* page-list 相关操作 */
admin.pageList = {
/* page-list 相关操作 */ tablePagination: new TablePaginate("page"),
admin.pageList = { pageInfo: {
tablePagination: new TablePaginate("page"), currentCount: 1,
pageInfo: { pageCount: 1,
currentCount: 1, currentPage: 1
pageCount: 1, },
currentPage: 1 id: "",
}, type: "link",
id: "",
type: "link", /*
* 初始化 table, pagination, comments dialog
/* */
* 初始化 table, pagination, comments dialog init: function (page) {
*/ this.tablePagination.buildTable([{
init: function (page) { text: "",
this.tablePagination.buildTable([{ index: "pageOrder",
text: "", width: 60,
index: "pageOrder", style: "padding-left: 12px;font-size:14px;"
width: 60, }, {
style: "padding-left: 12px;font-size:14px;" style: "padding-left: 12px;",
}, { text: Label.titleLabel,
style: "padding-left: 12px;", index: "pageTitle",
text: Label.titleLabel, width: 300
index: "pageTitle", }, {
width: 300 style: "padding-left: 12px;",
}, { text: Label.permalinkLabel,
style: "padding-left: 12px;", index: "pagePermalink",
text: Label.permalinkLabel, minWidth: 300
index: "pagePermalink", }, {
minWidth: 300 style: "padding-left: 12px;",
}, { text: Label.openMethodLabel,
style: "padding-left: 12px;", index: "pageTarget",
text: Label.openMethodLabel, width: 120
index: "pageTarget", }, {
width: 120 style: "padding-left: 12px;",
}, { text: Label.typeLabel,
style: "padding-left: 12px;", index: "pageType",
text: Label.typeLabel, width: 80
index: "pageType", }, {
width: 80 text: Label.commentLabel,
}, { index: "comments",
text: Label.commentLabel, width: 80,
index: "comments", style: "padding-left: 12px;"
width: 80, }]);
style: "padding-left: 12px;" this.tablePagination.initPagination();
}]); this.tablePagination.initCommentsDialog();
this.tablePagination.initPagination(); this.getList(page);
this.tablePagination.initCommentsDialog();
this.getList(page); var language = Label.localeString.substring(0, 2);
if (language === "zh") {
var language = Label.localeString.substring(0, 2); language = "zh-cn";
if (language === "zh") { }
language = "zh-cn";
} admin.editorPage = new Editor({
language: language,
admin.editorPage = new Editor({ kind: "all",
language: language, id: "pageContent"
kind: "all", });
id: "pageContent"
}); // select type
$(".fn-type").click(function () {
// select type var $it = $(this);
$(".fn-type").click(function () { if ($it.hasClass("selected")) {
var $it = $(this); return;
if ($it.hasClass("selected")) { }
return;
} $(".fn-type").removeClass("selected");
$it.addClass("selected");
$(".fn-type").removeClass("selected");
$it.addClass("selected"); admin.pageList.type = $it.data("type");
admin.pageList.type = $it.data("type"); if (admin.pageList.type === "page") {
$("#pagePagePanel").slideDown();
if (admin.pageList.type === "page") {
$("#pagePagePanel").slideDown(); // 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
if (Label.editorType === "CodeMirror-Markdown" && admin.editorPage.getContent() === "") {
// 使用 CodeMirror 编辑器时,当编辑器初识之前,元素为 display:none 时,行号显示不正常 admin.editorPage.setContent("");
if (Label.editorType === "CodeMirror-Markdown" && admin.editorPage.getContent() === "") { }
admin.editorPage.setContent(""); } else {
} $("#pagePagePanel").slideUp();
} else { }
$("#pagePagePanel").slideUp(); });
} },
});
}, /*
* 根据当前页码获取列表
/* * @pagNum 当前页码
* 根据当前页码获取列表 */
* @pagNum 当前页码 getList: function (pageNum) {
*/ $("#loadMsg").text(Label.loadingLabel);
getList: function (pageNum) { var that = this;
$("#loadMsg").text(Label.loadingLabel);
var that = this; $.ajax({
url: latkeConfig.servePath + "/console/pages/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
$.ajax({ type: "GET",
url: latkeConfig.servePath + "/console/pages/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE, cache: false,
type: "GET", success: function(result, textStatus){
cache: false, $("#tipMsg").text(result.msg);
success: function(result, textStatus){ if (!result.sc) {
$("#tipMsg").text(result.msg); $("#loadMsg").text("");
if (!result.sc) { return;
$("#loadMsg").text(""); }
return;
} var pages = result.pages;
var pageData = [];
var pages = result.pages; admin.pageList.pageInfo.currentCount = pages.length;
var pageData = []; admin.pageList.pageInfo.pageCount = result.pagination.paginationPageCount === 0 ? 1 : result.pagination.paginationPageCount;
admin.pageList.pageInfo.currentCount = pages.length; for (var i = 0; i < pages.length; i++) {
admin.pageList.pageInfo.pageCount = result.pagination.paginationPageCount === 0 ? 1 : result.pagination.paginationPageCount; pageData[i] = {};
for (var i = 0; i < pages.length; i++) { if (i === 0) {
pageData[i] = {}; if (pages.length === 1) {
if (i === 0) { pageData[i].pageOrder = "";
if (pages.length === 1) { } else {
pageData[i].pageOrder = ""; pageData[i].pageOrder = '<div class="table-center" style="width:14px">\
} else { <span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'down\');" \
pageData[i].pageOrder = '<div class="table-center" style="width:14px">\ class="table-downIcon"></span></div>';
<span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'down\');" \ }
class="table-downIcon"></span></div>'; } else if (i === pages.length - 1) {
} pageData[i].pageOrder = '<div class="table-center" style="width:14px">\
} else if (i === pages.length - 1) { <span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'up\');" class="table-upIcon"></span>\
pageData[i].pageOrder = '<div class="table-center" style="width:14px">\ </div>';
<span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'up\');" class="table-upIcon"></span>\ } else {
</div>'; pageData[i].pageOrder = '<div class="table-center" style="width:38px">\
} else { <span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'up\');" class="table-upIcon"></span>\
pageData[i].pageOrder = '<div class="table-center" style="width:38px">\ <span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'down\');" class="table-downIcon"></span>\
<span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'up\');" class="table-upIcon"></span>\ </div>';
<span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'down\');" class="table-downIcon"></span>\ }
</div>';
} pageData[i].pageTitle = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>" +
pages[i].pageTitle + "</a>";
pageData[i].pageTitle = "<a class='no-underline' href='" + latkeConfig.servePath + pages[i].pagePermalink + "' target='_blank'>" + pageData[i].pagePermalink = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>"
pages[i].pageTitle + "</a>"; + pages[i].pagePermalink + "</a>";
pageData[i].pagePermalink = "<a class='no-underline' href='" + latkeConfig.servePath + pages[i].pagePermalink + "' target='_blank'>" pageData[i].pageTarget = pages[i].pageOpenTarget;
+ pages[i].pagePermalink + "</a>"; pageData[i].pageType = pages[i].pageType ;
pageData[i].pageTarget = pages[i].pageOpenTarget; pageData[i].comments = pages[i].pageCommentCount;
pageData[i].pageType = pages[i].pageType ; pageData[i].expendRow = "<span><a href='" + pages[i].pagePermalink + "' target='_blank'>" + Label.viewLabel + "</a> \
pageData[i].comments = pages[i].pageCommentCount; <a href='javascript:void(0)' onclick=\"admin.pageList.get('" + pages[i].oId + "')\">" + Label.updateLabel + "</a>\
pageData[i].expendRow = "<span><a href='" + latkeConfig.servePath + pages[i].pagePermalink + "' target='_blank'>" + Label.viewLabel + "</a> \ <a href='javascript:void(0)' onclick=\"admin.pageList.del('" + pages[i].oId + "')\">" + Label.removeLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.pageList.get('" + pages[i].oId + "')\">" + Label.updateLabel + "</a>\ <a href='javascript:void(0)' onclick=\"admin.comment.open('" + pages[i].oId + "', 'page')\">" + Label.commentLabel + "</a></span>";
<a href='javascript:void(0)' onclick=\"admin.pageList.del('" + pages[i].oId + "')\">" + Label.removeLabel + "</a>\ }
<a href='javascript:void(0)' onclick=\"admin.comment.open('" + pages[i].oId + "', 'page')\">" + Label.commentLabel + "</a></span>";
} that.tablePagination.updateTablePagination(pageData, pageNum, result.pagination);
that.tablePagination.updateTablePagination(pageData, pageNum, result.pagination); $("#loadMsg").text("");
}
$("#loadMsg").text(""); });
} },
});
}, /*
* 获取自定义页面
/* * @id 自定义页面 id
* 获取自定义页面 */
* @id 自定义页面 id get: function (id) {
*/ $("#loadMsg").text(Label.loadingLabel);
get: function (id) { $("#tipMsg").text("");
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text(""); $.ajax({
url: latkeConfig.servePath + "/console/page/" + id,
$.ajax({ type: "GET",
url: latkeConfig.servePath + "/console/page/" + id, cache: false,
type: "GET", success: function(result, textStatus){
cache: false, $("#tipMsg").text(result.msg);
success: function(result, textStatus){ if (!result.sc) {
$("#tipMsg").text(result.msg); $("#loadMsg").text("");
if (!result.sc) { return;
$("#loadMsg").text(""); }
return;
} admin.pageList.id = id;
admin.pageList.id = id; $("#pageTitle").val(result.page.pageTitle);
$("#pagePermalink").val(result.page.pagePermalink);
$("#pageTitle").val(result.page.pageTitle); $("#pageTarget").val(result.page.pageOpenTarget);
$("#pagePermalink").val(result.page.pagePermalink); if (result.page.pageType === "page") {
$("#pageTarget").val(result.page.pageOpenTarget); $($(".fn-type").get(1)).click();
if (result.page.pageType === "page") { } else {
$($(".fn-type").get(1)).click(); $($(".fn-type").get(0)).click();
} else { }
$($(".fn-type").get(0)).click(); $("#pageCommentable").prop("checked", result.page.pageCommentable);
}
$("#pageCommentable").prop("checked", result.page.pageCommentable); admin.editorPage.setContent(result.page.pageContent);
admin.editorPage.setContent(result.page.pageContent); $("#loadMsg").text("");
}
$("#loadMsg").text(""); });
} },
});
}, /*
* 删除自定义页面
/* * @id 自定义页面 id
* 删除自定义页面 */
* @id 自定义页面 id del: function (id) {
*/ var isDelete = confirm(Label.confirmRemoveLabel);
del: function (id) { if (isDelete) {
var isDelete = confirm(Label.confirmRemoveLabel); $("#loadMsg").text(Label.loadingLabel);
if (isDelete) { $("#tipMsg").text("");
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text(""); $.ajax({
url: latkeConfig.servePath + "/console/page/" + id,
$.ajax({ type: "DELETE",
url: latkeConfig.servePath + "/console/page/" + id, cache: false,
type: "DELETE", success: function(result, textStatus){
cache: false, $("#tipMsg").text(result.msg);
success: function(result, textStatus){ if (!result.sc) {
$("#tipMsg").text(result.msg); $("#loadMsg").text("");
if (!result.sc) { return;
$("#loadMsg").text(""); }
return;
} var pageNum = admin.pageList.pageInfo.currentPage;
if (admin.pageList.pageInfo.currentCount === 1 && admin.pageList.pageInfo.pageCount !== 1 &&
var pageNum = admin.pageList.pageInfo.currentPage; admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) {
if (admin.pageList.pageInfo.currentCount === 1 && admin.pageList.pageInfo.pageCount !== 1 && admin.pageList.pageInfo.pageCount--;
admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) { pageNum = admin.pageList.pageInfo.pageCount;
admin.pageList.pageInfo.pageCount--; }
pageNum = admin.pageList.pageInfo.pageCount; var hashList = window.location.hash.split("/");
} if (pageNum == hashList[hashList.length - 1]) {
var hashList = window.location.hash.split("/"); admin.pageList.getList(pageNum);
if (pageNum == hashList[hashList.length - 1]) { } else {
admin.pageList.getList(pageNum); admin.setHashByPage(pageNum);
} else { }
admin.setHashByPage(pageNum);
} $("#loadMsg").text("");
}
$("#loadMsg").text(""); });
} }
}); },
}
}, /*
* 添加自定义页面
/* */
* 添加自定义页面 add: function () {
*/ if (this.validate()) {
add: function () { $("#loadMsg").text(Label.loadingLabel);
if (this.validate()) { $("#tipMsg").text("");
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text(""); var pageContent = admin.editorPage.getContent();
var pageContent = admin.editorPage.getContent(); var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, "");
if (admin.pageList.type === "link") {
var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, ""); pagePermalink = Util.proessURL(pagePermalink);
if (admin.pageList.type === "link") { }
pagePermalink = Util.proessURL(pagePermalink);
} var requestJSONObject = {
"page": {
var requestJSONObject = { "pageTitle": $("#pageTitle").val(),
"page": { "pageContent": pageContent,
"pageTitle": $("#pageTitle").val(), "pagePermalink": pagePermalink,
"pageContent": pageContent, "pageCommentable": $("#pageCommentable").prop("checked"),
"pagePermalink": pagePermalink, "pageType": admin.pageList.type,
"pageCommentable": $("#pageCommentable").prop("checked"), "pageOpenTarget": $("#pageTarget").val()
"pageType": admin.pageList.type, }
"pageOpenTarget": $("#pageTarget").val() };
}
}; $.ajax({
url: latkeConfig.servePath + "/console/page/",
$.ajax({ type: "POST",
url: latkeConfig.servePath + "/console/page/", cache: false,
type: "POST", data: JSON.stringify(requestJSONObject),
cache: false, success: function(result, textStatus){
data: JSON.stringify(requestJSONObject), $("#tipMsg").text(result.msg);
success: function(result, textStatus){ if (!result.sc) {
$("#tipMsg").text(result.msg); $("#loadMsg").text("");
if (!result.sc) { return;
$("#loadMsg").text(""); }
return;
} admin.pageList.id = "";
$("#pagePermalink").val("");
admin.pageList.id = ""; $("#pageTitle").val("");
$("#pagePermalink").val(""); $("#pageCommentable").prop("cheked", false);
$("#pageTitle").val(""); $("#pageTarget").val("_self");
$("#pageCommentable").prop("cheked", false); $($(".fn-type").get(0)).click();
$("#pageTarget").val("_self");
$($(".fn-type").get(0)).click(); admin.editorPage.setContent("");
admin.editorPage.setContent(""); if (admin.pageList.pageInfo.currentCount === Label.PAGE_SIZE &&
admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) {
if (admin.pageList.pageInfo.currentCount === Label.PAGE_SIZE && admin.pageList.pageInfo.pageCount++;
admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) { }
admin.pageList.pageInfo.pageCount++; var hashList = window.location.hash.split("/");
} if (admin.pageList.pageInfo.pageCount == hashList[hashList.length - 1]) {
var hashList = window.location.hash.split("/"); admin.pageList.getList(admin.pageList.pageInfo.pageCount);
if (admin.pageList.pageInfo.pageCount == hashList[hashList.length - 1]) { } else {
admin.pageList.getList(admin.pageList.pageInfo.pageCount); admin.setHashByPage(admin.pageList.pageInfo.pageCount);
} else { }
admin.setHashByPage(admin.pageList.pageInfo.pageCount);
} $("#loadMsg").text("");
}
$("#loadMsg").text(""); });
} }
}); },
}
}, /*
* 更新自定义页面
/* */
* 更新自定义页面 update: function () {
*/ if (this.validate()) {
update: function () { $("#loadMsg").text(Label.loadingLabel);
if (this.validate()) { $("#tipMsg").text("");
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text(""); var pageContent = admin.editorPage.getContent();
var pageContent = admin.editorPage.getContent(); var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, "");
if (admin.pageList.type === "link") {
var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, ""); pagePermalink = Util.proessURL(pagePermalink);
if (admin.pageList.type === "link") { }
pagePermalink = Util.proessURL(pagePermalink);
}
var requestJSONObject = {
"page": {
var requestJSONObject = { "pageTitle": $("#pageTitle").val(),
"page": { "oId": this.id,
"pageTitle": $("#pageTitle").val(), "pageContent": pageContent,
"oId": this.id, "pagePermalink": pagePermalink,
"pageContent": pageContent, "pageCommentable": $("#pageCommentable").prop("checked"),
"pagePermalink": pagePermalink, "pageType": admin.pageList.type,
"pageCommentable": $("#pageCommentable").prop("checked"), "pageOpenTarget": $("#pageTarget").val()
"pageType": admin.pageList.type, }
"pageOpenTarget": $("#pageTarget").val() };
}
}; $.ajax({
url: latkeConfig.servePath + "/console/page/",
$.ajax({ type: "PUT",
url: latkeConfig.servePath + "/console/page/", cache: false,
type: "PUT", data: JSON.stringify(requestJSONObject),
cache: false, success: function(result, textStatus){
data: JSON.stringify(requestJSONObject), $("#tipMsg").text(result.msg);
success: function(result, textStatus){
$("#tipMsg").text(result.msg); if (!result.sc) {
$("#loadMsg").text("");
if (!result.sc) { return;
$("#loadMsg").text(""); }
return; admin.pageList.id = "";
}
admin.pageList.id = ""; admin.pageList.getList(admin.pageList.pageInfo.currentPage);
$("#pageTitle").val("");
admin.pageList.getList(admin.pageList.pageInfo.currentPage); $("#pagePermalink").val("");
$("#pageTitle").val(""); $("#pageCommentable").prop("cheked", false);
$("#pagePermalink").val(""); $("#pageTarget").val("_self");
$("#pageCommentable").prop("cheked", false); $($(".fn-type").get(0)).click();
$("#pageTarget").val("_self");
$($(".fn-type").get(0)).click(); admin.editorPage.setContent("");
admin.editorPage.setContent(""); $("#loadMsg").text("");
}
$("#loadMsg").text(""); });
} }
}); },
}
}, /*
* 验证字段
/* */
* 验证字段 validate: function () {
*/ if ($("#pageTitle").val().replace(/\s/g, "") === "") {
validate: function () { $("#tipMsg").text(Label.titleEmptyLabel);
if ($("#pageTitle").val().replace(/\s/g, "") === "") { $("#pageTitle").focus();
$("#tipMsg").text(Label.titleEmptyLabel); } else if (admin.pageList.type === "link" &&
$("#pageTitle").focus(); $("#pagePermalink").val().replace(/\s/g, "") === "") {
} else if (admin.pageList.type === "link" && $("#tipMsg").text(Label.linkEmptyLabel);
$("#pagePermalink").val().replace(/\s/g, "") === "") { } else {
$("#tipMsg").text(Label.linkEmptyLabel); return true;
} else { }
return true; return false;
} },
return false;
}, /*
* 提交自定义页面
/* */
* 提交自定义页面 submit: function () {
*/ if (this.id !== "") {
submit: function () { this.update();
if (this.id !== "") { } else {
this.update(); this.add();
} else { }
this.add(); },
}
}, /*
* 调换顺序
/* */
* 调换顺序 changeOrder: function (id, order, status) {
*/ $("#loadMsg").text(Label.loadingLabel);
changeOrder: function (id, order, status) { $("#tipMsg").text("");
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text(""); var requestJSONObject = {
"oId": id.toString(),
var requestJSONObject = { "direction": status
"oId": id.toString(), };
"direction": status
}; $.ajax({
url: latkeConfig.servePath + "/console/page/order/",
$.ajax({ type: "PUT",
url: latkeConfig.servePath + "/console/page/order/", cache: false,
type: "PUT", data: JSON.stringify(requestJSONObject),
cache: false, success: function(result, textStatus){
data: JSON.stringify(requestJSONObject), $("#tipMsg").text(result.msg);
success: function(result, textStatus){
$("#tipMsg").text(result.msg); // Refershes the page list
admin.pageList.getList(admin.pageList.pageInfo.currentPage);
// Refershes the page list
admin.pageList.getList(admin.pageList.pageInfo.currentPage); $("#loadMsg").text("");
}
$("#loadMsg").text(""); });
} }
}); };
}
}; /*
* 注册到 admin 进行管理
/* */
* 注册到 admin 进行管理 admin.register["page-list"] = {
*/ "obj": admin.pageList,
admin.register["page-list"] = { "init": admin.pageList.init,
"obj": admin.pageList, "refresh": admin.pageList.getList
"init": admin.pageList.init, }
"refresh": admin.pageList.getList
=======
=======
>>>>>>> origin/0.4.6
/*
* 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.
*/
/**
* page list for admin
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.2.1, Jun 20, 2012
*/
/* page-list 相关操作 */
admin.pageList = {
tablePagination: new TablePaginate("page"),
pageInfo: {
currentCount: 1,
pageCount: 1,
currentPage: 1
},
id: "",
type: "link",
/*
* 初始化 table, pagination, comments dialog
*/
init: function (page) {
this.tablePagination.buildTable([{
text: "",
index: "pageOrder",
width: 60,
style: "padding-left: 12px;font-size:14px;"
}, {
style: "padding-left: 12px;",
text: Label.titleLabel,
index: "pageTitle",
width: 300
}, {
style: "padding-left: 12px;",
text: Label.permalinkLabel,
index: "pagePermalink",
minWidth: 300
}, {
style: "padding-left: 12px;",
text: Label.openMethodLabel,
index: "pageTarget",
width: 120
}, {
style: "padding-left: 12px;",
text: Label.typeLabel,
index: "pageType",
width: 80
}, {
text: Label.commentLabel,
index: "comments",
width: 80,
style: "padding-left: 12px;"
}]);
this.tablePagination.initPagination();
this.tablePagination.initCommentsDialog();
this.getList(page);
var language = Label.localeString.substring(0, 2);
if (language === "zh") {
language = "zh-cn";
}
admin.editorPage = new Editor({
language: language,
kind: "all",
id: "pageContent"
});
// select type
$(".fn-type").click(function () {
var $it = $(this);
if ($it.hasClass("selected")) {
return;
}
$(".fn-type").removeClass("selected");
$it.addClass("selected");
admin.pageList.type = $it.data("type");
if (admin.pageList.type === "page") {
$("#pagePagePanel").slideDown();
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
if (Label.editorType === "CodeMirror-Markdown" && admin.editorPage.getContent() === "") {
admin.editorPage.setContent("");
}
} else {
$("#pagePagePanel").slideUp();
}
});
},
/*
* 根据当前页码获取列表
* @pagNum 当前页码
*/
getList: function (pageNum) {
$("#loadMsg").text(Label.loadingLabel);
var that = this;
$.ajax({
url: latkeConfig.servePath + "/console/pages/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
type: "GET",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var pages = result.pages;
var pageData = [];
admin.pageList.pageInfo.currentCount = pages.length;
admin.pageList.pageInfo.pageCount = result.pagination.paginationPageCount === 0 ? 1 : result.pagination.paginationPageCount;
for (var i = 0; i < pages.length; i++) {
pageData[i] = {};
if (i === 0) {
if (pages.length === 1) {
pageData[i].pageOrder = "";
} else {
pageData[i].pageOrder = '<div class="table-center" style="width:14px">\
<span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'down\');" \
class="table-downIcon"></span></div>';
}
} else if (i === pages.length - 1) {
pageData[i].pageOrder = '<div class="table-center" style="width:14px">\
<span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'up\');" class="table-upIcon"></span>\
</div>';
} else {
pageData[i].pageOrder = '<div class="table-center" style="width:38px">\
<span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'up\');" class="table-upIcon"></span>\
<span onclick="admin.pageList.changeOrder(' + pages[i].oId + ', ' + i + ', \'down\');" class="table-downIcon"></span>\
</div>';
}
pageData[i].pageTitle = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>" +
pages[i].pageTitle + "</a>";
pageData[i].pagePermalink = "<a class='no-underline' href='" + pages[i].pagePermalink + "' target='_blank'>"
+ pages[i].pagePermalink + "</a>";
pageData[i].pageTarget = pages[i].pageOpenTarget;
pageData[i].pageType = pages[i].pageType ;
pageData[i].comments = pages[i].pageCommentCount;
pageData[i].expendRow = "<span><a href='" + pages[i].pagePermalink + "' target='_blank'>" + Label.viewLabel + "</a> \
<a href='javascript:void(0)' onclick=\"admin.pageList.get('" + pages[i].oId + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.pageList.del('" + pages[i].oId + "')\">" + Label.removeLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.comment.open('" + pages[i].oId + "', 'page')\">" + Label.commentLabel + "</a></span>";
}
that.tablePagination.updateTablePagination(pageData, pageNum, result.pagination);
$("#loadMsg").text("");
}
});
},
/*
* 获取自定义页面
* @id 自定义页面 id
*/
get: function (id) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/page/" + id,
type: "GET",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
admin.pageList.id = id;
$("#pageTitle").val(result.page.pageTitle);
$("#pagePermalink").val(result.page.pagePermalink);
$("#pageTarget").val(result.page.pageOpenTarget);
if (result.page.pageType === "page") {
$($(".fn-type").get(1)).click();
} else {
$($(".fn-type").get(0)).click();
}
$("#pageCommentable").prop("checked", result.page.pageCommentable);
admin.editorPage.setContent(result.page.pageContent);
$("#loadMsg").text("");
}
});
},
/*
* 删除自定义页面
* @id 自定义页面 id
*/
del: function (id) {
var isDelete = confirm(Label.confirmRemoveLabel);
if (isDelete) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/page/" + id,
type: "DELETE",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var pageNum = admin.pageList.pageInfo.currentPage;
if (admin.pageList.pageInfo.currentCount === 1 && admin.pageList.pageInfo.pageCount !== 1 &&
admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) {
admin.pageList.pageInfo.pageCount--;
pageNum = admin.pageList.pageInfo.pageCount;
}
var hashList = window.location.hash.split("/");
if (pageNum == hashList[hashList.length - 1]) {
admin.pageList.getList(pageNum);
} else {
admin.setHashByPage(pageNum);
}
$("#loadMsg").text("");
}
});
}
},
/*
* 添加自定义页面
*/
add: function () {
if (this.validate()) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var pageContent = admin.editorPage.getContent();
var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, "");
if (admin.pageList.type === "link") {
pagePermalink = Util.proessURL(pagePermalink);
}
var requestJSONObject = {
"page": {
"pageTitle": $("#pageTitle").val(),
"pageContent": pageContent,
"pagePermalink": pagePermalink,
"pageCommentable": $("#pageCommentable").prop("checked"),
"pageType": admin.pageList.type,
"pageOpenTarget": $("#pageTarget").val()
}
};
$.ajax({
url: latkeConfig.servePath + "/console/page/",
type: "POST",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
admin.pageList.id = "";
$("#pagePermalink").val("");
$("#pageTitle").val("");
$("#pageCommentable").prop("cheked", false);
$("#pageTarget").val("_self");
$($(".fn-type").get(0)).click();
admin.editorPage.setContent("");
if (admin.pageList.pageInfo.currentCount === Label.PAGE_SIZE &&
admin.pageList.pageInfo.currentPage === admin.pageList.pageInfo.pageCount) {
admin.pageList.pageInfo.pageCount++;
}
var hashList = window.location.hash.split("/");
if (admin.pageList.pageInfo.pageCount == hashList[hashList.length - 1]) {
admin.pageList.getList(admin.pageList.pageInfo.pageCount);
} else {
admin.setHashByPage(admin.pageList.pageInfo.pageCount);
}
$("#loadMsg").text("");
}
});
}
},
/*
* 更新自定义页面
*/
update: function () {
if (this.validate()) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var pageContent = admin.editorPage.getContent();
var pagePermalink = $("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g, "");
if (admin.pageList.type === "link") {
pagePermalink = Util.proessURL(pagePermalink);
}
var requestJSONObject = {
"page": {
"pageTitle": $("#pageTitle").val(),
"oId": this.id,
"pageContent": pageContent,
"pagePermalink": pagePermalink,
"pageCommentable": $("#pageCommentable").prop("checked"),
"pageType": admin.pageList.type,
"pageOpenTarget": $("#pageTarget").val()
}
};
$.ajax({
url: latkeConfig.servePath + "/console/page/",
type: "PUT",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
admin.pageList.id = "";
admin.pageList.getList(admin.pageList.pageInfo.currentPage);
$("#pageTitle").val("");
$("#pagePermalink").val("");
$("#pageCommentable").prop("cheked", false);
$("#pageTarget").val("_self");
$($(".fn-type").get(0)).click();
admin.editorPage.setContent("");
$("#loadMsg").text("");
}
});
}
},
/*
* 验证字段
*/
validate: function () {
if ($("#pageTitle").val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.titleEmptyLabel);
$("#pageTitle").focus();
} else if (admin.pageList.type === "link" &&
$("#pagePermalink").val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.linkEmptyLabel);
} else {
return true;
}
return false;
},
/*
* 提交自定义页面
*/
submit: function () {
if (this.id !== "") {
this.update();
} else {
this.add();
}
},
/*
* 调换顺序
*/
changeOrder: function (id, order, status) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var requestJSONObject = {
"oId": id.toString(),
"direction": status
};
$.ajax({
url: latkeConfig.servePath + "/console/page/order/",
type: "PUT",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
// Refershes the page list
admin.pageList.getList(admin.pageList.pageInfo.currentPage);
$("#loadMsg").text("");
}
});
}
};
/*
* 注册到 admin 进行管理
*/
admin.register["page-list"] = {
"obj": admin.pageList,
"init": admin.pageList.init,
"refresh": admin.pageList.getList
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
}
\ No newline at end of file
<<<<<<< HEAD /*
<<<<<<< HEAD * 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");
* * you may not use this file except in compliance with the License.
* Licensed under the Apache License, Version 2.0 (the "License"); * You may obtain a copy of the License at
* 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
* *
* 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,
* Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* distributed under the License is distributed on an "AS IS" BASIS, * See the License for the specific language governing permissions and
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * limitations under the License.
* See the License for the specific language governing permissions and */
* limitations under the License. /**
*/ * preference for admin.
/** *
* preference for admin. * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> * @version 1.0.1.5, Jun 26, 2012
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> */
* @version 1.0.1.4, May 3, 2012
*/ /* preference 相关操作 */
admin.preference = {
/* preference 相关操作 */ locale: "",
admin.preference = { editorType: "",
locale: "",
editorType: "", /*
* 初始化
/* */
* 初始化 init: function () {
*/ $("#tabPreference").tabs();
init: function () {
$("#tabPreference").tabs(); $.ajax({
url: latkeConfig.servePath + "/console/preference/",
$.ajax({ type: "GET",
url: latkeConfig.servePath + "/console/preference/", cache: false,
type: "GET", success: function(result, textStatus){
cache: false, $("#tipMsg").text(result.msg);
success: function(result, textStatus){ if (!result.sc) {
$("#tipMsg").text(result.msg); $("#loadMsg").text("");
if (!result.sc) { return;
$("#loadMsg").text(""); }
return;
} var preference = result.preference;
var preference = result.preference; // 线上环境严禁使用 localhost, 默认将其设为 host
if (preference.blogHost.indexOf("localhost") > -1 && Label.miniPostfix === ".min") {
// 线上环境严禁使用 localhost, 默认将其设为 host preference.blogHost = window.location.host;
if (preference.blogHost.indexOf("localhost") > -1 && Label.miniPostfix === ".min") { $("#tipMsg").text(Label.resetBlogHostLabel);
preference.blogHost = window.location.host; }
$("#tipMsg").text(Label.resetBlogHostLabel);
} $("#metaKeywords").val(preference.metaKeywords),
$("#metaDescription").val(preference.metaDescription),
$("#metaKeywords").val(preference.metaKeywords), $("#blogTitle").val(preference.blogTitle),
$("#metaDescription").val(preference.metaDescription), $("#blogSubtitle").val(preference.blogSubtitle),
$("#blogTitle").val(preference.blogTitle), $("#mostCommentArticleDisplayCount").val(preference.mostCommentArticleDisplayCount);
$("#blogSubtitle").val(preference.blogSubtitle), $("#mostViewArticleDisplayCount").val(preference.mostViewArticleDisplayCount),
$("#mostCommentArticleDisplayCount").val(preference.mostCommentArticleDisplayCount); $("#recentCommentDisplayCount").val(preference.recentCommentDisplayCount);
$("#mostViewArticleDisplayCount").val(preference.mostViewArticleDisplayCount), $("#mostUsedTagDisplayCount").val(preference.mostUsedTagDisplayCount);
$("#recentCommentDisplayCount").val(preference.recentCommentDisplayCount); $("#articleListDisplayCount").val(preference.articleListDisplayCount);
$("#mostUsedTagDisplayCount").val(preference.mostUsedTagDisplayCount); $("#articleListPaginationWindowSize").val(preference.articleListPaginationWindowSize);
$("#articleListDisplayCount").val(preference.articleListDisplayCount); $("#blogHost").val(preference.blogHost);
$("#articleListPaginationWindowSize").val(preference.articleListPaginationWindowSize); $("#localeString").val(preference.localeString);
$("#blogHost").val(preference.blogHost); $("#timeZoneId").val(preference.timeZoneId);
$("#localeString").val(preference.localeString); $("#noticeBoard").val(preference.noticeBoard);
$("#timeZoneId").val(preference.timeZoneId); $("#htmlHead").val(preference.htmlHead);
$("#noticeBoard").val(preference.noticeBoard); $("#externalRelevantArticlesDisplayCount").val(preference.externalRelevantArticlesDisplayCount);
$("#htmlHead").val(preference.htmlHead); $("#relevantArticlesDisplayCount").val(preference.relevantArticlesDisplayCount);
$("#externalRelevantArticlesDisplayCount").val(preference.externalRelevantArticlesDisplayCount); $("#randomArticlesDisplayCount").val(preference.randomArticlesDisplayCount);
$("#relevantArticlesDisplayCount").val(preference.relevantArticlesDisplayCount); $("#keyOfSolo").val(preference.keyOfSolo);
$("#randomArticlesDisplayCount").val(preference.randomArticlesDisplayCount); preference.enableArticleUpdateHint ? $("#enableArticleUpdateHint").attr("checked", "checked") : $("#enableArticleUpdateHint").removeAttr("checked");
$("#keyOfSolo").val(preference.keyOfSolo);
preference.enableArticleUpdateHint ? $("#enableArticleUpdateHint").attr("checked", "checked") : $("#enableArticleUpdateHint").removeAttr("checked"); preference.allowVisitDraftViaPermalink ? $("#allowVisitDraftViaPermalink").attr("checked", "checked") : $("allowVisitDraftViaPermalink").removeAttr("checked");
preference.allowVisitDraftViaPermalink ? $("#allowVisitDraftViaPermalink").attr("checked", "checked") : $("allowVisitDraftViaPermalink").removeAttr("checked"); admin.preference.locale = preference.localeString;
admin.preference.editorType = preference.editorType;
admin.preference.locale = preference.localeString;
admin.preference.editorType = preference.editorType; // skin
$("#skinMain").data("skinDirName", preference.skinDirName);
// skin var skins = eval('(' + preference.skins + ')');
$("#skinMain").data("skinDirName", preference.skinDirName); var skinsHTML = "";
var skins = eval('(' + preference.skins + ')'); for (var i = 0; i < skins.length; i++) {
var skinsHTML = ""; if (skins[i].skinName === preference.skinName
for (var i = 0; i < skins.length; i++) { && skins[i].skinDirName === preference.skinDirName ) {
if (skins[i].skinName === preference.skinName skinsHTML += "<div title='" + skins[i].skinDirName
&& skins[i].skinDirName === preference.skinDirName ) { + "' class='left skinItem selected'><img class='skinPreview' src='skins/"
skinsHTML += "<div title='" + skins[i].skinDirName + skins[i].skinDirName + "/preview.png'/><div>" + skins[i].skinName + "</div></div>"
+ "' class='left skinItem selected'><img class='skinPreview' src='skins/" } else {
+ skins[i].skinDirName + "/preview.png'/><div>" + skins[i].skinName + "</div></div>" skinsHTML += "<div title='" + skins[i].skinDirName
} else { + "' class='left skinItem'><img class='skinPreview' src='skins/"
skinsHTML += "<div title='" + skins[i].skinDirName + skins[i].skinDirName + "/preview.png'/><div>" + skins[i].skinName + "</div></div>"
+ "' class='left skinItem'><img class='skinPreview' src='skins/" }
+ skins[i].skinDirName + "/preview.png'/><div>" + skins[i].skinName + "</div></div>" }
} $("#skinMain").append(skinsHTML + "<div class='clear'></div>");
}
$("#skinMain").append(skinsHTML + "<div class='clear'></div>"); $(".skinItem").click(function () {
$(".skinItem").removeClass("selected");
$(".skinItem").click(function () { $(this).addClass("selected");
$(".skinItem").removeClass("selected"); $("#skinMain").data("skinDirName", this.title);
$(this).addClass("selected"); });
$("#skinMain").data("skinDirName", this.title);
}); // sign
var signs = eval('(' + preference.signs + ')');
// sign for (var j = 1; j < signs.length; j++) {
var signs = eval('(' + preference.signs + ')'); $("#preferenceSign" + j).val(signs[j].signHTML);
for (var j = 1; j < signs.length; j++) { $("#preferenceSignButton" + j).tip({
$("#preferenceSign" + j).val(signs[j].signHTML); content: signs[j].signHTML === "" ? Label.signIsNullLabel : signs[j].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, ""),
$("#preferenceSignButton" + j).tip({ position: "bottom"
content: signs[j].signHTML === "" ? Label.signIsNullLabel : signs[j].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, ""), });
position: "bottom" }
});
} // Article list style
$("#articleListDisplay").val(preference.articleListStyle);
// Article list style // Editor Type
$("#articleListDisplay").val(preference.articleListStyle); $("#editorType").val(preference.editorType);
// Editor Type // Feed output mode
$("#editorType").val(preference.editorType); $("#feedOutputMode").val(preference.feedOutputMode);
// Feed output mode // Commentable
$("#feedOutputMode").val(preference.feedOutputMode); preference.commentable ? $("#commentable").attr("checked", "checked") : $("commentable").removeAttr("checked");
// Commentable
preference.commentable ? $("#commentable").attr("checked", "checked") : $("commentable").removeAttr("checked"); $("#loadMsg").text("");
}
$("#loadMsg").text(""); });
} },
});
}, /*
* @description 参数校验
/* */
* 更新 validate: function () {
*/ if (!/^\d+$/.test($("#mostUsedTagDisplayCount").val())) {
update: function () { $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.indexTagDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#loadMsg").text(Label.loadingLabel); $("#mostUsedTagDisplayCount").focus();
$("#tipMsg").text(""); return false;
} else if (!/^\d+$/.test($("#recentCommentDisplayCount").val())) {
var signs = [{ $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.indexRecentCommentDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
"oId": 0, $("#recentCommentDisplayCount").focus();
"signHTML": "" return false;
}, { } else if (!/^\d+$/.test($("#mostCommentArticleDisplayCount").val())) {
"oId": 1, $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.indexMostCommentArticleDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
"signHTML": $("#preferenceSign1").val() $("#mostCommentArticleDisplayCount").focus();
}, { return false;
"oId": 2, } else if (!/^\d+$/.test($("#mostViewArticleDisplayCount").val())) {
"signHTML": $("#preferenceSign2").val() $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.indexMostViewArticleDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
}, { $("#mostViewArticleDisplayCount").focus();
"oId": 3, return false;
"signHTML": $("#preferenceSign3").val() } else if (!/^\d+$/.test($("#articleListDisplayCount").val())) {
}]; $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.pageSizeLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#articleListDisplayCount").focus();
var requestJSONObject = { return false;
"preference": { } else if (!/^\d+$/.test($("#articleListPaginationWindowSize").val())) {
"metaKeywords": $("#metaKeywords").val(), $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.windowSizeLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
"metaDescription": $("#metaDescription").val(), $("#articleListPaginationWindowSize").focus();
"blogTitle": $("#blogTitle").val(), return false;
"blogSubtitle": $("#blogSubtitle").val(), } else if (!/^\d+$/.test($("#randomArticlesDisplayCount").val())) {
"mostCommentArticleDisplayCount": $("#mostCommentArticleDisplayCount").val(), $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.randomArticlesDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
"mostViewArticleDisplayCount": $("#mostViewArticleDisplayCount").val(), $("#randomArticlesDisplayCount").focus();
"recentCommentDisplayCount": $("#recentCommentDisplayCount").val(), return false;
"mostUsedTagDisplayCount": $("#mostUsedTagDisplayCount").val(), } else if (!/^\d+$/.test($("#relevantArticlesDisplayCount").val())) {
"articleListDisplayCount": $("#articleListDisplayCount").val(), $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.relevantArticlesDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
"articleListPaginationWindowSize": $("#articleListPaginationWindowSize").val(), $("#relevantArticlesDisplayCount").focus();
"skinDirName": $("#skinMain").data("skinDirName"), return false;
"blogHost": $("#blogHost").val(), } else if (!/^\d+$/.test($("#externalRelevantArticlesDisplayCount").val())) {
"localeString": $("#localeString").val(), $("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.externalRelevantArticlesDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
"timeZoneId": $("#timeZoneId").val(), $("#externalRelevantArticlesDisplayCount").focus();
"noticeBoard": $("#noticeBoard").val(), return false;
"htmlHead": $("#htmlHead").val(), }
"externalRelevantArticlesDisplayCount": $("#externalRelevantArticlesDisplayCount").val(), return true;
"relevantArticlesDisplayCount": $("#relevantArticlesDisplayCount").val(), },
"randomArticlesDisplayCount": $("#randomArticlesDisplayCount").val(),
"enableArticleUpdateHint": $("#enableArticleUpdateHint").prop("checked"), /*
"signs": signs, * @description 更新
"keyOfSolo": $("#keyOfSolo").val(), */
"allowVisitDraftViaPermalink": $("#allowVisitDraftViaPermalink").prop("checked"), update: function () {
"articleListStyle": $("#articleListDisplay").val(), if (!admin.preference.validate()) {
"editorType": $("#editorType").val(), return;
"feedOutputMode": $("#feedOutputMode").val(), }
"commentable": $("#commentable").prop("checked")
} $("#tipMsg").text("");
}; $("#loadMsg").text(Label.loadingLabel);
var signs = [{
$.ajax({ "oId": 0,
url: latkeConfig.servePath + "/console/preference/", "signHTML": ""
type: "PUT", }, {
cache: false, "oId": 1,
data: JSON.stringify(requestJSONObject), "signHTML": $("#preferenceSign1").val()
success: function(result, textStatus){ }, {
$("#tipMsg").text(result.msg); "oId": 2,
if (!result.sc) { "signHTML": $("#preferenceSign2").val()
$("#loadMsg").text(""); }, {
return; "oId": 3,
} "signHTML": $("#preferenceSign3").val()
}];
if ($("#localeString").val() !== admin.preference.locale ||
$("#editorType").val() !== admin.preference.editorType) { var requestJSONObject = {
window.location.reload(); "preference": {
} "metaKeywords": $("#metaKeywords").val(),
"metaDescription": $("#metaDescription").val(),
// update article and preferences signs "blogTitle": $("#blogTitle").val(),
for (var i = 1; i < signs.length; i++) { "blogSubtitle": $("#blogSubtitle").val(),
if ($("#articleSign" + signs[i].oId).length === 1) { "mostCommentArticleDisplayCount": $("#mostCommentArticleDisplayCount").val(),
$("#articleSign" + signs[i].oId).tip("option", "content", "mostViewArticleDisplayCount": $("#mostViewArticleDisplayCount").val(),
signs[i].signHTML === "" ? Label.signIsNullLabel : signs[i].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, "")); "recentCommentDisplayCount": $("#recentCommentDisplayCount").val(),
} "mostUsedTagDisplayCount": $("#mostUsedTagDisplayCount").val(),
$("#preferenceSignButton" + signs[i].oId).tip("option", "content", "articleListDisplayCount": $("#articleListDisplayCount").val(),
signs[i].signHTML === "" ? Label.signIsNullLabel : signs[i].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, "")); "articleListPaginationWindowSize": $("#articleListPaginationWindowSize").val(),
} "skinDirName": $("#skinMain").data("skinDirName"),
"blogHost": $("#blogHost").val(),
$("#loadMsg").text(""); "localeString": $("#localeString").val(),
} "timeZoneId": $("#timeZoneId").val(),
}); "noticeBoard": $("#noticeBoard").val(),
} "htmlHead": $("#htmlHead").val(),
}; "externalRelevantArticlesDisplayCount": $("#externalRelevantArticlesDisplayCount").val(),
"relevantArticlesDisplayCount": $("#relevantArticlesDisplayCount").val(),
/* "randomArticlesDisplayCount": $("#randomArticlesDisplayCount").val(),
* 注册到 admin 进行管理 "enableArticleUpdateHint": $("#enableArticleUpdateHint").prop("checked"),
*/ "signs": signs,
admin.register["preference"] = { "keyOfSolo": $("#keyOfSolo").val(),
"obj": admin.preference, "allowVisitDraftViaPermalink": $("#allowVisitDraftViaPermalink").prop("checked"),
"init": admin.preference.init, "articleListStyle": $("#articleListDisplay").val(),
"refresh": function () { "editorType": $("#editorType").val(),
$("#loadMsg").text(""); "feedOutputMode": $("#feedOutputMode").val(),
} "commentable": $("#commentable").prop("checked")
======= }
======= };
>>>>>>> origin/0.4.6
/* $.ajax({
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team url: latkeConfig.servePath + "/console/preference/",
* type: "PUT",
* Licensed under the Apache License, Version 2.0 (the "License"); cache: false,
* you may not use this file except in compliance with the License. data: JSON.stringify(requestJSONObject),
* You may obtain a copy of the License at success: function(result, textStatus){
* $("#tipMsg").text(result.msg);
* http://www.apache.org/licenses/LICENSE-2.0 if (!result.sc) {
* $("#loadMsg").text("");
* Unless required by applicable law or agreed to in writing, software return;
* 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 if ($("#localeString").val() !== admin.preference.locale ||
* limitations under the License. $("#editorType").val() !== admin.preference.editorType) {
*/ window.location.reload();
/** }
* preference for admin.
* // update article and preferences signs
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> for (var i = 1; i < signs.length; i++) {
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a> if ($("#articleSign" + signs[i].oId).length === 1) {
* @version 1.0.1.5, Jun 26, 2012 $("#articleSign" + signs[i].oId).tip("option", "content",
*/ signs[i].signHTML === "" ? Label.signIsNullLabel : signs[i].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, ""));
}
/* preference 相关操作 */ $("#preferenceSignButton" + signs[i].oId).tip("option", "content",
admin.preference = { signs[i].signHTML === "" ? Label.signIsNullLabel : signs[i].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, ""));
locale: "", }
editorType: "",
$("#loadMsg").text("");
/* }
* 初始化 });
*/ }
init: function () { };
$("#tabPreference").tabs();
/*
$.ajax({ * 注册到 admin 进行管理
url: latkeConfig.servePath + "/console/preference/", */
type: "GET", admin.register["preference"] = {
cache: false, "obj": admin.preference,
success: function(result, textStatus){ "init": admin.preference.init,
$("#tipMsg").text(result.msg); "refresh": function () {
if (!result.sc) { $("#loadMsg").text("");
$("#loadMsg").text(""); }
return; }
}
var preference = result.preference;
// 线上环境严禁使用 localhost, 默认将其设为 host
if (preference.blogHost.indexOf("localhost") > -1 && Label.miniPostfix === ".min") {
preference.blogHost = window.location.host;
$("#tipMsg").text(Label.resetBlogHostLabel);
}
$("#metaKeywords").val(preference.metaKeywords),
$("#metaDescription").val(preference.metaDescription),
$("#blogTitle").val(preference.blogTitle),
$("#blogSubtitle").val(preference.blogSubtitle),
$("#mostCommentArticleDisplayCount").val(preference.mostCommentArticleDisplayCount);
$("#mostViewArticleDisplayCount").val(preference.mostViewArticleDisplayCount),
$("#recentCommentDisplayCount").val(preference.recentCommentDisplayCount);
$("#mostUsedTagDisplayCount").val(preference.mostUsedTagDisplayCount);
$("#articleListDisplayCount").val(preference.articleListDisplayCount);
$("#articleListPaginationWindowSize").val(preference.articleListPaginationWindowSize);
$("#blogHost").val(preference.blogHost);
$("#localeString").val(preference.localeString);
$("#timeZoneId").val(preference.timeZoneId);
$("#noticeBoard").val(preference.noticeBoard);
$("#htmlHead").val(preference.htmlHead);
$("#externalRelevantArticlesDisplayCount").val(preference.externalRelevantArticlesDisplayCount);
$("#relevantArticlesDisplayCount").val(preference.relevantArticlesDisplayCount);
$("#randomArticlesDisplayCount").val(preference.randomArticlesDisplayCount);
$("#keyOfSolo").val(preference.keyOfSolo);
preference.enableArticleUpdateHint ? $("#enableArticleUpdateHint").attr("checked", "checked") : $("#enableArticleUpdateHint").removeAttr("checked");
preference.allowVisitDraftViaPermalink ? $("#allowVisitDraftViaPermalink").attr("checked", "checked") : $("allowVisitDraftViaPermalink").removeAttr("checked");
admin.preference.locale = preference.localeString;
admin.preference.editorType = preference.editorType;
// skin
$("#skinMain").data("skinDirName", preference.skinDirName);
var skins = eval('(' + preference.skins + ')');
var skinsHTML = "";
for (var i = 0; i < skins.length; i++) {
if (skins[i].skinName === preference.skinName
&& skins[i].skinDirName === preference.skinDirName ) {
skinsHTML += "<div title='" + skins[i].skinDirName
+ "' class='left skinItem selected'><img class='skinPreview' src='skins/"
+ skins[i].skinDirName + "/preview.png'/><div>" + skins[i].skinName + "</div></div>"
} else {
skinsHTML += "<div title='" + skins[i].skinDirName
+ "' class='left skinItem'><img class='skinPreview' src='skins/"
+ skins[i].skinDirName + "/preview.png'/><div>" + skins[i].skinName + "</div></div>"
}
}
$("#skinMain").append(skinsHTML + "<div class='clear'></div>");
$(".skinItem").click(function () {
$(".skinItem").removeClass("selected");
$(this).addClass("selected");
$("#skinMain").data("skinDirName", this.title);
});
// sign
var signs = eval('(' + preference.signs + ')');
for (var j = 1; j < signs.length; j++) {
$("#preferenceSign" + j).val(signs[j].signHTML);
$("#preferenceSignButton" + j).tip({
content: signs[j].signHTML === "" ? Label.signIsNullLabel : signs[j].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, ""),
position: "bottom"
});
}
// Article list style
$("#articleListDisplay").val(preference.articleListStyle);
// Editor Type
$("#editorType").val(preference.editorType);
// Feed output mode
$("#feedOutputMode").val(preference.feedOutputMode);
// Commentable
preference.commentable ? $("#commentable").attr("checked", "checked") : $("commentable").removeAttr("checked");
$("#loadMsg").text("");
}
});
},
/*
* @description 参数校验
*/
validate: function () {
if (!/^\d+$/.test($("#mostUsedTagDisplayCount").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.indexTagDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#mostUsedTagDisplayCount").focus();
return false;
} else if (!/^\d+$/.test($("#recentCommentDisplayCount").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.indexRecentCommentDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#recentCommentDisplayCount").focus();
return false;
} else if (!/^\d+$/.test($("#mostCommentArticleDisplayCount").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.indexMostCommentArticleDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#mostCommentArticleDisplayCount").focus();
return false;
} else if (!/^\d+$/.test($("#mostViewArticleDisplayCount").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.indexMostViewArticleDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#mostViewArticleDisplayCount").focus();
return false;
} else if (!/^\d+$/.test($("#articleListDisplayCount").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.pageSizeLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#articleListDisplayCount").focus();
return false;
} else if (!/^\d+$/.test($("#articleListPaginationWindowSize").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.windowSizeLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#articleListPaginationWindowSize").focus();
return false;
} else if (!/^\d+$/.test($("#randomArticlesDisplayCount").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.randomArticlesDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#randomArticlesDisplayCount").focus();
return false;
} else if (!/^\d+$/.test($("#relevantArticlesDisplayCount").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.relevantArticlesDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#relevantArticlesDisplayCount").focus();
return false;
} else if (!/^\d+$/.test($("#externalRelevantArticlesDisplayCount").val())) {
$("#tipMsg").text("[" + Label.paramSettingsLabel + " - " + Label.externalRelevantArticlesDisplayCntLabel + "] " + Label.nonNegativeIntegerOnlyLabel);
$("#externalRelevantArticlesDisplayCount").focus();
return false;
}
return true;
},
/*
* @description 更新
*/
update: function () {
if (!admin.preference.validate()) {
return;
}
$("#tipMsg").text("");
$("#loadMsg").text(Label.loadingLabel);
var signs = [{
"oId": 0,
"signHTML": ""
}, {
"oId": 1,
"signHTML": $("#preferenceSign1").val()
}, {
"oId": 2,
"signHTML": $("#preferenceSign2").val()
}, {
"oId": 3,
"signHTML": $("#preferenceSign3").val()
}];
var requestJSONObject = {
"preference": {
"metaKeywords": $("#metaKeywords").val(),
"metaDescription": $("#metaDescription").val(),
"blogTitle": $("#blogTitle").val(),
"blogSubtitle": $("#blogSubtitle").val(),
"mostCommentArticleDisplayCount": $("#mostCommentArticleDisplayCount").val(),
"mostViewArticleDisplayCount": $("#mostViewArticleDisplayCount").val(),
"recentCommentDisplayCount": $("#recentCommentDisplayCount").val(),
"mostUsedTagDisplayCount": $("#mostUsedTagDisplayCount").val(),
"articleListDisplayCount": $("#articleListDisplayCount").val(),
"articleListPaginationWindowSize": $("#articleListPaginationWindowSize").val(),
"skinDirName": $("#skinMain").data("skinDirName"),
"blogHost": $("#blogHost").val(),
"localeString": $("#localeString").val(),
"timeZoneId": $("#timeZoneId").val(),
"noticeBoard": $("#noticeBoard").val(),
"htmlHead": $("#htmlHead").val(),
"externalRelevantArticlesDisplayCount": $("#externalRelevantArticlesDisplayCount").val(),
"relevantArticlesDisplayCount": $("#relevantArticlesDisplayCount").val(),
"randomArticlesDisplayCount": $("#randomArticlesDisplayCount").val(),
"enableArticleUpdateHint": $("#enableArticleUpdateHint").prop("checked"),
"signs": signs,
"keyOfSolo": $("#keyOfSolo").val(),
"allowVisitDraftViaPermalink": $("#allowVisitDraftViaPermalink").prop("checked"),
"articleListStyle": $("#articleListDisplay").val(),
"editorType": $("#editorType").val(),
"feedOutputMode": $("#feedOutputMode").val(),
"commentable": $("#commentable").prop("checked")
}
};
$.ajax({
url: latkeConfig.servePath + "/console/preference/",
type: "PUT",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
if ($("#localeString").val() !== admin.preference.locale ||
$("#editorType").val() !== admin.preference.editorType) {
window.location.reload();
}
// update article and preferences signs
for (var i = 1; i < signs.length; i++) {
if ($("#articleSign" + signs[i].oId).length === 1) {
$("#articleSign" + signs[i].oId).tip("option", "content",
signs[i].signHTML === "" ? Label.signIsNullLabel : signs[i].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, ""));
}
$("#preferenceSignButton" + signs[i].oId).tip("option", "content",
signs[i].signHTML === "" ? Label.signIsNullLabel : signs[i].signHTML.replace(/\n/g, "").replace(/<script.*<\/script>/ig, ""));
}
$("#loadMsg").text("");
}
});
}
};
/*
* 注册到 admin 进行管理
*/
admin.register["preference"] = {
"obj": admin.preference,
"init": admin.preference.init,
"refresh": function () {
$("#loadMsg").text("");
}
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
}
\ No newline at end of file
<<<<<<< HEAD /*
<<<<<<< HEAD * 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");
* * you may not use this file except in compliance with the License.
* Licensed under the Apache License, Version 2.0 (the "License"); * You may obtain a copy of the License at
* 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
* *
* 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,
* Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* distributed under the License is distributed on an "AS IS" BASIS, * See the License for the specific language governing permissions and
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * limitations under the License.
* See the License for the specific language governing permissions and */
* limitations under the License. /**
*/ * table and paginate util
/** *
* table and paginate util * @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* * @version 1.0.0.8, Jun 11, 2012
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a> */
* @version 1.0.0.7, Nov 8, 2011
*/ var TablePaginate = function (id) {
this.id = id;
var TablePaginate = function (id) { this.currentPage = 1;
this.id = id; };
this.currentPage = 1;
}; $.extend(TablePaginate.prototype, {
/*
$.extend(TablePaginate.prototype, { * 构建 table 框架
/* * @colModel table 列宽,标题等数据
* 构建 table 框架 */
* @colModel table 列宽,标题等数据 buildTable: function (colModel, noExpend) {
*/ var tableData = {
buildTable: function (colModel, noExpend) { colModel: colModel,
var tableData = { noDataTip: Label.noDataLabel
colModel: colModel, }
noDataTip: Label.noDataLabel if (!noExpend) {
} tableData.expendRow = {
if (!noExpend) { index: "expendRow"
tableData.expendRow = { }
index: "expendRow" }
} $("#" + this.id + "Table").table(tableData);
}
$("#" + this.id + "Table").table(tableData); },
}, /*
* 初始化分页
/* */
* 初始化分页 initPagination: function () {
*/ var id = this.id;
initPagination: function () { $("#" + id + "Pagination").paginate({
var id = this.id; "bind": function(currentPage, errorMessage) {
$("#" + id + "Pagination").paginate({ if (errorMessage) {
"bind": function(currentPage) { $("#tipMsg").text(errorMessage);
admin.setHashByPage(currentPage); } else {
return true; admin.setHashByPage(currentPage);
}, }
"currentPage": 1, },
"errorMessage": Label.inputErrorLabel, "currentPage": 1,
"nextPageText": Label.nextPagePabel, "errorMessage": Label.inputErrorLabel,
"previousPageText": Label.previousPageLabel, "nextPageText": Label.nextPagePabel,
"goText": Label.gotoLabel, "previousPageText": Label.previousPageLabel,
"type": "custom", "goText": Label.gotoLabel,
"custom": [1], "type": "custom",
"pageCount": 1 "custom": [1],
}); "pageCount": 1
}, });
},
/*
* 初始化评论对话框 /*
*/ * 初始化评论对话框
initCommentsDialog: function () { */
var that = this; initCommentsDialog: function () {
$("#" + this.id + "Comments").dialog({ var that = this;
width: 700, $("#" + this.id + "Comments").dialog({
height:500, "modal": true,
"modal": true, "hideFooter": true,
"hideFooter": true, "close": function () {
"close": function () { admin[that.id + "List"].getList(that.currentPage);
admin[that.id + "List"].getList(that.currentPage); return true;
return true; }
} });
}); },
},
/*
/* * 更新 table & paginateion
* 更新 table & paginateion */
*/ updateTablePagination: function (data, currentPage, pageInfo) {
updateTablePagination: function (data, currentPage, pageInfo) { currentPage = parseInt(currentPage);
currentPage = parseInt(currentPage); if (currentPage > pageInfo.paginationPageCount && currentPage > 1) {
if (currentPage > pageInfo.paginationPageCount && currentPage > 1) { $("#tipMsg").text(Label.pageLabel + currentPage + Label.notFoundLabel);
$("#tipMsg").text(Label.pageLabel + ":" + currentPage + " " + Label.noDataLable); $("#loadMsg").text("");
$("#loadMsg").text(""); return;
return; }
} $("#" + this.id + "Table").table("update", {
$("#" + this.id + "Table").table("update", { data: [{
data: [{ groupName: "all",
groupName: "all", groupData: data
groupData: data }]
}] });
});
if (pageInfo.paginationPageCount === 0) {
if (pageInfo.paginationPageCount === 0) { pageInfo.paginationPageCount = 1;
pageInfo.paginationPageCount = 1; }
}
$("#" + this.id + "Pagination").paginate("update", {
$("#" + this.id + "Pagination").paginate("update", { pageCount: pageInfo.paginationPageCount,
pageCount: pageInfo.paginationPageCount, currentPage: currentPage,
currentPage: currentPage, custom: pageInfo.paginationPageNums
custom: pageInfo.paginationPageNums });
}); this.currentPage = currentPage;
this.currentPage = currentPage; }
} });
=======
=======
>>>>>>> origin/0.4.6
/*
* 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.
*/
/**
* table and paginate util
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.8, Jun 11, 2012
*/
var TablePaginate = function (id) {
this.id = id;
this.currentPage = 1;
};
$.extend(TablePaginate.prototype, {
/*
* 构建 table 框架
* @colModel table 列宽,标题等数据
*/
buildTable: function (colModel, noExpend) {
var tableData = {
colModel: colModel,
noDataTip: Label.noDataLabel
}
if (!noExpend) {
tableData.expendRow = {
index: "expendRow"
}
}
$("#" + this.id + "Table").table(tableData);
},
/*
* 初始化分页
*/
initPagination: function () {
var id = this.id;
$("#" + id + "Pagination").paginate({
"bind": function(currentPage, errorMessage) {
if (errorMessage) {
$("#tipMsg").text(errorMessage);
} else {
admin.setHashByPage(currentPage);
}
},
"currentPage": 1,
"errorMessage": Label.inputErrorLabel,
"nextPageText": Label.nextPagePabel,
"previousPageText": Label.previousPageLabel,
"goText": Label.gotoLabel,
"type": "custom",
"custom": [1],
"pageCount": 1
});
},
/*
* 初始化评论对话框
*/
initCommentsDialog: function () {
var that = this;
$("#" + this.id + "Comments").dialog({
"modal": true,
"hideFooter": true,
"close": function () {
admin[that.id + "List"].getList(that.currentPage);
return true;
}
});
},
/*
* 更新 table & paginateion
*/
updateTablePagination: function (data, currentPage, pageInfo) {
currentPage = parseInt(currentPage);
if (currentPage > pageInfo.paginationPageCount && currentPage > 1) {
$("#tipMsg").text(Label.pageLabel + currentPage + Label.notFoundLabel);
$("#loadMsg").text("");
return;
}
$("#" + this.id + "Table").table("update", {
data: [{
groupName: "all",
groupData: data
}]
});
if (pageInfo.paginationPageCount === 0) {
pageInfo.paginationPageCount = 1;
}
$("#" + this.id + "Pagination").paginate("update", {
pageCount: pageInfo.paginationPageCount,
currentPage: currentPage,
custom: pageInfo.paginationPageNums
});
this.currentPage = currentPage;
}
<<<<<<< HEAD
>>>>>>> origin/0.4.6
=======
>>>>>>> origin/0.4.6
});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
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