Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AI_BOOK_TOOL
Project
Project
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
template admin
AI_BOOK_TOOL
Commits
fac33607
Commit
fac33607
authored
Aug 12, 2025
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a125aaf4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
105 deletions
+94
-105
index.js
play/index.js
+94
-105
No files found.
play/index.js
View file @
fac33607
...
...
@@ -14,7 +14,7 @@ $(function () {
}
else
{
console
.
log
(
'
获取到数据:
'
,
data
);
if
(
!
data
.
continuity
)
{
data
.
continuity
=
data
.
pages
.
map
((
item
,
i
)
=>
{
return
i
+
''
});
data
.
continuity
=
data
.
pages
.
map
((
item
,
i
)
=>
{
return
i
+
''
});
}
initializeApp
(
data
);
}
...
...
@@ -152,12 +152,12 @@ function initializeApp(data) {
let
endTime
=
group
.
end
;
// 如果时间信息为空,使用页面级别的时间
if
(
startTime
===
null
||
startTime
===
undefined
)
{
startTime
=
page
.
start
||
0
;
}
if
(
endTime
===
null
||
endTime
===
undefined
)
{
endTime
=
page
.
end
||
0
;
}
//
if (startTime === null || startTime === undefined) {
// startTime = page.start
;
//
}
//
if (endTime === null || endTime === undefined) {
// endTime = page.end
;
//
}
group
.
group
.
forEach
((
textGroup
,
textIndex
)
=>
{
if
(
textGroup
&&
textGroup
.
rect
)
{
...
...
@@ -413,26 +413,15 @@ function initializeApp(data) {
// 遍历所有矩形框,检查时间
allRects
.
forEach
(
rect
=>
{
if
(
currentTime
>=
rect
.
_start
&&
currentTime
<=
rect
.
_end
)
{
if
(
rect
.
_start
!=
null
&&
rect
.
_end
!=
null
&&
currentTime
>=
rect
.
_start
&&
currentTime
<=
rect
.
_end
)
{
newRects
.
push
(
rect
);
}
});
// 遍历所有单词,检查时间
allWords
.
forEach
(
word
=>
{
let
wordStart
=
word
.
start
;
let
wordEnd
=
word
.
end
;
// 为没有时间信息的单词设置默认时间
if
(
wordStart
===
null
||
wordStart
===
undefined
)
{
wordStart
=
word
.
_start
||
0
;
}
if
(
wordEnd
===
null
||
wordEnd
===
undefined
)
{
wordEnd
=
word
.
_end
||
0
;
}
// 如果当前时间已经过了这个单词的开始时间,就保持高亮直到切换页面
if
(
currentTime
>=
wordS
tart
)
{
if
(
word
.
start
!=
null
&&
currentTime
>=
word
.
s
tart
)
{
newWords
.
push
(
word
);
}
});
...
...
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