From 980e5ce3d2219f6edee0fe669ca888bbcc565148 Mon Sep 17 00:00:00 2001 From: Andrii Rodzyk Date: Fri, 15 Nov 2024 15:15:19 +0200 Subject: [PATCH 1/3] feat: blankary; refactor: @site-modules; refactor: link-parser --- angular.json | 4 +- src/.well-known/atproto-did | 1 - src/CNAME | 1 - .../@common-read}/common-read.module.ts | 0 .../@common-read}/index.ts | 0 .../ui/common-read/common-read.component.html | 0 .../ui/common-read/common-read.component.scss | 0 .../ui/common-read/common-read.component.ts | 0 .../@common-read}/ui/index.ts | 0 .../@common-read}/utils/composition.ts | 0 .../@common-read}/utils/index.ts | 0 .../utils/read-base-component.ts | 35 ++++- .../blankary/blankary-routing.module.ts | 17 +++ .../blankary-shell.component.html | 8 + .../blankary-shell.component.scss} | 0 .../blankary-shell.component.ts | 46 ++++++ .../@site-modules/blankary/blankary.module.ts | 19 +++ .../blankary/data-access/blankary.service.ts | 34 +++++ .../comick/comick-routing.module.ts | 0 .../comick-shell/comick-shell.component.html | 0 .../comick-shell/comick-shell.component.scss} | 0 .../comick-shell/comick-shell.component.ts | 8 +- .../comick/comick.module.ts | 2 +- .../comick/data-access/comick.service.ts | 6 +- .../imgur/data-access/imgur.service.ts | 4 +- .../imgur/imgur-routing.module.ts | 0 .../imgur-shell/imgur-shell.component.ts | 8 +- .../{ => @site-modules}/imgur/imgur.module.ts | 2 +- src/app/@site-modules/index.ts | 12 ++ .../mangadex/data-access/mangadex.service.ts | 4 +- .../mangadex/mangadex-routing.module.ts | 0 .../mangadex-shell.component.ts | 8 +- .../mangadex/mangadex.module.ts | 2 +- .../nhentai/data-access/nhentai.service.ts | 8 +- .../nhentai/nhentai-routing.module.ts | 0 .../nhentai-shell.component.html | 0 .../nhentai-shell.component.scss} | 0 .../nhentai-shell/nhentai-shell.component.ts | 8 +- .../nhentai/nhentai.module.ts | 2 +- .../pixiv/data-access/pixiv.service.ts | 6 +- .../pixiv/pixiv-routing.module.ts | 0 .../pixiv-shell/pixiv-shell.component.html | 0 .../pixiv-shell/pixiv-shell.component.scss} | 0 .../pixiv-shell/pixiv-shell.component.ts | 8 +- .../{ => @site-modules}/pixiv/pixiv.module.ts | 2 +- .../read/data-access/read.service.ts | 2 +- .../read/read-routing.module.ts | 0 .../read/read-shell/read-shell.component.ts | 8 +- .../{ => @site-modules}/read/read.module.ts | 2 +- .../reddit/data-access/reddit.service.ts | 6 +- .../reddit/reddit-routing.module.ts | 0 .../reddit-shell/reddit-shell.component.ts | 8 +- .../reddit/reddit.module.ts | 2 +- .../data-access/telegraph.service.ts | 6 +- .../telegraph/telegraph-routing.module.ts | 0 .../telegraph-shell.component.ts | 8 +- .../telegraph/telegraph.module.ts | 2 +- .../yandere/data-access/yandere.service.ts | 6 +- .../yandere/yandere-routing.module.ts | 0 .../yandere-shell.component.html | 0 .../yandere-shell.component.scss} | 0 .../yandere-shell/yandere-shell.component.ts | 8 +- .../yandere/yandere.module.ts | 2 +- .../zenko/data-access/zenko.service.ts | 6 +- .../zenko/zenko-routing.module.ts | 0 .../zenko-shell/zenko-shell.component.html | 0 .../zenko-shell/zenko-shell.component.scss | 0 .../zenko-shell/zenko-shell.component.ts | 8 +- .../{ => @site-modules}/zenko/zenko.module.ts | 2 +- src/app/app-routing.module.ts | 69 +++++---- src/app/file/pdf/pdf.component.ts | 2 +- src/app/file/zip/zip.component.ts | 2 +- src/app/link-parser/link-parser.module.ts | 4 +- .../link-parser/link-parser.component.html | 29 +--- .../link-parser/link-parser.component.scss | 141 +----------------- .../link-parser/link-parser.component.ts | 134 +++-------------- .../ui/footer/footer.component.html | 4 +- .../link-parser/ui/footer/footer.component.ts | 4 +- .../ui/parser-form/parser-form.component.html | 22 +++ .../ui/parser-form/parser-form.component.scss | 112 ++++++++++++++ .../ui/parser-form/parser-form.component.ts | 129 ++++++++++++++++ .../link-parser/utils/blankary-link-parser.ts | 6 + src/app/link-parser/utils/index.ts | 3 +- .../list/list-shell/list-shell.component.ts | 3 +- src/app/page-not-found.component.ts | 15 +- .../playlist/data-access/playlist.service.ts | 9 +- .../shared/data-access/download.service.ts | 2 +- .../shared/data-access/meta-tags.service.ts | 74 +++++++++ src/app/shared/data-access/proxy.service.ts | 14 ++ .../ui/file-change/file-change.component.ts | 4 +- .../ui/manga-page/manga-page.component.scss | 76 +--------- .../viewer-footer/viewer-footer.component.ts | 2 +- .../viewer-header/viewer-header.component.ts | 2 +- src/app/shared/ui/viewer/viewer.component.ts | 2 +- src/app/shared/utils/phrases.ts | 6 + src/assets/langs/uk.json | 8 +- src/assets/logos/blankary-logo.svg | 12 ++ src/assets/logos/pixiv-logo.svg | 2 + ...telegra-ph-logo.svg => telegraph-logo.svg} | 0 src/assets/logos/zenko-logo.svg | 1 + src/environments/environment.development.ts | 3 +- src/environments/environment.ts | 4 +- src/robots.txt | 7 + src/sitemap.xml | 13 ++ 104 files changed, 759 insertions(+), 492 deletions(-) delete mode 100644 src/.well-known/atproto-did delete mode 100644 src/CNAME rename src/app/{common/common-read => @site-modules/@common-read}/common-read.module.ts (100%) rename src/app/{common/common-read => @site-modules/@common-read}/index.ts (100%) rename src/app/{common/common-read => @site-modules/@common-read}/ui/common-read/common-read.component.html (100%) rename src/app/{common/common-read => @site-modules/@common-read}/ui/common-read/common-read.component.scss (100%) rename src/app/{common/common-read => @site-modules/@common-read}/ui/common-read/common-read.component.ts (100%) rename src/app/{common/common-read => @site-modules/@common-read}/ui/index.ts (100%) rename src/app/{common/common-read => @site-modules/@common-read}/utils/composition.ts (100%) rename src/app/{common/common-read => @site-modules/@common-read}/utils/index.ts (100%) rename src/app/{common/common-read => @site-modules/@common-read}/utils/read-base-component.ts (81%) create mode 100644 src/app/@site-modules/blankary/blankary-routing.module.ts create mode 100644 src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.html rename src/app/{comick/comick-shell/comick-shell.component.scss => @site-modules/blankary/blankary-shell/blankary-shell.component.scss} (100%) create mode 100644 src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.ts create mode 100644 src/app/@site-modules/blankary/blankary.module.ts create mode 100644 src/app/@site-modules/blankary/data-access/blankary.service.ts rename src/app/{ => @site-modules}/comick/comick-routing.module.ts (100%) rename src/app/{ => @site-modules}/comick/comick-shell/comick-shell.component.html (100%) rename src/app/{nhentai/nhentai-shell/nhentai-shell.component.scss => @site-modules/comick/comick-shell/comick-shell.component.scss} (100%) rename src/app/{ => @site-modules}/comick/comick-shell/comick-shell.component.ts (84%) rename src/app/{ => @site-modules}/comick/comick.module.ts (87%) rename src/app/{ => @site-modules}/comick/data-access/comick.service.ts (86%) rename src/app/{ => @site-modules}/imgur/data-access/imgur.service.ts (95%) rename src/app/{ => @site-modules}/imgur/imgur-routing.module.ts (100%) rename src/app/{ => @site-modules}/imgur/imgur-shell/imgur-shell.component.ts (89%) rename src/app/{ => @site-modules}/imgur/imgur.module.ts (87%) create mode 100644 src/app/@site-modules/index.ts rename src/app/{ => @site-modules}/mangadex/data-access/mangadex.service.ts (95%) rename src/app/{ => @site-modules}/mangadex/mangadex-routing.module.ts (100%) rename src/app/{ => @site-modules}/mangadex/mangadex-shell/mangadex-shell.component.ts (91%) rename src/app/{ => @site-modules}/mangadex/mangadex.module.ts (88%) rename src/app/{ => @site-modules}/nhentai/data-access/nhentai.service.ts (84%) rename src/app/{ => @site-modules}/nhentai/nhentai-routing.module.ts (100%) rename src/app/{ => @site-modules}/nhentai/nhentai-shell/nhentai-shell.component.html (100%) rename src/app/{pixiv/pixiv-shell/pixiv-shell.component.scss => @site-modules/nhentai/nhentai-shell/nhentai-shell.component.scss} (100%) rename src/app/{ => @site-modules}/nhentai/nhentai-shell/nhentai-shell.component.ts (84%) rename src/app/{ => @site-modules}/nhentai/nhentai.module.ts (87%) rename src/app/{ => @site-modules}/pixiv/data-access/pixiv.service.ts (93%) rename src/app/{ => @site-modules}/pixiv/pixiv-routing.module.ts (100%) rename src/app/{ => @site-modules}/pixiv/pixiv-shell/pixiv-shell.component.html (100%) rename src/app/{yandere/yandere-shell/yandere-shell.component.scss => @site-modules/pixiv/pixiv-shell/pixiv-shell.component.scss} (100%) rename src/app/{ => @site-modules}/pixiv/pixiv-shell/pixiv-shell.component.ts (84%) rename src/app/{ => @site-modules}/pixiv/pixiv.module.ts (87%) rename src/app/{ => @site-modules}/read/data-access/read.service.ts (96%) rename src/app/{ => @site-modules}/read/read-routing.module.ts (100%) rename src/app/{ => @site-modules}/read/read-shell/read-shell.component.ts (89%) rename src/app/{ => @site-modules}/read/read.module.ts (87%) rename src/app/{ => @site-modules}/reddit/data-access/reddit.service.ts (88%) rename src/app/{ => @site-modules}/reddit/reddit-routing.module.ts (100%) rename src/app/{ => @site-modules}/reddit/reddit-shell/reddit-shell.component.ts (86%) rename src/app/{ => @site-modules}/reddit/reddit.module.ts (87%) rename src/app/{ => @site-modules}/telegraph/data-access/telegraph.service.ts (85%) rename src/app/{ => @site-modules}/telegraph/telegraph-routing.module.ts (100%) rename src/app/{ => @site-modules}/telegraph/telegraph-shell/telegraph-shell.component.ts (87%) rename src/app/{ => @site-modules}/telegraph/telegraph.module.ts (88%) rename src/app/{ => @site-modules}/yandere/data-access/yandere.service.ts (88%) rename src/app/{ => @site-modules}/yandere/yandere-routing.module.ts (100%) rename src/app/{ => @site-modules}/yandere/yandere-shell/yandere-shell.component.html (100%) rename src/app/{zenko/zenko-shell/zenko-shell.component.scss => @site-modules/yandere/yandere-shell/yandere-shell.component.scss} (100%) rename src/app/{ => @site-modules}/yandere/yandere-shell/yandere-shell.component.ts (84%) rename src/app/{ => @site-modules}/yandere/yandere.module.ts (87%) rename src/app/{ => @site-modules}/zenko/data-access/zenko.service.ts (93%) rename src/app/{ => @site-modules}/zenko/zenko-routing.module.ts (100%) rename src/app/{ => @site-modules}/zenko/zenko-shell/zenko-shell.component.html (100%) create mode 100644 src/app/@site-modules/zenko/zenko-shell/zenko-shell.component.scss rename src/app/{ => @site-modules}/zenko/zenko-shell/zenko-shell.component.ts (83%) rename src/app/{ => @site-modules}/zenko/zenko.module.ts (87%) create mode 100644 src/app/link-parser/ui/parser-form/parser-form.component.html create mode 100644 src/app/link-parser/ui/parser-form/parser-form.component.scss create mode 100644 src/app/link-parser/ui/parser-form/parser-form.component.ts create mode 100644 src/app/link-parser/utils/blankary-link-parser.ts create mode 100644 src/app/shared/data-access/meta-tags.service.ts create mode 100644 src/app/shared/data-access/proxy.service.ts create mode 100644 src/assets/logos/blankary-logo.svg create mode 100644 src/assets/logos/pixiv-logo.svg rename src/assets/logos/{telegra-ph-logo.svg => telegraph-logo.svg} (100%) create mode 100644 src/assets/logos/zenko-logo.svg create mode 100644 src/robots.txt create mode 100644 src/sitemap.xml diff --git a/angular.json b/angular.json index eceb153..0a93052 100644 --- a/angular.json +++ b/angular.json @@ -42,6 +42,7 @@ "build": { "builder": "@angular-devkit/build-angular:application", "options": { + "allowedCommonJsDependencies": ["jszip"], "outputPath": "dist/chytanka", "index": "src/index.html", "browser": "src/main.ts", @@ -53,7 +54,8 @@ "assets": [ "src/favicon.ico", "src/assets", - "src/.well-known", + "src/robots.txt", + "src/sitemap.xml", "src/manifest.webmanifest", "src/manifest-uk.webmanifest", "src/CNAME" diff --git a/src/.well-known/atproto-did b/src/.well-known/atproto-did deleted file mode 100644 index 1bb4136..0000000 --- a/src/.well-known/atproto-did +++ /dev/null @@ -1 +0,0 @@ -did:plc:y7mx7g4jhmi3xeqxhvwxic4m \ No newline at end of file diff --git a/src/CNAME b/src/CNAME deleted file mode 100644 index 036ee5a..0000000 --- a/src/CNAME +++ /dev/null @@ -1 +0,0 @@ -chtnk.c \ No newline at end of file diff --git a/src/app/common/common-read/common-read.module.ts b/src/app/@site-modules/@common-read/common-read.module.ts similarity index 100% rename from src/app/common/common-read/common-read.module.ts rename to src/app/@site-modules/@common-read/common-read.module.ts diff --git a/src/app/common/common-read/index.ts b/src/app/@site-modules/@common-read/index.ts similarity index 100% rename from src/app/common/common-read/index.ts rename to src/app/@site-modules/@common-read/index.ts diff --git a/src/app/common/common-read/ui/common-read/common-read.component.html b/src/app/@site-modules/@common-read/ui/common-read/common-read.component.html similarity index 100% rename from src/app/common/common-read/ui/common-read/common-read.component.html rename to src/app/@site-modules/@common-read/ui/common-read/common-read.component.html diff --git a/src/app/common/common-read/ui/common-read/common-read.component.scss b/src/app/@site-modules/@common-read/ui/common-read/common-read.component.scss similarity index 100% rename from src/app/common/common-read/ui/common-read/common-read.component.scss rename to src/app/@site-modules/@common-read/ui/common-read/common-read.component.scss diff --git a/src/app/common/common-read/ui/common-read/common-read.component.ts b/src/app/@site-modules/@common-read/ui/common-read/common-read.component.ts similarity index 100% rename from src/app/common/common-read/ui/common-read/common-read.component.ts rename to src/app/@site-modules/@common-read/ui/common-read/common-read.component.ts diff --git a/src/app/common/common-read/ui/index.ts b/src/app/@site-modules/@common-read/ui/index.ts similarity index 100% rename from src/app/common/common-read/ui/index.ts rename to src/app/@site-modules/@common-read/ui/index.ts diff --git a/src/app/common/common-read/utils/composition.ts b/src/app/@site-modules/@common-read/utils/composition.ts similarity index 100% rename from src/app/common/common-read/utils/composition.ts rename to src/app/@site-modules/@common-read/utils/composition.ts diff --git a/src/app/common/common-read/utils/index.ts b/src/app/@site-modules/@common-read/utils/index.ts similarity index 100% rename from src/app/common/common-read/utils/index.ts rename to src/app/@site-modules/@common-read/utils/index.ts diff --git a/src/app/common/common-read/utils/read-base-component.ts b/src/app/@site-modules/@common-read/utils/read-base-component.ts similarity index 81% rename from src/app/common/common-read/utils/read-base-component.ts rename to src/app/@site-modules/@common-read/utils/read-base-component.ts index 4eeb834..30c2225 100644 --- a/src/app/common/common-read/utils/read-base-component.ts +++ b/src/app/@site-modules/@common-read/utils/read-base-component.ts @@ -7,6 +7,7 @@ import { LangService } from "../../../shared/data-access/lang.service"; import { HistoryService } from "../../../history/data-access/history.service"; import { ViewerService } from "../../../shared/data-access"; import { PlaylistItem, PlaylistService, isPlaylist } from "../../../playlist/data-access/playlist.service"; +import { MetaTagsService } from "../../../shared/data-access/meta-tags.service"; export abstract class ReadBaseComponent { protected refresh$: BehaviorSubject = new BehaviorSubject(null); @@ -38,7 +39,7 @@ export abstract class ReadBaseComponent { }) } - private title: Title = inject(Title) + meta = inject(MetaTagsService) protected route: ActivatedRoute = inject(ActivatedRoute) public lang: LangService = inject(LangService) @@ -82,11 +83,29 @@ export abstract class ReadBaseComponent { }) } - protected tapSetTitle(): MonoTypeOperatorFunction { - return tap(async (episode: CompositionEpisode) => { - if (episode) { - this.title.setTitle(`${episode.title} | Chytanka`); - } + // protected tapSetTitle(): MonoTypeOperatorFunction { + // return tap(async (episode: CompositionEpisode) => { + // if (episode) { + // this.title.setTitle(`${episode.title} | Chytanka`); + // } + // }) + // } + + protected tapSetMetaTags(copyrights = ''): MonoTypeOperatorFunction { + return tap((v) => { + + const t = v?.title; + this.meta.setOg(); + this.meta.setTwiter() + this.meta.setTitle(`Читати ${t} онлайн в Читанці`) + this.meta.setDesc(`Читати ${t} онлайн в Читанці`) + this.meta.setImage(v.images[0].src, t, '', copyrights) + // this.meta.setOgUrl(`https://chtnk.online/${v.id}/${MangadexHelper.getAlias(v.attributes)}`) + + // if (isNSFW(v.attributes)) { + // this.meta.setAdult() + // } + }) } @@ -113,14 +132,14 @@ export abstract class ReadBaseComponent { return tap(async (episode: CompositionEpisode) => { if (episode) { - + this.currentPlItem.set({ id: post_id, site: site }) this.cdr.detectChanges() } - + }) } } \ No newline at end of file diff --git a/src/app/@site-modules/blankary/blankary-routing.module.ts b/src/app/@site-modules/blankary/blankary-routing.module.ts new file mode 100644 index 0000000..5511c82 --- /dev/null +++ b/src/app/@site-modules/blankary/blankary-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { BlankaryShellComponent } from './blankary-shell/blankary-shell.component'; + +const routes: Routes = [ + { path: '', redirectTo: '/', pathMatch: 'full' }, + { + path: ':id', + component: BlankaryShellComponent + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class BlankaryRoutingModule { } diff --git a/src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.html b/src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.html new file mode 100644 index 0000000..0dc6e81 --- /dev/null +++ b/src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.html @@ -0,0 +1,8 @@ + + +

{{lang.ph().imagesVia}}Blankary + API. + {{lang.ph().thanks}}
{{lang.ph().detalisCopy}}

+ +
\ No newline at end of file diff --git a/src/app/comick/comick-shell/comick-shell.component.scss b/src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.scss similarity index 100% rename from src/app/comick/comick-shell/comick-shell.component.scss rename to src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.scss diff --git a/src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.ts b/src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.ts new file mode 100644 index 0000000..08031a4 --- /dev/null +++ b/src/app/@site-modules/blankary/blankary-shell/blankary-shell.component.ts @@ -0,0 +1,46 @@ +import { Component, inject, OnDestroy } from '@angular/core'; +import { switchMap, of, MonoTypeOperatorFunction, tap } from 'rxjs'; +import { BLANKARY_PATH } from '../../../app-routing.module'; +import { ReadBaseComponent } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; +import { BlankaryService } from '../data-access/blankary.service'; +import { MetaTagsService } from '../../../shared/data-access/meta-tags.service'; + +@Component({ + selector: 'app-blankary-shell', + templateUrl: './blankary-shell.component.html', + styleUrl: './blankary-shell.component.scss' +}) +export class BlankaryShellComponent extends ReadBaseComponent implements OnDestroy { + blankary = inject(BlankaryService) + + + override episode$ = this.combineParamMapAndRefresh() + .pipe(this.tapStartLoading(), + switchMap(([params]) => { + const pathParam = params?.get('id'); + + if (!pathParam) return of(null); + + const path = (Base64.isBase64(pathParam)) ? Base64.fromBase64(pathParam) : pathParam; + + return (this.blankary.getComposition(path)).pipe( + this.catchError(), + this.tapSetMetaTags(), + this.tapSaveToHistory(BLANKARY_PATH, path), + this.tapSaveToCurrentPlaylistItem(BLANKARY_PATH, path), + this.finalizeLoading()); + }) + ); + + constructor() { + super() + } + + ngOnDestroy(): void { + this.plObserv?.unsubscribe(); + } + + + +} diff --git a/src/app/@site-modules/blankary/blankary.module.ts b/src/app/@site-modules/blankary/blankary.module.ts new file mode 100644 index 0000000..425f6e3 --- /dev/null +++ b/src/app/@site-modules/blankary/blankary.module.ts @@ -0,0 +1,19 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { BlankaryRoutingModule } from './blankary-routing.module'; +import { BlankaryShellComponent } from './blankary-shell/blankary-shell.component'; +import { CommonReadModule } from '../@common-read'; + + +@NgModule({ + declarations: [ + BlankaryShellComponent + ], + imports: [ + CommonModule, + BlankaryRoutingModule, + CommonReadModule + ] +}) +export class BlankaryModule { } diff --git a/src/app/@site-modules/blankary/data-access/blankary.service.ts b/src/app/@site-modules/blankary/data-access/blankary.service.ts new file mode 100644 index 0000000..fbb2f80 --- /dev/null +++ b/src/app/@site-modules/blankary/data-access/blankary.service.ts @@ -0,0 +1,34 @@ +import { HttpClient } from '@angular/common/http'; +import { inject, Injectable } from '@angular/core'; +import { map, Observable } from 'rxjs'; +import { CompositionEpisode } from '../../@common-read'; +import { environment } from '../../../../environments/environment'; +import { Base64 } from '../../../shared/utils'; + +@Injectable({ + providedIn: 'root' +}) +export class BlankaryService { + http: HttpClient = inject(HttpClient) + + getComposition(id: string): Observable { + return this.http.get(environment.blankaryoHost + id) + .pipe(map((data) => { return this.map(data) })) + } + + map(data: any): CompositionEpisode { + + const mappedResponse = { + title: data.title, + + images: JSON.parse(data.images).map((img: string) => { + return { + src: environment.proxy + Base64.toBase64(`https://blankary.com/image/${img}`) + }; + }) + + }; + + return mappedResponse; + } +} diff --git a/src/app/comick/comick-routing.module.ts b/src/app/@site-modules/comick/comick-routing.module.ts similarity index 100% rename from src/app/comick/comick-routing.module.ts rename to src/app/@site-modules/comick/comick-routing.module.ts diff --git a/src/app/comick/comick-shell/comick-shell.component.html b/src/app/@site-modules/comick/comick-shell/comick-shell.component.html similarity index 100% rename from src/app/comick/comick-shell/comick-shell.component.html rename to src/app/@site-modules/comick/comick-shell/comick-shell.component.html diff --git a/src/app/nhentai/nhentai-shell/nhentai-shell.component.scss b/src/app/@site-modules/comick/comick-shell/comick-shell.component.scss similarity index 100% rename from src/app/nhentai/nhentai-shell/nhentai-shell.component.scss rename to src/app/@site-modules/comick/comick-shell/comick-shell.component.scss diff --git a/src/app/comick/comick-shell/comick-shell.component.ts b/src/app/@site-modules/comick/comick-shell/comick-shell.component.ts similarity index 84% rename from src/app/comick/comick-shell/comick-shell.component.ts rename to src/app/@site-modules/comick/comick-shell/comick-shell.component.ts index f337ac5..ba1c0ec 100644 --- a/src/app/comick/comick-shell/comick-shell.component.ts +++ b/src/app/@site-modules/comick/comick-shell/comick-shell.component.ts @@ -1,9 +1,9 @@ import { Component, inject, OnDestroy } from '@angular/core'; import { ComickService } from '../data-access/comick.service'; import { switchMap, of } from 'rxjs'; -import { ReadBaseComponent } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; -import { COMICK_PATH } from '../../app-routing.module'; +import { ReadBaseComponent } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; +import { COMICK_PATH } from '../../../app-routing.module'; @Component({ selector: 'app-comick-shell', @@ -22,7 +22,7 @@ export class ComickShellComponent extends ReadBaseComponent implements OnDestroy const path = (Base64.isBase64(pathParam)) ? Base64.fromBase64(pathParam) : pathParam; - return (this.comick.getComposition(path)).pipe(this.catchError(), this.tapSetTitle(), + return (this.comick.getComposition(path)).pipe(this.catchError(), this.tapSetMetaTags(), this.tapSaveToHistory(COMICK_PATH, path), this.tapSaveToCurrentPlaylistItem(COMICK_PATH, path), this.finalizeLoading()); diff --git a/src/app/comick/comick.module.ts b/src/app/@site-modules/comick/comick.module.ts similarity index 87% rename from src/app/comick/comick.module.ts rename to src/app/@site-modules/comick/comick.module.ts index 6b0d441..37aeb07 100644 --- a/src/app/comick/comick.module.ts +++ b/src/app/@site-modules/comick/comick.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { ComickRoutingModule } from './comick-routing.module'; import { ComickShellComponent } from './comick-shell/comick-shell.component'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; @NgModule({ diff --git a/src/app/comick/data-access/comick.service.ts b/src/app/@site-modules/comick/data-access/comick.service.ts similarity index 86% rename from src/app/comick/data-access/comick.service.ts rename to src/app/@site-modules/comick/data-access/comick.service.ts index d80f249..8521d61 100644 --- a/src/app/comick/data-access/comick.service.ts +++ b/src/app/@site-modules/comick/data-access/comick.service.ts @@ -1,9 +1,9 @@ import { HttpClient } from '@angular/common/http'; import { inject, Injectable } from '@angular/core'; import { Observable, map } from 'rxjs'; -import { environment } from '../../../environments/environment'; -import { CompositionEpisode } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { environment } from '../../../../environments/environment'; +import { CompositionEpisode } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; @Injectable({ providedIn: 'root' diff --git a/src/app/imgur/data-access/imgur.service.ts b/src/app/@site-modules/imgur/data-access/imgur.service.ts similarity index 95% rename from src/app/imgur/data-access/imgur.service.ts rename to src/app/@site-modules/imgur/data-access/imgur.service.ts index fdf0610..6feab8e 100644 --- a/src/app/imgur/data-access/imgur.service.ts +++ b/src/app/@site-modules/imgur/data-access/imgur.service.ts @@ -1,8 +1,8 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { environment } from '../../../environments/environment'; +import { environment } from '../../../../environments/environment'; import { Observable, map } from 'rxjs'; -import { CompositionEpisode, CompositionImage } from '../../common/common-read'; +import { CompositionEpisode, CompositionImage } from '../../@common-read'; interface ImgurRespCompImage { link: string; width: number; diff --git a/src/app/imgur/imgur-routing.module.ts b/src/app/@site-modules/imgur/imgur-routing.module.ts similarity index 100% rename from src/app/imgur/imgur-routing.module.ts rename to src/app/@site-modules/imgur/imgur-routing.module.ts diff --git a/src/app/imgur/imgur-shell/imgur-shell.component.ts b/src/app/@site-modules/imgur/imgur-shell/imgur-shell.component.ts similarity index 89% rename from src/app/imgur/imgur-shell/imgur-shell.component.ts rename to src/app/@site-modules/imgur/imgur-shell/imgur-shell.component.ts index 0a92cfc..0deb53e 100644 --- a/src/app/imgur/imgur-shell/imgur-shell.component.ts +++ b/src/app/@site-modules/imgur/imgur-shell/imgur-shell.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; import { ImgurService } from '../data-access/imgur.service'; -import { Base64 } from '../../shared/utils'; +import { Base64 } from '../../../shared/utils'; import { of, switchMap } from 'rxjs'; -import { ReadBaseComponent } from '../../common/common-read'; -import { IMGUR_PATH } from '../../app-routing.module'; +import { ReadBaseComponent } from '../../@common-read'; +import { IMGUR_PATH } from '../../../app-routing.module'; @Component({ selector: 'app-imgur-shell', @@ -30,7 +30,7 @@ export class ImgurShellComponent extends ReadBaseComponent { const id = (Base64.isBase64(idParam)) ? Base64.fromBase64(idParam) : idParam; const id64 = Base64.toBase64(id); - return (this.imgur.getComposition(id)).pipe(this.catchError(), this.tapSetTitle(), + return (this.imgur.getComposition(id)).pipe(this.catchError(), this.tapSetMetaTags(), this.tapSaveToHistory(IMGUR_PATH, id64), this.tapSaveToCurrentPlaylistItem(IMGUR_PATH, id), diff --git a/src/app/imgur/imgur.module.ts b/src/app/@site-modules/imgur/imgur.module.ts similarity index 87% rename from src/app/imgur/imgur.module.ts rename to src/app/@site-modules/imgur/imgur.module.ts index a8b88aa..d3e9df3 100644 --- a/src/app/imgur/imgur.module.ts +++ b/src/app/@site-modules/imgur/imgur.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { ImgurRoutingModule } from './imgur-routing.module'; import { ImgurShellComponent } from './imgur-shell/imgur-shell.component'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; @NgModule({ diff --git a/src/app/@site-modules/index.ts b/src/app/@site-modules/index.ts new file mode 100644 index 0000000..b5393d5 --- /dev/null +++ b/src/app/@site-modules/index.ts @@ -0,0 +1,12 @@ +export * from './blankary/blankary.module' +export * from './comick/comick.module' +export * from './imgur/imgur.module' +export * from './mangadex/mangadex.module' +export * from './nhentai/nhentai.module' +export * from './pixiv/pixiv.module' +export * from './reddit/reddit.module' +export * from './telegraph/telegraph.module' +export * from './yandere/yandere.module' +export * from './zenko/zenko.module' +// link to json data +export * from './read/read.module' \ No newline at end of file diff --git a/src/app/mangadex/data-access/mangadex.service.ts b/src/app/@site-modules/mangadex/data-access/mangadex.service.ts similarity index 95% rename from src/app/mangadex/data-access/mangadex.service.ts rename to src/app/@site-modules/mangadex/data-access/mangadex.service.ts index eeb6b68..5b6ea8e 100644 --- a/src/app/mangadex/data-access/mangadex.service.ts +++ b/src/app/@site-modules/mangadex/data-access/mangadex.service.ts @@ -1,8 +1,8 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { environment } from '../../../environments/environment'; +import { environment } from '../../../../environments/environment'; import { Observable, catchError, map, throwError } from 'rxjs'; -import { CompositionEpisode, CompositionImage } from '../../common/common-read'; +import { CompositionEpisode, CompositionImage } from '../../@common-read'; interface MdChapterImages { hash: string; diff --git a/src/app/mangadex/mangadex-routing.module.ts b/src/app/@site-modules/mangadex/mangadex-routing.module.ts similarity index 100% rename from src/app/mangadex/mangadex-routing.module.ts rename to src/app/@site-modules/mangadex/mangadex-routing.module.ts diff --git a/src/app/mangadex/mangadex-shell/mangadex-shell.component.ts b/src/app/@site-modules/mangadex/mangadex-shell/mangadex-shell.component.ts similarity index 91% rename from src/app/mangadex/mangadex-shell/mangadex-shell.component.ts rename to src/app/@site-modules/mangadex/mangadex-shell/mangadex-shell.component.ts index d97327e..2e24d74 100644 --- a/src/app/mangadex/mangadex-shell/mangadex-shell.component.ts +++ b/src/app/@site-modules/mangadex/mangadex-shell/mangadex-shell.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; import { forkJoin, map, of, switchMap } from 'rxjs'; import { MangadexService } from '../data-access/mangadex.service'; -import { Base64 } from '../../shared/utils'; -import { ReadBaseComponent } from '../../common/common-read'; -import { MANGADEX_PATH } from '../../app-routing.module'; +import { Base64 } from '../../../shared/utils'; +import { ReadBaseComponent } from '../../@common-read'; +import { MANGADEX_PATH } from '../../../app-routing.module'; @Component({ selector: 'app-mangadex-shell', @@ -50,7 +50,7 @@ export class MangadexShellComponent extends ReadBaseComponent { ); }), this.catchError(), - this.tapSetTitle(), + this.tapSetMetaTags(MANGADEX_PATH), this.tapSaveToHistory(MANGADEX_PATH, id64), this.tapSaveToCurrentPlaylistItem(MANGADEX_PATH, id), diff --git a/src/app/mangadex/mangadex.module.ts b/src/app/@site-modules/mangadex/mangadex.module.ts similarity index 88% rename from src/app/mangadex/mangadex.module.ts rename to src/app/@site-modules/mangadex/mangadex.module.ts index 4151ab1..3774c69 100644 --- a/src/app/mangadex/mangadex.module.ts +++ b/src/app/@site-modules/mangadex/mangadex.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { MangadexRoutingModule } from './mangadex-routing.module'; import { MangadexShellComponent } from './mangadex-shell/mangadex-shell.component'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; @NgModule({ diff --git a/src/app/nhentai/data-access/nhentai.service.ts b/src/app/@site-modules/nhentai/data-access/nhentai.service.ts similarity index 84% rename from src/app/nhentai/data-access/nhentai.service.ts rename to src/app/@site-modules/nhentai/data-access/nhentai.service.ts index f26ab8b..7378bb3 100644 --- a/src/app/nhentai/data-access/nhentai.service.ts +++ b/src/app/@site-modules/nhentai/data-access/nhentai.service.ts @@ -1,9 +1,9 @@ import { HttpClient } from '@angular/common/http'; import { inject, Injectable } from '@angular/core'; import { Observable, map } from 'rxjs'; -import { environment } from '../../../environments/environment'; -import { CompositionEpisode } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { environment } from '../../../../environments/environment'; +import { CompositionEpisode } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; @Injectable({ providedIn: 'root' @@ -16,7 +16,7 @@ export class NhentaiService { .pipe(map((data) => { return this.map(data) })) } - imageType = new Map().set('p', 'png').set('j', 'jpg').set('g', 'gif') + imageType = new Map().set('p', 'png').set('j', 'jpg').set('g', 'gif').set('w', 'webp') map(data: any): CompositionEpisode { const mediaId = data.media_id; diff --git a/src/app/nhentai/nhentai-routing.module.ts b/src/app/@site-modules/nhentai/nhentai-routing.module.ts similarity index 100% rename from src/app/nhentai/nhentai-routing.module.ts rename to src/app/@site-modules/nhentai/nhentai-routing.module.ts diff --git a/src/app/nhentai/nhentai-shell/nhentai-shell.component.html b/src/app/@site-modules/nhentai/nhentai-shell/nhentai-shell.component.html similarity index 100% rename from src/app/nhentai/nhentai-shell/nhentai-shell.component.html rename to src/app/@site-modules/nhentai/nhentai-shell/nhentai-shell.component.html diff --git a/src/app/pixiv/pixiv-shell/pixiv-shell.component.scss b/src/app/@site-modules/nhentai/nhentai-shell/nhentai-shell.component.scss similarity index 100% rename from src/app/pixiv/pixiv-shell/pixiv-shell.component.scss rename to src/app/@site-modules/nhentai/nhentai-shell/nhentai-shell.component.scss diff --git a/src/app/nhentai/nhentai-shell/nhentai-shell.component.ts b/src/app/@site-modules/nhentai/nhentai-shell/nhentai-shell.component.ts similarity index 84% rename from src/app/nhentai/nhentai-shell/nhentai-shell.component.ts rename to src/app/@site-modules/nhentai/nhentai-shell/nhentai-shell.component.ts index f7c29b3..df787d4 100644 --- a/src/app/nhentai/nhentai-shell/nhentai-shell.component.ts +++ b/src/app/@site-modules/nhentai/nhentai-shell/nhentai-shell.component.ts @@ -1,9 +1,9 @@ import { Component, inject, OnDestroy } from '@angular/core'; import { NhentaiService } from '../data-access/nhentai.service'; import { switchMap, of } from 'rxjs'; -import { NHENTAI_PATH } from '../../app-routing.module'; -import { Base64 } from '../../shared/utils'; -import { ReadBaseComponent } from '../../common/common-read'; +import { NHENTAI_PATH } from '../../../app-routing.module'; +import { Base64 } from '../../../shared/utils'; +import { ReadBaseComponent } from '../../@common-read'; @Component({ selector: 'app-nhentai-shell', @@ -22,7 +22,7 @@ export class NhentaiShellComponent extends ReadBaseComponent implements OnDestro const path = (Base64.isBase64(pathParam)) ? Base64.fromBase64(pathParam) : pathParam; - return (this.nhentai.getComposition(path)).pipe(this.catchError(), this.tapSetTitle(), + return (this.nhentai.getComposition(path)).pipe(this.catchError(), this.tapSetMetaTags(), this.tapSaveToHistory(NHENTAI_PATH, path), this.tapSaveToCurrentPlaylistItem(NHENTAI_PATH, path), this.finalizeLoading()); diff --git a/src/app/nhentai/nhentai.module.ts b/src/app/@site-modules/nhentai/nhentai.module.ts similarity index 87% rename from src/app/nhentai/nhentai.module.ts rename to src/app/@site-modules/nhentai/nhentai.module.ts index d4c7d15..cf903c7 100644 --- a/src/app/nhentai/nhentai.module.ts +++ b/src/app/@site-modules/nhentai/nhentai.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { NhentaiRoutingModule } from './nhentai-routing.module'; import { NhentaiShellComponent } from './nhentai-shell/nhentai-shell.component'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; @NgModule({ diff --git a/src/app/pixiv/data-access/pixiv.service.ts b/src/app/@site-modules/pixiv/data-access/pixiv.service.ts similarity index 93% rename from src/app/pixiv/data-access/pixiv.service.ts rename to src/app/@site-modules/pixiv/data-access/pixiv.service.ts index b91ac65..3cc25f9 100644 --- a/src/app/pixiv/data-access/pixiv.service.ts +++ b/src/app/@site-modules/pixiv/data-access/pixiv.service.ts @@ -1,9 +1,9 @@ import { HttpClient } from '@angular/common/http'; import { inject, Injectable } from '@angular/core'; import { Observable, map } from 'rxjs'; -import { environment } from '../../../environments/environment'; -import { CompositionEpisode, CompositionPublisher } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { environment } from '../../../../environments/environment'; +import { CompositionEpisode, CompositionPublisher } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; @Injectable({ providedIn: 'root' diff --git a/src/app/pixiv/pixiv-routing.module.ts b/src/app/@site-modules/pixiv/pixiv-routing.module.ts similarity index 100% rename from src/app/pixiv/pixiv-routing.module.ts rename to src/app/@site-modules/pixiv/pixiv-routing.module.ts diff --git a/src/app/pixiv/pixiv-shell/pixiv-shell.component.html b/src/app/@site-modules/pixiv/pixiv-shell/pixiv-shell.component.html similarity index 100% rename from src/app/pixiv/pixiv-shell/pixiv-shell.component.html rename to src/app/@site-modules/pixiv/pixiv-shell/pixiv-shell.component.html diff --git a/src/app/yandere/yandere-shell/yandere-shell.component.scss b/src/app/@site-modules/pixiv/pixiv-shell/pixiv-shell.component.scss similarity index 100% rename from src/app/yandere/yandere-shell/yandere-shell.component.scss rename to src/app/@site-modules/pixiv/pixiv-shell/pixiv-shell.component.scss diff --git a/src/app/pixiv/pixiv-shell/pixiv-shell.component.ts b/src/app/@site-modules/pixiv/pixiv-shell/pixiv-shell.component.ts similarity index 84% rename from src/app/pixiv/pixiv-shell/pixiv-shell.component.ts rename to src/app/@site-modules/pixiv/pixiv-shell/pixiv-shell.component.ts index 05d6ceb..16707ca 100644 --- a/src/app/pixiv/pixiv-shell/pixiv-shell.component.ts +++ b/src/app/@site-modules/pixiv/pixiv-shell/pixiv-shell.component.ts @@ -1,9 +1,9 @@ import { Component, inject, OnDestroy } from '@angular/core'; import { PixivService } from '../data-access/pixiv.service'; -import { PIXIV_PATH } from '../../app-routing.module'; +import { PIXIV_PATH } from '../../../app-routing.module'; import { switchMap, of } from 'rxjs'; -import { ReadBaseComponent } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { ReadBaseComponent } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; @Component({ selector: 'app-pixiv-shell', @@ -22,7 +22,7 @@ export class PixivShellComponent extends ReadBaseComponent implements OnDestroy const path = (Base64.isBase64(pathParam)) ? Base64.fromBase64(pathParam) : pathParam; - return (this.pixiv.getComposition(path)).pipe(this.catchError(), this.tapSetTitle(), + return (this.pixiv.getComposition(path)).pipe(this.catchError(), this.tapSetMetaTags(), this.tapSaveToHistory(PIXIV_PATH, path), this.tapSaveToCurrentPlaylistItem(PIXIV_PATH, path), this.finalizeLoading()); diff --git a/src/app/pixiv/pixiv.module.ts b/src/app/@site-modules/pixiv/pixiv.module.ts similarity index 87% rename from src/app/pixiv/pixiv.module.ts rename to src/app/@site-modules/pixiv/pixiv.module.ts index bee58bd..5e3f4a9 100644 --- a/src/app/pixiv/pixiv.module.ts +++ b/src/app/@site-modules/pixiv/pixiv.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { PixivRoutingModule } from './pixiv-routing.module'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; import { PixivShellComponent } from './pixiv-shell/pixiv-shell.component'; diff --git a/src/app/read/data-access/read.service.ts b/src/app/@site-modules/read/data-access/read.service.ts similarity index 96% rename from src/app/read/data-access/read.service.ts rename to src/app/@site-modules/read/data-access/read.service.ts index 0d0af5d..dbf434d 100644 --- a/src/app/read/data-access/read.service.ts +++ b/src/app/@site-modules/read/data-access/read.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable, catchError, tap, throwError } from 'rxjs'; -import { CompositionEpisode, isCompositionEpisode } from '../../common/common-read'; +import { CompositionEpisode, isCompositionEpisode } from '../../@common-read'; @Injectable({ providedIn: 'root' diff --git a/src/app/read/read-routing.module.ts b/src/app/@site-modules/read/read-routing.module.ts similarity index 100% rename from src/app/read/read-routing.module.ts rename to src/app/@site-modules/read/read-routing.module.ts diff --git a/src/app/read/read-shell/read-shell.component.ts b/src/app/@site-modules/read/read-shell/read-shell.component.ts similarity index 89% rename from src/app/read/read-shell/read-shell.component.ts rename to src/app/@site-modules/read/read-shell/read-shell.component.ts index edfb163..147ed4f 100644 --- a/src/app/read/read-shell/read-shell.component.ts +++ b/src/app/@site-modules/read/read-shell/read-shell.component.ts @@ -1,9 +1,9 @@ import { Component, signal } from '@angular/core'; import { of, switchMap } from 'rxjs'; import { ReadService } from '../data-access/read.service'; -import { Base64 } from '../../shared/utils'; -import { ReadBaseComponent } from '../../common/common-read'; -import { READ_PATH } from '../../app-routing.module'; +import { Base64 } from '../../../shared/utils'; +import { ReadBaseComponent } from '../../@common-read'; +import { READ_PATH } from '../../../app-routing.module'; @Component({ selector: 'app-read-shell', @@ -32,7 +32,7 @@ export class ReadShellComponent extends ReadBaseComponent { return this.read.getComposition(url).pipe( this.catchError(), - this.tapSetTitle(), + this.tapSetMetaTags(), this.tapSaveToHistory(READ_PATH, id64), this.tapSaveToCurrentPlaylistItem(READ_PATH, url), diff --git a/src/app/read/read.module.ts b/src/app/@site-modules/read/read.module.ts similarity index 87% rename from src/app/read/read.module.ts rename to src/app/@site-modules/read/read.module.ts index 6cd48d1..8a7c4db 100644 --- a/src/app/read/read.module.ts +++ b/src/app/@site-modules/read/read.module.ts @@ -2,7 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ReadShellComponent } from './read-shell/read-shell.component'; import { ReadRoutingModule } from './read-routing.module'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; diff --git a/src/app/reddit/data-access/reddit.service.ts b/src/app/@site-modules/reddit/data-access/reddit.service.ts similarity index 88% rename from src/app/reddit/data-access/reddit.service.ts rename to src/app/@site-modules/reddit/data-access/reddit.service.ts index 31a1dba..f672e6a 100644 --- a/src/app/reddit/data-access/reddit.service.ts +++ b/src/app/@site-modules/reddit/data-access/reddit.service.ts @@ -1,9 +1,9 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable, map } from 'rxjs'; -import { environment } from '../../../environments/environment'; -import { CompositionEpisode } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { environment } from '../../../../environments/environment'; +import { CompositionEpisode } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; @Injectable({ providedIn: 'root' diff --git a/src/app/reddit/reddit-routing.module.ts b/src/app/@site-modules/reddit/reddit-routing.module.ts similarity index 100% rename from src/app/reddit/reddit-routing.module.ts rename to src/app/@site-modules/reddit/reddit-routing.module.ts diff --git a/src/app/reddit/reddit-shell/reddit-shell.component.ts b/src/app/@site-modules/reddit/reddit-shell/reddit-shell.component.ts similarity index 86% rename from src/app/reddit/reddit-shell/reddit-shell.component.ts rename to src/app/@site-modules/reddit/reddit-shell/reddit-shell.component.ts index fcf196b..b1d2716 100644 --- a/src/app/reddit/reddit-shell/reddit-shell.component.ts +++ b/src/app/@site-modules/reddit/reddit-shell/reddit-shell.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; -import { Base64 } from '../../shared/utils'; +import { Base64 } from '../../../shared/utils'; import { of, switchMap } from 'rxjs'; import { RedditService } from '../data-access/reddit.service'; -import { ReadBaseComponent } from '../../common/common-read'; -import { REDDIT_PATH } from '../../app-routing.module'; +import { ReadBaseComponent } from '../../@common-read'; +import { REDDIT_PATH } from '../../../app-routing.module'; @Component({ selector: 'app-reddit-shell', @@ -29,7 +29,7 @@ export class RedditShellComponent extends ReadBaseComponent { return (this.reddit.getComposition(id)).pipe( this.catchError(), - this.tapSetTitle(), + this.tapSetMetaTags(REDDIT_PATH), this.tapSaveToHistory(REDDIT_PATH, id64), this.tapSaveToCurrentPlaylistItem(REDDIT_PATH, id), diff --git a/src/app/reddit/reddit.module.ts b/src/app/@site-modules/reddit/reddit.module.ts similarity index 87% rename from src/app/reddit/reddit.module.ts rename to src/app/@site-modules/reddit/reddit.module.ts index 82d4b80..0478cf6 100644 --- a/src/app/reddit/reddit.module.ts +++ b/src/app/@site-modules/reddit/reddit.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { RedditRoutingModule } from './reddit-routing.module'; import { RedditShellComponent } from './reddit-shell/reddit-shell.component'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; @NgModule({ diff --git a/src/app/telegraph/data-access/telegraph.service.ts b/src/app/@site-modules/telegraph/data-access/telegraph.service.ts similarity index 85% rename from src/app/telegraph/data-access/telegraph.service.ts rename to src/app/@site-modules/telegraph/data-access/telegraph.service.ts index 130d3c3..d43a63f 100644 --- a/src/app/telegraph/data-access/telegraph.service.ts +++ b/src/app/@site-modules/telegraph/data-access/telegraph.service.ts @@ -1,9 +1,9 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable, map } from 'rxjs'; -import { CompositionEpisode } from '../../common/common-read'; -import { environment } from '../../../environments/environment'; -import { Base64 } from '../../shared/utils'; +import { CompositionEpisode } from '../../@common-read'; +import { environment } from '../../../../environments/environment'; +import { Base64 } from '../../../shared/utils'; @Injectable({ providedIn: 'root' diff --git a/src/app/telegraph/telegraph-routing.module.ts b/src/app/@site-modules/telegraph/telegraph-routing.module.ts similarity index 100% rename from src/app/telegraph/telegraph-routing.module.ts rename to src/app/@site-modules/telegraph/telegraph-routing.module.ts diff --git a/src/app/telegraph/telegraph-shell/telegraph-shell.component.ts b/src/app/@site-modules/telegraph/telegraph-shell/telegraph-shell.component.ts similarity index 87% rename from src/app/telegraph/telegraph-shell/telegraph-shell.component.ts rename to src/app/@site-modules/telegraph/telegraph-shell/telegraph-shell.component.ts index fedf3b2..8e8a02e 100644 --- a/src/app/telegraph/telegraph-shell/telegraph-shell.component.ts +++ b/src/app/@site-modules/telegraph/telegraph-shell/telegraph-shell.component.ts @@ -1,9 +1,9 @@ import { Component, OnDestroy } from '@angular/core'; -import { Base64 } from '../../shared/utils'; +import { Base64 } from '../../../shared/utils'; import { of, switchMap } from 'rxjs'; import { TelegraphService } from '../data-access/telegraph.service'; -import { ReadBaseComponent } from '../../common/common-read'; -import { TELEGRAPH_PATH } from '../../app-routing.module'; +import { ReadBaseComponent } from '../../@common-read'; +import { TELEGRAPH_PATH } from '../../../app-routing.module'; @Component({ selector: 'app-telegraph-shell', @@ -27,7 +27,7 @@ export class TelegraphShellComponent extends ReadBaseComponent implements OnDest const path = (Base64.isBase64(pathParam)) ? Base64.fromBase64(pathParam) : pathParam; - return (this.telegraph.getComposition(path)).pipe(this.catchError(), this.tapSetTitle(), + return (this.telegraph.getComposition(path)).pipe(this.catchError(), this.tapSetMetaTags(TELEGRAPH_PATH), this.tapSaveToHistory(TELEGRAPH_PATH, path), this.tapSaveToCurrentPlaylistItem(TELEGRAPH_PATH, path), this.finalizeLoading()); diff --git a/src/app/telegraph/telegraph.module.ts b/src/app/@site-modules/telegraph/telegraph.module.ts similarity index 88% rename from src/app/telegraph/telegraph.module.ts rename to src/app/@site-modules/telegraph/telegraph.module.ts index 96aa9bd..ea0b591 100644 --- a/src/app/telegraph/telegraph.module.ts +++ b/src/app/@site-modules/telegraph/telegraph.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { TelegraphRoutingModule } from './telegraph-routing.module'; import { TelegraphShellComponent } from './telegraph-shell/telegraph-shell.component'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; @NgModule({ diff --git a/src/app/yandere/data-access/yandere.service.ts b/src/app/@site-modules/yandere/data-access/yandere.service.ts similarity index 88% rename from src/app/yandere/data-access/yandere.service.ts rename to src/app/@site-modules/yandere/data-access/yandere.service.ts index 3e3b08c..1ebdce3 100644 --- a/src/app/yandere/data-access/yandere.service.ts +++ b/src/app/@site-modules/yandere/data-access/yandere.service.ts @@ -1,9 +1,9 @@ import { inject, Injectable } from '@angular/core'; -import { environment } from '../../../environments/environment'; +import { environment } from '../../../../environments/environment'; import { HttpClient } from '@angular/common/http'; import { Observable, map } from 'rxjs'; -import { CompositionEpisode, CompositionPublisher } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { CompositionEpisode, CompositionPublisher } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; @Injectable({ providedIn: 'root' diff --git a/src/app/yandere/yandere-routing.module.ts b/src/app/@site-modules/yandere/yandere-routing.module.ts similarity index 100% rename from src/app/yandere/yandere-routing.module.ts rename to src/app/@site-modules/yandere/yandere-routing.module.ts diff --git a/src/app/yandere/yandere-shell/yandere-shell.component.html b/src/app/@site-modules/yandere/yandere-shell/yandere-shell.component.html similarity index 100% rename from src/app/yandere/yandere-shell/yandere-shell.component.html rename to src/app/@site-modules/yandere/yandere-shell/yandere-shell.component.html diff --git a/src/app/zenko/zenko-shell/zenko-shell.component.scss b/src/app/@site-modules/yandere/yandere-shell/yandere-shell.component.scss similarity index 100% rename from src/app/zenko/zenko-shell/zenko-shell.component.scss rename to src/app/@site-modules/yandere/yandere-shell/yandere-shell.component.scss diff --git a/src/app/yandere/yandere-shell/yandere-shell.component.ts b/src/app/@site-modules/yandere/yandere-shell/yandere-shell.component.ts similarity index 84% rename from src/app/yandere/yandere-shell/yandere-shell.component.ts rename to src/app/@site-modules/yandere/yandere-shell/yandere-shell.component.ts index 61b2699..a3c7e9a 100644 --- a/src/app/yandere/yandere-shell/yandere-shell.component.ts +++ b/src/app/@site-modules/yandere/yandere-shell/yandere-shell.component.ts @@ -1,9 +1,9 @@ import { Component, inject, OnDestroy } from '@angular/core'; import { switchMap, of } from 'rxjs'; -import { ReadBaseComponent } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { ReadBaseComponent } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; import { YandereService } from '../data-access/yandere.service'; -import { YANDERE_PATH } from '../../app-routing.module'; +import { YANDERE_PATH } from '../../../app-routing.module'; @Component({ selector: 'app-yandere-shell', @@ -22,7 +22,7 @@ export class YandereShellComponent extends ReadBaseComponent implements OnDestr const path = (Base64.isBase64(pathParam)) ? Base64.fromBase64(pathParam) : pathParam; - return (this.yandere.getComposition(path)).pipe(this.catchError(), this.tapSetTitle(), + return (this.yandere.getComposition(path)).pipe(this.catchError(), this.tapSetMetaTags(), this.tapSaveToHistory(YANDERE_PATH, path), this.tapSaveToCurrentPlaylistItem(YANDERE_PATH, path), this.finalizeLoading()); diff --git a/src/app/yandere/yandere.module.ts b/src/app/@site-modules/yandere/yandere.module.ts similarity index 87% rename from src/app/yandere/yandere.module.ts rename to src/app/@site-modules/yandere/yandere.module.ts index 11807a6..b4fe542 100644 --- a/src/app/yandere/yandere.module.ts +++ b/src/app/@site-modules/yandere/yandere.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { YandereRoutingModule } from './yandere-routing.module'; import { YandereShellComponent } from './yandere-shell/yandere-shell.component'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; @NgModule({ diff --git a/src/app/zenko/data-access/zenko.service.ts b/src/app/@site-modules/zenko/data-access/zenko.service.ts similarity index 93% rename from src/app/zenko/data-access/zenko.service.ts rename to src/app/@site-modules/zenko/data-access/zenko.service.ts index 0eae702..e680e8b 100644 --- a/src/app/zenko/data-access/zenko.service.ts +++ b/src/app/@site-modules/zenko/data-access/zenko.service.ts @@ -1,9 +1,9 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { inject, Injectable } from '@angular/core'; import { Observable, map } from 'rxjs'; -import { environment } from '../../../environments/environment'; -import { CompositionEpisode, CompositionPublisher } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { environment } from '../../../../environments/environment'; +import { CompositionEpisode, CompositionPublisher } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; @Injectable({ providedIn: 'root' diff --git a/src/app/zenko/zenko-routing.module.ts b/src/app/@site-modules/zenko/zenko-routing.module.ts similarity index 100% rename from src/app/zenko/zenko-routing.module.ts rename to src/app/@site-modules/zenko/zenko-routing.module.ts diff --git a/src/app/zenko/zenko-shell/zenko-shell.component.html b/src/app/@site-modules/zenko/zenko-shell/zenko-shell.component.html similarity index 100% rename from src/app/zenko/zenko-shell/zenko-shell.component.html rename to src/app/@site-modules/zenko/zenko-shell/zenko-shell.component.html diff --git a/src/app/@site-modules/zenko/zenko-shell/zenko-shell.component.scss b/src/app/@site-modules/zenko/zenko-shell/zenko-shell.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/zenko/zenko-shell/zenko-shell.component.ts b/src/app/@site-modules/zenko/zenko-shell/zenko-shell.component.ts similarity index 83% rename from src/app/zenko/zenko-shell/zenko-shell.component.ts rename to src/app/@site-modules/zenko/zenko-shell/zenko-shell.component.ts index 1023de5..3a01ba0 100644 --- a/src/app/zenko/zenko-shell/zenko-shell.component.ts +++ b/src/app/@site-modules/zenko/zenko-shell/zenko-shell.component.ts @@ -1,8 +1,8 @@ import { Component, inject, OnDestroy } from '@angular/core'; import { switchMap, of } from 'rxjs'; -import { ZENKO_PATH } from '../../app-routing.module'; -import { ReadBaseComponent } from '../../common/common-read'; -import { Base64 } from '../../shared/utils'; +import { ZENKO_PATH } from '../../../app-routing.module'; +import { ReadBaseComponent } from '../../@common-read'; +import { Base64 } from '../../../shared/utils'; import { ZenkoService } from '../data-access/zenko.service'; @Component({ @@ -22,7 +22,7 @@ export class ZenkoShellComponent extends ReadBaseComponent implements OnDestroy const path = (Base64.isBase64(pathParam)) ? Base64.fromBase64(pathParam) : pathParam; - return (this.zenko.getComposition(path)).pipe(this.catchError(), this.tapSetTitle(), + return (this.zenko.getComposition(path)).pipe(this.catchError(), this.tapSetMetaTags(ZENKO_PATH), this.tapSaveToHistory(ZENKO_PATH, path), this.tapSaveToCurrentPlaylistItem(ZENKO_PATH, path), this.finalizeLoading()); diff --git a/src/app/zenko/zenko.module.ts b/src/app/@site-modules/zenko/zenko.module.ts similarity index 87% rename from src/app/zenko/zenko.module.ts rename to src/app/@site-modules/zenko/zenko.module.ts index 9789ca3..6cdaa5e 100644 --- a/src/app/zenko/zenko.module.ts +++ b/src/app/@site-modules/zenko/zenko.module.ts @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common'; import { ZenkoRoutingModule } from './zenko-routing.module'; import { ZenkoShellComponent } from './zenko-shell/zenko-shell.component'; -import { CommonReadModule } from '../common/common-read'; +import { CommonReadModule } from '../@common-read'; @NgModule({ diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 9ccbf4d..03a91db 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -26,55 +26,62 @@ export const NHENTAI_PATH = `nhentai`; export const COMICK_PATH = `comick`; export const YANDERE_PATH = `yandere`; export const PIXIV_PATH = 'pixiv'; +export const BLANKARY_PATH = 'blankary'; export const FILE_PATH = 'file'; const linkParserMod: LoadChildrenCallback = () => import('./link-parser/link-parser.module').then(m => m.LinkParserModule) -const imgurMod: LoadChildrenCallback = () => import('./imgur/imgur.module').then(m => m.ImgurModule); -const mangadexMod: LoadChildrenCallback = () => import('./mangadex/mangadex.module').then(m => m.MangadexModule); -const telegraphMod = () => import('./telegraph/telegraph.module').then(m => m.TelegraphModule) -const readMod = () => import('./read/read.module').then(m => m.ReadModule); -const redditMod = () => import('./reddit/reddit.module').then(m => m.RedditModule) -const zenkoMod = () => import('./zenko/zenko.module').then(m => m.ZenkoModule) -const nhentaiMod = () => import('./nhentai/nhentai.module').then(m => m.NhentaiModule) -const comickMod = () => import('./comick/comick.module').then(m => m.ComickModule) -const yandereMod = () => import('./yandere/yandere.module').then(m => m.YandereModule) -const pixivMod = () => import('./pixiv/pixiv.module').then(m => m.PixivModule) +const imgurMod: LoadChildrenCallback = () => import('./@site-modules/imgur/imgur.module').then(m => m.ImgurModule); +const mangadexMod: LoadChildrenCallback = () => import('./@site-modules/mangadex/mangadex.module').then(m => m.MangadexModule); +const telegraphMod = () => import('./@site-modules/telegraph/telegraph.module').then(m => m.TelegraphModule) +const readMod = () => import('./@site-modules/read/read.module').then(m => m.ReadModule); +const redditMod = () => import('./@site-modules/reddit/reddit.module').then(m => m.RedditModule) +const zenkoMod = () => import('./@site-modules/zenko/zenko.module').then(m => m.ZenkoModule) +const nhentaiMod = () => import('./@site-modules/nhentai/nhentai.module').then(m => m.NhentaiModule) +const comickMod = () => import('./@site-modules/comick/comick.module').then(m => m.ComickModule) +const yandereMod = () => import('./@site-modules/yandere/yandere.module').then(m => m.YandereModule) +const pixivMod = () => import('./@site-modules/pixiv/pixiv.module').then(m => m.PixivModule) +const blankaryMod = () => import('./@site-modules/blankary/blankary.module').then(m => m.BlankaryModule) const fileMod = () => import('./file/file.module').then(m => m.FileModule) const COMPARE_OUTLET_NAME = 'right' -const moduleMap = new Map() +const siteModulesMap = new Map() + .set(BLANKARY_PATH, blankaryMod) + .set(COMICK_PATH, comickMod) .set(IMGUR_PATH, imgurMod) .set(MANGADEX_PATH, mangadexMod) + .set(NHENTAI_PATH, nhentaiMod) + .set(PIXIV_PATH, pixivMod) + .set(REDDIT_PATH, redditMod) .set(TELEGRAPH_PATH, telegraphMod) + .set(YANDERE_PATH, yandereMod) + .set(ZENKO_PATH, zenkoMod) + .set(READ_PATH, readMod) + +function getPairRoutesToCompare(map: Map) { + const routes: Routes = []; + + for (const item of map) { + routes.push( + { path: item[0], loadChildren: item[1] }, + { outlet: COMPARE_OUTLET_NAME, path: item[0], loadChildren: item[1] } + ) + } + + return routes +} const routes: Routes = [ { path: '', loadChildren: linkParserMod }, { path: LIST_PATH, loadChildren: () => import('./list/list.module').then(m => m.ListModule) }, - { path: IMGUR_PATH, loadChildren: imgurMod }, - { outlet: COMPARE_OUTLET_NAME, path: IMGUR_PATH, loadChildren: imgurMod }, - { path: MANGADEX_PATH, loadChildren: mangadexMod }, - { outlet: COMPARE_OUTLET_NAME, path: MANGADEX_PATH, loadChildren: mangadexMod }, - { path: READ_PATH, loadChildren: readMod }, - { outlet: COMPARE_OUTLET_NAME, path: READ_PATH, loadChildren: readMod }, - { path: TELEGRAPH_PATH, loadChildren: telegraphMod }, - { outlet: COMPARE_OUTLET_NAME, path: TELEGRAPH_PATH, loadChildren: telegraphMod }, - { path: REDDIT_PATH, loadChildren: redditMod }, - { outlet: COMPARE_OUTLET_NAME, path: REDDIT_PATH, loadChildren: redditMod }, - { path: ZENKO_PATH, loadChildren: zenkoMod }, - { outlet: COMPARE_OUTLET_NAME, path: ZENKO_PATH, loadChildren: zenkoMod }, - { path: NHENTAI_PATH, loadChildren: nhentaiMod }, - { outlet: COMPARE_OUTLET_NAME, path: NHENTAI_PATH, loadChildren: nhentaiMod }, - { path: COMICK_PATH, loadChildren: comickMod }, - { outlet: COMPARE_OUTLET_NAME, path: COMICK_PATH, loadChildren: comickMod }, - { path: YANDERE_PATH, loadChildren: yandereMod }, - { outlet: COMPARE_OUTLET_NAME, path: YANDERE_PATH, loadChildren: yandereMod }, - { path: PIXIV_PATH, loadChildren: pixivMod }, - { outlet: COMPARE_OUTLET_NAME, path: PIXIV_PATH, loadChildren: pixivMod }, + ...getPairRoutesToCompare(siteModulesMap), + { path: FILE_PATH, loadChildren: fileMod }, { outlet: COMPARE_OUTLET_NAME, path: FILE_PATH, loadChildren: fileMod }, + { matcher: urlMatcher, loadChildren: linkParserMod }, { outlet: COMPARE_OUTLET_NAME, matcher: urlMatcher, loadChildren: linkParserMod }, + { path: '**', component: PageNotFoundComponent } ]; diff --git a/src/app/file/pdf/pdf.component.ts b/src/app/file/pdf/pdf.component.ts index 2c279e9..8c0ff06 100644 --- a/src/app/file/pdf/pdf.component.ts +++ b/src/app/file/pdf/pdf.component.ts @@ -5,7 +5,7 @@ import { SharedModule } from '../../shared/shared.module'; import { Router } from '@angular/router'; import { getDocument, GlobalWorkerOptions, PDFPageProxy } from 'pdfjs-dist'; import { RenderParameters } from 'pdfjs-dist/types/src/display/api'; -import { CompositionEpisode } from '../../common/common-read'; +import { CompositionEpisode } from '../../@site-modules/@common-read'; GlobalWorkerOptions.workerSrc = '/assets/pdf.worker.min.mjs' diff --git a/src/app/file/zip/zip.component.ts b/src/app/file/zip/zip.component.ts index edee89b..4a421e4 100644 --- a/src/app/file/zip/zip.component.ts +++ b/src/app/file/zip/zip.component.ts @@ -2,7 +2,7 @@ import { Component, effect, inject, OnDestroy, OnInit } from '@angular/core'; import { FileService } from '../data-access/file.service'; import { SharedModule } from '../../shared/shared.module'; import { Router } from '@angular/router'; -import { CompositionEpisode, CompositionImage } from '../../common/common-read'; +import { CompositionEpisode, CompositionImage } from '../../@site-modules/@common-read'; import { DomManipulationService } from '../../shared/data-access'; import { ComicInfo } from '../../shared/utils/comic-info'; import { Acbf } from '../../shared/utils/acbf'; diff --git a/src/app/link-parser/link-parser.module.ts b/src/app/link-parser/link-parser.module.ts index 4117a8d..90cd26e 100644 --- a/src/app/link-parser/link-parser.module.ts +++ b/src/app/link-parser/link-parser.module.ts @@ -10,6 +10,7 @@ import { SettingsComponent } from './ui/settings/settings.component'; import { FooterComponent } from './ui/footer/footer.component'; import { HeaderComponent } from './ui/header/header.component'; import { HistoryModule } from '../history/history.module'; +import { ParserFormComponent } from './ui/parser-form/parser-form.component'; @NgModule({ @@ -18,7 +19,8 @@ import { HistoryModule } from '../history/history.module'; FaqComponent, SettingsComponent, FooterComponent, - HeaderComponent + HeaderComponent, + ParserFormComponent ], imports: [ CommonModule, diff --git a/src/app/link-parser/link-parser/link-parser.component.html b/src/app/link-parser/link-parser/link-parser.component.html index 6e0206b..8047e61 100644 --- a/src/app/link-parser/link-parser/link-parser.component.html +++ b/src/app/link-parser/link-parser/link-parser.component.html @@ -1,32 +1,5 @@
-
-
-

@defer{ }

-
-
- -
- @defer { } -
-
- -
-

{{lang.ph().slogan}}

- @if (linkParams()) { - - {{lang.ph().letsgo}} - - {{linkParams()?.id | truncate}} - - } -
-
- -
- {{lang.ph().createList}} -
- +