Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
f4372aa2
Unverified
Commit
f4372aa2
authored
Sep 14, 2019
by
Van
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
❇
fix #12894
parent
53336c9b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
src/main/webapp/js/admin/admin.min.js
src/main/webapp/js/admin/admin.min.js
+1
-1
src/main/webapp/js/admin/articleList.js
src/main/webapp/js/admin/articleList.js
+10
-5
No files found.
src/main/webapp/js/admin/admin.min.js
View file @
f4372aa2
...
...
@@ -3,7 +3,7 @@ admin.editors={};var SoloEditor=function(e){this.conf=e,this.init()};$.extend(So
var
TablePaginate
=
function
(
a
){
this
.
id
=
a
,
this
.
currentPage
=
1
};
$
.
extend
(
TablePaginate
.
prototype
,{
buildTable
:
function
(
a
,
t
){
var
e
=
{
colModel
:
a
,
noDataTip
:
Label
.
noDataLabel
};
t
||
(
e
.
expendRow
=
{
index
:
"
expendRow
"
}),
$
(
"
#
"
+
this
.
id
+
"
Table
"
).
table
(
e
)},
initPagination
:
function
(){
var
a
=
this
.
id
;
$
(
"
#
"
+
a
+
"
Pagination
"
).
paginate
({
bind
:
function
(
a
,
t
){
t
?
$
(
"
#tipMsg
"
).
text
(
t
):
admin
.
setHashByPage
(
a
)},
currentPage
:
1
,
errorMessage
:
Label
.
inputErrorLabel
,
nextPageText
:
"
>
"
,
previousPageText
:
"
<
"
,
goText
:
Label
.
gotoLabel
,
type
:
"
custom
"
,
custom
:[
1
],
pageCount
:
1
})},
initCommentsDialog
:
function
(){
var
a
=
this
;
$
(
"
#
"
+
this
.
id
+
"
Comments
"
).
dialog
({
modal
:
!
0
,
hideFooter
:
!
0
,
close
:
function
(){
return
admin
[
a
.
id
+
"
List
"
].
getList
(
a
.
currentPage
),
!
0
}})},
updateTablePagination
:
function
(
a
,
t
,
e
){
if
((
t
=
parseInt
(
t
))
>
e
.
paginationPageCount
&&
1
<
t
)
return
$
(
"
#tipMsg
"
).
text
(
Label
.
pageLabel
+
t
+
Label
.
notFoundLabel
),
void
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#
"
+
this
.
id
+
"
Table
"
).
table
(
"
update
"
,{
data
:[{
groupName
:
"
all
"
,
groupData
:
a
}]}),
0
===
e
.
paginationPageCount
&&
(
e
.
paginationPageCount
=
1
),
$
(
"
#
"
+
this
.
id
+
"
Pagination
"
).
paginate
(
"
update
"
,{
pageCount
:
e
.
paginationPageCount
,
currentPage
:
t
,
custom
:
e
.
paginationPageNums
}),
this
.
currentPage
=
t
}});
admin
.
article
=
{
isConfirm
:
!
0
,
status
:{
id
:
void
0
,
isArticle
:
void
0
},
content
:
""
,
get
:
function
(
t
,
e
){
this
.
status
.
id
=
t
,
this
.
status
.
isArticle
=
e
,
admin
.
selectTab
(
"
article/article
"
)},
getAndSet
:
function
(){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/
"
+
admin
.
article
.
status
.
id
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){
if
(
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
){
$
(
"
#title
"
).
val
(
e
.
article
.
articleTitle
),
admin
.
editors
.
articleEditor
.
setContent
(
e
.
article
.
articleContent
),
admin
.
editors
.
abstractEditor
.
setContent
(
e
.
article
.
articleAbstract
),
admin
.
article
.
content
=
admin
.
editors
.
articleEditor
.
getContent
();
for
(
var
i
=
e
.
article
.
articleTags
,
a
=
""
,
l
=
0
;
l
<
i
.
length
;
l
++
)
0
===
l
?
a
=
i
[
l
].
tagTitle
:
a
+=
"
,
"
+
i
[
l
].
tagTitle
;
$
(
"
#tag
"
).
val
(
a
),
$
(
"
#permalink
"
).
val
(
e
.
article
.
articlePermalink
),
$
(
"
#viewPwd
"
).
val
(
e
.
article
.
articleViewPwd
),
$
(
"
#articleCommentable
"
).
prop
(
"
checked
"
,
e
.
article
.
articleCommentable
);
var
s
=
e
.
article
.
signs
;
$
(
"
.signs button
"
).
each
(
function
(
t
){
parseInt
(
e
.
article
.
articleSignId
)
===
parseInt
(
s
[
t
].
oId
)?
$
(
"
#articleSign
"
+
s
[
t
].
oId
).
addClass
(
"
selected
"
):
$
(
"
#articleSign
"
+
s
[
t
].
oId
).
removeClass
(
"
selected
"
)}),
admin
.
article
.
setStatus
(),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
del
:
function
(
t
,
i
,
e
){
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
articleLabel
+
'
"
'
+
Util
.
htmlDecode
(
e
)
+
'
"?
'
)
&&
(
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/
"
+
t
,
type
:
"
DELETE
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
?
admin
[
i
+
"
List
"
].
getList
(
1
):
$
(
"
#loadMsg
"
).
text
(
""
)}}))},
add
:
function
(
e
){
if
(
admin
.
article
.
validate
()){
var
i
=
this
;
i
.
_addDisabled
(),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
t
=
""
;
$
(
"
.signs button
"
).
each
(
function
(){
"
selected
"
===
this
.
className
&&
(
t
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
))});
var
a
=
admin
.
editors
.
articleEditor
.
getContent
(),
l
=
admin
.
editors
.
abstractEditor
.
getContent
();
if
(
$
(
"
#articleThumbnail
"
).
prop
(
"
checked
"
)){
var
s
=
$
(
"
.thumbnail__img
"
).
css
(
"
background-image
"
);
a
=
"
.
replace
(
"
w/768
"
,
"
w/960
"
).
replace
(
"
h/432
"
,
"
h/540
"
)
+
"
)
\n\n
"
+
a
}
var
c
=
{
article
:{
articleTitle
:
$
(
"
#title
"
).
val
(),
articleContent
:
a
,
articleAbstract
:
l
,
articleTags
:
this
.
trimUniqueArray
(
$
(
"
#tag
"
).
val
()).
toString
(),
articlePermalink
:
$
(
"
#permalink
"
).
val
(),
articleStatus
:
e
,
articleSignId
:
t
,
postToCommunity
:
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
),
articleCommentable
:
$
(
"
#articleCommentable
"
).
prop
(
"
checked
"
),
articleViewPwd
:
$
(
"
#viewPwd
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/
"
,
type
:
"
POST
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
c
),
success
:
function
(
t
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
&&
(
admin
.
article
.
status
.
id
=
void
0
,
0
===
e
?
admin
.
selectTab
(
"
article/article-list
"
):
admin
.
selectTab
(
"
article/draft-list
"
),
admin
.
article
.
isConfirm
=!
1
)},
complete
:
function
(
t
,
e
){
i
.
_removeDisabled
(),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
update
:
function
(
i
){
if
(
admin
.
article
.
validate
()){
var
a
=
this
;
a
.
_addDisabled
(),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
t
=
""
;
$
(
"
.signs button
"
).
each
(
function
(){
"
selected
"
===
this
.
className
&&
(
t
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
))});
var
e
=
admin
.
editors
.
articleEditor
.
getContent
(),
l
=
admin
.
editors
.
abstractEditor
.
getContent
();
if
(
$
(
"
#articleThumbnail
"
).
prop
(
"
checked
"
)){
var
s
=
$
(
"
.thumbnail__img
"
).
css
(
"
background-image
"
);
e
=
"
.
replace
(
"
w/768
"
,
"
w/960
"
).
replace
(
"
h/432
"
,
"
h/540
"
)
+
"
)
\n\n
"
+
e
}
var
c
=
{
article
:{
oId
:
this
.
status
.
id
,
articleTitle
:
$
(
"
#title
"
).
val
(),
articleContent
:
e
,
articleAbstract
:
l
,
articleTags
:
this
.
trimUniqueArray
(
$
(
"
#tag
"
).
val
()).
toString
(),
articlePermalink
:
$
(
"
#permalink
"
).
val
(),
articleStatus
:
i
,
articleSignId
:
t
,
articleCommentable
:
$
(
"
#articleCommentable
"
).
prop
(
"
checked
"
),
articleViewPwd
:
$
(
"
#viewPwd
"
).
val
(),
postToCommunity
:
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
)}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
c
),
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
&&
(
0
===
i
?
admin
.
selectTab
(
"
article/article-list
"
):
admin
.
selectTab
(
"
article/draft-list
"
),
$
(
"
#tipMsg
"
).
text
(
Label
.
updateSuccLabel
),
admin
.
article
.
status
.
id
=
void
0
,
admin
.
article
.
isConfirm
=!
1
)},
complete
:
function
(
t
,
e
){
a
.
_removeDisabled
(),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
setStatus
:
function
(){
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/tags
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
){
if
(
!
(
t
.
tags
.
length
<=
0
)){
$
(
"
#tagCheckboxPanel>span
"
).
remove
(
""
);
for
(
var
i
=
""
,
a
=
0
;
a
<
t
.
tags
.
length
;
a
++
)
i
+=
"
<span>
"
+
t
.
tags
[
a
].
tagTitle
+
"
</span>
"
;
$
(
"
#tagCheckboxPanel
"
).
html
(
i
+
'
<div class="fn__clear"></div>
'
),
$
(
"
#loadMsg
"
).
text
(
""
)}}
else
$
(
"
#loadMsg
"
).
text
(
""
)}}),
this
.
status
?
this
.
status
.
isArticle
?(
$
(
"
#unSubmitArticle
"
).
show
(),
$
(
"
#saveArticle
"
).
hide
(),
$
(
"
#submitArticle
"
).
show
()):(
$
(
"
#submitArticle
"
).
show
(),
$
(
"
#unSubmitArticle
"
).
hide
(),
$
(
"
#saveArticle
"
).
show
()):(
$
(
"
#submitArticle
"
).
show
(),
$
(
"
#unSubmitArticle
"
).
hide
(),
$
(
"
#saveArticle
"
).
show
(),
$
(
"
#postToCommunityPanel
"
).
show
())},
clear
:
function
(){
this
.
status
=
{
id
:
void
0
,
isArticle
:
void
0
},
this
.
setStatus
(),
$
(
"
#title
"
).
val
(
""
),
admin
.
editors
.
articleEditor
.
setContent
(
""
),
admin
.
editors
.
abstractEditor
.
setContent
(
""
),
$
(
"
#tag
"
).
val
(
""
),
$
(
"
#tagCheckboxPanel
"
).
hide
().
find
(
"
span
"
).
removeClass
(
"
selected
"
),
$
(
"
#permalink
"
).
val
(
""
),
$
(
"
#articleCammentable
"
).
prop
(
"
checked
"
,
!
0
),
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
,
!
1
),
$
(
"
.signs button
"
).
each
(
function
(
t
){
this
.
className
=
0
===
t
?
"
selected
"
:
""
}),
$
(
"
#articleThumbnail
"
).
prop
(
"
checked
"
)
&&
$
(
"
#articleThumbnail
"
).
click
()},
init
:
function
(
t
){
$
(
"
.signs button
"
).
click
(
function
(
t
){
$
(
"
.signs button
"
).
removeClass
(
"
selected
"
),
$
(
this
).
addClass
(
"
selected
"
)}),
$
(
"
#tipMsg
"
).
text
(
Label
.
uploadMsg
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/tags
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
){
if
(
!
(
t
.
tags
.
length
<=
0
)){
for
(
var
i
=
[],
a
=
0
;
a
<
t
.
tags
.
length
;
a
++
)
i
.
push
(
t
.
tags
[
a
].
tagTitle
);
$
(
"
#tag
"
).
completed
({
height
:
160
,
buttonText
:
Label
.
selectLabel
,
data
:
i
}),
$
(
"
#loadMsg
"
).
text
(
""
)}}
else
$
(
"
#loadMsg
"
).
text
(
""
)}}),
$
(
"
#submitArticle
"
).
click
(
function
(){
admin
.
article
.
status
.
id
?
admin
.
article
.
update
(
0
):
admin
.
article
.
add
(
0
)}),
$
(
"
#saveArticle
"
).
click
(
function
(){
admin
.
article
.
status
.
id
?
admin
.
article
.
update
(
admin
.
article
.
status
.
isArticle
?
0
:
1
):
admin
.
article
.
add
(
1
)}),
admin
.
editors
.
articleEditor
=
new
SoloEditor
({
id
:
"
articleContent
"
,
height
:
500
,
fun
:
t
,
previewMode
:
"
both
"
,
resize
:
!
1
}),
admin
.
editors
.
abstractEditor
=
new
SoloEditor
({
id
:
"
abstract
"
,
height
:
200
,
previewMode
:
"
editor
"
,
resize
:
!
0
}),
$
(
"
#articleThumbnailBtn
"
).
click
(
function
(){
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/thumbs?n=1&w=768&h=432
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
t
.
sc
?
$
(
"
#articleThumbnailBtn
"
).
prev
().
css
(
"
background-image
"
,
"
url(
"
+
t
.
data
[
0
]
+
"
)
"
):
$
(
"
#loadMsg
"
).
text
(
t
.
msg
)}})}).
click
()},
validate
:
function
(){
var
t
=
admin
.
editors
.
articleEditor
.
getContent
();
if
(
""
===
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
))
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
),
$
(
"
#title
"
).
focus
().
val
(
""
);
else
{
if
(
""
!==
t
.
replace
(
/
\s
/g
,
""
))
return
!
0
;
$
(
"
#tipMsg
"
).
text
(
Label
.
contentEmptyLabel
)}
return
!
1
},
unPublish
:
function
(){
var
i
=
this
;
i
.
_addDisabled
(),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/unpublish/
"
+
admin
.
article
.
status
.
id
,
type
:
"
PUT
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
&&
(
admin
.
selectTab
(
"
article/draft-list
"
),
admin
.
article
.
status
.
id
=
void
0
,
admin
.
article
.
isConfirm
=!
1
)},
complete
:
function
(
t
,
e
){
i
.
_removeDisabled
(),
$
(
"
#loadMsg
"
).
text
(
""
)}})},
trimUniqueArray
:
function
(
t
){
for
(
var
e
=
(
t
=
t
.
toString
()).
split
(
"
,
"
),
i
=
0
;
i
<
e
.
length
;
i
++
)
e
[
i
]
=
e
[
i
].
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
),
""
===
e
[
i
]
&&
(
e
.
splice
(
i
,
1
),
i
--
);
return
$
.
unique
(
e
).
toString
()},
prePost
:
function
(){
if
(
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
admin
.
article
.
content
=
""
,
admin
.
editors
.
articleEditor
.
getContent
){
var
t
=
admin
.
editors
.
articleEditor
.
getContent
();
"
#article/article
"
===
window
.
location
.
hash
&&
""
!==
t
.
replace
(
/
\s
/g
,
""
)
&&
confirm
(
Label
.
editorPostLabel
)
&&
admin
.
article
.
clear
(),
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#loadMsg
"
).
text
(
""
)}},
_addDisabled
:
function
(){
$
(
"
#unSubmitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
),
$
(
"
#saveArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
),
$
(
"
#submitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
)},
_removeDisabled
:
function
(){
$
(
"
#unSubmitArticle
"
).
removeAttr
(
"
disabled
"
),
$
(
"
#saveArticle
"
).
removeAttr
(
"
disabled
"
),
$
(
"
#submitArticle
"
).
removeAttr
(
"
disabled
"
)}},
admin
.
register
.
article
=
{
obj
:
admin
.
article
,
init
:
admin
.
article
.
init
,
refresh
:
function
(){
admin
.
editors
.
abstractEditor
.
setContent
(
""
),
admin
.
editors
.
articleEditor
.
setContent
(
""
),
$
(
"
#loadMsg
"
).
text
(
""
),
$
(
"
#tipMsg
"
).
text
(
Label
.
uploadMsg
)}};
admin
.
comment
=
{
open
:
function
(
e
,
t
){
this
.
getList
(
e
,
t
),
$
(
"
#
"
+
t
+
"
Comments
"
).
dialog
(
"
open
"
)},
getList
:
function
(
l
,
c
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#
"
+
c
+
"
Comments
"
).
html
(
""
);
var
e
=
"
article
"
;
"
page
"
===
c
&&
(
e
=
"
page
"
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/comments/
"
+
e
+
"
/
"
+
l
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){
if
(
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
){
for
(
var
a
=
e
.
comments
,
n
=
""
,
m
=
0
;
m
<
a
.
length
;
m
++
){
var
s
=
"
<a target='_blank' href='
"
+
a
[
m
].
commentURL
+
"
'>
"
,
o
=
a
[
m
].
commentContent
;
"
http://
"
===
a
[
m
].
commentURL
&&
(
s
=
"
<a target='_blank'>
"
),
n
+=
"
<div class='comment-title'><span class='fn__left'>
"
+
s
+
a
[
m
].
commentName
+
"
</a>
"
,
a
[
m
].
commentOriginalCommentName
&&
(
n
+=
"
@
"
+
a
[
m
].
commentOriginalCommentName
),
n
+=
"
</span><a title='
"
+
Label
.
removeLabel
+
"
' class='fn__right fn__pointer' href=
\"
javascript:admin.comment.del('
"
+
a
[
m
].
oId
+
"
', '
"
+
c
+
"
', '
"
+
l
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a><span class='fn__right'>
"
+
$
.
bowknot
.
getDate
(
a
[
m
].
commentTime
)
+
"
</span><div class='fn__clear'></div></div><div class='vditor-reset'>
"
+
o
+
"
</div>
"
}
""
===
n
&&
(
n
=
Label
.
noCommentLabel
),
$
(
"
#
"
+
c
+
"
Comments
"
).
html
(
n
),
Util
.
parseMarkdown
(),
Util
.
parseLanguage
(),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
del
:
function
(
e
,
a
,
n
){
if
(
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
commentLabel
+
"
?
"
)){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
var
t
=
"
article
"
;
"
page
"
===
a
&&
(
t
=
"
page
"
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/
"
+
t
+
"
/comment/
"
+
e
,
type
:
"
DELETE
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
&&
admin
.
comment
.
getList
(
n
,
a
),
$
(
"
#loadMsg
"
).
text
(
""
)}})}}};
admin
.
articleList
=
{
tablePagination
:
new
TablePaginate
(
"
article
"
),
init
:
function
(
t
){
this
.
tablePagination
.
buildTable
([{
text
:
Label
.
titleLabel
,
index
:
"
title
"
,
minWidth
:
110
,
style
:
"
padding-left: 12px;font-size:14px;
"
},{
text
:
Label
.
authorLabel
,
index
:
"
author
"
,
width
:
150
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
commentLabel
,
index
:
"
comments
"
,
width
:
80
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
viewLabel
,
width
:
60
,
index
:
"
articleViewCount
"
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
dateLabel
,
index
:
"
date
"
,
width
:
90
,
style
:
"
padding-left: 12px;
"
}]),
this
.
tablePagination
.
initPagination
(),
this
.
tablePagination
.
initCommentsDialog
(),
this
.
getList
(
t
);
var
e
=
this
;
$
(
"
#articleListBtn
"
).
click
(
function
(){
e
.
getList
(
t
)})},
syncToHacpai
:
function
(
t
){
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/push2rhy?id=
"
+
t
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
Label
.
pushSuccLabel
)}})},
getList
:
function
(
c
){
var
o
=
this
;
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/articles/status/published/
"
+
c
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
+
"
?k=
"
+
$
(
"
#articleListInput
"
).
val
(),
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
){
for
(
var
a
=
t
.
articles
,
i
=
[],
l
=
0
;
l
<
a
.
length
;
l
++
){
i
[
l
]
=
{},
i
[
l
].
title
=
'
<a href="
'
+
Label
.
servePath
+
a
[
l
].
articlePermalink
+
"
\"
target='_blank' title='
"
+
a
[
l
].
articleTitle
+
"
' class='no-underline'>
"
+
a
[
l
].
articleTitle
+
"
</a><span class='table-tag'>
"
+
a
[
l
].
articleTags
+
"
</span>
"
,
i
[
l
].
date
=
$
.
bowknot
.
getDate
(
a
[
l
].
articleCreateTime
),
i
[
l
].
comments
=
a
[
l
].
articleCommentCount
,
i
[
l
].
articleViewCount
=
a
[
l
].
articleViewCount
,
i
[
l
].
author
=
a
[
l
].
authorName
;
var
n
=
a
[
l
].
articlePutTop
?
Label
.
cancelPutTopLabel
:
Label
.
putTopLabel
;
i
[
l
].
expendRow
=
"
<a href='javascript:void(0)' onclick=
\"
admin.article.get('
"
+
a
[
l
].
oId
+
"
', true)
\"
>
"
+
Label
.
updateLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.article.del('
"
+
a
[
l
].
oId
+
"
', 'article', '
"
+
encodeURIComponent
(
a
[
l
].
articleTitle
)
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.articleList.syncToHacpai('
"
+
a
[
l
].
oId
+
"
')
\"
>
"
+
Label
.
pushToHacpaiLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.articleList.popTop(this, '
"
+
a
[
l
].
oId
+
"
')
\"
>
"
+
n
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.comment.open('
"
+
a
[
l
].
oId
+
"
', 'article')
\"
>
"
+
Label
.
commentLabel
+
"
</a>
"
}
o
.
tablePagination
.
updateTablePagination
(
i
,
c
,
t
.
pagination
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
popTop
:
function
(
t
,
e
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
a
=
$
(
t
),
i
=
"
canceltop
"
,
l
=
Label
.
putTopLabel
;
a
.
html
()
===
Label
.
putTopLabel
&&
(
i
=
"
puttop
"
,
l
=
Label
.
cancelPutTopLabel
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/
"
+
i
+
"
/
"
+
e
,
type
:
"
PUT
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
&&
a
.
html
(
l
),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
article-list
"
]
=
{
obj
:
admin
.
articleList
,
init
:
admin
.
articleList
.
init
,
refresh
:
admin
.
articleList
.
getList
};
admin
.
articleList
=
{
tablePagination
:
new
TablePaginate
(
"
article
"
),
init
:
function
(
e
){
this
.
tablePagination
.
buildTable
([{
text
:
Label
.
titleLabel
,
index
:
"
title
"
,
minWidth
:
110
,
style
:
"
padding-left: 12px;font-size:14px;
"
},{
text
:
Label
.
authorLabel
,
index
:
"
author
"
,
width
:
150
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
commentLabel
,
index
:
"
comments
"
,
width
:
80
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
viewLabel
,
width
:
60
,
index
:
"
articleViewCount
"
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
dateLabel
,
index
:
"
date
"
,
width
:
90
,
style
:
"
padding-left: 12px;
"
}]),
this
.
tablePagination
.
initPagination
(),
this
.
tablePagination
.
initCommentsDialog
(),
this
.
getList
(
e
);
var
a
=
this
;
$
(
"
#articleListBtn
"
).
click
(
function
(){
a
.
getList
(
e
)}),
$
(
"
#articleListInput
"
).
keypress
(
function
(
t
){
13
===
t
.
keyCode
&&
a
.
getList
(
e
)})},
syncToHacpai
:
function
(
t
){
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/push2rhy?id=
"
+
t
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
Label
.
pushSuccLabel
)}})},
getList
:
function
(
c
){
var
o
=
this
;
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/articles/status/published/
"
+
c
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
+
"
?k=
"
+
$
(
"
#articleListInput
"
).
val
(),
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
){
for
(
var
a
=
t
.
articles
,
i
=
[],
l
=
0
;
l
<
a
.
length
;
l
++
){
i
[
l
]
=
{},
i
[
l
].
title
=
'
<a href="
'
+
Label
.
servePath
+
a
[
l
].
articlePermalink
+
"
\"
target='_blank' title='
"
+
a
[
l
].
articleTitle
+
"
' class='no-underline'>
"
+
a
[
l
].
articleTitle
+
"
</a><span class='table-tag'>
"
+
a
[
l
].
articleTags
+
"
</span>
"
,
i
[
l
].
date
=
$
.
bowknot
.
getDate
(
a
[
l
].
articleCreateTime
),
i
[
l
].
comments
=
a
[
l
].
articleCommentCount
,
i
[
l
].
articleViewCount
=
a
[
l
].
articleViewCount
,
i
[
l
].
author
=
a
[
l
].
authorName
;
var
n
=
a
[
l
].
articlePutTop
?
Label
.
cancelPutTopLabel
:
Label
.
putTopLabel
;
i
[
l
].
expendRow
=
"
<a href='javascript:void(0)' onclick=
\"
admin.article.get('
"
+
a
[
l
].
oId
+
"
', true)
\"
>
"
+
Label
.
updateLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.article.del('
"
+
a
[
l
].
oId
+
"
', 'article', '
"
+
encodeURIComponent
(
a
[
l
].
articleTitle
)
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.articleList.syncToHacpai('
"
+
a
[
l
].
oId
+
"
')
\"
>
"
+
Label
.
pushToHacpaiLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.articleList.popTop(this, '
"
+
a
[
l
].
oId
+
"
')
\"
>
"
+
n
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.comment.open('
"
+
a
[
l
].
oId
+
"
', 'article')
\"
>
"
+
Label
.
commentLabel
+
"
</a>
"
}
o
.
tablePagination
.
updateTablePagination
(
i
,
c
,
t
.
pagination
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
popTop
:
function
(
t
,
e
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
a
=
$
(
t
),
i
=
"
canceltop
"
,
l
=
Label
.
putTopLabel
;
a
.
html
()
===
Label
.
putTopLabel
&&
(
i
=
"
puttop
"
,
l
=
Label
.
cancelPutTopLabel
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/article/
"
+
i
+
"
/
"
+
e
,
type
:
"
PUT
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
&&
a
.
html
(
l
),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
article-list
"
]
=
{
obj
:
admin
.
articleList
,
init
:
admin
.
articleList
.
init
,
refresh
:
admin
.
articleList
.
getList
};
admin
.
draftList
=
{
tablePagination
:
new
TablePaginate
(
"
draft
"
),
init
:
function
(
t
){
this
.
tablePagination
.
buildTable
([{
text
:
Label
.
titleLabel
,
index
:
"
title
"
,
minWidth
:
110
,
style
:
"
padding-left: 12px;font-size:14px;
"
},{
text
:
Label
.
authorLabel
,
index
:
"
author
"
,
width
:
150
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
commentLabel
,
index
:
"
comments
"
,
width
:
80
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
viewLabel
,
width
:
60
,
index
:
"
articleViewCount
"
,
style
:
"
padding-left: 12px;
"
},{
text
:
Label
.
dateLabel
,
index
:
"
date
"
,
width
:
90
,
style
:
"
padding-left: 12px;
"
}]),
this
.
tablePagination
.
initPagination
(),
this
.
tablePagination
.
initCommentsDialog
(),
this
.
getList
(
t
)},
getList
:
function
(
n
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
var
d
=
this
;
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/articles/status/unpublished/
"
+
n
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
){
for
(
var
a
=
t
.
articles
,
i
=
[],
l
=
0
;
l
<
a
.
length
;
l
++
)
i
[
l
]
=
{},
i
[
l
].
tags
=
a
[
l
].
articleTags
,
i
[
l
].
date
=
$
.
bowknot
.
getDate
(
a
[
l
].
articleCreateTime
),
i
[
l
].
comments
=
a
[
l
].
articleCommentCount
,
i
[
l
].
articleViewCount
=
a
[
l
].
articleViewCount
,
i
[
l
].
author
=
a
[
l
].
authorName
,
i
[
l
].
title
=
"
<a class='no-underline' href='
"
+
Label
.
servePath
+
a
[
l
].
articlePermalink
+
"
' target='_blank'>
"
+
a
[
l
].
articleTitle
+
"
</a><span class='table-tag'>
"
+
a
[
l
].
articleTags
+
"
</span>
"
,
i
[
l
].
expendRow
=
"
<a href='javascript:void(0)' onclick=
\"
admin.article.get('
"
+
a
[
l
].
oId
+
"
', false);
\"
>
"
+
Label
.
updateLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.article.del('
"
+
a
[
l
].
oId
+
"
', 'draft', '
"
+
encodeURIComponent
(
a
[
l
].
articleTitle
)
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.comment.open('
"
+
a
[
l
].
oId
+
"
', 'draft')
\"
>
"
+
Label
.
commentLabel
+
"
</a>
"
;
d
.
tablePagination
.
updateTablePagination
(
i
,
n
,
t
.
pagination
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
draft-list
"
]
=
{
obj
:
admin
.
draftList
,
init
:
admin
.
draftList
.
init
,
refresh
:
admin
.
draftList
.
getList
};
admin
.
pageList
=
{
tablePagination
:
new
TablePaginate
(
"
page
"
),
pageInfo
:{
currentCount
:
1
,
pageCount
:
1
,
currentPage
:
1
},
id
:
""
,
init
:
function
(
e
){
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
:
100
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
openMethodLabel
,
index
:
"
pageTarget
"
,
width
:
120
}]),
this
.
tablePagination
.
initPagination
(),
this
.
getList
(
e
)},
getList
:
function
(
p
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
l
=
this
;
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/pages/
"
+
p
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
e
,
a
){
if
(
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
){
var
t
=
e
.
pages
,
i
=
[];
admin
.
pageList
.
pageInfo
.
currentCount
=
t
.
length
,
admin
.
pageList
.
pageInfo
.
pageCount
=
0
===
e
.
pagination
.
paginationPageCount
?
1
:
e
.
pagination
.
paginationPageCount
;
for
(
var
n
=
0
;
n
<
t
.
length
;
n
++
){
i
[
n
]
=
{},
0
===
n
?
1
===
t
.
length
?
i
[
n
].
pageOrder
=
""
:
i
[
n
].
pageOrder
=
'
<div class="table-center" style="width:14px"> <span onclick="admin.pageList.changeOrder(
'
+
t
[
n
].
oId
+
"
,
"
+
n
+
'
,
\'
down
\'
);" class="icon-move-down"></span></div>
'
:
n
===
t
.
length
-
1
?
i
[
n
].
pageOrder
=
'
<div class="table-center" style="width:14px"> <span onclick="admin.pageList.changeOrder(
'
+
t
[
n
].
oId
+
"
,
"
+
n
+
'
,
\'
up
\'
);" class="icon-move-up"></span> </div>
'
:
i
[
n
].
pageOrder
=
'
<div class="table-center" style="width:38px"> <span onclick="admin.pageList.changeOrder(
'
+
t
[
n
].
oId
+
"
,
"
+
n
+
'
,
\'
up
\'
);" class="icon-move-up"></span> <span onclick="admin.pageList.changeOrder(
'
+
t
[
n
].
oId
+
"
,
"
+
n
+
'
,
\'
down
\'
);" class="icon-move-down"></span> </div>
'
;
var
g
=
""
;
""
!==
t
[
n
].
pageIcon
&&
(
g
=
"
<img class='navigation-icon' src='
"
+
t
[
n
].
pageIcon
+
"
'/>
"
),
i
[
n
].
pageTitle
=
g
+
"
<a class='no-underline' href='
"
+
t
[
n
].
pagePermalink
+
"
' target='_blank'>
"
+
t
[
n
].
pageTitle
+
"
</a>
"
,
i
[
n
].
pagePermalink
=
"
<a class='no-underline' href='
"
+
t
[
n
].
pagePermalink
+
"
' target='_blank'>
"
+
t
[
n
].
pagePermalink
+
"
</a>
"
,
i
[
n
].
pageTarget
=
t
[
n
].
pageOpenTarget
,
i
[
n
].
expendRow
=
"
<span><a href='
"
+
t
[
n
].
pagePermalink
+
"
' target='_blank'>
"
+
Label
.
viewLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.pageList.get('
"
+
t
[
n
].
oId
+
"
')
\"
>
"
+
Label
.
updateLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.pageList.del('
"
+
t
[
n
].
oId
+
"
', '
"
+
encodeURIComponent
(
t
[
n
].
pageTitle
)
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a></span>
"
}
l
.
tablePagination
.
updateTablePagination
(
i
,
p
,
e
.
pagination
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
get
:
function
(
t
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/page/
"
+
t
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
e
,
a
){
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
&&
(
admin
.
pageList
.
id
=
t
,
$
(
"
#pageTitle
"
).
val
(
e
.
page
.
pageTitle
),
$
(
"
#pagePermalink
"
).
val
(
e
.
page
.
pagePermalink
),
$
(
"
#pageTarget
"
).
val
(
e
.
page
.
pageOpenTarget
),
$
(
"
#pageIcon
"
).
val
(
e
.
page
.
pageIcon
)),
$
(
"
#loadMsg
"
).
text
(
""
)}})},
del
:
function
(
e
,
a
){
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
navLabel
+
'
"
'
+
Util
.
htmlDecode
(
a
)
+
'
"?
'
)
&&
(
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/page/
"
+
e
,
type
:
"
DELETE
"
,
cache
:
!
1
,
success
:
function
(
e
,
a
){
if
(
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
){
var
t
=
admin
.
pageList
.
pageInfo
.
currentPage
;
1
===
admin
.
pageList
.
pageInfo
.
currentCount
&&
1
!==
admin
.
pageList
.
pageInfo
.
pageCount
&&
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
&&
(
admin
.
pageList
.
pageInfo
.
pageCount
--
,
t
=
admin
.
pageList
.
pageInfo
.
pageCount
);
var
i
=
window
.
location
.
hash
.
split
(
"
/
"
);
t
==
i
[
i
.
length
-
1
]?
admin
.
pageList
.
getList
(
t
):
admin
.
setHashByPage
(
t
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}}))},
add
:
function
(){
if
(
this
.
validate
()){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
e
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
),
a
=
{
page
:{
pageTitle
:
$
(
"
#pageTitle
"
).
val
(),
pagePermalink
:
e
,
pageOpenTarget
:
$
(
"
#pageTarget
"
).
val
(),
pageIcon
:
$
(
"
#pageIcon
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/page/
"
,
type
:
"
POST
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
a
),
success
:
function
(
e
,
a
){
if
(
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
){
admin
.
pageList
.
id
=
""
,
$
(
"
#pagePermalink
"
).
val
(
""
),
$
(
"
#pageTitle
"
).
val
(
""
),
$
(
"
#pageIcon
"
).
val
(
""
),
$
(
"
#pageTarget
"
).
val
(
"
_self
"
),
admin
.
pageList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
&&
admin
.
pageList
.
pageInfo
.
pageCount
++
;
var
t
=
window
.
location
.
hash
.
split
(
"
/
"
);
admin
.
pageList
.
pageInfo
.
pageCount
==
t
[
t
.
length
-
1
]?
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
pageCount
):
admin
.
setHashByPage
(
admin
.
pageList
.
pageInfo
.
pageCount
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
update
:
function
(){
if
(
this
.
validate
()){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
e
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
),
a
=
{
page
:{
pageTitle
:
$
(
"
#pageTitle
"
).
val
(),
oId
:
this
.
id
,
pagePermalink
:
e
,
pageOpenTarget
:
$
(
"
#pageTarget
"
).
val
(),
pageIcon
:
$
(
"
#pageIcon
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/page/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
a
),
success
:
function
(
e
,
a
){
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
&&
(
admin
.
pageList
.
id
=
""
,
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
),
$
(
"
#pageTitle
"
).
val
(
""
),
$
(
"
#pageIcon
"
).
val
(
""
),
$
(
"
#pagePermalink
"
).
val
(
""
),
$
(
"
#pageTarget
"
).
val
(
"
_self
"
)),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
validate
:
function
(){
if
(
""
===
$
(
"
#pageTitle
"
).
val
().
replace
(
/
\s
/g
,
""
))
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
),
$
(
"
#pageTitle
"
).
focus
();
else
{
if
(
""
!==
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
\s
/g
,
""
))
return
!
0
;
$
(
"
#tipMsg
"
).
text
(
Label
.
linkEmptyLabel
)}
return
!
1
},
submit
:
function
(){
""
!==
this
.
id
?
this
.
update
():
this
.
add
()},
changeOrder
:
function
(
e
,
a
,
t
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
i
=
{
oId
:
e
.
toString
(),
direction
:
t
};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/page/order/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
i
),
success
:
function
(
e
,
a
){
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
page-list
"
]
=
{
obj
:
admin
.
pageList
,
init
:
admin
.
pageList
.
init
,
refresh
:
admin
.
pageList
.
getList
};
admin
.
others
=
{
init
:
function
(){
$
(
"
#tabOthers
"
).
tabs
(),
$
(
"
#loadMsg
"
).
text
(
""
)},
removeUnusedArchives
:
function
(){
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/archive/unused
"
,
type
:
"
DELETE
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){
$
(
"
#tipMsg
"
).
text
(
e
.
msg
)}})},
removeUnusedTags
:
function
(){
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/tag/unused
"
,
type
:
"
DELETE
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){
$
(
"
#tipMsg
"
).
text
(
e
.
msg
)}})},
exportSQL
:
function
(){
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/export/sql
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){
e
.
sc
?
$
(
"
#tipMsg
"
).
text
(
e
.
msg
):
window
.
location
=
Label
.
servePath
+
"
/console/export/sql
"
}})},
exportJSON
:
function
(){
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/export/json
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){
e
.
sc
?
$
(
"
#tipMsg
"
).
text
(
e
.
msg
):
window
.
location
=
Label
.
servePath
+
"
/console/export/json
"
}})},
exportHexo
:
function
(){
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/export/hexo
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){
e
.
sc
?
$
(
"
#tipMsg
"
).
text
(
e
.
msg
):
window
.
location
=
Label
.
servePath
+
"
/console/export/hexo
"
}})},
getUnusedTags
:
function
(){
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/tag/unused
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
e
,
t
){(
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
)?
e
.
unusedTags
.
length
:
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
.
others
=
{
obj
:
admin
.
others
,
init
:
admin
.
others
.
init
,
refresh
:
function
(){
admin
.
clearTip
()}};
...
...
src/main/webapp/js/admin/articleList.js
View file @
f4372aa2
...
...
@@ -20,7 +20,7 @@
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.
1.0.0, Feb 6
, 2019
* @version 1.
3.0.0, Sep 14
, 2019
*/
/* article-list 相关操作 */
...
...
@@ -66,6 +66,11 @@ admin.articleList = {
$
(
'
#articleListBtn
'
).
click
(
function
()
{
that
.
getList
(
page
)
})
$
(
'
#articleListInput
'
).
keypress
(
function
(
event
)
{
if
(
event
.
keyCode
===
13
)
{
that
.
getList
(
page
)
}
})
},
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment