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
fcc37e05
Unverified
Commit
fcc37e05
authored
Apr 22, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12768
parent
1fbcedd4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
50 deletions
+9
-50
src/main/java/org/b3log/solo/service/PageMgmtService.java
src/main/java/org/b3log/solo/service/PageMgmtService.java
+2
-31
src/main/webapp/js/admin/admin.js
src/main/webapp/js/admin/admin.js
+2
-13
src/main/webapp/js/admin/admin.min.js
src/main/webapp/js/admin/admin.min.js
+2
-2
src/main/webapp/js/admin/pageList.js
src/main/webapp/js/admin/pageList.js
+3
-4
No files found.
src/main/java/org/b3log/solo/service/PageMgmtService.java
View file @
fcc37e05
...
@@ -26,7 +26,6 @@ import org.b3log.latke.repository.Transaction;
...
@@ -26,7 +26,6 @@ import org.b3log.latke.repository.Transaction;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.annotation.Service
;
import
org.b3log.latke.service.annotation.Service
;
import
org.b3log.latke.util.Strings
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.PageRepository
;
import
org.b3log.solo.repository.PageRepository
;
...
@@ -127,27 +126,7 @@ public class PageMgmtService {
...
@@ -127,27 +126,7 @@ public class PageMgmtService {
final
JSONObject
oldPage
=
pageRepository
.
get
(
pageId
);
final
JSONObject
oldPage
=
pageRepository
.
get
(
pageId
);
final
JSONObject
newPage
=
new
JSONObject
(
page
,
JSONObject
.
getNames
(
page
));
final
JSONObject
newPage
=
new
JSONObject
(
page
,
JSONObject
.
getNames
(
page
));
newPage
.
put
(
Page
.
PAGE_ORDER
,
oldPage
.
getInt
(
Page
.
PAGE_ORDER
));
newPage
.
put
(
Page
.
PAGE_ORDER
,
oldPage
.
getInt
(
Page
.
PAGE_ORDER
));
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
).
trim
();
final
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
).
trim
();
final
String
oldPermalink
=
oldPage
.
getString
(
Page
.
PAGE_PERMALINK
);
if
(!
oldPermalink
.
equals
(
permalink
))
{
if
(!
Strings
.
isURL
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"invalidPermalinkFormatLabel"
));
}
if
(!
oldPermalink
.
equals
(
permalink
)
&&
permalinkQueryService
.
exist
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"duplicatedPermalinkLabel"
));
}
}
newPage
.
put
(
Page
.
PAGE_PERMALINK
,
permalink
);
newPage
.
put
(
Page
.
PAGE_PERMALINK
,
permalink
);
page
.
put
(
Page
.
PAGE_ICON
,
page
.
optString
(
Page
.
PAGE_ICON
));
page
.
put
(
Page
.
PAGE_ICON
,
page
.
optString
(
Page
.
PAGE_ICON
));
...
@@ -211,15 +190,7 @@ public class PageMgmtService {
...
@@ -211,15 +190,7 @@ public class PageMgmtService {
final
int
maxOrder
=
pageRepository
.
getMaxOrder
();
final
int
maxOrder
=
pageRepository
.
getMaxOrder
();
page
.
put
(
Page
.
PAGE_ORDER
,
maxOrder
+
1
);
page
.
put
(
Page
.
PAGE_ORDER
,
maxOrder
+
1
);
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
);
final
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
);
if
(!
Strings
.
isURL
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"invalidPermalinkFormatLabel"
));
}
if
(
permalinkQueryService
.
exist
(
permalink
))
{
if
(
permalinkQueryService
.
exist
(
permalink
))
{
if
(
transaction
.
isActive
())
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
transaction
.
rollback
();
...
...
src/main/webapp/js/admin/admin.js
View file @
fcc37e05
...
@@ -19,7 +19,8 @@
...
@@ -19,7 +19,8 @@
* @description index for admin
* @description index for admin
*
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.0.0, Mar 30, 2019
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.4.0.0, Apr 22, 2019
*/
*/
Util
.
htmlDecode
=
function
(
code
)
{
Util
.
htmlDecode
=
function
(
code
)
{
...
@@ -28,18 +29,6 @@ Util.htmlDecode = function (code) {
...
@@ -28,18 +29,6 @@ Util.htmlDecode = function (code) {
return
div
.
innerText
return
div
.
innerText
}
}
/**
* @description URL 没有协议头,则自动加上 http://
* @param {String} url URL 地址
* @returns {String} 添加后的URL
*/
Util
.
proessURL
=
function
(
url
)
{
if
(
!
/^
\w
+:
\/\/
/
.
test
(
url
))
{
url
=
'
http://
'
+
url
}
return
url
}
var
Admin
=
function
()
{
var
Admin
=
function
()
{
this
.
register
=
{}
this
.
register
=
{}
// 工具栏下的工具
// 工具栏下的工具
...
...
src/main/webapp/js/admin/admin.min.js
View file @
fcc37e05
Util
.
htmlDecode
=
function
(
t
){
var
e
=
document
.
createElement
(
"
div
"
);
return
e
.
innerHTML
=
decodeURIComponent
(
t
),
e
.
innerText
}
,
Util
.
proessURL
=
function
(
t
){
return
/^
\w
+:
\/\/
/
.
test
(
t
)
||
(
t
=
"
http://
"
+
t
),
t
}
;
var
Admin
=
function
(){
this
.
register
=
{},
this
.
tools
=
[
"
#page-list
"
,
"
#theme-list
"
,
"
#link-list
"
,
"
#preference
"
,
"
#user-list
"
,
"
#plugin-list
"
,
"
#others
"
,
"
#category-list
"
],
this
.
adTools
=
[
"
link-list
"
,
"
preference
"
,
"
theme-list
"
,
"
page-list
"
,
"
user-list
"
,
"
plugin-list
"
,
"
others
"
,
"
category-list
"
]};
$
.
extend
(
Admin
.
prototype
,{
logout
:
function
(){
window
.
location
.
href
=
Label
.
servePath
+
"
/logout
"
},
toggleMenu
:
function
(){
"
-240px
"
===
$
(
"
#tabs
"
).
css
(
"
left
"
)?(
$
(
"
#tabs
"
).
css
(
"
left
"
,
0
),
$
(
"
.tabs__bg
"
).
show
()):(
$
(
"
#tabs
"
).
css
(
"
left
"
,
"
-240px
"
),
$
(
"
.tabs__bg
"
).
hide
())},
clearTip
:
function
(){
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#loadMsg
"
).
text
(
""
)},
setHashByPage
:
function
(
t
){
var
e
=
window
.
location
.
hash
.
split
(
"
/
"
);
/^
\d
*$/
.
test
(
e
[
e
.
length
-
1
])?
e
[
e
.
length
-
1
]
=
t
:
e
.
push
(
t
),
window
.
location
.
hash
=
e
.
join
(
"
/
"
)},
selectTab
:
function
(
t
){
window
.
location
.
hash
=
"
#
"
+
t
},
analyseHash
:
function
(){
for
(
var
t
=
window
.
location
.
hash
,
e
=
t
.
substr
(
1
,
t
.
length
-
1
).
split
(
"
/
"
),
i
=
{
page
:
1
,
hashList
:[]},
a
=
0
;
a
<
e
.
length
;
a
++
)
a
===
e
.
length
-
1
&&
/^
\d
+$/
.
test
(
e
[
a
])?
i
.
page
=
e
[
a
]:
i
.
hashList
.
push
(
e
[
a
]);
return
i
},
setCurByHash
:
function
(){
$
(
window
).
scrollTop
(
0
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
t
=
admin
.
analyseHash
(),
e
=
t
.
hashList
[
1
],
i
=
t
.
hashList
[
2
];
if
(
1
===
t
.
hashList
.
length
&&
(
e
=
t
.
hashList
[
0
]),
""
!==
e
){
try
{
if
(
admin
.
editors
.
articleEditor
.
getContent
){
if
(
"
article
"
!==
e
&&
admin
.
article
.
isConfirm
&&
""
!==
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
()
&&!
confirm
(
Label
.
editorLeaveLabel
))
return
void
(
window
.
location
.
hash
=
"
#article/article
"
);
if
(
"
article
"
===
e
&&
admin
.
article
.
isConfirm
&&
""
!==
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
())
return
}}
catch
(
t
){
console
.
log
(
t
)}
"
article
"
!==
e
&&
admin
.
editors
.
articleEditor
.
setContent
&&
admin
.
article
.
clear
(),
admin
.
article
.
isConfirm
=!
0
,
$
(
"
#tabs
"
).
tabs
(
"
setCurrent
"
,
e
),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
1
===
$
(
"
#tabsPanel_
"
+
e
).
length
?
""
===
$
(
"
#tabsPanel_
"
+
e
).
html
().
replace
(
/
\s
/g
,
""
)?
$
(
"
#tabsPanel_
"
+
e
).
load
(
"
admin-
"
+
e
+
"
.do
"
,
function
(){
"
article
"
===
e
&&
admin
.
article
.
status
.
id
?
admin
.
register
[
e
].
init
.
call
(
admin
.
register
[
e
].
obj
,
admin
.
article
.
getAndSet
):
admin
.
register
[
e
].
init
.
call
(
admin
.
register
[
e
].
obj
,
t
.
page
),
i
&&
$
(
"
#tab
"
+
e
.
substring
(
0
,
1
).
toUpperCase
()
+
e
.
substring
(
1
)).
tabs
(
"
setCurrent
"
,
i
),
admin
.
plugin
.
setCurByHash
(
t
)}):(
"
article
"
===
e
&&
admin
.
article
.
status
.
id
&&
admin
.
article
.
getAndSet
(),
admin
.
register
[
e
]
&&
admin
.
register
[
e
].
refresh
&&
admin
.
register
[
e
].
refresh
.
call
(
admin
.
register
[
e
].
obj
,
t
.
page
),
i
&&
$
(
"
#tab
"
+
e
.
substring
(
0
,
1
).
toUpperCase
()
+
e
.
substring
(
1
)).
tabs
(
"
setCurrent
"
,
i
),
admin
.
plugin
.
setCurByHash
(
t
)):(
$
(
"
#tipMsg
"
).
text
(
"
Error: No tab!
"
+
Label
.
reportIssueLabel
),
$
(
"
#loadMsg
"
).
text
(
""
))}},
init
:
function
(){
Util
.
killIE
(),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tabs
"
).
tabs
(),
setInterval
(
function
(){
""
!==
$
(
"
#tipMsg
"
).
text
()
&&
setTimeout
(
function
(){
$
(
"
#tipMsg
"
).
text
(
""
)},
7
e3
)},
6
e3
),
$
(
"
#loadMsg
"
).
text
(
""
),
window
.
onbeforeunload
=
function
(
t
){
if
(
"
#article/article
"
===
window
.
location
.
hash
)
return
t
&&
(
t
.
returnValue
=
Label
.
editorLeaveLabel
),
Label
.
editorLeaveLabel
},
$
(
document
).
ajaxError
(
function
(
t
,
e
,
i
,
a
){
200
!==
e
.
status
&&
$
(
"
#tipMsg
"
).
text
(
e
.
status
+
"
:
"
+
a
)})},
collapseNav
:
function
(
t
){
$
(
t
).
next
().
slideToggle
(
"
normal
"
,
function
(){
"
none
"
!==
this
.
style
.
display
?(
$
(
t
).
find
(
"
.icon-chevron-down
"
)[
0
].
className
=
"
icon-chevron-up fn__right
"
,
$
(
t
).
addClass
(
"
tab-current
"
)):(
$
(
t
).
find
(
"
.icon-chevron-up
"
)[
0
].
className
=
"
icon-chevron-down fn__right
"
,
$
(
t
).
removeClass
(
"
tab-current
"
)),
$
(
"
#tabs > ul
"
).
height
(
"
auto
"
),
$
(
"
#tabs > ul
"
).
height
(
$
(
"
#tabs > ul
"
).
height
()
+
80
)})},
inited
:
function
(){
if
(
"
adminRole
"
!==
Label
.
userRole
)
for
(
var
t
=
0
;
t
<
this
.
adTools
.
length
;
t
++
)
$
(
"
#tabs
"
).
tabs
(
"
remove
"
,
this
.
adTools
[
t
]);
else
for
(
var
e
=
0
;
e
<
this
.
tools
.
length
;
e
++
)
if
(
"
#
"
+
window
.
location
.
hash
.
split
(
"
/
"
)[
1
]
===
this
.
tools
[
e
]){
$
(
"
#tabToolsTitle
"
).
click
();
break
}
this
.
setCurByHash
()}});
var
admin
=
new
Admin
;
Util
.
htmlDecode
=
function
(
t
){
var
e
=
document
.
createElement
(
"
div
"
);
return
e
.
innerHTML
=
decodeURIComponent
(
t
),
e
.
innerText
};
var
Admin
=
function
(){
this
.
register
=
{},
this
.
tools
=
[
"
#page-list
"
,
"
#theme-list
"
,
"
#link-list
"
,
"
#preference
"
,
"
#user-list
"
,
"
#plugin-list
"
,
"
#others
"
,
"
#category-list
"
],
this
.
adTools
=
[
"
link-list
"
,
"
preference
"
,
"
theme-list
"
,
"
page-list
"
,
"
user-list
"
,
"
plugin-list
"
,
"
others
"
,
"
category-list
"
]};
$
.
extend
(
Admin
.
prototype
,{
logout
:
function
(){
window
.
location
.
href
=
Label
.
servePath
+
"
/logout
"
},
toggleMenu
:
function
(){
"
-240px
"
===
$
(
"
#tabs
"
).
css
(
"
left
"
)?(
$
(
"
#tabs
"
).
css
(
"
left
"
,
0
),
$
(
"
.tabs__bg
"
).
show
()):(
$
(
"
#tabs
"
).
css
(
"
left
"
,
"
-240px
"
),
$
(
"
.tabs__bg
"
).
hide
())},
clearTip
:
function
(){
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#loadMsg
"
).
text
(
""
)},
setHashByPage
:
function
(
t
){
var
e
=
window
.
location
.
hash
.
split
(
"
/
"
);
/^
\d
*$/
.
test
(
e
[
e
.
length
-
1
])?
e
[
e
.
length
-
1
]
=
t
:
e
.
push
(
t
),
window
.
location
.
hash
=
e
.
join
(
"
/
"
)},
selectTab
:
function
(
t
){
window
.
location
.
hash
=
"
#
"
+
t
},
analyseHash
:
function
(){
for
(
var
t
=
window
.
location
.
hash
,
e
=
t
.
substr
(
1
,
t
.
length
-
1
).
split
(
"
/
"
),
i
=
{
page
:
1
,
hashList
:[]},
a
=
0
;
a
<
e
.
length
;
a
++
)
a
===
e
.
length
-
1
&&
/^
\d
+$/
.
test
(
e
[
a
])?
i
.
page
=
e
[
a
]:
i
.
hashList
.
push
(
e
[
a
]);
return
i
},
setCurByHash
:
function
(){
$
(
window
).
scrollTop
(
0
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
t
=
admin
.
analyseHash
(),
e
=
t
.
hashList
[
1
],
i
=
t
.
hashList
[
2
];
if
(
1
===
t
.
hashList
.
length
&&
(
e
=
t
.
hashList
[
0
]),
""
!==
e
){
try
{
if
(
admin
.
editors
.
articleEditor
.
getContent
){
if
(
"
article
"
!==
e
&&
admin
.
article
.
isConfirm
&&
""
!==
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
()
&&!
confirm
(
Label
.
editorLeaveLabel
))
return
void
(
window
.
location
.
hash
=
"
#article/article
"
);
if
(
"
article
"
===
e
&&
admin
.
article
.
isConfirm
&&
""
!==
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
())
return
}}
catch
(
t
){
console
.
log
(
t
)}
"
article
"
!==
e
&&
admin
.
editors
.
articleEditor
.
setContent
&&
admin
.
article
.
clear
(),
admin
.
article
.
isConfirm
=!
0
,
$
(
"
#tabs
"
).
tabs
(
"
setCurrent
"
,
e
),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
1
===
$
(
"
#tabsPanel_
"
+
e
).
length
?
""
===
$
(
"
#tabsPanel_
"
+
e
).
html
().
replace
(
/
\s
/g
,
""
)?
$
(
"
#tabsPanel_
"
+
e
).
load
(
"
admin-
"
+
e
+
"
.do
"
,
function
(){
"
article
"
===
e
&&
admin
.
article
.
status
.
id
?
admin
.
register
[
e
].
init
.
call
(
admin
.
register
[
e
].
obj
,
admin
.
article
.
getAndSet
):
admin
.
register
[
e
].
init
.
call
(
admin
.
register
[
e
].
obj
,
t
.
page
),
i
&&
$
(
"
#tab
"
+
e
.
substring
(
0
,
1
).
toUpperCase
()
+
e
.
substring
(
1
)).
tabs
(
"
setCurrent
"
,
i
),
admin
.
plugin
.
setCurByHash
(
t
)}):(
"
article
"
===
e
&&
admin
.
article
.
status
.
id
&&
admin
.
article
.
getAndSet
(),
admin
.
register
[
e
]
&&
admin
.
register
[
e
].
refresh
&&
admin
.
register
[
e
].
refresh
.
call
(
admin
.
register
[
e
].
obj
,
t
.
page
),
i
&&
$
(
"
#tab
"
+
e
.
substring
(
0
,
1
).
toUpperCase
()
+
e
.
substring
(
1
)).
tabs
(
"
setCurrent
"
,
i
),
admin
.
plugin
.
setCurByHash
(
t
)):(
$
(
"
#tipMsg
"
).
text
(
"
Error: No tab!
"
+
Label
.
reportIssueLabel
),
$
(
"
#loadMsg
"
).
text
(
""
))}},
init
:
function
(){
Util
.
killIE
(),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tabs
"
).
tabs
(),
setInterval
(
function
(){
""
!==
$
(
"
#tipMsg
"
).
text
()
&&
setTimeout
(
function
(){
$
(
"
#tipMsg
"
).
text
(
""
)},
7
e3
)},
6
e3
),
$
(
"
#loadMsg
"
).
text
(
""
),
window
.
onbeforeunload
=
function
(
t
){
if
(
"
#article/article
"
===
window
.
location
.
hash
)
return
t
&&
(
t
.
returnValue
=
Label
.
editorLeaveLabel
),
Label
.
editorLeaveLabel
},
$
(
document
).
ajaxError
(
function
(
t
,
e
,
i
,
a
){
200
!==
e
.
status
&&
$
(
"
#tipMsg
"
).
text
(
e
.
status
+
"
:
"
+
a
)})},
collapseNav
:
function
(
t
){
$
(
t
).
next
().
slideToggle
(
"
normal
"
,
function
(){
"
none
"
!==
this
.
style
.
display
?(
$
(
t
).
find
(
"
.icon-chevron-down
"
)[
0
].
className
=
"
icon-chevron-up fn__right
"
,
$
(
t
).
addClass
(
"
tab-current
"
)):(
$
(
t
).
find
(
"
.icon-chevron-up
"
)[
0
].
className
=
"
icon-chevron-down fn__right
"
,
$
(
t
).
removeClass
(
"
tab-current
"
)),
$
(
"
#tabs > ul
"
).
height
(
"
auto
"
),
$
(
"
#tabs > ul
"
).
height
(
$
(
"
#tabs > ul
"
).
height
()
+
80
)})},
inited
:
function
(){
if
(
"
adminRole
"
!==
Label
.
userRole
)
for
(
var
t
=
0
;
t
<
this
.
adTools
.
length
;
t
++
)
$
(
"
#tabs
"
).
tabs
(
"
remove
"
,
this
.
adTools
[
t
]);
else
for
(
var
e
=
0
;
e
<
this
.
tools
.
length
;
e
++
)
if
(
"
#
"
+
window
.
location
.
hash
.
split
(
"
/
"
)[
1
]
===
this
.
tools
[
e
]){
$
(
"
#tabToolsTitle
"
).
click
();
break
}
this
.
setCurByHash
()}});
var
admin
=
new
Admin
;
admin
.
editors
=
{};
var
SoloEditor
=
function
(
e
){
this
.
conf
=
e
,
this
.
init
()};
$
.
extend
(
SoloEditor
.
prototype
,{
init
:
function
(){
this
.
editor
=
new
Vditor
(
this
.
conf
.
id
,{
cache
:
!
0
,
tab
:
"
\t
"
,
hint
:{
emojiPath
:
Label
.
staticServePath
+
"
/js/lib/emojify.js-1.1.0/images/basic
"
},
preview
:{
delay
:
500
,
show
:
this
.
conf
.
previewShow
,
url
:
Label
.
servePath
+
"
/console/markdown/2html
"
,
parse
:
function
(
e
){
"
none
"
!==
e
.
style
.
display
&&
Util
.
parseLanguage
()}},
upload
:{
max
:
10485760
,
url
:
Label
.
uploadURL
,
token
:
Label
.
uploadToken
,
filename
:
function
(
e
){
return
e
.
replace
(
/
[^
(a-zA-Z0-9
\u
4e00-
\u
9fa5
\.
)
]
/g
,
""
).
replace
(
/
[\?\\/
:|<>
\*\[\]\(\)\$
%
\{\}
@~
]
/g
,
""
).
replace
(
"
/
\\
s/g
"
,
""
)}},
height
:
this
.
conf
.
height
,
counter
:
102400
,
resize
:{
enable
:
this
.
conf
.
resize
},
lang
:
Label
.
localeString
}),
"
function
"
==
typeof
this
.
conf
.
fun
&&
this
.
conf
.
fun
()},
getContent
:
function
(){
return
this
.
editor
.
getValue
()},
setContent
:
function
(
e
){
this
.
editor
.
setValue
(
e
)},
remove
:
function
(){
document
.
getElementById
(
this
.
editor
.
vditor
.
id
).
outerHTML
=
""
}}),
admin
.
editors
.
articleEditor
=
{},
admin
.
editors
.
abstractEditor
=
{};
admin
.
editors
=
{};
var
SoloEditor
=
function
(
e
){
this
.
conf
=
e
,
this
.
init
()};
$
.
extend
(
SoloEditor
.
prototype
,{
init
:
function
(){
this
.
editor
=
new
Vditor
(
this
.
conf
.
id
,{
cache
:
!
0
,
tab
:
"
\t
"
,
hint
:{
emojiPath
:
Label
.
staticServePath
+
"
/js/lib/emojify.js-1.1.0/images/basic
"
},
preview
:{
delay
:
500
,
show
:
this
.
conf
.
previewShow
,
url
:
Label
.
servePath
+
"
/console/markdown/2html
"
,
parse
:
function
(
e
){
"
none
"
!==
e
.
style
.
display
&&
Util
.
parseLanguage
()}},
upload
:{
max
:
10485760
,
url
:
Label
.
uploadURL
,
token
:
Label
.
uploadToken
,
filename
:
function
(
e
){
return
e
.
replace
(
/
[^
(a-zA-Z0-9
\u
4e00-
\u
9fa5
\.
)
]
/g
,
""
).
replace
(
/
[\?\\/
:|<>
\*\[\]\(\)\$
%
\{\}
@~
]
/g
,
""
).
replace
(
"
/
\\
s/g
"
,
""
)}},
height
:
this
.
conf
.
height
,
counter
:
102400
,
resize
:{
enable
:
this
.
conf
.
resize
},
lang
:
Label
.
localeString
}),
"
function
"
==
typeof
this
.
conf
.
fun
&&
this
.
conf
.
fun
()},
getContent
:
function
(){
return
this
.
editor
.
getValue
()},
setContent
:
function
(
e
){
this
.
editor
.
setValue
(
e
)},
remove
:
function
(){
document
.
getElementById
(
this
.
editor
.
vditor
.
id
).
outerHTML
=
""
}}),
admin
.
editors
.
articleEditor
=
{},
admin
.
editors
.
abstractEditor
=
{};
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
}});
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
,
previewShow
:
!
0
,
resize
:
!
1
}),
admin
.
editors
.
abstractEditor
=
new
SoloEditor
({
id
:
"
abstract
"
,
height
:
200
,
previewShow
:
!
1
,
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
.
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
,
previewShow
:
!
0
,
resize
:
!
1
}),
admin
.
editors
.
abstractEditor
=
new
SoloEditor
({
id
:
"
abstract
"
,
height
:
200
,
previewShow
:
!
1
,
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
(
i
,
c
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#
"
+
c
+
"
Comments
"
).
html
(
""
);
var
e
=
"
article
"
;
"
page
"
===
c
&&
(
e
=
"
page
"
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/comments/
"
+
e
+
"
/
"
+
i
,
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
+
"
'>
"
,
l
=
a
[
m
].
commentContent
,
o
=
Util
.
replaceEmString
(
l
);
"
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
+
"
', '
"
+
i
+
"
')
\"
>
"
+
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
.
comment
=
{
open
:
function
(
e
,
t
){
this
.
getList
(
e
,
t
),
$
(
"
#
"
+
t
+
"
Comments
"
).
dialog
(
"
open
"
)},
getList
:
function
(
i
,
c
){
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#
"
+
c
+
"
Comments
"
).
html
(
""
);
var
e
=
"
article
"
;
"
page
"
===
c
&&
(
e
=
"
page
"
),
$
.
ajax
({
url
:
Label
.
servePath
+
"
/console/comments/
"
+
e
+
"
/
"
+
i
,
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
+
"
'>
"
,
l
=
a
[
m
].
commentContent
,
o
=
Util
.
replaceEmString
(
l
);
"
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
+
"
', '
"
+
i
+
"
')
\"
>
"
+
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
(
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
.
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
=
Util
.
proessURL
(
$
(
"
#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
=
Util
.
proessURL
(
$
(
"
#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
:
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
.
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
"
),
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
"
),
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
"
),
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
"
),
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
()}};
...
...
src/main/webapp/js/admin/pageList.js
View file @
fcc37e05
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.0.
0, Feb 6
, 2019
* @version 1.3.0.
1, Apr 22
, 2019
*/
*/
/* page-list 相关操作 */
/* page-list 相关操作 */
...
@@ -202,7 +202,7 @@ admin.pageList = {
...
@@ -202,7 +202,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pagePermalink
=
Util
.
proessURL
(
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
)
);
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
...
@@ -255,8 +255,7 @@ admin.pageList = {
...
@@ -255,8 +255,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pagePermalink
=
Util
.
proessURL
(
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
));
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
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