Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Merged main into develop

Joseph Milazzo848885f103b9
diff --cc UI/Web/src/app/book-reader/book-reader/book-reader.component.html
index 410ef7555,22356d552..93446c1d0
--- a/UI/Web/src/app/book-reader/book-reader/book-reader.component.html
+++ b/UI/Web/src/app/book-reader/book-reader/book-reader.component.html
@@@ -107,24 -107,24 +107,24 @@@
</app-drawer>
</div>
-- <div #readingSection class="reading-section" [ngStyle]="{'padding-top': topOffset + 20 + 'px'}"
++ <div #readingSection class="reading-section" [ngStyle]="{'padding-top': topOffset + 20 + 'px'}"
[@isLoading]="isLoading ? true : false" (click)="handleReaderClick($event)">
-- <div #readingHtml class="book-content" [ngStyle]="{'padding-bottom': topOffset + 20 + 'px', 'margin': '0px 0px'}"
++ <div #readingHtml class="book-content" [ngStyle]="{'padding-bottom': topOffset + 20 + 'px', 'margin': '0px 0px'}"
[innerHtml]="page" *ngIf="page !== undefined"></div>
<div class="left {{clickOverlayClass('left')}} no-observe" (click)="prevPage()" *ngIf="clickToPaginate" tabindex="-1"></div>
<div class="{{scrollbarNeeded ? 'right-with-scrollbar' : 'right'}} {{clickOverlayClass('right')}} no-observe" (click)="nextPage()" *ngIf="clickToPaginate" tabindex="-1"></div>
--
- <div *ngIf="page !== undefined && scrollbarNeeded">
++
+ <div *ngIf="page !== undefined && scrollbarNeeded" (click)="$event.stopPropagation();">
<ng-container [ngTemplateOutlet]="actionBar"></ng-container>
</div>
</div>
<ng-template #actionBar>
<div class="reading-bar row g-0 justify-content-between">
-- <button class="btn btn-outline-secondary btn-icon col-2 col-xs-1" (click)="prevPage()"
-- [disabled]="IsPrevDisabled"
++ <button class="btn btn-outline-secondary btn-icon col-2 col-xs-1" (click)="prevPage()"
++ [disabled]="IsPrevDisabled"
title="{{readingDirection === ReadingDirection.LeftToRight ? 'Previous' : 'Next'}} Page">
<i class="fa {{(readingDirection === ReadingDirection.LeftToRight ? IsPrevChapter : IsNextChapter) ? 'fa-angle-double-left' : 'fa-angle-left'}}" aria-hidden="true"></i>
<span class="d-none d-sm-block">&nbsp;{{readingDirection === ReadingDirection.LeftToRight ? 'Previous' : 'Next'}}</span>
@@@ -143,8 -143,8 +143,8 @@@
</ng-template>
</div>
<button class="btn btn-secondary col-2 col-xs-1" (click)="closeReader()"><i class="fa fa-times-circle" aria-hidden="true"></i><span class="d-none d-sm-block">&nbsp;Close</span></button>
-- <button class="btn btn-outline-secondary btn-icon col-2 col-xs-1"
-- [disabled]="IsNextDisabled"
++ <button class="btn btn-outline-secondary btn-icon col-2 col-xs-1"
++ [disabled]="IsNextDisabled"
(click)="nextPage()" title="{{readingDirection === ReadingDirection.LeftToRight ? 'Next' : 'Previous'}} Page">
<i class="fa {{(readingDirection === ReadingDirection.LeftToRight ? IsNextChapter : IsPrevChapter) ? 'fa-angle-double-right' : 'fa-angle-right'}}" aria-hidden="true"></i>
<span class="d-none d-sm-block">{{readingDirection === ReadingDirection.LeftToRight ? 'Next' : 'Previous'}}&nbsp;</span>
@@@ -152,4 -152,4 +152,4 @@@
</div>
</ng-template>
--</div>
++</div>
diff --cc UI/Web/src/app/cards/cover-image-chooser/cover-image-chooser.component.ts
index 466769a99,3d49894c2..5f3a2e895
--- a/UI/Web/src/app/cards/cover-image-chooser/cover-image-chooser.component.ts
+++ b/UI/Web/src/app/cards/cover-image-chooser/cover-image-chooser.component.ts
@@@ -43,8 -42,7 +43,8 @@@ export class CoverImageChooserComponen
mode: 'file' | 'url' | 'all' = 'all';
private readonly onDestroy = new Subject<void>();
- constructor(public imageService: ImageService, private fb: FormBuilder, private toastr: ToastrService, private uploadService: UploadService,
- constructor(public imageService: ImageService, private fb: FormBuilder, private toastr: ToastrService, private uploadService: UploadService) { }
++ constructor(public imageService: ImageService, private fb: FormBuilder, private toastr: ToastrService, private uploadService: UploadService,
+ @Inject(DOCUMENT) private document: Document) { }
ngOnInit(): void {
this.form = this.fb.group({
@@@ -86,10 -84,10 +86,10 @@@
const img = new Image();
img.crossOrigin = 'Anonymous';
img.src = this.imageService.getCoverUploadImage(filename);
- img.onload = (e) => this.handleUrlImageAdd(e);
+ img.onload = (e) => this.handleUrlImageAdd(img);
img.onerror = (e) => {
this.toastr.error('The image could not be fetched due to server refusing request. Please download and upload from file instead.');
-- this.form.get('coverImageUrl')?.setValue('');
++ this.form.get('coverImageUrl')?.setValue('');
};
this.form.get('coverImageUrl')?.setValue('');
});
@@@ -97,10 -95,8 +97,10 @@@
}
changeMode(mode: 'url') {
-- this.mode = mode;
++ this.mode = mode;
this.setupEnterHandler();
+
+ setTimeout(() => (this.document.querySelector('#load-image') as HTMLInputElement)?.focus(), 10);
}
public dropped(files: NgxFileDropEntry[]) {
@@@ -164,7 -162,7 +164,7 @@@
this.loadImage();
break;
}
--
++
case KEY_CODES.ESC_KEY:
this.mode = 'all';
event.stopPropagation();