Commit ccf69fa6 authored by Liang Ding's avatar Liang Ding

Merge branch '0.6.0' of https://github.com/b3log/b3log-solo into 0.6.0

parents 4d2ecb1a 8b5f9643
......@@ -348,8 +348,11 @@ duplicatedPermalinkLabel=Duplicated permalink!
invalidPermalinkFormatLabel=Invalid permalink format!
duplicatedEmailLabel=Duplicated email!
refreshAndRetryLabel=Please refresh and try again!
editorLeaveLabel=Content is not null, Do you leave\uff1f
editorPostLabel=Content is not null, Do you clear\uff1f
editorLeaveLabel=Content is not null, Do you leave?
editorPostLabel=Content is not null, Do you clear?
registerSoloUserLabel=Register Solo User
registerLabel=Register
changeRoleLabel=Change Role
####
confirmRemoveLabel=Are You Remove
confirmInitLabel=Are You Sure?
......@@ -371,7 +374,4 @@ helloWorld.content=<p>Welcome to \
<span style="color: blue;">G</span> \
<span style="color: orangered; font-weight: bold;">Solo</span></a>\
. This is your first post. Edit or delete it, then start blogging!</p>
helloWorld.comment.content=Hi, this is a comment. _esc_enter_88250_To delete a comment, just log in and view the post's comments. There you will have the option to delete them.
registerSoloUser=Register Solo User
registerLabel=Register
changeUserRole=Change Role
\ No newline at end of file
helloWorld.comment.content=Hi, this is a comment. _esc_enter_88250_To delete a comment, just log in and view the post's comments. There you will have the option to delete them.
\ No newline at end of file
......@@ -350,6 +350,9 @@ duplicatedEmailLabel=\u90ae\u4ef6\u5730\u5740\u91cd\u590d\uff01
refreshAndRetryLabel=\u8bf7\u5237\u65b0\u91cd\u8bd5\uff01
editorLeaveLabel=\u7f16\u8f91\u5668\u4e2d\u8fd8\u6709\u5185\u5bb9\uff0c\u662f\u5426\u79bb\u5f00\uff1f
editorPostLabel=\u7f16\u8f91\u5668\u4e2d\u8fd8\u6709\u5185\u5bb9\uff0c\u662f\u5426\u6e05\u7a7a\uff1f
registerSoloUserLabel=\u6ce8\u518c Solo \u7528\u6237
registerLabel=\u6ce8\u518c
changeRoleLabel=\u6539\u53d8\u89d2\u8272
####
confirmRemoveLabel=\u662f\u5426\u5220\u9664
confirmInitLabel=\u786e\u5b9a\u8fdb\u884c\u521d\u59cb\u5316\u5417\uff1f
......@@ -371,7 +374,4 @@ helloWorld.content=<p>\u6b22\u8fce\u4f7f\u7528 \
<span style="color: blue;">G</span> \
<span style="color: orangered; font-weight: bold;">Solo</span></a>\
\u3002\u8fd9\u662f\u7cfb\u7edf\u81ea\u52a8\u751f\u6210\u7684\u6f14\u793a\u6587\u7ae0\u3002\u7f16\u8f91\u6216\u8005\u5220\u9664\u5b83\uff0c\u7136\u540e\u5f00\u59cb\u60a8\u7684\u535a\u5ba2\uff01</p>
helloWorld.comment.content=\u60a8\u597d\uff0c\u8fd9\u662f\u4e00\u6761\u8bc4\u8bba\u3002_esc_enter_88250_\u8981\u5220\u9664\u8bc4\u8bba\uff0c\u8bf7\u5148\u767b\u5f55\uff0c\u7136\u540e\u518d\u67e5\u770b\u8fd9\u7bc7\u6587\u7ae0\u7684\u8bc4\u8bba\u3002\u5728\u90a3\u91cc\uff0c\u60a8\u53ef\u4ee5\u770b\u5230\u7f16\u8f91\u6216\u8005\u5220\u9664\u8bc4\u8bba\u7684\u9009\u9879\u3002
registerSoloUser=\u6ce8\u518c Solo \u7528\u6237
registerLabel=\u6ce8\u518c
changeUserRole=\u6539\u53d8\u89d2\u8272
\ No newline at end of file
helloWorld.comment.content=\u60a8\u597d\uff0c\u8fd9\u662f\u4e00\u6761\u8bc4\u8bba\u3002_esc_enter_88250_\u8981\u5220\u9664\u8bc4\u8bba\uff0c\u8bf7\u5148\u767b\u5f55\uff0c\u7136\u540e\u518d\u67e5\u770b\u8fd9\u7bc7\u6587\u7ae0\u7684\u8bc4\u8bba\u3002\u5728\u90a3\u91cc\uff0c\u60a8\u53ef\u4ee5\u770b\u5230\u7f16\u8f91\u6216\u8005\u5220\u9664\u8bc4\u8bba\u7684\u9009\u9879\u3002
\ No newline at end of file
<script type="text/javascript">
var latkeConfig = {
"staticServePath": "${staticServePath}",
"servePath": "${servePath}"
};
var Label = {
"skinDirName": "${skinDirName}",
"editorType": "${editorType}",
"userRole": "${userRole}",
"PAGE_SIZE": "${articleListDisplayCount}",
"WINDOW_SIZE": "${articleListPaginationWindowSize}",
"localeString": "${localeString}",
"version": "${version}",
"miniPostfix": "${miniPostfix}",
"reportIssueLabel": "please report this issue on https://github.com/b3log/b3log-solo/issues/new",
"noDataLabel": "${noDataLabel}",
"resetBlogHostLabel": "${resetBlogHostLabel}",
"linkDescriptionLabel": "${linkDescriptionLabel}",
"addressInvalidLabel": "${addressInvalidLabel}",
"selectLabel": "${selectLabel}",
"outOfDateLabel": "${outOfDateLabel}",
"upToDateLabel": "${upToDateLabel}",
"commentContentLabel": "${commentContentLabel}",
"loadingLabel": "${loadingLabel}",
"noCommentLabel": "${noCommentLabel}",
"confirmRemoveLabel": "${confirmRemoveLabel}",
"removeLabel": "${removeLabel}",
"cancelPutTopLabel": "${cancelPutTopLabel}",
"putTopLabel": "${putTopLabel}",
"viewLabel": "${viewLabel}",
"updateLabel": "${updateLabel}",
"commentLabel": "${commentLabel}",
"titleLabel": "${titleLabel}",
"tagsLabel": "${tagsLabel}",
"authorLabel": "${authorLabel}",
"createDateLabel": "${createDateLabel}",
"previousPageLabel": "${previousPageLabel}",
"pageLabel": "${pageLabel}",
"nextPagePabel": "${nextPagePabel}",
"gotoLabel": "${gotoLabel}",
"fileNameLabel": "${fileNameLabel}",
"uploadDateLabel": "${uploadDateLabel}",
"sizeLabel": "${sizeLabel}",
"downloadCountLabel": "${downloadCountLabel}",
"downloadLabel": "${downloadLabel}",
"permalinkLabel": "${permalinkLabel}",
"titleEmptyLabel": "${titleEmptyLabel}",
"contentEmptyLabel": "${contentEmptyLabel}",
"linkTitleLabel": "${linkTitleLabel}",
"urlLabel": "${urlLabel}",
"addressEmptyLabel": "${addressEmptyLabel}",
"pluginNameLabel": "${pluginNameLabel}",
"statusLabel": "${statusLabel}",
"versionLabel": "${versionLabel}",
"commentNameLabel": "${commentNameLabel}",
"commentEmailLabel": "${commentEmailLabel}",
"administratorLabel": "${administratorLabel}",
"duplicatedEmailLabel": "${duplicatedEmailLabel}",
"mailInvalidLabel": "${mailInvalidLabel}",
"mailCannotEmptyLabel": "${mailCannotEmptyLabel}",
"noSettingLabel": "${noSettingLabel}",
"blogEmptyLabel": "${blogEmptyLabel}",
"sumLabel": "${sumLabel}",
"countLabel": "${countLabel}",
"blogArticleEmptyLabel": "${blogArticleEmptyLabel}",
"importSuccLabel": "${importSuccLabel}",
"categoryLabel": "${categoryLabel}",
"importedLabel": "${importedLabel}",
"passwordEmptyLabel": "${passwordEmptyLabel}",
"tagsEmptyLabel": "${tagsEmptyLabel}",
"abstractEmptyLabel": "${abstractEmptyLabel}",
"commonUserLabel": "${commonUserLabel}",
"articleLabel": "${articleLabel}",
"enabledLabel": "${enabledLabel}",
"disabledLabel": "${disabledLabel}",
"signIsNullLabel": "${signIsNullLabel}",
"editorLeaveLabel": "${editorLeaveLabel}",
"editorPostLabel": "${editorPostLabel}",
"enableLabel": "${enableLabel}",
"disableLabel": "${disableLabel}",
"settingLabel": "${settingLabel}",
"linkEmptyLabel": "${linkEmptyLabel}",
"openMethodLabel": "${openMethodLabel}",
"typeLabel": "${typeLabel}",
"markdownHelpLabel": "${markdownHelpLabel}",
"notFoundLabel": "${notFoundLabel}",
"em00Label": "${em00Label}",
"em01Label": "${em01Label}",
"em02Label": "${em02Label}",
"em03Label": "${em03Label}",
"em04Label": "${em04Label}",
"em05Label": "${em05Label}",
"em06Label": "${em06Label}",
"em07Label": "${em07Label}",
"em08Label": "${em08Label}",
"em09Label": "${em09Label}",
"em10Label": "${em10Label}",
"em11Label": "${em11Label}",
"em12Label": "${em12Label}",
"em13Label": "${em13Label}",
"em14Label": "${em14Label}",
"paramSettingsLabel": "${paramSettingsLabel}",
"nonNegativeIntegerOnlyLabel": "${nonNegativeIntegerOnlyLabel}",
"indexTagDisplayCntLabel": "${indexTagDisplayCntLabel}",
"indexRecentCommentDisplayCntLabel": "${indexRecentCommentDisplayCntLabel}",
"indexMostCommentArticleDisplayCntLabel": "${indexMostCommentArticleDisplayCntLabel}",
"indexMostViewArticleDisplayCntLabel": "${indexMostViewArticleDisplayCntLabel}",
"pageSizeLabel": "${pageSizeLabel}",
"windowSizeLabel": "${windowSizeLabel}",
"randomArticlesDisplayCntLabel": "${randomArticlesDisplayCntLabel}",
"relevantArticlesDisplayCntLabel": "${relevantArticlesDisplayCntLabel}",
"externalRelevantArticlesDisplayCntLabel": "${externalRelevantArticlesDisplayCntLabel}",
"nameTooLongLabel": "${nameTooLongLabel}",
"navLabel": "${navLabel}",
"userLabel": "${userLabel}"
};
admin.init();
<script type="text/javascript">
var latkeConfig = {
"staticServePath": "${staticServePath}",
"servePath": "${servePath}"
};
var Label = {
"skinDirName": "${skinDirName}",
"editorType": "${editorType}",
"userRole": "${userRole}",
"PAGE_SIZE": "${articleListDisplayCount}",
"WINDOW_SIZE": "${articleListPaginationWindowSize}",
"localeString": "${localeString}",
"version": "${version}",
"miniPostfix": "${miniPostfix}",
"reportIssueLabel": "please report this issue on https://github.com/b3log/b3log-solo/issues/new",
"noDataLabel": "${noDataLabel}",
"resetBlogHostLabel": "${resetBlogHostLabel}",
"linkDescriptionLabel": "${linkDescriptionLabel}",
"addressInvalidLabel": "${addressInvalidLabel}",
"selectLabel": "${selectLabel}",
"outOfDateLabel": "${outOfDateLabel}",
"upToDateLabel": "${upToDateLabel}",
"commentContentLabel": "${commentContentLabel}",
"loadingLabel": "${loadingLabel}",
"noCommentLabel": "${noCommentLabel}",
"confirmRemoveLabel": "${confirmRemoveLabel}",
"removeLabel": "${removeLabel}",
"cancelPutTopLabel": "${cancelPutTopLabel}",
"putTopLabel": "${putTopLabel}",
"viewLabel": "${viewLabel}",
"updateLabel": "${updateLabel}",
"commentLabel": "${commentLabel}",
"titleLabel": "${titleLabel}",
"tagsLabel": "${tagsLabel}",
"authorLabel": "${authorLabel}",
"createDateLabel": "${createDateLabel}",
"previousPageLabel": "${previousPageLabel}",
"pageLabel": "${pageLabel}",
"nextPagePabel": "${nextPagePabel}",
"gotoLabel": "${gotoLabel}",
"fileNameLabel": "${fileNameLabel}",
"uploadDateLabel": "${uploadDateLabel}",
"sizeLabel": "${sizeLabel}",
"downloadCountLabel": "${downloadCountLabel}",
"downloadLabel": "${downloadLabel}",
"permalinkLabel": "${permalinkLabel}",
"titleEmptyLabel": "${titleEmptyLabel}",
"contentEmptyLabel": "${contentEmptyLabel}",
"linkTitleLabel": "${linkTitleLabel}",
"urlLabel": "${urlLabel}",
"addressEmptyLabel": "${addressEmptyLabel}",
"pluginNameLabel": "${pluginNameLabel}",
"statusLabel": "${statusLabel}",
"versionLabel": "${versionLabel}",
"commentNameLabel": "${commentNameLabel}",
"commentEmailLabel": "${commentEmailLabel}",
"administratorLabel": "${administratorLabel}",
"duplicatedEmailLabel": "${duplicatedEmailLabel}",
"mailInvalidLabel": "${mailInvalidLabel}",
"mailCannotEmptyLabel": "${mailCannotEmptyLabel}",
"noSettingLabel": "${noSettingLabel}",
"blogEmptyLabel": "${blogEmptyLabel}",
"sumLabel": "${sumLabel}",
"countLabel": "${countLabel}",
"blogArticleEmptyLabel": "${blogArticleEmptyLabel}",
"importSuccLabel": "${importSuccLabel}",
"categoryLabel": "${categoryLabel}",
"importedLabel": "${importedLabel}",
"passwordEmptyLabel": "${passwordEmptyLabel}",
"tagsEmptyLabel": "${tagsEmptyLabel}",
"abstractEmptyLabel": "${abstractEmptyLabel}",
"commonUserLabel": "${commonUserLabel}",
"articleLabel": "${articleLabel}",
"enabledLabel": "${enabledLabel}",
"disabledLabel": "${disabledLabel}",
"signIsNullLabel": "${signIsNullLabel}",
"editorLeaveLabel": "${editorLeaveLabel}",
"editorPostLabel": "${editorPostLabel}",
"enableLabel": "${enableLabel}",
"disableLabel": "${disableLabel}",
"settingLabel": "${settingLabel}",
"linkEmptyLabel": "${linkEmptyLabel}",
"openMethodLabel": "${openMethodLabel}",
"typeLabel": "${typeLabel}",
"markdownHelpLabel": "${markdownHelpLabel}",
"notFoundLabel": "${notFoundLabel}",
"em00Label": "${em00Label}",
"em01Label": "${em01Label}",
"em02Label": "${em02Label}",
"em03Label": "${em03Label}",
"em04Label": "${em04Label}",
"em05Label": "${em05Label}",
"em06Label": "${em06Label}",
"em07Label": "${em07Label}",
"em08Label": "${em08Label}",
"em09Label": "${em09Label}",
"em10Label": "${em10Label}",
"em11Label": "${em11Label}",
"em12Label": "${em12Label}",
"em13Label": "${em13Label}",
"em14Label": "${em14Label}",
"paramSettingsLabel": "${paramSettingsLabel}",
"nonNegativeIntegerOnlyLabel": "${nonNegativeIntegerOnlyLabel}",
"indexTagDisplayCntLabel": "${indexTagDisplayCntLabel}",
"indexRecentCommentDisplayCntLabel": "${indexRecentCommentDisplayCntLabel}",
"indexMostCommentArticleDisplayCntLabel": "${indexMostCommentArticleDisplayCntLabel}",
"indexMostViewArticleDisplayCntLabel": "${indexMostViewArticleDisplayCntLabel}",
"pageSizeLabel": "${pageSizeLabel}",
"windowSizeLabel": "${windowSizeLabel}",
"randomArticlesDisplayCntLabel": "${randomArticlesDisplayCntLabel}",
"relevantArticlesDisplayCntLabel": "${relevantArticlesDisplayCntLabel}",
"externalRelevantArticlesDisplayCntLabel": "${externalRelevantArticlesDisplayCntLabel}",
"nameTooLongLabel": "${nameTooLongLabel}",
"navLabel": "${navLabel}",
"userLabel": "${userLabel}",
"changeRoleLabel": "${changeRoleLabel}",
"visitorUserLabel": "${visitorUserLabel}"
};
admin.init();
</script>
\ No newline at end of file
......@@ -39,7 +39,9 @@ body {
}
h2 {
background: linear-gradient(#F9F9F9, #ECECEC) repeat scroll 0 0 transparent;
background-color:#ECECEC;
background-image:linear-gradient(#F9F9F9, #ECECEC);
background-repeat:repeat-x;
border-radius: 4px 4px 0 0;
font-size: 16px;
margin: 0;
......@@ -106,10 +108,9 @@ button:active {
color:#fff;
text-decoration:none;
text-shadow:0 -1px 0 rgba(0,0,0,0.25);
background-color:#3072b3;
background-color: #3072b3;
background-image:linear-gradient(#599bcd,#3072b3);
background-repeat:repeat-x;
border-color:#2a65a0;
}
.clear {
......@@ -227,11 +228,11 @@ button:active {
}
.a-403 {
margin: 20px 75px 0 0 ;
margin: 10px 75px 0 0 ;
}
.img-500 {
margin: 25px 0 0 25px;
margin: 20px 0 0 25px;
}
.a-500 {
......
html{height:100%;overflow:hidden}html,body{margin:0;padding:0}body{background-color:#f3f1e5;color:#333;font-family:\5fae\8f6f\96c5\9ed1;font-size:small;height:100%}h2{background:linear-gradient(#f9f9f9,#ececec) repeat scroll 0 0 transparent;border-radius:4px 4px 0 0;font-size:16px;margin:0;padding:10px 20px;text-shadow:0 -1px 0 rgba(255,255,255,0.5)}input{border:1px solid #ccc;border-radius:3px 3px 3px 3px;box-shadow:0 1px 2px rgba(0,0,0,0.075) inset;font-size:13px;margin:15px 0;padding:7px 8px;transition:all .15s ease-in 0s;vertical-align:middle;width:410px}input:focus{box-shadow:0 1px 2px rgba(0,0,0,0.075) inset,0 0 5px rgbargba(200,200,200,0.9);border:1px solid #e6e5d9}.form{padding:20px}label{font-size:13px}button{position:relative;display:inline-block;font-size:13px;font-weight:700;color:#333;text-shadow:0 1px 0 rgba(255,255,255,0.9);white-space:nowrap;background-color:#eaeaea;background-image:linear-gradient(#fafafa,#eaeaea);background-repeat:repeat-x;border-radius:3px;border:1px solid #ddd;border-bottom-color:#c5c5c5;box-shadow:0 1px 3px rgba(0,0,0,0.075);vertical-align:baseline;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;outline:0;padding:7px 15px;margin-top:10px}button:hover,button:active{color:#fff;text-decoration:none;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#3072b3;background-image:linear-gradient(#599bcd,#3072b3);background-repeat:repeat-x;border-color:#2a65a0}.clear{background-color:transparent;border:0;clear:both;display:block;font-size:0;height:0;line-height:0;overflow:hidden}.none{display:none}.main .icon{position:absolute;right:0;top:0;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 li{margin:6px 0 6px 16px}.mian tr{height:54px}.footerWrapper{background-color:#fff;border-top:1px solid #e6e5d9;bottom:0;padding:12px 0;position:absolute;text-align:center;width:100%}.footerWrapper a{text-decoration:none}.article-pwd>div,.article-pwd>form{margin:0 20px}.article-pwd>div{margin-bottom:10px;max-height:264px;overflow:auto;word-wrap:break-word}.img-403,.img-500{box-shadow:0 0 5px #e6e5d9;margin:20px 0 0 45px;padding:5px}.a-403,.a-500{margin:20px 50px 0 0;text-align:right}.a-403{margin:20px 75px 0 0}.img-500{margin:25px 0 0 25px}.a-500{margin:25px 35px 0 0}.kill img{position:absolute;right:40px;top:200px}.kill ul{margin-bottom:50px}.kill p{margin:12px 20px}.kill span{margin-left:20px}#init{position:absolute;top:81px;width:470px}#init input{margin:5px 0;padding:5px 8px}#sys p{height:166px}#sys{padding:0 20px}#initButton{margin-right:10px}#tip{color:#21759b;font-weight:bold;margin-left:10px}
\ No newline at end of file
html{height:100%;overflow:hidden}html,body{margin:0;padding:0}body{background-color:#f3f1e5;color:#333;font-family:\5fae\8f6f\96c5\9ed1;font-size:small;height:100%}h2{background:linear-gradient(#f9f9f9,#ececec) repeat scroll 0 0 transparent;border-radius:4px 4px 0 0;font-size:16px;margin:0;padding:10px 20px;text-shadow:0 -1px 0 rgba(255,255,255,0.5)}input{border:1px solid #ccc;border-radius:3px 3px 3px 3px;box-shadow:0 1px 2px rgba(0,0,0,0.075) inset;font-size:13px;margin:15px 0;padding:7px 8px;transition:all .15s ease-in 0s;vertical-align:middle;width:410px}input:focus{box-shadow:0 1px 2px rgba(0,0,0,0.075) inset,0 0 5px rgbargba(200,200,200,0.9);border:1px solid #e6e5d9}.form{padding:20px}label{font-size:13px}button{position:relative;display:inline-block;font-size:13px;font-weight:700;color:#333;text-shadow:0 1px 0 rgba(255,255,255,0.9);white-space:nowrap;background-color:#eaeaea;background-image:linear-gradient(#fafafa,#eaeaea);background-repeat:repeat-x;border-radius:3px;border:1px solid #ddd;border-bottom-color:#c5c5c5;box-shadow:0 1px 3px rgba(0,0,0,0.075);vertical-align:baseline;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;outline:0;padding:7px 15px;margin-top:10px}button:hover,button:active{color:#fff;text-decoration:none;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#3072b3;background-image:linear-gradient(#599bcd,#3072b3);background-repeat:repeat-x;border-color:#2a65a0}.clear{background-color:transparent;border:0;clear:both;display:block;font-size:0;height:0;line-height:0;overflow:hidden}.none{display:none}.main .icon{position:absolute;right:0;top:0;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 li{margin:6px 0 6px 16px}.footerWrapper{background-color:#fff;border-top:1px solid #e6e5d9;bottom:0;padding:12px 0;position:absolute;text-align:center;width:100%}.footerWrapper a{text-decoration:none}.article-pwd>div,.article-pwd>form{margin:0 20px}.article-pwd>div{margin-bottom:10px;max-height:264px;overflow:auto;word-wrap:break-word}.img-403,.img-500{box-shadow:0 0 5px #e6e5d9;margin:20px 0 0 45px;padding:5px}.a-403,.a-500{margin:20px 50px 0 0;text-align:right}.a-403{margin:20px 75px 0 0}.img-500{margin:25px 0 0 25px}.a-500{margin:25px 35px 0 0}.kill img{position:absolute;right:40px;top:200px}.kill ul{margin-bottom:50px}.kill p{margin:12px 20px}.kill span{margin-left:20px}#init{position:absolute;top:81px;width:470px}#init input,.register input{margin:5px 0;padding:5px 8px}#sys p{height:166px}#sys{padding:0 20px}#initButton{margin-right:10px}#tip{color:#21759b;font-weight:bold;margin-left:10px}
\ No newline at end of file
......@@ -3171,12 +3171,12 @@ admin.register["plugin-list"] = {
*
* @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, Feb 23, 2013
* @version 1.0.1.5, Apr 1, 2013
*/
/* user-list 相关操作 */
admin.userList = {
tablePagination: new TablePaginate("user"),
tablePagination: new TablePaginate("user"),
pageInfo: {
currentCount: 1,
pageCount: 1,
......@@ -3186,31 +3186,30 @@ admin.userList = {
'oId': "",
"userRole": ""
},
/*
* 初始化 table, pagination
*/
init: function (page) {
init: function(page) {
this.tablePagination.buildTable([{
style: "padding-left: 12px;",
text: Label.commentNameLabel,
index: "userName",
width: 230
}, {
style: "padding-left: 12px;",
text: Label.commentEmailLabel,
index: "userEmail",
minWidth: 180
}, {
style: "padding-left: 12px;",
text: Label.administratorLabel,
index: "isAdmin",
width: 120
}]);
style: "padding-left: 12px;",
text: Label.commentNameLabel,
index: "userName",
width: 230
}, {
style: "padding-left: 12px;",
text: Label.commentEmailLabel,
index: "userEmail",
minWidth: 180
}, {
style: "padding-left: 12px;",
text: Label.administratorLabel,
index: "isAdmin",
width: 120
}]);
this.tablePagination.initPagination();
this.getList(page);
$("#userUpdate").dialog({
width: 700,
height: 190,
......@@ -3218,27 +3217,26 @@ admin.userList = {
"hideFooter": true
});
},
/*
* 根据当前页码获取列表
* @pagNum 当前页码
*/
getList: function (pageNum) {
getList: function(pageNum) {
$("#loadMsg").text(Label.loadingLabel);
this.pageInfo.currentPage = pageNum;
var that = this;
$.ajax({
url: latkeConfig.servePath + "/console/users/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
url: latkeConfig.servePath + "/console/users/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
type: "GET",
cache: false,
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var users = result.users;
var userData = [];
admin.userList.pageInfo.currentCount = users.length;
......@@ -3248,104 +3246,100 @@ admin.userList = {
$("#loadMsg").text("");
return;
}
for (var i = 0; i < users.length; i++) {
userData[i] = {};
userData[i].userName = users[i].userName;
userData[i].userEmail = users[i].userEmail;
if ("adminRole" === users[i].userRole) {
userData[i].isAdmin = "&nbsp;" + Label.administratorLabel;
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>";
} else if ("defaultRole" === users[i].userRole) {
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.userList.del('" + users[i].oId + "', '" + users[i].userName + "')\">" + Label.removeLabel + "</a>" +
"<a href='javascript:void(0)' onclick=\"admin.userList.changeRole('" + users[i].oId + "')\">" + "ChangeRole" + "</a>";
userData[i].isAdmin = Label.commonUserLabel;
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>";
} else {
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.userList.del('" + users[i].oId + "', '" + users[i].userName + "')\">" + Label.removeLabel + "</a>" +
"<a href='javascript:void(0)' onclick=\"admin.userList.changeRole('" + users[i].oId + "')\">" + "ChangeRole" + "</a>";
userData[i].isAdmin = Label.visitorUserLabel;
"<a href='javascript:void(0)' onclick=\"admin.userList.changeRole('" + users[i].oId + "')\">" + Label.changeRoleLabel + "</a>";
if ("defaultRole" === users[i].userRole) {
userData[i].isAdmin = Label.commonUserLabel;
}
else {
userData[i].isAdmin = Label.visitorUserLabel;
}
}
that.tablePagination.updateTablePagination(userData, pageNum, result.pagination);
$("#loadMsg").text("");
}
that.tablePagination.updateTablePagination(userData, pageNum, result.pagination);
$("#loadMsg").text("");
}
});
},
/*
* 添加用户
*/
add: function () {
add: function() {
if (this.validate()) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var requestJSONObject = {
"userName": $("#userName").val(),
"userEmail": $("#userEmail").val(),
"userPassword": $("#userPassword").val()
};
$.ajax({
url: latkeConfig.servePath + "/console/user/",
type: "POST",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
$("#userName").val("");
$("#userEmail").val("");
$("#userPassword").val("");
if (admin.userList.pageInfo.currentCount === Label.PAGE_SIZE &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount++;
}
var hashList = window.location.hash.split("/");
if (admin.userList.pageInfo.pageCount !== parseInt(hashList[hashList.length - 1])) {
admin.setHashByPage(admin.userList.pageInfo.pageCount);
}
admin.userList.getList(admin.userList.pageInfo.pageCount);
$("#loadMsg").text("");
}
});
}
},
/*
* 获取用户
* @id 用户 id
*/
get: function (id, userRole) {
get: function(id, userRole) {
$("#loadMsg").text(Label.loadingLabel);
$("#userUpdate").dialog("open");
$.ajax({
url: latkeConfig.servePath + "/console/user/" + id,
type: "GET",
cache: false,
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var $userEmailUpdate = $("#userEmailUpdate");
$("#userNameUpdate").val(result.user.userName).data("userInfo", {
'oId': id,
......@@ -3358,20 +3352,19 @@ admin.userList = {
$userEmailUpdate.removeAttr("disabled");
}
$("#userPasswordUpdate").val(result.user.userPassword);
$("#loadMsg").text("");
}
});
},
/*
* 更新用户
*/
update: function () {
update: function() {
if (this.validate("Update")) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var userInfo = $("#userNameUpdate").data("userInfo");
var requestJSONObject = {
"userName": $("#userNameUpdate").val(),
......@@ -3380,53 +3373,52 @@ admin.userList = {
"userRole": userInfo.userRole,
"userPassword": $("#userPasswordUpdate").val()
};
$.ajax({
url: latkeConfig.servePath + "/console/user/",
type: "PUT",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
success: function(result, textStatus) {
$("#userUpdate").dialog("close");
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
admin.userList.getList(admin.userList.pageInfo.currentPage);
$("#loadMsg").text("");
}
});
}
},
/*
* 删除用户
* @id 用户 id
* @userName 用户名称
*/
del: function (id, userName) {
del: function(id, userName) {
var isDelete = confirm(Label.confirmRemoveLabel + Label.userLabel + '"' + userName + '"?');
if (isDelete) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/user/" + id,
type: "DELETE",
cache: false,
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var pageNum = admin.userList.pageInfo.currentPage;
if (admin.userList.pageInfo.currentCount === 1 && admin.userList.pageInfo.pageCount !== 1 &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount--;
pageNum = admin.userList.pageInfo.pageCount;
}
......@@ -3435,23 +3427,22 @@ admin.userList = {
admin.setHashByPage(pageNum);
}
admin.userList.getList(pageNum);
$("#loadMsg").text("");
}
});
}
},
/**
* 修改角色
* @param id
*/
changeRole : function(id){
changeRole: function(id) {
$.ajax({
url: latkeConfig.servePath + "/console/changeRole/" + id,
type: "GET",
cache: false,
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
......@@ -3460,7 +3451,7 @@ admin.userList = {
var pageNum = admin.userList.pageInfo.currentPage;
if (admin.userList.pageInfo.currentCount === 1 && admin.userList.pageInfo.pageCount !== 1 &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount--;
pageNum = admin.userList.pageInfo.pageCount;
}
......@@ -3474,12 +3465,11 @@ admin.userList = {
}
});
},
/*
* 验证字段
* @status 更新或者添加时进行验证
*/
validate: function (status) {
validate: function(status) {
if (!status) {
status = "";
}
......@@ -3487,10 +3477,10 @@ admin.userList = {
if (2 > userName.length || userName.length > 20) {
$("#tipMsg").text(Label.nameTooLongLabel);
$("#userName" + status).focus();
}else if ($("#userEmail" + status).val().replace(/\s/g, "") === "") {
} else if ($("#userEmail" + status).val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.mailCannotEmptyLabel);
$("#userEmail" + status).focus();
} else if(!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail" + status).val())) {
} else if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail" + status).val())) {
$("#tipMsg").text(Label.mailInvalidLabel);
$("#userEmail" + status).focus();
} else if ($("#userPassword" + status).val().replace(/\s/g, "") === "") {
......@@ -3506,10 +3496,10 @@ admin.userList = {
/*
* 注册到 admin 进行管理
*/
admin.register["user-list"] = {
admin.register["user-list"] = {
"obj": admin.userList,
"init": admin.userList.init,
"refresh": function () {
"refresh": function() {
$("#loadMsg").text("");
}
}/*
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 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.
*/
/**
* user 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.4, Feb 23, 2013
*/
/* user-list 相关操作 */
admin.userList = {
tablePagination: new TablePaginate("user"),
pageInfo: {
currentCount: 1,
pageCount: 1,
currentPage: 1
},
userInfo: {
'oId': "",
"userRole": ""
},
/*
* 初始化 table, pagination
*/
init: function (page) {
this.tablePagination.buildTable([{
style: "padding-left: 12px;",
text: Label.commentNameLabel,
index: "userName",
width: 230
}, {
style: "padding-left: 12px;",
text: Label.commentEmailLabel,
index: "userEmail",
minWidth: 180
}, {
style: "padding-left: 12px;",
text: Label.administratorLabel,
index: "isAdmin",
width: 120
}]);
this.tablePagination.initPagination();
this.getList(page);
$("#userUpdate").dialog({
width: 700,
height: 190,
"modal": true,
"hideFooter": true
});
},
/*
* 根据当前页码获取列表
* @pagNum 当前页码
*/
getList: function (pageNum) {
$("#loadMsg").text(Label.loadingLabel);
this.pageInfo.currentPage = pageNum;
var that = this;
$.ajax({
url: latkeConfig.servePath + "/console/users/" + 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 users = result.users;
var userData = [];
admin.userList.pageInfo.currentCount = users.length;
admin.userList.pageInfo.pageCount = result.pagination.paginationPageCount;
if (users.length < 1) {
$("#tipMsg").text("No user " + Label.reportIssueLabel);
$("#loadMsg").text("");
return;
}
for (var i = 0; i < users.length; i++) {
userData[i] = {};
userData[i].userName = users[i].userName;
userData[i].userEmail = users[i].userEmail;
if ("adminRole" === users[i].userRole) {
userData[i].isAdmin = "&nbsp;" + Label.administratorLabel;
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>";
} else if ("defaultRole" === users[i].userRole) {
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.userList.del('" + users[i].oId + "', '" + users[i].userName + "')\">" + Label.removeLabel + "</a>" +
"<a href='javascript:void(0)' onclick=\"admin.userList.changeRole('" + users[i].oId + "')\">" + "ChangeRole" + "</a>";
userData[i].isAdmin = Label.commonUserLabel;
} else {
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.userList.del('" + users[i].oId + "', '" + users[i].userName + "')\">" + Label.removeLabel + "</a>" +
"<a href='javascript:void(0)' onclick=\"admin.userList.changeRole('" + users[i].oId + "')\">" + "ChangeRole" + "</a>";
userData[i].isAdmin = Label.visitorUserLabel;
}
}
that.tablePagination.updateTablePagination(userData, pageNum, result.pagination);
$("#loadMsg").text("");
}
});
},
/*
* 添加用户
*/
add: function () {
if (this.validate()) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var requestJSONObject = {
"userName": $("#userName").val(),
"userEmail": $("#userEmail").val(),
"userPassword": $("#userPassword").val()
};
$.ajax({
url: latkeConfig.servePath + "/console/user/",
type: "POST",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
$("#userName").val("");
$("#userEmail").val("");
$("#userPassword").val("");
if (admin.userList.pageInfo.currentCount === Label.PAGE_SIZE &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount++;
}
var hashList = window.location.hash.split("/");
if (admin.userList.pageInfo.pageCount !== parseInt(hashList[hashList.length - 1])) {
admin.setHashByPage(admin.userList.pageInfo.pageCount);
}
admin.userList.getList(admin.userList.pageInfo.pageCount);
$("#loadMsg").text("");
}
});
}
},
/*
* 获取用户
* @id 用户 id
*/
get: function (id, userRole) {
$("#loadMsg").text(Label.loadingLabel);
$("#userUpdate").dialog("open");
$.ajax({
url: latkeConfig.servePath + "/console/user/" + id,
type: "GET",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var $userEmailUpdate = $("#userEmailUpdate");
$("#userNameUpdate").val(result.user.userName).data("userInfo", {
'oId': id,
"userRole": userRole
});
$userEmailUpdate.val(result.user.userEmail);
if ("adminRole" === userRole) {
$userEmailUpdate.attr("disabled", "disabled");
} else {
$userEmailUpdate.removeAttr("disabled");
}
$("#userPasswordUpdate").val(result.user.userPassword);
$("#loadMsg").text("");
}
});
},
/*
* 更新用户
*/
update: function () {
if (this.validate("Update")) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var userInfo = $("#userNameUpdate").data("userInfo");
var requestJSONObject = {
"userName": $("#userNameUpdate").val(),
"oId": userInfo.oId,
"userEmail": $("#userEmailUpdate").val(),
"userRole": userInfo.userRole,
"userPassword": $("#userPasswordUpdate").val()
};
$.ajax({
url: latkeConfig.servePath + "/console/user/",
type: "PUT",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
$("#userUpdate").dialog("close");
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
admin.userList.getList(admin.userList.pageInfo.currentPage);
$("#loadMsg").text("");
}
});
}
},
/*
* 删除用户
* @id 用户 id
* @userName 用户名称
*/
del: function (id, userName) {
var isDelete = confirm(Label.confirmRemoveLabel + Label.userLabel + '"' + userName + '"?');
if (isDelete) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/user/" + id,
type: "DELETE",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var pageNum = admin.userList.pageInfo.currentPage;
if (admin.userList.pageInfo.currentCount === 1 && admin.userList.pageInfo.pageCount !== 1 &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount--;
pageNum = admin.userList.pageInfo.pageCount;
}
var hashList = window.location.hash.split("/");
if (pageNum !== parseInt(hashList[hashList.length - 1])) {
admin.setHashByPage(pageNum);
}
admin.userList.getList(pageNum);
$("#loadMsg").text("");
}
});
}
},
/**
* 修改角色
* @param id
*/
changeRole : function(id){
$.ajax({
url: latkeConfig.servePath + "/console/changeRole/" + id,
type: "GET",
cache: false,
success: function(result, textStatus){
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var pageNum = admin.userList.pageInfo.currentPage;
if (admin.userList.pageInfo.currentCount === 1 && admin.userList.pageInfo.pageCount !== 1 &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount--;
pageNum = admin.userList.pageInfo.pageCount;
}
var hashList = window.location.hash.split("/");
if (pageNum !== parseInt(hashList[hashList.length - 1])) {
admin.setHashByPage(pageNum);
}
admin.userList.getList(pageNum);
$("#loadMsg").text("");
}
});
},
/*
* 验证字段
* @status 更新或者添加时进行验证
*/
validate: function (status) {
if (!status) {
status = "";
}
var userName = $("#userName" + status).val().replace(/(^\s*)|(\s*$)/g, "");
if (2 > userName.length || userName.length > 20) {
$("#tipMsg").text(Label.nameTooLongLabel);
$("#userName" + status).focus();
}else if ($("#userEmail" + status).val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.mailCannotEmptyLabel);
$("#userEmail" + status).focus();
} else if(!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail" + status).val())) {
$("#tipMsg").text(Label.mailInvalidLabel);
$("#userEmail" + status).focus();
} else if ($("#userPassword" + status).val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.passwordEmptyLabel);
$("#userPassword" + status).focus();
} else {
return true;
}
return false;
}
};
/*
* 注册到 admin 进行管理
*/
admin.register["user-list"] = {
"obj": admin.userList,
"init": admin.userList.init,
"refresh": function () {
$("#loadMsg").text("");
}
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 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.
*/
/**
* user 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.5, Apr 1, 2013
*/
/* user-list 相关操作 */
admin.userList = {
tablePagination: new TablePaginate("user"),
pageInfo: {
currentCount: 1,
pageCount: 1,
currentPage: 1
},
userInfo: {
'oId': "",
"userRole": ""
},
/*
* 初始化 table, pagination
*/
init: function(page) {
this.tablePagination.buildTable([{
style: "padding-left: 12px;",
text: Label.commentNameLabel,
index: "userName",
width: 230
}, {
style: "padding-left: 12px;",
text: Label.commentEmailLabel,
index: "userEmail",
minWidth: 180
}, {
style: "padding-left: 12px;",
text: Label.administratorLabel,
index: "isAdmin",
width: 120
}]);
this.tablePagination.initPagination();
this.getList(page);
$("#userUpdate").dialog({
width: 700,
height: 190,
"modal": true,
"hideFooter": true
});
},
/*
* 根据当前页码获取列表
* @pagNum 当前页码
*/
getList: function(pageNum) {
$("#loadMsg").text(Label.loadingLabel);
this.pageInfo.currentPage = pageNum;
var that = this;
$.ajax({
url: latkeConfig.servePath + "/console/users/" + 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 users = result.users;
var userData = [];
admin.userList.pageInfo.currentCount = users.length;
admin.userList.pageInfo.pageCount = result.pagination.paginationPageCount;
if (users.length < 1) {
$("#tipMsg").text("No user " + Label.reportIssueLabel);
$("#loadMsg").text("");
return;
}
for (var i = 0; i < users.length; i++) {
userData[i] = {};
userData[i].userName = users[i].userName;
userData[i].userEmail = users[i].userEmail;
if ("adminRole" === users[i].userRole) {
userData[i].isAdmin = "&nbsp;" + Label.administratorLabel;
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>";
} else {
userData[i].expendRow = "<a href='javascript:void(0)' onclick=\"admin.userList.get('" +
users[i].oId + "', '" + users[i].userRole + "')\">" + Label.updateLabel + "</a>\
<a href='javascript:void(0)' onclick=\"admin.userList.del('" + users[i].oId + "', '" + users[i].userName + "')\">" + Label.removeLabel + "</a>" +
"<a href='javascript:void(0)' onclick=\"admin.userList.changeRole('" + users[i].oId + "')\">" + Label.changeRoleLabel + "</a>";
if ("defaultRole" === users[i].userRole) {
userData[i].isAdmin = Label.commonUserLabel;
}
else {
userData[i].isAdmin = Label.visitorUserLabel;
}
}
that.tablePagination.updateTablePagination(userData, pageNum, result.pagination);
$("#loadMsg").text("");
}
}
});
},
/*
* 添加用户
*/
add: function() {
if (this.validate()) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var requestJSONObject = {
"userName": $("#userName").val(),
"userEmail": $("#userEmail").val(),
"userPassword": $("#userPassword").val()
};
$.ajax({
url: latkeConfig.servePath + "/console/user/",
type: "POST",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
$("#userName").val("");
$("#userEmail").val("");
$("#userPassword").val("");
if (admin.userList.pageInfo.currentCount === Label.PAGE_SIZE &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount++;
}
var hashList = window.location.hash.split("/");
if (admin.userList.pageInfo.pageCount !== parseInt(hashList[hashList.length - 1])) {
admin.setHashByPage(admin.userList.pageInfo.pageCount);
}
admin.userList.getList(admin.userList.pageInfo.pageCount);
$("#loadMsg").text("");
}
});
}
},
/*
* 获取用户
* @id 用户 id
*/
get: function(id, userRole) {
$("#loadMsg").text(Label.loadingLabel);
$("#userUpdate").dialog("open");
$.ajax({
url: latkeConfig.servePath + "/console/user/" + id,
type: "GET",
cache: false,
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var $userEmailUpdate = $("#userEmailUpdate");
$("#userNameUpdate").val(result.user.userName).data("userInfo", {
'oId': id,
"userRole": userRole
});
$userEmailUpdate.val(result.user.userEmail);
if ("adminRole" === userRole) {
$userEmailUpdate.attr("disabled", "disabled");
} else {
$userEmailUpdate.removeAttr("disabled");
}
$("#userPasswordUpdate").val(result.user.userPassword);
$("#loadMsg").text("");
}
});
},
/*
* 更新用户
*/
update: function() {
if (this.validate("Update")) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var userInfo = $("#userNameUpdate").data("userInfo");
var requestJSONObject = {
"userName": $("#userNameUpdate").val(),
"oId": userInfo.oId,
"userEmail": $("#userEmailUpdate").val(),
"userRole": userInfo.userRole,
"userPassword": $("#userPasswordUpdate").val()
};
$.ajax({
url: latkeConfig.servePath + "/console/user/",
type: "PUT",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus) {
$("#userUpdate").dialog("close");
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
admin.userList.getList(admin.userList.pageInfo.currentPage);
$("#loadMsg").text("");
}
});
}
},
/*
* 删除用户
* @id 用户 id
* @userName 用户名称
*/
del: function(id, userName) {
var isDelete = confirm(Label.confirmRemoveLabel + Label.userLabel + '"' + userName + '"?');
if (isDelete) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/user/" + id,
type: "DELETE",
cache: false,
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var pageNum = admin.userList.pageInfo.currentPage;
if (admin.userList.pageInfo.currentCount === 1 && admin.userList.pageInfo.pageCount !== 1 &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount--;
pageNum = admin.userList.pageInfo.pageCount;
}
var hashList = window.location.hash.split("/");
if (pageNum !== parseInt(hashList[hashList.length - 1])) {
admin.setHashByPage(pageNum);
}
admin.userList.getList(pageNum);
$("#loadMsg").text("");
}
});
}
},
/**
* 修改角色
* @param id
*/
changeRole: function(id) {
$.ajax({
url: latkeConfig.servePath + "/console/changeRole/" + id,
type: "GET",
cache: false,
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
return;
}
var pageNum = admin.userList.pageInfo.currentPage;
if (admin.userList.pageInfo.currentCount === 1 && admin.userList.pageInfo.pageCount !== 1 &&
admin.userList.pageInfo.currentPage === admin.userList.pageInfo.pageCount) {
admin.userList.pageInfo.pageCount--;
pageNum = admin.userList.pageInfo.pageCount;
}
var hashList = window.location.hash.split("/");
if (pageNum !== parseInt(hashList[hashList.length - 1])) {
admin.setHashByPage(pageNum);
}
admin.userList.getList(pageNum);
$("#loadMsg").text("");
}
});
},
/*
* 验证字段
* @status 更新或者添加时进行验证
*/
validate: function(status) {
if (!status) {
status = "";
}
var userName = $("#userName" + status).val().replace(/(^\s*)|(\s*$)/g, "");
if (2 > userName.length || userName.length > 20) {
$("#tipMsg").text(Label.nameTooLongLabel);
$("#userName" + status).focus();
} else if ($("#userEmail" + status).val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.mailCannotEmptyLabel);
$("#userEmail" + status).focus();
} else if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#userEmail" + status).val())) {
$("#tipMsg").text(Label.mailInvalidLabel);
$("#userEmail" + status).focus();
} else if ($("#userPassword" + status).val().replace(/\s/g, "") === "") {
$("#tipMsg").text(Label.passwordEmptyLabel);
$("#userPassword" + status).focus();
} else {
return true;
}
return false;
}
};
/*
* 注册到 admin 进行管理
*/
admin.register["user-list"] = {
"obj": admin.userList,
"init": admin.userList.init,
"refresh": function() {
$("#loadMsg").text("");
}
}
\ No newline at end of file
......@@ -24,7 +24,7 @@
</a>
</div>
<div class="main register">
<h2>${registerSoloUser}</h2>
<h2>${registerSoloUserLabel}</h2>
<div class="form">
<label for="userEmail">
${commentEmail1Label}
......
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