Commit e6ff7899 authored by Liang Ding's avatar Liang Ding

解决冲突

parent c79fbf5d
......@@ -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/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/34">34 升级 GAE SDK 到 1.7.0</a></li>
<li><a href="https://github.com/b3log/b3log-solo/issues/36">36 加入博客关键信息获取接口</a></li>
</ul>
<h2>Release 0.4.5 - Jun 1, 2012</h2>
<ul>
......
......@@ -102,7 +102,6 @@ public final class TagQueryService {
}
/**
>>>>>>> origin/0.4.6
* Gets all tags.
*
* @return for example,
......
......@@ -131,7 +131,7 @@ public final class Articles {
return true;
}
/*
/**
* Gets time of the recent updated article.
*
* @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
/**
* admin style
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.3.7, May 23, 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;
}
#tipMsg, #loadMsg {
background-color: #E5E7EB;
border-radius: 3px;
font-weight: bold;
left: 48%;
margin: 0 auto;
overflow: hidden;
padding: 2px 0;
position: fixed;
text-align: center;
top: 3px;
z-index: 2;
}
#tipMsg {
top: 33px;
}
.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;
moz-user-select: 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-header-middle {
float: left;
}
.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;
}
=======
=======
>>>>>>> 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.
*/
/**
* 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
/*
* 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.
*/
/**
* 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
<<<<<<< HEAD
/**
* 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;
}
=======
=======
>>>>>>> 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.
*/
/**
* 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
/*
* 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.
*/
/**
* 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;
}
/* end comment */
\ No newline at end of file
<<<<<<< HEAD
<<<<<<< HEAD
/**
* 403, 500, article-pwd, init, login and kill-browser page style.
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.1.0, May 11, 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 error */
.error {
height: auto;
margin: 60px 0pt;
}
.error ul {
width: 50%;
margin: 12px 0 0 12px;
float: left;
}
.error .img-forbidden {
margin: 38px 10px 0 0;
width: 96px;
height: 96px;
float: right;
}
/* end 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;
}
=======
=======
>>>>>>> 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.
*/
/**
* 403, 404, 500, article-pwd, init, login and kill-browser page style.
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @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
/*
* 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.
*/
/**
* 403, 404, 500, article-pwd, init, login and kill-browser page style.
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @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;
}
/* end init and login */
<<<<<<< HEAD
<<<<<<< HEAD
/*
* 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.8, May 4, 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 = this.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();
}
});
=======
=======
>>>>>>> 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
/*
* 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();
}
});
var admin = new Admin();
\ No newline at end of file
<<<<<<< HEAD
<<<<<<< HEAD
/*
* 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.1, May 2, 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 () {
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);
}
}
=======
=======
>>>>>>> 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
/*
* 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
<<<<<<< HEAD
/*
* 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.4, May 9, 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 () {
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);
}
}
=======
=======
>>>>>>> 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
/*
* 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
<<<<<<< HEAD
/*
* 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.1.9, May 4, 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='" + latkeConfig.servePath + pages[i].pagePermalink + "' target='_blank'>" +
pages[i].pageTitle + "</a>";
pageData[i].pagePermalink = "<a class='no-underline' href='" + latkeConfig.servePath + 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='" + latkeConfig.servePath + 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
=======
=======
>>>>>>> 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
/*
* 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
<<<<<<< HEAD
/*
* 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.
*/
/**
* preference 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.1.4, May 3, 2012
*/
/* preference 相关操作 */
admin.preference = {
locale: "",
editorType: "",
/*
* 初始化
*/
init: function () {
$("#tabPreference").tabs();
$.ajax({
url: latkeConfig.servePath + "/console/preference/",
type: "GET",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#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("");
}
});
},
/*
* 更新
*/
update: function () {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
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("");
}
=======
=======
>>>>>>> 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.
*/
/**
* preference 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.1.5, Jun 26, 2012
*/
/* preference 相关操作 */
admin.preference = {
locale: "",
editorType: "",
/*
* 初始化
*/
init: function () {
$("#tabPreference").tabs();
$.ajax({
url: latkeConfig.servePath + "/console/preference/",
type: "GET",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#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
/*
* 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.
*/
/**
* preference 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.1.5, Jun 26, 2012
*/
/* preference 相关操作 */
admin.preference = {
locale: "",
editorType: "",
/*
* 初始化
*/
init: function () {
$("#tabPreference").tabs();
$.ajax({
url: latkeConfig.servePath + "/console/preference/",
type: "GET",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#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
<<<<<<< HEAD
/*
* 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.7, Nov 8, 2011
*/
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) {
admin.setHashByPage(currentPage);
return true;
},
"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({
width: 700,
height:500,
"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.noDataLable);
$("#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;
}
=======
=======
>>>>>>> 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
/*
* 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;
}
});
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