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
eb8c764a
Unverified
Commit
eb8c764a
authored
Apr 22, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '3.6.1-dev'
parents
4f7c377f
8afaea7e
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
65 deletions
+11
-65
src/main/java/org/b3log/solo/processor/console/PageConsole.java
...in/java/org/b3log/solo/processor/console/PageConsole.java
+1
-7
src/main/java/org/b3log/solo/service/DataModelService.java
src/main/java/org/b3log/solo/service/DataModelService.java
+1
-8
src/main/java/org/b3log/solo/service/PageMgmtService.java
src/main/java/org/b3log/solo/service/PageMgmtService.java
+2
-31
src/main/webapp/js/admin/admin.js
src/main/webapp/js/admin/admin.js
+2
-13
src/main/webapp/js/admin/admin.min.js
src/main/webapp/js/admin/admin.min.js
+2
-2
src/main/webapp/js/admin/pageList.js
src/main/webapp/js/admin/pageList.js
+3
-4
No files found.
src/main/java/org/b3log/solo/processor/console/PageConsole.java
View file @
eb8c764a
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
package
org
.
b3log
.
solo
.
processor
.
console
;
package
org
.
b3log
.
solo
.
processor
.
console
;
import
org.apache.commons.lang.StringEscapeUtils
;
import
org.apache.commons.lang.StringEscapeUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.ioc.Inject
;
import
org.b3log.latke.ioc.Inject
;
...
@@ -43,7 +42,7 @@ import org.json.JSONObject;
...
@@ -43,7 +42,7 @@ import org.json.JSONObject;
* Plugin console request processing.
* Plugin console request processing.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1
1, Apr 19
, 2019
* @version 1.0.0.1
2, Apr 22
, 2019
* @since 0.4.0
* @since 0.4.0
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -344,11 +343,6 @@ public class PageConsole {
...
@@ -344,11 +343,6 @@ public class PageConsole {
for
(
int
i
=
0
;
i
<
pages
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
pages
.
length
();
i
++)
{
final
JSONObject
page
=
pages
.
getJSONObject
(
i
);
final
JSONObject
page
=
pages
.
getJSONObject
(
i
);
final
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
);
if
(
StringUtils
.
startsWith
(
permalink
,
"/"
))
{
page
.
put
(
Page
.
PAGE_PERMALINK
,
Latkes
.
getServePath
()
+
permalink
);
}
String
title
=
page
.
optString
(
Page
.
PAGE_TITLE
);
String
title
=
page
.
optString
(
Page
.
PAGE_TITLE
);
title
=
StringEscapeUtils
.
escapeXml
(
title
);
title
=
StringEscapeUtils
.
escapeXml
(
title
);
page
.
put
(
Page
.
PAGE_TITLE
,
title
);
page
.
put
(
Page
.
PAGE_TITLE
,
title
);
...
...
src/main/java/org/b3log/solo/service/DataModelService.java
View file @
eb8c764a
...
@@ -59,7 +59,7 @@ import static org.b3log.solo.model.Article.ARTICLE_CONTENT;
...
@@ -59,7 +59,7 @@ import static org.b3log.solo.model.Article.ARTICLE_CONTENT;
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.7.0.
9, Apr 8
, 2019
* @version 1.7.0.
10, Apr 22
, 2019
* @since 0.3.1
* @since 0.3.1
*/
*/
@Service
@Service
...
@@ -863,13 +863,6 @@ public class DataModelService {
...
@@ -863,13 +863,6 @@ public class DataModelService {
try
{
try
{
LOGGER
.
debug
(
"Filling page navigations...."
);
LOGGER
.
debug
(
"Filling page navigations...."
);
final
List
<
JSONObject
>
pages
=
pageRepository
.
getPages
();
final
List
<
JSONObject
>
pages
=
pageRepository
.
getPages
();
for
(
final
JSONObject
page
:
pages
)
{
final
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
);
if
(
StringUtils
.
startsWith
(
permalink
,
"/"
))
{
page
.
put
(
Page
.
PAGE_PERMALINK
,
Latkes
.
getServePath
()
+
permalink
);
}
}
dataModel
.
put
(
Common
.
PAGE_NAVIGATIONS
,
pages
);
dataModel
.
put
(
Common
.
PAGE_NAVIGATIONS
,
pages
);
}
catch
(
final
RepositoryException
e
)
{
}
catch
(
final
RepositoryException
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Fills page navigations failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Fills page navigations failed"
,
e
);
...
...
src/main/java/org/b3log/solo/service/PageMgmtService.java
View file @
eb8c764a
...
@@ -26,7 +26,6 @@ import org.b3log.latke.repository.Transaction;
...
@@ -26,7 +26,6 @@ import org.b3log.latke.repository.Transaction;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.annotation.Service
;
import
org.b3log.latke.service.annotation.Service
;
import
org.b3log.latke.util.Strings
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.PageRepository
;
import
org.b3log.solo.repository.PageRepository
;
...
@@ -127,27 +126,7 @@ public class PageMgmtService {
...
@@ -127,27 +126,7 @@ public class PageMgmtService {
final
JSONObject
oldPage
=
pageRepository
.
get
(
pageId
);
final
JSONObject
oldPage
=
pageRepository
.
get
(
pageId
);
final
JSONObject
newPage
=
new
JSONObject
(
page
,
JSONObject
.
getNames
(
page
));
final
JSONObject
newPage
=
new
JSONObject
(
page
,
JSONObject
.
getNames
(
page
));
newPage
.
put
(
Page
.
PAGE_ORDER
,
oldPage
.
getInt
(
Page
.
PAGE_ORDER
));
newPage
.
put
(
Page
.
PAGE_ORDER
,
oldPage
.
getInt
(
Page
.
PAGE_ORDER
));
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
).
trim
();
final
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
).
trim
();
final
String
oldPermalink
=
oldPage
.
getString
(
Page
.
PAGE_PERMALINK
);
if
(!
oldPermalink
.
equals
(
permalink
))
{
if
(!
Strings
.
isURL
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"invalidPermalinkFormatLabel"
));
}
if
(!
oldPermalink
.
equals
(
permalink
)
&&
permalinkQueryService
.
exist
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"duplicatedPermalinkLabel"
));
}
}
newPage
.
put
(
Page
.
PAGE_PERMALINK
,
permalink
);
newPage
.
put
(
Page
.
PAGE_PERMALINK
,
permalink
);
page
.
put
(
Page
.
PAGE_ICON
,
page
.
optString
(
Page
.
PAGE_ICON
));
page
.
put
(
Page
.
PAGE_ICON
,
page
.
optString
(
Page
.
PAGE_ICON
));
...
@@ -211,15 +190,7 @@ public class PageMgmtService {
...
@@ -211,15 +190,7 @@ public class PageMgmtService {
final
int
maxOrder
=
pageRepository
.
getMaxOrder
();
final
int
maxOrder
=
pageRepository
.
getMaxOrder
();
page
.
put
(
Page
.
PAGE_ORDER
,
maxOrder
+
1
);
page
.
put
(
Page
.
PAGE_ORDER
,
maxOrder
+
1
);
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
);
final
String
permalink
=
page
.
optString
(
Page
.
PAGE_PERMALINK
);
if
(!
Strings
.
isURL
(
permalink
))
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
}
throw
new
ServiceException
(
langPropsService
.
get
(
"invalidPermalinkFormatLabel"
));
}
if
(
permalinkQueryService
.
exist
(
permalink
))
{
if
(
permalinkQueryService
.
exist
(
permalink
))
{
if
(
transaction
.
isActive
())
{
if
(
transaction
.
isActive
())
{
transaction
.
rollback
();
transaction
.
rollback
();
...
...
src/main/webapp/js/admin/admin.js
View file @
eb8c764a
...
@@ -19,7 +19,8 @@
...
@@ -19,7 +19,8 @@
* @description index for admin
* @description index for admin
*
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.0.0, Mar 30, 2019
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.4.0.0, Apr 22, 2019
*/
*/
Util
.
htmlDecode
=
function
(
code
)
{
Util
.
htmlDecode
=
function
(
code
)
{
...
@@ -28,18 +29,6 @@ Util.htmlDecode = function (code) {
...
@@ -28,18 +29,6 @@ Util.htmlDecode = function (code) {
return
div
.
innerText
return
div
.
innerText
}
}
/**
* @description URL 没有协议头,则自动加上 http://
* @param {String} url URL 地址
* @returns {String} 添加后的URL
*/
Util
.
proessURL
=
function
(
url
)
{
if
(
!
/^
\w
+:
\/\/
/
.
test
(
url
))
{
url
=
'
http://
'
+
url
}
return
url
}
var
Admin
=
function
()
{
var
Admin
=
function
()
{
this
.
register
=
{}
this
.
register
=
{}
// 工具栏下的工具
// 工具栏下的工具
...
...
src/main/webapp/js/admin/admin.min.js
View file @
eb8c764a
This diff is collapsed.
Click to expand it.
src/main/webapp/js/admin/pageList.js
View file @
eb8c764a
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.0.
0, Feb 6
, 2019
* @version 1.3.0.
1, Apr 22
, 2019
*/
*/
/* page-list 相关操作 */
/* page-list 相关操作 */
...
@@ -202,7 +202,7 @@ admin.pageList = {
...
@@ -202,7 +202,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pagePermalink
=
Util
.
proessURL
(
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
)
);
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
...
@@ -255,8 +255,7 @@ admin.pageList = {
...
@@ -255,8 +255,7 @@ admin.pageList = {
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
);
$
(
"
#tipMsg
"
).
text
(
""
);
$
(
"
#tipMsg
"
).
text
(
""
);
var
pagePermalink
=
Util
.
proessURL
(
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
));
var
pagePermalink
=
$
(
"
#pagePermalink
"
).
val
().
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
""
);
var
requestJSONObject
=
{
var
requestJSONObject
=
{
"
page
"
:
{
"
page
"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment