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
a560b54a
Unverified
Commit
a560b54a
authored
Feb 19, 2019
by
Van
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
📦
parent
c37bf256
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
0 deletions
+102
-0
src/main/webapp/css/default-admin.min.css
src/main/webapp/css/default-admin.min.css
+17
-0
src/main/webapp/css/default-base.min.css
src/main/webapp/css/default-base.min.css
+17
-0
src/main/webapp/css/default-init.min.css
src/main/webapp/css/default-init.min.css
+17
-0
src/main/webapp/js/admin/admin.min.js
src/main/webapp/js/admin/admin.min.js
+17
-0
src/main/webapp/js/common.min.js
src/main/webapp/js/common.min.js
+17
-0
src/main/webapp/js/page.min.js
src/main/webapp/js/page.min.js
+17
-0
No files found.
src/main/webapp/css/default-admin.min.css
View file @
a560b54a
This diff is collapsed.
Click to expand it.
src/main/webapp/css/default-base.min.css
View file @
a560b54a
/**
* 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/>.
*/
body
,
dd
,
div
,
dl
,
h1
,
h2
,
h3
,
h4
,
h5
,
h6
,
html
,
img
,
li
,
ol
,
p
,
ul
{
padding
:
0
;
margin
:
0
}
.clear
,
.fn-clear
:after
{
clear
:
both
}
.form
th
,
.nowrap
{
white-space
:
nowrap
}
.goBottomIcon
,
.goTopIcon
{
position
:
fixed
;
right
:
20px
}
#tags
,
#tags
li
{
list-style
:
none
}
body
{
background-color
:
#FFF
;
color
:
#000
;
font-family
:
elvetica
,
Arial
,
sans-serif
,
'\5fae\8f6f\96c5\9ed1'
;
font-size
:
small
}
img
{
border
:
none
;
vertical-align
:
middle
}
h1
{
font-size
:
160%
}
h2
{
font-size
:
140%
}
h3
{
font-size
:
120%
}
h4
{
font-size
:
110%
}
textarea
{
overflow
:
auto
}
.button
,
button
{
background
:
url(../images/icon.png)
center
bottom
;
border
:
1px
solid
;
border-color
:
#CCC
#BBB
#A0A0A0
;
border-radius
:
4px
;
height
:
28px
;
margin
:
0
;
padding
:
0
6px
;
vertical-align
:
top
}
.button
:hover
,
button
:hover
{
border-color
:
#BBB
}
.padding12
{
padding
:
12px
}
.paddingBottom12
{
padding-bottom
:
12px
!important
}
.paddingTop12
{
padding-top
:
12px
!important
}
.margin12
{
margin
:
12px
}
.marginTop12
{
margin-top
:
12px
!important
}
.marginBottom12
{
margin-bottom
:
12px
!important
}
.marginLeft12
{
margin-left
:
12px
!important
}
.marginLeft6
{
margin-left
:
6px
!important
}
.marginRight12
{
margin-right
:
12px
!important
}
.f-bold
{
font-weight
:
700
!important
}
.left
{
float
:
left
}
.right
{
float
:
right
}
.clear
{
background-color
:
transparent
;
border
:
0
;
display
:
block
;
font-size
:
0
;
height
:
0
;
line-height
:
0
;
overflow
:
hidden
}
.fn-clear
:after
,
.fn-clear
:before
{
display
:
table
;
content
:
""
}
.fn__flex
{
display
:
flex
}
.fn__flex1
{
flex
:
1
;
min-width
:
1px
}
.fn__flex-inline
{
display
:
inline-flex
!important
;
align-items
:
center
}
.none
{
display
:
none
}
.pointer
{
cursor
:
pointer
}
.no-underline
{
text-decoration
:
none
!important
}
#tags
a
,
.logo
{
text-decoration
:
none
}
.red
{
color
:
red
}
.contentBody
{
margin-bottom
:
12px
;
padding
:
3px
12px
}
.form
th
{
text-align
:
right
}
.form
input
[
type
=
text
],
.form
input
[
type
=
password
],
.form
textarea
{
border-color
:
silver
#D9D9D9
#D9D9D9
;
border-right
:
1px
solid
#D9D9D9
;
border-style
:
solid
;
border-width
:
1px
;
font-family
:
Helvetica
,
Arial
,
sans-serif
;
font-size
:
12px
;
outline
:
0
;
width
:
99%
;
padding
:
0
3px
}
.form
input
{
height
:
24px
}
.form
input
[
type
=
checkbox
]
{
border
:
0
;
vertical-align
:
sub
;
height
:
20px
}
.form
input
.normalInput
{
width
:
auto
}
.form
input
[
type
=
checkbox
]
:focus
{
border
:
0
;
box-shadow
:
0
0
0
}
.form
input
:focus
,
.form
textarea
:focus
{
box-shadow
:
0
1px
2px
rgba
(
0
,
0
,
0
,
.3
)
inset
}
.form
textarea
{
padding
:
3px
;
overflow
:
auto
;
resize
:
vertical
}
.logo
{
padding
:
0
5px
;
text-shadow
:
0
0
1px
#EEE
}
.article-body
h1
,
.article-body
h2
{
padding-bottom
:
.3em
;
border-bottom
:
1px
solid
#eee
}
.aboutIcon
,
.adminIcon
,
.articlesIcon
,
.browserIcon
,
.cacheIcon
,
.calendarIcon
,
.commentIcon
,
.deleteIcon
,
.draftsIcon
,
.falseIcon
,
.fileIcon
,
.goBottomIcon
,
.goTopIcon
,
.homeIcon
,
.linkIcon
,
.loginIcon
,
.logoutIcon
,
.notPutTopIcon
,
.othersIcon
,
.pageIcon
,
.postIcon
,
.preferenceIcon
,
.putTopIcon
,
.trueIcon
,
.updateIcon
,
.usersIcon
{
background-image
:
url(../images/icon.png)
;
cursor
:
pointer
;
height
:
16px
;
width
:
16px
}
.adminIcon
,
.homeIcon
,
.loginIcon
,
.logoutIcon
{
margin-top
:
3px
}
.pageIcon
{
background-position
:
-144px
0
}
.postIcon
{
background-position
:
-16px
0
}
.linkIcon
{
background-position
:
-32px
0
}
.preferenceIcon
{
background-position
:
-48px
0
}
.articlesIcon
{
background-position
:
-64px
0
}
.trueIcon
{
background-position
:
-80px
0
;
cursor
:
auto
}
.falseIcon
{
background-position
:
-96px
0
;
cursor
:
auto
}
.fileIcon
{
background-position
:
-112px
0
}
.deleteIcon
{
background-position
:
0
-16px
}
.updateIcon
{
background-position
:
-16px
-16px
}
.commentIcon
{
background-position
:
-32px
-16px
}
.homeIcon
{
background-position
:
-64px
-16px
}
.adminIcon
{
background-position
:
-80px
-16px
}
.logoutIcon
{
background-position
:
-96px
-16px
}
.loginIcon
{
background-position
:
-112px
-16px
}
.browserIcon
{
background-position
:
-128px
-16px
}
.calendarIcon
{
background-position
:
-144px
-16px
}
.putTopIcon
{
background-position
:
-16px
-32px
;
float
:
left
}
.notPutTopIcon
{
background-position
:
-32px
-32px
;
float
:
left
}
.othersIcon
{
background-position
:
-48px
-32px
}
.cacheIcon
,
.draftsIcon
{
background-position
:
-96px
-32px
}
.usersIcon
{
background-position
:
-112px
-32px
}
.goTopIcon
{
background-position
:
-64px
-32px
;
top
:
45%
}
.goBottomIcon
{
background-position
:
-80px
-32px
;
bottom
:
40%
}
.article-body
{
word-wrap
:
break-word
;
overflow
:
auto
;
line-height
:
1.65
;
font-size
:
16px
;
word-break
:
break-word
}
.article-body
ol
,
.article-body
ul
{
padding-left
:
2em
;
margin-top
:
0
;
margin-bottom
:
16px
}
.article-body
li
{
margin-top
:
.25em
}
.article-body
img
{
cursor
:
zoom-in
}
.article-body
img
.emoji
{
cursor
:
auto
;
max-width
:
18px
}
#captcha
,
#captchaReply
,
#emotions
span
{
cursor
:
pointer
}
.article-body
h1
,
.article-body
h2
,
.article-body
h3
,
.article-body
h4
,
.article-body
h5
,
.article-body
h6
{
margin-top
:
24px
;
margin-bottom
:
16px
;
font-weight
:
600
;
line-height
:
1.25
}
.article-body
h1
{
font-size
:
1.7em
}
.article-body
h2
{
font-size
:
1.5em
}
.article-body
h3
{
font-size
:
1.25em
}
.article-body
h4
{
font-size
:
1em
}
.article-body
h5
{
font-size
:
.875em
}
.article-body
h6
{
font-size
:
.85em
}
.article-body
hr
{
height
:
.15em
;
padding
:
0
;
margin
:
24px
0
;
background-color
:
#e7e7e7
;
border
:
0
}
.article-body
p
{
margin-top
:
0
;
margin-bottom
:
16px
}
.article-body
blockquote
{
padding
:
0
1em
;
color
:
#777
;
border-left
:
.25em
solid
#ddd
;
margin-bottom
:
16px
}
.article-body
blockquote
p
{
margin
:
0
}
.article-body
ins
>
iframe
{
border
:
0
}
.article-body
iframe
{
border
:
1px
solid
rgba
(
0
,
0
,
0
,
.38
)}
.article-body
table
{
width
:
100%
;
border
:
1px
solid
#dedede
;
margin
:
15px
auto
;
border-collapse
:
collapse
;
empty-cells
:
show
}
.article-body
thead
{
text-align
:
center
}
.article-body
td
,
.article-body
th
{
height
:
35px
;
border
:
1px
solid
#dedede
;
padding
:
0
10px
}
.article-body
th
{
font-weight
:
700
;
text-align
:
center
!important
;
background
:
rgba
(
158
,
188
,
226
,
.2
)}
.article-body
tbody
tr
:nth-child
(
2n
)
{
background
:
rgba
(
158
,
188
,
226
,
.12
)}
.article-body
tr
:hover
{
background
:
#efefef
}
.article-body
code
{
padding
:
.2em
.4em
;
margin
:
0
;
font-size
:
85%
;
background-color
:
rgba
(
252
,
41
,
41
,
.12
);
border-radius
:
3px
;
word-break
:
break-word
}
.article-body
pre
{
position
:
relative
}
.article-body
pre
textarea
{
position
:
absolute
;
top
:
-100000px
}
.article-body
pre
>
code
{
padding
:
.5em
;
background-color
:
rgba
(
0
,
0
,
0
,
.04
);
background-size
:
20px
20px
;
border-radius
:
5px
;
display
:
block
}
.article-body
kbd
{
display
:
inline-block
;
padding
:
3px
5px
;
font
:
11px
Consolas
,
"Liberation Mono"
,
Menlo
,
Courier
,
monospace
;
line-height
:
10px
;
color
:
#555
;
vertical-align
:
middle
;
background-color
:
#fcfcfc
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
.38
);
border-bottom-color
:
#bbb
;
border-radius
:
3px
;
box-shadow
:
inset
0
-1px
0
#bbb
}
.article-body
.task-list-item
,
.article-body__task
{
list-style
:
none
;
margin-left
:
-1em
}
.em00
,
.em01
,
.em02
,
.em03
,
.em04
,
.em05
,
.em06
,
.em07
,
.em08
,
.em09
,
.em10
,
.em11
,
.em12
,
.em13
,
.em14
{
background-image
:
url(../images/emotions/emotions.png)
;
background-size
:
120px
;
float
:
left
;
height
:
24px
;
margin-right
:
5px
;
width
:
24px
}
.em01
{
background-position
:
-24px
0
}
.em02
{
background-position
:
-48px
0
}
.em03
{
background-position
:
-72px
0
}
.em04
{
background-position
:
-96px
0
}
.em05
{
background-position
:
0
-24px
}
.em06
{
background-position
:
-24px
-24px
}
.em07
{
background-position
:
-48px
-24px
}
.em08
{
background-position
:
-72px
-24px
}
.em09
{
background-position
:
-96px
-24px
}
.em10
{
background-position
:
0
-48px
}
.em11
{
background-position
:
-24px
-48px
}
.em12
{
background-position
:
-48px
-48px
}
.em13
{
background-position
:
-72px
-48px
}
.em14
{
background-position
:
-96px
-48px
}
#tags
li
{
float
:
left
;
height
:
38px
}
#tags
a
:hover
{
text-shadow
:
0
0
2px
#555
}
#tags
a
{
border-radius
:
3px
;
box-shadow
:
1px
1px
3px
#555
;
float
:
left
;
margin
:
3px
6px
;
padding
:
3px
12px
}
#tags
.tags1
{
font-size
:
12px
;
font-weight
:
400
}
#tags
.tags2
{
font-size
:
14px
;
font-weight
:
400
}
#tags
.tags3
{
font-size
:
16px
;
font-weight
:
400
}
#tags
.tags4
{
font-size
:
18px
;
font-weight
:
700
}
#tags
.tags5
{
font-size
:
20px
;
font-weight
:
700
}
\ No newline at end of file
src/main/webapp/css/default-init.min.css
View file @
a560b54a
/**
* 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/>.
*/
.error
,
button
{
font-weight
:
700
}
.wrap
,
body
,
html
{
min-height
:
100vh
}
.content
,
.logo
{
align-self
:
center
}
.content-reset
img
,
.img-error
{
max-width
:
100%
}
body
,
html
{
margin
:
0
;
padding
:
0
}
body
{
background-color
:
#fff
;
color
:
#3b3e43
;
font-family
:
\
5
fae
\
8
f6f
\
96
c5
\
9
ed1
;
font-size
:
small
}
button
{
background-size
:
110%
110%
;
border
:
1px
solid
rgba
(
27
,
31
,
35
,
.2
);
font-size
:
13px
;
text-shadow
:
0
1px
0
rgba
(
255
,
255
,
255
,
.9
);
white-space
:
nowrap
;
background-color
:
#eff3f6
;
background-image
:
linear-gradient
(
-180deg
,
#fafbfc
,
#eff3f6
90%
);
color
:
#24292e
;
border-radius
:
3px
;
box-shadow
:
0
1px
3px
rgba
(
0
,
0
,
0
,
.075
);
outline
:
0
;
padding
:
7px
15px
;
margin-top
:
10px
;
cursor
:
pointer
}
button
:hover
{
background-color
:
#e6ebf1
;
background-image
:
linear-gradient
(
-180deg
,
#f0f3f6
,
#e6ebf1
90%
);
background-position
:
-.5em
;
border-color
:
rgba
(
27
,
31
,
35
,
.35
)}
a
{
color
:
#4285f4
;
text-decoration
:
none
}
h2
{
background-color
:
#F3F1E5
;
border-radius
:
4px
4px
0
0
;
font-size
:
16px
;
margin
:
0
;
padding
:
10px
20px
}
input
[
type
=
password
],
input
[
type
=
text
]
{
border
:
1px
solid
#d1d5da
;
background-color
:
#FAFAFA
;
border-radius
:
3px
;
box-shadow
:
inset
0
1px
2px
rgba
(
27
,
31
,
35
,
.075
);
padding
:
7px
8px
;
width
:
100%
;
line-height
:
17px
;
box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
outline
:
0
;
margin-top
:
10px
}
input
[
type
=
password
]
:focus
,
input
[
type
=
text
]
:focus
{
background-color
:
#FFF
;
box-shadow
:
inset
0
1px
2px
rgba
(
27
,
31
,
35
,
.075
),
0
0
0
.2em
#dbedff
;
border
:
1px
solid
#4285f4
}
.error
{
color
:
#d23f31
}
.wrap
{
border-top
:
5px
solid
#E6E5D9
;
background-color
:
#F3F1E5
;
display
:
flex
;
flex-direction
:
column
;
box-sizing
:
border-box
}
.content-wrap
{
flex
:
1
;
display
:
flex
}
.content
{
background-color
:
#fff
;
margin
:
0
auto
;
width
:
760px
;
display
:
flex
}
.main
{
border-left
:
1px
solid
#E6E5D9
;
font-size
:
15px
;
padding
:
20px
;
flex
:
1
}
.logo
{
width
:
217px
;
text-align
:
center
}
.logo
img
{
height
:
128px
;
width
:
128px
}
.footerWrapper
{
background-color
:
#FFF
;
border-top
:
1px
solid
#E6E5D9
;
padding
:
12px
0
;
text-align
:
center
}
.a-error
{
text-align
:
right
}
.img-error
{
margin
:
20px
auto
;
padding
:
0
;
display
:
block
}
.content-reset
h1
,
.content-reset
h2
{
padding-bottom
:
.3em
;
border-bottom
:
1px
solid
#eee
}
.kill
img
{
position
:
absolute
;
right
:
40px
;
top
:
200px
}
.kill
ul
{
margin-bottom
:
50px
}
.kill
p
{
margin
:
12px
20px
}
.kill
span
{
margin-left
:
20px
}
#github
{
position
:
relative
;
text-align
:
center
}
#github
.github--loading
:after
{
content
:
"Loading..."
;
position
:
absolute
;
height
:
100%
;
width
:
100%
;
top
:
0
;
left
:
0
;
z-index
:
7
;
background-color
:
rgba
(
255
,
255
,
255
,
.6
);
font-size
:
22px
;
text-align
:
center
;
padding-top
:
135px
;
color
:
#000
;
text-shadow
:
0
1px
2px
rgba
(
0
,
0
,
0
,
.2
);
box-sizing
:
border-box
}
#github
.github__icon
{
height
:
200px
;
width
:
266px
;
background-image
:
url(../images/github.png)
;
margin
:
0
auto
;
background-size
:
contain
;
cursor
:
pointer
}
#github
.github__icon
:hover
{
background-image
:
url(../images/github.gif)
}
#github
img
{
display
:
none
}
.github__text
{
cursor
:
pointer
;
font-size
:
12px
;
color
:
#666
}
.github__text
ul
{
display
:
none
;
text-align
:
left
;
margin
:
5px
auto
0
;
width
:
280px
;
padding-left
:
24px
;
box-sizing
:
border-box
}
.github__link
{
font-size
:
12px
;
text-decoration
:
underline
;
margin-top
:
10px
;
display
:
block
}
.github__check
{
font-size
:
12px
;
display
:
flex
;
width
:
80%
;
margin
:
10px
auto
0
;
align-items
:
center
;
line-height
:
20px
;
color
:
#999
}
.github__check
a
{
color
:
#999
;
text-decoration
:
underline
}
.github__check
input
{
width
:
auto
}
.content-reset
{
word-wrap
:
break-word
;
overflow
:
auto
;
line-height
:
1.65
;
font-size
:
16px
;
word-break
:
break-word
}
.content-reset
ol
,
.content-reset
ul
{
padding-left
:
2em
;
margin-top
:
0
;
margin-bottom
:
16px
}
.content-reset
li
{
margin-top
:
.25em
}
.content-reset
img
.emoji
{
max-width
:
20px
}
.content-reset
h1
,
.content-reset
h2
,
.content-reset
h3
,
.content-reset
h4
,
.content-reset
h5
,
.content-reset
h6
{
margin-top
:
24px
;
margin-bottom
:
16px
;
font-weight
:
600
;
line-height
:
1.25
}
.content-reset
h1
{
font-size
:
1.7em
}
.content-reset
h2
{
font-size
:
1.5em
}
.content-reset
h3
{
font-size
:
1.25em
}
.content-reset
h4
{
font-size
:
1em
}
.content-reset
h5
{
font-size
:
.875em
}
.content-reset
h6
{
font-size
:
.85em
}
.content-reset
hr
{
height
:
.15em
;
padding
:
0
;
margin
:
24px
0
;
background-color
:
#e7e7e7
;
border
:
0
}
.content-reset
p
{
margin-top
:
0
;
margin-bottom
:
16px
}
.content-reset
blockquote
{
padding
:
0
1em
;
color
:
#777
;
border-left
:
.25em
solid
#ddd
;
margin-bottom
:
16px
}
.content-reset
blockquote
p
{
margin
:
0
}
.content-reset
ins
>
iframe
{
border
:
0
}
.content-reset
iframe
{
border
:
1px
solid
rgba
(
0
,
0
,
0
,
.38
)}
.content-reset
table
{
width
:
100%
;
border
:
1px
solid
#dedede
;
margin
:
15px
auto
;
border-collapse
:
collapse
;
empty-cells
:
show
}
.content-reset
thead
{
text-align
:
center
}
.content-reset
td
,
.content-reset
th
{
height
:
35px
;
border
:
1px
solid
#dedede
;
padding
:
0
10px
}
.content-reset
th
{
font-weight
:
700
;
text-align
:
center
!important
;
background
:
rgba
(
158
,
188
,
226
,
.2
)}
.content-reset
tbody
tr
:nth-child
(
2n
)
{
background
:
rgba
(
158
,
188
,
226
,
.12
)}
.content-reset
tr
:hover
{
background
:
#efefef
}
.content-reset
code
{
padding
:
.2em
.4em
;
margin
:
0
;
font-size
:
85%
;
background-color
:
rgba
(
252
,
41
,
41
,
.12
);
border-radius
:
3px
;
word-break
:
break-word
}
.content-reset
pre
{
position
:
relative
}
.content-reset
pre
textarea
{
position
:
absolute
;
top
:
-100000px
}
.content-reset
pre
>
code
{
padding
:
.5em
;
background-color
:
rgba
(
0
,
0
,
0
,
.04
);
background-size
:
20px
20px
;
border-radius
:
5px
;
display
:
block
}
.content-reset
kbd
{
display
:
inline-block
;
padding
:
3px
5px
;
font
:
11px
Consolas
,
"Liberation Mono"
,
Menlo
,
Courier
,
monospace
;
line-height
:
10px
;
color
:
#555
;
vertical-align
:
middle
;
background-color
:
#fcfcfc
;
border
:
1px
solid
rgba
(
0
,
0
,
0
,
.38
);
border-bottom-color
:
#bbb
;
border-radius
:
3px
;
box-shadow
:
inset
0
-1px
0
#bbb
}
.content-reset
.task-list-item
,
.content-reset__task
{
list-style
:
none
;
margin-left
:
-1em
}
.search
{
border-top
:
5px
solid
#e6e5d9
;
background-color
:
#f3f1e5
;
padding
:
20px
0
20px
84px
;
min-height
:
480px
;
flex
:
1
}
.search__body
{
display
:
flex
;
flex-direction
:
column
}
.search__header
{
margin
:
20px
;
display
:
flex
}
.search__header
a
{
line-height
:
44px
}
.search__input
{
flex
:
1
}
.search__input
input
{
margin
:
0
10px
0
20px
;
width
:
523px
;
height
:
44px
;
line-height
:
44px
}
.search__input
button
{
height
:
44px
;
margin
:
0
}
.search__articles
{
width
:
600px
}
.search__articles
header
h1
{
margin
:
0
}
.search__articles
header
h1
>
a
{
font-size
:
18px
;
text-decoration
:
none
;
font-weight
:
400
}
.search__articles
.meta
{
font-size
:
14px
;
color
:
#999
}
.search__articles
footer
{
margin-bottom
:
30px
}
.search__articles
footer
a
{
text-decoration
:
none
;
font-size
:
13px
}
.search__articles
footer
a
:hover
,
.search__articles
header
h1
>
a
:hover
,
.search__pagination
a
:hover
{
text-decoration
:
underline
}
.search__pagination
a
{
color
:
#4285f4
;
text-decoration
:
none
}
.search__pagination
a
,
.search__pagination
span
{
margin-right
:
5px
}
@media
(
max-width
:
780px
){
.content
,
.main
{
width
:
auto
}
.main
,
.search__input
{
float
:
none
}
.wrap
{
padding
:
40px
0
0
}
.logo
,
.search__header
img
,
.search__header
>
.fn-right
{
display
:
none
}
.main
{
border
:
0
}
#init
,
.search
,
input
{
width
:
100%
;
box-sizing
:
border-box
}
input
{
display
:
block
}
.a-403
,
.a-404
,
.a-500
{
margin
:
0
20px
0
0
}
#init
{
padding
:
0
20px
;
left
:
0
}
.search__input
input
{
margin
:
0
}
.search__input
button
{
position
:
absolute
;
right
:
20px
;
height
:
32px
;
line-height
:
16px
}
.search
{
padding
:
20px
;
min-height
:
auto
}
.search__articles
{
width
:
auto
}}
\ No newline at end of file
src/main/webapp/js/admin/admin.min.js
View file @
a560b54a
/*
* 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
Admin
=
function
(){
this
.
register
=
{},
this
.
tools
=
[
"
#page-list
"
,
"
#file-list
"
,
"
#link-list
"
,
"
#preference
"
,
"
#user-list
"
,
"
#plugin-list
"
,
"
#others
"
,
"
#category-list
"
],
this
.
adTools
=
[
"
link-list
"
,
"
preference
"
,
"
file-list
"
,
"
page-list
"
,
"
user-list
"
,
"
plugin-list
"
,
"
others
"
,
"
category-list
"
]};
$
.
extend
(
Admin
.
prototype
,{
logout
:
function
(){
window
.
location
.
href
=
latkeConfig
.
servePath
+
"
/logout
"
},
toggleMenu
:
function
(){
"
-240px
"
===
$
(
"
#tabs
"
).
css
(
"
left
"
)?(
$
(
"
#tabs
"
).
css
(
"
left
"
,
0
),
$
(
"
.tabs__bg
"
).
show
()):(
$
(
"
#tabs
"
).
css
(
"
left
"
,
"
-240px
"
),
$
(
"
.tabs__bg
"
).
hide
())},
clearTip
:
function
(){
$
(
"
#tipMsg
"
).
text
(
""
),
$
(
"
#loadMsg
"
).
text
(
""
)},
setHashByPage
:
function
(
t
){
var
e
=
window
.
location
.
hash
.
split
(
"
/
"
);
/^
\d
*$/
.
test
(
e
[
e
.
length
-
1
])?
e
[
e
.
length
-
1
]
=
t
:
e
.
push
(
t
),
window
.
location
.
hash
=
e
.
join
(
"
/
"
)},
selectTab
:
function
(
t
){
window
.
location
.
hash
=
"
#
"
+
t
},
analyseHash
:
function
(){
for
(
var
t
=
window
.
location
.
hash
,
e
=
t
.
substr
(
1
,
t
.
length
-
1
).
split
(
"
/
"
),
i
=
{
page
:
1
,
hashList
:[]},
a
=
0
;
a
<
e
.
length
;
a
++
)
a
===
e
.
length
-
1
&&
/^
\d
+$/
.
test
(
e
[
a
])?
i
.
page
=
e
[
a
]:
i
.
hashList
.
push
(
e
[
a
]);
return
i
},
setCurByHash
:
function
(){
$
(
window
).
scrollTop
(
0
),
$
(
"
#tipMsg
"
).
text
(
""
);
var
t
=
admin
.
analyseHash
(),
e
=
t
.
hashList
[
1
],
i
=
t
.
hashList
[
2
];
if
(
1
===
t
.
hashList
.
length
&&
(
e
=
t
.
hashList
[
0
]),
""
!==
e
){
"
article
"
!==
e
?
admin
.
article
.
clearDraftTimer
():
"
article
"
===
e
&&
(
admin
.
article
.
autoSaveDraftTimer
=
setInterval
(
function
(){
admin
.
article
.
_autoSaveToDraft
()},
admin
.
article
.
AUTOSAVETIME
));
try
{
if
(
"
article
"
!==
e
&&
admin
.
article
.
isConfirm
&&
""
!==
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
()
&&!
confirm
(
Label
.
editorLeaveLabel
))
return
void
(
window
.
location
.
hash
=
"
#article/article
"
);
if
(
"
article
"
===
e
&&
admin
.
article
.
isConfirm
&&
""
!==
admin
.
editors
.
articleEditor
.
getContent
().
replace
(
/
\s
/g
,
""
)
&&
admin
.
article
.
content
!==
admin
.
editors
.
articleEditor
.
getContent
())
return
}
catch
(
t
){
var
a
=
$
(
"
#articleContent
"
);
if
(
0
<
a
.
length
){
if
(
"
article
"
!==
e
&&
admin
.
article
.
isConfirm
&&
""
!==
a
.
val
().
replace
(
/
\s
/g
,
""
)
&&
admin
.
article
.
content
!==
a
.
val
()
&&!
confirm
(
Label
.
editorLeaveLabel
))
return
void
(
window
.
location
.
hash
=
"
#article/article
"
);
if
(
"
article
"
===
e
&&
admin
.
article
.
isConfirm
&&
""
!==
a
.
val
().
replace
(
/
\s
/g
,
""
)
&&
admin
.
article
.
content
!==
a
.
val
())
return
}}
"
article
"
!==
e
&&
admin
.
editors
.
articleEditor
.
setContent
&&
admin
.
article
.
clear
(),
admin
.
article
.
isConfirm
=!
0
,
$
(
"
#tabs
"
).
tabs
(
"
setCurrent
"
,
e
),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
1
===
$
(
"
#tabsPanel_
"
+
e
).
length
?
""
===
$
(
"
#tabsPanel_
"
+
e
).
html
().
replace
(
/
\s
/g
,
""
)?
$
(
"
#tabsPanel_
"
+
e
).
load
(
"
admin-
"
+
e
+
"
.do
"
,
function
(){
"
article
"
===
e
&&
admin
.
article
.
status
.
id
?
admin
.
register
[
e
].
init
.
call
(
admin
.
register
[
e
].
obj
,
admin
.
article
.
getAndSet
):
admin
.
register
[
e
].
init
.
call
(
admin
.
register
[
e
].
obj
,
t
.
page
),
i
&&
$
(
"
#tab
"
+
e
.
substring
(
0
,
1
).
toUpperCase
()
+
e
.
substring
(
1
)).
tabs
(
"
setCurrent
"
,
i
),
admin
.
plugin
.
setCurByHash
(
t
)}):(
"
article
"
===
e
&&
admin
.
article
.
status
.
id
&&
admin
.
article
.
getAndSet
(),
admin
.
register
[
e
]
&&
admin
.
register
[
e
].
refresh
&&
admin
.
register
[
e
].
refresh
.
call
(
admin
.
register
[
e
].
obj
,
t
.
page
),
i
&&
$
(
"
#tab
"
+
e
.
substring
(
0
,
1
).
toUpperCase
()
+
e
.
substring
(
1
)).
tabs
(
"
setCurrent
"
,
i
),
admin
.
plugin
.
setCurByHash
(
t
)):(
$
(
"
#tipMsg
"
).
text
(
"
Error: No tab!
"
+
Label
.
reportIssueLabel
),
$
(
"
#loadMsg
"
).
text
(
""
))}},
init
:
function
(){
Util
.
killIE
(),
$
(
"
#loadMsg
"
).
text
(
Label
.
loadingLabel
),
$
(
"
#tabs
"
).
tabs
(),
setInterval
(
function
(){
""
!==
$
(
"
#tipMsg
"
).
text
()
&&
setTimeout
(
function
(){
$
(
"
#tipMsg
"
).
text
(
""
)},
7
e3
)},
6
e3
),
$
(
"
#loadMsg
"
).
text
(
""
)},
collapseNav
:
function
(
t
){
$
(
t
).
next
().
slideToggle
(
"
normal
"
,
function
(){
"
none
"
!==
this
.
style
.
display
?(
$
(
t
).
find
(
"
.icon-chevron-down
"
)[
0
].
className
=
"
icon-chevron-up right
"
,
$
(
t
).
addClass
(
"
tab-current
"
)):(
$
(
t
).
find
(
"
.icon-chevron-up
"
)[
0
].
className
=
"
icon-chevron-down right
"
,
$
(
t
).
removeClass
(
"
tab-current
"
)),
$
(
"
#tabs > ul
"
).
height
(
"
auto
"
),
$
(
"
#tabs > ul
"
).
height
(
$
(
"
#tabs > ul
"
).
height
()
+
80
)})},
inited
:
function
(){
if
(
"
adminRole
"
!==
Label
.
userRole
)
for
(
var
t
=
0
;
t
<
this
.
adTools
.
length
;
t
++
)
$
(
"
#tabs
"
).
tabs
(
"
remove
"
,
this
.
adTools
[
t
]);
else
for
(
var
e
=
0
;
e
<
this
.
tools
.
length
;
e
++
)
if
(
"
#
"
+
window
.
location
.
hash
.
split
(
"
/
"
)[
1
]
===
this
.
tools
[
e
]){
$
(
"
#tabToolsTitle
"
).
click
();
break
}
this
.
setCurByHash
()}});
var
admin
=
new
Admin
;
admin
.
editors
=
{};
var
SoloEditor
=
function
(
e
){
this
.
conf
=
e
,
this
.
init
()};
$
.
extend
(
SoloEditor
.
prototype
,{
init
:
function
(){
this
.
editor
=
new
Vditor
(
this
.
conf
.
id
,{
cache
:
!
0
,
hint
:{
emojiPath
:
latkeConfig
.
staticServePath
+
"
/js/lib/emojify.js-1.1.0/images/basic
"
},
preview
:{
delay
:
500
,
show
:
this
.
conf
.
previewShow
,
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
()))}},
upload
:{
max
:
10485760
,
url
:
Label
.
uploadURL
,
token
:
Label
.
uploadToken
,
filename
:
function
(
e
){
return
e
.
replace
(
/
\?
|
\\
|
\/
|:|
\|
|<|>|
\*
|
\[
|
\]
|
\s
+/g
,
"
-
"
)}},
height
:
this
.
conf
.
height
,
counter
:
102400
,
resize
:{
enable
:
this
.
conf
.
resize
},
lang
:
Label
.
localeString
,
classes
:{
preview
:
"
content-reset
"
}}),
"
function
"
==
typeof
this
.
conf
.
fun
&&
this
.
conf
.
fun
()},
getContent
:
function
(){
return
this
.
editor
.
getValue
()},
setContent
:
function
(
e
){
this
.
editor
.
setValue
(
e
)},
remove
:
function
(){
document
.
getElementById
(
this
.
editor
.
vditor
.
id
).
outerHTML
=
""
}}),
admin
.
editors
.
articleEditor
=
{},
admin
.
editors
.
abstractEditor
=
{},
admin
.
editors
.
pageEditor
=
{};
var
TablePaginate
=
function
(
a
){
this
.
id
=
a
,
this
.
currentPage
=
1
};
$
.
extend
(
TablePaginate
.
prototype
,{
buildTable
:
function
(
a
,
t
){
var
e
=
{
colModel
:
a
,
noDataTip
:
Label
.
noDataLabel
};
t
||
(
e
.
expendRow
=
{
index
:
"
expendRow
"
}),
$
(
"
#
"
+
this
.
id
+
"
Table
"
).
table
(
e
)},
initPagination
:
function
(){
var
a
=
this
.
id
;
$
(
"
#
"
+
a
+
"
Pagination
"
).
paginate
({
bind
:
function
(
a
,
t
){
t
?
$
(
"
#tipMsg
"
).
text
(
t
):
admin
.
setHashByPage
(
a
)},
currentPage
:
1
,
errorMessage
:
Label
.
inputErrorLabel
,
nextPageText
:
"
>
"
,
previousPageText
:
"
<
"
,
goText
:
Label
.
gotoLabel
,
type
:
"
custom
"
,
custom
:[
1
],
pageCount
:
1
})},
initCommentsDialog
:
function
(){
var
a
=
this
;
$
(
"
#
"
+
this
.
id
+
"
Comments
"
).
dialog
({
modal
:
!
0
,
hideFooter
:
!
0
,
close
:
function
(){
return
admin
[
a
.
id
+
"
List
"
].
getList
(
a
.
currentPage
),
!
0
}})},
updateTablePagination
:
function
(
a
,
t
,
e
){
if
((
t
=
parseInt
(
t
))
>
e
.
paginationPageCount
&&
1
<
t
)
return
$
(
"
#tipMsg
"
).
text
(
Label
.
pageLabel
+
t
+
Label
.
notFoundLabel
),
void
$
(
"
#loadMsg
"
).
text
(
""
);
$
(
"
#
"
+
this
.
id
+
"
Table
"
).
table
(
"
update
"
,{
data
:[{
groupName
:
"
all
"
,
groupData
:
a
}]}),
0
===
e
.
paginationPageCount
&&
(
e
.
paginationPageCount
=
1
),
$
(
"
#
"
+
this
.
id
+
"
Pagination
"
).
paginate
(
"
update
"
,{
pageCount
:
e
.
paginationPageCount
,
currentPage
:
t
,
custom
:
e
.
paginationPageNums
}),
this
.
currentPage
=
t
}});
...
...
src/main/webapp/js/common.min.js
View file @
a560b54a
/*
* 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
=
{
htmlDecode
:
function
(
e
){
var
t
=
document
.
createElement
(
"
div
"
);
return
t
.
innerHTML
=
decodeURIComponent
(
e
),
t
.
innerText
},
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
(
e
){
var
t
=!
1
,
i
=!
1
;
e
=
e
||
"
article-body
"
;
if
(
$
(
"
.
"
+
e
).
each
(
function
(){
if
(
$
(
this
).
find
(
"
p
"
).
each
(
function
(){
if
(
2
<
$
(
this
).
text
().
split
(
"
$
"
).
length
||
1
<
$
(
this
).
text
().
split
(
"
\\
(
"
).
length
&&
1
<
$
(
this
).
text
().
split
(
"
\\
)
"
).
length
)
return
!
(
t
=!
0
)}),
0
<
$
(
this
).
find
(
"
code.lang-flow, code.language-flow
"
).
length
)
return
!
(
i
=!
0
)}),
t
){
var
n
=
function
(){
MathJax
.
Hub
.
Config
({
tex2jax
:{
inlineMath
:[[
"
$
"
,
"
$
"
],[
"
\\
(
"
,
"
\\
)
"
]],
displayMath
:[[
"
$$
"
,
"
$$
"
]],
processEscapes
:
!
0
,
processEnvironments
:
!
0
,
skipTags
:[
"
pre
"
,
"
code
"
,
"
script
"
]}}),
MathJax
.
Hub
.
Typeset
()};
"
undefined
"
!=
typeof
MathJax
?
n
():
$
.
ajax
({
method
:
"
GET
"
,
url
:
"
https://cdn.staticfile.org/MathJax/MathJax-2.6-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&_=1473258780393
"
,
dataType
:
"
script
"
,
cache
:
!
0
}).
done
(
function
(){
n
()})}
if
(
i
){
var
o
=
function
(){
$
(
"
.
"
+
e
+
"
code.lang-flow, .
"
+
e
+
"
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
()})}},
isLoggedIn
:
function
(){
return
!!
(
1
===
$
(
"
#admin
"
).
length
&&
$
(
"
#admin
"
).
data
(
"
login
"
)
||
"
true
"
===
latkeConfig
.
isLoggedIn
)},
getUserName
:
function
(){
return
1
===
$
(
"
#adminName
"
).
length
?
$
(
"
#adminName
"
).
text
():
latkeConfig
.
userName
},
error
:
function
(){
$
(
"
#tipMsg
"
).
text
(
"
Error:
"
+
arguments
[
0
]
+
"
File:
"
+
arguments
[
1
]
+
"
\n
Line:
"
+
arguments
[
2
]
+
"
please report this issue on https://github.com/b3log/solo/issues/new
"
),
$
(
"
#loadMsg
"
).
text
(
""
)},
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
},
proessURL
:
function
(
e
){
return
/^
\w
+:
\/\/
/
.
test
(
e
)
||
(
e
=
"
http://
"
+
e
),
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
);
var
t
=
$
(
"
body
"
).
height
()
>
$
(
document
).
height
()?
$
(
"
body
"
).
height
():
$
(
document
).
height
();
window
.
scrollTo
(
0
,
t
-
$
(
window
).
height
()
-
e
)},
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
},
getWinHeight
:
function
(){
return
window
.
innerHeight
?
window
.
innerHeight
:
"
CSS1Compat
"
===
document
.
compatMode
?
window
.
document
.
documentElement
.
clientHeight
:
window
.
document
.
body
.
clientHeight
}};
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 @
a560b54a
/*
* 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
),
i
=
0
;
i
<
t
.
length
;
i
++
){
var
o
=
t
[
i
].
innerHTML
;
t
[
i
].
innerHTML
=
Util
.
replaceEmString
(
o
)}},
parseLanguage
:
function
(
e
){
var
t
=!
1
;
$
(
"
.article-body pre, .content-reset pre, .code-highlight 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
i
=
this
;
"
undefined
"
==
typeof
Vditor
&&
(
$
(
"
head
"
).
append
(
$
(
"
<link rel='stylesheet' href='
"
+
latkeConfig
.
staticServePath
+
"
/js/lib/vditor-0.2.5/index.classic.css'>
"
)),
$
.
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
:
i
.
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
:
i
.
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
o
=
$
(
"
#soloEditor
"
);
0
!==
o
.
length
?
"
0px
"
===
$
(
"
body
"
).
css
(
"
padding-bottom
"
)
||
e
?(
$
(
"
#soloEditorError
"
).
text
(
""
),
o
.
css
({
bottom
:
"
0
"
,
opacity
:
1
}),
$
(
"
body
"
).
css
(
"
padding-bottom
"
,
"
238px
"
),
this
.
currentCommentId
=
e
,
$
(
"
#soloEditorReplyTarget
"
).
text
(
t
?
"
@
"
+
t
:
""
),
"
undefined
"
!=
typeof
vditor
&&
vditor
.
focus
()):(
o
.
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
i
=
e
.
randomArticles
;
if
(
i
&&
0
!==
i
.
length
){
for
(
var
o
=
""
,
n
=
0
;
n
<
i
.
length
;
n
++
){
var
l
=
i
[
n
],
a
=
l
.
articleTitle
;
o
+=
"
<li><a rel='nofollow' title='
"
+
a
+
"
' href='
"
+
latkeConfig
.
servePath
+
l
.
articlePermalink
+
"
'>
"
+
a
+
"
</a></li>
"
}
var
r
=
(
s
||
"
<h4>
"
+
c
+
"
</h4>
"
)
+
"
<ul class='marginLeft12'>
"
+
o
+
"
</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
i
=
e
.
relevantArticles
;
if
(
i
&&
0
!==
i
.
length
){
for
(
var
o
=
""
,
n
=
0
;
n
<
i
.
length
;
n
++
){
var
l
=
i
[
n
],
a
=
l
.
articleTitle
;
o
+=
"
<li><a rel='nofollow' title='
"
+
a
+
"
' href='
"
+
latkeConfig
.
servePath
+
l
.
articlePermalink
+
"
'>
"
+
a
+
"
</a></li>
"
}
var
r
=
s
+
"
<ul class='marginLeft12'>
"
+
o
+
"
</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
i
=
e
.
articles
;
if
(
i
&&
0
!==
i
.
length
){
for
(
var
o
=
""
,
n
=
0
;
n
<
i
.
length
;
n
++
){
var
l
=
i
[
n
],
a
=
l
.
articleTitle
;
o
+=
"
<li><a rel='nofollow' title='
"
+
a
+
"
' target='_blank' href='
"
+
l
.
articlePermalink
+
"
'>
"
+
a
+
"
</a></li>
"
}
var
r
=
(
s
||
"
<h4>
"
+
c
.
externalRelevantArticles1Label
+
"
</h4>
"
)
+
"
<ul class='marginLeft12'>
"
+
o
+
"
</ul>
"
;
$
(
"
#externalRelevantArticles
"
).
append
(
r
)}
else
$
(
"
#externalRelevantArticles
"
).
remove
()}})}
catch
(
e
){}},
submitComment
:
function
(){
var
t
=
this
,
e
=
this
.
tips
,
i
=
"
article
"
;
if
(
void
0
===
e
.
externalRelevantArticlesDisplayCount
&&
(
i
=
"
page
"
),
1
<
vditor
.
getValue
().
length
&&
vditor
.
getValue
().
length
<
500
){
$
(
"
#soloEditorAdd
"
).
attr
(
"
disabled
"
,
"
disabled
"
);
var
o
=
{
oId
:
e
.
oId
,
commentContent
:
vditor
.
getValue
()};
this
.
currentCommentId
&&
(
o
.
commentOriginalCommentId
=
this
.
currentCommentId
),
$
.
ajax
({
type
:
"
POST
"
,
url
:
latkeConfig
.
servePath
+
"
/
"
+
i
+
"
/comments
"
,
cache
:
!
1
,
contentType
:
"
application/json
"
,
data
:
JSON
.
stringify
(
o
),
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
,
i
,
o
){
var
n
=
parseInt
(
$
(
e
).
position
().
top
);
if
(
o
&&
(
n
=
parseInt
(
$
(
e
).
parents
(
o
).
position
().
top
)),
0
<
$
(
"
#commentRef
"
+
t
).
length
)
$
(
"
#commentRef
"
+
t
).
show
().
css
(
"
top
"
,
n
+
i
+
"
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
+
i
+
"
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
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