From 9e4fdd6f38853d8a4a959901ab7902569de75484 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 08:08:54 +0100 Subject: viewer: Implemented the "example" project in devServer Display loader and error messages (not translated yet) Created a "GalleryStore" to fetch the JSon data from the gallery (currently from example) --- viewer/src/@types/gallery/index.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 viewer/src/@types/gallery/index.d.ts (limited to 'viewer/src/@types/gallery') diff --git a/viewer/src/@types/gallery/index.d.ts b/viewer/src/@types/gallery/index.d.ts new file mode 100644 index 0000000..2dd11fb --- /dev/null +++ b/viewer/src/@types/gallery/index.d.ts @@ -0,0 +1,25 @@ +declare namespace Gallery { + interface Item { + title: string, + date: string, + description: string, + tags: string[], + path: string, + thumbnail: { + path: string, + }, + properties: Image | Directory, + } + interface Image { + type: "image", + filesize: number, + resolution: { + width: number, + height: number, + } + } + interface Directory { + type: "directory", + items: Item[] + } +} \ No newline at end of file -- cgit v1.2.3 From c2b4c5d144db17ebf2dc9de32ba25cc836831ae2 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 21:15:59 +0100 Subject: viewer: Improved the Gallery type definitions. Basic display of the images and thumbnails example: "thumbnails" instead of "thumbs" --- viewer/src/@types/gallery/index.d.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'viewer/src/@types/gallery') diff --git a/viewer/src/@types/gallery/index.d.ts b/viewer/src/@types/gallery/index.d.ts index 2dd11fb..b47c812 100644 --- a/viewer/src/@types/gallery/index.d.ts +++ b/viewer/src/@types/gallery/index.d.ts @@ -1,4 +1,10 @@ declare namespace Gallery { + interface Image extends Item { + properties: ImageProperties, + } + interface Directory extends Item { + properties: DirectoryProperties, + } interface Item { title: string, date: string, @@ -8,9 +14,9 @@ declare namespace Gallery { thumbnail: { path: string, }, - properties: Image | Directory, + properties: ImageProperties | DirectoryProperties, } - interface Image { + interface ImageProperties { type: "image", filesize: number, resolution: { @@ -18,7 +24,7 @@ declare namespace Gallery { height: number, } } - interface Directory { + interface DirectoryProperties { type: "directory", items: Item[] } -- cgit v1.2.3 From a681accaa7617892bb7c53248aa9030a4eb47f50 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 28 Dec 2019 04:52:30 +0100 Subject: viewer: Tag propositions. Disabled directory indexation. Note: The propositions are not based on the current search results, but on the searched tags, which doesn't seem to be the correct way. We'll probably have to move the search results to a store for global visibility. --- viewer/src/@types/gallery/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'viewer/src/@types/gallery') diff --git a/viewer/src/@types/gallery/index.d.ts b/viewer/src/@types/gallery/index.d.ts index b47c812..310c865 100644 --- a/viewer/src/@types/gallery/index.d.ts +++ b/viewer/src/@types/gallery/index.d.ts @@ -9,7 +9,7 @@ declare namespace Gallery { title: string, date: string, description: string, - tags: string[], + tags: RawTag[], path: string, thumbnail: { path: string, @@ -28,4 +28,5 @@ declare namespace Gallery { type: "directory", items: Item[] } + type RawTag = string; } \ No newline at end of file -- cgit v1.2.3 From 89bcb2dbe5b5e6eb8e8ba13ceecee2770dfe4cd4 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 9 Jan 2020 02:10:35 +0100 Subject: viewer: Changed "image" type to "picture". Adapted the code to the current compiler output format. The currentItem and currentPath are calculated in the store for easier multi-component access. Breadcrumb for current's position and navigation. --- viewer/src/@types/gallery/index.d.ts | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'viewer/src/@types/gallery') diff --git a/viewer/src/@types/gallery/index.d.ts b/viewer/src/@types/gallery/index.d.ts index 310c865..97cc207 100644 --- a/viewer/src/@types/gallery/index.d.ts +++ b/viewer/src/@types/gallery/index.d.ts @@ -1,28 +1,22 @@ declare namespace Gallery { - interface Image extends Item { - properties: ImageProperties, + interface Picture extends Item { + properties: PictureProperties, } interface Directory extends Item { properties: DirectoryProperties, } interface Item { title: string, - date: string, + datetime: string, description: string, tags: RawTag[], path: string, - thumbnail: { - path: string, - }, - properties: ImageProperties | DirectoryProperties, + thumbnail?: string, + properties: PictureProperties | DirectoryProperties, } - interface ImageProperties { - type: "image", - filesize: number, - resolution: { - width: number, - height: number, - } + interface PictureProperties { + type: "picture", + resource: string, } interface DirectoryProperties { type: "directory", -- cgit v1.2.3 From 27b51018525dbb7a6edb3073819d82245387ddd3 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 10 Jan 2020 22:22:22 +0100 Subject: viewer: license headers --- viewer/src/@types/gallery/index.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'viewer/src/@types/gallery') diff --git a/viewer/src/@types/gallery/index.d.ts b/viewer/src/@types/gallery/index.d.ts index 97cc207..25407e8 100644 --- a/viewer/src/@types/gallery/index.d.ts +++ b/viewer/src/@types/gallery/index.d.ts @@ -1,3 +1,22 @@ +/* ldgallery - A static generator which turns a collection of tagged +-- pictures into a searchable web gallery. +-- +-- Copyright (C) 2019-2020 Guillaume FOUET +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . +*/ + declare namespace Gallery { interface Picture extends Item { properties: PictureProperties, -- cgit v1.2.3