aboutsummaryrefslogtreecommitdiff
path: root/viewer/src
diff options
context:
space:
mode:
authorZéro~Informatique2022-07-26 08:44:34 +0200
committerpacien2022-09-03 01:30:42 +0200
commit00510820a2794efcadbc83f7f8b54318fe198ecb (patch)
treea894d99c22a601197869c7a6928d40bb4ae2c392 /viewer/src
parent88aa098c07e067f9f737fbeba1f52a9bd5042e53 (diff)
downloadldgallery-00510820a2794efcadbc83f7f8b54318fe198ecb.tar.gz
viewer: migrate to vue 3, general refactoring and cleanup
Non-exhaustive list of fixes and improvements done at the same time: - html default background to grey (avoids white flash during init) - unified links behavior - added more theme variables - removed the flex-expand transition (it wasn't working) and replaced it with a slide - fixed LdLoading not centered on the content - title on removable tags - fixed an issue with encoded URI from vue-router - unified Item resource URLs - removed the iframe for PlainTextViewer (it wasn't working properly) and replaced it with a pre - fixed clear and search buttons tabindex - fixed the information panel bumping up during the fade animation of tag's dropdown - fixed some focus outlines not appearing correctly - moved CSS variables to the :root context - Code cleaning GitHub: closes #217 GitHub: closes #300 GitHub: closes #297 GitHub: closes #105 GitHub: closes #267 GitHub: closes #275 GitHub: closes #228 GitHub: closes #215 GitHub: closes #112
Diffstat (limited to 'viewer/src')
-rw-r--r--viewer/src/@types/gallery.ts (renamed from viewer/src/@types/gallery.d.ts)134
-rw-r--r--viewer/src/@types/itemType.ts (renamed from viewer/src/@types/ItemType.ts)16
-rw-r--r--viewer/src/@types/operation.ts (renamed from viewer/src/@types/Operation.ts)8
-rw-r--r--viewer/src/@types/scrollposition.d.ts20
-rw-r--r--viewer/src/@types/splashscreen.ts (renamed from viewer/src/@types/splashscreen.d.ts)2
-rw-r--r--viewer/src/@types/tag.ts (renamed from viewer/src/@types/tag.d.ts)5
-rw-r--r--viewer/src/@types/v-lazy-image.d.ts20
-rw-r--r--viewer/src/@types/vue-dragscroll.d.ts20
-rw-r--r--viewer/src/assets/scss/_buefy_variables.scss171
-rw-r--r--viewer/src/assets/scss/buefy.scss47
-rw-r--r--viewer/src/assets/scss/constants.scss (renamed from viewer/src/assets/scss/palette.scss)24
-rw-r--r--viewer/src/assets/scss/global.scss53
-rw-r--r--viewer/src/assets/scss/scrollbar.scss2
-rw-r--r--viewer/src/assets/scss/theme.scss42
-rw-r--r--viewer/src/assets/scss/transition.scss40
-rw-r--r--viewer/src/components/LdBreadcrumb.vue129
-rw-r--r--viewer/src/components/LdCommand.vue98
-rw-r--r--viewer/src/components/LdCommandSort.vue60
-rw-r--r--viewer/src/components/LdInput.vue60
-rw-r--r--viewer/src/components/LdKeyPress.vue49
-rw-r--r--viewer/src/components/LdLink.vue75
-rw-r--r--viewer/src/components/LdLoading.vue51
-rw-r--r--viewer/src/components/LdNotice.vue (renamed from viewer/src/components/LdError.vue)39
-rw-r--r--viewer/src/components/LdProposition.vue186
-rw-r--r--viewer/src/components/LdTagInput.vue96
-rw-r--r--viewer/src/components/LdTitle.vue47
-rw-r--r--viewer/src/components/async/AsyncLdMarkdown.vue (renamed from viewer/src/components/async/Markdown.vue)24
-rw-r--r--viewer/src/components/async/index.ts24
-rw-r--r--viewer/src/components/index.ts44
-rw-r--r--viewer/src/components/item_handlers/LdMarkdownViewer.vue76
-rw-r--r--viewer/src/components/item_handlers/LdPictureViewer.vue128
-rw-r--r--viewer/src/components/item_handlers/LdPlainTextViewer.vue56
-rw-r--r--viewer/src/locales/en.json26
-rw-r--r--viewer/src/locales/en.yml44
-rw-r--r--viewer/src/main.ts65
-rw-r--r--viewer/src/plugins/asyncLib.ts3
-rw-r--r--viewer/src/plugins/devServer.js53
-rw-r--r--viewer/src/plugins/i18n.ts19
-rw-r--r--viewer/src/plugins/index.ts8
-rw-r--r--viewer/src/plugins/router.ts22
-rw-r--r--viewer/src/services/api/ldFetch.ts (renamed from viewer/src/plugins/fontawesome-icons.ts)42
-rw-r--r--viewer/src/services/dragscrollclickfix.ts51
-rw-r--r--viewer/src/services/fetchWithCheck.ts7
-rw-r--r--viewer/src/services/indexFactory.ts163
-rw-r--r--viewer/src/services/indexSearch.ts74
-rw-r--r--viewer/src/services/indexfactory.ts157
-rw-r--r--viewer/src/services/indexsearch.ts70
-rw-r--r--viewer/src/services/itemComparator.ts93
-rw-r--r--viewer/src/services/itemComparators.ts74
-rw-r--r--viewer/src/services/itemGuards.ts11
-rw-r--r--viewer/src/services/ldzoom.ts135
-rw-r--r--viewer/src/services/navigation.ts90
-rw-r--r--viewer/src/services/ui/ldFullscreen.ts (renamed from viewer/src/plugins/buefy.ts)43
-rw-r--r--viewer/src/services/ui/ldItemResourceUrl.ts15
-rw-r--r--viewer/src/services/ui/ldKeepFocus.ts (renamed from viewer/src/plugins/fontawesome.ts)23
-rw-r--r--viewer/src/services/ui/ldKeyboard.ts (renamed from viewer/src/plugins/dragscroll.ts)13
-rw-r--r--viewer/src/services/ui/ldSaveScroll.ts37
-rw-r--r--viewer/src/services/ui/ldTitle.ts (renamed from viewer/src/plugins/lazyimage.ts)19
-rw-r--r--viewer/src/services/ui/ldZoom.ts128
-rw-r--r--viewer/src/shims-tsx.d.ts13
-rw-r--r--viewer/src/shims-vue.d.ts10
-rw-r--r--viewer/src/store/galleryStore.ts201
-rw-r--r--viewer/src/store/index.ts46
-rw-r--r--viewer/src/store/uiStore.ts116
-rw-r--r--viewer/src/views/GalleryNavigation.vue106
-rw-r--r--viewer/src/views/GallerySearch.vue60
-rw-r--r--viewer/src/views/GalleryTiles.vue (renamed from viewer/src/components/LdGallery.vue)53
-rw-r--r--viewer/src/views/ItemThumbnail.vue (renamed from viewer/src/components/LdThumbnail.vue)62
-rw-r--r--viewer/src/views/MainLayout.vue173
-rw-r--r--viewer/src/views/PanelLeft.vue120
-rw-r--r--viewer/src/views/SplashScreen.vue106
-rw-r--r--viewer/src/views/item_handlers/AudioViewer.vue (renamed from viewer/src/components/item_handlers/LdAudioViewer.vue)43
-rw-r--r--viewer/src/views/item_handlers/DirectoryViewer.vue (renamed from viewer/src/components/item_handlers/LdDirectoryViewer.vue)33
-rw-r--r--viewer/src/views/item_handlers/DownloadViewer.vue (renamed from viewer/src/components/item_handlers/LdDownloadViewer.vue)42
-rw-r--r--viewer/src/views/item_handlers/MarkdownViewer.vue50
-rw-r--r--viewer/src/views/item_handlers/PdfViewer.vue (renamed from viewer/src/components/item_handlers/LdPdfViewer.vue)28
-rw-r--r--viewer/src/views/item_handlers/PictureViewer.vue129
-rw-r--r--viewer/src/views/item_handlers/PlainTextViewer.vue69
-rw-r--r--viewer/src/views/item_handlers/VideoViewer.vue (renamed from viewer/src/components/item_handlers/LdVideoViewer.vue)33
-rw-r--r--viewer/src/views/layout/left/LayoutCommandSearch.vue (renamed from viewer/src/components/LdCommandSearch.vue)54
-rw-r--r--viewer/src/views/layout/left/LayoutInformation.vue (renamed from viewer/src/components/LdInformation.vue)61
-rw-r--r--viewer/src/views/layout/left/LayoutLeft.vue158
-rw-r--r--viewer/src/views/layout/left/LayoutProposition.vue208
-rw-r--r--viewer/src/views/layout/left/LayoutTagInput.vue164
-rw-r--r--viewer/src/views/layout/left/LayoutTagList.vue74
-rw-r--r--viewer/src/views/layout/top/LayoutBreadcrumb.vue130
-rw-r--r--viewer/src/views/layout/top/LayoutCommand.vue127
-rw-r--r--viewer/src/views/layout/top/LayoutCommandSort.vue117
-rw-r--r--viewer/src/views/layout/top/LayoutTop.vue (renamed from viewer/src/views/PanelTop.vue)20
89 files changed, 3018 insertions, 2919 deletions
diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.ts
index 0b4cfc4..8c0f177 100644
--- a/viewer/src/@types/gallery.d.ts
+++ b/viewer/src/@types/gallery.ts
@@ -1,7 +1,7 @@
1/* ldgallery - A static generator which turns a collection of tagged 1/* ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery. 2-- pictures into a searchable web gallery.
3-- 3--
4-- Copyright (C) 2019-2020 Guillaume FOUET 4-- Copyright (C) 2019-2022 Guillaume FOUET
5-- 5--
6-- This program is free software: you can redistribute it and/or modify 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 7-- it under the terms of the GNU Affero General Public License as
@@ -17,10 +17,10 @@
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
20import { ItemType } from "./ItemType"; 20import { ItemType } from './itemType';
21import { SplashScreenConfig } from "./splashscreen"; 21import { SplashScreenConfig } from './splashscreen';
22 22
23export type ItemSortStr = "title_asc" | "date_asc" | "date_desc"; 23export type ItemSortStr = 'title_asc' | 'date_asc' | 'date_desc';
24 24
25export interface Config { 25export interface Config {
26 galleryRoot: string; 26 galleryRoot: string;
@@ -30,39 +30,54 @@ export interface Config {
30 splashScreen?: SplashScreenConfig; 30 splashScreen?: SplashScreenConfig;
31} 31}
32 32
33export interface Properties { 33// ---
34 galleryTitle: string; 34
35 tagCategories: RawTag[]; 35export interface Resolution {
36 width: number;
37 height: number;
36} 38}
37export interface Index { 39export interface Thumbnail {
38 properties: Properties; 40 resource: string;
39 tree: DirectoryItem; 41 resolution: Resolution;
40} 42}
43export type RawTag = string;
41 44
42export interface OtherItem extends Item { 45// ---
43 properties: OtherProperties; 46
47export interface Downloadable {
48 resource: string;
49 type: ItemType; // unknown
44} 50}
45export interface PictureItem extends Item { 51export interface OtherProperties extends Downloadable {
46 properties: PictureProperties; 52 type: ItemType.OTHER;
47} 53}
48export interface PlainTextItem extends Item { 54export interface PictureProperties extends Downloadable {
49 properties: PlainTextProperties; 55 type: ItemType.PICTURE;
56 resolution: Resolution;
50} 57}
51export interface