File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1655,16 +1655,14 @@ function initScript() {
16551655 wrapAllElements ( 'img' , 'div' ) ;
16561656
16571657 // 书籍章节进度保存
1658- let lastPart = pathParts [ pathParts . length - 1 ] ;
1659- if ( lastPart . startsWith ( 'chapter_' ) ) {
1660- if ( window . location . hash !== '' ) {
1661- lastPart += window . location . hash ;
1662- }
1663- if ( ! isKindleMode ( ) ) {
1664- localStorage . setItem ( book_hash , lastPart ) ;
1665- } else {
1666- setCookie ( book_hash , lastPart ) ;
1667- }
1658+ let saveBookChapterRead = "eb_ci_" + chapter_index ;
1659+ if ( window . location . hash !== '' ) {
1660+ saveBookChapterRead += window . location . hash ;
1661+ }
1662+ if ( ! isKindleMode ( ) ) {
1663+ localStorage . setItem ( book_hash , saveBookChapterRead ) ;
1664+ } else {
1665+ setCookie ( book_hash , saveBookChapterRead ) ;
16681666 }
16691667
16701668 // 主题切换功能
Original file line number Diff line number Diff line change @@ -494,16 +494,16 @@ def create_index_page(self):
494494
495495 if chapter_index is not None :
496496 if chapter_anchor is not None :
497- index_html += f' <li class="{ level_class } "><a class="chapter-link" href="/book/{ self .book_hash } /chapter_{ chapter_index } .html#{ chapter_anchor } " id="chapter_ { chapter_index } .html #{ chapter_anchor } "><span class="chapter-title">{ toc_item ["title" ]} </span><span class="chapter-page">chapter_{ chapter_index } .html</span></a></li>\n '
497+ index_html += f' <li class="{ level_class } "><a class="chapter-link" href="/book/{ self .book_hash } /chapter_{ chapter_index } .html#{ chapter_anchor } " id="eb_ci_ { chapter_index } #{ chapter_anchor } "><span class="chapter-title">{ toc_item ["title" ]} </span><span class="chapter-page">chapter_{ chapter_index } .html</span></a></li>\n '
498498 else :
499- index_html += f' <li class="{ level_class } "><a class="chapter-link" href="/book/{ self .book_hash } /chapter_{ chapter_index } .html" id="chapter_ { chapter_index } .html "><span class="chapter-title">{ toc_item ["title" ]} </span><span class="chapter-page">chapter_{ chapter_index } .html</span></a></li>\n '
499+ index_html += f' <li class="{ level_class } "><a class="chapter-link" href="/book/{ self .book_hash } /chapter_{ chapter_index } .html" id="eb_ci_ { chapter_index } "><span class="chapter-title">{ toc_item ["title" ]} </span><span class="chapter-page">chapter_{ chapter_index } .html</span></a></li>\n '
500500 toc_item ['new_file_name' ] = f'chapter_{ chapter_index } .html'
501501 else :
502502 print (f"Chapter index not found for toc item: { toc_item ['title' ]} (src: { toc_src } )" )
503503 else :
504504 # 回退到简单章节列表
505505 for i , chapter in enumerate (self .chapters ):
506- index_html += f' <li><a class="chapter-link" href="/book/{ self .book_hash } /chapter_{ i } .html" id="chapter_ { i } .html ">{ chapter ["title" ]} </a></li>\n '
506+ index_html += f' <li><a class="chapter-link" href="/book/{ self .book_hash } /chapter_{ i } .html" id="eb_ci_ { i } ">{ chapter ["title" ]} </a></li>\n '
507507
508508 index_html += f""" </ul>
509509 </div>
You can’t perform that action at this time.
0 commit comments