Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
77dfbc40
提交
77dfbc40
authored
4月 12, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add
上级
876b321a
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
50 行增加
和
2 行删除
+50
-2
read.css
assets/html/assets/css/read.css
+4
-0
read.html
assets/html/read.html
+23
-1
read_unline.html
assets/html/read_unline.html
+23
-1
没有找到文件。
assets/html/assets/css/read.css
浏览文件 @
77dfbc40
...
@@ -469,6 +469,10 @@ light.c-ff4500::selection {
...
@@ -469,6 +469,10 @@ light.c-ff4500::selection {
.chapter-container
.chapter-content-list
.chapter-item-up
.chapter-expand-inline
svg
{
.chapter-container
.chapter-content-list
.chapter-item-up
.chapter-expand-inline
svg
{
text-indent
:
0
;
text-indent
:
0
;
}
}
.chapter-container
.chapter-content-list
.chapter-item
.chapter-item-link
,
.chapter-container
.chapter-content-list
.chapter-item-up
.chapter-item-link
{
display
:
inline
!important
;
}
.chapter-container
.chapter-content-list
.chapter-item
.chapter-expand-inline
,
.chapter-container
.chapter-content-list
.chapter-item
.chapter-expand-inline
,
.chapter-container
.chapter-content-list
.chapter-item-up
.chapter-expand-inline
,
.chapter-container
.chapter-content-list
.chapter-item-up
.chapter-expand-inline
,
.chapter-container
.chapter-content-list
.chapter-item
.chapter-item-tooltip
,
.chapter-container
.chapter-content-list
.chapter-item
.chapter-item-tooltip
,
...
...
assets/html/read.html
浏览文件 @
77dfbc40
...
@@ -371,6 +371,7 @@ function countSubstringOccurrences(str, substring) {
...
@@ -371,6 +371,7 @@ function countSubstringOccurrences(str, substring) {
// 带内容加载完成
// 带内容加载完成
await
this
.
waitForContentLoad
();
await
this
.
waitForContentLoad
();
await
this
.
replaceVideoToAudio
();
if
(
scroll
)
{
if
(
scroll
)
{
$
(
".chapter-content-list .show"
).
css
({
$
(
".chapter-content-list .show"
).
css
({
transform
:
`translateY(-
${
this
.
upContentsHeight
-
this
.
windowHeight
}
px)`
,
transform
:
`translateY(-
${
this
.
upContentsHeight
-
this
.
windowHeight
}
px)`
,
...
@@ -404,6 +405,27 @@ function countSubstringOccurrences(str, substring) {
...
@@ -404,6 +405,27 @@ function countSubstringOccurrences(str, substring) {
}
}
}
}
},
},
replaceVideoToAudio
()
{
const
allVideo
=
document
.
querySelectorAll
(
"video"
);
let
arr
=
[
'.mp3'
,
'.wma'
,
'.wmv'
,
'.aac'
,
'.flac'
]
if
(
allVideo
.
length
>
0
)
{
allVideo
.
forEach
((
item
,
index
)
=>
{
var
sources
=
$
(
item
).
find
(
"source"
);
let
src
=
''
;
let
suffix
=
''
;
if
(
sources
.
length
===
1
)
{
src
=
$
(
sources
[
0
]).
attr
(
"src"
);
suffix
=
src
.
substring
(
src
.
lastIndexOf
(
'.'
));
}
if
(
arr
.
includes
(
suffix
.
toLowerCase
()))
{
const
html
=
`<audio controls><source src="
${
src
}
" type="audio/
${
suffix
.
substring
(
1
)}
"></audio>`
;
$
(
html
).
insertBefore
(
$
(
item
));
$
(
item
).
remove
();
}
})
}
},
// 添加学习进度
// 添加学习进度
async
uploadReadProgress
(
chapter_id
,
progress
)
{
async
uploadReadProgress
(
chapter_id
,
progress
)
{
if
(
!
this
.
token
)
return
;
if
(
!
this
.
token
)
return
;
...
@@ -2221,7 +2243,7 @@ function countSubstringOccurrences(str, substring) {
...
@@ -2221,7 +2243,7 @@ function countSubstringOccurrences(str, substring) {
const
refreshTokenSuccess
=
(
arguments
)
=>
{
const
refreshTokenSuccess
=
(
arguments
)
=>
{
return
app
.
refreshTokenSuccess
(
arguments
);
return
app
.
refreshTokenSuccess
(
arguments
);
};
};
// callbackInFlutterComponent(',
323,2856,d4c36b804c0418b134c2eef6d1689943
');
// callbackInFlutterComponent(',
175,335,2f85d063f94485c0c2ef31e652875bd5
');
</script>
</script>
</body>
</body>
</html>
</html>
assets/html/read_unline.html
浏览文件 @
77dfbc40
...
@@ -353,6 +353,7 @@ function countSubstringOccurrences(str, substring) {
...
@@ -353,6 +353,7 @@ function countSubstringOccurrences(str, substring) {
});
});
// 带内容加载完成
// 带内容加载完成
await
this
.
waitForContentLoad
();
await
this
.
waitForContentLoad
();
await
this
.
replaceVideoToAudio
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
// 计算设置上一节的高度
// 计算设置上一节的高度
this
.
chapterContentHeight
=
$
(
"#chapter-content-list .show"
).
innerHeight
();
this
.
chapterContentHeight
=
$
(
"#chapter-content-list .show"
).
innerHeight
();
...
@@ -371,7 +372,28 @@ function countSubstringOccurrences(str, substring) {
...
@@ -371,7 +372,28 @@ function countSubstringOccurrences(str, substring) {
this
.
nextChapterLoading
=
false
;
this
.
nextChapterLoading
=
false
;
this
.
callHandlerNoticeFlutterSubmit
(
"dismissLoadingCallback"
);
this
.
callHandlerNoticeFlutterSubmit
(
"dismissLoadingCallback"
);
},
},
// 替换video标签
replaceVideoToAudio
()
{
const
allVideo
=
document
.
querySelectorAll
(
"video"
);
let
arr
=
[
'.mp3'
,
'.wma'
,
'.wmv'
,
'.aac'
,
'.flac'
]
if
(
allVideo
.
length
>
0
)
{
allVideo
.
forEach
((
item
,
index
)
=>
{
var
sources
=
$
(
item
).
find
(
"source"
);
let
src
=
''
;
let
suffix
=
''
;
if
(
sources
.
length
===
1
)
{
src
=
$
(
sources
[
0
]).
attr
(
"src"
);
suffix
=
src
.
substring
(
src
.
lastIndexOf
(
'.'
));
}
if
(
arr
.
includes
(
suffix
.
toLowerCase
()))
{
const
html
=
`<audio controls><source src="
${
src
}
" type="audio/
${
suffix
.
substring
(
1
)}
"></audio>`
;
$
(
html
).
insertBefore
(
$
(
item
));
$
(
item
).
remove
();
}
})
}
},
// 气泡操作
// 气泡操作
async
tooltipOpa
(
elem
)
{
async
tooltipOpa
(
elem
)
{
const
position
=
$
(
elem
).
data
(
"random"
);
const
position
=
$
(
elem
).
data
(
"random"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论