Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大白技术控
yanglr2010
提交
52b062c3
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,发现更多精彩内容 >>
提交
52b062c3
编写于
8月 28, 2019
作者:
EvanOne(文一)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: Not show toc when the post not heading
上级
28e188f1
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
20 addition
and
12 deletion
+20
-12
source/js/scroll.js
source/js/scroll.js
+1
-1
source/js/sidebar.js
source/js/sidebar.js
+5
-5
source/js/stun-boot.js
source/js/stun-boot.js
+4
-3
source/js/utils.js
source/js/utils.js
+10
-3
未找到文件。
source/js/scroll.js
浏览文件 @
52b062c3
source/js/sidebar.js
浏览文件 @
52b062c3
source/js/stun-boot.js
浏览文件 @
52b062c3
$
(
document
).
ready
(
function
()
{
CONFIG
.
shortcuts
.
switch_post
&&
Stun
.
utils
.
registerSwitchPost
();
CONFIG
.
shortcuts
.
switch_post
&&
Stun
.
utils
.
register
HotkeyTo
SwitchPost
();
// Not reload this, because it's changeless.
if
(
CONFIG
.
external_link
)
{
...
...
@@ -7,11 +7,12 @@ $(document).ready(function () {
}
Stun
.
utils
.
pjaxReloadBoot
=
function
()
{
this
.
initTocDisplay
();
this
.
addCopyButtonToCopyright
();
this
.
registerCopyEvent
();
CONFIG
.
reward
&&
this
.
registerShowReward
();
CONFIG
.
gallery_waterfall
&&
this
.
galleryWaterF
all
();
CONFIG
.
lazyload
&&
this
.
lazyLoadImage
s
();
CONFIG
.
gallery_waterfall
&&
this
.
showImageToWaterf
all
();
CONFIG
.
lazyload
&&
this
.
lazyLoadImage
();
if
(
CONFIG
.
external_link
)
{
var
WRAPPER
=
'
.archive-inner, .post-title
'
;
...
...
source/js/utils.js
浏览文件 @
52b062c3
...
...
@@ -174,6 +174,13 @@ Stun.utils = Stun.$u = {
return
false
;
}
},
initTocDisplay
:
function
()
{
if
(
$
(
'
.post-body
'
).
find
(
'
h1,h2,h3,h4,h5,h6
'
)[
0
])
return
;
$
(
'
.sidebar-nav
'
).
addClass
(
'
hide
'
);
$
(
'
.sidebar-toc
'
).
addClass
(
'
hide
'
);
$
(
'
.sidebar-overview
'
).
removeClass
(
'
hide
'
);
},
// Wrap images with fancybox support.
wrapImageWithFancyBox
:
function
()
{
$
(
'
.content img
'
).
not
(
'
:hidden
'
).
each
(
function
()
{
...
...
@@ -223,7 +230,7 @@ Stun.utils = Stun.$u = {
});
},
// Display the image in the gallery as a waterfall.
galleryWaterF
all
:
function
()
{
showImageToWaterf
all
:
function
()
{
var
gConfig
=
CONFIG
.
gallery_waterfall
;
var
colWidth
=
parseInt
(
gConfig
.
col_width
);
var
colGapX
=
parseInt
(
gConfig
.
gap_x
);
...
...
@@ -239,7 +246,7 @@ Stun.utils = Stun.$u = {
});
},
// Lazy load the images of post.
lazyLoadImage
s
:
function
()
{
lazyLoadImage
:
function
()
{
$
(
'
img.lazyload
'
).
lazyload
();
},
// Add a mark icon to the link with `target="_blank"` attribute.
...
...
@@ -260,7 +267,7 @@ Stun.utils = Stun.$u = {
.
append
(
$icon
);
},
// Switch to the prev / next post by shortcuts.
registerSwitchPost
:
function
()
{
register
HotkeyTo
SwitchPost
:
function
()
{
var
_this
=
this
;
$
(
document
).
on
(
'
keydown
'
,
function
(
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录