Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大白技术控
yanglr2010
提交
bf69f1ea
Y
yanglr2010
项目概览
大白技术控
/
yanglr2010
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yanglr2010
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bf69f1ea
编写于
7月 24, 2019
作者:
EvanOne(文一)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
style: Format code
上级
3a08c20b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
28 deletion
+41
-28
source/css/_components/fancybox.styl
source/css/_components/fancybox.styl
+8
-0
source/css/_components/index.styl
source/css/_components/index.styl
+1
-0
source/js/copy.js
source/js/copy.js
+5
-5
source/js/sidebar.js
source/js/sidebar.js
+15
-11
source/js/stun-boot.js
source/js/stun-boot.js
+1
-1
source/js/utils.js
source/js/utils.js
+11
-11
未找到文件。
source/css/_components/fancybox.styl
0 → 100644
浏览文件 @
bf69f1ea
a.fancybox
clearAStyle()
cursor: zoom-in
.post-gallery
display: grid
grid-template-columns: repeat(3, auto)
grid-gap: 10px 10px
source/css/_components/index.styl
浏览文件 @
bf69f1ea
...
...
@@ -2,6 +2,7 @@
@import './reward.styl' if (hexo-config('reward.enable'))
@import './back2top.styl' if (hexo-config('back2top.enable'))
@import './external-link.styl' if (hexo-config('external_link.icon.enable'))
@import './fancybox.styl' if (hexo-config('fancybox'))
@import './recent-posts.styl'
@import './pagination.styl'
@import './comments.styl'
...
...
source/js/copy.js
浏览文件 @
bf69f1ea
$
(
document
).
ready
(
function
test
()
{
$
(
document
).
ready
(
function
()
{
var
CODEBLOCK_CLASS_NAME
=
'
highlight
'
;
var
$codeBlocks
=
$
(
'
figure.highlight
'
);
$codeBlocks
.
each
(
function
test
(
index
,
item
)
{
if
(
!
$
(
item
).
find
(
'
figcaption
'
)[
0
])
{
var
lang
=
item
$codeBlocks
.
each
(
function
(
)
{
if
(
!
$
(
this
).
find
(
'
figcaption
'
)[
0
])
{
var
lang
=
this
.
getAttribute
(
'
class
'
)
.
split
(
/
\s
/
)
.
filter
(
function
(
e
)
{
return
e
!==
CODEBLOCK_CLASS_NAME
;
});
...
...
@@ -14,7 +14,7 @@ $(document).ready(function test () {
'
</figcaption>
'
)[
0
];
item
.
insertBefore
(
codeHeader
,
$
(
item
).
children
().
first
()[
0
]);
this
.
insertBefore
(
codeHeader
,
$
(
this
).
children
().
first
()[
0
]);
}
});
...
...
source/js/sidebar.js
浏览文件 @
bf69f1ea
...
...
@@ -63,7 +63,8 @@ $(document).ready(function () {
// based on the scrolling of heading in the article.
function
autoSpreadToc
()
{
var
$postBody
=
$
(
'
.post-body
'
);
var
$firsetChild
=
$postBody
.
find
(
'
h1,h2,h3,h4,h5,h6
'
).
first
();
var
$headings
=
$postBody
.
find
(
'
h1,h2,h3,h4,h5,h6
'
);
var
$firsetChild
=
$headings
.
first
();
// All heading are not to the top.
if
(
$postBody
[
0
]
&&
(
!!
$firsetChild
[
0
]
&&
...
...
@@ -73,9 +74,9 @@ $(document).ready(function () {
return
;
}
$
postBody
.
find
(
'
h1,h2,h3,h4,h5,h6
'
).
each
(
function
(
index
,
item
)
{
if
(
item
&&
item
.
getBoundingClientRect
().
top
<
0
)
{
currHeading
=
$
(
item
).
attr
(
'
id
'
);
$
headings
.
each
(
function
(
)
{
if
(
this
.
getBoundingClientRect
().
top
<
0
)
{
currHeading
=
$
(
this
).
attr
(
'
id
'
);
}
});
...
...
@@ -106,12 +107,14 @@ $(document).ready(function () {
}
if
(
isTocScroll
)
{
$currLink
.
velocity
(
'
stop
'
).
velocity
(
'
scroll
'
,
{
container
:
$toc
,
offset
:
-
(
$toc
.
height
()
/
2
),
duration
:
500
,
easing
:
'
easeOutQuart
'
});
$currLink
.
velocity
(
'
stop
'
)
.
velocity
(
'
scroll
'
,
{
container
:
$toc
,
offset
:
-
(
$toc
.
height
()
/
2
),
duration
:
500
,
easing
:
'
easeOutQuart
'
});
}
}
...
...
@@ -170,7 +173,8 @@ $(document).ready(function () {
// Update the reading progress lines of post.
function
readProgress
()
{
var
$post
=
$
(
'
.content
'
);
var
scrollH
=
(
$post
[
0
]
&&
$post
[
0
].
getBoundingClientRect
().
top
*
-
1
)
||
0
;
var
scrollH
=
(
$post
[
0
]
&&
$post
[
0
].
getBoundingClientRect
().
top
*
-
1
)
||
0
;
var
percent
=
parseInt
((
scrollH
/
Math
.
abs
(
$post
.
height
()
-
$
(
window
).
height
()))
*
100
);
...
...
source/js/stun-boot.js
浏览文件 @
bf69f1ea
...
...
@@ -2,7 +2,7 @@ $(document).ready(function () {
CONFIG
.
shortcuts
.
switch_post
&&
Stun
.
utils
.
registerSwitchPost
();
CONFIG
.
back2top
&&
Stun
.
utils
.
back2Top
();
CONFIG
.
reward
&&
Stun
.
utils
.
registerShowReward
();
CONFIG
.
fancybox
&&
CONFIG
.
utils
.
wrapImageWithFancyBox
();
CONFIG
.
fancybox
&&
Stun
.
utils
.
wrapImageWithFancyBox
();
if
(
CONFIG
.
external_link
.
icon
)
{
var
EXTERNAL_LINK_CONTAINER
=
'
.content, #footer
'
;
...
...
source/js/utils.js
浏览文件 @
bf69f1ea
...
...
@@ -152,24 +152,24 @@ Stun.utils = Stun.$u = {
},
// Adjust the size of images by the parameter "size".
adjustImageSize
:
function
()
{
$
(
'
img
'
).
each
(
function
(
index
,
img
)
{
if
(
img
.
src
.
includes
(
'
?size=
'
))
{
var
size
=
img
.
src
.
split
(
'
?size=
'
)[
1
]
&&
img
.
src
.
split
(
'
?size=
'
)[
1
].
toLowerCase
();
$
(
'
img
'
).
each
(
function
()
{
if
(
this
.
src
.
includes
(
'
?size=
'
))
{
var
size
=
this
.
src
.
split
(
'
?size=
'
)[
1
]
&&
this
.
src
.
split
(
'
?size=
'
)[
1
].
toLowerCase
();
var
w
=
size
.
split
(
'
x
'
)[
0
];
var
h
=
size
.
split
(
'
x
'
)[
1
];
$
(
img
).
css
(
'
width
'
,
w
);
$
(
img
).
css
(
'
height
'
,
h
);
$
(
this
).
css
(
'
width
'
,
w
);
$
(
this
).
css
(
'
height
'
,
h
);
}
});
},
/**
* Add a mark icon to the link with `target="_blank"` attribute.
* @param {String}
selector Any Jquery selecto
r.
* @param {String}
wrapper Any Jquery wrappe
r.
*/
addIconToExternalLink
:
function
(
selecto
r
)
{
if
(
!
$
(
selecto
r
)[
0
])
return
;
addIconToExternalLink
:
function
(
wrappe
r
)
{
if
(
!
$
(
wrappe
r
)[
0
])
return
;
var
$icon
=
$
(
'
<i class="external-link fa fa-
'
+
...
...
@@ -177,10 +177,10 @@ Stun.utils = Stun.$u = {
'
"></i>
'
);
// Insert icon after link.
// $icon.insertAfter($(
selecto
r).find('a[target="_blank"]'));
// $icon.insertAfter($(
wrappe
r).find('a[target="_blank"]'));
// Insert icon inner link.
$
(
selecto
r
).
find
(
'
a[target="_blank"]
'
).
append
(
$icon
);
$
(
wrappe
r
).
find
(
'
a[target="_blank"]
'
).
append
(
$icon
);
},
// Back the page to top.
back2Top
:
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录