aboutsummaryrefslogtreecommitdiff
path: root/viewer
diff options
context:
space:
mode:
authorzeroinformatique2021-07-03 00:48:53 +0200
committerGitHub2021-07-03 00:48:53 +0200
commitb6605e2c4ee73ac8b994624098344db5e44ac07d (patch)
tree5ed06cc5ecdabe070f6fdb9bc4f9a8a3b435cbe6 /viewer
parent08ac32103fb5f8cca1861267dfd07a7c0d2faf62 (diff)
parent1f0377c1b4c2959c73fe4e368673f057ef369917 (diff)
downloadldgallery-b6605e2c4ee73ac8b994624098344db5e44ac07d.tar.gz
Merge pull request #302 from ldgallery/oz-types-normalization
viewer: types normalization
Diffstat (limited to 'viewer')
-rw-r--r--viewer/src/@types/ItemType.ts19
-rw-r--r--viewer/src/@types/gallery.d.ts183
-rw-r--r--viewer/src/@types/scrollposition.d.ts2
-rw-r--r--viewer/src/@types/tag.d.ts40
-rw-r--r--viewer/src/components/LdBreadcrumb.vue7
-rw-r--r--viewer/src/components/LdCommand.vue5
-rw-r--r--viewer/src/components/LdCommandSort.vue2
-rw-r--r--viewer/src/components/LdGallery.vue6
-rw-r--r--viewer/src/components/LdInformation.vue5
-rw-r--r--viewer/src/components/LdKeyPress.vue2
-rw-r--r--viewer/src/components/LdProposition.vue16
-rw-r--r--viewer/src/components/LdTagInput.vue15
-rw-r--r--viewer/src/components/LdThumbnail.vue5
-rw-r--r--viewer/src/components/LdTitle.vue5
-rw-r--r--viewer/src/components/item_handlers/LdAudioViewer.vue5
-rw-r--r--viewer/src/components/item_handlers/LdDirectoryViewer.vue (renamed from viewer/src/components/item_handlers/LdDirectory.vue)7
-rw-r--r--viewer/src/components/item_handlers/LdDownloadViewer.vue (renamed from viewer/src/components/item_handlers/LdDownload.vue)7
-rw-r--r--viewer/src/components/item_handlers/LdPdfViewer.vue3
-rw-r--r--viewer/src/components/item_handlers/LdPictureViewer.vue (renamed from viewer/src/components/item_handlers/LdPicture.vue)9
-rw-r--r--viewer/src/components/item_handlers/LdPlainTextViewer.vue3
-rw-r--r--viewer/src/components/item_handlers/LdVideoViewer.vue3
-rw-r--r--viewer/src/main.ts4
-rw-r--r--viewer/src/services/indexfactory.ts32
-rw-r--r--viewer/src/services/indexsearch.ts24
-rw-r--r--viewer/src/services/itemComparators.ts13
-rw-r--r--viewer/src/services/ldzoom.ts7
-rw-r--r--viewer/src/services/navigation.ts15
-rw-r--r--viewer/src/store/galleryStore.ts28
-rw-r--r--viewer/src/store/index.ts7
-rw-r--r--viewer/src/store/uiStore.ts5
-rw-r--r--viewer/src/views/GalleryNavigation.vue8
-rw-r--r--viewer/src/views/GallerySearch.vue3
-rw-r--r--viewer/src/views/MainLayout.vue5
-rw-r--r--viewer/src/views/PanelLeft.vue8
34 files changed, 274 insertions, 234 deletions
diff --git a/viewer/src/@types/ItemType.ts b/viewer/src/@types/ItemType.ts
index 31a395b..9974d4e 100644
--- a/viewer/src/@types/ItemType.ts
+++ b/viewer/src/@types/ItemType.ts
@@ -1,4 +1,21 @@
1// TODO: Convert all ambiant types related to LdGallery to modules 1/* ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery.
3--
4-- Copyright (C) 2019-2021 Guillaume FOUET
5--
6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as
8-- published by the Free Software Foundation, either version 3 of the
9-- License, or (at your option) any later version.
10--
11-- This program is distributed in the hope that it will be useful,
12-- but WITHOUT ANY WARRANTY; without even the implied warranty of
13-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-- GNU Affero General Public License for more details.
15--
16-- You should have received a copy of the GNU Affero General Public License
17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/
2 19
3export enum ItemType { 20export enum ItemType {
4 OTHER = "other", 21 OTHER = "other",
diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts
index e9b80e6..d9e7534 100644
--- a/viewer/src/@types/gallery.d.ts
+++ b/viewer/src/@types/gallery.d.ts
@@ -17,98 +17,99 @@
17-- along with this program. If not, see <https://www.gnu.org/licenses/>. 17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/ 18*/
19 19
20declare namespace Gallery { 20import { ItemType } from "./ItemType";
21 type ItemSortStr = "title_asc" | "date_asc" | "date_desc";
22 21
23 interface Config { 22export type ItemSortStr = "title_asc" | "date_asc" | "date_desc";
24 galleryRoot: string;
25 galleryIndex?: string;
26 initialItemSort?: ItemSortStr;
27 initialTagDisplayLimit?: number;
28 }
29 23
30 interface GalleryProperties { 24export interface Config {
31 galleryTitle: string; 25 galleryRoot: string;
32 tagCategories: RawTag[]; 26 galleryIndex?: string;
33 } 27 initialItemSort?: ItemSortStr;
34 interface Index { 28 initialTagDisplayLimit?: number;
35 properties: GalleryProperties; 29}
36 tree: Directory; 30
37 } 31export interface Properties {
32 galleryTitle: string;
33 tagCategories: RawTag[];
34}
35export interface Index {
36 properties: Properties;
37 tree: DirectoryItem;
38}
39
40export interface OtherItem extends Item {
41 properties: OtherProperties;
42}
43export interface PictureItem extends Item {
44 properties: PictureProperties;
45}
46export interface PlainTextItem extends Item {
47 properties: PlainTextProperties;
48}
49export interface PDFItem extends Item {
50 properties: PDFProperties;
51}
52export interface VideoItem extends Item {
53 properties: VideoProperties;
54}
55export interface AudioItem extends Item {
56 properties: AudioProperties;
57}
58export interface DirectoryItem extends Item {
59 properties: DirectoryProperties;
60}
61export interface Item {
62 title: string;
63 datetime: string;
64 description: string;
65 tags: RawTag[];
66 path: string;
67 thumbnail?: Thumbnail;
68 properties:
69 | OtherProperties
70 | PictureProperties
71 | PlainTextProperties
72 | PDFProperties
73 | VideoProperties
74 | AudioProperties
75 | DirectoryProperties;
76}
77export interface Resolution {
78 width: number;
79 height: number;
80}
81export interface OtherProperties {
82 type: ItemType.OTHER;
83 resource: string;
84}
85export interface PictureProperties {
86 type: ItemType.PICTURE;
87 resource: string;
88 resolution: Resolution;
89}
90export interface PlainTextProperties {
91 type: ItemType.PLAINTEXT;
92 resource: string;
93}
94export interface PDFProperties {
95 type: ItemType.PDF;
96 resource: string;
97}
98export interface VideoProperties {
99 type: ItemType.VIDEO;
100 resource: string;
101}
102export interface AudioProperties {
103 type: ItemType.AUDIO;
104 resource: string;
105}
106export interface DirectoryProperties {
107 type: ItemType.DIRECTORY;
108 items: Item[];
109}
38 110
39 interface Other extends Item { 111export interface Thumbnail {
40 properties: OtherProperties; 112 resource: string;
41 } 113 resolution: Resolution;
42 interface Picture extends Item {
43 properties: PictureProperties;
44 }
45 interface PlainText extends Item {
46 properties: PlainTextProperties;
47 }
48 interface PDF extends Item {
49 properties: PDFProperties;
50 }
51 interface Video extends Item {
52 properties: VideoProperties;
53 }
54 interface Audio extends Item {
55 properties: AudioProperties;
56 }
57 interface Directory extends Item {
58 properties: DirectoryProperties;
59 }
60 interface Item {
61 title: string;
62 datetime: string;
63 description: string;
64 tags: RawTag[];
65 path: string;
66 thumbnail?: Thumbnail;
67 properties:
68 | OtherProperties
69 | PictureProperties
70 | PlainTextProperties
71 | PDFProperties
72 | VideoProperties
73 | AudioProperties
74 | DirectoryProperties;
75 }
76 interface Resolution {
77 width: number;