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
Expand all
Show 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 @@
...
@@ -41,7 +41,7 @@
</span>
</span>
<div class="right">
<div class="right">
<label for="articleCommentable">${allowComment1Label}</label>
<label for="articleCommentable">${allowComment1Label}</label>
<input type="checkbox" id="articleCommentable" checked="checked" />
<input type="checkbox" id="articleCommentable" checked="checked" />
<span id="postToCommunityPanel">
<span id="postToCommunityPanel">
<label for="postToCommunity">
<label for="postToCommunity">
<a class="no-underline" href="http://symphony.b3log.org/usage" target="_blank">${postToCommunityLabel}</a>
<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 @@
...
@@ -17,7 +17,7 @@
* index for admin
* index for admin
*
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @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
()
{
var
Admin
=
function
()
{
...
@@ -101,7 +101,8 @@ $.extend(Admin.prototype, {
...
@@ -101,7 +101,8 @@ $.extend(Admin.prototype, {
try
{
try
{
// 除更新、发布、取消发布文章,编辑器中无内容外,离开编辑器需进行提示。
// 除更新、发布、取消发布文章,编辑器中无内容外,离开编辑器需进行提示。
if
(
tab
!==
"
article
"
&&
admin
.
article
.
isConfirm
&&
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
))
{
if
(
!
confirm
(
Label
.
editorLeaveLabel
))
{
window
.
location
.
hash
=
"
#article/article
"
;
window
.
location
.
hash
=
"
#article/article
"
;
return
;
return
;
...
@@ -109,14 +110,16 @@ $.extend(Admin.prototype, {
...
@@ -109,14 +110,16 @@ $.extend(Admin.prototype, {
}
}
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
if
(
tab
===
"
article
"
&&
admin
.
article
.
isConfirm
&&
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
;
return
;
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
var
$articleContent
=
$
(
'
#articleContent
'
);
var
$articleContent
=
$
(
'
#articleContent
'
);
if
(
$articleContent
.
length
>
0
)
{
if
(
$articleContent
.
length
>
0
)
{
if
(
tab
!==
"
article
"
&&
admin
.
article
.
isConfirm
&&
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
))
{
if
(
!
confirm
(
Label
.
editorLeaveLabel
))
{
window
.
location
.
hash
=
"
#article/article
"
;
window
.
location
.
hash
=
"
#article/article
"
;
return
;
return
;
...
@@ -124,14 +127,15 @@ $.extend(Admin.prototype, {
...
@@ -124,14 +127,15 @@ $.extend(Admin.prototype, {
}
}
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
// 不离开编辑器,hash 需变为 "#article/article",此时不需要做任何处理。
if
(
tab
===
"
article
"
&&
admin
.
article
.
isConfirm
&&
if
(
tab
===
"
article
"
&&
admin
.
article
.
isConfirm
&&
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
)
{
$articleContent
.
val
().
replace
(
/
\s
/g
,
''
)
!==
""
&&
admin
.
article
.
content
!==
$articleContent
.
val
())
{
return
;
return
;
}
}
}
}
}
}
// clear article
// clear article
if
(
tab
!==
"
article
"
&&
admin
.
editor
Article
.
setContent
)
{
if
(
tab
!==
"
article
"
&&
admin
.
editor
s
.
articleEditor
.
setContent
)
{
admin
.
article
.
clear
();
admin
.
article
.
clear
();
}
}
admin
.
article
.
isConfirm
=
true
;
admin
.
article
.
isConfirm
=
true
;
...
...
war/src/main/webapp/js/admin/article.js
View file @
eba3a79a
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
*
*
* @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.9, May 3, 2012
* @version 1.0.
3.0, Jan 29, 2013
*/
*/
admin
.
article
=
{
admin
.
article
=
{
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
...
@@ -28,7 +28,7 @@ admin.article = {
...
@@ -28,7 +28,7 @@ admin.article = {
isArticle
:
undefined
,
isArticle
:
undefined
,
articleHadBeenPublished
:
undefined
articleHadBeenPublished
:
undefined
},
},
content
:
""
,
/*
/*
* 获取文章并把值塞入发布文章页面
* 获取文章并把值塞入发布文章页面
* @id 文章 id
* @id 文章 id
...
@@ -58,8 +58,9 @@ admin.article = {
...
@@ -58,8 +58,9 @@ 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
;
admin
.
editorArticle
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editors
.
articleEditor
.
setContent
(
result
.
article
.
articleContent
);
admin
.
editorAbstract
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
editors
.
abstractEditor
.
setContent
(
result
.
article
.
articleAbstract
);
admin
.
article
.
content
=
admin
.
editors
.
articleEditor
.
getContent
();
var
tags
=
result
.
article
.
articleTags
,
var
tags
=
result
.
article
.
articleTags
,
tagsString
=
''
;
tagsString
=
''
;
...
@@ -139,8 +140,8 @@ admin.article = {
...
@@ -139,8 +140,8 @@ admin.article = {
}
}
});
});
var
articleContent
=
admin
.
editor
Article
.
getContent
(),
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
(),
articleAbstract
=
admin
.
editor
Abstract
.
getContent
();
articleAbstract
=
admin
.
editor
s
.
abstractEditor
.
getContent
();
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
article
"
:
{
"
article
"
:
{
...
@@ -209,8 +210,8 @@ admin.article = {
...
@@ -209,8 +210,8 @@ admin.article = {
}
}
});
});
var
articleContent
=
admin
.
editor
Article
.
getContent
(),
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
(),
articleAbstract
=
admin
.
editor
Abstract
.
getContent
();
articleAbstract
=
admin
.
editor
s
.
abstractEditor
.
getContent
();
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
article
"
:
{
"
article
"
:
{
...
@@ -304,8 +305,8 @@ admin.article = {
...
@@ -304,8 +305,8 @@ admin.article = {
$
(
"
#title
"
).
val
(
""
);
$
(
"
#title
"
).
val
(
""
);
admin
.
editor
Article
.
setContent
(
""
);
admin
.
editor
s
.
articleEditor
.
setContent
(
""
);
admin
.
editor
Abstract
.
setContent
(
""
);
admin
.
editor
s
.
abstractEditor
.
setContent
(
""
);
// reset tag
// reset tag
$
(
"
#tag
"
).
val
(
""
);
$
(
"
#tag
"
).
val
(
""
);
...
@@ -321,6 +322,8 @@ admin.article = {
...
@@ -321,6 +322,8 @@ admin.article = {
this
.
className
=
""
;
this
.
className
=
""
;
}
}
});
});
$
(
"
.markdown-preview-main
"
).
html
(
""
);
},
},
/*
/*
...
@@ -413,14 +416,14 @@ admin.article = {
...
@@ -413,14 +416,14 @@ admin.article = {
});
});
// editor
// editor
admin
.
editor
Article
=
new
Editor
({
admin
.
editor
s
.
articleEditor
=
new
Editor
({
id
:
"
articleContent
"
,
id
:
"
articleContent
"
,
kind
:
"
all
"
,
kind
:
"
all
"
,
fun
:
fun
,
fun
:
fun
,
height
:
500
height
:
500
});
});
admin
.
editor
Abstract
=
new
Editor
({
admin
.
editor
s
.
abstractEditor
=
new
Editor
({
id
:
"
abstract
"
,
id
:
"
abstract
"
,
kind
:
"
simple
"
,
kind
:
"
simple
"
,
height
:
200
height
:
200
...
@@ -431,7 +434,7 @@ admin.article = {
...
@@ -431,7 +434,7 @@ admin.article = {
* 验证发布文章字段的合法性
* 验证发布文章字段的合法性
*/
*/
validate
:
function
()
{
validate
:
function
()
{
var
articleContent
=
admin
.
editor
Article
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
();
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
if
(
$
(
"
#title
"
).
val
().
replace
(
/
\s
/g
,
""
)
===
""
)
{
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
);
$
(
"
#tipMsg
"
).
text
(
Label
.
titleEmptyLabel
);
...
@@ -498,12 +501,12 @@ admin.article = {
...
@@ -498,12 +501,12 @@ admin.article = {
*/
*/
prePost
:
function
()
{
prePost
:
function
()
{
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
admin
.
article
.
content
=
""
;
if
(
!
admin
.
editor
Article
.
getContent
)
{
if
(
!
admin
.
editor
s
.
articleEditor
.
getContent
)
{
return
;
return
;
}
}
var
articleContent
=
admin
.
editor
Article
.
getContent
();
var
articleContent
=
admin
.
editor
s
.
articleEditor
.
getContent
();
if
(
window
.
location
.
hash
===
"
#article/article
"
&&
if
(
window
.
location
.
hash
===
"
#article/article
"
&&
articleContent
.
replace
(
/
\s
/g
,
''
)
!==
""
)
{
articleContent
.
replace
(
/
\s
/g
,
''
)
!==
""
)
{
...
...
war/src/main/webapp/js/admin/editor.js
View file @
eba3a79a
...
@@ -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.
3, Apr 29, 2012
* @version 1.0.0.
4, Jan 29, 2013
*/
*/
admin
.
editors
=
{};
admin
.
editors
=
{};
...
@@ -86,6 +86,6 @@ $.extend(Editor.prototype, {
...
@@ -86,6 +86,6 @@ $.extend(Editor.prototype, {
}
}
});
});
admin
.
editor
Article
=
{};
admin
.
editor
s
.
articleEditor
=
{};
admin
.
editor
Abstract
=
{};
admin
.
editor
s
.
abstractEditor
=
{};
admin
.
editor
Page
=
{};
admin
.
editor
s
.
pageEditor
=
{};
war/src/main/webapp/js/admin/latkeAdmin.js
View file @
eba3a79a
This diff is collapsed.
Click to expand it.
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 @@
...
@@ -18,7 +18,7 @@
*
*
* @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.
1, Jun 20, 2012
* @version 1.0.2.
2, Jun 29, 2013
*/
*/
/* page-list 相关操作 */
/* page-list 相关操作 */
...
@@ -76,7 +76,7 @@ admin.pageList = {
...
@@ -76,7 +76,7 @@ admin.pageList = {
language
=
"
zh-cn
"
;
language
=
"
zh-cn
"
;
}
}
admin
.
editor
Page
=
new
Editor
({
admin
.
editor
s
.
pageEditor
=
new
Editor
({
language
:
language
,
language
:
language
,
kind
:
"
all
"
,
kind
:
"
all
"
,
id
:
"
pageContent
"
id
:
"
pageContent
"
...
@@ -98,8 +98,9 @@ admin.pageList = {
...
@@ -98,8 +98,9 @@ admin.pageList = {
$
(
"
#pagePagePanel
"
).
slideDown
();
$
(
"
#pagePagePanel
"
).
slideDown
();
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
// 使用 CodeMirror 编辑器时,当编辑器初始之前,元素为 display:none 时,行号显示不正常
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
&&
admin
.
editorPage
.
getContent
()
===
""
)
{
if
(
Label
.
editorType
===
"
CodeMirror-Markdown
"
admin
.
editorPage
.
setContent
(
""
);
&&
admin
.
editors
.
pageEditor
.
getContent
()
===
""
)
{
admin
.
editors
.
pageEditor
.
setContent
(
""
);
}
}
}
else
{
}
else
{
$
(
"
#pagePagePanel
"
).
slideUp
();
$
(
"
#pagePagePanel
"
).
slideUp
();
...
@@ -202,7 +203,7 @@ admin.pageList = {
...
@@ -202,7 +203,7 @@ admin.pageList = {
}
}
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
,
result
.
page
.
pageCommentable
);
$
(
"
#pageCommentable
"
).
prop
(
"
checked
"
,
result
.
page
.
pageCommentable
);
admin
.
editor
Page
.
setContent
(
result
.
page
.
pageContent
);
admin
.
editor
s
.
pageEditor
.
setContent
(
result
.
page
.
pageContent
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
}
}
...
@@ -257,7 +258,7 @@ admin.pageList = {
...
@@ -257,7 +258,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editor
Page
.
getContent
();
var
pageContent
=
admin
.
editor
s
.
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
"
)
{
...
@@ -294,7 +295,7 @@ admin.pageList = {
...
@@ -294,7 +295,7 @@ admin.pageList = {
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editor
Page
.
setContent
(
""
);
admin
.
editor
s
.
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
)
{
...
@@ -321,7 +322,7 @@ admin.pageList = {
...
@@ -321,7 +322,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pageContent
=
admin
.
editor
Page
.
getContent
();
var
pageContent
=
admin
.
editor
s
.
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
"
)
{
...
@@ -362,7 +363,7 @@ admin.pageList = {
...
@@ -362,7 +363,7 @@ admin.pageList = {
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
"
#pageTarget
"
).
val
(
"
_self
"
);
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
$
(
$
(
"
.fn-type
"
).
get
(
0
)).
click
();
admin
.
editor
Page
.
setContent
(
""
);
admin
.
editor
s
.
pageEditor
.
setContent
(
""
);
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#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