Web Links (#1983)
* Updated dependencies * Updated the default key to be 256 bits to meet security requirements. * Added basic implementation of web link resolving favicon. Needs lots more work and testing on all OSes. * Implemented ability to see links and click on them for an individual chapter. * Hooked up the ability to set Series web links. * Render out the web link * Refactored out the favicon so there is a backup in case it fails. Refactored the baseline image placeholders to be dark mode since that is the default. * Added Robbie's nice error weblink fallbacks.
This commit is contained in:
parent
23fde65a7b
commit
bd8a1821a7
37 changed files with 4272 additions and 80 deletions
|
|
@ -14,9 +14,10 @@ export class ImageService implements OnDestroy {
|
|||
baseUrl = environment.apiUrl;
|
||||
apiKey: string = '';
|
||||
encodedKey: string = '';
|
||||
public placeholderImage = 'assets/images/image-placeholder-min.png';
|
||||
public errorImage = 'assets/images/error-placeholder2-min.png';
|
||||
public placeholderImage = 'assets/images/image-placeholder.dark-min.png';
|
||||
public errorImage = 'assets/images/error-placeholder2.dark-min.png';
|
||||
public resetCoverImage = 'assets/images/image-reset-cover-min.png';
|
||||
public errorWebLinkImage = 'assets/images/broken-white-32x32.png';
|
||||
|
||||
private onDestroy: Subject<void> = new Subject();
|
||||
|
||||
|
|
@ -25,9 +26,11 @@ export class ImageService implements OnDestroy {
|
|||
if (this.themeService.isDarkTheme()) {
|
||||
this.placeholderImage = 'assets/images/image-placeholder.dark-min.png';
|
||||
this.errorImage = 'assets/images/error-placeholder2.dark-min.png';
|
||||
this.errorWebLinkImage = 'assets/images/broken-white-32x32.png';
|
||||
} else {
|
||||
this.placeholderImage = 'assets/images/image-placeholder-min.png';
|
||||
this.errorImage = 'assets/images/error-placeholder2-min.png';
|
||||
this.errorWebLinkImage = 'assets/images/broken-black-32x32.png';
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -91,6 +94,10 @@ export class ImageService implements OnDestroy {
|
|||
return `${this.baseUrl}image/bookmark?chapterId=${chapterId}&apiKey=${this.encodedKey}&pageNum=${pageNum}`;
|
||||
}
|
||||
|
||||
getWebLinkImage(url: string) {
|
||||
return `${this.baseUrl}image/web-link?url=${encodeURIComponent(url)}&apiKey=${this.encodedKey}`;
|
||||
}
|
||||
|
||||
getCoverUploadImage(filename: string) {
|
||||
return `${this.baseUrl}image/cover-upload?filename=${encodeURIComponent(filename)}&apiKey=${this.encodedKey}`;
|
||||
}
|
||||
|
|
@ -99,6 +106,10 @@ export class ImageService implements OnDestroy {
|
|||
event.target.src = this.placeholderImage;
|
||||
}
|
||||
|
||||
updateErroredWebLinkImage(event: any) {
|
||||
event.target.src = this.errorWebLinkImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to refresh an existing loaded image (lazysizes). If random already attached, will append another number onto it.
|
||||
* @param url Existing request url from ImageService only
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue