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
886481c7
Commit
886481c7
authored
May 31, 2015
by
Liang Ding
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12018 from b3log/0.6.9
0.6.9
parents
ee3a7ae8
e744ed9c
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
573 additions
and
482 deletions
+573
-482
core/src/main/java/org/b3log/solo/service/PageMgmtService.java
...src/main/java/org/b3log/solo/service/PageMgmtService.java
+31
-31
core/src/test/resources/b3log.properties
core/src/test/resources/b3log.properties
+2
-1
war/src/main/webapp/admin-index.ftl
war/src/main/webapp/admin-index.ftl
+0
-10
war/src/main/webapp/css/default-admin.css
war/src/main/webapp/css/default-admin.css
+2
-2
war/src/main/webapp/css/default-admin.min.css
war/src/main/webapp/css/default-admin.min.css
+1
-1
war/src/main/webapp/js/admin/article.js
war/src/main/webapp/js/admin/article.js
+62
-39
war/src/main/webapp/js/admin/editor.js
war/src/main/webapp/js/admin/editor.js
+13
-5
war/src/main/webapp/js/admin/editorCodeMirror.js
war/src/main/webapp/js/admin/editorCodeMirror.js
+37
-31
war/src/main/webapp/js/admin/editorKindEditor.js
war/src/main/webapp/js/admin/editorKindEditor.js
+20
-15
war/src/main/webapp/js/admin/editorTinyMCE.js
war/src/main/webapp/js/admin/editorTinyMCE.js
+32
-32
war/src/main/webapp/js/admin/latkeAdmin.js
war/src/main/webapp/js/admin/latkeAdmin.js
+268
-218
war/src/main/webapp/js/admin/latkeAdmin.min.js
war/src/main/webapp/js/admin/latkeAdmin.min.js
+1
-1
war/src/main/webapp/js/admin/pageList.js
war/src/main/webapp/js/admin/pageList.js
+104
-96
No files found.
core/src/main/java/org/b3log/solo/service/PageMgmtService.java
View file @
886481c7
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
*/
*/
package
org
.
b3log
.
solo
.
service
;
package
org
.
b3log
.
solo
.
service
;
import
java.util.List
;
import
java.util.List
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Keys
;
...
@@ -37,12 +36,11 @@ import org.b3log.solo.util.Comments;
...
@@ -37,12 +36,11 @@ import org.b3log.solo.util.Comments;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
/**
/**
* Page management service.
* Page management service.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.
0.0.7, Jun 8, 2012
* @version 1.
1.0.7, May 30, 2015
* @since 0.4.0
* @since 0.4.0
*/
*/
@Service
@Service
...
@@ -98,8 +96,7 @@ public class PageMgmtService {
...
@@ -98,8 +96,7 @@ public class PageMgmtService {
/**
/**
* Updates a page by the specified request json object.
* Updates a page by the specified request json object.
*
*
* @param requestJSONObject the specified request json object, for example,
* @param requestJSONObject the specified request json object, for example, <pre>
* <pre>
* {
* {
* "page": {
* "page": {
* "oId": "",
* "oId": "",
...
@@ -110,10 +107,12 @@ public class PageMgmtService {
...
@@ -110,10 +107,12 @@ public class PageMgmtService {
* "pagePermalink": "",
* "pagePermalink": "",
* "pageCommentable": boolean,
* "pageCommentable": boolean,
* "pageType": "",
* "pageType": "",
* "pageOpenTarget": ""
* "pageOpenTarget": "",
* "pageEditorType": "" // optional, preference specified if not exists this key
* }
* }
* }, see {@link Page} for more details
* }, see {@link Page} for more details
* </pre>
* </pre>
*
* @throws ServiceException service exception
* @throws ServiceException service exception
*/
*/
public
void
updatePage
(
final
JSONObject
requestJSONObject
)
throws
ServiceException
{
public
void
updatePage
(
final
JSONObject
requestJSONObject
)
throws
ServiceException
{
...
@@ -167,10 +166,11 @@ public class PageMgmtService {
...
@@ -167,10 +166,11 @@ public class PageMgmtService {
processCommentsForPageUpdate
(
newPage
);
processCommentsForPageUpdate
(
newPage
);
}
}
// Editor type
// Set editor type
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
if
(!
newPage
.
has
(
Page
.
PAGE_EDITOR_TYPE
))
{
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
newPage
.
put
(
Page
.
PAGE_EDITOR_TYPE
,
preference
.
optString
(
Preference
.
EDITOR_TYPE
));
newPage
.
put
(
Page
.
PAGE_EDITOR_TYPE
,
preference
.
optString
(
Preference
.
EDITOR_TYPE
));
}
pageRepository
.
update
(
pageId
,
newPage
);
pageRepository
.
update
(
pageId
,
newPage
);
...
@@ -216,9 +216,8 @@ public class PageMgmtService {
...
@@ -216,9 +216,8 @@ public class PageMgmtService {
/**
/**
* Adds a page with the specified request json object.
* Adds a page with the specified request json object.
*
*
* @param requestJSONObject the specified request json object, for example,
* @param requestJSONObject the specified request json object, for example, <pre>
* <pre>
* {
* {
* "page": {
* "page": {
* "pageTitle": "",
* "pageTitle": "",
...
@@ -226,13 +225,14 @@ public class PageMgmtService {
...
@@ -226,13 +225,14 @@ public class PageMgmtService {
* "pageOpenTarget": "",
* "pageOpenTarget": "",
* "pageCommentable": boolean,
* "pageCommentable": boolean,
* "pageType": "",
* "pageType": "",
* "pagePermalink": "" // optional
* "pagePermalink": "", // optional
* "pageEditorType": "" // optional, preference specified if not exists this key
* }
* }
* }, see {@link Page} for more details
* }, see {@link Page} for more details
* </pre>
* </pre>
*
* @return generated page id
* @return generated page id
* @throws ServiceException if permalink format checks failed or persists
* @throws ServiceException if permalink format checks failed or persists failed
* failed
*/
*/
public
String
addPage
(
final
JSONObject
requestJSONObject
)
throws
ServiceException
{
public
String
addPage
(
final
JSONObject
requestJSONObject
)
throws
ServiceException
{
final
Transaction
transaction
=
pageRepository
.
beginTransaction
();
final
Transaction
transaction
=
pageRepository
.
beginTransaction
();
...
@@ -274,11 +274,12 @@ public class PageMgmtService {
...
@@ -274,11 +274,12 @@ public class PageMgmtService {
}
}
page
.
put
(
Page
.
PAGE_PERMALINK
,
permalink
.
replaceAll
(
" "
,
"-"
));
page
.
put
(
Page
.
PAGE_PERMALINK
,
permalink
.
replaceAll
(
" "
,
"-"
));
// Editor type
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
page
.
put
(
Page
.
PAGE_EDITOR_TYPE
,
preference
.
optString
(
Preference
.
EDITOR_TYPE
));
// Set editor type
if
(!
page
.
has
(
Page
.
PAGE_EDITOR_TYPE
))
{
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
page
.
put
(
Page
.
PAGE_EDITOR_TYPE
,
preference
.
optString
(
Preference
.
EDITOR_TYPE
));
}
final
String
ret
=
pageRepository
.
add
(
page
);
final
String
ret
=
pageRepository
.
add
(
page
);
...
@@ -303,8 +304,7 @@ public class PageMgmtService {
...
@@ -303,8 +304,7 @@ public class PageMgmtService {
}
}
/**
/**
* Changes the order of a page specified by the given page id with
* Changes the order of a page specified by the given page id with the specified direction.
* the specified direction.
*
*
* @param pageId the given page id
* @param pageId the given page id
* @param direction the specified direction, "up"/"down"
* @param direction the specified direction, "up"/"down"
...
@@ -381,9 +381,9 @@ public class PageMgmtService {
...
@@ -381,9 +381,9 @@ public class PageMgmtService {
/**
/**
* Processes comments for page update.
* Processes comments for page update.
*
*
* @param page the specified page to update
* @param page the specified page to update
* @throws Exception exception
* @throws Exception exception
*/
*/
public
void
processCommentsForPageUpdate
(
final
JSONObject
page
)
throws
Exception
{
public
void
processCommentsForPageUpdate
(
final
JSONObject
page
)
throws
Exception
{
final
String
pageId
=
page
.
getString
(
Keys
.
OBJECT_ID
);
final
String
pageId
=
page
.
getString
(
Keys
.
OBJECT_ID
);
...
@@ -409,7 +409,7 @@ public class PageMgmtService {
...
@@ -409,7 +409,7 @@ public class PageMgmtService {
/**
/**
* Sets the permalink query service with the specified permalink query service.
* Sets the permalink query service with the specified permalink query service.
*
*
* @param permalinkQueryService the specified permalink query service
* @param permalinkQueryService the specified permalink query service
*/
*/
public
void
setPermalinkQueryService
(
final
PermalinkQueryService
permalinkQueryService
)
{
public
void
setPermalinkQueryService
(
final
PermalinkQueryService
permalinkQueryService
)
{
...
@@ -418,7 +418,7 @@ public class PageMgmtService {
...
@@ -418,7 +418,7 @@ public class PageMgmtService {
/**
/**
* Set the page repository with the specified page repository.
* Set the page repository with the specified page repository.
*
*
* @param pageRepository the specified page repository
* @param pageRepository the specified page repository
*/
*/
public
void
setPageRepository
(
final
PageRepository
pageRepository
)
{
public
void
setPageRepository
(
final
PageRepository
pageRepository
)
{
...
@@ -427,7 +427,7 @@ public class PageMgmtService {
...
@@ -427,7 +427,7 @@ public class PageMgmtService {
/**
/**
* Sets the preference query service with the specified preference query service.
* Sets the preference query service with the specified preference query service.
*
*
* @param preferenceQueryService the specified preference query service
* @param preferenceQueryService the specified preference query service
*/
*/
public
void
setPreferenceQueryService
(
final
PreferenceQueryService
preferenceQueryService
)
{
public
void
setPreferenceQueryService
(
final
PreferenceQueryService
preferenceQueryService
)
{
...
@@ -436,7 +436,7 @@ public class PageMgmtService {
...
@@ -436,7 +436,7 @@ public class PageMgmtService {
/**
/**
* Sets the statistic query service with the specified statistic query service.
* Sets the statistic query service with the specified statistic query service.
*
*
* @param statisticQueryService the specified statistic query service
* @param statisticQueryService the specified statistic query service
*/
*/
public
void
setStatisticQueryService
(
final
StatisticQueryService
statisticQueryService
)
{
public
void
setStatisticQueryService
(
final
StatisticQueryService
statisticQueryService
)
{
...
@@ -445,7 +445,7 @@ public class PageMgmtService {
...
@@ -445,7 +445,7 @@ public class PageMgmtService {
/**
/**
* Sets the statistic management service with the specified statistic management service.
* Sets the statistic management service with the specified statistic management service.
*
*
* @param statisticMgmtService the specified statistic management service
* @param statisticMgmtService the specified statistic management service
*/
*/
public
void
setStatisticMgmtService
(
final
StatisticMgmtService
statisticMgmtService
)
{
public
void
setStatisticMgmtService
(
final
StatisticMgmtService
statisticMgmtService
)
{
...
@@ -454,7 +454,7 @@ public class PageMgmtService {
...
@@ -454,7 +454,7 @@ public class PageMgmtService {
/**
/**
* Sets the comment repository with the specified comment repository.
* Sets the comment repository with the specified comment repository.
*
*
* @param commentRepository the specified comment repository
* @param commentRepository the specified comment repository
*/
*/
public
void
setCommentRepository
(
final
CommentRepository
commentRepository
)
{
public
void
setCommentRepository
(
final
CommentRepository
commentRepository
)
{
...
@@ -463,7 +463,7 @@ public class PageMgmtService {
...
@@ -463,7 +463,7 @@ public class PageMgmtService {
/**
/**
* Sets the language service with the specified language service.
* Sets the language service with the specified language service.
*
*
* @param langPropsService the specified language service
* @param langPropsService the specified language service
*/
*/
public
void
setLangPropsService
(
final
LangPropsService
langPropsService
)
{
public
void
setLangPropsService
(
final
LangPropsService
langPropsService
)
{
...
...
core/src/test/resources/b3log.properties
View file @
886481c7
...
@@ -16,11 +16,12 @@
...
@@ -16,11 +16,12 @@
#
#
# Description: B3log configurations for testing.
# Description: B3log configurations for testing.
# Version: 1.
1.0.0, Jan 13
, 2015
# Version: 1.
2.0.0, May 25
, 2015
# Author: Liang Ding
# Author: Liang Ding
#
#
rhythm.servePath
=
http://localhost:8081
rhythm.servePath
=
http://localhost:8081
symphony.servePath
=
http://localhost:8084
symphony.servePath
=
http://localhost:8084
gravatar
=
http://gravatar.duoshuo.com/avatar/
faviconAPI
=
http://api.byi.pw/favicon?url=
faviconAPI
=
http://api.byi.pw/favicon?url=
\ No newline at end of file
war/src/main/webapp/admin-index.ftl
View file @
886481c7
...
@@ -6,9 +6,7 @@
...
@@ -6,9 +6,7 @@
<title>
${blogTitle} - ${adminConsoleLabel}
</title>
<title>
${blogTitle} - ${adminConsoleLabel}
</title>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"${staticServePath}/css/default-base${miniPostfix}.css?${staticResourceVersion}"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"${staticServePath}/css/default-base${miniPostfix}.css?${staticResourceVersion}"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"${staticServePath}/css/default-admin${miniPostfix}.css?${staticResourceVersion}"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"${staticServePath}/css/default-admin${miniPostfix}.css?${staticResourceVersion}"
/>
<
#if
"
CodeMirror-Markdown
"
==
editorType
>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"${staticServePath}/js/lib/CodeMirror/codemirror.css?${staticResourceVersion}"
/>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"${staticServePath}/js/lib/CodeMirror/codemirror.css?${staticResourceVersion}"
/>
</
#
if>
<link
rel=
"icon"
type=
"image/png"
href=
"${staticServePath}/favicon.png"
/>
<link
rel=
"icon"
type=
"image/png"
href=
"${staticServePath}/favicon.png"
/>
</head>
</head>
<body
onhashchange=
"admin.setCurByHash();"
>
<body
onhashchange=
"admin.setCurByHash();"
>
...
@@ -133,24 +131,16 @@
...
@@ -133,24 +131,16 @@
</div>
</div>
<script
src=
"${staticServePath}/js/lib/jquery/jquery.min.js"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/jquery.min.js"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/jquery.bowknot.min.js?${staticResourceVersion}"
></script>
<script
src=
"${staticServePath}/js/lib/jquery/jquery.bowknot.min.js?${staticResourceVersion}"
></script>
<
#if
"
tinyMCE
"
==
editorType
>
<script
src=
"${servePath}/js/lib/tiny_mce/tiny_mce.js"
></script>
<script
src=
"${servePath}/js/lib/tiny_mce/tiny_mce.js"
></script>
<
#elseif
"
KindEditor
"
==
editorType
>
<script
src=
"${staticServePath}/js/lib/KindEditor/kindeditor-min.js"
></script>
<script
src=
"${staticServePath}/js/lib/KindEditor/kindeditor-min.js"
></script>
<
#else
>
<script
src=
"${staticServePath}/js/lib/CodeMirror/codemirror.js"
></script>
<script
src=
"${staticServePath}/js/lib/CodeMirror/codemirror.js"
></script>
</
#
if>
<script
src=
"${staticServePath}/js/common${miniPostfix}.js"
></script>
<script
src=
"${staticServePath}/js/common${miniPostfix}.js"
></script>
<
#if
""
==
miniPostfix
>
<
#if
""
==
miniPostfix
>
<script
src=
"${staticServePath}/js/admin/admin.js"
></script>
<script
src=
"${staticServePath}/js/admin/admin.js"
></script>
<script
src=
"${staticServePath}/js/admin/editor.js"
></script>
<script
src=
"${staticServePath}/js/admin/editor.js"
></script>
<
#if
"
tinyMCE
"
==
editorType
>
<script
src=
"${staticServePath}/js/admin/editorTinyMCE.js"
></script>
<script
src=
"${staticServePath}/js/admin/editorTinyMCE.js"
></script>
<
#elseif
"
KindEditor
"
==
editorType
>
<script
src=
"${staticServePath}/js/admin/editorKindEditor.js"
></script>
<script
src=
"${staticServePath}/js/admin/editorKindEditor.js"
></script>
<
#else
>
<script
src=
"${staticServePath}/js/admin/editorCodeMirror.js"
></script>
<script
src=
"${staticServePath}/js/admin/editorCodeMirror.js"
></script>
</
#
if>
<script
src=
"${staticServePath}/js/admin/tablePaginate.js"
></script>
<script
src=
"${staticServePath}/js/admin/tablePaginate.js"
></script>
<script
src=
"${staticServePath}/js/admin/article.js"
></script>
<script
src=
"${staticServePath}/js/admin/article.js"
></script>
<script
src=
"${staticServePath}/js/admin/comment.js"
></script>
<script
src=
"${staticServePath}/js/admin/comment.js"
></script>
...
...
war/src/main/webapp/css/default-admin.css
View file @
886481c7
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
* admin style
* admin style
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.
4.1, Dec 24, 2012
* @version 1.0.
5.1, May 30, 2015
*/
*/
/* start resset */
/* start resset */
...
@@ -647,7 +647,7 @@ button#submitArticle {
...
@@ -647,7 +647,7 @@ button#submitArticle {
float
:
left
;
float
:
left
;
height
:
16px
;
height
:
16px
;
width
:
16px
;
width
:
16px
;
background-position
:
-
79
px
-32px
;
background-position
:
-
81
px
-32px
;
}
}
.table-upIcon
{
.table-upIcon
{
background-position
:
-64px
-32px
;
background-position
:
-64px
-32px
;
...
...
war/src/main/webapp/css/default-admin.min.css
View file @
886481c7
body
,
input
,
textarea
{
font-family
:
'sans-serif'
,
'\5fae\8f6f\96c5\9ed1'
}
html
,
body
{
height
:
100%
;
min-width
:
1024px
;
background-color
:
#fafafa
}
a
:link
{
color
:
#21759b
}
a
:visited
{
color
:
#551a8b
}
a
:active
{
color
:
#d54121
}
a
:hover
{
color
:
#d54121
}
button
.selected
{
background
:
url("../images/bowknot/completed.png")
no-repeat
scroll
right
bottom
transparent
;
color
:
#d54121
}
.ico-arrow-down
,
.ico-arrow-up
{
background
:
url("../images/arrows.png")
repeat
scroll
0
4px
transparent
;
float
:
right
;
height
:
20px
;
margin
:
2px
3px
0
0
;
width
:
18px
}
.ico-arrow-up
{
background-position
:
0
-30px
}
.aboutIcon
{
background-position
:
-16px
-48px
}
#allPanel
{
height
:
auto
;
min-height
:
100%
;
position
:
relative
}
#tabsPanel
{
margin
:
30px
0
0
162px
;
padding
:
0
12px
}
#tabsPanel
>
div
{
padding-bottom
:
36px
}
.tip
{
font-weight
:
bold
;
margin
:
0
auto
;
overflow
:
hidden
;
padding
:
2px
0
;
position
:
fixed
;
text-align
:
center
;
top
:
5px
;
width
:
100%
;
z-index
:
2
}
.tip-msg
{
top
:
33px
}
#tipMsg
,
#loadMsg
{
background-color
:
#e5e7eb
;
border-radius
:
3px
;
padding
:
2px
0
}
.footer
{
bottom
:
12px
;
position
:
absolute
;
text-align
:
center
;
width
:
100%
}
#top
{
background-color
:
#666
;
background-image
:
linear-gradient
(
#666
,
#7f7f7f
);
background-image
:
-ms-linear-gradient
(
#666
,
#7f7f7f
);
background-image
:
-o-linear-gradient
(
#666
,
#7f7f7f
);
background-image
:
-webkit-linear-gradient
(
#666
,
#7f7f7f
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
GradientType
=
0
,
startColorstr
=
'#666666'
,
endColorstr
=
'#7F7F7F'
)}
#top
a
,
#top
span
span
{
float
:
left
;
line-height
:
18px
;
margin
:
6px
0
;
padding
:
0
6px
;
text-decoration
:
none
;
text-shadow
:
0
-1px
0
#fff
;
font-weight
:
normal
;
border-right
:
1px
solid
#686868
;
color
:
#ccc
;
text-shadow
:
0
-1px
0
#555
}
#top
>
a
{
color
:
#fff
}
#top
a
:hover
,
#top
a
.hover
{
border-radius
:
0
13px
13px
0
;
margin
:
0
;
line-height
:
30px
;
background-color
:
#4c4c4c
;
border-left-color
:
#707070
}
#tabs
{
background-color
:
#ececec
;
border-radius
:
0
5px
5px
0
;
border-right
:
1px
solid
#CCC
;
border-top
:
1px
solid
#DDD
;
bottom
:
0
;
box-shadow
:
6px
0
6px
#ececec
;
min-height
:
468px
;
padding
:
15px
0
;
position
:
absolute
;
top
:
58px
;
width
:
145px
}
#tabs
ul
{
list-style
:
none
}
#tabs
li
{
margin-left
:
0
}
#tabs
a
,
#tabs
>
ul
>
li
>
div
{
color
:
#21759b
;
display
:
block
;
text-decoration
:
none
;
cursor
:
pointer
;
letter-spacing
:
1px
}
#tabs
a
:hover
,
#tabs
>
ul
>
li
>
div
:hover
{
color
:
#d54121
}
#tabs
>
ul
>
li
>
div
{
border-bottom
:
1px
solid
#dfdfdf
;
border-top
:
1px
solid
#f9f9f9
;
font-weight
:
bold
;
padding-left
:
12px
;
line-height
:
30px
;
height
:
30px
}
#tabs
>
ul
>
li
>
div
>
a
.tab-current
{
background-color
:
#777
;
border-bottom
:
1px
solid
#6d6d6d
;
border-top
:
1px
solid
#808080
;
color
:
#fff
;
margin-left
:
-12px
;
padding-left
:
12px
;
text-shadow
:
0
-1px
0
#333
}
#tabs
li
li
a
{
background-color
:
#fff
;
padding-left
:
36px
;
line-height
:
28px
;
height
:
28px
}
#tabs
.tab-current
{
background-color
:
#eaf2fa
;
color
:
#333
;
font-weight
:
bold
}
#tabs
li
li
a
:hover
{
background-color
:
#eaf2fa
;
color
:
#333
}
#tabs
.commentIcon
,
#tabs
.postIcon
,
#tabs
.preferenceIcon
,
#tabs
.usersIcon
,
#tabs
.aboutIcon
{
margin
:
6px
9px
0
0
}
.sub-tabs
{
height
:
30px
}
.sub-tabs
ul
{
float
:
right
;
list-style
:
none
outside
none
;
margin-right
:
24px
}
.sub-tabs
li
{
float
:
left
}
.sub-tabs
li
a
{
background-color
:
#ececec
;
border
:
1px
solid
#dfdfdf
;
border-bottom
:
0
;
border-radius
:
5px
5px
0
0
;
color
:
#333
;
display
:
block
;
line-height
:
29px
;
padding
:
0
12px
;
text-decoration
:
none
}
.sub-tabs
.tab-current
,
.sub-tabs
.tab-current
:hover
{
background-color
:
#fff
;
font-weight
:
bold
;
line-height
:
30px
}
.sub-tabs
a
:hover
{
background-color
:
#f5f5f5
}
.sub-tabs-main
{
background-color
:
#fff
;
border
:
1px
solid
#dfdfdf
;
padding
:
12px
;
border-radius
:
6px
}
.form
>
div
{
margin
:
12px
0
}
.form
>
div
label
{
font-weight
:
bold
;
line-height
:
28px
;
margin-right
:
12px
}
.module-panel
{
border
:
1px
solid
#dfdfdf
;
border-radius
:
3px
3px
3px
3px
;
box-shadow
:
0
1px
0
#fff
inset
;
background-color
:
#f5f5f5
;
margin-bottom
:
36px
;
min-height
:
160px
}
.module-header
{
background-color
:
#f9f9f9
;
background-image
:
linear-gradient
(
#f9f9f9
,
#ececec
);
background-image
:
-ms-linear-gradient
(
#f9f9f9
,
#ececec
);
background-image
:
-o-linear-gradient
(
#f9f9f9
,
#ececec
);
background-image
:
-webkit-linear-gradient
(
#f9f9f9
,
#ececec
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
GradientType
=
0
,
startColorstr
=
'#f9f9f9'
,
endColorstr
=
'#ececec'
);
border-bottom-color
:
#dfdfdf
;
box-shadow
:
0
1px
0
#fff
;
text-shadow
:
0
1px
0
#fff
;
padding
:
5px
10px
}
.module-header
h2
{
color
:
#464646
;
font-size
:
16px
}
.module-header
a
{
text-decoration
:
none
}
.comment-title
{
background-color
:
#ececec
;
border-bottom
:
1px
solid
#dfdfdf
;
border-top
:
1px
solid
#f9f9f9
;
padding
:
3px
6px
3px
12px
}
#comments
{
height
:
462px
;
overflow
:
auto
}
.markdown-preivew
{
background-color
:
#fff
;
background-image
:
linear-gradient
(
#fff
,
#f3f3f3
);
background-image
:
-ms-linear-gradient
(
#fff
,
#f3f3f3
);
background-image
:
-o-linear-gradient
(
#fff
,
#f3f3f3
);
background-image
:
-webkit-linear-gradient
(
#fff
,
#f3f3f3
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
GradientType
=
0
,
startColorstr
=
'#FFFFFF'
,
endColorstr
=
'#F3F3F3'
);
border-color
:
#c0c0c0
#D9D9D9
#d9d9d9
;
border-style
:
solid
;
border-width
:
1px
;
float
:
left
;
height
:
500px
;
margin-left
:
20px
;
overflow
:
auto
;
width
:
47%
;
word-wrap
:
break-word
}
.markdown-help.ico-help
,
.markdown-help.ico-close
{
background-image
:
url("../images/icon.png")
;
background-position
:
-16px
-47px
;
cursor
:
pointer
;
float
:
right
;
height
:
17px
;
width
:
17px
}
.markdown-help.ico-close
{
height
:
16px
;
background-position
:
-48px
-16px
}
.markdown-help-main
,
.markdown-preview-main
{
color
:
#21759b
;
padding
:
0
12px
}
.markdown-help-main
dt
{
font-size
:
14px
;
font-weight
:
bold
;
margin
:
12px
0
6px
0
}
.markdown-help-main
dd
{
margin-left
:
12px
}
button
#submitArticle
{
background
:
none
repeat
scroll
0
0
#d54121
;
box-shadow
:
0
0
0
1px
#fff
inset
,
0
1px
1px
rgba
(
0
,
0
,
0
,
0.1
);
text-shadow
:
0
1px
rgba
(
0
,
0
,
0
,
0.1
);
color
:
#FFF
}
#skinsPanel
{
min-width
:
328px
;
width
:
99%
}
.skinPreview
{
cursor
:
pointer
;
height
:
160px
;
margin
:
6px
;
width
:
280px
}
.skinItem
{
background-color
:
#fafafa
;
border-radius
:
3px
;
box-shadow
:
1px
1px
3px
#333
;
line-height
:
16px
;
margin
:
24px
12px
;
padding
:
5px
;
text-align
:
center
}
#skinMain
.skinItem.selected
{
background-color
:
#d54121
}
.skinItem
:hover
{
background-color
:
#EEE
}
.f-blue
,
.error-msg
{
color
:
#36c
}
.signs
button
{
margin
:
0
12px
}
.small-head
{
float
:
left
;
height
:
35px
;
margin
:
3px
9px
0
3px
;
width
:
35px
}
#commentTable
.table-main
td
{
vertical-align
:
top
}
.about-logo
{
float
:
left
;
margin
:
62px
36px
62px
24px
}
.about-margin
{
font-size
:
20px
;
margin
:
20px
0
}
.ico-alipay-me
{
background-image
:
url("../images/alipay-me.png")
;
font-size
:
20px
;
height
:
24px
;
margin
:
20px
0
;
width
:
126px
}
.completed-input
{
margin
:
2px
12px
0
0
}
.completed-panel
{
background-color
:
#ececec
;
border
:
1px
solid
#ccc
;
color
:
#00c
;
display
:
none
;
overflow
:
auto
;
padding
:
2px
;
position
:
absolute
;
z-index
:
10
}
.completed-panel
a
{
display
:
block
;
text-decoration
:
none
}
.completed-panel
a
.selected
{
background-color
:
#fff
;
color
:
#d54121
}
.completed-ck
{
margin-top
:
9px
}
.completed-ck
span
{
background
:
url(../images/icon.png)
repeat
center
bottom
;
border
:
1px
solid
;
border-color
:
#CCc
#bbb
#A0A0A0
;
border-radius
:
4px
;
color
:
#21759b
;
cursor
:
pointer
;
float
:
left
;
height
:
28px
;
line-height
:
26px
;
margin
:
3px
6px
;
padding
:
0
6px
;
vertical-align
:
top
}
.completed-ck
span
:hover
{
border-color
:
#BBB
}
.completed-ck
span
.selected
{
color
:
#d54121
;
background
:
url(../images/bowknot/completed.png)
no-repeat
right
bottom
}
.dialog-background
{
background-color
:
#000
;
display
:
none
;
filter
:
alpha
(
opacity
=
30
);
height
:
100%
;
left
:
0
;
opacity
:
.3
;
position
:
absolute
;
top
:
0
;
width
:
100%
;
z-index
:
90
}
.dialog-panel
{
display
:
none
;
position
:
absolute
;
z-index
:
100
}
.dialog-title
{
color
:
#fff
;
float
:
left
;
font-size
:
12px
;
line-height
:
27px
;
margin-left
:
3px
}
.dialog-header-bg
{
background
:
url("../images/icon.png")
repeat
scroll
center
bottom
#f1f1f1
;
border-color
:
#c0c0c0
#D9D9D9
#d9d9d9
;
border-radius
:
6px
6px
0
0
;
border-style
:
solid
;
border-width
:
1px
1px
0
;
cursor
:
move
;
height
:
34px
}
.dialog-close-icon
{
background
:
url("../images/bowknot/dialog-close.png")
no-repeat
scroll
0
0
transparent
;
cursor
:
pointer
;
float
:
right
;
height
:
18px
;
margin-top
:
6px
;
padding
:
3px
;
width
:
22px
}
.dialog-close-icon
:hover
{
background-image
:
url("../images/bowknot/dialog-close-hover.png")
}
.dialog-main
{
background-color
:
#fff
;
border
:
2px
solid
#666
;
border-color
:
#c0c0c0
#D9D9D9
#d9d9d9
;
border-top-width
:
0
;
padding
:
12px
}
.paginate-paginate
div
,
.paginate-paginate
a
,
.paginate-pageCount
{
float
:
left
;
height
:
20px
;
line-height
:
20px
;
margin
:
0
5px
;
text-decoration
:
none
}
.pagination-pages
{
background
:
url(../images/icon.png)
repeat
center
bottom
;
border
:
1px
solid
;
border-color
:
#CCc
#bbb
#A0A0A0
;
border-radius
:
4px
;
padding
:
0
6px
;
cursor
:
pointer
;
float
:
left
;
height
:
20px
;
line-height
:
20px
;
margin
:
0
5px
}
.pagination-current-page
{
cursor
:
auto
;
font-weight
:
bold
;
border-color
:
#BBB
}
.paginate-inputPage
{
height
:
14px
;
width
:
24px
}
.table-main
{
margin
:
0
;
padding
:
0
;
position
:
relative
}
.table-main
table
{
word-break
:
break-all
;
word-wrap
:
break-word
}
.table-header
{
border
:
1px
solid
#d0d0d0
;
border-bottom
:
0
;
border-radius
:
6px
6px
0
0
}
.table-header
th
{
height
:
34px
;
line-height
:
34px
;
text-align
:
left
;
text-indent
:
6px
;
font-size
:
14px
;
font-weight
:
normal
;
background
:
url("../images/icon.png")
repeat
scroll
center
bottom
#f1f1f1
}
.table-main
td
{
border-bottom
:
1px
solid
#d0d0d0
;
color
:
#333
;
padding
:
3px
0
}
.table-lineHover
.table-hasExpend
td
{
border-bottom
:
0
}
.table-heiglight
td
,
.table-lineHover
td
{
background-color
:
#f3f3f3
;
border-right-color
:
#f3f3f3
}
.table-expendRow
td
{
padding
:
0
0
5px
36px
}
.table-expendRow
td
span
{
margin-left
:
60px
}
.table-expendRow
td
a
{
background-color
:
#999
;
border-radius
:
3px
;
color
:
#FFF
;
font-size
:
12px
;
margin-right
:
5px
;
padding
:
1px
6px
;
text-decoration
:
none
}
.table-expendRow
td
a
:hover
{
background-color
:
#BBB
}
.table-center
{
margin
:
0
auto
}
.table-upIcon
,
.table-downIcon
{
background-image
:
url("../images/icon.png")
;
cursor
:
pointer
;
float
:
left
;
height
:
16px
;
width
:
16px
;
background-position
:
-79px
-32px
}
.table-upIcon
{
background-position
:
-64px
-32px
;
margin-right
:
6px
}
.table-tag
{
color
:
#d54121
;
font-size
:
12px
;
font-style
:
italic
;
margin-left
:
10px
}
.tip-panel
{
background-color
:
#FFF
;
box-shadow
:
0
3px
10px
#8b8b8b
;
display
:
none
;
max-height
:
500px
;
max-width
:
500px
;
overflow
:
hidden
;
padding
:
3px
;
position
:
absolute
;
z-index
:
1
}
body
,
input
,
textarea
{
font-family
:
'sans-serif'
,
'\5fae\8f6f\96c5\9ed1'
}
html
,
body
{
height
:
100%
;
min-width
:
1024px
;
background-color
:
#fafafa
}
a
:link
{
color
:
#21759b
}
a
:visited
{
color
:
#551a8b
}
a
:active
{
color
:
#d54121
}
a
:hover
{
color
:
#d54121
}
button
.selected
{
background
:
url("../images/bowknot/completed.png")
no-repeat
scroll
right
bottom
transparent
;
color
:
#d54121
}
.ico-arrow-down
,
.ico-arrow-up
{
background
:
url("../images/arrows.png")
repeat
scroll
0
4px
transparent
;
float
:
right
;
height
:
20px
;
margin
:
2px
3px
0
0
;
width
:
18px
}
.ico-arrow-up
{
background-position
:
0
-30px
}
.aboutIcon
{
background-position
:
-16px
-48px
}
#allPanel
{
height
:
auto
;
min-height
:
100%
;
position
:
relative
}
#tabsPanel
{
margin
:
30px
0
0
162px
;
padding
:
0
12px
}
#tabsPanel
>
div
{
padding-bottom
:
36px
}
.tip
{
font-weight
:
bold
;
margin
:
0
auto
;
overflow
:
hidden
;
padding
:
2px
0
;
position
:
fixed
;
text-align
:
center
;
top
:
5px
;
width
:
100%
;
z-index
:
2
}
.tip-msg
{
top
:
33px
}
#tipMsg
,
#loadMsg
{
background-color
:
#e5e7eb
;
border-radius
:
3px
;
padding
:
2px
0
}
.footer
{
bottom
:
12px
;
position
:
absolute
;
text-align
:
center
;
width
:
100%
}
#top
{
background-color
:
#666
;
background-image
:
linear-gradient
(
#666
,
#7f7f7f
);
background-image
:
-ms-linear-gradient
(
#666
,
#7f7f7f
);
background-image
:
-o-linear-gradient
(
#666
,
#7f7f7f
);
background-image
:
-webkit-linear-gradient
(
#666
,
#7f7f7f
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
GradientType
=
0
,
startColorstr
=
'#666666'
,
endColorstr
=
'#7F7F7F'
)}
#top
a
,
#top
span
span
{
float
:
left
;
line-height
:
18px
;
margin
:
6px
0
;
padding
:
0
6px
;
text-decoration
:
none
;
text-shadow
:
0
-1px
0
#fff
;
font-weight
:
normal
;
border-right
:
1px
solid
#686868
;
color
:
#ccc
;
text-shadow
:
0
-1px
0
#555
}
#top
>
a
{
color
:
#fff
}
#top
a
:hover
,
#top
a
.hover
{
border-radius
:
0
13px
13px
0
;
margin
:
0
;
line-height
:
30px
;
background-color
:
#4c4c4c
;
border-left-color
:
#707070
}
#tabs
{
background-color
:
#ececec
;
border-radius
:
0
5px
5px
0
;
border-right
:
1px
solid
#CCC
;
border-top
:
1px
solid
#DDD
;
bottom
:
0
;
box-shadow
:
6px
0
6px
#ececec
;
min-height
:
468px
;
padding
:
15px
0
;
position
:
absolute
;
top
:
58px
;
width
:
145px
}
#tabs
ul
{
list-style
:
none
}
#tabs
li
{
margin-left
:
0
}
#tabs
a
,
#tabs
>
ul
>
li
>
div
{
color
:
#21759b
;
display
:
block
;
text-decoration
:
none
;
cursor
:
pointer
;
letter-spacing
:
1px
}
#tabs
a
:hover
,
#tabs
>
ul
>
li
>
div
:hover
{
color
:
#d54121
}
#tabs
>
ul
>
li
>
div
{
border-bottom
:
1px
solid
#dfdfdf
;
border-top
:
1px
solid
#f9f9f9
;
font-weight
:
bold
;
padding-left
:
12px
;
line-height
:
30px
;
height
:
30px
}
#tabs
>
ul
>
li
>
div
>
a
.tab-current
{
background-color
:
#777
;
border-bottom
:
1px
solid
#6d6d6d
;
border-top
:
1px
solid
#808080
;
color
:
#fff
;
margin-left
:
-12px
;
padding-left
:
12px
;
text-shadow
:
0
-1px
0
#333
}
#tabs
li
li
a
{
background-color
:
#fff
;
padding-left
:
36px
;
line-height
:
28px
;
height
:
28px
}
#tabs
.tab-current
{
background-color
:
#eaf2fa
;
color
:
#333
;
font-weight
:
bold
}
#tabs
li
li
a
:hover
{
background-color
:
#eaf2fa
;
color
:
#333
}
#tabs
.commentIcon
,
#tabs
.postIcon
,
#tabs
.preferenceIcon
,
#tabs
.usersIcon
,
#tabs
.aboutIcon
{
margin
:
6px
9px
0
0
}
.sub-tabs
{
height
:
30px
}
.sub-tabs
ul
{
float
:
right
;
list-style
:
none
outside
none
;
margin-right
:
24px
}
.sub-tabs
li
{
float
:
left
}
.sub-tabs
li
a
{
background-color
:
#ececec
;
border
:
1px
solid
#dfdfdf
;
border-bottom
:
0
;
border-radius
:
5px
5px
0
0
;
color
:
#333
;
display
:
block
;
line-height
:
29px
;
padding
:
0
12px
;
text-decoration
:
none
}
.sub-tabs
.tab-current
,
.sub-tabs
.tab-current
:hover
{
background-color
:
#fff
;
font-weight
:
bold
;
line-height
:
30px
}
.sub-tabs
a
:hover
{
background-color
:
#f5f5f5
}
.sub-tabs-main
{
background-color
:
#fff
;
border
:
1px
solid
#dfdfdf
;
padding
:
12px
;
border-radius
:
6px
}
.form
>
div
{
margin
:
12px
0
}
.form
>
div
label
{
font-weight
:
bold
;
line-height
:
28px
;
margin-right
:
12px
}
.module-panel
{
border
:
1px
solid
#dfdfdf
;
border-radius
:
3px
3px
3px
3px
;
box-shadow
:
0
1px
0
#fff
inset
;
background-color
:
#f5f5f5
;
margin-bottom
:
36px
;
min-height
:
160px
}
.module-header
{
background-color
:
#f9f9f9
;
background-image
:
linear-gradient
(
#f9f9f9
,
#ececec
);
background-image
:
-ms-linear-gradient
(
#f9f9f9
,
#ececec
);
background-image
:
-o-linear-gradient
(
#f9f9f9
,
#ececec
);
background-image
:
-webkit-linear-gradient
(
#f9f9f9
,
#ececec
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
GradientType
=
0
,
startColorstr
=
'#f9f9f9'
,
endColorstr
=
'#ececec'
);
border-bottom-color
:
#dfdfdf
;
box-shadow
:
0
1px
0
#fff
;
text-shadow
:
0
1px
0
#fff
;
padding
:
5px
10px
}
.module-header
h2
{
color
:
#464646
;
font-size
:
16px
}
.module-header
a
{
text-decoration
:
none
}
.comment-title
{
background-color
:
#ececec
;
border-bottom
:
1px
solid
#dfdfdf
;
border-top
:
1px
solid
#f9f9f9
;
padding
:
3px
6px
3px
12px
}
#comments
{
height
:
462px
;
overflow
:
auto
}
.markdown-preivew
{
background-color
:
#fff
;
background-image
:
linear-gradient
(
#fff
,
#f3f3f3
);
background-image
:
-ms-linear-gradient
(
#fff
,
#f3f3f3
);
background-image
:
-o-linear-gradient
(
#fff
,
#f3f3f3
);
background-image
:
-webkit-linear-gradient
(
#fff
,
#f3f3f3
);
filter
:
progid
:
DXImageTransform
.
Microsoft
.
gradient
(
GradientType
=
0
,
startColorstr
=
'#FFFFFF'
,
endColorstr
=
'#F3F3F3'
);
border-color
:
#c0c0c0
#D9D9D9
#d9d9d9
;
border-style
:
solid
;
border-width
:
1px
;
float
:
left
;
height
:
500px
;
margin-left
:
20px
;
overflow
:
auto
;
width
:
47%
;
word-wrap
:
break-word
}
.markdown-help.ico-help
,
.markdown-help.ico-close
{
background-image
:
url("../images/icon.png")
;
background-position
:
-16px
-47px
;
cursor
:
pointer
;
float
:
right
;
height
:
17px
;
width
:
17px
}
.markdown-help.ico-close
{
height
:
16px
;
background-position
:
-48px
-16px
}
.markdown-help-main
,
.markdown-preview-main
{
color
:
#21759b
;
padding
:
0
12px
}
.markdown-help-main
dt
{
font-size
:
14px
;
font-weight
:
bold
;
margin
:
12px
0
6px
0
}
.markdown-help-main
dd
{
margin-left
:
12px
}
button
#submitArticle
{
background
:
none
repeat
scroll
0
0
#d54121
;
box-shadow
:
0
0
0
1px
#fff
inset
,
0
1px
1px
rgba
(
0
,
0
,
0
,
0.1
);
text-shadow
:
0
1px
rgba
(
0
,
0
,
0
,
0.1
);
color
:
#FFF
}
#skinsPanel
{
min-width
:
328px
;
width
:
99%
}
.skinPreview
{
cursor
:
pointer
;
height
:
160px
;
margin
:
6px
;
width
:
280px
}
.skinItem
{
background-color
:
#fafafa
;
border-radius
:
3px
;
box-shadow
:
1px
1px
3px
#333
;
line-height
:
16px
;
margin
:
24px
12px
;
padding
:
5px
;
text-align
:
center
}
#skinMain
.skinItem.selected
{
background-color
:
#d54121
}
.skinItem
:hover
{
background-color
:
#EEE
}
.f-blue
,
.error-msg
{
color
:
#36c
}
.signs
button
{
margin
:
0
12px
}
.small-head
{
float
:
left
;
height
:
35px
;
margin
:
3px
9px
0
3px
;
width
:
35px
}
#commentTable
.table-main
td
{
vertical-align
:
top
}
.about-logo
{
float
:
left
;
margin
:
62px
36px
62px
24px
}
.about-margin
{
font-size
:
20px
;
margin
:
20px
0
}
.ico-alipay-me
{
background-image
:
url("../images/alipay-me.png")
;
font-size
:
20px
;
height
:
24px
;
margin
:
20px
0
;
width
:
126px
}
.completed-input
{
margin
:
2px
12px
0
0
}
.completed-panel
{
background-color
:
#ececec
;
border
:
1px
solid
#ccc
;
color
:
#00c
;
display
:
none
;
overflow
:
auto
;
padding
:
2px
;
position
:
absolute
;
z-index
:
10
}
.completed-panel
a
{
display
:
block
;
text-decoration
:
none
}
.completed-panel
a
.selected
{
background-color
:
#fff
;
color
:
#d54121
}
.completed-ck
{
margin-top
:
9px
}
.completed-ck
span
{
background
:
url(../images/icon.png)
repeat
center
bottom
;
border
:
1px
solid
;
border-color
:
#CCc
#bbb
#A0A0A0
;
border-radius
:
4px
;
color
:
#21759b
;
cursor
:
pointer
;
float
:
left
;
height
:
28px
;
line-height
:
26px
;
margin
:
3px
6px
;
padding
:
0
6px
;
vertical-align
:
top
}
.completed-ck
span
:hover
{
border-color
:
#BBB
}
.completed-ck
span
.selected
{
color
:
#d54121
;
background
:
url(../images/bowknot/completed.png)
no-repeat
right
bottom
}
.dialog-background
{
background-color
:
#000
;
display
:
none
;
filter
:
alpha
(
opacity
=
30
);
height
:
100%
;
left
:
0
;
opacity
:
.3
;
position
:
absolute
;
top
:
0
;
width
:
100%
;
z-index
:
90
}
.dialog-panel
{
display
:
none
;
position
:
absolute
;
z-index
:
100
}
.dialog-title
{
color
:
#fff
;
float
:
left
;
font-size
:
12px
;
line-height
:
27px
;
margin-left
:
3px
}
.dialog-header-bg
{
background
:
url("../images/icon.png")
repeat
scroll
center
bottom
#f1f1f1
;
border-color
:
#c0c0c0
#D9D9D9
#d9d9d9
;
border-radius
:
6px
6px
0
0
;
border-style
:
solid
;
border-width
:
1px
1px
0
;
cursor
:
move
;
height
:
34px
}
.dialog-close-icon
{
background
:
url("../images/bowknot/dialog-close.png")
no-repeat
scroll
0
0
transparent
;
cursor
:
pointer
;
float
:
right
;
height
:
18px
;
margin-top
:
6px
;
padding
:
3px
;
width
:
22px
}
.dialog-close-icon
:hover
{
background-image
:
url("../images/bowknot/dialog-close-hover.png")
}
.dialog-main
{
background-color
:
#fff
;
border
:
2px
solid
#666
;
border-color
:
#c0c0c0
#D9D9D9
#d9d9d9
;
border-top-width
:
0
;
padding
:
12px
}
.paginate-paginate
div
,
.paginate-paginate
a
,
.paginate-pageCount
{
float
:
left
;
height
:
20px
;
line-height
:
20px
;
margin
:
0
5px
;
text-decoration
:
none
}
.pagination-pages
{
background
:
url(../images/icon.png)
repeat
center
bottom
;
border
:
1px
solid
;
border-color
:
#CCc
#bbb
#A0A0A0
;
border-radius
:
4px
;
padding
:
0
6px
;
cursor
:
pointer
;
float
:
left
;
height
:
20px
;
line-height
:
20px
;
margin
:
0
5px
}
.pagination-current-page
{
cursor
:
auto
;
font-weight
:
bold
;
border-color
:
#BBB
}
.paginate-inputPage
{
height
:
14px
;
width
:
24px
}
.table-main
{
margin
:
0
;
padding
:
0
;
position
:
relative
}
.table-main
table
{
word-break
:
break-all
;
word-wrap
:
break-word
}
.table-header
{
border
:
1px
solid
#d0d0d0
;
border-bottom
:
0
;
border-radius
:
6px
6px
0
0
}
.table-header
th
{
height
:
34px
;
line-height
:
34px
;
text-align
:
left
;
text-indent
:
6px
;
font-size
:
14px
;
font-weight
:
normal
;
background
:
url("../images/icon.png")
repeat
scroll
center
bottom
#f1f1f1
}
.table-main
td
{
border-bottom
:
1px
solid
#d0d0d0
;
color
:
#333
;
padding
:
3px
0
}
.table-lineHover
.table-hasExpend
td
{
border-bottom
:
0
}
.table-heiglight
td
,
.table-lineHover
td
{
background-color
:
#f3f3f3
;
border-right-color
:
#f3f3f3
}
.table-expendRow
td
{
padding
:
0
0
5px
36px
}
.table-expendRow
td
span
{
margin-left
:
60px
}
.table-expendRow
td
a
{
background-color
:
#999
;
border-radius
:
3px
;
color
:
#FFF
;
font-size
:
12px
;
margin-right
:
5px
;
padding
:
1px
6px
;
text-decoration
:
none
}
.table-expendRow
td
a
:hover
{
background-color
:
#BBB
}
.table-center
{
margin
:
0
auto
}
.table-upIcon
,
.table-downIcon
{
background-image
:
url("../images/icon.png")
;
cursor
:
pointer
;
float
:
left
;
height
:
16px
;
width
:
16px
;
background-position
:
-81px
-32px
}
.table-upIcon
{
background-position
:
-64px
-32px
;
margin-right
:
6px
}
.table-tag
{
color
:
#d54121
;
font-size
:
12px
;
font-style
:
italic
;
margin-left
:
10px
}
.tip-panel
{
background-color
:
#FFF
;
box-shadow
:
0
3px
10px
#8b8b8b
;
display
:
none
;
max-height
:
500px
;
max-width
:
500px
;
overflow
:
hidden
;
padding
:
3px
;
position
:
absolute
;
z-index
:
1
}
\ No newline at end of file
\ No newline at end of file
war/src/main/webapp/js/admin/article.js
View file @
886481c7
...
@@ -18,9 +18,10 @@
...
@@ -18,9 +18,10 @@
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.
0.3.3, Sep 30, 2013
* @version 1.
1.3.3, May 30, 2015
*/
*/
admin
.
article
=
{
admin
.
article
=
{
currentEditorType
:
''
,
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
isConfirm
:
true
,
isConfirm
:
true
,
status
:
{
status
:
{
...
@@ -38,7 +39,7 @@ admin.article = {
...
@@ -38,7 +39,7 @@ admin.article = {
* @param {String} id 文章 id
* @param {String} id 文章 id
* @param {Boolean} isArticle 文章或者草稿
* @param {Boolean} isArticle 文章或者草稿
*/
*/
get
:
function
(
id
,
isArticle
)
{
get
:
function
(
id
,
isArticle
)
{
this
.
status
.
id
=
id
;
this
.
status
.
id
=
id
;
this
.
status
.
isArticle
=
isArticle
;
this
.
status
.
isArticle
=
isArticle
;
admin
.
selectTab
(
"
article/article
"
);
admin
.
selectTab
(
"
article/article
"
);
...
@@ -46,14 +47,14 @@ admin.article = {
...
@@ -46,14 +47,14 @@ admin.article = {
/**
/**
* @description 获取文章内容
* @description 获取文章内容
*/
*/
getAndSet
:
function
()
{
getAndSet
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/article/
"
+
admin
.
article
.
status
.
id
,
url
:
latkeConfig
.
servePath
+
"
/console/article/
"
+
admin
.
article
.
status
.
id
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
...
@@ -64,6 +65,15 @@ admin.article = {
...
@@ -64,6 +65,15 @@ admin.article = {
$
(
"
#title
"
).
val
(
result
.
article
.
articleTitle
);
$
(
"
#title
"
).
val
(
result
.
article
.
articleTitle
);
admin
.
article
.
status
.
articleHadBeenPublished
=
result
.
article
.
articleHadBeenPublished
;
admin
.
article
.
status
.
articleHadBeenPublished
=
result
.
article
.
articleHadBeenPublished
;
if
(
admin
.
article
.
currentEditorType
!==
result
.
article
.
articleEditorType
)
{
admin
.
editors
.
articleEditor
.
remove
();
admin
.
editors
.
abstractEditor
.
remove
();
admin
.
article
.
currentEditorType
=
result
.
article
.
articleEditorType
;
admin
.
editors
.
articleEditor
.
init
(
result
.
article
.
articleEditorType
);
admin
.
editors
.
abstractEditor
.
init
(
result
.
article
.
articleEditorType
);
}
admin
.
editors
.
articleEditor
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editors
.
articleEditor
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editors
.
abstractEditor
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
editors
.
abstractEditor
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
article
.
content
=
admin
.
editors
.
articleEditor
.
getContent
();
admin
.
article
.
content
=
admin
.
editors
.
articleEditor
.
getContent
();
...
@@ -86,7 +96,7 @@ admin.article = {
...
@@ -86,7 +96,7 @@ admin.article = {
// signs
// signs
var
signs
=
result
.
article
.
signs
;
var
signs
=
result
.
article
.
signs
;
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
if
(
parseInt
(
result
.
article
.
articleSignId
)
===
parseInt
(
signs
[
i
].
oId
))
{
if
(
parseInt
(
result
.
article
.
articleSignId
)
===
parseInt
(
signs
[
i
].
oId
))
{
$
(
"
#articleSign
"
+
signs
[
i
].
oId
).
addClass
(
"
selected
"
);
$
(
"
#articleSign
"
+
signs
[
i
].
oId
).
addClass
(
"
selected
"
);
}
else
{
}
else
{
...
@@ -105,7 +115,7 @@ admin.article = {
...
@@ -105,7 +115,7 @@ admin.article = {
* @param {String} fromId 文章来自草稿夹(draft)/文件夹(article)
* @param {String} fromId 文章来自草稿夹(draft)/文件夹(article)
* @param {String} title 文章标题
* @param {String} title 文章标题
*/
*/
del
:
function
(
id
,
fromId
,
title
)
{
del
:
function
(
id
,
fromId
,
title
)
{
var
isDelete
=
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
articleLabel
+
'
"
'
+
title
+
'
"?
'
);
var
isDelete
=
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
articleLabel
+
'
"
'
+
title
+
'
"?
'
);
if
(
isDelete
)
{
if
(
isDelete
)
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
...
@@ -115,7 +125,7 @@ admin.article = {
...
@@ -115,7 +125,7 @@ admin.article = {
url
:
latkeConfig
.
servePath
+
"
/console/article/
"
+
id
,
url
:
latkeConfig
.
servePath
+
"
/console/article/
"
+
id
,
type
:
"
DELETE
"
,
type
:
"
DELETE
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
...
@@ -132,7 +142,7 @@ admin.article = {
...
@@ -132,7 +142,7 @@ admin.article = {
* @param {Boolean} articleIsPublished 文章是否发布过
* @param {Boolean} articleIsPublished 文章是否发布过
* @param {Boolean} isAuto 是否为自动保存
* @param {Boolean} isAuto 是否为自动保存
*/
*/
add
:
function
(
articleIsPublished
,
isAuto
)
{
add
:
function
(
articleIsPublished
,
isAuto
)
{
if
(
admin
.
article
.
validate
())
{
if
(
admin
.
article
.
validate
())
{
var
that
=
this
;
var
that
=
this
;
that
.
_addDisabled
();
that
.
_addDisabled
();
...
@@ -140,7 +150,7 @@ admin.article = {
...
@@ -140,7 +150,7 @@ admin.article = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
signId
=
""
;
var
signId
=
""
;
$
(
"
.signs button
"
).
each
(
function
()
{
$
(
"
.signs button
"
).
each
(
function
()
{
if
(
this
.
className
===
"
selected
"
)
{
if
(
this
.
className
===
"
selected
"
)
{
signId
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
);
signId
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
);
}
}
...
@@ -169,7 +179,7 @@ admin.article = {
...
@@ -169,7 +179,7 @@ admin.article = {
type
:
"
POST
"
,
type
:
"
POST
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
if
(
isAuto
)
{
if
(
isAuto
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
admin
.
article
.
status
.
id
=
result
.
oId
;
admin
.
article
.
status
.
id
=
result
.
oId
;
...
@@ -190,7 +200,7 @@ admin.article = {
...
@@ -190,7 +200,7 @@ admin.article = {
admin
.
article
.
isConfirm
=
false
;
admin
.
article
.
isConfirm
=
false
;
},
},
complete
:
function
(
jqXHR
,
textStatus
)
{
complete
:
function
(
jqXHR
,
textStatus
)
{
that
.
_removeDisabled
();
that
.
_removeDisabled
();
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
if
(
jqXHR
.
status
===
403
)
{
if
(
jqXHR
.
status
===
403
)
{
...
@@ -206,7 +216,7 @@ admin.article = {
...
@@ -206,7 +216,7 @@ admin.article = {
* @param {Boolean} articleIsPublished 文章是否发布过
* @param {Boolean} articleIsPublished 文章是否发布过
* @param {Boolean} isAuto 是否为自动保存
* @param {Boolean} isAuto 是否为自动保存
*/
*/
update
:
function
(
articleIsPublished
,
isAuto
)
{
update
:
function
(
articleIsPublished
,
isAuto
)
{
if
(
admin
.
article
.
validate
())
{
if
(
admin
.
article
.
validate
())
{
var
that
=
this
;
var
that
=
this
;
that
.
_addDisabled
();
that
.
_addDisabled
();
...
@@ -214,7 +224,7 @@ admin.article = {
...
@@ -214,7 +224,7 @@ admin.article = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
signId
=
""
;
var
signId
=
""
;
$
(
"
.signs button
"
).
each
(
function
()
{
$
(
"
.signs button
"
).
each
(
function
()
{
if
(
this
.
className
===
"
selected
"
)
{
if
(
this
.
className
===
"
selected
"
)
{
signId
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
);
signId
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
);
}
}
...
@@ -235,7 +245,8 @@ admin.article = {
...
@@ -235,7 +245,8 @@ admin.article = {
"
articleSignId
"
:
signId
,
"
articleSignId
"
:
signId
,
"
articleCommentable
"
:
$
(
"
#articleCommentable
"
).
prop
(
"
checked
"
),
"
articleCommentable
"
:
$
(
"
#articleCommentable
"
).
prop
(
"
checked
"
),
"
articleViewPwd
"
:
$
(
"
#viewPwd
"
).
val
(),
"
articleViewPwd
"
:
$
(
"
#viewPwd
"
).
val
(),
"
postToCommunity
"
:
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
)
"
postToCommunity
"
:
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
),
"
articleEditorType
"
:
admin
.
article
.
currentEditorType
}
}
};
};
...
@@ -244,7 +255,7 @@ admin.article = {
...
@@ -244,7 +255,7 @@ admin.article = {
type
:
"
PUT
"
,
type
:
"
PUT
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
if
(
isAuto
)
{
if
(
isAuto
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
return
;
return
;
...
@@ -266,7 +277,7 @@ admin.article = {
...
@@ -266,7 +277,7 @@ admin.article = {
admin
.
article
.
status
.
id
=
undefined
;
admin
.
article
.
status
.
id
=
undefined
;
admin
.
article
.
isConfirm
=
false
;
admin
.
article
.
isConfirm
=
false
;
},
},
complete
:
function
(
jqXHR
,
textStatus
)
{
complete
:
function
(
jqXHR
,
textStatus
)
{
that
.
_removeDisabled
();
that
.
_removeDisabled
();
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
if
(
jqXHR
.
status
===
403
)
{
if
(
jqXHR
.
status
===
403
)
{
...
@@ -280,7 +291,7 @@ admin.article = {
...
@@ -280,7 +291,7 @@ admin.article = {
/**
/**
* @description 发布文章页面设置文章按钮、发布到社区等状态的显示
* @description 发布文章页面设置文章按钮、发布到社区等状态的显示
*/
*/
setStatus
:
function
()
{
setStatus
:
function
()
{
// set button status
// set button status
if
(
this
.
status
)
{
if
(
this
.
status
)
{
if
(
this
.
status
.
isArticle
)
{
if
(
this
.
status
.
isArticle
)
{
...
@@ -306,7 +317,7 @@ admin.article = {
...
@@ -306,7 +317,7 @@ admin.article = {
/**
/**
* @description 清除发布文章页面的输入框的内容
* @description 清除发布文章页面的输入框的内容
*/
*/
clear
:
function
()
{
clear
:
function
()
{
this
.
status
=
{
this
.
status
=
{
id
:
undefined
,
id
:
undefined
,
isArticle
:
undefined
,
isArticle
:
undefined
,
...
@@ -326,7 +337,7 @@ admin.article = {
...
@@ -326,7 +337,7 @@ admin.article = {
$
(
"
#permalink
"
).
val
(
""
);
$
(
"
#permalink
"
).
val
(
""
);
$
(
"
#articleCammentable
"
).
prop
(
"
checked
"
,
true
);
$
(
"
#articleCammentable
"
).
prop
(
"
checked
"
,
true
);
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
,
true
);
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
,
true
);
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
if
(
i
===
0
)
{
if
(
i
===
0
)
{
this
.
className
=
"
selected
"
;
this
.
className
=
"
selected
"
;
}
else
{
}
else
{
...
@@ -340,20 +351,21 @@ admin.article = {
...
@@ -340,20 +351,21 @@ admin.article = {
* @description 初始化发布文章页面
* @description 初始化发布文章页面
* @param {Function} fun 切面函数
* @param {Function} fun 切面函数
*/
*/
init
:
function
(
fun
)
{
init
:
function
(
fun
)
{
this
.
currentEditorType
=
Label
.
editorType
;
// Inits Signs.
// Inits Signs.
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/signs/
"
,
url
:
latkeConfig
.
servePath
+
"
/console/signs/
"
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
// Sets signs.
// Sets signs.
if
(
i
===
result
.
signs
.
length
)
{
if
(
i
===
result
.
signs
.
length
)
{
$
(
"
#articleSign1
"
).
addClass
(
"
selected
"
);
$
(
"
#articleSign1
"
).
addClass
(
"
selected
"
);
...
@@ -365,9 +377,9 @@ admin.article = {
...
@@ -365,9 +377,9 @@ admin.article = {
});
});
}
}
// Binds checkbox event.
// Binds checkbox event.
$
(
this
).
click
(
function
()
{
$
(
this
).
click
(
function
()
{
if
(
this
.
className
!==
"
selected
"
)
{
if
(
this
.
className
!==
"
selected
"
)
{
$
(
"
.signs button
"
).
each
(
function
()
{
$
(
"
.signs button
"
).
each
(
function
()
{
this
.
className
=
""
;
this
.
className
=
""
;
});
});
this
.
className
=
"
selected
"
;
this
.
className
=
"
selected
"
;
...
@@ -384,7 +396,7 @@ admin.article = {
...
@@ -384,7 +396,7 @@ admin.article = {
url
:
latkeConfig
.
servePath
+
"
/console/tags
"
,
url
:
latkeConfig
.
servePath
+
"
/console/tags
"
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
...
@@ -411,7 +423,7 @@ admin.article = {
...
@@ -411,7 +423,7 @@ admin.article = {
});
});
// submit action
// submit action
$
(
"
#submitArticle
"
).
click
(
function
()
{
$
(
"
#submitArticle
"
).
click
(
function
()
{
if
(
admin
.
article
.
status
.
id
)
{
if
(
admin
.
article
.
status
.
id
)
{
admin
.
article
.
update
(
true
);
admin
.
article
.
update
(
true
);
}
else
{
}
else
{
...
@@ -419,7 +431,7 @@ admin.article = {
...
@@ -419,7 +431,7 @@ admin.article = {
}
}
});
});
$
(
"
#saveArticle
"
).
click
(
function
()
{
$
(
"
#saveArticle
"
).
click
(
function
()
{
if
(
admin
.
article
.
status
.
id
)
{
if
(
admin
.
article
.
status
.
id
)
{
admin
.
article
.
update
(
admin
.
article
.
status
.
isArticle
);
admin
.
article
.
update
(
admin
.
article
.
status
.
isArticle
);
}
else
{
}
else
{
...
@@ -442,14 +454,14 @@ admin.article = {
...
@@ -442,14 +454,14 @@ admin.article = {
});
});
admin
.
article
.
clearDraftTimer
();
admin
.
article
.
clearDraftTimer
();
admin
.
article
.
autoSaveDraftTimer
=
setInterval
(
function
()
{
admin
.
article
.
autoSaveDraftTimer
=
setInterval
(
function
()
{
admin
.
article
.
_autoSaveToDraft
();
admin
.
article
.
_autoSaveToDraft
();
},
admin
.
article
.
AUTOSAVETIME
);
},
admin
.
article
.
AUTOSAVETIME
);
},
},
/**
/**
* @description 自动保存草稿件
* @description 自动保存草稿件
*/
*/
_autoSaveToDraft
:
function
()
{
_autoSaveToDraft
:
function
()
{
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
||
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
||
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
===
""
||
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
===
""
||
$
(
"
#tag
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tag
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
...
@@ -467,7 +479,7 @@ admin.article = {
...
@@ -467,7 +479,7 @@ admin.article = {
/**
/**
* @description 关闭定时器
* @description 关闭定时器
*/
*/
clearDraftTimer
:
function
()
{
clearDraftTimer
:
function
()
{
if
(
admin
.
article
.
autoSaveDraftTimer
!==
""
)
{
if
(
admin
.
article
.
autoSaveDraftTimer
!==
""
)
{
window
.
clearInterval
(
admin
.
article
.
autoSaveDraftTimer
);
window
.
clearInterval
(
admin
.
article
.
autoSaveDraftTimer
);
admin
.
article
.
autoSaveDraftTimer
=
""
;
admin
.
article
.
autoSaveDraftTimer
=
""
;
...
@@ -476,7 +488,7 @@ admin.article = {
...
@@ -476,7 +488,7 @@ admin.article = {
/**
/**
* @description 验证发布文章字段的合法性
* @description 验证发布文章字段的合法性
*/
*/
validate
:
function
()
{
validate
:
function
()
{
var
articleContent
=
admin
.
editors
.
articleEditor
.
getContent
();
var
articleContent
=
admin
.
editors
.
articleEditor
.
getContent
();
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
...
@@ -496,14 +508,14 @@ admin.article = {
...
@@ -496,14 +508,14 @@ admin.article = {
* @description 取消发布
* @description 取消发布
* @param {Boolean} isAuto 是否为自动保存
* @param {Boolean} isAuto 是否为自动保存
*/
*/
unPublish
:
function
(
isAuto
)
{
unPublish
:
function
(
isAuto
)
{
var
that
=
this
;
var
that
=
this
;
that
.
_addDisabled
();
that
.
_addDisabled
();
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/article/unpublish/
"
+
admin
.
article
.
status
.
id
,
url
:
latkeConfig
.
servePath
+
"
/console/article/unpublish/
"
+
admin
.
article
.
status
.
id
,
type
:
"
PUT
"
,
type
:
"
PUT
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
if
(
isAuto
)
{
if
(
isAuto
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
return
;
return
;
...
@@ -518,7 +530,7 @@ admin.article = {
...
@@ -518,7 +530,7 @@ admin.article = {
admin
.
article
.
status
.
id
=
undefined
;
admin
.
article
.
status
.
id
=
undefined
;
admin
.
article
.
isConfirm
=
false
;
admin
.
article
.
isConfirm
=
false
;
},
},
complete
:
function
(
jqXHR
,
textStatus
)
{
complete
:
function
(
jqXHR
,
textStatus
)
{
that
.
_removeDisabled
();
that
.
_removeDisabled
();
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
if
(
jqXHR
.
status
===
403
)
{
if
(
jqXHR
.
status
===
403
)
{
...
@@ -533,7 +545,7 @@ admin.article = {
...
@@ -533,7 +545,7 @@ admin.article = {
* @param {String} str 被解析的字符串
* @param {String} str 被解析的字符串
* @returns {String} 无重复的字符串
* @returns {String} 无重复的字符串
*/
*/
trimUniqueArray
:
function
(
str
)
{
trimUniqueArray
:
function
(
str
)
{
str
=
str
.
toString
();
str
=
str
.
toString
();
var
arr
=
str
.
split
(
"
,
"
);
var
arr
=
str
.
split
(
"
,
"
);
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
...
@@ -549,7 +561,7 @@ admin.article = {
...
@@ -549,7 +561,7 @@ admin.article = {
/**
/**
* @description 点击发文文章时的处理
* @description 点击发文文章时的处理
*/
*/
prePost
:
function
()
{
prePost
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
admin
.
article
.
content
=
""
;
admin
.
article
.
content
=
""
;
if
(
!
admin
.
editors
.
articleEditor
.
getContent
)
{
if
(
!
admin
.
editors
.
articleEditor
.
getContent
)
{
...
@@ -566,11 +578,20 @@ admin.article = {
...
@@ -566,11 +578,20 @@ admin.article = {
}
}
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
if
(
admin
.
article
.
currentEditorType
!==
Label
.
editorType
)
{
admin
.
editors
.
articleEditor
.
remove
();
admin
.
editors
.
abstractEditor
.
remove
();
admin
.
article
.
currentEditorType
=
Label
.
editorType
;
admin
.
editors
.
articleEditor
.
init
(
Label
.
editorType
);
admin
.
editors
.
abstractEditor
.
init
(
Label
.
editorType
);
}
},
},
/**
/**
* @description: 仿重复提交,点击一次后,按钮设置为 disabled
* @description: 仿重复提交,点击一次后,按钮设置为 disabled
*/
*/
_addDisabled
:
function
()
{
_addDisabled
:
function
()
{
$
(
"
#unSubmitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#unSubmitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#saveArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#saveArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#submitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#submitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
...
@@ -578,7 +599,7 @@ admin.article = {
...
@@ -578,7 +599,7 @@ admin.article = {
/**
/**
* @description: 仿重复提交,当后台有数据返回后,按钮移除 disabled 状态
* @description: 仿重复提交,当后台有数据返回后,按钮移除 disabled 状态
*/
*/
_removeDisabled
:
function
()
{
_removeDisabled
:
function
()
{
$
(
"
#unSubmitArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#unSubmitArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#saveArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#saveArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#submitArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#submitArticle
"
).
removeAttr
(
"
disabled
"
);
...
@@ -591,7 +612,9 @@ admin.article = {
...
@@ -591,7 +612,9 @@ admin.article = {
admin
.
register
.
article
=
{
admin
.
register
.
article
=
{
"
obj
"
:
admin
.
article
,
"
obj
"
:
admin
.
article
,
"
init
"
:
admin
.
article
.
init
,
"
init
"
:
admin
.
article
.
init
,
"
refresh
"
:
function
()
{
"
refresh
"
:
function
()
{
admin
.
editors
.
abstractEditor
.
setContent
(
''
);
admin
.
editors
.
articleEditor
.
setContent
(
''
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
}
}
...
...
war/src/main/webapp/js/admin/editor.js
View file @
886481c7
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
* @fileoverview editor
* @fileoverview editor
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.
0.0.4, Jan 29, 2013
* @version 1.
1.0.4, May 30, 2015
*/
*/
admin
.
editors
=
{};
admin
.
editors
=
{};
...
@@ -52,21 +52,23 @@ $.extend(Editor.prototype, {
...
@@ -52,21 +52,23 @@ $.extend(Editor.prototype, {
_init
:
function
()
{
_init
:
function
()
{
this
.
init
();
this
.
init
();
},
},
/*
/*
* @description 初始化编辑器
* @description 初始化编辑器
*/
*/
init
:
function
()
{
init
:
function
(
type
)
{
var
conf
=
this
.
conf
;
var
conf
=
this
.
conf
;
if
(
type
)
{
conf
.
type
=
type
;
}
var
types
=
conf
.
type
.
split
(
"
-
"
);
var
types
=
conf
.
type
.
split
(
"
-
"
);
if
(
types
.
length
===
2
)
{
if
(
types
.
length
===
2
)
{
conf
.
codeMirrorLanguage
=
types
[
1
];
conf
.
codeMirrorLanguage
=
types
[
1
];
conf
.
type
=
types
[
0
];
conf
.
type
=
types
[
0
];
}
}
admin
.
editors
[
conf
.
type
].
init
(
conf
);
admin
.
editors
[
conf
.
type
].
init
(
conf
);
},
},
/*
/*
* @description 获取编辑器值
* @description 获取编辑器值
* @returns {string} 编辑器值
* @returns {string} 编辑器值
...
@@ -75,7 +77,6 @@ $.extend(Editor.prototype, {
...
@@ -75,7 +77,6 @@ $.extend(Editor.prototype, {
var
conf
=
this
.
conf
;
var
conf
=
this
.
conf
;
return
admin
.
editors
[
conf
.
type
].
getContent
(
conf
.
id
);
return
admin
.
editors
[
conf
.
type
].
getContent
(
conf
.
id
);
},
},
/*
/*
* @description 设置编辑器值
* @description 设置编辑器值
* @param {string} content 编辑器回填内容
* @param {string} content 编辑器回填内容
...
@@ -83,6 +84,13 @@ $.extend(Editor.prototype, {
...
@@ -83,6 +84,13 @@ $.extend(Editor.prototype, {
setContent
:
function
(
content
)
{
setContent
:
function
(
content
)
{
var
conf
=
this
.
conf
;
var
conf
=
this
.
conf
;
admin
.
editors
[
conf
.
type
].
setContent
(
conf
.
id
,
content
);
admin
.
editors
[
conf
.
type
].
setContent
(
conf
.
id
,
content
);
},
/*
* @description 移除编辑器值
*/
remove
:
function
()
{
var
conf
=
this
.
conf
;
admin
.
editors
[
conf
.
type
].
remove
(
conf
.
id
);
}
}
});
});
...
...
war/src/main/webapp/js/admin/editorCodeMirror.js
View file @
886481c7
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
* @fileoverview markdowm CodeMirror editor
* @fileoverview markdowm CodeMirror editor
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.
0.0.4, May 30, 2013
* @version 1.
1.0.4, May 30, 2015
*/
*/
admin
.
editors
.
CodeMirror
=
{
admin
.
editors
.
CodeMirror
=
{
/*
/*
...
@@ -32,19 +32,19 @@ admin.editors.CodeMirror = {
...
@@ -32,19 +32,19 @@ admin.editors.CodeMirror = {
*/
*/
init
:
function
(
conf
)
{
init
:
function
(
conf
)
{
var
it
=
this
;
var
it
=
this
;
// load preview and clear
// load preview and clear
var
previewHTML
=
"
<div class='clear'></div>
"
;
var
previewHTML
=
"
<div class='clear'></div>
"
;
if
(
conf
.
kind
!==
"
simple
"
)
{
if
(
conf
.
kind
!==
"
simple
"
)
{
previewHTML
=
"
<div class='markdown-preivew'>
"
+
previewHTML
=
"
<div class='markdown-preivew'>
"
+
"
<div class='markdown-help ico-close'></div>
"
+
"
<div class='markdown-help ico-close'></div>
"
+
"
<div class='clear'></div>
"
+
"
<div class='clear'></div>
"
+
"
<div class='markdown-preview-main none'></div>
"
+
"
<div class='markdown-preview-main none'></div>
"
+
"
<div class='markdown-help-main'>
"
+
Label
.
markdownHelpLabel
+
"
</div>
"
"
<div class='markdown-help-main'>
"
+
Label
.
markdownHelpLabel
+
"
</div>
"
+
"
</div><div class='clear'></div>
"
;
+
"
</div><div class='clear'></div>
"
;
}
}
$
(
"
#
"
+
conf
.
id
).
after
(
previewHTML
);
$
(
"
#
"
+
conf
.
id
).
after
(
previewHTML
);
// init codemirror
// init codemirror
if
(
conf
.
kind
===
"
simple
"
)
{
if
(
conf
.
kind
===
"
simple
"
)
{
this
[
conf
.
id
]
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
conf
.
id
),
{
this
[
conf
.
id
]
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
conf
.
id
),
{
...
@@ -57,12 +57,12 @@ admin.editors.CodeMirror = {
...
@@ -57,12 +57,12 @@ admin.editors.CodeMirror = {
}
else
{
}
else
{
// preview 执行队列
// preview 执行队列
it
[
conf
.
id
+
"
Timers
"
]
=
[];
it
[
conf
.
id
+
"
Timers
"
]
=
[];
// 该编辑器是否第一次触发 preivew 事件
// 该编辑器是否第一次触发 preivew 事件
it
[
conf
.
id
+
"
IsFirst
"
]
=
true
;
it
[
conf
.
id
+
"
IsFirst
"
]
=
true
;
var
$preview
=
$
(
"
#
"
+
conf
.
id
).
parent
().
find
(
"
.markdown-preivew
"
),
var
$preview
=
$
(
"
#
"
+
conf
.
id
).
parent
().
find
(
"
.markdown-preivew
"
),
$help
=
$
(
"
#
"
+
conf
.
id
).
parent
().
find
(
"
.markdown-preivew
"
).
find
(
"
.markdown-help
"
);
$help
=
$
(
"
#
"
+
conf
.
id
).
parent
().
find
(
"
.markdown-preivew
"
).
find
(
"
.markdown-help
"
);
this
[
conf
.
id
]
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
conf
.
id
),
{
this
[
conf
.
id
]
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
conf
.
id
),
{
mode
:
'
markdown
'
,
mode
:
'
markdown
'
,
lineNumbers
:
true
,
lineNumbers
:
true
,
...
@@ -74,19 +74,19 @@ admin.editors.CodeMirror = {
...
@@ -74,19 +74,19 @@ admin.editors.CodeMirror = {
if
(
it
[
conf
.
id
].
getValue
()
===
""
)
{
if
(
it
[
conf
.
id
].
getValue
()
===
""
)
{
return
;
return
;
}
}
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/markdown/2html
"
,
url
:
latkeConfig
.
servePath
+
"
/console/markdown/2html
"
,
type
:
"
POST
"
,
type
:
"
POST
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
({
markdownText
:
it
[
conf
.
id
].
getValue
()}),
data
:
JSON
.
stringify
({
markdownText
:
it
[
conf
.
id
].
getValue
()}),
success
:
function
(
data
,
textStatus
)
{
success
:
function
(
data
,
textStatus
)
{
if
(
data
.
sc
)
{
if
(
data
.
sc
)
{
if
(
it
[
conf
.
id
+
"
IsFirst
"
]
&&
$help
.
hasClass
(
"
ico-close
"
))
{
if
(
it
[
conf
.
id
+
"
IsFirst
"
]
&&
$help
.
hasClass
(
"
ico-close
"
))
{
$help
.
click
();
$help
.
click
();
}
}
it
[
conf
.
id
+
"
IsFirst
"
]
=
false
;
it
[
conf
.
id
+
"
IsFirst
"
]
=
false
;
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
data
.
html
);
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
data
.
html
);
}
else
{
}
else
{
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
data
.
msg
);
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
data
.
msg
);
...
@@ -94,14 +94,14 @@ admin.editors.CodeMirror = {
...
@@ -94,14 +94,14 @@ admin.editors.CodeMirror = {
}
}
});
});
}
}
it
[
conf
.
id
+
"
Timers
"
].
push
(
update
);
it
[
conf
.
id
+
"
Timers
"
].
push
(
update
);
}
}
});
});
this
.
_callPreview
(
conf
.
id
,
it
[
conf
.
id
+
"
Timers
"
]);
this
.
_callPreview
(
conf
.
id
,
it
[
conf
.
id
+
"
Timers
"
]);
}
}
if
(
conf
.
kind
===
"
simple
"
)
{
if
(
conf
.
kind
===
"
simple
"
)
{
// 摘要不需要 preview,设置其宽度
// 摘要不需要 preview,设置其宽度
$
(
"
#
"
+
conf
.
id
).
next
().
width
(
"
99%
"
);
$
(
"
#
"
+
conf
.
id
).
next
().
width
(
"
99%
"
);
...
@@ -109,13 +109,12 @@ admin.editors.CodeMirror = {
...
@@ -109,13 +109,12 @@ admin.editors.CodeMirror = {
// 有 preview 时,绑定 preview 事件
// 有 preview 时,绑定 preview 事件
this
.
_bindEvent
(
conf
.
id
);
this
.
_bindEvent
(
conf
.
id
);
}
}
// after render, call back function
// after render, call back function
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
conf
.
fun
();
conf
.
fun
();
}
}
},
},
/*
/*
* @description 当有更新时每隔3秒 preview
* @description 当有更新时每隔3秒 preview
* @param {string} id 编辑器 id
* @param {string} id 编辑器 id
...
@@ -128,14 +127,13 @@ admin.editors.CodeMirror = {
...
@@ -128,14 +127,13 @@ admin.editors.CodeMirror = {
admin
.
editors
.
CodeMirror
[
id
+
"
Timers
"
]
=
[];
admin
.
editors
.
CodeMirror
[
id
+
"
Timers
"
]
=
[];
},
2000
);
},
2000
);
},
},
/*
/*
* @description 绑定编辑器 preview 事件
* @description 绑定编辑器 preview 事件
* @param {string} id 编辑器id
* @param {string} id 编辑器id
*/
*/
_bindEvent
:
function
(
id
)
{
_bindEvent
:
function
(
id
)
{
var
$preview
=
$
(
"
#
"
+
id
).
parent
().
find
(
"
.markdown-preivew
"
);
var
$preview
=
$
(
"
#
"
+
id
).
parent
().
find
(
"
.markdown-preivew
"
);
$preview
.
find
(
"
.markdown-help
"
).
click
(
function
()
{
$preview
.
find
(
"
.markdown-help
"
).
click
(
function
()
{
var
$it
=
$
(
this
);
var
$it
=
$
(
this
);
if
(
$it
.
hasClass
(
"
ico-help
"
))
{
if
(
$it
.
hasClass
(
"
ico-help
"
))
{
...
@@ -149,7 +147,6 @@ admin.editors.CodeMirror = {
...
@@ -149,7 +147,6 @@ admin.editors.CodeMirror = {
}
}
});
});
},
},
/*
/*
* @description 获取编辑器值
* @description 获取编辑器值
* @param {string} id 编辑器id
* @param {string} id 编辑器id
...
@@ -158,7 +155,6 @@ admin.editors.CodeMirror = {
...
@@ -158,7 +155,6 @@ admin.editors.CodeMirror = {
getContent
:
function
(
id
)
{
getContent
:
function
(
id
)
{
return
this
[
id
].
getValue
();
return
this
[
id
].
getValue
();
},
},
/*
/*
* @description 设置编辑器值
* @description 设置编辑器值
* @param {string} id 编辑器 id
* @param {string} id 编辑器 id
...
@@ -166,5 +162,15 @@ admin.editors.CodeMirror = {
...
@@ -166,5 +162,15 @@ admin.editors.CodeMirror = {
*/
*/
setContent
:
function
(
id
,
content
)
{
setContent
:
function
(
id
,
content
)
{
this
[
id
].
setValue
(
content
);
this
[
id
].
setValue
(
content
);
var
$preview
=
$
(
"
#
"
+
id
).
parent
().
find
(
"
.markdown-preivew
"
);
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
content
);
},
/*
* @description 销毁编辑器值
* @param {string} id 编辑器 id
*/
remove
:
function
(
id
)
{
this
[
id
].
toTextArea
();
$
(
"
.markdown-preivew
"
).
remove
();
}
}
};
};
\ No newline at end of file
war/src/main/webapp/js/admin/editorKindEditor.js
View file @
886481c7
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
* plugins/media/media.js 注释 26 & 28
* plugins/media/media.js 注释 26 & 28
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.
0.0.2, Jun 19, 2012
* @version 1.
1.0.2, May 30, 2015
*/
*/
admin
.
editors
.
KindEditor
=
{
admin
.
editors
.
KindEditor
=
{
/*
/*
...
@@ -33,15 +33,15 @@ admin.editors.KindEditor = {
...
@@ -33,15 +33,15 @@ admin.editors.KindEditor = {
var
language
=
"
zh_CN
"
;
var
language
=
"
zh_CN
"
;
if
(
"
en_US
"
===
Label
.
localeString
)
{
if
(
"
en_US
"
===
Label
.
localeString
)
{
language
=
"
en
"
language
=
"
en
"
}
}
if
(
conf
.
kind
&&
conf
.
kind
===
"
simple
"
)
{
if
(
conf
.
kind
&&
conf
.
kind
===
"
simple
"
)
{
try
{
try
{
this
[
conf
.
id
]
=
KindEditor
.
create
(
'
#
'
+
conf
.
id
,
{
this
[
conf
.
id
]
=
KindEditor
.
create
(
'
#
'
+
conf
.
id
,
{
langType
:
language
,
langType
:
language
,
resizeType
:
0
,
resizeType
:
0
,
items
:
[
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
strikethrough
"
,
"
|
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
items
:
[
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
strikethrough
"
,
"
|
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
"
insertunorderedlist
"
,
"
insertorderedlist
"
,
"
|
"
,
"
source
"
"
insertunorderedlist
"
,
"
insertorderedlist
"
,
"
|
"
,
"
source
"
]
]
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -50,15 +50,15 @@ admin.editors.KindEditor = {
...
@@ -50,15 +50,15 @@ admin.editors.KindEditor = {
}
else
{
}
else
{
try
{
try
{
this
[
conf
.
id
]
=
KindEditor
.
create
(
'
#
'
+
conf
.
id
,
{
this
[
conf
.
id
]
=
KindEditor
.
create
(
'
#
'
+
conf
.
id
,
{
langType
:
language
,
langType
:
language
,
items
:
[
"
formatblock
"
,
"
fontname
"
,
"
fontsize
"
,
"
|
"
,
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
strikethrough
"
,
"
forecolor
"
,
"
|
"
,
items
:
[
"
formatblock
"
,
"
fontname
"
,
"
fontsize
"
,
"
|
"
,
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
strikethrough
"
,
"
forecolor
"
,
"
|
"
,
"
link
"
,
"
unlink
"
,
"
image
"
,
"
media
"
,
"
|
"
,
"
pagebreak
"
,
"
emoticons
"
,
"
code
"
,
"
/
"
,
"
link
"
,
"
unlink
"
,
"
image
"
,
"
media
"
,
"
|
"
,
"
pagebreak
"
,
"
emoticons
"
,
"
code
"
,
"
/
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
"
insertunorderedlist
"
,
"
insertorderedlist
"
,
"
indent
"
,
"
outdent
"
,
"
|
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
"
insertunorderedlist
"
,
"
insertorderedlist
"
,
"
indent
"
,
"
outdent
"
,
"
|
"
,
"
justifyleft
"
,
"
justifycenter
"
,
"
justifyright
"
,
"
justifyfull
"
,
"
|
"
,
"
plainpaste
"
,
"
wordpaste
"
,
"
|
"
,
"
justifyleft
"
,
"
justifycenter
"
,
"
justifyright
"
,
"
justifyfull
"
,
"
|
"
,
"
plainpaste
"
,
"
wordpaste
"
,
"
|
"
,
"
clearhtml
"
,
"
source
"
,
"
preview
"
"
clearhtml
"
,
"
source
"
,
"
preview
"
],
],
afterCreate
:
function
()
{
afterCreate
:
function
()
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
conf
.
fun
();
conf
.
fun
();
}
}
}
}
...
@@ -68,7 +68,6 @@ admin.editors.KindEditor = {
...
@@ -68,7 +68,6 @@ admin.editors.KindEditor = {
}
}
}
}
},
},
/*
/*
* @description 获取编辑器值
* @description 获取编辑器值
* @param {string} id 编辑器id
* @param {string} id 编辑器id
...
@@ -83,7 +82,6 @@ admin.editors.KindEditor = {
...
@@ -83,7 +82,6 @@ admin.editors.KindEditor = {
}
}
return
content
;
return
content
;
},
},
/*
/*
* @description 设置编辑器值
* @description 设置编辑器值
* @param {string} id 编辑器 id
* @param {string} id 编辑器 id
...
@@ -95,5 +93,12 @@ admin.editors.KindEditor = {
...
@@ -95,5 +93,12 @@ admin.editors.KindEditor = {
}
catch
(
e
)
{
}
catch
(
e
)
{
$
(
"
#
"
+
id
).
val
(
content
);
$
(
"
#
"
+
id
).
val
(
content
);
}
}
},
/*
* @description 移除编辑器
* @param {string} id 编辑器 id
*/
remove
:
function
(
id
)
{
this
[
id
].
remove
();
}
}
};
};
war/src/main/webapp/js/admin/editorTinyMCE.js
View file @
886481c7
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
* @fileoverview tinyMCE editor
* @fileoverview tinyMCE editor
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.
0.0.6, Sep 26, 2012
* @version 1.
1.0.6, May 30, 2015
*/
*/
admin
.
editors
.
tinyMCE
=
{
admin
.
editors
.
tinyMCE
=
{
/*
/*
...
@@ -32,25 +32,23 @@ admin.editors.tinyMCE = {
...
@@ -32,25 +32,23 @@ admin.editors.tinyMCE = {
if
(
language
===
"
zh
"
)
{
if
(
language
===
"
zh
"
)
{
language
=
"
zh-cn
"
;
language
=
"
zh-cn
"
;
}
}
if
(
conf
.
kind
&&
conf
.
kind
===
"
simple
"
)
{
if
(
conf
.
kind
&&
conf
.
kind
===
"
simple
"
)
{
try
{
try
{
tinyMCE
.
init
({
tinyMCE
.
init
({
// General options
// General options
language
:
language
,
language
:
language
,
mode
:
"
exact
"
,
mode
:
"
exact
"
,
elements
:
conf
.
id
,
elements
:
conf
.
id
,
theme
:
"
advanced
"
,
theme
:
"
advanced
"
,
plugins
:
"
media
"
,
plugins
:
"
media
"
,
// Theme options
// Theme options
theme_advanced_buttons1
:
"
bold,italic,underline,strikethrough,|,undo,redo,|,bullist,numlist,|,code
"
,
theme_advanced_buttons1
:
"
bold,italic,underline,strikethrough,|,undo,redo,|,bullist,numlist,|,code
"
,
theme_advanced_buttons2
:
""
,
theme_advanced_buttons2
:
""
,
theme_advanced_buttons3
:
""
,
theme_advanced_buttons3
:
""
,
theme_advanced_toolbar_location
:
"
top
"
,
theme_advanced_toolbar_location
:
"
top
"
,
theme_advanced_toolbar_align
:
"
left
"
,
theme_advanced_toolbar_align
:
"
left
"
,
valid_children
:
"
+body[style]
"
valid_children
:
"
+body[style]
"
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
$
(
"
#tipMsg
"
).
text
(
"
TinyMCE load fail
"
);
$
(
"
#tipMsg
"
).
text
(
"
TinyMCE load fail
"
);
...
@@ -60,27 +58,24 @@ admin.editors.tinyMCE = {
...
@@ -60,27 +58,24 @@ admin.editors.tinyMCE = {
tinyMCE
.
init
({
tinyMCE
.
init
({
// General options
// General options
language
:
language
,
language
:
language
,
mode
:
"
exact
"
,
mode
:
"
exact
"
,
elements
:
conf
.
id
,
elements
:
conf
.
id
,
theme
:
"
advanced
"
,
theme
:
"
advanced
"
,
plugins
:
"
autosave,style,advhr,advimage,advlink,preview,inlinepopups,media,paste,syntaxhl,wordcount
"
,
plugins
:
"
autosave,style,advhr,advimage,advlink,preview,inlinepopups,media,paste,syntaxhl,wordcount
"
,
// Theme options
// Theme options
theme_advanced_buttons1
:
"
formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,forecolor,|,advhr,blockquote,syntaxhl,
"
,
theme_advanced_buttons1
:
"
formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,forecolor,|,advhr,blockquote,syntaxhl,
"
,
theme_advanced_buttons2
:
"
undo,redo,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,pastetext,pasteword,|,link,unlink,image,iespell,media,|,cleanup,code,preview,
"
,
theme_advanced_buttons2
:
"
undo,redo,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,pastetext,pasteword,|,link,unlink,image,iespell,media,|,cleanup,code,preview,
"
,
theme_advanced_buttons3
:
""
,
theme_advanced_buttons3
:
""
,
theme_advanced_toolbar_location
:
"
top
"
,
theme_advanced_toolbar_location
:
"
top
"
,
theme_advanced_toolbar_align
:
"
left
"
,
theme_advanced_toolbar_align
:
"
left
"
,
theme_advanced_resizing
:
true
,
theme_advanced_resizing
:
true
,
theme_advanced_statusbar_location
:
"
bottom
"
,
theme_advanced_statusbar_location
:
"
bottom
"
,
extended_valid_elements
:
"
link[type|rel|href|charset],pre[name|class],iframe[src|width|height|name|align],+a[*]
"
,
extended_valid_elements
:
"
link[type|rel|href|charset],pre[name|class],iframe[src|width|height|name|align],+a[*]
"
,
valid_children
:
"
+body[style]
"
,
valid_children
:
"
+body[style]
"
,
relative_urls
:
false
,
relative_urls
:
false
,
remove_script_host
:
false
,
remove_script_host
:
false
,
oninit
:
function
()
{
oninit
:
function
()
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
conf
.
fun
();
conf
.
fun
();
}
}
}
}
...
@@ -90,7 +85,6 @@ admin.editors.tinyMCE = {
...
@@ -90,7 +85,6 @@ admin.editors.tinyMCE = {
}
}
}
}
},
},
/*
/*
* @description 获取编辑器值
* @description 获取编辑器值
* @param {string} id 编辑器id
* @param {string} id 编辑器id
...
@@ -105,7 +99,6 @@ admin.editors.tinyMCE = {
...
@@ -105,7 +99,6 @@ admin.editors.tinyMCE = {
}
}
return
content
;
return
content
;
},
},
/*
/*
* @description 设置编辑器值
* @description 设置编辑器值
* @param {string} id 编辑器 id
* @param {string} id 编辑器 id
...
@@ -121,5 +114,12 @@ admin.editors.tinyMCE = {
...
@@ -121,5 +114,12 @@ admin.editors.tinyMCE = {
}
catch
(
e
)
{
}
catch
(
e
)
{
$
(
"
#
"
+
id
).
val
(
content
);
$
(
"
#
"
+
id
).
val
(
content
);
}
}
},
/*
* @description 移除编辑器
* @param {string} id 编辑器 id
*/
remove
:
function
(
id
)
{
tinyMCE
.
get
(
id
).
remove
();
}
}
};
};
war/src/main/webapp/js/admin/latkeAdmin.js
View file @
886481c7
...
@@ -276,7 +276,7 @@ var admin = new Admin();/*
...
@@ -276,7 +276,7 @@ var admin = new Admin();/*
* @fileoverview editor
* @fileoverview editor
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.
0.0.4, Jan 29, 2013
* @version 1.
1.0.4, May 30, 2015
*/
*/
admin
.
editors
=
{};
admin
.
editors
=
{};
...
@@ -311,21 +311,23 @@ $.extend(Editor.prototype, {
...
@@ -311,21 +311,23 @@ $.extend(Editor.prototype, {
_init
:
function
()
{
_init
:
function
()
{
this
.
init
();
this
.
init
();
},
},
/*
/*
* @description 初始化编辑器
* @description 初始化编辑器
*/
*/
init
:
function
()
{
init
:
function
(
type
)
{
var
conf
=
this
.
conf
;
var
conf
=
this
.
conf
;
if
(
type
)
{
conf
.
type
=
type
;
}
var
types
=
conf
.
type
.
split
(
"
-
"
);
var
types
=
conf
.
type
.
split
(
"
-
"
);
if
(
types
.
length
===
2
)
{
if
(
types
.
length
===
2
)
{
conf
.
codeMirrorLanguage
=
types
[
1
];
conf
.
codeMirrorLanguage
=
types
[
1
];
conf
.
type
=
types
[
0
];
conf
.
type
=
types
[
0
];
}
}
admin
.
editors
[
conf
.
type
].
init
(
conf
);
admin
.
editors
[
conf
.
type
].
init
(
conf
);
},
},
/*
/*
* @description 获取编辑器值
* @description 获取编辑器值
* @returns {string} 编辑器值
* @returns {string} 编辑器值
...
@@ -334,7 +336,6 @@ $.extend(Editor.prototype, {
...
@@ -334,7 +336,6 @@ $.extend(Editor.prototype, {
var
conf
=
this
.
conf
;
var
conf
=
this
.
conf
;
return
admin
.
editors
[
conf
.
type
].
getContent
(
conf
.
id
);
return
admin
.
editors
[
conf
.
type
].
getContent
(
conf
.
id
);
},
},
/*
/*
* @description 设置编辑器值
* @description 设置编辑器值
* @param {string} content 编辑器回填内容
* @param {string} content 编辑器回填内容
...
@@ -342,6 +343,13 @@ $.extend(Editor.prototype, {
...
@@ -342,6 +343,13 @@ $.extend(Editor.prototype, {
setContent
:
function
(
content
)
{
setContent
:
function
(
content
)
{
var
conf
=
this
.
conf
;
var
conf
=
this
.
conf
;
admin
.
editors
[
conf
.
type
].
setContent
(
conf
.
id
,
content
);
admin
.
editors
[
conf
.
type
].
setContent
(
conf
.
id
,
content
);
},
/*
* @description 移除编辑器值
*/
remove
:
function
()
{
var
conf
=
this
.
conf
;
admin
.
editors
[
conf
.
type
].
remove
(
conf
.
id
);
}
}
});
});
...
@@ -367,7 +375,7 @@ admin.editors.pageEditor = {};
...
@@ -367,7 +375,7 @@ admin.editors.pageEditor = {};
* @fileoverview tinyMCE editor
* @fileoverview tinyMCE editor
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.
0.0.6, Sep 26, 2012
* @version 1.
1.0.6, May 30, 2015
*/
*/
admin
.
editors
.
tinyMCE
=
{
admin
.
editors
.
tinyMCE
=
{
/*
/*
...
@@ -382,25 +390,23 @@ admin.editors.tinyMCE = {
...
@@ -382,25 +390,23 @@ admin.editors.tinyMCE = {
if
(
language
===
"
zh
"
)
{
if
(
language
===
"
zh
"
)
{
language
=
"
zh-cn
"
;
language
=
"
zh-cn
"
;
}
}
if
(
conf
.
kind
&&
conf
.
kind
===
"
simple
"
)
{
if
(
conf
.
kind
&&
conf
.
kind
===
"
simple
"
)
{
try
{
try
{
tinyMCE
.
init
({
tinyMCE
.
init
({
// General options
// General options
language
:
language
,
language
:
language
,
mode
:
"
exact
"
,
mode
:
"
exact
"
,
elements
:
conf
.
id
,
elements
:
conf
.
id
,
theme
:
"
advanced
"
,
theme
:
"
advanced
"
,
plugins
:
"
media
"
,
plugins
:
"
media
"
,
// Theme options
// Theme options
theme_advanced_buttons1
:
"
bold,italic,underline,strikethrough,|,undo,redo,|,bullist,numlist,|,code
"
,
theme_advanced_buttons1
:
"
bold,italic,underline,strikethrough,|,undo,redo,|,bullist,numlist,|,code
"
,
theme_advanced_buttons2
:
""
,
theme_advanced_buttons2
:
""
,
theme_advanced_buttons3
:
""
,
theme_advanced_buttons3
:
""
,
theme_advanced_toolbar_location
:
"
top
"
,
theme_advanced_toolbar_location
:
"
top
"
,
theme_advanced_toolbar_align
:
"
left
"
,
theme_advanced_toolbar_align
:
"
left
"
,
valid_children
:
"
+body[style]
"
valid_children
:
"
+body[style]
"
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
$
(
"
#tipMsg
"
).
text
(
"
TinyMCE load fail
"
);
$
(
"
#tipMsg
"
).
text
(
"
TinyMCE load fail
"
);
...
@@ -410,27 +416,24 @@ admin.editors.tinyMCE = {
...
@@ -410,27 +416,24 @@ admin.editors.tinyMCE = {
tinyMCE
.
init
({
tinyMCE
.
init
({
// General options
// General options
language
:
language
,
language
:
language
,
mode
:
"
exact
"
,
mode
:
"
exact
"
,
elements
:
conf
.
id
,
elements
:
conf
.
id
,
theme
:
"
advanced
"
,
theme
:
"
advanced
"
,
plugins
:
"
autosave,style,advhr,advimage,advlink,preview,inlinepopups,media,paste,syntaxhl,wordcount
"
,
plugins
:
"
autosave,style,advhr,advimage,advlink,preview,inlinepopups,media,paste,syntaxhl,wordcount
"
,
// Theme options
// Theme options
theme_advanced_buttons1
:
"
formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,forecolor,|,advhr,blockquote,syntaxhl,
"
,
theme_advanced_buttons1
:
"
formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,forecolor,|,advhr,blockquote,syntaxhl,
"
,
theme_advanced_buttons2
:
"
undo,redo,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,pastetext,pasteword,|,link,unlink,image,iespell,media,|,cleanup,code,preview,
"
,
theme_advanced_buttons2
:
"
undo,redo,|,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,pastetext,pasteword,|,link,unlink,image,iespell,media,|,cleanup,code,preview,
"
,
theme_advanced_buttons3
:
""
,
theme_advanced_buttons3
:
""
,
theme_advanced_toolbar_location
:
"
top
"
,
theme_advanced_toolbar_location
:
"
top
"
,
theme_advanced_toolbar_align
:
"
left
"
,
theme_advanced_toolbar_align
:
"
left
"
,
theme_advanced_resizing
:
true
,
theme_advanced_resizing
:
true
,
theme_advanced_statusbar_location
:
"
bottom
"
,
theme_advanced_statusbar_location
:
"
bottom
"
,
extended_valid_elements
:
"
link[type|rel|href|charset],pre[name|class],iframe[src|width|height|name|align],+a[*]
"
,
extended_valid_elements
:
"
link[type|rel|href|charset],pre[name|class],iframe[src|width|height|name|align],+a[*]
"
,
valid_children
:
"
+body[style]
"
,
valid_children
:
"
+body[style]
"
,
relative_urls
:
false
,
relative_urls
:
false
,
remove_script_host
:
false
,
remove_script_host
:
false
,
oninit
:
function
()
{
oninit
:
function
()
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
conf
.
fun
();
conf
.
fun
();
}
}
}
}
...
@@ -440,7 +443,6 @@ admin.editors.tinyMCE = {
...
@@ -440,7 +443,6 @@ admin.editors.tinyMCE = {
}
}
}
}
},
},
/*
/*
* @description 获取编辑器值
* @description 获取编辑器值
* @param {string} id 编辑器id
* @param {string} id 编辑器id
...
@@ -455,7 +457,6 @@ admin.editors.tinyMCE = {
...
@@ -455,7 +457,6 @@ admin.editors.tinyMCE = {
}
}
return
content
;
return
content
;
},
},
/*
/*
* @description 设置编辑器值
* @description 设置编辑器值
* @param {string} id 编辑器 id
* @param {string} id 编辑器 id
...
@@ -471,6 +472,13 @@ admin.editors.tinyMCE = {
...
@@ -471,6 +472,13 @@ admin.editors.tinyMCE = {
}
catch
(
e
)
{
}
catch
(
e
)
{
$
(
"
#
"
+
id
).
val
(
content
);
$
(
"
#
"
+
id
).
val
(
content
);
}
}
},
/*
* @description 移除编辑器
* @param {string} id 编辑器 id
*/
remove
:
function
(
id
)
{
tinyMCE
.
get
(
id
).
remove
();
}
}
};
};
/*
/*
...
@@ -494,7 +502,7 @@ admin.editors.tinyMCE = {
...
@@ -494,7 +502,7 @@ admin.editors.tinyMCE = {
* plugins/media/media.js 注释 26 & 28
* plugins/media/media.js 注释 26 & 28
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.
0.0.2, Jun 19, 2012
* @version 1.
1.0.2, May 30, 2015
*/
*/
admin
.
editors
.
KindEditor
=
{
admin
.
editors
.
KindEditor
=
{
/*
/*
...
@@ -508,15 +516,15 @@ admin.editors.KindEditor = {
...
@@ -508,15 +516,15 @@ admin.editors.KindEditor = {
var
language
=
"
zh_CN
"
;
var
language
=
"
zh_CN
"
;
if
(
"
en_US
"
===
Label
.
localeString
)
{
if
(
"
en_US
"
===
Label
.
localeString
)
{
language
=
"
en
"
language
=
"
en
"
}
}
if
(
conf
.
kind
&&
conf
.
kind
===
"
simple
"
)
{
if
(
conf
.
kind
&&
conf
.
kind
===
"
simple
"
)
{
try
{
try
{
this
[
conf
.
id
]
=
KindEditor
.
create
(
'
#
'
+
conf
.
id
,
{
this
[
conf
.
id
]
=
KindEditor
.
create
(
'
#
'
+
conf
.
id
,
{
langType
:
language
,
langType
:
language
,
resizeType
:
0
,
resizeType
:
0
,
items
:
[
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
strikethrough
"
,
"
|
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
items
:
[
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
strikethrough
"
,
"
|
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
"
insertunorderedlist
"
,
"
insertorderedlist
"
,
"
|
"
,
"
source
"
"
insertunorderedlist
"
,
"
insertorderedlist
"
,
"
|
"
,
"
source
"
]
]
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -525,15 +533,15 @@ admin.editors.KindEditor = {
...
@@ -525,15 +533,15 @@ admin.editors.KindEditor = {
}
else
{
}
else
{
try
{
try
{
this
[
conf
.
id
]
=
KindEditor
.
create
(
'
#
'
+
conf
.
id
,
{
this
[
conf
.
id
]
=
KindEditor
.
create
(
'
#
'
+
conf
.
id
,
{
langType
:
language
,
langType
:
language
,
items
:
[
"
formatblock
"
,
"
fontname
"
,
"
fontsize
"
,
"
|
"
,
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
strikethrough
"
,
"
forecolor
"
,
"
|
"
,
items
:
[
"
formatblock
"
,
"
fontname
"
,
"
fontsize
"
,
"
|
"
,
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
strikethrough
"
,
"
forecolor
"
,
"
|
"
,
"
link
"
,
"
unlink
"
,
"
image
"
,
"
media
"
,
"
|
"
,
"
pagebreak
"
,
"
emoticons
"
,
"
code
"
,
"
/
"
,
"
link
"
,
"
unlink
"
,
"
image
"
,
"
media
"
,
"
|
"
,
"
pagebreak
"
,
"
emoticons
"
,
"
code
"
,
"
/
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
"
insertunorderedlist
"
,
"
insertorderedlist
"
,
"
indent
"
,
"
outdent
"
,
"
|
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
"
insertunorderedlist
"
,
"
insertorderedlist
"
,
"
indent
"
,
"
outdent
"
,
"
|
"
,
"
justifyleft
"
,
"
justifycenter
"
,
"
justifyright
"
,
"
justifyfull
"
,
"
|
"
,
"
plainpaste
"
,
"
wordpaste
"
,
"
|
"
,
"
justifyleft
"
,
"
justifycenter
"
,
"
justifyright
"
,
"
justifyfull
"
,
"
|
"
,
"
plainpaste
"
,
"
wordpaste
"
,
"
|
"
,
"
clearhtml
"
,
"
source
"
,
"
preview
"
"
clearhtml
"
,
"
source
"
,
"
preview
"
],
],
afterCreate
:
function
()
{
afterCreate
:
function
()
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
conf
.
fun
();
conf
.
fun
();
}
}
}
}
...
@@ -543,7 +551,6 @@ admin.editors.KindEditor = {
...
@@ -543,7 +551,6 @@ admin.editors.KindEditor = {
}
}
}
}
},
},
/*
/*
* @description 获取编辑器值
* @description 获取编辑器值
* @param {string} id 编辑器id
* @param {string} id 编辑器id
...
@@ -558,7 +565,6 @@ admin.editors.KindEditor = {
...
@@ -558,7 +565,6 @@ admin.editors.KindEditor = {
}
}
return
content
;
return
content
;
},
},
/*
/*
* @description 设置编辑器值
* @description 设置编辑器值
* @param {string} id 编辑器 id
* @param {string} id 编辑器 id
...
@@ -570,6 +576,13 @@ admin.editors.KindEditor = {
...
@@ -570,6 +576,13 @@ admin.editors.KindEditor = {
}
catch
(
e
)
{
}
catch
(
e
)
{
$
(
"
#
"
+
id
).
val
(
content
);
$
(
"
#
"
+
id
).
val
(
content
);
}
}
},
/*
* @description 移除编辑器
* @param {string} id 编辑器 id
*/
remove
:
function
(
id
)
{
this
[
id
].
remove
();
}
}
};
};
/*
/*
...
@@ -591,7 +604,7 @@ admin.editors.KindEditor = {
...
@@ -591,7 +604,7 @@ admin.editors.KindEditor = {
* @fileoverview markdowm CodeMirror editor
* @fileoverview markdowm CodeMirror editor
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.
0.0.4, May 30, 2013
* @version 1.
1.0.4, May 30, 2015
*/
*/
admin
.
editors
.
CodeMirror
=
{
admin
.
editors
.
CodeMirror
=
{
/*
/*
...
@@ -606,19 +619,19 @@ admin.editors.CodeMirror = {
...
@@ -606,19 +619,19 @@ admin.editors.CodeMirror = {
*/
*/
init
:
function
(
conf
)
{
init
:
function
(
conf
)
{
var
it
=
this
;
var
it
=
this
;
// load preview and clear
// load preview and clear
var
previewHTML
=
"
<div class='clear'></div>
"
;
var
previewHTML
=
"
<div class='clear'></div>
"
;
if
(
conf
.
kind
!==
"
simple
"
)
{
if
(
conf
.
kind
!==
"
simple
"
)
{
previewHTML
=
"
<div class='markdown-preivew'>
"
+
previewHTML
=
"
<div class='markdown-preivew'>
"
+
"
<div class='markdown-help ico-close'></div>
"
+
"
<div class='markdown-help ico-close'></div>
"
+
"
<div class='clear'></div>
"
+
"
<div class='clear'></div>
"
+
"
<div class='markdown-preview-main none'></div>
"
+
"
<div class='markdown-preview-main none'></div>
"
+
"
<div class='markdown-help-main'>
"
+
Label
.
markdownHelpLabel
+
"
</div>
"
"
<div class='markdown-help-main'>
"
+
Label
.
markdownHelpLabel
+
"
</div>
"
+
"
</div><div class='clear'></div>
"
;
+
"
</div><div class='clear'></div>
"
;
}
}
$
(
"
#
"
+
conf
.
id
).
after
(
previewHTML
);
$
(
"
#
"
+
conf
.
id
).
after
(
previewHTML
);
// init codemirror
// init codemirror
if
(
conf
.
kind
===
"
simple
"
)
{
if
(
conf
.
kind
===
"
simple
"
)
{
this
[
conf
.
id
]
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
conf
.
id
),
{
this
[
conf
.
id
]
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
conf
.
id
),
{
...
@@ -631,12 +644,12 @@ admin.editors.CodeMirror = {
...
@@ -631,12 +644,12 @@ admin.editors.CodeMirror = {
}
else
{
}
else
{
// preview 执行队列
// preview 执行队列
it
[
conf
.
id
+
"
Timers
"
]
=
[];
it
[
conf
.
id
+
"
Timers
"
]
=
[];
// 该编辑器是否第一次触发 preivew 事件
// 该编辑器是否第一次触发 preivew 事件
it
[
conf
.
id
+
"
IsFirst
"
]
=
true
;
it
[
conf
.
id
+
"
IsFirst
"
]
=
true
;
var
$preview
=
$
(
"
#
"
+
conf
.
id
).
parent
().
find
(
"
.markdown-preivew
"
),
var
$preview
=
$
(
"
#
"
+
conf
.
id
).
parent
().
find
(
"
.markdown-preivew
"
),
$help
=
$
(
"
#
"
+
conf
.
id
).
parent
().
find
(
"
.markdown-preivew
"
).
find
(
"
.markdown-help
"
);
$help
=
$
(
"
#
"
+
conf
.
id
).
parent
().
find
(
"
.markdown-preivew
"
).
find
(
"
.markdown-help
"
);
this
[
conf
.
id
]
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
conf
.
id
),
{
this
[
conf
.
id
]
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
conf
.
id
),
{
mode
:
'
markdown
'
,
mode
:
'
markdown
'
,
lineNumbers
:
true
,
lineNumbers
:
true
,
...
@@ -648,19 +661,19 @@ admin.editors.CodeMirror = {
...
@@ -648,19 +661,19 @@ admin.editors.CodeMirror = {
if
(
it
[
conf
.
id
].
getValue
()
===
""
)
{
if
(
it
[
conf
.
id
].
getValue
()
===
""
)
{
return
;
return
;
}
}
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/markdown/2html
"
,
url
:
latkeConfig
.
servePath
+
"
/console/markdown/2html
"
,
type
:
"
POST
"
,
type
:
"
POST
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
({
markdownText
:
it
[
conf
.
id
].
getValue
()}),
data
:
JSON
.
stringify
({
markdownText
:
it
[
conf
.
id
].
getValue
()}),
success
:
function
(
data
,
textStatus
)
{
success
:
function
(
data
,
textStatus
)
{
if
(
data
.
sc
)
{
if
(
data
.
sc
)
{
if
(
it
[
conf
.
id
+
"
IsFirst
"
]
&&
$help
.
hasClass
(
"
ico-close
"
))
{
if
(
it
[
conf
.
id
+
"
IsFirst
"
]
&&
$help
.
hasClass
(
"
ico-close
"
))
{
$help
.
click
();
$help
.
click
();
}
}
it
[
conf
.
id
+
"
IsFirst
"
]
=
false
;
it
[
conf
.
id
+
"
IsFirst
"
]
=
false
;
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
data
.
html
);
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
data
.
html
);
}
else
{
}
else
{
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
data
.
msg
);
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
data
.
msg
);
...
@@ -668,14 +681,14 @@ admin.editors.CodeMirror = {
...
@@ -668,14 +681,14 @@ admin.editors.CodeMirror = {
}
}
});
});
}
}
it
[
conf
.
id
+
"
Timers
"
].
push
(
update
);
it
[
conf
.
id
+
"
Timers
"
].
push
(
update
);
}
}
});
});
this
.
_callPreview
(
conf
.
id
,
it
[
conf
.
id
+
"
Timers
"
]);
this
.
_callPreview
(
conf
.
id
,
it
[
conf
.
id
+
"
Timers
"
]);
}
}
if
(
conf
.
kind
===
"
simple
"
)
{
if
(
conf
.
kind
===
"
simple
"
)
{
// 摘要不需要 preview,设置其宽度
// 摘要不需要 preview,设置其宽度
$
(
"
#
"
+
conf
.
id
).
next
().
width
(
"
99%
"
);
$
(
"
#
"
+
conf
.
id
).
next
().
width
(
"
99%
"
);
...
@@ -683,13 +696,12 @@ admin.editors.CodeMirror = {
...
@@ -683,13 +696,12 @@ admin.editors.CodeMirror = {
// 有 preview 时,绑定 preview 事件
// 有 preview 时,绑定 preview 事件
this
.
_bindEvent
(
conf
.
id
);
this
.
_bindEvent
(
conf
.
id
);
}
}
// after render, call back function
// after render, call back function
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
if
(
typeof
(
conf
.
fun
)
===
"
function
"
)
{
conf
.
fun
();
conf
.
fun
();
}
}
},
},
/*
/*
* @description 当有更新时每隔3秒 preview
* @description 当有更新时每隔3秒 preview
* @param {string} id 编辑器 id
* @param {string} id 编辑器 id
...
@@ -702,14 +714,13 @@ admin.editors.CodeMirror = {
...
@@ -702,14 +714,13 @@ admin.editors.CodeMirror = {
admin
.
editors
.
CodeMirror
[
id
+
"
Timers
"
]
=
[];
admin
.
editors
.
CodeMirror
[
id
+
"
Timers
"
]
=
[];
},
2000
);
},
2000
);
},
},
/*
/*
* @description 绑定编辑器 preview 事件
* @description 绑定编辑器 preview 事件
* @param {string} id 编辑器id
* @param {string} id 编辑器id
*/
*/
_bindEvent
:
function
(
id
)
{
_bindEvent
:
function
(
id
)
{
var
$preview
=
$
(
"
#
"
+
id
).
parent
().
find
(
"
.markdown-preivew
"
);
var
$preview
=
$
(
"
#
"
+
id
).
parent
().
find
(
"
.markdown-preivew
"
);
$preview
.
find
(
"
.markdown-help
"
).
click
(
function
()
{
$preview
.
find
(
"
.markdown-help
"
).
click
(
function
()
{
var
$it
=
$
(
this
);
var
$it
=
$
(
this
);
if
(
$it
.
hasClass
(
"
ico-help
"
))
{
if
(
$it
.
hasClass
(
"
ico-help
"
))
{
...
@@ -723,7 +734,6 @@ admin.editors.CodeMirror = {
...
@@ -723,7 +734,6 @@ admin.editors.CodeMirror = {
}
}
});
});
},
},
/*
/*
* @description 获取编辑器值
* @description 获取编辑器值
* @param {string} id 编辑器id
* @param {string} id 编辑器id
...
@@ -732,7 +742,6 @@ admin.editors.CodeMirror = {
...
@@ -732,7 +742,6 @@ admin.editors.CodeMirror = {
getContent
:
function
(
id
)
{
getContent
:
function
(
id
)
{
return
this
[
id
].
getValue
();
return
this
[
id
].
getValue
();
},
},
/*
/*
* @description 设置编辑器值
* @description 设置编辑器值
* @param {string} id 编辑器 id
* @param {string} id 编辑器 id
...
@@ -740,6 +749,16 @@ admin.editors.CodeMirror = {
...
@@ -740,6 +749,16 @@ admin.editors.CodeMirror = {
*/
*/
setContent
:
function
(
id
,
content
)
{
setContent
:
function
(
id
,
content
)
{
this
[
id
].
setValue
(
content
);
this
[
id
].
setValue
(
content
);
var
$preview
=
$
(
"
#
"
+
id
).
parent
().
find
(
"
.markdown-preivew
"
);
$preview
.
find
(
"
.markdown-preview-main
"
).
html
(
content
);
},
/*
* @description 销毁编辑器值
* @param {string} id 编辑器 id
*/
remove
:
function
(
id
)
{
this
[
id
].
toTextArea
();
$
(
"
.markdown-preivew
"
).
remove
();
}
}
};
/*
};
/*
* Copyright (c) 2010-2015, b3log.org
* Copyright (c) 2010-2015, b3log.org
...
@@ -875,9 +894,10 @@ $.extend(TablePaginate.prototype, {
...
@@ -875,9 +894,10 @@ $.extend(TablePaginate.prototype, {
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.
0.3.3, Sep 30, 2013
* @version 1.
1.3.3, May 30, 2015
*/
*/
admin
.
article
=
{
admin
.
article
=
{
currentEditorType
:
''
,
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
isConfirm
:
true
,
isConfirm
:
true
,
status
:
{
status
:
{
...
@@ -895,7 +915,7 @@ admin.article = {
...
@@ -895,7 +915,7 @@ admin.article = {
* @param {String} id 文章 id
* @param {String} id 文章 id
* @param {Boolean} isArticle 文章或者草稿
* @param {Boolean} isArticle 文章或者草稿
*/
*/
get
:
function
(
id
,
isArticle
)
{
get
:
function
(
id
,
isArticle
)
{
this
.
status
.
id
=
id
;
this
.
status
.
id
=
id
;
this
.
status
.
isArticle
=
isArticle
;
this
.
status
.
isArticle
=
isArticle
;
admin
.
selectTab
(
"
article/article
"
);
admin
.
selectTab
(
"
article/article
"
);
...
@@ -903,14 +923,14 @@ admin.article = {
...
@@ -903,14 +923,14 @@ admin.article = {
/**
/**
* @description 获取文章内容
* @description 获取文章内容
*/
*/
getAndSet
:
function
()
{
getAndSet
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/article/
"
+
admin
.
article
.
status
.
id
,
url
:
latkeConfig
.
servePath
+
"
/console/article/
"
+
admin
.
article
.
status
.
id
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
...
@@ -921,6 +941,15 @@ admin.article = {
...
@@ -921,6 +941,15 @@ admin.article = {
$
(
"
#title
"
).
val
(
result
.
article
.
articleTitle
);
$
(
"
#title
"
).
val
(
result
.
article
.
articleTitle
);
admin
.
article
.
status
.
articleHadBeenPublished
=
result
.
article
.
articleHadBeenPublished
;
admin
.
article
.
status
.
articleHadBeenPublished
=
result
.
article
.
articleHadBeenPublished
;
if
(
admin
.
article
.
currentEditorType
!==
result
.
article
.
articleEditorType
)
{
admin
.
editors
.
articleEditor
.
remove
();
admin
.
editors
.
abstractEditor
.
remove
();
admin
.
article
.
currentEditorType
=
result
.
article
.
articleEditorType
;
admin
.
editors
.
articleEditor
.
init
(
result
.
article
.
articleEditorType
);
admin
.
editors
.
abstractEditor
.
init
(
result
.
article
.
articleEditorType
);
}
admin
.
editors
.
articleEditor
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editors
.
articleEditor
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editors
.
abstractEditor
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
editors
.
abstractEditor
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
article
.
content
=
admin
.
editors
.
articleEditor
.
getContent
();
admin
.
article
.
content
=
admin
.
editors
.
articleEditor
.
getContent
();
...
@@ -943,7 +972,7 @@ admin.article = {
...
@@ -943,7 +972,7 @@ admin.article = {
// signs
// signs
var
signs
=
result
.
article
.
signs
;
var
signs
=
result
.
article
.
signs
;
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
if
(
parseInt
(
result
.
article
.
articleSignId
)
===
parseInt
(
signs
[
i
].
oId
))
{
if
(
parseInt
(
result
.
article
.
articleSignId
)
===
parseInt
(
signs
[
i
].
oId
))
{
$
(
"
#articleSign
"
+
signs
[
i
].
oId
).
addClass
(
"
selected
"
);
$
(
"
#articleSign
"
+
signs
[
i
].
oId
).
addClass
(
"
selected
"
);
}
else
{
}
else
{
...
@@ -962,7 +991,7 @@ admin.article = {
...
@@ -962,7 +991,7 @@ admin.article = {
* @param {String} fromId 文章来自草稿夹(draft)/文件夹(article)
* @param {String} fromId 文章来自草稿夹(draft)/文件夹(article)
* @param {String} title 文章标题
* @param {String} title 文章标题
*/
*/
del
:
function
(
id
,
fromId
,
title
)
{
del
:
function
(
id
,
fromId
,
title
)
{
var
isDelete
=
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
articleLabel
+
'
"
'
+
title
+
'
"?
'
);
var
isDelete
=
confirm
(
Label
.
confirmRemoveLabel
+
Label
.
articleLabel
+
'
"
'
+
title
+
'
"?
'
);
if
(
isDelete
)
{
if
(
isDelete
)
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
...
@@ -972,7 +1001,7 @@ admin.article = {
...
@@ -972,7 +1001,7 @@ admin.article = {
url
:
latkeConfig
.
servePath
+
"
/console/article/
"
+
id
,
url
:
latkeConfig
.
servePath
+
"
/console/article/
"
+
id
,
type
:
"
DELETE
"
,
type
:
"
DELETE
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
...
@@ -989,7 +1018,7 @@ admin.article = {
...
@@ -989,7 +1018,7 @@ admin.article = {
* @param {Boolean} articleIsPublished 文章是否发布过
* @param {Boolean} articleIsPublished 文章是否发布过
* @param {Boolean} isAuto 是否为自动保存
* @param {Boolean} isAuto 是否为自动保存
*/
*/
add
:
function
(
articleIsPublished
,
isAuto
)
{
add
:
function
(
articleIsPublished
,
isAuto
)
{
if
(
admin
.
article
.
validate
())
{
if
(
admin
.
article
.
validate
())
{
var
that
=
this
;
var
that
=
this
;
that
.
_addDisabled
();
that
.
_addDisabled
();
...
@@ -997,7 +1026,7 @@ admin.article = {
...
@@ -997,7 +1026,7 @@ admin.article = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
signId
=
""
;
var
signId
=
""
;
$
(
"
.signs button
"
).
each
(
function
()
{
$
(
"
.signs button
"
).
each
(
function
()
{
if
(
this
.
className
===
"
selected
"
)
{
if
(
this
.
className
===
"
selected
"
)
{
signId
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
);
signId
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
);
}
}
...
@@ -1026,7 +1055,7 @@ admin.article = {
...
@@ -1026,7 +1055,7 @@ admin.article = {
type
:
"
POST
"
,
type
:
"
POST
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
if
(
isAuto
)
{
if
(
isAuto
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
admin
.
article
.
status
.
id
=
result
.
oId
;
admin
.
article
.
status
.
id
=
result
.
oId
;
...
@@ -1047,7 +1076,7 @@ admin.article = {
...
@@ -1047,7 +1076,7 @@ admin.article = {
admin
.
article
.
isConfirm
=
false
;
admin
.
article
.
isConfirm
=
false
;
},
},
complete
:
function
(
jqXHR
,
textStatus
)
{
complete
:
function
(
jqXHR
,
textStatus
)
{
that
.
_removeDisabled
();
that
.
_removeDisabled
();
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
if
(
jqXHR
.
status
===
403
)
{
if
(
jqXHR
.
status
===
403
)
{
...
@@ -1063,7 +1092,7 @@ admin.article = {
...
@@ -1063,7 +1092,7 @@ admin.article = {
* @param {Boolean} articleIsPublished 文章是否发布过
* @param {Boolean} articleIsPublished 文章是否发布过
* @param {Boolean} isAuto 是否为自动保存
* @param {Boolean} isAuto 是否为自动保存
*/
*/
update
:
function
(
articleIsPublished
,
isAuto
)
{
update
:
function
(
articleIsPublished
,
isAuto
)
{
if
(
admin
.
article
.
validate
())
{
if
(
admin
.
article
.
validate
())
{
var
that
=
this
;
var
that
=
this
;
that
.
_addDisabled
();
that
.
_addDisabled
();
...
@@ -1071,7 +1100,7 @@ admin.article = {
...
@@ -1071,7 +1100,7 @@ admin.article = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
signId
=
""
;
var
signId
=
""
;
$
(
"
.signs button
"
).
each
(
function
()
{
$
(
"
.signs button
"
).
each
(
function
()
{
if
(
this
.
className
===
"
selected
"
)
{
if
(
this
.
className
===
"
selected
"
)
{
signId
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
);
signId
=
this
.
id
.
substr
(
this
.
id
.
length
-
1
,
1
);
}
}
...
@@ -1092,7 +1121,8 @@ admin.article = {
...
@@ -1092,7 +1121,8 @@ admin.article = {
"
articleSignId
"
:
signId
,
"
articleSignId
"
:
signId
,
"
articleCommentable
"
:
$
(
"
#articleCommentable
"
).
prop
(
"
checked
"
),
"
articleCommentable
"
:
$
(
"
#articleCommentable
"
).
prop
(
"
checked
"
),
"
articleViewPwd
"
:
$
(
"
#viewPwd
"
).
val
(),
"
articleViewPwd
"
:
$
(
"
#viewPwd
"
).
val
(),
"
postToCommunity
"
:
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
)
"
postToCommunity
"
:
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
),
"
articleEditorType
"
:
admin
.
article
.
currentEditorType
}
}
};
};
...
@@ -1101,7 +1131,7 @@ admin.article = {
...
@@ -1101,7 +1131,7 @@ admin.article = {
type
:
"
PUT
"
,
type
:
"
PUT
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
if
(
isAuto
)
{
if
(
isAuto
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
return
;
return
;
...
@@ -1123,7 +1153,7 @@ admin.article = {
...
@@ -1123,7 +1153,7 @@ admin.article = {
admin
.
article
.
status
.
id
=
undefined
;
admin
.
article
.
status
.
id
=
undefined
;
admin
.
article
.
isConfirm
=
false
;
admin
.
article
.
isConfirm
=
false
;
},
},
complete
:
function
(
jqXHR
,
textStatus
)
{
complete
:
function
(
jqXHR
,
textStatus
)
{
that
.
_removeDisabled
();
that
.
_removeDisabled
();
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
if
(
jqXHR
.
status
===
403
)
{
if
(
jqXHR
.
status
===
403
)
{
...
@@ -1137,7 +1167,7 @@ admin.article = {
...
@@ -1137,7 +1167,7 @@ admin.article = {
/**
/**
* @description 发布文章页面设置文章按钮、发布到社区等状态的显示
* @description 发布文章页面设置文章按钮、发布到社区等状态的显示
*/
*/
setStatus
:
function
()
{
setStatus
:
function
()
{
// set button status
// set button status
if
(
this
.
status
)
{
if
(
this
.
status
)
{
if
(
this
.
status
.
isArticle
)
{
if
(
this
.
status
.
isArticle
)
{
...
@@ -1163,7 +1193,7 @@ admin.article = {
...
@@ -1163,7 +1193,7 @@ admin.article = {
/**
/**
* @description 清除发布文章页面的输入框的内容
* @description 清除发布文章页面的输入框的内容
*/
*/
clear
:
function
()
{
clear
:
function
()
{
this
.
status
=
{
this
.
status
=
{
id
:
undefined
,
id
:
undefined
,
isArticle
:
undefined
,
isArticle
:
undefined
,
...
@@ -1183,7 +1213,7 @@ admin.article = {
...
@@ -1183,7 +1213,7 @@ admin.article = {
$
(
"
#permalink
"
).
val
(
""
);
$
(
"
#permalink
"
).
val
(
""
);
$
(
"
#articleCammentable
"
).
prop
(
"
checked
"
,
true
);
$
(
"
#articleCammentable
"
).
prop
(
"
checked
"
,
true
);
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
,
true
);
$
(
"
#postToCommunity
"
).
prop
(
"
checked
"
,
true
);
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
if
(
i
===
0
)
{
if
(
i
===
0
)
{
this
.
className
=
"
selected
"
;
this
.
className
=
"
selected
"
;
}
else
{
}
else
{
...
@@ -1197,20 +1227,21 @@ admin.article = {
...
@@ -1197,20 +1227,21 @@ admin.article = {
* @description 初始化发布文章页面
* @description 初始化发布文章页面
* @param {Function} fun 切面函数
* @param {Function} fun 切面函数
*/
*/
init
:
function
(
fun
)
{
init
:
function
(
fun
)
{
this
.
currentEditorType
=
Label
.
editorType
;
// Inits Signs.
// Inits Signs.
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/signs/
"
,
url
:
latkeConfig
.
servePath
+
"
/console/signs/
"
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
$
(
"
.signs button
"
).
each
(
function
(
i
)
{
// Sets signs.
// Sets signs.
if
(
i
===
result
.
signs
.
length
)
{
if
(
i
===
result
.
signs
.
length
)
{
$
(
"
#articleSign1
"
).
addClass
(
"
selected
"
);
$
(
"
#articleSign1
"
).
addClass
(
"
selected
"
);
...
@@ -1222,9 +1253,9 @@ admin.article = {
...
@@ -1222,9 +1253,9 @@ admin.article = {
});
});
}
}
// Binds checkbox event.
// Binds checkbox event.
$
(
this
).
click
(
function
()
{
$
(
this
).
click
(
function
()
{
if
(
this
.
className
!==
"
selected
"
)
{
if
(
this
.
className
!==
"
selected
"
)
{
$
(
"
.signs button
"
).
each
(
function
()
{
$
(
"
.signs button
"
).
each
(
function
()
{
this
.
className
=
""
;
this
.
className
=
""
;
});
});
this
.
className
=
"
selected
"
;
this
.
className
=
"
selected
"
;
...
@@ -1241,7 +1272,7 @@ admin.article = {
...
@@ -1241,7 +1272,7 @@ admin.article = {
url
:
latkeConfig
.
servePath
+
"
/console/tags
"
,
url
:
latkeConfig
.
servePath
+
"
/console/tags
"
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
...
@@ -1268,7 +1299,7 @@ admin.article = {
...
@@ -1268,7 +1299,7 @@ admin.article = {
});
});
// submit action
// submit action
$
(
"
#submitArticle
"
).
click
(
function
()
{
$
(
"
#submitArticle
"
).
click
(
function
()
{
if
(
admin
.
article
.
status
.
id
)
{
if
(
admin
.
article
.
status
.
id
)
{
admin
.
article
.
update
(
true
);
admin
.
article
.
update
(
true
);
}
else
{
}
else
{
...
@@ -1276,7 +1307,7 @@ admin.article = {
...
@@ -1276,7 +1307,7 @@ admin.article = {
}
}
});
});
$
(
"
#saveArticle
"
).
click
(
function
()
{
$
(
"
#saveArticle
"
).
click
(
function
()
{
if
(
admin
.
article
.
status
.
id
)
{
if
(
admin
.
article
.
status
.
id
)
{
admin
.
article
.
update
(
admin
.
article
.
status
.
isArticle
);
admin
.
article
.
update
(
admin
.
article
.
status
.
isArticle
);
}
else
{
}
else
{
...
@@ -1299,14 +1330,14 @@ admin.article = {
...
@@ -1299,14 +1330,14 @@ admin.article = {
});
});
admin
.
article
.
clearDraftTimer
();
admin
.
article
.
clearDraftTimer
();
admin
.
article
.
autoSaveDraftTimer
=
setInterval
(
function
()
{
admin
.
article
.
autoSaveDraftTimer
=
setInterval
(
function
()
{
admin
.
article
.
_autoSaveToDraft
();
admin
.
article
.
_autoSaveToDraft
();
},
admin
.
article
.
AUTOSAVETIME
);
},
admin
.
article
.
AUTOSAVETIME
);
},
},
/**
/**
* @description 自动保存草稿件
* @description 自动保存草稿件
*/
*/
_autoSaveToDraft
:
function
()
{
_autoSaveToDraft
:
function
()
{
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
||
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
||
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
===
""
||
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
===
""
||
$
(
"
#tag
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tag
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
...
@@ -1324,7 +1355,7 @@ admin.article = {
...
@@ -1324,7 +1355,7 @@ admin.article = {
/**
/**
* @description 关闭定时器
* @description 关闭定时器
*/
*/
clearDraftTimer
:
function
()
{
clearDraftTimer
:
function
()
{
if
(
admin
.
article
.
autoSaveDraftTimer
!==
""
)
{
if
(
admin
.
article
.
autoSaveDraftTimer
!==
""
)
{
window
.
clearInterval
(
admin
.
article
.
autoSaveDraftTimer
);
window
.
clearInterval
(
admin
.
article
.
autoSaveDraftTimer
);
admin
.
article
.
autoSaveDraftTimer
=
""
;
admin
.
article
.
autoSaveDraftTimer
=
""
;
...
@@ -1333,7 +1364,7 @@ admin.article = {
...
@@ -1333,7 +1364,7 @@ admin.article = {
/**
/**
* @description 验证发布文章字段的合法性
* @description 验证发布文章字段的合法性
*/
*/
validate
:
function
()
{
validate
:
function
()
{
var
articleContent
=
admin
.
editors
.
articleEditor
.
getContent
();
var
articleContent
=
admin
.
editors
.
articleEditor
.
getContent
();
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
...
@@ -1353,14 +1384,14 @@ admin.article = {
...
@@ -1353,14 +1384,14 @@ admin.article = {
* @description 取消发布
* @description 取消发布
* @param {Boolean} isAuto 是否为自动保存
* @param {Boolean} isAuto 是否为自动保存
*/
*/
unPublish
:
function
(
isAuto
)
{
unPublish
:
function
(
isAuto
)
{
var
that
=
this
;
var
that
=
this
;
that
.
_addDisabled
();
that
.
_addDisabled
();
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/article/unpublish/
"
+
admin
.
article
.
status
.
id
,
url
:
latkeConfig
.
servePath
+
"
/console/article/unpublish/
"
+
admin
.
article
.
status
.
id
,
type
:
"
PUT
"
,
type
:
"
PUT
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
if
(
isAuto
)
{
if
(
isAuto
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
autoSaveLabel
);
return
;
return
;
...
@@ -1375,7 +1406,7 @@ admin.article = {
...
@@ -1375,7 +1406,7 @@ admin.article = {
admin
.
article
.
status
.
id
=
undefined
;
admin
.
article
.
status
.
id
=
undefined
;
admin
.
article
.
isConfirm
=
false
;
admin
.
article
.
isConfirm
=
false
;
},
},
complete
:
function
(
jqXHR
,
textStatus
)
{
complete
:
function
(
jqXHR
,
textStatus
)
{
that
.
_removeDisabled
();
that
.
_removeDisabled
();
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
if
(
jqXHR
.
status
===
403
)
{
if
(
jqXHR
.
status
===
403
)
{
...
@@ -1390,7 +1421,7 @@ admin.article = {
...
@@ -1390,7 +1421,7 @@ admin.article = {
* @param {String} str 被解析的字符串
* @param {String} str 被解析的字符串
* @returns {String} 无重复的字符串
* @returns {String} 无重复的字符串
*/
*/
trimUniqueArray
:
function
(
str
)
{
trimUniqueArray
:
function
(
str
)
{
str
=
str
.
toString
();
str
=
str
.
toString
();
var
arr
=
str
.
split
(
"
,
"
);
var
arr
=
str
.
split
(
"
,
"
);
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
...
@@ -1406,7 +1437,7 @@ admin.article = {
...
@@ -1406,7 +1437,7 @@ admin.article = {
/**
/**
* @description 点击发文文章时的处理
* @description 点击发文文章时的处理
*/
*/
prePost
:
function
()
{
prePost
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
admin
.
article
.
content
=
""
;
admin
.
article
.
content
=
""
;
if
(
!
admin
.
editors
.
articleEditor
.
getContent
)
{
if
(
!
admin
.
editors
.
articleEditor
.
getContent
)
{
...
@@ -1423,11 +1454,20 @@ admin.article = {
...
@@ -1423,11 +1454,20 @@ admin.article = {
}
}
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
if
(
admin
.
article
.
currentEditorType
!==
Label
.
editorType
)
{
admin
.
editors
.
articleEditor
.
remove
();
admin
.
editors
.
abstractEditor
.
remove
();
admin
.
article
.
currentEditorType
=
Label
.
editorType
;
admin
.
editors
.
articleEditor
.
init
(
Label
.
editorType
);
admin
.
editors
.
abstractEditor
.
init
(
Label
.
editorType
);
}
},
},
/**
/**
* @description: 仿重复提交,点击一次后,按钮设置为 disabled
* @description: 仿重复提交,点击一次后,按钮设置为 disabled
*/
*/
_addDisabled
:
function
()
{
_addDisabled
:
function
()
{
$
(
"
#unSubmitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#unSubmitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#saveArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#saveArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#submitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
$
(
"
#submitArticle
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
...
@@ -1435,7 +1475,7 @@ admin.article = {
...
@@ -1435,7 +1475,7 @@ admin.article = {
/**
/**
* @description: 仿重复提交,当后台有数据返回后,按钮移除 disabled 状态
* @description: 仿重复提交,当后台有数据返回后,按钮移除 disabled 状态
*/
*/
_removeDisabled
:
function
()
{
_removeDisabled
:
function
()
{
$
(
"
#unSubmitArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#unSubmitArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#saveArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#saveArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#submitArticle
"
).
removeAttr
(
"
disabled
"
);
$
(
"
#submitArticle
"
).
removeAttr
(
"
disabled
"
);
...
@@ -1448,7 +1488,9 @@ admin.article = {
...
@@ -1448,7 +1488,9 @@ admin.article = {
admin
.
register
.
article
=
{
admin
.
register
.
article
=
{
"
obj
"
:
admin
.
article
,
"
obj
"
:
admin
.
article
,
"
init
"
:
admin
.
article
.
init
,
"
init
"
:
admin
.
article
.
init
,
"
refresh
"
:
function
()
{
"
refresh
"
:
function
()
{
admin
.
editors
.
abstractEditor
.
setContent
(
''
);
admin
.
editors
.
articleEditor
.
setContent
(
''
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
}
}
...
@@ -1864,12 +1906,13 @@ admin.register["draft-list"] = {
...
@@ -1864,12 +1906,13 @@ admin.register["draft-list"] = {
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.
0.2.4, May 28, 2013
* @version 1.
1.2.4, May 30, 2015
*/
*/
/* page-list 相关操作 */
/* page-list 相关操作 */
admin
.
pageList
=
{
admin
.
pageList
=
{
tablePagination
:
new
TablePaginate
(
"
page
"
),
currentEditorType
:
''
,
tablePagination
:
new
TablePaginate
(
"
page
"
),
pageInfo
:
{
pageInfo
:
{
currentCount
:
1
,
currentCount
:
1
,
pageCount
:
1
,
pageCount
:
1
,
...
@@ -1877,75 +1920,75 @@ admin.pageList = {
...
@@ -1877,75 +1920,75 @@ admin.pageList = {
},
},
id
:
""
,
id
:
""
,
type
:
"
link
"
,
type
:
"
link
"
,
/*
/*
* 初始化 table, pagination, comments dialog
* 初始化 table, pagination, comments dialog
*/
*/
init
:
function
(
page
)
{
init
:
function
(
page
)
{
this
.
tablePagination
.
buildTable
([{
this
.
tablePagination
.
buildTable
([{
text
:
""
,
text
:
""
,
index
:
"
pageOrder
"
,
index
:
"
pageOrder
"
,
width
:
60
,
width
:
60
,
style
:
"
padding-left: 12px;font-size:14px;
"
style
:
"
padding-left: 12px;font-size:14px;
"
},
{
},
{
style
:
"
padding-left: 12px;
"
,
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
titleLabel
,
text
:
Label
.
titleLabel
,
index
:
"
pageTitle
"
,
index
:
"
pageTitle
"
,
width
:
300
width
:
300
},
{
},
{
style
:
"
padding-left: 12px;
"
,
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
permalinkLabel
,
text
:
Label
.
permalinkLabel
,
index
:
"
pagePermalink
"
,
index
:
"
pagePermalink
"
,
minWidth
:
300
minWidth
:
300
},
{
},
{
style
:
"
padding-left: 12px;
"
,
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
openMethodLabel
,
text
:
Label
.
openMethodLabel
,
index
:
"
pageTarget
"
,
index
:
"
pageTarget
"
,
width
:
120
width
:
120
},
{
},
{
style
:
"
padding-left: 12px;
"
,
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
typeLabel
,
text
:
Label
.
typeLabel
,
index
:
"
pageType
"
,
index
:
"
pageType
"
,
width
:
80
width
:
80
},
{
},
{
text
:
Label
.
commentLabel
,
text
:
Label
.
commentLabel
,
index
:
"
comments
"
,
index
:
"
comments
"
,
width
:
80
,
width
:
80
,
style
:
"
padding-left: 12px;
"
style
:
"
padding-left: 12px;
"
}]);
}]);
this
.
tablePagination
.
initPagination
();
this
.
tablePagination
.
initPagination
();
this
.
tablePagination
.
initCommentsDialog
();
this
.
tablePagination
.
initCommentsDialog
();
this
.
getList
(
page
);
this
.
getList
(
page
);
var
language
=
Label
.
localeString
.
substring
(
0
,
2
);
var
language
=
Label
.
localeString
.
substring
(
0
,
2
);
if
(
language
===
"
zh
"
)
{
if
(
language
===
"
zh
"
)
{
language
=
"
zh-cn
"
;
language
=
"
zh-cn
"
;
}
}
admin
.
pageList
.
currentEditorType
=
Label
.
editorType
;
admin
.
editors
.
pageEditor
=
new
Editor
({
admin
.
editors
.
pageEditor
=
new
Editor
({
language
:
language
,
language
:
language
,
kind
:
"
all
"
,
kind
:
"
all
"
,
id
:
"
pageContent
"
id
:
"
pageContent
"
});
});
// select type
// select type
$
(
"
.fn-type
"
).
click
(
function
()
{
$
(
"
.fn-type
"
).
click
(
function
()
{
var
$it
=
$
(
this
);
var
$it
=
$
(
this
);
if
(
$it
.
hasClass
(
"
selected
"
))
{
if
(
$it
.
hasClass
(
"
selected
"
))
{
return
;
return
;
}
}
$
(
"
.fn-type
"
).
removeClass
(
"
selected
"
);
$
(
"
.fn-type
"
).
removeClass
(
"
selected
"
);
$it
.
addClass
(
"
selected
"
);
$it
.
addClass
(
"
selected
"
);
admin
.
pageList
.
type
=
$it
.
data
(
"
type
"
);
admin
.
pageList
.
type
=
$it
.
data
(
"
type
"
);
if
(
admin
.
pageList
.
type
===
"
page
"
)
{
if
(
admin
.
pageList
.
type
===
"
page
"
)
{
$
(
"
#pagePagePanel
"
).
slideDown
();
$
(
"
#pagePagePanel
"
).
slideDown
();
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
&&
admin
.
editors
.
pageEditor
.
getContent
()
===
""
)
{
&&
admin
.
editors
.
pageEditor
.
getContent
()
===
""
)
{
admin
.
editors
.
pageEditor
.
setContent
(
""
);
admin
.
editors
.
pageEditor
.
setContent
(
""
);
}
}
}
else
{
}
else
{
...
@@ -1953,7 +1996,6 @@ admin.pageList = {
...
@@ -1953,7 +1996,6 @@ admin.pageList = {
}
}
});
});
},
},
/*
/*
* 根据当前页码获取列表
* 根据当前页码获取列表
* @pagNum 当前页码
* @pagNum 当前页码
...
@@ -1962,18 +2004,18 @@ admin.pageList = {
...
@@ -1962,18 +2004,18 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
that
=
this
;
var
that
=
this
;
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/pages/
"
+
pageNum
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
url
:
latkeConfig
.
servePath
+
"
/console/pages/
"
+
pageNum
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
var
pages
=
result
.
pages
;
var
pages
=
result
.
pages
;
var
pageData
=
[];
var
pageData
=
[];
admin
.
pageList
.
pageInfo
.
currentCount
=
pages
.
length
;
admin
.
pageList
.
pageInfo
.
currentCount
=
pages
.
length
;
...
@@ -1998,27 +2040,26 @@ admin.pageList = {
...
@@ -1998,27 +2040,26 @@ admin.pageList = {
<span onclick="admin.pageList.changeOrder(
'
+
pages
[
i
].
oId
+
'
,
'
+
i
+
'
,
\'
down
\'
);" class="table-downIcon"></span>
\
<span onclick="admin.pageList.changeOrder(
'
+
pages
[
i
].
oId
+
'
,
'
+
i
+
'
,
\'
down
\'
);" class="table-downIcon"></span>
\
</div>
'
;
</div>
'
;
}
}
pageData
[
i
].
pageTitle
=
"
<a class='no-underline' href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
pageData
[
i
].
pageTitle
=
"
<a class='no-underline' href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
pages
[
i
].
pageTitle
+
"
</a>
"
;
pages
[
i
].
pageTitle
+
"
</a>
"
;
pageData
[
i
].
pagePermalink
=
"
<a class='no-underline' href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
pageData
[
i
].
pagePermalink
=
"
<a class='no-underline' href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
pages
[
i
].
pagePermalink
+
"
</a>
"
;
+
pages
[
i
].
pagePermalink
+
"
</a>
"
;
pageData
[
i
].
pageTarget
=
pages
[
i
].
pageOpenTarget
;
pageData
[
i
].
pageTarget
=
pages
[
i
].
pageOpenTarget
;
pageData
[
i
].
pageType
=
pages
[
i
].
pageType
;
pageData
[
i
].
pageType
=
pages
[
i
].
pageType
;
pageData
[
i
].
comments
=
pages
[
i
].
pageCommentCount
;
pageData
[
i
].
comments
=
pages
[
i
].
pageCommentCount
;
pageData
[
i
].
expendRow
=
"
<span><a href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
Label
.
viewLabel
+
"
</a>
\
pageData
[
i
].
expendRow
=
"
<span><a href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
Label
.
viewLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.pageList.get('
"
+
pages
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
updateLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.pageList.get('
"
+
pages
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
updateLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.pageList.del('
"
+
pages
[
i
].
oId
+
"
', '
"
+
pages
[
i
].
pageTitle
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.pageList.del('
"
+
pages
[
i
].
oId
+
"
', '
"
+
pages
[
i
].
pageTitle
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.comment.open('
"
+
pages
[
i
].
oId
+
"
', 'page')
\"
>
"
+
Label
.
commentLabel
+
"
</a></span>
"
;
<a href='javascript:void(0)' onclick=
\"
admin.comment.open('
"
+
pages
[
i
].
oId
+
"
', 'page')
\"
>
"
+
Label
.
commentLabel
+
"
</a></span>
"
;
}
}
that
.
tablePagination
.
updateTablePagination
(
pageData
,
pageNum
,
result
.
pagination
);
that
.
tablePagination
.
updateTablePagination
(
pageData
,
pageNum
,
result
.
pagination
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
},
},
/*
/*
* 获取自定义页面
* 获取自定义页面
* @id 自定义页面 id
* @id 自定义页面 id
...
@@ -2026,20 +2067,20 @@ admin.pageList = {
...
@@ -2026,20 +2067,20 @@ admin.pageList = {
get
:
function
(
id
)
{
get
:
function
(
id
)
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
+
id
,
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
+
id
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
admin
.
pageList
.
id
=
id
;
admin
.
pageList
.
id
=
id
;
$
(
"
#pageTitle
"
).
val
(
result
.
page
.
pageTitle
);
$
(
"
#pageTitle
"
).
val
(
result
.
page
.
pageTitle
);
$
(
"
#pagePermalink
"
).
val
(
result
.
page
.
pagePermalink
);
$
(
"
#pagePermalink
"
).
val
(
result
.
page
.
pagePermalink
);
$
(
"
#pageTarget
"
).
val
(
result
.
page
.
pageOpenTarget
);
$
(
"
#pageTarget
"
).
val
(
result
.
page
.
pageOpenTarget
);
...
@@ -2050,13 +2091,19 @@ admin.pageList = {
...
@@ -2050,13 +2091,19 @@ admin.pageList = {
}
}
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
,
result
.
page
.
pageCommentable
);
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
,
result
.
page
.
pageCommentable
);
if
(
admin
.
pageList
.
currentEditorType
!==
result
.
page
.
pageEditorType
)
{
admin
.
editors
.
pageEditor
.
remove
();
admin
.
pageList
.
currentEditorType
=
result
.
page
.
pageEditorType
;
admin
.
editors
.
pageEditor
.
init
(
result
.
page
.
pageEditorType
);
}
admin
.
editors
.
pageEditor
.
setContent
(
result
.
page
.
pageContent
);
admin
.
editors
.
pageEditor
.
setContent
(
result
.
page
.
pageContent
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
},
},
/*
/*
* 删除自定义页面
* 删除自定义页面
* @id 自定义页面 id
* @id 自定义页面 id
...
@@ -2072,16 +2119,16 @@ admin.pageList = {
...
@@ -2072,16 +2119,16 @@ admin.pageList = {
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
+
id
,
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
+
id
,
type
:
"
DELETE
"
,
type
:
"
DELETE
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
var
pageNum
=
admin
.
pageList
.
pageInfo
.
currentPage
;
var
pageNum
=
admin
.
pageList
.
pageInfo
.
currentPage
;
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
1
&&
admin
.
pageList
.
pageInfo
.
pageCount
!==
1
&&
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
1
&&
admin
.
pageList
.
pageInfo
.
pageCount
!==
1
&&
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
admin
.
pageList
.
pageInfo
.
pageCount
--
;
admin
.
pageList
.
pageInfo
.
pageCount
--
;
pageNum
=
admin
.
pageList
.
pageInfo
.
pageCount
;
pageNum
=
admin
.
pageList
.
pageInfo
.
pageCount
;
}
}
...
@@ -2091,13 +2138,12 @@ admin.pageList = {
...
@@ -2091,13 +2138,12 @@ admin.pageList = {
}
else
{
}
else
{
admin
.
setHashByPage
(
pageNum
);
admin
.
setHashByPage
(
pageNum
);
}
}
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
}
}
},
},
/*
/*
* 添加自定义页面
* 添加自定义页面
*/
*/
...
@@ -2105,14 +2151,14 @@ admin.pageList = {
...
@@ -2105,14 +2151,14 @@ admin.pageList = {
if
(
this
.
validate
())
{
if
(
this
.
validate
())
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editors
.
pageEditor
.
getContent
();
var
pageContent
=
admin
.
editors
.
pageEditor
.
getContent
();
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
pagePermalink
=
Util
.
proessURL
(
pagePermalink
);
pagePermalink
=
Util
.
proessURL
(
pagePermalink
);
}
}
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
"
pageTitle
"
:
$
(
"
#pageTitle
"
).
val
(),
"
pageTitle
"
:
$
(
"
#pageTitle
"
).
val
(),
...
@@ -2123,30 +2169,30 @@ admin.pageList = {
...
@@ -2123,30 +2169,30 @@ admin.pageList = {
"
pageOpenTarget
"
:
$
(
"
#pageTarget
"
).
val
()
"
pageOpenTarget
"
:
$
(
"
#pageTarget
"
).
val
()
}
}
};
};
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
,
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
,
type
:
"
POST
"
,
type
:
"
POST
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
admin
.
pageList
.
id
=
""
;
admin
.
pageList
.
id
=
""
;
$
(
"
#pagePermalink
"
).
val
(
""
);
$
(
"
#pagePermalink
"
).
val
(
""
);
$
(
"
#pageTitle
"
).
val
(
""
);
$
(
"
#pageTitle
"
).
val
(
""
);
$
(
"
#pageCommentable
"
).
prop
(
"
cheked
"
,
false
);
$
(
"
#pageCommentable
"
).
prop
(
"
cheked
"
,
false
);
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editors
.
pageEditor
.
setContent
(
""
);
admin
.
editors
.
pageEditor
.
setContent
(
""
);
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
admin
.
pageList
.
pageInfo
.
pageCount
++
;
admin
.
pageList
.
pageInfo
.
pageCount
++
;
}
}
var
hashList
=
window
.
location
.
hash
.
split
(
"
/
"
);
var
hashList
=
window
.
location
.
hash
.
split
(
"
/
"
);
...
@@ -2155,13 +2201,12 @@ admin.pageList = {
...
@@ -2155,13 +2201,12 @@ admin.pageList = {
}
else
{
}
else
{
admin
.
setHashByPage
(
admin
.
pageList
.
pageInfo
.
pageCount
);
admin
.
setHashByPage
(
admin
.
pageList
.
pageInfo
.
pageCount
);
}
}
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
}
}
},
},
/*
/*
* 更新自定义页面
* 更新自定义页面
*/
*/
...
@@ -2169,15 +2214,15 @@ admin.pageList = {
...
@@ -2169,15 +2214,15 @@ admin.pageList = {
if
(
this
.
validate
())
{
if
(
this
.
validate
())
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editors
.
pageEditor
.
getContent
();
var
pageContent
=
admin
.
editors
.
pageEditor
.
getContent
();
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
pagePermalink
=
Util
.
proessURL
(
pagePermalink
);
pagePermalink
=
Util
.
proessURL
(
pagePermalink
);
}
}
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
"
pageTitle
"
:
$
(
"
#pageTitle
"
).
val
(),
"
pageTitle
"
:
$
(
"
#pageTitle
"
).
val
(),
...
@@ -2186,24 +2231,25 @@ admin.pageList = {
...
@@ -2186,24 +2231,25 @@ admin.pageList = {
"
pagePermalink
"
:
pagePermalink
,
"
pagePermalink
"
:
pagePermalink
,
"
pageCommentable
"
:
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
),
"
pageCommentable
"
:
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
),
"
pageType
"
:
admin
.
pageList
.
type
,
"
pageType
"
:
admin
.
pageList
.
type
,
"
pageOpenTarget
"
:
$
(
"
#pageTarget
"
).
val
()
"
pageOpenTarget
"
:
$
(
"
#pageTarget
"
).
val
(),
"
pageEditorType
"
:
admin
.
pageList
.
currentEditorType
}
}
};
};
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
,
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
,
type
:
"
PUT
"
,
type
:
"
PUT
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
admin
.
pageList
.
id
=
""
;
admin
.
pageList
.
id
=
""
;
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
);
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
);
$
(
"
#pageTitle
"
).
val
(
""
);
$
(
"
#pageTitle
"
).
val
(
""
);
$
(
"
#pagePermalink
"
).
val
(
""
);
$
(
"
#pagePermalink
"
).
val
(
""
);
...
@@ -2212,29 +2258,27 @@ admin.pageList = {
...
@@ -2212,29 +2258,27 @@ admin.pageList = {
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editors
.
pageEditor
.
setContent
(
""
);
admin
.
editors
.
pageEditor
.
setContent
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
}
}
},
},
/*
/*
* 验证字段
* 验证字段
*/
*/
validate
:
function
()
{
validate
:
function
()
{
if
(
$
(
"
#pageTitle
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
if
(
$
(
"
#pageTitle
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
);
$
(
"
#pageTitle
"
).
focus
();
$
(
"
#pageTitle
"
).
focus
();
}
else
if
(
admin
.
pageList
.
type
===
"
link
"
&&
}
else
if
(
admin
.
pageList
.
type
===
"
link
"
&&
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
linkEmptyLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
linkEmptyLabel
);
}
else
{
}
else
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
},
},
/*
/*
* 提交自定义页面
* 提交自定义页面
*/
*/
...
@@ -2244,31 +2288,37 @@ admin.pageList = {
...
@@ -2244,31 +2288,37 @@ admin.pageList = {
}
else
{
}
else
{
this
.
add
();
this
.
add
();
}
}
if
(
admin
.
pageList
.
currentEditorType
!==
Label
.
editorType
)
{
admin
.
editors
.
pageEditor
.
remove
();
admin
.
pageList
.
currentEditorType
=
Label
.
editorType
;
admin
.
editors
.
pageEditor
.
init
(
Label
.
editorType
);
}
},
},
/*
/*
* 调换顺序
* 调换顺序
*/
*/
changeOrder
:
function
(
id
,
order
,
status
)
{
changeOrder
:
function
(
id
,
order
,
status
)
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
oId
"
:
id
.
toString
(),
"
oId
"
:
id
.
toString
(),
"
direction
"
:
status
"
direction
"
:
status
};
};
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/page/order/
"
,
url
:
latkeConfig
.
servePath
+
"
/console/page/order/
"
,
type
:
"
PUT
"
,
type
:
"
PUT
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
// Refershes the page list
// Refershes the page list
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
);
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
...
@@ -2278,7 +2328,7 @@ admin.pageList = {
...
@@ -2278,7 +2328,7 @@ admin.pageList = {
/*
/*
* 注册到 admin 进行管理
* 注册到 admin 进行管理
*/
*/
admin
.
register
[
"
page-list
"
]
=
{
admin
.
register
[
"
page-list
"
]
=
{
"
obj
"
:
admin
.
pageList
,
"
obj
"
:
admin
.
pageList
,
"
init
"
:
admin
.
pageList
.
init
,
"
init
"
:
admin
.
pageList
.
init
,
"
refresh
"
:
admin
.
pageList
.
getList
"
refresh
"
:
admin
.
pageList
.
getList
...
...
war/src/main/webapp/js/admin/latkeAdmin.min.js
View file @
886481c7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
war/src/main/webapp/js/admin/pageList.js
View file @
886481c7
...
@@ -18,12 +18,13 @@
...
@@ -18,12 +18,13 @@
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.
0.2.4, May 28, 2013
* @version 1.
1.2.4, May 30, 2015
*/
*/
/* page-list 相关操作 */
/* page-list 相关操作 */
admin
.
pageList
=
{
admin
.
pageList
=
{
tablePagination
:
new
TablePaginate
(
"
page
"
),
currentEditorType
:
''
,
tablePagination
:
new
TablePaginate
(
"
page
"
),
pageInfo
:
{
pageInfo
:
{
currentCount
:
1
,
currentCount
:
1
,
pageCount
:
1
,
pageCount
:
1
,
...
@@ -31,75 +32,75 @@ admin.pageList = {
...
@@ -31,75 +32,75 @@ admin.pageList = {
},
},
id
:
""
,
id
:
""
,
type
:
"
link
"
,
type
:
"
link
"
,
/*
/*
* 初始化 table, pagination, comments dialog
* 初始化 table, pagination, comments dialog
*/
*/
init
:
function
(
page
)
{
init
:
function
(
page
)
{
this
.
tablePagination
.
buildTable
([{
this
.
tablePagination
.
buildTable
([{
text
:
""
,
text
:
""
,
index
:
"
pageOrder
"
,
index
:
"
pageOrder
"
,
width
:
60
,
width
:
60
,
style
:
"
padding-left: 12px;font-size:14px;
"
style
:
"
padding-left: 12px;font-size:14px;
"
},
{
},
{
style
:
"
padding-left: 12px;
"
,
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
titleLabel
,
text
:
Label
.
titleLabel
,
index
:
"
pageTitle
"
,
index
:
"
pageTitle
"
,
width
:
300
width
:
300
},
{
},
{
style
:
"
padding-left: 12px;
"
,
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
permalinkLabel
,
text
:
Label
.
permalinkLabel
,
index
:
"
pagePermalink
"
,
index
:
"
pagePermalink
"
,
minWidth
:
300
minWidth
:
300
},
{
},
{
style
:
"
padding-left: 12px;
"
,
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
openMethodLabel
,
text
:
Label
.
openMethodLabel
,
index
:
"
pageTarget
"
,
index
:
"
pageTarget
"
,
width
:
120
width
:
120
},
{
},
{
style
:
"
padding-left: 12px;
"
,
style
:
"
padding-left: 12px;
"
,
text
:
Label
.
typeLabel
,
text
:
Label
.
typeLabel
,
index
:
"
pageType
"
,
index
:
"
pageType
"
,
width
:
80
width
:
80
},
{
},
{
text
:
Label
.
commentLabel
,
text
:
Label
.
commentLabel
,
index
:
"
comments
"
,
index
:
"
comments
"
,
width
:
80
,
width
:
80
,
style
:
"
padding-left: 12px;
"
style
:
"
padding-left: 12px;
"
}]);
}]);
this
.
tablePagination
.
initPagination
();
this
.
tablePagination
.
initPagination
();
this
.
tablePagination
.
initCommentsDialog
();
this
.
tablePagination
.
initCommentsDialog
();
this
.
getList
(
page
);
this
.
getList
(
page
);
var
language
=
Label
.
localeString
.
substring
(
0
,
2
);
var
language
=
Label
.
localeString
.
substring
(
0
,
2
);
if
(
language
===
"
zh
"
)
{
if
(
language
===
"
zh
"
)
{
language
=
"
zh-cn
"
;
language
=
"
zh-cn
"
;
}
}
admin
.
pageList
.
currentEditorType
=
Label
.
editorType
;
admin
.
editors
.
pageEditor
=
new
Editor
({
admin
.
editors
.
pageEditor
=
new
Editor
({
language
:
language
,
language
:
language
,
kind
:
"
all
"
,
kind
:
"
all
"
,
id
:
"
pageContent
"
id
:
"
pageContent
"
});
});
// select type
// select type
$
(
"
.fn-type
"
).
click
(
function
()
{
$
(
"
.fn-type
"
).
click
(
function
()
{
var
$it
=
$
(
this
);
var
$it
=
$
(
this
);
if
(
$it
.
hasClass
(
"
selected
"
))
{
if
(
$it
.
hasClass
(
"
selected
"
))
{
return
;
return
;
}
}
$
(
"
.fn-type
"
).
removeClass
(
"
selected
"
);
$
(
"
.fn-type
"
).
removeClass
(
"
selected
"
);
$it
.
addClass
(
"
selected
"
);
$it
.
addClass
(
"
selected
"
);
admin
.
pageList
.
type
=
$it
.
data
(
"
type
"
);
admin
.
pageList
.
type
=
$it
.
data
(
"
type
"
);
if
(
admin
.
pageList
.
type
===
"
page
"
)
{
if
(
admin
.
pageList
.
type
===
"
page
"
)
{
$
(
"
#pagePagePanel
"
).
slideDown
();
$
(
"
#pagePagePanel
"
).
slideDown
();
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
&&
admin
.
editors
.
pageEditor
.
getContent
()
===
""
)
{
&&
admin
.
editors
.
pageEditor
.
getContent
()
===
""
)
{
admin
.
editors
.
pageEditor
.
setContent
(
""
);
admin
.
editors
.
pageEditor
.
setContent
(
""
);
}
}
}
else
{
}
else
{
...
@@ -107,7 +108,6 @@ admin.pageList = {
...
@@ -107,7 +108,6 @@ admin.pageList = {
}
}
});
});
},
},
/*
/*
* 根据当前页码获取列表
* 根据当前页码获取列表
* @pagNum 当前页码
* @pagNum 当前页码
...
@@ -116,18 +116,18 @@ admin.pageList = {
...
@@ -116,18 +116,18 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
that
=
this
;
var
that
=
this
;
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/pages/
"
+
pageNum
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
url
:
latkeConfig
.
servePath
+
"
/console/pages/
"
+
pageNum
+
"
/
"
+
Label
.
PAGE_SIZE
+
"
/
"
+
Label
.
WINDOW_SIZE
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
var
pages
=
result
.
pages
;
var
pages
=
result
.
pages
;
var
pageData
=
[];
var
pageData
=
[];
admin
.
pageList
.
pageInfo
.
currentCount
=
pages
.
length
;
admin
.
pageList
.
pageInfo
.
currentCount
=
pages
.
length
;
...
@@ -152,27 +152,26 @@ admin.pageList = {
...
@@ -152,27 +152,26 @@ admin.pageList = {
<span onclick="admin.pageList.changeOrder(
'
+
pages
[
i
].
oId
+
'
,
'
+
i
+
'
,
\'
down
\'
);" class="table-downIcon"></span>
\
<span onclick="admin.pageList.changeOrder(
'
+
pages
[
i
].
oId
+
'
,
'
+
i
+
'
,
\'
down
\'
);" class="table-downIcon"></span>
\
</div>
'
;
</div>
'
;
}
}
pageData
[
i
].
pageTitle
=
"
<a class='no-underline' href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
pageData
[
i
].
pageTitle
=
"
<a class='no-underline' href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
pages
[
i
].
pageTitle
+
"
</a>
"
;
pages
[
i
].
pageTitle
+
"
</a>
"
;
pageData
[
i
].
pagePermalink
=
"
<a class='no-underline' href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
pageData
[
i
].
pagePermalink
=
"
<a class='no-underline' href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
pages
[
i
].
pagePermalink
+
"
</a>
"
;
+
pages
[
i
].
pagePermalink
+
"
</a>
"
;
pageData
[
i
].
pageTarget
=
pages
[
i
].
pageOpenTarget
;
pageData
[
i
].
pageTarget
=
pages
[
i
].
pageOpenTarget
;
pageData
[
i
].
pageType
=
pages
[
i
].
pageType
;
pageData
[
i
].
pageType
=
pages
[
i
].
pageType
;
pageData
[
i
].
comments
=
pages
[
i
].
pageCommentCount
;
pageData
[
i
].
comments
=
pages
[
i
].
pageCommentCount
;
pageData
[
i
].
expendRow
=
"
<span><a href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
Label
.
viewLabel
+
"
</a>
\
pageData
[
i
].
expendRow
=
"
<span><a href='
"
+
pages
[
i
].
pagePermalink
+
"
' target='_blank'>
"
+
Label
.
viewLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.pageList.get('
"
+
pages
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
updateLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.pageList.get('
"
+
pages
[
i
].
oId
+
"
')
\"
>
"
+
Label
.
updateLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.pageList.del('
"
+
pages
[
i
].
oId
+
"
', '
"
+
pages
[
i
].
pageTitle
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.pageList.del('
"
+
pages
[
i
].
oId
+
"
', '
"
+
pages
[
i
].
pageTitle
+
"
')
\"
>
"
+
Label
.
removeLabel
+
"
</a>
\
<a href='javascript:void(0)' onclick=
\"
admin.comment.open('
"
+
pages
[
i
].
oId
+
"
', 'page')
\"
>
"
+
Label
.
commentLabel
+
"
</a></span>
"
;
<a href='javascript:void(0)' onclick=
\"
admin.comment.open('
"
+
pages
[
i
].
oId
+
"
', 'page')
\"
>
"
+
Label
.
commentLabel
+
"
</a></span>
"
;
}
}
that
.
tablePagination
.
updateTablePagination
(
pageData
,
pageNum
,
result
.
pagination
);
that
.
tablePagination
.
updateTablePagination
(
pageData
,
pageNum
,
result
.
pagination
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
},
},
/*
/*
* 获取自定义页面
* 获取自定义页面
* @id 自定义页面 id
* @id 自定义页面 id
...
@@ -180,20 +179,20 @@ admin.pageList = {
...
@@ -180,20 +179,20 @@ admin.pageList = {
get
:
function
(
id
)
{
get
:
function
(
id
)
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
+
id
,
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
+
id
,
type
:
"
GET
"
,
type
:
"
GET
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
admin
.
pageList
.
id
=
id
;
admin
.
pageList
.
id
=
id
;
$
(
"
#pageTitle
"
).
val
(
result
.
page
.
pageTitle
);
$
(
"
#pageTitle
"
).
val
(
result
.
page
.
pageTitle
);
$
(
"
#pagePermalink
"
).
val
(
result
.
page
.
pagePermalink
);
$
(
"
#pagePermalink
"
).
val
(
result
.
page
.
pagePermalink
);
$
(
"
#pageTarget
"
).
val
(
result
.
page
.
pageOpenTarget
);
$
(
"
#pageTarget
"
).
val
(
result
.
page
.
pageOpenTarget
);
...
@@ -204,13 +203,19 @@ admin.pageList = {
...
@@ -204,13 +203,19 @@ admin.pageList = {
}
}
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
,
result
.
page
.
pageCommentable
);
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
,
result
.
page
.
pageCommentable
);
if
(
admin
.
pageList
.
currentEditorType
!==
result
.
page
.
pageEditorType
)
{
admin
.
editors
.
pageEditor
.
remove
();
admin
.
pageList
.
currentEditorType
=
result
.
page
.
pageEditorType
;
admin
.
editors
.
pageEditor
.
init
(
result
.
page
.
pageEditorType
);
}
admin
.
editors
.
pageEditor
.
setContent
(
result
.
page
.
pageContent
);
admin
.
editors
.
pageEditor
.
setContent
(
result
.
page
.
pageContent
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
},
},
/*
/*
* 删除自定义页面
* 删除自定义页面
* @id 自定义页面 id
* @id 自定义页面 id
...
@@ -226,16 +231,16 @@ admin.pageList = {
...
@@ -226,16 +231,16 @@ admin.pageList = {
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
+
id
,
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
+
id
,
type
:
"
DELETE
"
,
type
:
"
DELETE
"
,
cache
:
false
,
cache
:
false
,
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
var
pageNum
=
admin
.
pageList
.
pageInfo
.
currentPage
;
var
pageNum
=
admin
.
pageList
.
pageInfo
.
currentPage
;
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
1
&&
admin
.
pageList
.
pageInfo
.
pageCount
!==
1
&&
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
1
&&
admin
.
pageList
.
pageInfo
.
pageCount
!==
1
&&
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
admin
.
pageList
.
pageInfo
.
pageCount
--
;
admin
.
pageList
.
pageInfo
.
pageCount
--
;
pageNum
=
admin
.
pageList
.
pageInfo
.
pageCount
;
pageNum
=
admin
.
pageList
.
pageInfo
.
pageCount
;
}
}
...
@@ -245,13 +250,12 @@ admin.pageList = {
...
@@ -245,13 +250,12 @@ admin.pageList = {
}
else
{
}
else
{
admin
.
setHashByPage
(
pageNum
);
admin
.
setHashByPage
(
pageNum
);
}
}
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
}
}
},
},
/*
/*
* 添加自定义页面
* 添加自定义页面
*/
*/
...
@@ -259,14 +263,14 @@ admin.pageList = {
...
@@ -259,14 +263,14 @@ admin.pageList = {
if
(
this
.
validate
())
{
if
(
this
.
validate
())
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editors
.
pageEditor
.
getContent
();
var
pageContent
=
admin
.
editors
.
pageEditor
.
getContent
();
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
pagePermalink
=
Util
.
proessURL
(
pagePermalink
);
pagePermalink
=
Util
.
proessURL
(
pagePermalink
);
}
}
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
"
pageTitle
"
:
$
(
"
#pageTitle
"
).
val
(),
"
pageTitle
"
:
$
(
"
#pageTitle
"
).
val
(),
...
@@ -277,30 +281,30 @@ admin.pageList = {
...
@@ -277,30 +281,30 @@ admin.pageList = {
"
pageOpenTarget
"
:
$
(
"
#pageTarget
"
).
val
()
"
pageOpenTarget
"
:
$
(
"
#pageTarget
"
).
val
()
}
}
};
};
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
,
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
,
type
:
"
POST
"
,
type
:
"
POST
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
admin
.
pageList
.
id
=
""
;
admin
.
pageList
.
id
=
""
;
$
(
"
#pagePermalink
"
).
val
(
""
);
$
(
"
#pagePermalink
"
).
val
(
""
);
$
(
"
#pageTitle
"
).
val
(
""
);
$
(
"
#pageTitle
"
).
val
(
""
);
$
(
"
#pageCommentable
"
).
prop
(
"
cheked
"
,
false
);
$
(
"
#pageCommentable
"
).
prop
(
"
cheked
"
,
false
);
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editors
.
pageEditor
.
setContent
(
""
);
admin
.
editors
.
pageEditor
.
setContent
(
""
);
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
admin
.
pageList
.
pageInfo
.
pageCount
++
;
admin
.
pageList
.
pageInfo
.
pageCount
++
;
}
}
var
hashList
=
window
.
location
.
hash
.
split
(
"
/
"
);
var
hashList
=
window
.
location
.
hash
.
split
(
"
/
"
);
...
@@ -309,13 +313,12 @@ admin.pageList = {
...
@@ -309,13 +313,12 @@ admin.pageList = {
}
else
{
}
else
{
admin
.
setHashByPage
(
admin
.
pageList
.
pageInfo
.
pageCount
);
admin
.
setHashByPage
(
admin
.
pageList
.
pageInfo
.
pageCount
);
}
}
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
}
}
},
},
/*
/*
* 更新自定义页面
* 更新自定义页面
*/
*/
...
@@ -323,15 +326,15 @@ admin.pageList = {
...
@@ -323,15 +326,15 @@ admin.pageList = {
if
(
this
.
validate
())
{
if
(
this
.
validate
())
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editors
.
pageEditor
.
getContent
();
var
pageContent
=
admin
.
editors
.
pageEditor
.
getContent
();
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
pagePermalink
=
Util
.
proessURL
(
pagePermalink
);
pagePermalink
=
Util
.
proessURL
(
pagePermalink
);
}
}
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
"
pageTitle
"
:
$
(
"
#pageTitle
"
).
val
(),
"
pageTitle
"
:
$
(
"
#pageTitle
"
).
val
(),
...
@@ -340,24 +343,25 @@ admin.pageList = {
...
@@ -340,24 +343,25 @@ admin.pageList = {
"
pagePermalink
"
:
pagePermalink
,
"
pagePermalink
"
:
pagePermalink
,
"
pageCommentable
"
:
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
),
"
pageCommentable
"
:
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
),
"
pageType
"
:
admin
.
pageList
.
type
,
"
pageType
"
:
admin
.
pageList
.
type
,
"
pageOpenTarget
"
:
$
(
"
#pageTarget
"
).
val
()
"
pageOpenTarget
"
:
$
(
"
#pageTarget
"
).
val
(),
"
pageEditorType
"
:
admin
.
pageList
.
currentEditorType
}
}
};
};
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
,
url
:
latkeConfig
.
servePath
+
"
/console/page/
"
,
type
:
"
PUT
"
,
type
:
"
PUT
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
if
(
!
result
.
sc
)
{
if
(
!
result
.
sc
)
{
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
return
;
return
;
}
}
admin
.
pageList
.
id
=
""
;
admin
.
pageList
.
id
=
""
;
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
);
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
);
$
(
"
#pageTitle
"
).
val
(
""
);
$
(
"
#pageTitle
"
).
val
(
""
);
$
(
"
#pagePermalink
"
).
val
(
""
);
$
(
"
#pagePermalink
"
).
val
(
""
);
...
@@ -366,29 +370,27 @@ admin.pageList = {
...
@@ -366,29 +370,27 @@ admin.pageList = {
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editors
.
pageEditor
.
setContent
(
""
);
admin
.
editors
.
pageEditor
.
setContent
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
}
}
},
},
/*
/*
* 验证字段
* 验证字段
*/
*/
validate
:
function
()
{
validate
:
function
()
{
if
(
$
(
"
#pageTitle
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
if
(
$
(
"
#pageTitle
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
);
$
(
"
#pageTitle
"
).
focus
();
$
(
"
#pageTitle
"
).
focus
();
}
else
if
(
admin
.
pageList
.
type
===
"
link
"
&&
}
else
if
(
admin
.
pageList
.
type
===
"
link
"
&&
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
linkEmptyLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
linkEmptyLabel
);
}
else
{
}
else
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
},
},
/*
/*
* 提交自定义页面
* 提交自定义页面
*/
*/
...
@@ -398,31 +400,37 @@ admin.pageList = {
...
@@ -398,31 +400,37 @@ admin.pageList = {
}
else
{
}
else
{
this
.
add
();
this
.
add
();
}
}
if
(
admin
.
pageList
.
currentEditorType
!==
Label
.
editorType
)
{
admin
.
editors
.
pageEditor
.
remove
();
admin
.
pageList
.
currentEditorType
=
Label
.
editorType
;
admin
.
editors
.
pageEditor
.
init
(
Label
.
editorType
);
}
},
},
/*
/*
* 调换顺序
* 调换顺序
*/
*/
changeOrder
:
function
(
id
,
order
,
status
)
{
changeOrder
:
function
(
id
,
order
,
status
)
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
oId
"
:
id
.
toString
(),
"
oId
"
:
id
.
toString
(),
"
direction
"
:
status
"
direction
"
:
status
};
};
$
.
ajax
({
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/console/page/order/
"
,
url
:
latkeConfig
.
servePath
+
"
/console/page/order/
"
,
type
:
"
PUT
"
,
type
:
"
PUT
"
,
cache
:
false
,
cache
:
false
,
data
:
JSON
.
stringify
(
requestJSONObject
),
data
:
JSON
.
stringify
(
requestJSONObject
),
success
:
function
(
result
,
textStatus
)
{
success
:
function
(
result
,
textStatus
)
{
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
$
(
"
#tipMsg
"
).
text
(
result
.
msg
);
// Refershes the page list
// Refershes the page list
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
);
admin
.
pageList
.
getList
(
admin
.
pageList
.
pageInfo
.
currentPage
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
});
});
...
@@ -432,7 +440,7 @@ admin.pageList = {
...
@@ -432,7 +440,7 @@ admin.pageList = {
/*
/*
* 注册到 admin 进行管理
* 注册到 admin 进行管理
*/
*/
admin
.
register
[
"
page-list
"
]
=
{
admin
.
register
[
"
page-list
"
]
=
{
"
obj
"
:
admin
.
pageList
,
"
obj
"
:
admin
.
pageList
,
"
init
"
:
admin
.
pageList
.
init
,
"
init
"
:
admin
.
pageList
.
init
,
"
refresh
"
:
admin
.
pageList
.
getList
"
refresh
"
:
admin
.
pageList
.
getList
...
...
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