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
7a81c585
Unverified
Commit
7a81c585
authored
Mar 04, 2019
by
Van
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
#12689
parent
f10de201
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
58 deletions
+8
-58
pom.xml
pom.xml
+5
-2
src/main/webapp/WEB-INF/static-resources.xml
src/main/webapp/WEB-INF/static-resources.xml
+0
-2
src/main/webapp/js/admin/admin.min.js
src/main/webapp/js/admin/admin.min.js
+2
-19
src/main/webapp/js/common.min.js
src/main/webapp/js/common.min.js
+0
-17
src/main/webapp/js/page.min.js
src/main/webapp/js/page.min.js
+0
-17
src/main/webapp/skins
src/main/webapp/skins
+1
-1
No files found.
pom.xml
View file @
7a81c585
...
...
@@ -302,10 +302,9 @@
<includes>
<include>
**/src/*/java/**/*.java
</include>
<include>
**/src/*/webapp/js/*.js
</include>
<include>
**/src/*/webapp/css/*.css
</include>
<include>
**/src/*/webapp/**/*.ftl
</include>
<include>
**/src/*/webapp/skins/*/js/*.js
</include>
<include>
**/src/*/webapp/skins/*/css/*.css
</include>
<include>
**/src/*/webapp/skins/*/css/*.
s
css
</include>
<include>
**/src/*/webapp/skins/**/*.properties
</include>
<include>
**/src/*/webapp/plugins/*/js/*.js
</include>
<include>
**/src/*/webapp/plugins/*/css/*.css
</include>
...
...
@@ -319,6 +318,10 @@
<excludes>
<exclude>
**/src/main/java/**/package-info.java
</exclude>
<exclude>
**/src/*/webapp/js/lib/*.js
</exclude>
<include>
**/src/*/webapp/js/*.min.js
</include>
<include>
**/src/*/webapp/js/admin/*.min.js
</include>
<include>
**/src/*/webapp/skins/*/js/*.min.js
</include>
<include>
**/src/*/webapp/skins/*/css/*.css
</include>
<exclude>
**/src/main/java/com/**/*.java
</exclude>
</excludes>
...
...
src/main/webapp/WEB-INF/static-resources.xml
View file @
7a81c585
...
...
@@ -54,9 +54,7 @@
<include
path=
"/js/**/*.woff"
/>
<include
path=
"/skins/**.css"
/>
<include
path=
"/skins/**.css.map"
/>
<include
path=
"/skins/**/*.css"
/>
<include
path=
"/skins/**/*.css.map"
/>
<include
path=
"/skins/**.js"
/>
<include
path=
"/skins/**/*.js"
/>
<include
path=
"/skins/**.png"
/>
...
...
src/main/webapp/js/admin/admin.min.js
View file @
7a81c585
This diff is collapsed.
Click to expand it.
src/main/webapp/js/common.min.js
View file @
7a81c585
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, 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/>.
*/
var
Util
=
{
isArticlePage
:
function
(
e
){
var
t
=!
0
;
return
-
1
<
e
.
indexOf
(
latkeConfig
.
servePath
+
"
/tags/
"
)
&&
(
t
=!
1
),
-
1
<
e
.
indexOf
(
latkeConfig
.
servePath
+
"
/tags.html
"
)
&&
(
t
=!
1
),
-
1
<
e
.
indexOf
(
latkeConfig
.
servePath
+
"
/category/
"
)
&&
(
t
=!
1
),
-
1
<
e
.
indexOf
(
latkeConfig
.
servePath
+
"
/archives.html
"
)
&&
(
t
=!
1
),
-
1
<
e
.
indexOf
(
latkeConfig
.
servePath
+
"
/archives/
"
)
&&
(
t
=!
1
),
-
1
<
e
.
indexOf
(
latkeConfig
.
servePath
+
"
/links.html
"
)
&&
(
t
=!
1
),
e
===
latkeConfig
.
servePath
&&
(
t
=!
1
),
/^
[
0-9
]
*$/
.
test
(
e
.
replace
(
latkeConfig
.
servePath
+
"
/
"
,
""
))
&&
(
t
=!
1
),
t
},
initPjax
:
function
(
e
){
1
===
$
(
"
#pjax
"
).
length
&&
(
$
.
pjax
({
selector
:
"
a
"
,
container
:
"
#pjax
"
,
show
:
""
,
cache
:
!
1
,
storage
:
!
0
,
titleSuffix
:
""
,
filter
:
function
(
e
){
return
e
===
latkeConfig
.
servePath
+
"
/rss.xml
"
||-
1
<
e
.
indexOf
(
latkeConfig
.
servePath
+
"
/admin-index.do
"
)
||!
(
-
1
<
e
.
indexOf
(
latkeConfig
.
servePath
))},
callback
:
function
(){
e
&&
e
()}}),
NProgress
.
configure
({
showSpinner
:
!
1
}),
$
(
"
#pjax
"
).
bind
(
"
pjax.start
"
,
function
(){
NProgress
.
start
()}),
$
(
"
#pjax
"
).
bind
(
"
pjax.end
"
,
function
(){
window
.
scroll
(
window
.
scrollX
,
0
),
NProgress
.
done
()}))},
parseMarkdown
:
function
(){
var
e
=!
1
,
t
=!
1
,
i
=
"
content-reset
"
;
if
(
$
(
"
.
"
+
i
).
each
(
function
(){
$
(
this
).
find
(
"
p
"
).
each
(
function
(){(
2
<
$
(
this
).
text
().
split
(
"
$
"
).
length
||
1
<
$
(
this
).
text
().
split
(
"
\\
(
"
).
length
&&
1
<
$
(
this
).
text
().
split
(
"
\\
)
"
).
length
)
&&
(
e
=!
0
)}),
0
<
$
(
this
).
find
(
"
code.lang-flow, code.language-flow
"
).
length
&&
(
t
=!
0
)}),
e
){
var
n
=
function
(){
MathJax
.
Hub
.
Config
({
tex2jax
:{
inlineMath
:[[
"
$
"
,
"
$
"
],[
"
\\
(
"
,
"
\\
)
"
]],
displayMath
:[[
"
$$
"
,
"
$$
"
]],
processEscapes
:
!
0
,
processEnvironments
:
!
0
,
skipTags
:[
"
pre
"
,
"
code
"
,
"
script
"
]},
asciimath2jax
:{
delimiters
:[[
"
$
"
,
"
$
"
]]}}),
MathJax
.
Hub
.
Typeset
()};
"
undefined
"
!=
typeof
MathJax
?
n
():
$
.
ajax
({
method
:
"
GET
"
,
url
:
"
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML
"
,
dataType
:
"
script
"
,
cache
:
!
0
}).
done
(
function
(){
n
()})}
if
(
t
){
var
o
=
function
(){
$
(
"
.
"
+
i
+
"
code.lang-flow, .
"
+
i
+
"
code.language-flow
"
).
each
(
function
(
e
){
var
t
=
$
(
this
),
i
=
"
symFlow
"
+
(
new
Date
).
getTime
()
+
e
;
t
.
hide
();
var
n
=
flowchart
.
parse
(
$
.
trim
(
t
.
text
()));
t
.
parent
().
after
(
'
<div style="text-align: center" id="
'
+
i
+
'
"></div>
'
),
n
.
drawSVG
(
i
),
t
.
parent
().
remove
(),
$
(
"
#
"
+
i
).
find
(
"
svg
"
).
height
(
"
auto
"
).
width
(
"
auto
"
)})};
"
undefined
"
!=
typeof
flowchart
?
o
():
$
.
ajax
({
method
:
"
GET
"
,
url
:
latkeConfig
.
staticServePath
+
"
/js/lib/flowchart/flowchart.min.js
"
,
dataType
:
"
script
"
,
cache
:
!
0
}).
done
(
function
(){
o
()})}},
killIE
:
function
(
e
){
var
t
=
navigator
.
userAgent
.
split
(
"
MSIE
"
)[
1
];
t
&&
(
e
||
(
e
=
7
),
parseFloat
(
t
.
split
(
"
;
"
))
<=
e
&&
function
(){
if
(
""
===
Cookie
.
readCookie
(
"
showKill
"
))
try
{
var
t
=
"
<div style='display: block; height: 100%; width: 100%; position: fixed; background-color: rgb(0, 0, 0); opacity: 0.6;filter: alpha(opacity=60); top: 0px;z-index:110'></div><iframe style='left:
"
+
(
$
(
window
).
width
()
-
781
)
/
2
+
"
px;z-index:120;top:
"
+
(
$
(
window
).
height
()
-
680
)
/
2
+
"
px; position: fixed; border: 0px none; width: 781px; height: 680px;' src='
"
+
latkeConfig
.
servePath
+
"
/kill-browser'></iframe>
"
;
$
(
"
body
"
).
append
(
t
)}
catch
(
e
){
t
=
"
<div style='display: block; height: 100%; width: 100%; position: fixed; background-color: rgb(0, 0, 0); opacity: 0.6;filter: alpha(opacity=60); top: 0px;z-index:110'></div><iframe style='left:10px;z-index:120;top: 0px; position: fixed; border: 0px none; width: 781px; height: 680px;' src='
"
+
latkeConfig
.
servePath
+
"
/kill-browser'></iframe>
"
,
document
.
body
.
innerHTML
=
document
.
body
.
innerHTML
+
t
}}())},
replaceEmString
:
function
(
e
){
var
t
=
e
.
split
(
"
[em
"
);
if
(
1
===
t
.
length
)
return
e
;
e
=
t
[
0
];
for
(
var
i
=
1
;
i
<
t
.
length
;
i
++
){
var
n
=
t
[
i
].
substr
(
0
,
2
);
e
+=
"
<img width='20' src='
"
+
latkeConfig
.
staticServePath
+
"
/images/emotions/em
"
+
n
+
"
.png' alt='
"
+
Label
[
"
em
"
+
n
+
"
Label
"
]
+
"
' title='
"
+
Label
[
"
em
"
+
n
+
"
Label
"
]
+
"
'/>
"
+
t
[
i
].
substr
(
3
)}
return
e
},
switchMobile
:
function
(
e
){
Cookie
.
createCookie
(
"
btouch_switch_toggle
"
,
e
,
365
),
setTimeout
(
function
(){
location
.
reload
()},
1250
)},
setTopBar
:
function
(){
var
e
=
$
(
"
#top
"
);
if
(
1
===
e
.
length
){
var
t
=
$
(
"
#showTop
"
);
t
.
click
(
function
(){
e
.
slideDown
(),
t
.
hide
()}),
$
(
"
#hideTop
"
).
click
(
function
(){
e
.
slideUp
(),
t
.
show
()})}},
goTop
:
function
(){
$
(
"
html, body
"
).
animate
({
scrollTop
:
0
},
800
)},
goBottom
:
function
(
e
){
e
||
(
e
=
0
),
$
(
"
html, body
"
).
animate
({
scrollTop
:
$
(
document
).
height
()
-
$
(
window
).
height
()
-
e
},
800
)},
init
:
function
(){
Util
.
killIE
(),
Util
.
setTopBar
(),
Util
.
parseMarkdown
(),
Util
.
initSW
()},
initSW
:
function
(){
navigator
.
serviceWorker
&&
navigator
.
serviceWorker
.
register
(
"
/sw.js
"
,{
scope
:
"
/
"
})},
replaceSideEm
:
function
(
e
){
for
(
var
t
=
0
;
t
<
e
.
length
;
t
++
){
var
i
=
$
(
e
[
t
]);
i
.
html
(
Util
.
replaceEmString
(
i
.
html
()))}},
buildTags
:
function
(
e
){
e
=
e
||
"
tags
"
;
for
(
var
t
=
[
"
tags1
"
,
"
tags2
"
,
"
tags3
"
,
"
tags4
"
,
"
tags5
"
],
i
=
$
(
"
#
"
+
e
+
"
b
"
).
get
(),
n
=
parseInt
(
$
(
"
#
"
+
e
+
"
b
"
).
last
().
text
()),
o
=
Math
.
ceil
(
n
/
t
.
length
),
a
=
0
;
a
<
i
.
length
;
a
++
)
for
(
var
r
=
parseInt
(
i
[
a
].
innerHTML
),
s
=
0
;
s
<
t
.
length
;
s
++
)
if
(
s
*
o
<
r
&&
r
<=
(
s
+
1
)
*
o
){
i
[
a
].
parentNode
.
className
=
t
[
s
];
break
}
$
(
"
#
"
+
e
).
html
(
$
(
"
#
"
+
e
+
"
li
"
).
get
().
sort
(
function
(
e
,
t
){
var
i
=
$
(
e
).
find
(
"
span
"
).
text
().
toLowerCase
(),
n
=
$
(
t
).
find
(
"
span
"
).
text
().
toLowerCase
();
return
i
.
localeCompare
(
n
)}))},
toDate
:
function
(
e
,
t
){
var
i
=
new
Date
(
e
),
n
=
{
"
M+
"
:
i
.
getMonth
()
+
1
,
"
d+
"
:
i
.
getDate
(),
"
H+
"
:
i
.
getHours
(),
"
m+
"
:
i
.
getMinutes
(),
"
s+
"
:
i
.
getSeconds
(),
"
q+
"
:
Math
.
floor
((
i
.
getMonth
()
+
3
)
/
3
),
S
:
i
.
getMilliseconds
()};
for
(
var
o
in
/
(
y+
)
/
.
test
(
t
)
&&
(
t
=
t
.
replace
(
RegExp
.
$1
,(
i
.
getFullYear
()
+
""
).
substr
(
4
-
RegExp
.
$1
.
length
))),
n
)
new
RegExp
(
"
(
"
+
o
+
"
)
"
).
test
(
t
)
&&
(
t
=
t
.
replace
(
RegExp
.
$1
,
1
==
RegExp
.
$1
.
length
?
n
[
o
]:(
"
00
"
+
n
[
o
]).
substr
((
""
+
n
[
o
]).
length
)));
return
t
}};
if
(
!
Cookie
)
var
Cookie
=
{
readCookie
:
function
(
e
){
for
(
var
t
=
e
+
"
=
"
,
i
=
document
.
cookie
.
split
(
"
;
"
),
n
=
0
;
n
<
i
.
length
;
n
++
){
for
(
var
o
=
i
[
n
];
"
"
==
o
.
charAt
(
0
);)
o
=
o
.
substring
(
1
,
o
.
length
);
if
(
0
==
o
.
indexOf
(
t
))
return
decodeURIComponent
(
o
.
substring
(
t
.
length
,
o
.
length
))}
return
""
},
eraseCookie
:
function
(
e
){
this
.
createCookie
(
e
,
""
,
-
1
)},
createCookie
:
function
(
e
,
t
,
i
){
var
n
=
""
;
if
(
i
){
var
o
=
new
Date
;
o
.
setTime
(
o
.
getTime
()
+
24
*
i
*
60
*
60
*
1
e3
),
n
=
"
; expires=
"
+
o
.
toGMTString
()}
document
.
cookie
=
e
+
"
=
"
+
encodeURIComponent
(
t
)
+
n
+
"
; path=/
"
}};
\ No newline at end of file
src/main/webapp/js/page.min.js
View file @
7a81c585
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, 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/>.
*/
var
Page
=
function
(
e
){
this
.
currentCommentId
=
""
,
this
.
tips
=
e
};
$
.
extend
(
Page
.
prototype
,{
replaceCommentsEm
:
function
(
e
){
for
(
var
t
=
$
(
e
),
o
=
0
;
o
<
t
.
length
;
o
++
){
var
i
=
t
[
o
].
innerHTML
;
t
[
o
].
innerHTML
=
Util
.
replaceEmString
(
i
)}},
parseLanguage
:
function
(
e
){
var
t
=!
1
;
$
(
"
.content-reset pre
"
).
each
(
function
(){
t
=!
0
}),
t
&&
(
document
.
createStyleSheet
?
document
.
createStyleSheet
(
latkeConfig
.
staticServePath
+
"
/js/lib/highlight-9.13.1/styles/
"
+
(
e
&&
e
.
theme
||
"
github
"
)
+
"
.css
"
):
$
(
"
head
"
).
append
(
$
(
"
<link rel='stylesheet' href='
"
+
latkeConfig
.
staticServePath
+
"
/js/lib/highlight-9.13.1/styles/
"
+
(
e
&&
e
.
theme
||
"
github
"
)
+
"
.css'>
"
)),
Label
.
markedAvailable
||
$
.
ajax
({
url
:
latkeConfig
.
staticServePath
+
"
/js/lib/highlight-9.13.1/highlight.pack.js
"
,
dataType
:
"
script
"
,
cache
:
!
0
,
success
:
function
(){
hljs
.
initHighlighting
.
called
=!
1
,
hljs
.
initHighlighting
()}}))},
load
:
function
(
e
){
var
t
=
this
;
t
.
parseLanguage
(
e
),
$
(
"
#comment
"
).
click
(
function
(){
t
.
toggleEditor
()}).
attr
(
"
readonly
"
,
"
readonly
"
),
$
(
"
#soloEditorCancel
"
).
click
(
function
(){
t
.
toggleEditor
()}),
$
(
"
#soloEditorAdd
"
).
click
(
function
(){
t
.
submitComment
()})},
toggleEditor
:
function
(
e
,
t
){
var
o
=
this
;
"
undefined
"
==
typeof
Vditor
&&
$
.
ajax
({
method
:
"
GET
"
,
url
:
latkeConfig
.
staticServePath
+
"
/js/lib/vditor-0.2.5/index.min.js
"
,
dataType
:
"
script
"
,
cache
:
!
0
,
async
:
!
1
,
success
:
function
(){
window
.
vditor
=
new
Vditor
(
"
soloEditorComment
"
,{
placeholder
:
o
.
tips
.
commentContentCannotEmptyLabel
,
height
:
180
,
hint
:{
emojiPath
:
latkeConfig
.
staticServePath
+
"
/js/lib/emojify.js-1.1.0/images/basic
"
},
esc
:
function
(){
$
(
"
#soloEditorCancel
"
).
click
()},
ctrlEnter
:
function
(){
$
(
"
#soloEditorAdd
"
).
click
()},
preview
:{
delay
:
500
,
show
:
!
1
,
url
:
latkeConfig
.
servePath
+
"
/console/markdown/2html
"
,
parse
:
function
(
e
){
"
none
"
!==
e
.
style
.
display
&&
(
Util
.
parseMarkdown
(
"
content-reset
"
),
Label
.
markedAvailable
||
(
hljs
.
initHighlighting
.
called
=!
1
,
hljs
.
initHighlighting
()))}},
counter
:
500
,
resize
:{
enable
:
!
0
,
position
:
"
top
"
,
after
:
function
(){
$
(
"
body
"
).
css
(
"
padding-bottom
"
,
$
(
"
#soloEditor
"
).
outerHeight
())}},
lang
:
o
.
tips
.
langLabel
,
toolbar
:[
"
emoji
"
,
"
headings
"
,
"
bold
"
,
"
italic
"
,
"
strike
"
,
"
|
"
,
"
line
"
,
"
quote
"
,
"
|
"
,
"
list
"
,
"
ordered-list
"
,
"
check
"
,
"
|
"
,
"
code
"
,
"
inline-code
"
,
"
|
"
,
"
undo
"
,
"
redo
"
,
"
|
"
,
"
link
"
,
"
table
"
,
"
|
"
,
"
preview
"
,
"
fullscreen
"
,
"
info
"
,
"
help
"
],
classes
:{
preview
:
"
content__reset
"
}}),
vditor
.
focus
()}});
var
i
=
$
(
"
#soloEditor
"
);
0
!==
i
.
length
?
"
0px
"
===
$
(
"
body
"
).
css
(
"
padding-bottom
"
)
||
e
?(
$
(
"
#soloEditorError
"
).
text
(
""
),
i
.
css
({
bottom
:
"
0
"
,
opacity
:
1
}),
$
(
"
body
"
).
css
(
"
padding-bottom
"
,
"
238px
"
),
this
.
currentCommentId
=
e
,
$
(
"
#soloEditorReplyTarget
"
).
text
(
t
?
"
@
"
+
t
:
""
),
"
undefined
"
!=
typeof
vditor
&&
vditor
.
focus
()):(
i
.
css
({
bottom
:
"
-300px
"
,
opacity
:
0
}),
$
(
"
body
"
).
css
(
"
padding-bottom
"
,
0
)):
location
.
href
=
latkeConfig
.
servePath
+
"
/start
"
},
loadRandomArticles
:
function
(
s
){
var
c
=
this
.
tips
.
randomArticles1Label
;
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/articles/random
"
,
type
:
"
POST
"
,
success
:
function
(
e
,
t
){
var
o
=
e
.
randomArticles
;
if
(
o
&&
0
!==
o
.
length
){
for
(
var
i
=
""
,
n
=
0
;
n
<
o
.
length
;
n
++
){
var
l
=
o
[
n
],
a
=
l
.
articleTitle
;
i
+=
"
<li><a rel='nofollow' title='
"
+
a
+
"
' href='
"
+
latkeConfig
.
servePath
+
l
.
articlePermalink
+
"
'>
"
+
a
+
"
</a></li>
"
}
var
r
=
(
s
||
"
<h4>
"
+
c
+
"
</h4>
"
)
+
"
<ul>
"
+
i
+
"
</ul>
"
;
$
(
"
#randomArticles
"
).
append
(
r
)}
else
$
(
"
#randomArticles
"
).
remove
()}})},
loadRelevantArticles
:
function
(
e
,
s
){
$
.
ajax
({
url
:
latkeConfig
.
servePath
+
"
/article/id/
"
+
e
+
"
/relevant/articles
"
,
type
:
"
GET
"
,
success
:
function
(
e
,
t
){
var
o
=
e
.
relevantArticles
;
if
(
o
&&
0
!==
o
.
length
){
for
(
var
i
=
""
,
n
=
0
;
n
<
o
.
length
;
n
++
){
var
l
=
o
[
n
],
a
=
l
.
articleTitle
;
i
+=
"
<li><a rel='nofollow' title='
"
+
a
+
"
' href='
"
+
latkeConfig
.
servePath
+
l
.
articlePermalink
+
"
'>
"
+
a
+
"
</a></li>
"
}
var
r
=
s
+
"
<ul>
"
+
i
+
"
</ul>
"
;
$
(
"
#relevantArticles
"
).
append
(
r
)}
else
$
(
"
#relevantArticles
"
).
remove
()},
error
:
function
(){
$
(
"
#relevantArticles
"
).
remove
()}})},
loadExternalRelevantArticles
:
function
(
e
,
s
){
var
c
=
this
.
tips
;
try
{
$
.
ajax
({
url
:
"
https://rhythm.b3log.org/get-articles-by-tags.do?tags=
"
+
e
+
"
&blogHost=
"
+
c
.
blogHost
+
"
&paginationPageSize=
"
+
c
.
externalRelevantArticlesDisplayCount
,
type
:
"
GET
"
,
cache
:
!
0
,
dataType
:
"
jsonp
"
,
error
:
function
(){
$
(
"
#externalRelevantArticles
"
).
remove
()},
success
:
function
(
e
,
t
){
var
o
=
e
.
articles
;
if
(
o
&&
0
!==
o
.
length
){
for
(
var
i
=
""
,
n
=
0
;
n
<
o
.
length
;
n
++
){
var
l
=
o
[
n
],
a
=
l
.
articleTitle
;
i
+=
"
<li><a rel='nofollow' title='
"
+
a
+
"
' target='_blank' href='
"
+
l
.
articlePermalink
+
"
'>
"
+
a
+
"
</a></li>
"
}
var
r
=
(
s
||
"
<h4>
"
+
c
.
externalRelevantArticles1Label
+
"
</h4>
"
)
+
"
<ul>
"
+
i
+
"
</ul>
"
;
$
(
"
#externalRelevantArticles
"
).
append
(
r
)}
else
$
(
"
#externalRelevantArticles
"
).
remove
()}})}
catch
(
e
){}},
submitComment
:
function
(){
var
t
=
this
,
e
=
this
.
tips
,
o
=
"
article
"
;
if
(
void
0
===
e
.
externalRelevantArticlesDisplayCount
&&
(
o
=
"
page
"
),
1
<
vditor
.
getValue
().
length
&&
vditor
.
getValue
().
length
<
500
){
$
(
"
#soloEditorAdd
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
var
i
=
{
oId
:
e
.
oId
,
commentContent
:
vditor
.
getValue
()};
this
.
currentCommentId
&&
(
i
.
commentOriginalCommentId
=
this
.
currentCommentId
),
$
.
ajax
({
type
:
"
POST
"
,
url
:
latkeConfig
.
servePath
+
"
/
"
+
o
+
"
/comments
"
,
cache
:
!
1
,
contentType
:
"
application/json
"
,
data
:
JSON
.
stringify
(
i
),
success
:
function
(
e
){
$
(
"
#soloEditorAdd
"
).
removeAttr
(
"
disabled
"
),
e
.
sc
?(
t
.
toggleEditor
(),
vditor
.
setValue
(
""
),
t
.
addCommentAjax
(
Util
.
replaceEmString
(
e
.
cmtTpl
))):
$
(
"
#soloEditorError
"
).
html
(
e
.
msg
)}})}
else
$
(
"
#soloEditorError
"
).
text
(
t
.
tips
.
commentContentCannotEmptyLabel
)},
addReplyForm
:
function
(
e
,
t
){
this
.
currentCommentId
=
e
,
this
.
toggleEditor
(
e
,
t
)},
hideComment
:
function
(
e
){
$
(
"
#commentRef
"
+
e
).
hide
()},
showComment
:
function
(
e
,
t
,
o
,
i
){
var
n
=
parseInt
(
$
(
e
).
position
().
top
);
if
(
i
&&
(
n
=
parseInt
(
$
(
e
).
parents
(
i
).
position
().
top
)),
0
<
$
(
"
#commentRef
"
+
t
).
length
)
$
(
"
#commentRef
"
+
t
).
show
().
css
(
"
top
"
,
n
+
o
+
"
px
"
);
else
{
var
l
=
$
(
"
#
"
+
t
).
clone
();
l
.
addClass
(
"
comment-body-ref
"
).
attr
(
"
id
"
,
"
commentRef
"
+
t
),
l
.
find
(
"
#replyForm
"
).
remove
(),
$
(
"
#comments
"
).
append
(
l
),
$
(
"
#commentRef
"
+
t
).
css
(
"
top
"
,
n
+
o
+
"
px
"
)}},
addCommentAjax
:
function
(
e
){
0
<
$
(
"
#comments
"
).
children
().
length
?
$
(
$
(
"
#comments
"
).
children
()[
0
]).
before
(
e
):
$
(
"
#comments
"
).
html
(
e
),
window
.
location
.
hash
=
"
#comments
"
}});
\ No newline at end of file
skins
@
a08a2f38
Subproject commit
38f6da79d5253a455a1ba52959643ebf544e835c
Subproject commit
a08a2f385bfa1b4db285741ef3dae289b57129a0
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