feat(pdf): move ebook reader to embedpdf, add bookmarks, remove old pdf.js stuff (#393)
* feat(pdf): move ebook reader to embedpdf, add bookmarks, remove old pdf.js stuff * feat(pdf): add page number support for bookmarks and enhance mobile navigation * feat(pdf): implement document ID tracking for search functionality * feat(pdf): add page number column to book marks and update unique index * feat(pdf): enhance annotation handling and improve search result scrolling * feat(pdf): improve layout handling and enhance resize observer functionality * feat(pdf): improve document viewer initialization and improve close button styling * fix(pdf): remove 'form' from disabled categories * feat(pdf): add pan mode functionality and enhance sidebar layout * feat(pdf): improve book viewer initialization with enhanced element detection * feat(pdf): add link handling to text selection and improve popup actions * feat(pdf): enhance link detection and improve selection handling in event service * feat(pdf): improve accessibility and improve resource management in PDF viewer * feat(pdf): add resize observer for improved layout handling * feat(pdf): error handling and improve navigation in PDF reader
This commit is contained in:
@@ -345,12 +345,12 @@ export class EbookReaderComponent implements OnInit, OnDestroy {
|
||||
this.toggleImmersiveMode();
|
||||
break;
|
||||
case 'go-first-section':
|
||||
this.viewManager.goToSection(0).subscribe();
|
||||
this.viewManager.goToSection(0).pipe(catchError(() => of(undefined))).subscribe();
|
||||
break;
|
||||
case 'go-last-section': {
|
||||
const s = this.progressService.currentProgressData?.section;
|
||||
if (s && s.total > 0) {
|
||||
this.viewManager.goToSection(s.total - 1).subscribe();
|
||||
this.viewManager.goToSection(s.total - 1).pipe(catchError(() => of(undefined))).subscribe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -429,7 +429,10 @@ export class EbookReaderComponent implements OnInit, OnDestroy {
|
||||
|
||||
onProgressChange(fraction: number): void {
|
||||
this.viewManager.goToFraction(fraction)
|
||||
.pipe(takeUntil(this.destroy$))
|
||||
.pipe(
|
||||
takeUntil(this.destroy$),
|
||||
catchError(() => of(undefined))
|
||||
)
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
@@ -481,6 +484,17 @@ export class EbookReaderComponent implements OnInit, OnDestroy {
|
||||
handleSelectionAction(action: TextSelectionAction): void {
|
||||
if (action.type === 'note') {
|
||||
this.noteService.openNewNoteDialog();
|
||||
} else if (action.type === 'go-to-link') {
|
||||
const linkUrl = this.selectionState().linkUrl;
|
||||
if (linkUrl) {
|
||||
this.viewManager.goTo(linkUrl)
|
||||
.pipe(
|
||||
takeUntil(this.destroy$),
|
||||
catchError(() => of(undefined))
|
||||
)
|
||||
.subscribe();
|
||||
}
|
||||
this.selectionService.handleAction(action);
|
||||
} else {
|
||||
this.selectionService.handleAction(action);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user