Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
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
Commits
eba3a79a
Commit
eba3a79a
authored
Jan 29, 2013
by
Vanessa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #176
parent
c556e741
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
90 additions
and
74 deletions
+90
-74
war/src/main/webapp/admin-article.ftl
war/src/main/webapp/admin-article.ftl
+1
-1
war/src/main/webapp/js/admin/admin.js
war/src/main/webapp/js/admin/admin.js
+10
-6
war/src/main/webapp/js/admin/article.js
war/src/main/webapp/js/admin/article.js
+20
-17
war/src/main/webapp/js/admin/editor.js
war/src/main/webapp/js/admin/editor.js
+4
-4
war/src/main/webapp/js/admin/latkeAdmin.js
war/src/main/webapp/js/admin/latkeAdmin.js
+44
-36
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
+10
-9
No files found.
war/src/main/webapp/admin-article.ftl
View file @
eba3a79a
...
...
@@ -41,7 +41,7 @@
</span>
<div class="right">
<label for="articleCommentable">${allowComment1Label}</label>
<input type="checkbox" id="articleCommentable" checked="checked" />
<input type="checkbox" id="articleCommentable" checked="checked" />
<span id="postToCommunityPanel">
<label for="postToCommunity">
<a class="no-underline" href="http://symphony.b3log.org/usage" target="_blank">${postToCommunityLabel}</a>
...
...
war/src/main/webapp/js/admin/admin.js
View file @
eba3a79a
...
...
@@ -17,7 +17,7 @@
* index for admin
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.2.
0, Aug 30, 2012
* @version 1.0.2.
1, Jan 29, 2013
*/
var
Admin
=
function
()
{
...
...
@@ -101,7 +101,8 @@ $.extend(Admin.prototype, {
try
{
// 除更新、发布、取消发布文章,编辑器中无内容外,离开编辑器需进行提示。
if
(
tab
!==
"
article
"
&&
admin
.
article
.
isConfirm
&&
admin
.
editorArticle
.
getContent
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
())
{
if
(
!
confirm
(
Label
.
editorLeaveLabel
))
{
window
.
location
.
hash
=
"
#article/article
"
;
return
;
...
...
@@ -109,14 +110,16 @@ $.extend(Admin.prototype, {
}
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
if
(
tab
===
"
article
"
&&
admin
.
article
.
isConfirm
&&
admin
.
editorArticle
.
getContent
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
())
{
return
;
}
}
catch
(
e
)
{
var
$articleContent
=
$
(
'
#articleContent
'
);
if
(
$articleContent
.
length
>
0
)
{
if
(
tab
!==
"
article
"
&&
admin
.
article
.
isConfirm
&&
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
$articleContent
.
val
())
{
if
(
!
confirm
(
Label
.
editorLeaveLabel
))
{
window
.
location
.
hash
=
"
#article/article
"
;
return
;
...
...
@@ -124,14 +127,15 @@ $.extend(Admin.prototype, {
}
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
if
(
tab
===
"
article
"
&&
admin
.
article
.
isConfirm
&&
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
$articleContent
.
val
())
{
return
;
}
}
}
// clear article
if
(
tab
!==
"
article
"
&&
admin
.
editor
Article
.
setContent
)
{
if
(
tab
!==
"
article
"
&&
admin
.
editor
s
.
articleEditor
.
setContent
)
{
admin
.
article
.
clear
();
}
admin
.
article
.
isConfirm
=
true
;
...
...
war/src/main/webapp/js/admin/article.js
View file @
eba3a79a
...
...
@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.
2.9, May 3, 2012
* @version 1.0.
3.0, Jan 29, 2013
*/
admin
.
article
=
{
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
...
...
@@ -28,7 +28,7 @@ admin.article = {
isArticle
:
undefined
,
articleHadBeenPublished
:
undefined
},
content
:
""
,
/*
* 获取文章并把值塞入发布文章页面
* @id 文章 id
...
...
@@ -58,9 +58,10 @@ admin.article = {
$
(
"
#title
"
).
val
(
result
.
article
.
articleTitle
);
admin
.
article
.
status
.
articleHadBeenPublished
=
result
.
article
.
articleHadBeenPublished
;
admin
.
editorArticle
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editorAbstract
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
editors
.
articleEditor
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editors
.
abstractEditor
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
article
.
content
=
admin
.
editors
.
articleEditor
.
getContent
();
var
tags
=
result
.
article
.
articleTags
,
tagsString
=
''
;
for
(
var
i
=
0
;
i
<
tags
.
length
;
i
++
)
{
...
...
@@ -139,8 +140,8 @@ admin.article = {
}
});
var
articleContent
=
admin
.
editor
Article
.
getContent
(),
articleAbstract
=
admin
.
editor
Abstract
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
(),
articleAbstract
=
admin
.
editor
s
.
abstractEditor
.
getContent
();
var
requestJSONObject
=
{
"
article
"
:
{
...
...
@@ -209,8 +210,8 @@ admin.article = {
}
});
var
articleContent
=
admin
.
editor
Article
.
getContent
(),
articleAbstract
=
admin
.
editor
Abstract
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
(),
articleAbstract
=
admin
.
editor
s
.
abstractEditor
.
getContent
();
var
requestJSONObject
=
{
"
article
"
:
{
...
...
@@ -304,8 +305,8 @@ admin.article = {
$
(
"
#title
"
).
val
(
""
);
admin
.
editor
Article
.
setContent
(
""
);
admin
.
editor
Abstract
.
setContent
(
""
);
admin
.
editor
s
.
articleEditor
.
setContent
(
""
);
admin
.
editor
s
.
abstractEditor
.
setContent
(
""
);
// reset tag
$
(
"
#tag
"
).
val
(
""
);
...
...
@@ -321,6 +322,8 @@ admin.article = {
this
.
className
=
""
;
}
});
$
(
"
.markdown-preview-main
"
).
html
(
""
);
},
/*
...
...
@@ -413,14 +416,14 @@ admin.article = {
});
// editor
admin
.
editor
Article
=
new
Editor
({
admin
.
editor
s
.
articleEditor
=
new
Editor
({
id
:
"
articleContent
"
,
kind
:
"
all
"
,
fun
:
fun
,
height
:
500
});
admin
.
editor
Abstract
=
new
Editor
({
admin
.
editor
s
.
abstractEditor
=
new
Editor
({
id
:
"
abstract
"
,
kind
:
"
simple
"
,
height
:
200
...
...
@@ -431,7 +434,7 @@ admin.article = {
* 验证发布文章字段的合法性
*/
validate
:
function
()
{
var
articleContent
=
admin
.
editor
Article
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
();
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
);
...
...
@@ -498,12 +501,12 @@ admin.article = {
*/
prePost
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
if
(
!
admin
.
editor
Article
.
getContent
)
{
admin
.
article
.
content
=
""
;
if
(
!
admin
.
editor
s
.
articleEditor
.
getContent
)
{
return
;
}
var
articleContent
=
admin
.
editor
Article
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
();
if
(
window
.
location
.
hash
===
"
#article/article
"
&&
articleContent
.
replace
(
/
\s
/g
,
''
)
!==
""
)
{
...
...
war/src/main/webapp/js/admin/editor.js
View file @
eba3a79a
...
...
@@ -17,7 +17,7 @@
* @fileoverview editor
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.
3, Apr 29, 2012
* @version 1.0.0.
4, Jan 29, 2013
*/
admin
.
editors
=
{};
...
...
@@ -86,6 +86,6 @@ $.extend(Editor.prototype, {
}
});
admin
.
editor
Article
=
{};
admin
.
editor
Abstract
=
{};
admin
.
editor
Page
=
{};
admin
.
editor
s
.
articleEditor
=
{};
admin
.
editor
s
.
abstractEditor
=
{};
admin
.
editor
s
.
pageEditor
=
{};
war/src/main/webapp/js/admin/latkeAdmin.js
View file @
eba3a79a
...
...
@@ -17,7 +17,7 @@
* index for admin
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.2.
0, Aug 30, 2012
* @version 1.0.2.
1, Jan 29, 2013
*/
var
Admin
=
function
()
{
...
...
@@ -101,7 +101,8 @@ $.extend(Admin.prototype, {
try
{
// 除更新、发布、取消发布文章,编辑器中无内容外,离开编辑器需进行提示。
if
(
tab
!==
"
article
"
&&
admin
.
article
.
isConfirm
&&
admin
.
editorArticle
.
getContent
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
())
{
if
(
!
confirm
(
Label
.
editorLeaveLabel
))
{
window
.
location
.
hash
=
"
#article/article
"
;
return
;
...
...
@@ -109,14 +110,16 @@ $.extend(Admin.prototype, {
}
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
if
(
tab
===
"
article
"
&&
admin
.
article
.
isConfirm
&&
admin
.
editorArticle
.
getContent
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
())
{
return
;
}
}
catch
(
e
)
{
var
$articleContent
=
$
(
'
#articleContent
'
);
if
(
$articleContent
.
length
>
0
)
{
if
(
tab
!==
"
article
"
&&
admin
.
article
.
isConfirm
&&
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
$articleContent
.
val
())
{
if
(
!
confirm
(
Label
.
editorLeaveLabel
))
{
window
.
location
.
hash
=
"
#article/article
"
;
return
;
...
...
@@ -124,14 +127,15 @@ $.extend(Admin.prototype, {
}
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
if
(
tab
===
"
article
"
&&
admin
.
article
.
isConfirm
&&
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
$articleContent
.
val
())
{
return
;
}
}
}
// clear article
if
(
tab
!==
"
article
"
&&
admin
.
editor
Article
.
setContent
)
{
if
(
tab
!==
"
article
"
&&
admin
.
editor
s
.
articleEditor
.
setContent
)
{
admin
.
article
.
clear
();
}
admin
.
article
.
isConfirm
=
true
;
...
...
@@ -264,7 +268,7 @@ var admin = new Admin();/*
* @fileoverview editor
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.
3, Apr 29, 2012
* @version 1.0.0.
4, Jan 29, 2013
*/
admin
.
editors
=
{};
...
...
@@ -333,9 +337,9 @@ $.extend(Editor.prototype, {
}
});
admin
.
editor
Article
=
{};
admin
.
editor
Abstract
=
{};
admin
.
editor
Page
=
{};
admin
.
editor
s
.
articleEditor
=
{};
admin
.
editor
s
.
abstractEditor
=
{};
admin
.
editor
s
.
pageEditor
=
{};
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
*
...
...
@@ -861,7 +865,7 @@ $.extend(TablePaginate.prototype, {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.
2.9, May 3, 2012
* @version 1.0.
3.0, Jan 29, 2013
*/
admin
.
article
=
{
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
...
...
@@ -871,7 +875,7 @@ admin.article = {
isArticle
:
undefined
,
articleHadBeenPublished
:
undefined
},
content
:
""
,
/*
* 获取文章并把值塞入发布文章页面
* @id 文章 id
...
...
@@ -901,9 +905,10 @@ admin.article = {
$
(
"
#title
"
).
val
(
result
.
article
.
articleTitle
);
admin
.
article
.
status
.
articleHadBeenPublished
=
result
.
article
.
articleHadBeenPublished
;
admin
.
editorArticle
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editorAbstract
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
editors
.
articleEditor
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editors
.
abstractEditor
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
article
.
content
=
admin
.
editors
.
articleEditor
.
getContent
();
var
tags
=
result
.
article
.
articleTags
,
tagsString
=
''
;
for
(
var
i
=
0
;
i
<
tags
.
length
;
i
++
)
{
...
...
@@ -982,8 +987,8 @@ admin.article = {
}
});
var
articleContent
=
admin
.
editor
Article
.
getContent
(),
articleAbstract
=
admin
.
editor
Abstract
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
(),
articleAbstract
=
admin
.
editor
s
.
abstractEditor
.
getContent
();
var
requestJSONObject
=
{
"
article
"
:
{
...
...
@@ -1052,8 +1057,8 @@ admin.article = {
}
});
var
articleContent
=
admin
.
editor
Article
.
getContent
(),
articleAbstract
=
admin
.
editor
Abstract
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
(),
articleAbstract
=
admin
.
editor
s
.
abstractEditor
.
getContent
();
var
requestJSONObject
=
{
"
article
"
:
{
...
...
@@ -1147,8 +1152,8 @@ admin.article = {
$
(
"
#title
"
).
val
(
""
);
admin
.
editor
Article
.
setContent
(
""
);
admin
.
editor
Abstract
.
setContent
(
""
);
admin
.
editor
s
.
articleEditor
.
setContent
(
""
);
admin
.
editor
s
.
abstractEditor
.
setContent
(
""
);
// reset tag
$
(
"
#tag
"
).
val
(
""
);
...
...
@@ -1164,6 +1169,8 @@ admin.article = {
this
.
className
=
""
;
}
});
$
(
"
.markdown-preview-main
"
).
html
(
""
);
},
/*
...
...
@@ -1256,14 +1263,14 @@ admin.article = {
});
// editor
admin
.
editor
Article
=
new
Editor
({
admin
.
editor
s
.
articleEditor
=
new
Editor
({
id
:
"
articleContent
"
,
kind
:
"
all
"
,
fun
:
fun
,
height
:
500
});
admin
.
editor
Abstract
=
new
Editor
({
admin
.
editor
s
.
abstractEditor
=
new
Editor
({
id
:
"
abstract
"
,
kind
:
"
simple
"
,
height
:
200
...
...
@@ -1274,7 +1281,7 @@ admin.article = {
* 验证发布文章字段的合法性
*/
validate
:
function
()
{
var
articleContent
=
admin
.
editor
Article
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
();
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
);
...
...
@@ -1341,12 +1348,12 @@ admin.article = {
*/
prePost
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
if
(
!
admin
.
editor
Article
.
getContent
)
{
admin
.
article
.
content
=
""
;
if
(
!
admin
.
editor
s
.
articleEditor
.
getContent
)
{
return
;
}
var
articleContent
=
admin
.
editor
Article
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
();
if
(
window
.
location
.
hash
===
"
#article/article
"
&&
articleContent
.
replace
(
/
\s
/g
,
''
)
!==
""
)
{
...
...
@@ -1798,7 +1805,7 @@ admin.register["draft-list"] = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.2.
1, Jun 20, 2012
* @version 1.0.2.
2, Jun 29, 2013
*/
/* page-list 相关操作 */
...
...
@@ -1856,7 +1863,7 @@ admin.pageList = {
language
=
"
zh-cn
"
;
}
admin
.
editor
Page
=
new
Editor
({
admin
.
editor
s
.
pageEditor
=
new
Editor
({
language
:
language
,
kind
:
"
all
"
,
id
:
"
pageContent
"
...
...
@@ -1878,8 +1885,9 @@ admin.pageList = {
$
(
"
#pagePagePanel
"
).
slideDown
();
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
&&
admin
.
editorPage
.
getContent
()
===
""
)
{
admin
.
editorPage
.
setContent
(
""
);
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
&&
admin
.
editors
.
pageEditor
.
getContent
()
===
""
)
{
admin
.
editors
.
pageEditor
.
setContent
(
""
);
}
}
else
{
$
(
"
#pagePagePanel
"
).
slideUp
();
...
...
@@ -1982,7 +1990,7 @@ admin.pageList = {
}
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
,
result
.
page
.
pageCommentable
);
admin
.
editor
Page
.
setContent
(
result
.
page
.
pageContent
);
admin
.
editor
s
.
pageEditor
.
setContent
(
result
.
page
.
pageContent
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
...
...
@@ -2037,7 +2045,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editor
Page
.
getContent
();
var
pageContent
=
admin
.
editor
s
.
pageEditor
.
getContent
();
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
...
...
@@ -2074,7 +2082,7 @@ admin.pageList = {
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editor
Page
.
setContent
(
""
);
admin
.
editor
s
.
pageEditor
.
setContent
(
""
);
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
...
...
@@ -2101,7 +2109,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editor
Page
.
getContent
();
var
pageContent
=
admin
.
editor
s
.
pageEditor
.
getContent
();
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
...
...
@@ -2142,7 +2150,7 @@ admin.pageList = {
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editor
Page
.
setContent
(
""
);
admin
.
editor
s
.
pageEditor
.
setContent
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
...
...
war/src/main/webapp/js/admin/latkeAdmin.min.js
View file @
eba3a79a
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 @
eba3a79a
...
...
@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.2.
1, Jun 20, 2012
* @version 1.0.2.
2, Jun 29, 2013
*/
/* page-list 相关操作 */
...
...
@@ -76,7 +76,7 @@ admin.pageList = {
language
=
"
zh-cn
"
;
}
admin
.
editor
Page
=
new
Editor
({
admin
.
editor
s
.
pageEditor
=
new
Editor
({
language
:
language
,
kind
:
"
all
"
,
id
:
"
pageContent
"
...
...
@@ -98,8 +98,9 @@ admin.pageList = {
$
(
"
#pagePagePanel
"
).
slideDown
();
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
&&
admin
.
editorPage
.
getContent
()
===
""
)
{
admin
.
editorPage
.
setContent
(
""
);
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
&&
admin
.
editors
.
pageEditor
.
getContent
()
===
""
)
{
admin
.
editors
.
pageEditor
.
setContent
(
""
);
}
}
else
{
$
(
"
#pagePagePanel
"
).
slideUp
();
...
...
@@ -202,7 +203,7 @@ admin.pageList = {
}
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
,
result
.
page
.
pageCommentable
);
admin
.
editor
Page
.
setContent
(
result
.
page
.
pageContent
);
admin
.
editor
s
.
pageEditor
.
setContent
(
result
.
page
.
pageContent
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
...
...
@@ -257,7 +258,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editor
Page
.
getContent
();
var
pageContent
=
admin
.
editor
s
.
pageEditor
.
getContent
();
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
...
...
@@ -294,7 +295,7 @@ admin.pageList = {
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editor
Page
.
setContent
(
""
);
admin
.
editor
s
.
pageEditor
.
setContent
(
""
);
if
(
admin
.
pageList
.
pageInfo
.
currentCount
===
Label
.
PAGE_SIZE
&&
admin
.
pageList
.
pageInfo
.
currentPage
===
admin
.
pageList
.
pageInfo
.
pageCount
)
{
...
...
@@ -321,7 +322,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editor
Page
.
getContent
();
var
pageContent
=
admin
.
editor
s
.
pageEditor
.
getContent
();
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
if
(
admin
.
pageList
.
type
===
"
link
"
)
{
...
...
@@ -362,7 +363,7 @@ admin.pageList = {
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editor
Page
.
setContent
(
""
);
admin
.
editor
s
.
pageEditor
.
setContent
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
...
...
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