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
5e3bb8f9
Unverified
Commit
5e3bb8f9
authored
Oct 23, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
📦
前端打包 v3.6.6
parent
5c2d7d7f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/main/webapp/js/admin/admin.min.js
src/main/webapp/js/admin/admin.min.js
+1
-1
src/main/webapp/skins
src/main/webapp/skins
+1
-1
No files found.
src/main/webapp/js/admin/admin.min.js
View file @
5e3bb8f9
...
@@ -7,7 +7,7 @@ admin.articleList={tablePagination:new TablePaginate("article"),init:function(e)
...
@@ -7,7 +7,7 @@ admin.articleList={tablePagination:new TablePaginate("article"),init:function(e)
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
.
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
.
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
()}};
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
()}};
admin
.
linkList
=
{
tablePagination
:
new
TablePaginate
(
"
link
"
),
pageInfo
:{
currentCount
:
1
,
pageCount
:
1
,
currentPage
:
1
},
id
:
""
,
init
:
function
(
i
){
this
.
tablePagination
.
buildTable
([{
text
:
""
,
index
:
"
linkOrder
"
,
width
:
60
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
linkTitleLabel
,
index
:
"
linkTitle
"
,
width
:
230
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
urlLabel
,
index
:
"
linkAddress
"
,
minWidth
:
180
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
linkDescriptionLabel
,
index
:
"
linkDescription
"
,
width
:
360
}]),
this
.
tablePagination
.
initPagination
(),
this
.
getList
(
i
),
$
(
"
#updateLink
"
).
dialog
({
title
:
$
(
"
#updateLink
"
).
data
(
"
title
"
),
width
:
700
,
height
:
290
,
modal
:
!
0
,
hideFooter
:
!
0
})},
getList
:
function
(
l
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
0
===
l
&&
(
l
=
1
),
this
.
pageInfo
.
currentPage
=
l
;
var
s
=
this
;
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/links/
"
+
l
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
i
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
){
var
n
=
i
.
links
,
t
=
[];
admin
.
linkList
.
pageInfo
.
currentCount
=
n
.
length
,
admin
.
linkList
.
pageInfo
.
pageCount
=
0
===
i
.
pagination
.
paginationPageCount
?
1
:
i
.
pagination
.
paginationPageCount
;
for
(
var
a
=
0
;
a
<
n
.
length
;
a
++
)
t
[
a
]
=
{},
0
===
a
?
1
===
n
.
length
?
t
[
a
].
linkOrder
=
""
:
t
[
a
].
linkOrder
=
'
<div class="table-center" style="width:14px"> <span onclick="admin.linkList.changeOrder(
'
+
n
[
a
].
oId
+
"
,
"
+
a
+
'
,
\'
down
\'
);" class="icon-move-down"></span> </div>
'
:
a
===
n
.
length
-
1
?
t
[
a
].
linkOrder
=
'
<div class="table-center" style="width:14px"> <span onclick="admin.linkList.changeOrder(
'
+
n
[
a
].
oId
+
"
,
"
+
a
+
'
,
\'
up
\'
);" class="icon-move-up"></span> </div>
'
:
t
[
a
].
linkOrder
=
'
<div class="table-center" style="width:38px"> <span onclick="admin.linkList.changeOrder(
'
+
n
[
a
].
oId
+
"
,
"
+
a
+
'
,
\'
up
\'
);" class="icon-move-up"></span> <span onclick="admin.linkList.changeOrder(
'
+
n
[
a
].
oId
+
"
,
"
+
a
+
'
,
\'
down
\'
);" class="icon-move-down"></span> </div>
'
,
t
[
a
].
linkTitle
=
n
[
a
].
linkTitle
,
t
[
a
].
linkAddress
=
"
<a target='_blank' class='no-underline' href='
"
+
n
[
a
].
linkAddress
+
"
'>
"
+
n
[
a
].
linkAddress
+
"
</a>
"
,
t
[
a
].
linkDescription
=
n
[
a
].
linkDescription
,
t
[
a
].
expendRow
=
"
<span><a href='
"
+
n
[
a
].
linkAddress
+
"
' target='_blank'>
"
+
Label
.
viewLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.linkList.get('
"
+
n
[
a
].
oId
+
"
')
\"
>
"
+
Label
.
updateLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.linkList.del('
"
+
n
[
a
].
oId
+
"
', '
"
+
encodeURIComponent
(
n
[
a
].
linkTitle
)
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a></span>
"
;
s
.
tablePagination
.
updateTablePagination
(
t
,
l
,
i
.
pagination
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
add
:
function
(){
if
(
this
.
validate
()){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
i
=
{
link
:{
linkTitle
:
$
(
"
#linkTitle
"
).
val
(),
linkAddress
:
$
(
"
#linkAddress
"
).
val
(),
linkDescription
:
$
(
"
#linkDescription
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/
"
,
type
:
"
POST
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
i
),
success
:
function
(
i
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
){
$
(
"
#linkTitle
"
).
val
(
""
),
$
(
"
#linkAddress
"
).
val
(
""
),
$
(
"
#linkDescription
"
).
val
(
""
),
admin
.
linkList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
admin
.
linkList
.
pageInfo
.
currentPage
===
admin
.
linkList
.
pageInfo
.
pageCount
&&
admin
.
linkList
.
pageInfo
.
pageCount
++
;
var
n
=
window
.
location
.
hash
.
split
(
"
/
"
);
admin
.
linkList
.
pageInfo
.
pageCount
!==
parseInt
(
n
[
n
.
length
-
1
])
&&
admin
.
setHashByPage
(
admin
.
linkList
.
pageInfo
.
pageCount
),
admin
.
linkList
.
getList
(
admin
.
linkList
.
pageInfo
.
pageCount
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
get
:
function
(
n
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#updateLink
"
).
dialog
(
"
open
"
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/
"
+
n
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
i
,
e
){
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
&&
(
admin
.
linkList
.
id
=
n
,
$
(
"
#linkTitleUpdate
"
).
val
(
i
.
link
.
linkTitle
),
$
(
"
#linkAddressUpdate
"
).
val
(
i
.
link
.
linkAddress
),
$
(
"
#linkDescriptionUpdate
"
).
val
(
i
.
link
.
linkDescription
)),
$
(
"
#loadMsg
"
).
text
(
""
)}})},
update
:
function
(){
if
(
this
.
validate
(
"
Update
"
)){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
i
=
{
link
:{
linkTitle
:
$
(
"
#linkTitleUpdate
"
).
val
(),
oId
:
this
.
id
,
linkAddress
:
$
(
"
#linkAddressUpdate
"
).
val
(),
linkDescription
:
$
(
"
#linkDescriptionUpdate
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
i
),
success
:
function
(
i
,
e
){
$
(
"
#updateLink
"
).
dialog
(
"
close
"
),
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
&&
admin
.
linkList
.
getList
(
admin
.
linkList
.
pageInfo
.
currentPage
),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
del
:
function
(
i
,
e
){
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
permalinkLabel
+
'
"
'
+
Util
.
htmlDecode
(
e
)
+
'
"?
'
)
&&
(
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/
"
+
i
,
type
:
"
DELETE
"
,
cache
:
!
1
,
success
:
function
(
i
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
){
var
n
=
admin
.
linkList
.
pageInfo
.
currentPage
;
1
===
admin
.
linkList
.
pageInfo
.
currentCount
&&
1
!==
admin
.
linkList
.
pageInfo
.
pageCount
&&
admin
.
linkList
.
pageInfo
.
currentPage
===
admin
.
linkList
.
pageInfo
.
pageCount
&&
(
admin
.
linkList
.
pageInfo
.
pageCount
--
,
n
=
admin
.
linkList
.
pageInfo
.
pageCount
);
var
t
=
window
.
location
.
hash
.
split
(
"
/
"
);
n
!==
parseInt
(
t
[
t
.
length
-
1
])
&&
admin
.
setHashByPage
(
n
),
admin
.
linkList
.
getList
(
n
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}}))},
validate
:
function
(
i
){
if
(
i
||
(
i
=
""
),
""
===
$
(
"
#linkTitle
"
+
i
).
val
().
replace
(
/
\s
/g
,
""
))
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
),
$
(
"
#linkTitle
"
+
i
).
focus
().
val
(
""
);
else
if
(
""
===
$
(
"
#linkAddress
"
+
i
).
val
().
replace
(
/
\s
/g
,
""
))
$
(
"
#tipMsg
"
).
text
(
Label
.
addressEmptyLabel
),
$
(
"
#linkAddress
"
+
i
).
focus
().
val
(
""
);
else
{
if
(
/^
\w
+:
\/\/
/
.
test
(
$
(
"
#linkAddress
"
+
i
).
val
()))
return
!
0
;
$
(
"
#tipMsg
"
).
text
(
Label
.
addressInvalidLabel
),
$
(
"
#linkAddress
"
+
i
).
focus
().
val
(
""
)}
return
!
1
},
changeOrder
:
function
(
i
,
e
,
n
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
t
=
{
oId
:
i
.
toString
(),
direction
:
n
};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/order/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
t
),
success
:
function
(
i
,
e
){
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
admin
.
linkList
.
getList
(
admin
.
linkList
.
pageInfo
.
currentPage
),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
link-list
"
]
=
{
obj
:
admin
.
linkList
,
init
:
admin
.
linkList
.
init
,
refresh
:
admin
.
linkList
.
getList
};
admin
.
linkList
=
{
tablePagination
:
new
TablePaginate
(
"
link
"
),
pageInfo
:{
currentCount
:
1
,
pageCount
:
1
,
currentPage
:
1
},
id
:
""
,
init
:
function
(
i
){
this
.
tablePagination
.
buildTable
([{
text
:
""
,
index
:
"
linkOrder
"
,
width
:
60
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
linkTitleLabel
,
index
:
"
linkTitle
"
,
width
:
230
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
urlLabel
,
index
:
"
linkAddress
"
,
minWidth
:
180
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
linkDescriptionLabel
,
index
:
"
linkDescription
"
,
width
:
360
}]),
this
.
tablePagination
.
initPagination
(),
this
.
getList
(
i
),
$
(
"
#updateLink
"
).
dialog
({
title
:
$
(
"
#updateLink
"
).
data
(
"
title
"
),
width
:
700
,
height
:
350
,
modal
:
!
0
,
hideFooter
:
!
0
})},
getList
:
function
(
l
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
0
===
l
&&
(
l
=
1
),
this
.
pageInfo
.
currentPage
=
l
;
var
s
=
this
;
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/links/
"
+
l
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
i
,
n
){
if
(
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
){
var
e
=
i
.
links
,
t
=
[];
admin
.
linkList
.
pageInfo
.
currentCount
=
e
.
length
,
admin
.
linkList
.
pageInfo
.
pageCount
=
0
===
i
.
pagination
.
paginationPageCount
?
1
:
i
.
pagination
.
paginationPageCount
;
for
(
var
a
=
0
;
a
<
e
.
length
;
a
++
)
t
[
a
]
=
{},
0
===
a
?
1
===
e
.
length
?
t
[
a
].
linkOrder
=
""
:
t
[
a
].
linkOrder
=
'
<div class="table-center" style="width:14px"> <span onclick="admin.linkList.changeOrder(
'
+
e
[
a
].
oId
+
"
,
"
+
a
+
'
,
\'
down
\'
);" class="icon-move-down"></span> </div>
'
:
a
===
e
.
length
-
1
?
t
[
a
].
linkOrder
=
'
<div class="table-center" style="width:14px"> <span onclick="admin.linkList.changeOrder(
'
+
e
[
a
].
oId
+
"
,
"
+
a
+
'
,
\'
up
\'
);" class="icon-move-up"></span> </div>
'
:
t
[
a
].
linkOrder
=
'
<div class="table-center" style="width:38px"> <span onclick="admin.linkList.changeOrder(
'
+
e
[
a
].
oId
+
"
,
"
+
a
+
'
,
\'
up
\'
);" class="icon-move-up"></span> <span onclick="admin.linkList.changeOrder(
'
+
e
[
a
].
oId
+
"
,
"
+
a
+
'
,
\'
down
\'
);" class="icon-move-down"></span> </div>
'
,
t
[
a
].
linkTitle
=
e
[
a
].
linkTitle
,
t
[
a
].
linkAddress
=
"
<a target='_blank' class='no-underline' href='
"
+
e
[
a
].
linkAddress
+
"
'>
"
+
e
[
a
].
linkAddress
+
"
</a>
"
,
t
[
a
].
linkDescription
=
e
[
a
].
linkDescription
,
t
[
a
].
linkIcon
=
e
[
a
].
linkIcon
,
t
[
a
].
expendRow
=
"
<span><a href='
"
+
e
[
a
].
linkAddress
+
"
' target='_blank'>
"
+
Label
.
viewLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.linkList.get('
"
+
e
[
a
].
oId
+
"
')
\"
>
"
+
Label
.
updateLabel
+
"
</a> <a href='javascript:void(0)' onclick=
\"
admin.linkList.del('
"
+
e
[
a
].
oId
+
"
', '
"
+
encodeURIComponent
(
e
[
a
].
linkTitle
)
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a></span>
"
;
s
.
tablePagination
.
updateTablePagination
(
t
,
l
,
i
.
pagination
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
add
:
function
(){
if
(
this
.
validate
()){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
i
=
{
link
:{
linkTitle
:
$
(
"
#linkTitle
"
).
val
(),
linkAddress
:
$
(
"
#linkAddress
"
).
val
(),
linkDescription
:
$
(
"
#linkDescription
"
).
val
(),
linkIcon
:
$
(
"
#linkIcon
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/
"
,
type
:
"
POST
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
i
),
success
:
function
(
i
,
n
){
if
(
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
){
$
(
"
#linkTitle
"
).
val
(
""
),
$
(
"
#linkAddress
"
).
val
(
""
),
$
(
"
#linkDescription
"
).
val
(
""
),
$
(
"
#linkIcon
"
).
val
(
""
),
admin
.
linkList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
admin
.
linkList
.
pageInfo
.
currentPage
===
admin
.
linkList
.
pageInfo
.
pageCount
&&
admin
.
linkList
.
pageInfo
.
pageCount
++
;
var
e
=
window
.
location
.
hash
.
split
(
"
/
"
);
admin
.
linkList
.
pageInfo
.
pageCount
!==
parseInt
(
e
[
e
.
length
-
1
])
&&
admin
.
setHashByPage
(
admin
.
linkList
.
pageInfo
.
pageCount
),
admin
.
linkList
.
getList
(
admin
.
linkList
.
pageInfo
.
pageCount
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
get
:
function
(
e
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#updateLink
"
).
dialog
(
"
open
"
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/
"
+
e
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
i
,
n
){
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
&&
(
admin
.
linkList
.
id
=
e
,
$
(
"
#linkTitleUpdate
"
).
val
(
i
.
link
.
linkTitle
),
$
(
"
#linkAddressUpdate
"
).
val
(
i
.
link
.
linkAddress
),
$
(
"
#linkDescriptionUpdate
"
).
val
(
i
.
link
.
linkDescription
),
$
(
"
#linkIconUpdate
"
).
val
(
i
.
link
.
linkIcon
)),
$
(
"
#loadMsg
"
).
text
(
""
)}})},
update
:
function
(){
if
(
this
.
validate
(
"
Update
"
)){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
i
=
{
link
:{
linkTitle
:
$
(
"
#linkTitleUpdate
"
).
val
(),
oId
:
this
.
id
,
linkAddress
:
$
(
"
#linkAddressUpdate
"
).
val
(),
linkDescription
:
$
(
"
#linkDescriptionUpdate
"
).
val
(),
linkIcon
:
$
(
"
#linkIconUpdate
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
i
),
success
:
function
(
i
,
n
){
$
(
"
#updateLink
"
).
dialog
(
"
close
"
),
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
&&
admin
.
linkList
.
getList
(
admin
.
linkList
.
pageInfo
.
currentPage
),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
del
:
function
(
i
,
n
){
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
permalinkLabel
+
'
"
'
+
Util
.
htmlDecode
(
n
)
+
'
"?
'
)
&&
(
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/
"
+
i
,
type
:
"
DELETE
"
,
cache
:
!
1
,
success
:
function
(
i
,
n
){
if
(
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
){
var
e
=
admin
.
linkList
.
pageInfo
.
currentPage
;
1
===
admin
.
linkList
.
pageInfo
.
currentCount
&&
1
!==
admin
.
linkList
.
pageInfo
.
pageCount
&&
admin
.
linkList
.
pageInfo
.
currentPage
===
admin
.
linkList
.
pageInfo
.
pageCount
&&
(
admin
.
linkList
.
pageInfo
.
pageCount
--
,
e
=
admin
.
linkList
.
pageInfo
.
pageCount
);
var
t
=
window
.
location
.
hash
.
split
(
"
/
"
);
e
!==
parseInt
(
t
[
t
.
length
-
1
])
&&
admin
.
setHashByPage
(
e
),
admin
.
linkList
.
getList
(
e
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}}))},
validate
:
function
(
i
){
if
(
i
||
(
i
=
""
),
""
===
$
(
"
#linkTitle
"
+
i
).
val
().
replace
(
/
\s
/g
,
""
))
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
),
$
(
"
#linkTitle
"
+
i
).
focus
().
val
(
""
);
else
if
(
""
===
$
(
"
#linkAddress
"
+
i
).
val
().
replace
(
/
\s
/g
,
""
))
$
(
"
#tipMsg
"
).
text
(
Label
.
addressEmptyLabel
),
$
(
"
#linkAddress
"
+
i
).
focus
().
val
(
""
);
else
{
if
(
/^
\w
+:
\/\/
/
.
test
(
$
(
"
#linkAddress
"
+
i
).
val
()))
return
!
0
;
$
(
"
#tipMsg
"
).
text
(
Label
.
addressInvalidLabel
),
$
(
"
#linkAddress
"
+
i
).
focus
().
val
(
""
)}
return
!
1
},
changeOrder
:
function
(
i
,
n
,
e
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
t
=
{
oId
:
i
.
toString
(),
direction
:
e
};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/link/order/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
t
),
success
:
function
(
i
,
n
){
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
admin
.
linkList
.
getList
(
admin
.
linkList
.
pageInfo
.
currentPage
),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
link-list
"
]
=
{
obj
:
admin
.
linkList
,
init
:
admin
.
linkList
.
init
,
refresh
:
admin
.
linkList
.
getList
};
admin
.
preference
=
{
locale
:
""
,
init
:
function
(){
$
(
"
#tabPreference
"
).
tabs
(),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/preference/
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
result
,
textStatus
){
if
(
$
(
"
#tipMsg
"
).
text
(
result
.
msg
),
result
.
sc
){
var
preference
=
result
.
preference
;
$
(
"
#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
),
$
(
"
#localeString
"
).
val
(
preference
.
localeString
),
$
(
"
#timeZoneId
"
).
val
(
preference
.
timeZoneId
),
$
(
"
#noticeBoard
"
).
val
(
preference
.
noticeBoard
),
$
(
"
#footerContent
"
).
val
(
preference
.
footerContent
),
$
(
"
#htmlHead
"
).
val
(
preference
.
htmlHead
),
$
(
"
#externalRelevantArticlesDisplayCount
"
).
val
(
preference
.
externalRelevantArticlesDisplayCount
),
$
(
"
#relevantArticlesDisplayCount
"
).
val
(
preference
.
relevantArticlesDisplayCount
),
$
(
"
#randomArticlesDisplayCount
"
).
val
(
preference
.
randomArticlesDisplayCount
),
$
(
"
#customVars
"
).
val
(
preference
.
customVars
),
"
true
"
===
preference
.
enableArticleUpdateHint
?
$
(
"
#enableArticleUpdateHint
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
#enableArticleUpdateHint
"
).
removeAttr
(
"
checked
"
),
"
true
"
===
preference
.
allowVisitDraftViaPermalink
?
$
(
"
#allowVisitDraftViaPermalink
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
allowVisitDraftViaPermalink
"
).
removeAttr
(
"
checked
"
),
"
true
"
===
preference
.
commentable
?
$
(
"
#commentable
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
commentable
"
).
removeAttr
(
"
checked
"
),
"
true
"
===
preference
.
syncGitHub
?
$
(
"
#syncGitHub
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
syncGitHub
"
).
removeAttr
(
"
checked
"
),
"
true
"
===
preference
.
pullGitHub
?
$
(
"
#pullGitHub
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
pullGitHub
"
).
removeAttr
(
"
checked
"
),
admin
.
preference
.
locale
=
preference
.
localeString
;
for
(
var
signs
=
eval
(
"
(
"
+
preference
.
signs
+
"
)
"
),
j
=
1
;
j
<
signs
.
length
;
j
++
)
$
(
"
#preferenceSign
"
+
j
).
val
(
signs
[
j
].
signHTML
);
$
(
"
#articleListDisplay
"
).
val
(
preference
.
articleListStyle
),
$
(
"
#hljsTheme
"
).
val
(
preference
.
hljsTheme
),
$
(
"
#feedOutputMode
"
).
val
(
preference
.
feedOutputMode
),
$
(
"
#feedOutputCnt
"
).
val
(
preference
.
feedOutputCnt
),
$
(
"
#faviconURL
"
).
val
(
preference
.
faviconURL
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
validate
:
function
(){
return
/^
\d
+$/
.
test
(
$
(
"
#mostUsedTagDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#recentCommentDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#mostCommentArticleDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#mostViewArticleDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#articleListDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#articleListPaginationWindowSize
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#randomArticlesDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#relevantArticlesDisplayCount
"
).
val
())?
!!
/^
\d
+$/
.
test
(
$
(
"
#externalRelevantArticlesDisplayCount
"
).
val
())
||
(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
externalRelevantArticlesDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#externalRelevantArticlesDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
relevantArticlesDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#relevantArticlesDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
randomArticlesDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#randomArticlesDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
windowSizeLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#articleListPaginationWindowSize
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
pageSizeLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#articleListDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
indexMostViewArticleDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#mostViewArticleDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
indexMostCommentArticleDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#mostCommentArticleDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
indexRecentCommentDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#recentCommentDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
indexTagDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#mostUsedTagDisplayCount
"
).
focus
(),
!
1
)},
update
:
function
(){
if
(
admin
.
preference
.
validate
()){
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
var
e
=
[{
oId
:
0
,
signHTML
:
""
},{
oId
:
1
,
signHTML
:
$
(
"
#preferenceSign1
"
).
val
()},{
oId
:
2
,
signHTML
:
$
(
"
#preferenceSign2
"
).
val
()},{
oId
:
3
,
signHTML
:
$
(
"
#preferenceSign3
"
).
val
()}],
t
=
{
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
(),
localeString
:
$
(
"
#localeString
"
).
val
(),
timeZoneId
:
$
(
"
#timeZoneId
"
).
val
(),
noticeBoard
:
$
(
"
#noticeBoard
"
).
val
(),
footerContent
:
$
(
"
#footerContent
"
).
val
(),
htmlHead
:
$
(
"
#htmlHead
"
).
val
(),
externalRelevantArticlesDisplayCount
:
$
(
"
#externalRelevantArticlesDisplayCount
"
).
val
(),
relevantArticlesDisplayCount
:
$
(
"
#relevantArticlesDisplayCount
"
).
val
(),
randomArticlesDisplayCount
:
$
(
"
#randomArticlesDisplayCount
"
).
val
(),
enableArticleUpdateHint
:
$
(
"
#enableArticleUpdateHint
"
).
prop
(
"
checked
"
),
signs
:
e
,
allowVisitDraftViaPermalink
:
$
(
"
#allowVisitDraftViaPermalink
"
).
prop
(
"
checked
"
),
articleListStyle
:
$
(
"
#articleListDisplay
"
).
val
(),
hljsTheme
:
$
(
"
#hljsTheme
"
).
val
(),
feedOutputMode
:
$
(
"
#feedOutputMode
"
).
val
(),
feedOutputCnt
:
$
(
"
#feedOutputCnt
"
).
val
(),
faviconURL
:
$
(
"
#faviconURL
"
).
val
(),
syncGitHub
:
$
(
"
#syncGitHub
"
).
prop
(
"
checked
"
),
pullGitHub
:
$
(
"
#pullGitHub
"
).
prop
(
"
checked
"
),
commentable
:
$
(
"
#commentable
"
).
prop
(
"
checked
"
),
customVars
:
$
(
"
#customVars
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/preference/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
t
),
success
:
function
(
e
,
t
){
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
&&
$
(
"
#localeString
"
).
val
()
!==
admin
.
preference
.
locale
&&
window
.
location
.
reload
(),
$
(
"
#loadMsg
"
).
text
(
""
)}})}}},
admin
.
register
.
preference
=
{
obj
:
admin
.
preference
,
init
:
admin
.
preference
.
init
,
refresh
:
function
(){
admin
.
clearTip
()}};
admin
.
preference
=
{
locale
:
""
,
init
:
function
(){
$
(
"
#tabPreference
"
).
tabs
(),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/preference/
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
result
,
textStatus
){
if
(
$
(
"
#tipMsg
"
).
text
(
result
.
msg
),
result
.
sc
){
var
preference
=
result
.
preference
;
$
(
"
#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
),
$
(
"
#localeString
"
).
val
(
preference
.
localeString
),
$
(
"
#timeZoneId
"
).
val
(
preference
.
timeZoneId
),
$
(
"
#noticeBoard
"
).
val
(
preference
.
noticeBoard
),
$
(
"
#footerContent
"
).
val
(
preference
.
footerContent
),
$
(
"
#htmlHead
"
).
val
(
preference
.
htmlHead
),
$
(
"
#externalRelevantArticlesDisplayCount
"
).
val
(
preference
.
externalRelevantArticlesDisplayCount
),
$
(
"
#relevantArticlesDisplayCount
"
).
val
(
preference
.
relevantArticlesDisplayCount
),
$
(
"
#randomArticlesDisplayCount
"
).
val
(
preference
.
randomArticlesDisplayCount
),
$
(
"
#customVars
"
).
val
(
preference
.
customVars
),
"
true
"
===
preference
.
enableArticleUpdateHint
?
$
(
"
#enableArticleUpdateHint
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
#enableArticleUpdateHint
"
).
removeAttr
(
"
checked
"
),
"
true
"
===
preference
.
allowVisitDraftViaPermalink
?
$
(
"
#allowVisitDraftViaPermalink
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
allowVisitDraftViaPermalink
"
).
removeAttr
(
"
checked
"
),
"
true
"
===
preference
.
commentable
?
$
(
"
#commentable
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
commentable
"
).
removeAttr
(
"
checked
"
),
"
true
"
===
preference
.
syncGitHub
?
$
(
"
#syncGitHub
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
syncGitHub
"
).
removeAttr
(
"
checked
"
),
"
true
"
===
preference
.
pullGitHub
?
$
(
"
#pullGitHub
"
).
attr
(
"
checked
"
,
"
checked
"
):
$
(
"
pullGitHub
"
).
removeAttr
(
"
checked
"
),
admin
.
preference
.
locale
=
preference
.
localeString
;
for
(
var
signs
=
eval
(
"
(
"
+
preference
.
signs
+
"
)
"
),
j
=
1
;
j
<
signs
.
length
;
j
++
)
$
(
"
#preferenceSign
"
+
j
).
val
(
signs
[
j
].
signHTML
);
$
(
"
#articleListDisplay
"
).
val
(
preference
.
articleListStyle
),
$
(
"
#hljsTheme
"
).
val
(
preference
.
hljsTheme
),
$
(
"
#feedOutputMode
"
).
val
(
preference
.
feedOutputMode
),
$
(
"
#feedOutputCnt
"
).
val
(
preference
.
feedOutputCnt
),
$
(
"
#faviconURL
"
).
val
(
preference
.
faviconURL
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
validate
:
function
(){
return
/^
\d
+$/
.
test
(
$
(
"
#mostUsedTagDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#recentCommentDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#mostCommentArticleDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#mostViewArticleDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#articleListDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#articleListPaginationWindowSize
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#randomArticlesDisplayCount
"
).
val
())?
/^
\d
+$/
.
test
(
$
(
"
#relevantArticlesDisplayCount
"
).
val
())?
!!
/^
\d
+$/
.
test
(
$
(
"
#externalRelevantArticlesDisplayCount
"
).
val
())
||
(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
externalRelevantArticlesDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#externalRelevantArticlesDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
relevantArticlesDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#relevantArticlesDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
randomArticlesDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#randomArticlesDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
windowSizeLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#articleListPaginationWindowSize
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
pageSizeLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#articleListDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
indexMostViewArticleDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#mostViewArticleDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
indexMostCommentArticleDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#mostCommentArticleDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
indexRecentCommentDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#recentCommentDisplayCount
"
).
focus
(),
!
1
):(
$
(
"
#tipMsg
"
).
text
(
"
[
"
+
Label
.
paramSettingsLabel
+
"
-
"
+
Label
.
indexTagDisplayCntLabel
+
"
]
"
+
Label
.
nonNegativeIntegerOnlyLabel
),
$
(
"
#mostUsedTagDisplayCount
"
).
focus
(),
!
1
)},
update
:
function
(){
if
(
admin
.
preference
.
validate
()){
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
var
e
=
[{
oId
:
0
,
signHTML
:
""
},{
oId
:
1
,
signHTML
:
$
(
"
#preferenceSign1
"
).
val
()},{
oId
:
2
,
signHTML
:
$
(
"
#preferenceSign2
"
).
val
()},{
oId
:
3
,
signHTML
:
$
(
"
#preferenceSign3
"
).
val
()}],
t
=
{
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
(),
localeString
:
$
(
"
#localeString
"
).
val
(),
timeZoneId
:
$
(
"
#timeZoneId
"
).
val
(),
noticeBoard
:
$
(
"
#noticeBoard
"
).
val
(),
footerContent
:
$
(
"
#footerContent
"
).
val
(),
htmlHead
:
$
(
"
#htmlHead
"
).
val
(),
externalRelevantArticlesDisplayCount
:
$
(
"
#externalRelevantArticlesDisplayCount
"
).
val
(),
relevantArticlesDisplayCount
:
$
(
"
#relevantArticlesDisplayCount
"
).
val
(),
randomArticlesDisplayCount
:
$
(
"
#randomArticlesDisplayCount
"
).
val
(),
enableArticleUpdateHint
:
$
(
"
#enableArticleUpdateHint
"
).
prop
(
"
checked
"
),
signs
:
e
,
allowVisitDraftViaPermalink
:
$
(
"
#allowVisitDraftViaPermalink
"
).
prop
(
"
checked
"
),
articleListStyle
:
$
(
"
#articleListDisplay
"
).
val
(),
hljsTheme
:
$
(
"
#hljsTheme
"
).
val
(),
feedOutputMode
:
$
(
"
#feedOutputMode
"
).
val
(),
feedOutputCnt
:
$
(
"
#feedOutputCnt
"
).
val
(),
faviconURL
:
$
(
"
#faviconURL
"
).
val
(),
syncGitHub
:
$
(
"
#syncGitHub
"
).
prop
(
"
checked
"
),
pullGitHub
:
$
(
"
#pullGitHub
"
).
prop
(
"
checked
"
),
commentable
:
$
(
"
#commentable
"
).
prop
(
"
checked
"
),
customVars
:
$
(
"
#customVars
"
).
val
()}};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/preference/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
t
),
success
:
function
(
e
,
t
){
$
(
"
#tipMsg
"
).
text
(
e
.
msg
),
e
.
sc
&&
$
(
"
#localeString
"
).
val
()
!==
admin
.
preference
.
locale
&&
window
.
location
.
reload
(),
$
(
"
#loadMsg
"
).
text
(
""
)}})}}},
admin
.
register
.
preference
=
{
obj
:
admin
.
preference
,
init
:
admin
.
preference
.
init
,
refresh
:
function
(){
admin
.
clearTip
()}};
admin
.
themeList
=
{
skinDirName
:
""
,
mobileSkinDirName
:
""
,
init
:
function
(){
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/skin
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
i
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
){
admin
.
themeList
.
skinDirName
=
i
.
skin
.
skinDirName
,
admin
.
themeList
.
mobileSkinDirName
=
i
.
skin
.
mobileSkinDirName
;
for
(
var
a
=
JSON
.
parse
(
i
.
skin
.
skins
),
s
=
""
,
t
=
0
;
t
<
a
.
length
;
t
++
){
var
n
=
""
;
a
[
t
].
skinDirName
===
i
.
skin
.
skinDirName
&&
(
n
=
"
selected
"
),
s
+=
'
<div class="fn__left skinItem
'
+
n
+
'
"><div class="ft__center">
'
+
a
[
t
].
skinDirName
+
'
</div><img class="skinPreview" src="
'
+
Label
.
staticServePath
+
"
/skins/
"
+
a
[
t
].
skinDirName
+
'
/preview.png"/><div>
'
,
a
[
t
].
skinDirName
!==
i
.
skin
.
skinDirName
&&
(
s
+=
'
<button class="small update fn__left" data-name="
'
+
a
[
t
].
skinDirName
+
'
">
'
+
Label
.
enableLabel
+
"
</button>
"
),
a
[
t
].
skinDirName
!==
i
.
skin
.
mobileSkinDirName
&&
(
s
+=
'
<button class="small mobile fn__left" data-name="
'
+
a
[
t
].
skinDirName
+
'
">
'
+
Label
.
setMobileLabel
+
"
</button>
"
),
s
+=
'
<button class="small fn__right" onclick="window.open(
\'
'
+
Label
.
servePath
+
"
?skin=
"
+
a
[
t
].
skinDirName
+
"
')
\"
>
"
+
Label
.
previewLabel
+
"
</button></div></div>
"
}
$
(
"
#skinMain
"
).
html
(
s
+
"
<div class='fn__clear'></div>
"
),
$
(
"
.skinItem .update
"
).
click
(
function
(){
admin
.
themeList
.
update
(
$
(
this
).
data
(
"
name
"
),
"
pc
"
)}),
$
(
"
.skinItem .mobile
"
).
click
(
function
(){
admin
.
themeList
.
update
(
$
(
this
).
data
(
"
name
"
),
"
mobile
"
)}),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
update
:
function
(
i
,
e
){
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
var
a
=
{
skin
:{
skinDirName
:
admin
.
themeList
.
skinDirName
,
mobileSkinDirName
:
admin
.
themeList
.
mobileSkinDirName
}};
"
pc
"
===
e
?
a
.
skin
.
skinDirName
=
i
:
a
.
skin
.
mobileSkinDirName
=
i
,
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/skin
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
a
),
success
:
function
(
i
,
e
){
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
&&
admin
.
themeList
.
init
(),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
theme-list
"
]
=
{
obj
:
admin
.
themeList
,
init
:
admin
.
themeList
.
init
,
refresh
:
function
(){
$
(
"
#loadMsg
"
).
text
(
""
)}};
admin
.
themeList
=
{
skinDirName
:
""
,
mobileSkinDirName
:
""
,
init
:
function
(){
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/skin
"
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
i
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
){
admin
.
themeList
.
skinDirName
=
i
.
skin
.
skinDirName
,
admin
.
themeList
.
mobileSkinDirName
=
i
.
skin
.
mobileSkinDirName
;
for
(
var
a
=
JSON
.
parse
(
i
.
skin
.
skins
),
s
=
""
,
t
=
0
;
t
<
a
.
length
;
t
++
){
var
n
=
""
;
a
[
t
].
skinDirName
===
i
.
skin
.
skinDirName
&&
(
n
=
"
selected
"
),
s
+=
'
<div class="fn__left skinItem
'
+
n
+
'
"><div class="ft__center">
'
+
a
[
t
].
skinDirName
+
'
</div><img class="skinPreview" src="
'
+
Label
.
staticServePath
+
"
/skins/
"
+
a
[
t
].
skinDirName
+
'
/preview.png"/><div>
'
,
a
[
t
].
skinDirName
!==
i
.
skin
.
skinDirName
&&
(
s
+=
'
<button class="small update fn__left" data-name="
'
+
a
[
t
].
skinDirName
+
'
">
'
+
Label
.
enableLabel
+
"
</button>
"
),
a
[
t
].
skinDirName
!==
i
.
skin
.
mobileSkinDirName
&&
(
s
+=
'
<button class="small mobile fn__left" data-name="
'
+
a
[
t
].
skinDirName
+
'
">
'
+
Label
.
setMobileLabel
+
"
</button>
"
),
s
+=
'
<button class="small fn__right" onclick="window.open(
\'
'
+
Label
.
servePath
+
"
?skin=
"
+
a
[
t
].
skinDirName
+
"
')
\"
>
"
+
Label
.
previewLabel
+
"
</button></div></div>
"
}
$
(
"
#skinMain
"
).
html
(
s
+
"
<div class='fn__clear'></div>
"
),
$
(
"
.skinItem .update
"
).
click
(
function
(){
admin
.
themeList
.
update
(
$
(
this
).
data
(
"
name
"
),
"
pc
"
)}),
$
(
"
.skinItem .mobile
"
).
click
(
function
(){
admin
.
themeList
.
update
(
$
(
this
).
data
(
"
name
"
),
"
mobile
"
)}),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
update
:
function
(
i
,
e
){
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
var
a
=
{
skin
:{
skinDirName
:
admin
.
themeList
.
skinDirName
,
mobileSkinDirName
:
admin
.
themeList
.
mobileSkinDirName
}};
"
pc
"
===
e
?
a
.
skin
.
skinDirName
=
i
:
a
.
skin
.
mobileSkinDirName
=
i
,
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/skin
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
a
),
success
:
function
(
i
,
e
){
$
(
"
#tipMsg
"
).
text
(
i
.
msg
),
i
.
sc
&&
admin
.
themeList
.
init
(),
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
theme-list
"
]
=
{
obj
:
admin
.
themeList
,
init
:
admin
.
themeList
.
init
,
refresh
:
function
(){
$
(
"
#loadMsg
"
).
text
(
""
)}};
admin
.
pluginList
=
{
tablePagination
:
new
TablePaginate
(
"
plugin
"
),
pageInfo
:{
currentCount
:
1
,
pageCount
:
1
,
currentPage
:
1
},
init
:
function
(
t
){
this
.
tablePagination
.
buildTable
([{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
pluginNameLabel
,
index
:
"
name
"
,
width
:
230
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
statusLabel
,
index
:
"
status
"
,
minWidth
:
80
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
authorLabel
,
index
:
"
author
"
,
width
:
200
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
versionLabel
,
index
:
"
version
"
,
width
:
120
}]),
this
.
tablePagination
.
initPagination
(),
$
(
"
#pluginSetting
"
).
dialog
({
width
:
700
,
height
:
180
,
modal
:
!
0
,
hideFooter
:
!
0
}),
this
.
getList
(
t
)},
getList
:
function
(
n
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
l
=
this
;
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/plugins/
"
+
n
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
){
admin
.
pluginList
.
pageInfo
.
currentPage
=
n
;
for
(
var
a
=
t
.
plugins
,
i
=
0
;
i
<
a
.
length
;
i
++
)
a
[
i
].
expendRow
=
"
<a href='javascript:void(0)' onclick=
\"
admin.pluginList.changeStatus('
"
+
a
[
i
].
oId
+
"
', '
"
+
a
[
i
].
status
+
"
')
\"
>
"
,
"
ENABLED
"
===
a
[
i
].
status
?(
a
[
i
].
status
=
Label
.
enabledLabel
,
a
[
i
].
expendRow
+=
Label
.
disableLabel
):(
a
[
i
].
status
=
Label
.
disabledLabel
,
a
[
i
].
expendRow
+=
Label
.
enableLabel
),
a
[
i
].
expendRow
+=
"
</a>
"
,
"
{}
"
!=
a
[
i
].
setting
&&
(
a
[
i
].
expendRow
+=
"
<a href='javascript:void(0)' onclick=
\"
admin.pluginList.toSetting('
"
+
a
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
settingLabel
+
"
</a>
"
);
l
.
tablePagination
.
updateTablePagination
(
t
.
plugins
,
n
,
t
.
pagination
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
toSetting
:
function
(
t
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
e
=
{
oId
:
t
};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/plugin/toSetting
"
,
type
:
"
POST
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
e
),
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
$
(
"
#pluginSetting
"
).
html
(
t
),
$
(
"
#pluginSetting
"
).
dialog
(
"
open
"
),
$
(
"
#loadMsg
"
).
text
(
""
)}})},
changeStatus
:
function
(
t
,
e
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
a
=
{
oId
:
t
,
status
:
e
=
"
ENABLED
"
===
e
?
"
DISABLED
"
:
"
ENABLED
"
};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/plugin/status/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
a
),
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
?(
$
(
"
#loadMsg
"
).
text
(
""
),
window
.
location
.
reload
()):
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
plugin-list
"
]
=
{
obj
:
admin
.
pluginList
,
init
:
admin
.
pluginList
.
init
,
refresh
:
function
(){
$
(
"
#loadMsg
"
).
text
(
""
)}};
admin
.
pluginList
=
{
tablePagination
:
new
TablePaginate
(
"
plugin
"
),
pageInfo
:{
currentCount
:
1
,
pageCount
:
1
,
currentPage
:
1
},
init
:
function
(
t
){
this
.
tablePagination
.
buildTable
([{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
pluginNameLabel
,
index
:
"
name
"
,
width
:
230
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
statusLabel
,
index
:
"
status
"
,
minWidth
:
80
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
authorLabel
,
index
:
"
author
"
,
width
:
200
},{
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
versionLabel
,
index
:
"
version
"
,
width
:
120
}]),
this
.
tablePagination
.
initPagination
(),
$
(
"
#pluginSetting
"
).
dialog
({
width
:
700
,
height
:
180
,
modal
:
!
0
,
hideFooter
:
!
0
}),
this
.
getList
(
t
)},
getList
:
function
(
n
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
l
=
this
;
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/plugins/
"
+
n
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
type
:
"
GET
"
,
cache
:
!
1
,
success
:
function
(
t
,
e
){
if
(
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
){
admin
.
pluginList
.
pageInfo
.
currentPage
=
n
;
for
(
var
a
=
t
.
plugins
,
i
=
0
;
i
<
a
.
length
;
i
++
)
a
[
i
].
expendRow
=
"
<a href='javascript:void(0)' onclick=
\"
admin.pluginList.changeStatus('
"
+
a
[
i
].
oId
+
"
', '
"
+
a
[
i
].
status
+
"
')
\"
>
"
,
"
ENABLED
"
===
a
[
i
].
status
?(
a
[
i
].
status
=
Label
.
enabledLabel
,
a
[
i
].
expendRow
+=
Label
.
disableLabel
):(
a
[
i
].
status
=
Label
.
disabledLabel
,
a
[
i
].
expendRow
+=
Label
.
enableLabel
),
a
[
i
].
expendRow
+=
"
</a>
"
,
"
{}
"
!=
a
[
i
].
setting
&&
(
a
[
i
].
expendRow
+=
"
<a href='javascript:void(0)' onclick=
\"
admin.pluginList.toSetting('
"
+
a
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
settingLabel
+
"
</a>
"
);
l
.
tablePagination
.
updateTablePagination
(
t
.
plugins
,
n
,
t
.
pagination
),
$
(
"
#loadMsg
"
).
text
(
""
)}
else
$
(
"
#loadMsg
"
).
text
(
""
)}})},
toSetting
:
function
(
t
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
e
=
{
oId
:
t
};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/plugin/toSetting
"
,
type
:
"
POST
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
e
),
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
$
(
"
#pluginSetting
"
).
html
(
t
),
$
(
"
#pluginSetting
"
).
dialog
(
"
open
"
),
$
(
"
#loadMsg
"
).
text
(
""
)}})},
changeStatus
:
function
(
t
,
e
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
a
=
{
oId
:
t
,
status
:
e
=
"
ENABLED
"
===
e
?
"
DISABLED
"
:
"
ENABLED
"
};
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/plugin/status/
"
,
type
:
"
PUT
"
,
cache
:
!
1
,
data
:
JSON
.
stringify
(
a
),
success
:
function
(
t
,
e
){
$
(
"
#tipMsg
"
).
text
(
t
.
msg
),
t
.
sc
?(
$
(
"
#loadMsg
"
).
text
(
""
),
window
.
location
.
reload
()):
$
(
"
#loadMsg
"
).
text
(
""
)}})}},
admin
.
register
[
"
plugin-list
"
]
=
{
obj
:
admin
.
pluginList
,
init
:
admin
.
pluginList
.
init
,
refresh
:
function
(){
$
(
"
#loadMsg
"
).
text
(
""
)}};
...
...
skins
@
21c902d4
Subproject commit
8e70bda33f9690f5b8e4b293630052ba4b4d036d
Subproject commit
21c902d4c80aecd5b797c4002c99feda70b6f985
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