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
02c38803
Commit
02c38803
authored
Jun 25, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.9.1-dev'
parents
c04e12f0
e36b2c8b
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
1393 additions
and
118 deletions
+1393
-118
gulpfile.js
gulpfile.js
+9
-0
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
+5
-5
src/main/java/org/b3log/solo/processor/CategoryProcessor.java
...main/java/org/b3log/solo/processor/CategoryProcessor.java
+3
-6
src/main/java/org/b3log/solo/processor/FileUploadProcessor.java
...in/java/org/b3log/solo/processor/FileUploadProcessor.java
+4
-3
src/main/java/org/b3log/solo/processor/IndexProcessor.java
src/main/java/org/b3log/solo/processor/IndexProcessor.java
+3
-3
src/main/java/org/b3log/solo/processor/PageProcessor.java
src/main/java/org/b3log/solo/processor/PageProcessor.java
+3
-5
src/main/java/org/b3log/solo/processor/TagProcessor.java
src/main/java/org/b3log/solo/processor/TagProcessor.java
+11
-11
src/main/java/org/b3log/solo/processor/UserTemplateProcessor.java
.../java/org/b3log/solo/processor/UserTemplateProcessor.java
+6
-6
src/main/java/org/b3log/solo/processor/renderer/SkinRenderer.java
.../java/org/b3log/solo/processor/renderer/SkinRenderer.java
+114
-0
src/main/webapp/js/admin/editorCodeMirror.js
src/main/webapp/js/admin/editorCodeMirror.js
+9
-13
src/main/webapp/js/common.js
src/main/webapp/js/common.js
+81
-0
src/main/webapp/js/lib/compress/pjax.min.js
src/main/webapp/js/lib/compress/pjax.min.js
+5
-0
src/main/webapp/js/lib/jquery/jquery-3.1.0.min.js
src/main/webapp/js/lib/jquery/jquery-3.1.0.min.js
+4
-0
src/main/webapp/js/lib/jquery/jquery.pjax.js
src/main/webapp/js/lib/jquery/jquery.pjax.js
+399
-0
src/main/webapp/js/lib/nprogress/nprogress.css
src/main/webapp/js/lib/nprogress/nprogress.css
+73
-0
src/main/webapp/js/lib/nprogress/nprogress.js
src/main/webapp/js/lib/nprogress/nprogress.js
+475
-0
src/main/webapp/skins/Medium/archive-articles.ftl
src/main/webapp/skins/Medium/archive-articles.ftl
+4
-0
src/main/webapp/skins/Medium/archives.ftl
src/main/webapp/skins/Medium/archives.ftl
+4
-0
src/main/webapp/skins/Medium/article.ftl
src/main/webapp/skins/Medium/article.ftl
+22
-13
src/main/webapp/skins/Medium/category-articles.ftl
src/main/webapp/skins/Medium/category-articles.ftl
+4
-0
src/main/webapp/skins/Medium/css/base.css
src/main/webapp/skins/Medium/css/base.css
+75
-0
src/main/webapp/skins/Medium/footer.ftl
src/main/webapp/skins/Medium/footer.ftl
+1
-1
src/main/webapp/skins/Medium/index.ftl
src/main/webapp/skins/Medium/index.ftl
+4
-0
src/main/webapp/skins/Medium/js/common.js
src/main/webapp/skins/Medium/js/common.js
+36
-0
src/main/webapp/skins/Medium/links.ftl
src/main/webapp/skins/Medium/links.ftl
+30
-26
src/main/webapp/skins/Medium/page.ftl
src/main/webapp/skins/Medium/page.ftl
+0
-1
src/main/webapp/skins/Medium/tag-articles.ftl
src/main/webapp/skins/Medium/tag-articles.ftl
+4
-0
src/main/webapp/skins/Medium/tags.ftl
src/main/webapp/skins/Medium/tags.ftl
+5
-25
No files found.
gulpfile.js
View file @
02c38803
...
@@ -55,4 +55,13 @@ gulp.task('default', function () {
...
@@ -55,4 +55,13 @@ gulp.task('default', function () {
.
pipe
(
concat
(
'
admin-lib.min.js
'
))
.
pipe
(
concat
(
'
admin-lib.min.js
'
))
.
pipe
(
gulp
.
dest
(
'
./src/main/webapp/js/lib/compress/
'
));
.
pipe
(
gulp
.
dest
(
'
./src/main/webapp/js/lib/compress/
'
));
// concat js
var
jsPjax
=
[
'
./src/main/webapp/js/lib/jquery/jquery-3.1.0.min.js
'
,
'
./src/main/webapp/js/lib/jquery/jquery.pjax.js
'
,
'
./src/main/webapp/js/lib/nprogress/nprogress.js
'
];
gulp
.
src
(
jsPjax
)
.
pipe
(
uglify
())
.
pipe
(
concat
(
'
pjax.min.js
'
))
.
pipe
(
gulp
.
dest
(
'
./src/main/webapp/js/lib/compress/
'
));
});
});
\ No newline at end of file
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
View file @
02c38803
...
@@ -39,12 +39,12 @@ import org.b3log.latke.servlet.annotation.RequestProcessor;
...
@@ -39,12 +39,12 @@ import org.b3log.latke.servlet.annotation.RequestProcessor;
import
org.b3log.latke.servlet.renderer.JSONRenderer
;
import
org.b3log.latke.servlet.renderer.JSONRenderer
;
import
org.b3log.latke.servlet.renderer.TextHTMLRenderer
;
import
org.b3log.latke.servlet.renderer.TextHTMLRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.FreeMarkerRenderer
;
import
org.b3log.latke.util.*
;
import
org.b3log.latke.util.*
;
import
org.b3log.solo.SoloServletListener
;
import
org.b3log.solo.SoloServletListener
;
import
org.b3log.solo.event.EventTypes
;
import
org.b3log.solo.event.EventTypes
;
import
org.b3log.solo.model.*
;
import
org.b3log.solo.model.*
;
import
org.b3log.solo.processor.renderer.ConsoleRenderer
;
import
org.b3log.solo.processor.renderer.ConsoleRenderer
;
import
org.b3log.solo.processor.renderer.SkinRenderer
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.service.*
;
import
org.b3log.solo.service.*
;
import
org.b3log.solo.util.Skins
;
import
org.b3log.solo.util.Skins
;
...
@@ -67,7 +67,7 @@ import java.util.*;
...
@@ -67,7 +67,7 @@ import java.util.*;
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://zephyr.b3log.org">Zephyr</a>
* @author <a href="http://zephyr.b3log.org">Zephyr</a>
* @version 1.4.4.
1, Apr 13
, 2018
* @version 1.4.4.
2, Jun 22
, 2018
* @since 0.3.1
* @since 0.3.1
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -745,7 +745,7 @@ public class ArticleProcessor {
...
@@ -745,7 +745,7 @@ public class ArticleProcessor {
@RequestProcessing
(
value
=
"/authors/**"
,
method
=
HTTPRequestMethod
.
GET
)
@RequestProcessing
(
value
=
"/authors/**"
,
method
=
HTTPRequestMethod
.
GET
)
public
void
showAuthorArticles
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
public
void
showAuthorArticles
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
throws
IOException
,
JSONException
{
throws
IOException
,
JSONException
{
final
AbstractFreeMarkerRenderer
renderer
=
new
FreeMarkerRenderer
(
);
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
request
);
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
renderer
.
setTemplateName
(
"author-articles.ftl"
);
renderer
.
setTemplateName
(
"author-articles.ftl"
);
...
@@ -838,7 +838,7 @@ public class ArticleProcessor {
...
@@ -838,7 +838,7 @@ public class ArticleProcessor {
@RequestProcessing
(
value
=
"/archives/**"
,
method
=
HTTPRequestMethod
.
GET
)
@RequestProcessing
(
value
=
"/archives/**"
,
method
=
HTTPRequestMethod
.
GET
)
public
void
showArchiveArticles
(
final
HTTPRequestContext
context
,
public
void
showArchiveArticles
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
{
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
{
final
AbstractFreeMarkerRenderer
renderer
=
new
FreeMarkerRenderer
(
);
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
request
);
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
renderer
.
setTemplateName
(
"archive-articles.ftl"
);
renderer
.
setTemplateName
(
"archive-articles.ftl"
);
...
@@ -961,7 +961,7 @@ public class ArticleProcessor {
...
@@ -961,7 +961,7 @@ public class ArticleProcessor {
LOGGER
.
log
(
Level
.
DEBUG
,
"Article[id={0}]"
,
articleId
);
LOGGER
.
log
(
Level
.
DEBUG
,
"Article[id={0}]"
,
articleId
);
final
AbstractFreeMarkerRenderer
renderer
=
new
FreeMarkerRenderer
(
);
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
request
);
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
renderer
.
setTemplateName
(
"article.ftl"
);
renderer
.
setTemplateName
(
"article.ftl"
);
...
...
src/main/java/org/b3log/solo/processor/CategoryProcessor.java
View file @
02c38803
...
@@ -30,13 +30,13 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
...
@@ -30,13 +30,13 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.FreeMarkerRenderer
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.latke.util.Strings
;
import
org.b3log.latke.util.Strings
;
import
org.b3log.solo.model.Article
;
import
org.b3log.solo.model.Article
;
import
org.b3log.solo.model.Category
;
import
org.b3log.solo.model.Category
;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.processor.renderer.SkinRenderer
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.service.*
;
import
org.b3log.solo.service.*
;
import
org.b3log.solo.util.Skins
;
import
org.b3log.solo.util.Skins
;
...
@@ -55,7 +55,7 @@ import java.util.Map;
...
@@ -55,7 +55,7 @@ import java.util.Map;
* Category processor.
* Category processor.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.
2, Apr 21, 2017
* @version 1.0.1.
3, Jun 22, 2018
* @since 2.0.0
* @since 2.0.0
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -149,10 +149,8 @@ public class CategoryProcessor {
...
@@ -149,10 +149,8 @@ public class CategoryProcessor {
*/
*/
@RequestProcessing
(
value
=
"/category/**"
,
method
=
HTTPRequestMethod
.
GET
)
@RequestProcessing
(
value
=
"/category/**"
,
method
=
HTTPRequestMethod
.
GET
)
public
void
showCategoryArticles
(
final
HTTPRequestContext
context
)
throws
IOException
{
public
void
showCategoryArticles
(
final
HTTPRequestContext
context
)
throws
IOException
{
final
AbstractFreeMarkerRenderer
renderer
=
new
FreeMarkerRenderer
();
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
context
.
getRequest
());
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
renderer
.
setTemplateName
(
"category-articles.ftl"
);
renderer
.
setTemplateName
(
"category-articles.ftl"
);
final
Map
<
String
,
Object
>
dataModel
=
renderer
.
getDataModel
();
final
Map
<
String
,
Object
>
dataModel
=
renderer
.
getDataModel
();
...
@@ -161,7 +159,6 @@ public class CategoryProcessor {
...
@@ -161,7 +159,6 @@ public class CategoryProcessor {
try
{
try
{
String
requestURI
=
request
.
getRequestURI
();
String
requestURI
=
request
.
getRequestURI
();
if
(!
requestURI
.
endsWith
(
"/"
))
{
if
(!
requestURI
.
endsWith
(
"/"
))
{
requestURI
+=
"/"
;
requestURI
+=
"/"
;
}
}
...
...
src/main/java/org/b3log/solo/processor/FileUploadProcessor.java
View file @
02c38803
...
@@ -55,7 +55,7 @@ import java.util.*;
...
@@ -55,7 +55,7 @@ import java.util.*;
* File upload processor.
* File upload processor.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.
0.2, Apr 5
, 2018
* @version 1.0.
1.0, Jun 22
, 2018
* @since 2.8.0
* @since 2.8.0
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -153,7 +153,7 @@ public class FileUploadProcessor {
...
@@ -153,7 +153,7 @@ public class FileUploadProcessor {
final
MultipartStreamParser
parser
=
new
MultipartStreamParser
(
new
MemoryFileUploadFactory
().
setMaxFileSize
(
maxSize
));
final
MultipartStreamParser
parser
=
new
MultipartStreamParser
(
new
MemoryFileUploadFactory
().
setMaxFileSize
(
maxSize
));
parser
.
parseRequestStream
(
req
.
getInputStream
(),
"UTF-8"
);
parser
.
parseRequestStream
(
req
.
getInputStream
(),
"UTF-8"
);
final
List
<
String
>
errFiles
=
new
ArrayList
();
final
List
<
String
>
errFiles
=
new
ArrayList
();
final
Map
<
String
,
String
>
succMap
=
new
HashMap
<>();
final
Map
<
String
,
String
>
succMap
=
new
Linked
HashMap
<>();
final
FileUpload
[]
files
=
parser
.
getFiles
(
"file[]"
);
final
FileUpload
[]
files
=
parser
.
getFiles
(
"file[]"
);
final
String
[]
names
=
parser
.
getParameterValues
(
"name[]"
);
final
String
[]
names
=
parser
.
getParameterValues
(
"name[]"
);
String
fileName
;
String
fileName
;
...
@@ -190,7 +190,8 @@ public class FileUploadProcessor {
...
@@ -190,7 +190,8 @@ public class FileUploadProcessor {
for
(
int
i
=
0
;
i
<
files
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
files
.
length
;
i
++)
{
final
FileUpload
file
=
files
[
i
];
final
FileUpload
file
=
files
[
i
];
final
String
originalName
=
fileName
=
file
.
getHeader
().
getFileName
();
String
originalName
=
fileName
=
file
.
getHeader
().
getFileName
();
originalName
=
originalName
.
replaceAll
(
"\\W"
,
""
);
try
{
try
{
String
suffix
=
StringUtils
.
substringAfterLast
(
fileName
,
"."
);
String
suffix
=
StringUtils
.
substringAfterLast
(
fileName
,
"."
);
final
String
contentType
=
file
.
getHeader
().
getContentType
();
final
String
contentType
=
file
.
getHeader
().
getContentType
();
...
...
src/main/java/org/b3log/solo/processor/IndexProcessor.java
View file @
02c38803
...
@@ -32,7 +32,6 @@ import org.b3log.latke.servlet.URIPatternMode;
...
@@ -32,7 +32,6 @@ import org.b3log.latke.servlet.URIPatternMode;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.FreeMarkerRenderer
;
import
org.b3log.latke.util.Locales
;
import
org.b3log.latke.util.Locales
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.latke.util.freemarker.Templates
;
import
org.b3log.latke.util.freemarker.Templates
;
...
@@ -41,6 +40,7 @@ import org.b3log.solo.model.Common;
...
@@ -41,6 +40,7 @@ import org.b3log.solo.model.Common;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Skin
;
import
org.b3log.solo.model.Skin
;
import
org.b3log.solo.processor.renderer.ConsoleRenderer
;
import
org.b3log.solo.processor.renderer.ConsoleRenderer
;
import
org.b3log.solo.processor.renderer.SkinRenderer
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.service.PreferenceQueryService
;
import
org.b3log.solo.service.PreferenceQueryService
;
import
org.b3log.solo.service.StatisticMgmtService
;
import
org.b3log.solo.service.StatisticMgmtService
;
...
@@ -61,7 +61,7 @@ import java.util.Set;
...
@@ -61,7 +61,7 @@ import java.util.Set;
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="mailto:385321165@qq.com">DASHU</a>
* @author <a href="mailto:385321165@qq.com">DASHU</a>
* @version 1.2.4.
6, Jun 28, 2017
* @version 1.2.4.
7, Jun 22, 2018
* @since 0.3.1
* @since 0.3.1
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -117,7 +117,7 @@ public class IndexProcessor {
...
@@ -117,7 +117,7 @@ public class IndexProcessor {
*/
*/
@RequestProcessing
(
value
=
{
"/\\d*"
,
""
},
uriPatternsMode
=
URIPatternMode
.
REGEX
,
method
=
HTTPRequestMethod
.
GET
)
@RequestProcessing
(
value
=
{
"/\\d*"
,
""
},
uriPatternsMode
=
URIPatternMode
.
REGEX
,
method
=
HTTPRequestMethod
.
GET
)
public
void
showIndex
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
{
public
void
showIndex
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
{
final
AbstractFreeMarkerRenderer
renderer
=
new
FreeMarkerRenderer
(
);
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
request
);
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
renderer
.
setTemplateName
(
"index.ftl"
);
renderer
.
setTemplateName
(
"index.ftl"
);
final
Map
<
String
,
Object
>
dataModel
=
renderer
.
getDataModel
();
final
Map
<
String
,
Object
>
dataModel
=
renderer
.
getDataModel
();
...
...
src/main/java/org/b3log/solo/processor/PageProcessor.java
View file @
02c38803
...
@@ -27,11 +27,11 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
...
@@ -27,11 +27,11 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.FreeMarkerRenderer
;
import
org.b3log.latke.util.Stopwatchs
;
import
org.b3log.latke.util.Stopwatchs
;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.processor.renderer.SkinRenderer
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.service.CommentQueryService
;
import
org.b3log.solo.service.CommentQueryService
;
import
org.b3log.solo.service.PreferenceQueryService
;
import
org.b3log.solo.service.PreferenceQueryService
;
...
@@ -51,7 +51,7 @@ import java.util.Map;
...
@@ -51,7 +51,7 @@ import java.util.Map;
* Page processor.
* Page processor.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.
6, Nov 8, 2016
* @version 1.1.0.
7, Jun 22, 2018
* @since 0.3.1
* @since 0.3.1
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -99,10 +99,8 @@ public class PageProcessor {
...
@@ -99,10 +99,8 @@ public class PageProcessor {
*/
*/
@RequestProcessing
(
value
=
"/page"
,
method
=
HTTPRequestMethod
.
GET
)
@RequestProcessing
(
value
=
"/page"
,
method
=
HTTPRequestMethod
.
GET
)
public
void
showPage
(
final
HTTPRequestContext
context
)
{
public
void
showPage
(
final
HTTPRequestContext
context
)
{
final
AbstractFreeMarkerRenderer
renderer
=
new
FreeMarkerRenderer
();
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
context
.
getRequest
());
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
renderer
.
setTemplateName
(
"page.ftl"
);
renderer
.
setTemplateName
(
"page.ftl"
);
final
Map
<
String
,
Object
>
dataModel
=
renderer
.
getDataModel
();
final
Map
<
String
,
Object
>
dataModel
=
renderer
.
getDataModel
();
...
...
src/main/java/org/b3log/solo/processor/TagProcessor.java
View file @
02c38803
...
@@ -30,7 +30,6 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
...
@@ -30,7 +30,6 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.FreeMarkerRenderer
;
import
org.b3log.latke.util.Paginator
;
import
org.b3log.latke.util.Paginator
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.latke.util.Strings
;
import
org.b3log.latke.util.Strings
;
...
@@ -38,6 +37,7 @@ import org.b3log.solo.model.Article;
...
@@ -38,6 +37,7 @@ import org.b3log.solo.model.Article;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Tag
;
import
org.b3log.solo.model.Tag
;
import
org.b3log.solo.processor.renderer.SkinRenderer
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.service.*
;
import
org.b3log.solo.service.*
;
import
org.b3log.solo.util.Skins
;
import
org.b3log.solo.util.Skins
;
...
@@ -58,7 +58,7 @@ import java.util.Map;
...
@@ -58,7 +58,7 @@ import java.util.Map;
* Tag processor.
* Tag processor.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.
4, Nov 20, 2015
* @version 1.1.1.
5, Jun 22, 2018
* @since 0.3.1
* @since 0.3.1
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -119,7 +119,7 @@ public class TagProcessor {
...
@@ -119,7 +119,7 @@ public class TagProcessor {
*/
*/
@RequestProcessing
(
value
=
"/tags/**"
,
method
=
HTTPRequestMethod
.
GET
)
@RequestProcessing
(
value
=
"/tags/**"
,
method
=
HTTPRequestMethod
.
GET
)
public
void
showTagArticles
(
final
HTTPRequestContext
context
)
throws
IOException
{
public
void
showTagArticles
(
final
HTTPRequestContext
context
)
throws
IOException
{
final
AbstractFreeMarkerRenderer
renderer
=
new
FreeMarkerRenderer
(
);
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
context
.
getRequest
()
);
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
...
@@ -229,16 +229,16 @@ public class TagProcessor {
...
@@ -229,16 +229,16 @@ public class TagProcessor {
/**
/**
* Fills pagination.
* Fills pagination.
*
*
* @param dataModel the specified data model
* @param dataModel
the specified data model
* @param pageCount the specified page count
* @param pageCount
the specified page count
* @param currentPageNum the specified current page number
* @param currentPageNum the specified current page number
* @param articles the specified articles
* @param articles
the specified articles
* @param pageNums the specified page numbers
* @param pageNums
the specified page numbers
*/
*/
private
void
fillPagination
(
final
Map
<
String
,
Object
>
dataModel
,
private
void
fillPagination
(
final
Map
<
String
,
Object
>
dataModel
,
final
int
pageCount
,
final
int
currentPageNum
,
final
int
pageCount
,
final
int
currentPageNum
,
final
List
<
JSONObject
>
articles
,
final
List
<
JSONObject
>
articles
,
final
List
<
Integer
>
pageNums
)
{
final
List
<
Integer
>
pageNums
)
{
final
String
previousPageNum
=
Integer
.
toString
(
currentPageNum
>
1
?
currentPageNum
-
1
:
0
);
final
String
previousPageNum
=
Integer
.
toString
(
currentPageNum
>
1
?
currentPageNum
-
1
:
0
);
dataModel
.
put
(
Pagination
.
PAGINATION_PREVIOUS_PAGE_NUM
,
"0"
.
equals
(
previousPageNum
)
?
""
:
previousPageNum
);
dataModel
.
put
(
Pagination
.
PAGINATION_PREVIOUS_PAGE_NUM
,
"0"
.
equals
(
previousPageNum
)
?
""
:
previousPageNum
);
...
@@ -259,7 +259,7 @@ public class TagProcessor {
...
@@ -259,7 +259,7 @@ public class TagProcessor {
* Gets the request page number from the specified request URI and tag title.
* Gets the request page number from the specified request URI and tag title.
*
*
* @param requestURI the specified request URI
* @param requestURI the specified request URI
* @param tagTitle the specified tag title
* @param tagTitle
the specified tag title
* @return page number, returns {@code -1} if the specified request URI can not convert to an number
* @return page number, returns {@code -1} if the specified request URI can not convert to an number
*/
*/
private
static
int
getCurrentPageNum
(
final
String
requestURI
,
final
String
tagTitle
)
{
private
static
int
getCurrentPageNum
(
final
String
requestURI
,
final
String
tagTitle
)
{
...
...
src/main/java/org/b3log/solo/processor/UserTemplateProcessor.java
View file @
02c38803
...
@@ -30,10 +30,10 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
...
@@ -30,10 +30,10 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
org.b3log.latke.servlet.renderer.freemarker.FreeMarkerRenderer
;
import
org.b3log.latke.util.Locales
;
import
org.b3log.latke.util.Locales
;
import
org.b3log.latke.util.freemarker.Templates
;
import
org.b3log.latke.util.freemarker.Templates
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.processor.renderer.SkinRenderer
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.processor.util.Filler
;
import
org.b3log.solo.service.PreferenceQueryService
;
import
org.b3log.solo.service.PreferenceQueryService
;
import
org.b3log.solo.service.StatisticMgmtService
;
import
org.b3log.solo.service.StatisticMgmtService
;
...
@@ -58,7 +58,7 @@ import java.util.Map;
...
@@ -58,7 +58,7 @@ import java.util.Map;
* </p>
* </p>
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
5, Nov 20, 2015
* @version 1.0.0.
6, Jun 22, 2018
* @since 0.4.5
* @since 0.4.5
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -96,21 +96,21 @@ public class UserTemplateProcessor {
...
@@ -96,21 +96,21 @@ public class UserTemplateProcessor {
/**
/**
* Shows the user template page.
* Shows the user template page.
*
*
* @param context the specified context
* @param context
the specified context
* @param request the specified HTTP servlet request
* @param request
the specified HTTP servlet request
* @param response the specified HTTP servlet response
* @param response the specified HTTP servlet response
* @throws IOException io exception
* @throws IOException io exception
*/
*/
@RequestProcessing
(
value
=
"/*.html"
,
method
=
HTTPRequestMethod
.
GET
)
@RequestProcessing
(
value
=
"/*.html"
,
method
=
HTTPRequestMethod
.
GET
)
public
void
showPage
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
public
void
showPage
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
throws
IOException
{
throws
IOException
{
final
String
requestURI
=
request
.
getRequestURI
();
final
String
requestURI
=
request
.
getRequestURI
();
String
templateName
=
StringUtils
.
substringAfterLast
(
requestURI
,
"/"
);
String
templateName
=
StringUtils
.
substringAfterLast
(
requestURI
,
"/"
);
templateName
=
StringUtils
.
substringBefore
(
templateName
,
"."
)
+
".ftl"
;
templateName
=
StringUtils
.
substringBefore
(
templateName
,
"."
)
+
".ftl"
;
LOGGER
.
log
(
Level
.
DEBUG
,
"Shows page[requestURI={0}, templateName={1}]"
,
requestURI
,
templateName
);
LOGGER
.
log
(
Level
.
DEBUG
,
"Shows page[requestURI={0}, templateName={1}]"
,
requestURI
,
templateName
);
final
AbstractFreeMarkerRenderer
renderer
=
new
FreeMarkerRenderer
(
);
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
request
);
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
renderer
.
setTemplateName
(
templateName
);
renderer
.
setTemplateName
(
templateName
);
...
...
src/main/java/org/b3log/solo/processor/renderer/SkinRenderer.java
0 → 100644
View file @
02c38803
/*
* Solo - A beautiful, simple, stable, fast Java blogging system.
* Copyright (c) 2010-2018, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package
org
.
b3log
.
solo
.
processor
.
renderer
;
import
freemarker.template.Template
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.time.DateFormatUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.logging.Logger
;
import
org.b3log.latke.servlet.HTTPRequestContext
;
import
org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.StringWriter
;
import
java.util.Map
;
/**
* Skin renderer.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, Jun 22, 2018
* @since 2.9.1
*/
public
final
class
SkinRenderer
extends
AbstractFreeMarkerRenderer
{
/**
* Logger.
*/
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
SkinRenderer
.
class
);
/**
* HTTP servlet request.
*/
private
final
HttpServletRequest
request
;
/**
* Constructs a skin renderer with the specified HTTP servlet request.
*
* @param request the specified HTTP servlet request
*/
public
SkinRenderer
(
final
HttpServletRequest
request
)
{
this
.
request
=
request
;
}
/**
* Processes the specified FreeMarker template with the specified request, data model, pjax hacking.
*
* @param request the specified request
* @param dataModel the specified data model
* @param template the specified FreeMarker template
* @return generated HTML
* @throws Exception exception
*/
protected
String
genHTML
(
final
HttpServletRequest
request
,
final
Map
<
String
,
Object
>
dataModel
,
final
Template
template
)
throws
Exception
{
final
boolean
isPJAX
=
isPJAX
(
request
);
dataModel
.
put
(
"pjax"
,
isPJAX
);
if
(!
isPJAX
)
{
return
super
.
genHTML
(
request
,
dataModel
,
template
);
}
final
StringWriter
stringWriter
=
new
StringWriter
();
template
.
setOutputEncoding
(
"UTF-8"
);
template
.
process
(
dataModel
,
stringWriter
);
final
long
endTimeMillis
=
System
.
currentTimeMillis
();
final
String
dateString
=
DateFormatUtils
.
format
(
endTimeMillis
,
"yyyy/MM/dd HH:mm:ss"
);
final
long
startTimeMillis
=
(
Long
)
request
.
getAttribute
(
Keys
.
HttpRequest
.
START_TIME_MILLIS
);
final
String
msg
=
String
.
format
(
"\n<!-- Generated by Latke (https://github.com/b3log/latke) in %1$dms, %2$s -->"
,
endTimeMillis
-
startTimeMillis
,
dateString
);
final
String
pjaxContainer
=
request
.
getHeader
(
"X-PJAX-Container"
);
return
StringUtils
.
substringBetween
(
stringWriter
.
toString
(),
"<!---- pjax {"
+
pjaxContainer
+
"} start ---->"
,
"<!---- pjax {"
+
pjaxContainer
+
"} end ---->"
)
+
msg
;
}
@Override
protected
void
beforeRender
(
final
HTTPRequestContext
context
)
{
}
@Override
protected
void
afterRender
(
final
HTTPRequestContext
context
)
{
}
/**
* Determines whether the specified request is sending with pjax.
*
* @param request the specified request
* @return {@code true} if it is sending with pjax, otherwise returns {@code false}
*/
private
static
boolean
isPJAX
(
final
HttpServletRequest
request
)
{
final
boolean
pjax
=
Boolean
.
valueOf
(
request
.
getHeader
(
"X-PJAX"
));
final
String
pjaxContainer
=
request
.
getHeader
(
"X-PJAX-Container"
);
return
pjax
&&
StringUtils
.
isNotBlank
(
pjaxContainer
);
}
}
src/main/webapp/js/admin/editorCodeMirror.js
View file @
02c38803
...
@@ -83,7 +83,7 @@ Util.processClipBoard = function (clipboardData, cm) {
...
@@ -83,7 +83,7 @@ Util.processClipBoard = function (clipboardData, cm) {
};
};
Util
.
initUploadFile
=
function
(
obj
)
{
Util
.
initUploadFile
=
function
(
obj
)
{
var
isImg
=
false
;
var
cursor
;
$
(
'
#
'
+
obj
.
id
).
fileupload
({
$
(
'
#
'
+
obj
.
id
).
fileupload
({
multipart
:
true
,
multipart
:
true
,
pasteZone
:
obj
.
pasteZone
,
pasteZone
:
obj
.
pasteZone
,
...
@@ -91,6 +91,7 @@ Util.initUploadFile = function (obj) {
...
@@ -91,6 +91,7 @@ Util.initUploadFile = function (obj) {
url
:
latkeConfig
.
servePath
+
"
/upload
"
,
url
:
latkeConfig
.
servePath
+
"
/upload
"
,
paramName
:
"
file[]
"
,
paramName
:
"
file[]
"
,
add
:
function
(
e
,
data
)
{
add
:
function
(
e
,
data
)
{
obj
.
uploadingLabel
=
''
;
data
.
submit
();
data
.
submit
();
},
},
submit
:
function
(
e
,
data
)
{
submit
:
function
(
e
,
data
)
{
...
@@ -102,12 +103,11 @@ Util.initUploadFile = function (obj) {
...
@@ -102,12 +103,11 @@ Util.initUploadFile = function (obj) {
obj
.
uploadingLabel
+=
'
[
'
+
item
.
name
.
replace
(
/
\W
/g
,
''
)
+
'
](Uploading...)
'
;
obj
.
uploadingLabel
+=
'
[
'
+
item
.
name
.
replace
(
/
\W
/g
,
''
)
+
'
](Uploading...)
'
;
}
}
});
});
var
cursor
=
obj
.
editor
.
getCursor
();
cursor
=
obj
.
editor
.
getCursor
();
obj
.
editor
.
replaceRange
(
obj
.
uploadingLabel
,
cursor
,
cursor
);
obj
.
editor
.
replaceRange
(
obj
.
uploadingLabel
,
cursor
,
cursor
);
}
}
},
},
done
:
function
(
e
,
data
)
{
done
:
function
(
e
,
data
)
{
var
cursor
=
obj
.
editor
.
getCursor
();
if
(
!
data
.
result
.
sc
)
{
if
(
!
data
.
result
.
sc
)
{
var
msg
=
''
;
var
msg
=
''
;
data
.
files
.
forEach
(
function
(
item
)
{
data
.
files
.
forEach
(
function
(
item
)
{
...
@@ -119,7 +119,7 @@ Util.initUploadFile = function (obj) {
...
@@ -119,7 +119,7 @@ Util.initUploadFile = function (obj) {
});
});
obj
.
editor
.
replaceRange
(
msg
,
obj
.
editor
.
replaceRange
(
msg
,
CodeMirror
.
Pos
(
cursor
.
line
,
cursor
.
ch
-
obj
.
uploadingLabel
.
length
),
cursor
);
cursor
,
CodeMirror
.
Pos
(
cursor
.
line
,
cursor
.
ch
+
obj
.
uploadingLabel
.
length
)
);
return
;
return
;
}
}
...
@@ -127,25 +127,22 @@ Util.initUploadFile = function (obj) {
...
@@ -127,25 +127,22 @@ Util.initUploadFile = function (obj) {
Object
.
keys
(
data
.
result
.
data
.
succMap
).
forEach
(
function
(
key
)
{
Object
.
keys
(
data
.
result
.
data
.
succMap
).
forEach
(
function
(
key
)
{
var
isImage
=
false
;
var
isImage
=
false
;
data
.
files
.
forEach
(
function
(
item
)
{
data
.
files
.
forEach
(
function
(
item
)
{
if
(
item
.
name
.
replace
(
/
\W
/g
,
''
)
===
key
)
{
isImage
=
item
.
type
.
indexOf
(
'
image
'
)
>
-
1
isImage
=
item
.
type
.
indexOf
(
'
image
'
)
>
-
1
}
});
});
resultMsg
+=
(
isImage
?
'

\n\n
'
;
key
.
replace
(
/
\W
/g
,
''
)
+
'
](
'
+
data
.
result
.
data
.
succMap
[
key
]
+
'
)
\n\n
'
;
});
});
data
.
result
.
data
.
errFiles
.
forEach
(
function
(
name
)
{
data
.
result
.
data
.
errFiles
.
forEach
(
function
(
name
)
{
var
isImage
=
false
;
var
isImage
=
false
;
data
.
files
.
forEach
(
function
(
item
)
{
data
.
files
.
forEach
(
function
(
item
)
{
if
(
item
.
name
.
replace
(
/
\W
/g
,
''
)
===
key
)
{
isImage
=
item
.
type
.
indexOf
(
'
image
'
)
>
-
1
isImage
=
item
.
type
.
indexOf
(
'
image
'
)
>
-
1
}
});
});
resultMsg
+=
(
isImage
?
'

'
;
'
[
'
+
name
.
replace
(
/
\W
/g
,
''
)
+
'
](Error)
'
;
});
});
obj
.
editor
.
replaceRange
(
resultMsg
,
obj
.
editor
.
replaceRange
(
resultMsg
,
CodeMirror
.
Pos
(
cursor
.
line
,
cursor
.
ch
-
obj
.
uploadingLabel
.
length
),
cursor
);
cursor
,
CodeMirror
.
Pos
(
cursor
.
line
,
cursor
.
ch
+
obj
.
uploadingLabel
.
length
)
);
},
},
fail
:
function
(
e
,
data
)
{
fail
:
function
(
e
,
data
)
{
if
(
obj
.
editor
.
replaceRange
)
{
if
(
obj
.
editor
.
replaceRange
)
{
...
@@ -157,9 +154,8 @@ Util.initUploadFile = function (obj) {
...
@@ -157,9 +154,8 @@ Util.initUploadFile = function (obj) {
msg
+=
'
[
'
+
item
.
name
.
replace
(
/
\W
/g
,
''
)
+
'
](
'
+
data
.
errorThrown
+
'
)
'
;
msg
+=
'
[
'
+
item
.
name
.
replace
(
/
\W
/g
,
''
)
+
'
](
'
+
data
.
errorThrown
+
'
)
'
;
}
}
});
});
var
cursor
=
obj
.
editor
.
getCursor
();
obj
.
editor
.
replaceRange
(
msg
,
obj
.
editor
.
replaceRange
(
'
[
'
+
item
.
name
.
replace
(
/
\W
/g
,
''
)
+
'
](
'
+
data
.
errorThrown
+
'
)
'
,
cursor
,
CodeMirror
.
Pos
(
cursor
.
line
,
cursor
.
ch
+
obj
.
uploadingLabel
.
length
));
CodeMirror
.
Pos
(
cursor
.
line
,
cursor
.
ch
-
obj
.
uploadingLabel
.
length
),
cursor
);
}
}
}
}
});
});
...
...
src/main/webapp/js/common.js
View file @
02c38803
...
@@ -28,6 +28,87 @@
...
@@ -28,6 +28,87 @@
* @static
* @static
*/
*/
var
Util
=
{
var
Util
=
{
_isArticlePage
:
function
(
href
)
{
var
isArticle
=
true
;
if
(
href
.
indexOf
(
latkeConfig
.
servePath
+
'
/tags/
'
)
>
-
1
)
{
isArticle
=
false
;
}
if
(
href
.
indexOf
(
latkeConfig
.
servePath
+
'
/tags.html
'
)
>
-
1
)
{
isArticle
=
false
;
}
if
(
href
.
indexOf
(
latkeConfig
.
servePath
+
'
/category/
'
)
>
-
1
)
{
isArticle
=
false
;
}
if
(
href
.
indexOf
(
latkeConfig
.
servePath
+
'
/archives.html
'
)
>
-
1
)
{
isArticle
=
false
;
}
if
(
href
.
indexOf
(
latkeConfig
.
servePath
+
'
/archives/
'
)
>
-
1
)
{
isArticle
=
false
;
}
if
(
href
.
indexOf
(
latkeConfig
.
servePath
+
'
/links.html
'
)
>
-
1
)
{
isArticle
=
false
;
}
if
(
href
===
latkeConfig
.
servePath
)
{
isArticle
=
false
;
}
if
(
/^
[
0-9
]
*$/
.
test
(
href
.
replace
(
latkeConfig
.
servePath
+
'
/
'
,
''
)))
{
isArticle
=
false
;
}
return
isArticle
;
},
/**
* pjax
*/
initPjax
:
function
(
cb
,
articelCB
)
{
if
(
$
(
'
#pjax
'
).
length
===
1
)
{
$
.
pjax
({
selector
:
'
a
'
,
container
:
'
#pjax
'
,
show
:
''
,
cache
:
false
,
storage
:
true
,
titleSuffix
:
''
,
filter
:
function
(
href
){
return
Util
.
_isArticlePage
(
href
);
},
callback
:
function
()
{
cb
()
},
});
NProgress
.
configure
({
showSpinner
:
false
});
$
(
'
#pjax
'
).
bind
(
'
pjax.start
'
,
function
(){
NProgress
.
start
();
});
$
(
'
#pjax
'
).
bind
(
'
pjax.end
'
,
function
(){
NProgress
.
done
();
});
return
;
}
if
(
$
(
'
#pjaxArticle
'
).
length
===
1
)
{
$
.
pjax
({
selector
:
'
a
'
,
container
:
'
#pjaxArticle
'
,
show
:
''
,
cache
:
false
,
storage
:
true
,
titleSuffix
:
''
,
filter
:
function
(
href
){
return
!
Util
.
_isArticlePage
(
href
);
},
callback
:
function
()
{
articelCB
();
},
});
NProgress
.
configure
({
showSpinner
:
false
});
$
(
'
#pjaxArticle
'
).
bind
(
'
pjax.start
'
,
function
(){
NProgress
.
start
();
});
$
(
'
#pjaxArticle
'
).
bind
(
'
pjax.end
'
,
function
(){
NProgress
.
done
();
});
return
;
}
},
/**
/**
* 按需加载 MathJax 及 flow
* 按需加载 MathJax 及 flow
* @returns {undefined}
* @returns {undefined}
...
...
src/main/webapp/js/lib/compress/pjax.min.js
0 → 100644
View file @
02c38803
This diff is collapsed.
Click to expand it.
src/main/webapp/js/lib/jquery/jquery-3.1.0.min.js
0 → 100644
View file @
02c38803
This diff is collapsed.
Click to expand it.
src/main/webapp/js/lib/jquery/jquery.pjax.js
0 → 100644
View file @
02c38803
This diff is collapsed.
Click to expand it.
src/main/webapp/js/lib/nprogress/nprogress.css
0 → 100644
View file @
02c38803
/* Make clicks pass-through */
#nprogress
{
pointer-events
:
none
;
}
#nprogress
.bar
{
background
:
#d23f31
;
position
:
fixed
;
z-index
:
1031
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
2px
;
}
/* Fancy blur effect */
#nprogress
.peg
{
display
:
block
;
position
:
absolute
;
right
:
0px
;
width
:
100px
;
height
:
100%
;
box-shadow
:
0
0
10px
#d23f31
,
0
0
5px
#d23f31
;
opacity
:
1.0
;
-webkit-transform
:
rotate
(
3deg
)
translate
(
0px
,
-4px
);
-ms-transform
:
rotate
(
3deg
)
translate
(
0px
,
-4px
);
transform
:
rotate
(
3deg
)
translate
(
0px
,
-4px
);
}
/* Remove these to get rid of the spinner */
#nprogress
.spinner
{
display
:
block
;
position
:
fixed
;
z-index
:
1031
;
top
:
15px
;
right
:
15px
;
}
#nprogress
.spinner-icon
{
width
:
18px
;
height
:
18px
;
box-sizing
:
border-box
;
border
:
solid
2px
transparent
;
border-top-color
:
#d23f31
;
border-left-color
:
#d23f31
;
border-radius
:
50%
;
-webkit-animation
:
nprogress-spinner
400ms
linear
infinite
;
animation
:
nprogress-spinner
400ms
linear
infinite
;
}
.nprogress-custom-parent
{
overflow
:
hidden
;
position
:
relative
;
}
.nprogress-custom-parent
#nprogress
.spinner
,
.nprogress-custom-parent
#nprogress
.bar
{
position
:
absolute
;
}
@-webkit-keyframes
nprogress-spinner
{
0
%
{
-webkit-transform
:
rotate
(
0deg
);
}
100
%
{
-webkit-transform
:
rotate
(
360deg
);
}
}
@keyframes
nprogress-spinner
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
360deg
);
}
}
src/main/webapp/js/lib/nprogress/nprogress.js
0 → 100644
View file @
02c38803
This diff is collapsed.
Click to expand it.
src/main/webapp/skins/Medium/archive-articles.ftl
View file @
02c38803
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
</head>
</head>
<body>
<body>
<
#include
"
header
.
ftl
"
>
<
#include
"
header
.
ftl
"
>
<div
id=
"pjax"
>
<
#if
pjax
>
<!---- pjax {#pjax} start ---->
</
#
if>
<
#include
"
nav
.
ftl
"
>
<
#include
"
nav
.
ftl
"
>
<div
class=
"main"
>
<div
class=
"main"
>
<
#if
noticeBoard
??
>
<
#if
noticeBoard
??
>
...
@@ -54,6 +56,8 @@
...
@@ -54,6 +56,8 @@
</div>
</div>
<
#include
"
bottom2
.
ftl
"
>
<
#include
"
bottom2
.
ftl
"
>
</div>
</div>
<
#if
pjax
>
<!---- pjax {#pjax} end ---->
</
#
if>
</div>
<
#include
"
footer
.
ftl
"
>
<
#include
"
footer
.
ftl
"
>
</body>
</body>
</html>
</html>
src/main/webapp/skins/Medium/archives.ftl
View file @
02c38803
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
</head>
</head>
<body>
<body>
<
#include
"
header
.
ftl
"
>
<
#include
"
header
.
ftl
"
>
<div
id=
"pjax"
>
<
#if
pjax
>
<!---- pjax {#pjax} start ---->
</
#
if>
<
#include
"
nav
.
ftl
"
>
<
#include
"
nav
.
ftl
"
>
<div
class=
"main"
>
<div
class=
"main"
>
<
#if
noticeBoard
??
>
<
#if
noticeBoard
??
>
...
@@ -66,6 +68,8 @@
...
@@ -66,6 +68,8 @@
</
#
if>
</
#
if>
</div>
</div>
<
#include
"
bottom
.
ftl
"
>
<
#include
"
bottom
.
ftl
"
>
</div>
<
#if
pjax
>
<!---- pjax {#pjax} end ---->
</
#
if>
</div>
</div>
<
#include
"
footer
.
ftl
"
>
<
#include
"
footer
.
ftl
"
>
</body>
</body>
...
...
src/main/webapp/skins/Medium/article.ftl
View file @
02c38803
...
@@ -51,6 +51,8 @@
...
@@ -51,6 +51,8 @@
</head>
</head>
<body>
<body>
<
#include
"
header
.
ftl
"
>
<
#include
"
header
.
ftl
"
>
<div
id=
"pjaxArticle"
>
<
#if
pjax
>
<!---- pjax {#pjaxArticle} start ---->
</
#
if>
<div
class=
"main post__main"
>
<div
class=
"main post__main"
>
<
#if
noticeBoard
??
>
<
#if
noticeBoard
??
>
<div
class=
"board"
>
<div
class=
"board"
>
...
@@ -82,7 +84,9 @@
...
@@ -82,7 +84,9 @@
</div>
</div>
</
#
if>
</
#
if>
</section>
</section>
<footer
class=
"post__tags"
>
<footer
data-oid=
"${article.oId}"
class=
"post__tags"
data-tag=
"<#list article.articleTags?split("
,")
as
articleTag
>
${articleTag}
<
#if
articleTag_has_next
>
,
</
#
if></
#
list>
">
<
#list
article
.
articleTags
?
split
(",")
as
articleTag
>
<
#list
article
.
articleTags
?
split
(",")
as
articleTag
>
<a
class=
"tag"
rel=
"tag"
href=
"${servePath}/tags/${articleTag?url('UTF-8')}"
>
<a
class=
"tag"
rel=
"tag"
href=
"${servePath}/tags/${articleTag?url('UTF-8')}"
>
${articleTag}
</a>
${articleTag}
</a>
...
@@ -212,7 +216,10 @@
...
@@ -212,7 +216,10 @@
data-avatar=
"${article.authorThumbnailURL}"
></span>
data-avatar=
"${article.authorThumbnailURL}"
></span>
</div>
</div>
</div>
</div>
<script
type=
"text/javascript"
src=
"${staticServePath}/js/lib/jquery/jquery.min.js"
charset=
"utf-8"
></script>
<
#if
pjax
>
<!---- pjax {#pjaxArticle} end ---->
</
#
if>
</div>
<script
type=
"text/javascript"
src=
"${staticServePath}/js/lib/compress/pjax.min.js"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
src=
"${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
<script
type=
"text/javascript"
src=
"${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
charset=
"utf-8"
></script>
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
<script
type=
"text/javascript"
...
@@ -251,17 +258,19 @@
...
@@ -251,17 +258,19 @@
Skin
.
initArticle
();
Skin
.
initArticle
();
</script>
</script>
<
@
comment_script
oId=
article.oId
>
<
@
comment_script
oId=
article.oId
>
page.tips.externalRelevantArticlesDisplayCount = "${externalRelevantArticlesDisplayCount}";
Skin.initComment = function (articleOId, articleTags) {
<
#if
0
!=
randomArticlesDisplayCount
>
page.tips.externalRelevantArticlesDisplayCount = "${externalRelevantArticlesDisplayCount}";
page.loadRandomArticles("
<div
class=
'module__title'
><span>
${randomArticlesLabel}
</span></div>
");
<
#if
0
!=
randomArticlesDisplayCount
>
</
#
if>
page.loadRandomArticles("
<div
class=
'module__title'
><span>
${randomArticlesLabel}
</span></div>
");
<
#if
0
!=
externalRelevantArticlesDisplayCount
>
</
#
if>
page.loadExternalRelevantArticles("
<
#list
article
.
articleTags
?
split
(",")
as
articleTag
>
${articleTag}
<
#if
articleTag_has_next
>
,
</
#
if></
#
list>
"
<
#if
0
!=
externalRelevantArticlesDisplayCount
>
, "
<div
class=
'module__title'
><span>
${externalRelevantArticlesLabel}
</span></div>
");
page.loadExternalRelevantArticles(articleTags, "
<div
class=
'module__title'
><span>
${externalRelevantArticlesLabel}
</span></div>
");
</
#
if>
</
#
if>
<
#if
0
!=
relevantArticlesDisplayCount
>
<
#if
0
!=
relevantArticlesDisplayCount
>
page.loadRelevantArticles('${article.oId}', '
<div
class=
"module__title"
><span>
${relevantArticlesLabel}
</span></div>
');
page.loadRelevantArticles(articleOId, '
<div
class=
"module__title"
><span>
${relevantArticlesLabel}
</span></div>
');
</
#
if>
</
#
if>
}
Skin.initComment('${article.oId}', "
<
#list
article
.
articleTags
?
split
(",")
as
articleTag
>
${articleTag}
<
#if
articleTag_has_next
>
,
</
#
if></
#
list>
")
</
@
comment
_script
>
</
@
comment
_script
>
${plugins}
${plugins}
</body>
</body>
...
...
src/main/webapp/skins/Medium/category-articles.ftl
View file @
02c38803
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
</head>
</head>
<body>
<body>
<
#include
"
header
.
ftl
"
>
<
#include
"
header
.
ftl
"
>
<div
id=
"pjax"
>
<
#if
pjax
>
<!---- pjax {#pjax} start ---->
</
#
if>
<
#include
"
nav
.
ftl
"
>
<
#include
"
nav
.
ftl
"
>
<div
class=
"main"
>
<div
class=
"main"
>
<
#if
noticeBoard
??
>
<
#if
noticeBoard
??
>
...
@@ -48,6 +50,8 @@
...
@@ -48,6 +50,8 @@
<
#include
"
article-list
.
ftl
"
>
<
#include
"
article-list
.
ftl
"
>
</div>
</div>
<
#include
"
bottom2
.
ftl
"
>
<
#include
"
bottom2
.
ftl
"
>
</div>
<
#if
pjax
>
<!---- pjax {#pjax} end ---->
</
#
if>
</div>
</div>
<
#include
"
footer
.
ftl
"
>
<
#include
"
footer
.
ftl
"
>
</body>
</body>
...
...
src/main/webapp/skins/Medium/css/base.css
View file @
02c38803
...
@@ -1356,3 +1356,78 @@ blockquote {
...
@@ -1356,3 +1356,78 @@ blockquote {
padding-left
:
0
;
padding-left
:
0
;
}
}
}
}
/* Make clicks pass-through */
#nprogress
{
pointer-events
:
none
;
}
#nprogress
.bar
{
background
:
#d23f31
;
position
:
fixed
;
z-index
:
1031
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
2px
;
}
/* Fancy blur effect */
#nprogress
.peg
{
display
:
block
;
position
:
absolute
;
right
:
0px
;
width
:
100px
;
height
:
100%
;
box-shadow
:
0
0
10px
#d23f31
,
0
0
5px
#d23f31
;
opacity
:
1.0
;
-webkit-transform
:
rotate
(
3deg
)
translate
(
0px
,
-4px
);
-ms-transform
:
rotate
(
3deg
)
translate
(
0px
,
-4px
);
transform
:
rotate
(
3deg
)
translate
(
0px
,
-4px
);
}
/* Remove these to get rid of the spinner */
#nprogress
.spinner
{
display
:
block
;
position
:
fixed
;
z-index
:
1031
;
top
:
15px
;
right
:
15px
;
}
#nprogress
.spinner-icon
{
width
:
18px
;
height
:
18px
;
box-sizing
:
border-box
;
border
:
solid
2px
transparent
;
border-top-color
:
#d23f31
;
border-left-color
:
#d23f31
;
border-radius
:
50%
;
-webkit-animation
:
nprogress-spinner
400ms
linear
infinite
;
animation
:
nprogress-spinner
400ms
linear
infinite
;
}
.nprogress-custom-parent
{
overflow
:
hidden
;
position
:
relative
;
}
.nprogress-custom-parent
#nprogress
.spinner
,
.nprogress-custom-parent
#nprogress
.bar
{
position
:
absolute
;
}
@-webkit-keyframes
nprogress-spinner
{
0
%
{
-webkit-transform
:
rotate
(
0deg
);
}
100
%
{
-webkit-transform
:
rotate
(
360deg
);
}
}
@keyframes
nprogress-spinner
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
360deg
);
}
}
src/main/webapp/skins/Medium/footer.ftl
View file @
02c38803
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
</footer>
</footer>
</div>
</div>
<script type="text/javascript" src="${staticServePath}/js/lib/
jquery/jquery
.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/lib/
compress/pjax
.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
<script type="text/javascript" src="${staticServePath}/js/common${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script>
charset="utf-8"></script>
<script type="text/javascript"
<script type="text/javascript"
...
...
src/main/webapp/skins/Medium/index.ftl
View file @
02c38803
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
</head>
</head>
<body>
<body>
<
#include
"
header
.
ftl
"
>
<
#include
"
header
.
ftl
"
>
<div
id=
"pjax"
>
<
#if
pjax
>
<!---- pjax {#pjax} start ---->
</
#
if>
<
#include
"
nav
.
ftl
"
>
<
#include
"
nav
.
ftl
"
>
<div
class=
"main"
>
<div
class=
"main"
>
<
#if
noticeBoard
??
>
<
#if
noticeBoard
??
>
...
@@ -44,6 +46,8 @@
...
@@ -44,6 +46,8 @@
</div>
</div>
<
#include
"
bottom2
.
ftl
"
>
<
#include
"
bottom2
.
ftl
"
>
</div>
</div>
<
#if
pjax
>
<!---- pjax {#pjax} end ---->
</
#
if>
</div>
<
#include
"
footer
.
ftl
"
>
<
#include
"
footer
.
ftl
"
>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/webapp/skins/Medium/js/common.js
View file @
02c38803
...
@@ -45,6 +45,42 @@ var Skin = {
...
@@ -45,6 +45,42 @@ var Skin = {
}
}
});
});
$
(
window
).
scroll
();
$
(
window
).
scroll
();
Util
.
initPjax
(
function
()
{
Util
.
parseMarkdown
(
'
content-reset
'
);
if
(
location
.
href
===
latkeConfig
.
servePath
+
'
/tags.html
'
)
{
Skin
.
initTags
()
}
},
function
()
{
Util
.
parseMarkdown
(
'
content-reset
'
);
Skin
.
initArticle
();
Skin
.
initComment
(
$
(
'
.post__tags
'
).
data
(
'
oid
'
),
$
(
'
.post__tags
'
).
data
(
'
tag
'
))
})
},
initTags
:
function
()
{
var
$tags
=
$
(
'
#tags
'
);
var
tagsArray
=
$tags
.
find
(
'
.tag
'
)
// 根据引用次数添加样式,产生云效果
var
max
=
parseInt
(
tagsArray
.
first
().
data
(
'
count
'
));
var
distance
=
Math
.
ceil
(
max
/
5
);
for
(
var
i
=
0
;
i
<
tagsArray
.
length
;
i
++
)
{
var
count
=
parseInt
(
$
(
tagsArray
[
i
]).
data
(
'
count
'
));
// 算出当前 tag 数目所在的区间,加上 class
for
(
var
j
=
0
;
j
<
5
;
j
++
)
{
if
(
count
>
j
*
distance
&&
count
<=
(
j
+
1
)
*
distance
)
{
tagsArray
[
i
].
className
=
'
tag tag__level
'
+
j
;
break
;
}
}
}
// 按字母或者中文拼音进行排序
$tags
.
html
(
tagsArray
.
get
().
sort
(
function
(
a
,
b
)
{
var
valA
=
$
(
a
).
text
().
toLowerCase
();
var
valB
=
$
(
b
).
text
().
toLowerCase
();
// 对中英文排序的处理
return
valA
.
localeCompare
(
valB
);
}));
},
},
initArticle
:
function
()
{
initArticle
:
function
()
{
Skin
.
_share
(
'
#articleShare
'
)
Skin
.
_share
(
'
#articleShare
'
)
...
...
src/main/webapp/skins/Medium/links.ftl
View file @
02c38803
...
@@ -28,35 +28,39 @@
...
@@ -28,35 +28,39 @@
</head>
</head>
<body>
<body>
<
#include
"
header
.
ftl
"
>
<
#include
"
header
.
ftl
"
>
<
#include
"
nav
.
ftl
"
>
<div
id=
"pjax"
>
<div
class=
"main"
>
<
#if
pjax
>
<!---- pjax {#pjax} start ---->
</
#
if>
<
#if
noticeBoard
??
>
<
#include
"
nav
.
ftl
"
>
<div
class=
"board"
>
<div
class=
"main"
>
${noticeBoard}
<
#if
noticeBoard
??
>
</div>
<div
class=
"board"
>
</
#
if>
${noticeBoard}
<div
class=
"wrapper content"
>
<div
class=
"module__title"
>
<span>
${links?size}
<span
class=
"ft-green ft-12"
>
${linkLabel}
</span>
</span>
</div>
</div>
<
#if
0
!=
links
?
size
>
<
#list
links
as
link
>
<div
class=
"page__item"
>
<h3>
<a
rel=
"friend"
class=
"ft-gray"
href=
"${link.linkAddress}"
target=
"_blank"
>
${link.linkTitle}
<span
class=
"ft-12 ft-green"
>
${link.linkDescription}
</span>
</a>
</h3>
</div>
</
#
list>
</
#
if>
</
#
if>
<div
class=
"wrapper content"
>
<div
class=
"module__title"
>
<span>
${links?size}
<span
class=
"ft-green ft-12"
>
${linkLabel}
</span>
</span>
</div>
<
#if
0
!=
links
?
size
>
<
#list
links
as
link
>
<div
class=
"page__item"
>
<h3>
<a
rel=
"friend"
class=
"ft-gray"
href=
"${link.linkAddress}"
target=
"_blank"
>
${link.linkTitle}
<span
class=
"ft-12 ft-green"
>
${link.linkDescription}
</span>
</a>
</h3>
</div>
</
#
list>
</
#
if>
</div>
<
#include
"
bottom
.
ftl
"
>
</div>
</div>
<
#i
nclude
"
bottom
.
ftl
"
>
<
#i
f
pjax
>
<!---- pjax {#pjax} end ---->
</
#
if
>
</div>
</div>
<
#include
"
footer
.
ftl
"
>
<
#include
"
footer
.
ftl
"
>
</body>
</body>
...
...
src/main/webapp/skins/Medium/page.ftl
View file @
02c38803
...
@@ -41,7 +41,6 @@
...
@@ -41,7 +41,6 @@
<section
class=
"content-reset"
>
<section
class=
"content-reset"
>
${page.pageContent}
${page.pageContent}
</section>
</section>
</article>
</article>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/skins/Medium/tag-articles.ftl
View file @
02c38803
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
</head>
</head>
<body>
<body>
<
#include
"
header
.
ftl
"
>
<
#include
"
header
.
ftl
"
>
<div
id=
"pjax"
>
<
#if
pjax
>
<!---- pjax {#pjax} start ---->
</
#
if>
<
#include
"
nav
.
ftl
"
>
<
#include
"
nav
.
ftl
"
>
<div
class=
"main"
>
<div
class=
"main"
>
<
#if
noticeBoard
??
>
<
#if
noticeBoard
??
>
...
@@ -49,6 +51,8 @@
...
@@ -49,6 +51,8 @@
<
#include
"
article-list
.
ftl
"
>
<
#include
"
article-list
.
ftl
"
>
</div>
</div>
<
#include
"
bottom2
.
ftl
"
>
<
#include
"
bottom2
.
ftl
"
>
</div>
<
#if
pjax
>
<!---- pjax {#pjax} end ---->
</
#
if>
</div>
</div>
<
#include
"
footer
.
ftl
"
>
<
#include
"
footer
.
ftl
"
>
</body>
</body>
...
...
src/main/webapp/skins/Medium/tags.ftl
View file @
02c38803
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
</head>
</head>
<body>
<body>
<
#include
"
header
.
ftl
"
>
<
#include
"
header
.
ftl
"
>
<div
id=
"pjax"
>
<
#if
pjax
>
<!---- pjax {#pjax} start ---->
</
#
if>
<
#include
"
nav
.
ftl
"
>
<
#include
"
nav
.
ftl
"
>
<div
class=
"main"
>
<div
class=
"main"
>
<
#if
noticeBoard
??
>
<
#if
noticeBoard
??
>
...
@@ -53,34 +55,12 @@
...
@@ -53,34 +55,12 @@
</div>
</div>
</div>
</div>
<
#include
"
bottom
.
ftl
"
>
<
#include
"
bottom
.
ftl
"
>
</div>
<
#if
pjax
>
<!---- pjax {#pjax} end ---->
</
#
if>
</div>
</div>
<
#include
"
footer
.
ftl
"
>
<
#include
"
footer
.
ftl
"
>
<script>
<script>
(
function
()
{
Skin
.
initTags
()
var
$tags
=
$
(
'
#tags
'
);
var
tagsArray
=
$tags
.
find
(
'
.tag
'
)
// 根据引用次数添加样式,产生云效果
var
max
=
parseInt
(
tagsArray
.
first
().
data
(
'
count
'
));
var
distance
=
Math
.
ceil
(
max
/
5
);
for
(
var
i
=
0
;
i
<
tagsArray
.
length
;
i
++
)
{
var
count
=
parseInt
(
$
(
tagsArray
[
i
]).
data
(
'
count
'
));
// 算出当前 tag 数目所在的区间,加上 class
for
(
var
j
=
0
;
j
<
5
;
j
++
)
{
if
(
count
>
j
*
distance
&&
count
<=
(
j
+
1
)
*
distance
)
{
tagsArray
[
i
].
className
=
'
tag tag__level
'
+
j
;
break
;
}
}
}
// 按字母或者中文拼音进行排序
$tags
.
html
(
tagsArray
.
get
().
sort
(
function
(
a
,
b
)
{
var
valA
=
$
(
a
).
text
().
toLowerCase
();
var
valB
=
$
(
b
).
text
().
toLowerCase
();
// 对中英文排序的处理
return
valA
.
localeCompare
(
valB
);
}));
})();
</script>
</script>
</body>
</body>
</html>
</html>
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