提交 77dfbc40 authored 作者: yueweilu's avatar yueweilu

add

上级 876b321a
......@@ -469,6 +469,10 @@ light.c-ff4500::selection {
.chapter-container .chapter-content-list .chapter-item-up .chapter-expand-inline svg {
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-up .chapter-expand-inline,
.chapter-container .chapter-content-list .chapter-item .chapter-item-tooltip,
......
......@@ -371,6 +371,7 @@ function countSubstringOccurrences(str, substring) {
// 带内容加载完成
await this.waitForContentLoad();
await this.replaceVideoToAudio();
if (scroll) {
$(".chapter-content-list .show").css({
transform: `translateY(-${this.upContentsHeight - this.windowHeight}px)`,
......@@ -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) {
if (!this.token) return;
......@@ -2221,7 +2243,7 @@ function countSubstringOccurrences(str, substring) {
const refreshTokenSuccess = (arguments) => {
return app.refreshTokenSuccess(arguments);
};
// callbackInFlutterComponent(',323,2856,d4c36b804c0418b134c2eef6d1689943');
// callbackInFlutterComponent(',175,335,2f85d063f94485c0c2ef31e652875bd5');
</script>
</body>
</html>
......@@ -353,6 +353,7 @@ function countSubstringOccurrences(str, substring) {
});
// 带内容加载完成
await this.waitForContentLoad();
await this.replaceVideoToAudio();
setTimeout(() => {
// 计算设置上一节的高度
this.chapterContentHeight = $("#chapter-content-list .show").innerHeight();
......@@ -371,7 +372,28 @@ function countSubstringOccurrences(str, substring) {
this.nextChapterLoading = false;
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) {
const position = $(elem).data("random");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论