From 6b6c1145ab8e4e6894eb54b1c98fb4b02e0d17b3 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 17 Oct 2020 20:54:18 +0200 Subject: viewer: set pointer cursor on collapsible info panel title bar GitHub: closes #269 --- viewer/src/views/PanelLeft.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'viewer/src/views') diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue index 0ab3aa8..d2a3656 100644 --- a/viewer/src/views/PanelLeft.vue +++ b/viewer/src/views/PanelLeft.vue @@ -37,7 +37,7 @@ :current-tags="currentTags" /> -

+

{{ $t("panelLeft.information.title") }}

@@ -108,6 +108,10 @@ export default class PanelLeft extends Vue { margin-top: 2px; // Fixes a vertical centering issue with the carret } } + + .infoPanelTitleBar { + cursor: pointer; + } } .flexShrinkFully { -- cgit v1.2.3 From 5e179a35b23282c4613582755de06a91f6991309 Mon Sep 17 00:00:00 2001 From: zeroinformatique Date: Sun, 18 Oct 2020 00:22:04 +0200 Subject: viewer: accessibility: set focus on the main area (#273) github: resolves #177--- viewer/src/views/MainLayout.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'viewer/src/views') diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index 6ef9a3b..9cd518b 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue @@ -22,7 +22,7 @@ - + @@ -43,6 +43,10 @@ export default class MainLayout extends Vue { isLoading: boolean = true; scrollPositions: ScrollPosition = {}; + get contentDiv() { + return this.content.$el as HTMLDivElement; + } + mounted() { history.replaceState({ ldgallery: "ENTRYPOINT" }, ""); this.fetchGalleryItems(); @@ -53,11 +57,15 @@ export default class MainLayout extends Vue { document.body.removeEventListener("fullscreenchange", this.onFullscreenChange); } + moveFocusToContentDiv() { + setTimeout(() => this.contentDiv.focus()); + } + @Watch("$route") routeChanged(newRoute: Route, oldRoute: Route) { - const el = this.content.$el; - this.scrollPositions[oldRoute.path] = el.scrollTop; - this.$nextTick(() => (el.scrollTop = this.scrollPositions[newRoute.path])); + this.scrollPositions[oldRoute.path] = this.contentDiv.scrollTop; + this.$nextTick(() => (this.contentDiv.scrollTop = this.scrollPositions[newRoute.path])); + this.moveFocusToContentDiv(); } fetchGalleryItems() { @@ -66,6 +74,7 @@ export default class MainLayout extends Vue { .fetchConfig() .then(this.$uiStore.initFromConfig) .then(this.$galleryStore.fetchGalleryItems) + .then(this.moveFocusToContentDiv) .finally(() => (this.isLoading = false)) .catch(this.displayError); } @@ -130,6 +139,9 @@ html { left: var(--layout-left); z-index: 3; overflow-x: hidden; + &:focus { + outline: none; + } } } .fullscreen { -- cgit v1.2.3 From 7bd88b9d462903ae7753b9ef7a3613ebcd9bad45 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 25 Jun 2021 12:09:30 +0200 Subject: viewer/GalleryNavigation: uniquely identify viewer instances by item This forces viewer components to be re-instantiated on item change. GitHub: fixes #268 --- viewer/src/views/GalleryNavigation.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'viewer/src/views') diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue index fd1f19a..c53df66 100644 --- a/viewer/src/views/GalleryNavigation.vue +++ b/viewer/src/views/GalleryNavigation.vue @@ -21,7 +21,7 @@
- +
-- cgit v1.2.3 From 6b125a393d8ce10bfd9273c24ea1615b335abeba Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 26 Jun 2021 17:44:03 +0200 Subject: viewer/GalleryNavigation: uniquely identify viewer instances by item Fixed error "Object is possibly 'null'" in the template --- viewer/src/views/GalleryNavigation.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'viewer/src/views') diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue index c53df66..69198f6 100644 --- a/viewer/src/views/GalleryNavigation.vue +++ b/viewer/src/views/GalleryNavigation.vue @@ -21,7 +21,7 @@
- +
@@ -66,6 +66,10 @@ export default class GalleryNavigation extends Vue { return this.COMPONENT_BY_TYPE[this.$galleryStore.currentItem?.properties.type ?? ItemType.OTHER]; } + get componentKey() { + return this.$galleryStore.currentItem?.path ?? ""; + } + @Watch("path") pathChanged() { this.$galleryStore.setCurrentPath(this.path); -- cgit v1.2.3 From 9165cc1efcf7791f78b61b2c51a9de651b1b09aa Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 2 Jul 2021 22:53:16 +0200 Subject: viewer: types normalization - gallery.d.ts GitHub: closes #301 --- viewer/src/views/GalleryNavigation.vue | 8 ++++---- viewer/src/views/GallerySearch.vue | 3 +-- viewer/src/views/MainLayout.vue | 4 ++-- viewer/src/views/PanelLeft.vue | 5 ++--- 4 files changed, 9 insertions(+), 11 deletions(-) (limited to 'viewer/src/views') diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue index 69198f6..8bb225a 100644 --- a/viewer/src/views/GalleryNavigation.vue +++ b/viewer/src/views/GalleryNavigation.vue @@ -26,10 +26,10 @@ -- cgit v1.2.3 From cddf5d5c42795388dbd9058268160f1e867d64f5 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 3 Jul 2021 05:06:44 +0200 Subject: viewer: use CSS module (MainLayout) Extracted from 0f4a1d1 (GH PR #304). --- viewer/src/views/MainLayout.vue | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'viewer/src/views') diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index eee813f..c54f183 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue @@ -18,11 +18,17 @@ --> @@ -40,18 +39,32 @@ import { Component, Ref, Vue, Watch } from "vue-property-decorator"; import { Route } from "vue-router"; import PanelLeft from "./PanelLeft.vue"; import PanelTop from "./PanelTop.vue"; +import SplashScreen from "./SplashScreen.vue"; @Component({ - components: { PanelLeft, PanelTop }, + components: { + PanelLeft, + PanelTop, + SplashScreen, + }, }) export default class MainLayout extends Vue { - @Ref() readonly content!: Vue; + @Ref() readonly content?: Vue; isLoading: boolean = true; scrollPositions: ScrollPosition = {}; - get contentDiv() { - return this.content.$el as HTMLDivElement; + get contentDiv(): HTMLDivElement | null { + return (this.content?.$el as HTMLDivElement) ?? null; + } + + get isReady(): boolean { + return ( + !this.$uiStore.splashScreenEnabled && + !this.isLoading && + this.$galleryStore.config !== null && + this.$galleryStore.currentPath !== null + ); } mounted() { @@ -65,13 +78,14 @@ export default class MainLayout extends Vue { } moveFocusToContentDiv() { - setTimeout(() => this.contentDiv.focus()); + setTimeout(() => this.contentDiv?.focus()); } @Watch("$route") routeChanged(newRoute: Route, oldRoute: Route) { + if (!this.contentDiv) return; this.scrollPositions[oldRoute.path] = this.contentDiv.scrollTop; - this.$nextTick(() => (this.contentDiv.scrollTop = this.scrollPositions[newRoute.path])); + this.$nextTick(() => (this.contentDiv!.scrollTop = this.scrollPositions[newRoute.path])); this.moveFocusToContentDiv(); } @@ -86,14 +100,10 @@ export default class MainLayout extends Vue { .catch(this.displayError); } - get isReady() { - return !this.isLoading && this.$galleryStore.config && this.$galleryStore.currentPath !== null; - } - displayError(reason: any) { this.$buefy.snackbar.open({ message: `${reason}`, - actionText: "Retry", + actionText: this.$t("snack.retry"), position: "is-top", type: "is-danger", indefinite: true, diff --git a/viewer/src/views/SplashScreen.vue b/viewer/src/views/SplashScreen.vue new file mode 100644 index 0000000..808567e --- /dev/null +++ b/viewer/src/views/SplashScreen.vue @@ -0,0 +1,72 @@ + + + + + -- cgit v1.2.3 From c28b29b12810548a5927a02ca80714fcce24a61b Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 4 Jul 2021 18:37:46 +0200 Subject: viewer/SplashScreen: remove useless style class --- viewer/src/views/SplashScreen.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'viewer/src/views') diff --git a/viewer/src/views/SplashScreen.vue b/viewer/src/views/SplashScreen.vue index 808567e..a2f499a 100644 --- a/viewer/src/views/SplashScreen.vue +++ b/viewer/src/views/SplashScreen.vue @@ -2,7 +2,7 @@
- +
@@ -65,8 +65,4 @@ export default class SplashScreen extends Vue { align-items: center; padding: 32px; } -.buttonAcknowledge { - min-width: 310px; - align-self: center; -} -- cgit v1.2.3 From c83f44cd69a227f873a026c01653ef434b6ae045 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Mon, 5 Jul 2021 19:10:20 +0200 Subject: viewer: viewer: optional user-defined markdown splash screen Code review changes --- viewer/src/views/SplashScreen.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'viewer/src/views') diff --git a/viewer/src/views/SplashScreen.vue b/viewer/src/views/SplashScreen.vue index a2f499a..dcb845d 100644 --- a/viewer/src/views/SplashScreen.vue +++ b/viewer/src/views/SplashScreen.vue @@ -31,7 +31,7 @@ export default class SplashScreen extends Vue { } fetchMarkdown() { - FetchWithCheck.get(`${process.env.VUE_APP_DATA_URL}${this.config.resource}?${this.config.dontshowagainUID ?? ""}`) + FetchWithCheck.get(`${process.env.VUE_APP_DATA_URL}${this.config.resource}?${this.config.acknowledgmentKey ?? ""}`) .then(response => response.text()) .then(text => (this.markdown = text)) .finally(() => (this.isLoading = false)) -- cgit v1.2.3 From 2f9e51b5cd7dfafadac90ec896edd365da12a1c8 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 3 Jul 2021 23:07:09 +0200 Subject: viewer: add markdown item handler Extracted from b170f49 (GH PR #304) --- viewer/src/views/GalleryNavigation.vue | 1 + 1 file changed, 1 insertion(+) (limited to 'viewer/src/views') diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue index fdd3922..200637e 100644 --- a/viewer/src/views/GalleryNavigation.vue +++ b/viewer/src/views/GalleryNavigation.vue @@ -44,6 +44,7 @@ export default class GalleryNavigation extends Vue { directory: "ld-directory-viewer", picture: "ld-picture-viewer", plaintext: "ld-plain-text-viewer", + markdown: "ld-markdown-viewer", pdf: "ld-pdf-viewer", video: "ld-video-viewer", audio: "ld-audio-viewer", -- cgit v1.2.3 From 581029f1b15b51f90812a47b20bce454014da32a Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Tue, 12 Apr 2022 21:35:24 +0200 Subject: viewer: add markdown item handler Minor CSS fixes Comment for future upgrade to Vue3 --- viewer/src/views/SplashScreen.vue | 1 + 1 file changed, 1 insertion(+) (limited to 'viewer/src/views') diff --git a/viewer/src/views/SplashScreen.vue b/viewer/src/views/SplashScreen.vue index dcb845d..93d84a1 100644 --- a/viewer/src/views/SplashScreen.vue +++ b/viewer/src/views/SplashScreen.vue @@ -30,6 +30,7 @@ export default class SplashScreen extends Vue { this.fetchMarkdown(); } + // TODO: Identical to LdMarkdownViewer.vue, use composition with Vue3. fetchMarkdown() { FetchWithCheck.get(`${process.env.VUE_APP_DATA_URL}${this.config.resource}?${this.config.acknowledgmentKey ?? ""}`) .then(response => response.text()) -- cgit v1.2.3 From 00510820a2794efcadbc83f7f8b54318fe198ecb Mon Sep 17 00:00:00 2001 From: Zéro~Informatique Date: Tue, 26 Jul 2022 08:44:34 +0200 Subject: 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 --- viewer/src/views/GalleryNavigation.vue | 106 ++++++----- viewer/src/views/GallerySearch.vue | 60 +++--- viewer/src/views/GalleryTiles.vue | 70 +++++++ viewer/src/views/ItemThumbnail.vue | 99 ++++++++++ viewer/src/views/MainLayout.vue | 173 +++++++---------- viewer/src/views/PanelLeft.vue | 120 ------------ viewer/src/views/PanelTop.vue | 32 ---- viewer/src/views/SplashScreen.vue | 106 ++++++----- viewer/src/views/item_handlers/AudioViewer.vue | 65 +++++++ viewer/src/views/item_handlers/DirectoryViewer.vue | 42 +++++ viewer/src/views/item_handlers/DownloadViewer.vue | 66 +++++++ viewer/src/views/item_handlers/MarkdownViewer.vue | 50 +++++ viewer/src/views/item_handlers/PdfViewer.vue | 48 +++++ viewer/src/views/item_handlers/PictureViewer.vue | 129 +++++++++++++ viewer/src/views/item_handlers/PlainTextViewer.vue | 69 +++++++ viewer/src/views/item_handlers/VideoViewer.vue | 47 +++++ .../src/views/layout/left/LayoutCommandSearch.vue | 64 +++++++ viewer/src/views/layout/left/LayoutInformation.vue | 99 ++++++++++ viewer/src/views/layout/left/LayoutLeft.vue | 158 ++++++++++++++++ viewer/src/views/layout/left/LayoutProposition.vue | 208 +++++++++++++++++++++ viewer/src/views/layout/left/LayoutTagInput.vue | 164 ++++++++++++++++ viewer/src/views/layout/left/LayoutTagList.vue | 74 ++++++++ viewer/src/views/layout/top/LayoutBreadcrumb.vue | 130 +++++++++++++ viewer/src/views/layout/top/LayoutCommand.vue | 127 +++++++++++++ viewer/src/views/layout/top/LayoutCommandSort.vue | 117 ++++++++++++ viewer/src/views/layout/top/LayoutTop.vue | 38 ++++ 26 files changed, 2071 insertions(+), 390 deletions(-) create mode 100644 viewer/src/views/GalleryTiles.vue create mode 100644 viewer/src/views/ItemThumbnail.vue delete mode 100644 viewer/src/views/PanelLeft.vue delete mode 100644 viewer/src/views/PanelTop.vue create mode 100644 viewer/src/views/item_handlers/AudioViewer.vue create mode 100644 viewer/src/views/item_handlers/DirectoryViewer.vue create mode 100644 viewer/src/views/item_handlers/DownloadViewer.vue create mode 100644 viewer/src/views/item_handlers/MarkdownViewer.vue create mode 100644 viewer/src/views/item_handlers/PdfViewer.vue create mode 100644 viewer/src/views/item_handlers/PictureViewer.vue create mode 100644 viewer/src/views/item_handlers/PlainTextViewer.vue create mode 100644 viewer/src/views/item_handlers/VideoViewer.vue create mode 100644 viewer/src/views/layout/left/LayoutCommandSearch.vue create mode 100644 viewer/src/views/layout/left/LayoutInformation.vue create mode 100644 viewer/src/views/layout/left/LayoutLeft.vue create mode 100644 viewer/src/views/layout/left/LayoutProposition.vue create mode 100644 viewer/src/views/layout/left/LayoutTagInput.vue create mode 100644 viewer/src/views/layout/left/LayoutTagList.vue create mode 100644 viewer/src/views/layout/top/LayoutBreadcrumb.vue create mode 100644 viewer/src/views/layout/top/LayoutCommand.vue create mode 100644 viewer/src/views/layout/top/LayoutCommandSort.vue create mode 100644 viewer/src/views/layout/top/LayoutTop.vue (limited to 'viewer/src/views') diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue index 200637e..0869aaf 100644 --- a/viewer/src/views/GalleryNavigation.vue +++ b/viewer/src/views/GalleryNavigation.vue @@ -1,7 +1,7 @@ - diff --git a/viewer/src/views/GalleryTiles.vue b/viewer/src/views/GalleryTiles.vue new file mode 100644 index 0000000..96d69da --- /dev/null +++ b/viewer/src/views/GalleryTiles.vue @@ -0,0 +1,70 @@ + + + + + + + diff --git a/viewer/src/views/ItemThumbnail.vue b/viewer/src/views/ItemThumbnail.vue new file mode 100644 index 0000000..1c9e206 --- /dev/null +++ b/viewer/src/views/ItemThumbnail.vue @@ -0,0 +1,99 @@ + + + + + + + diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index 2347ba7..9c84116 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue @@ -1,7 +1,7 @@ - diff --git a/viewer/src/views/PanelTop.vue b/viewer/src/views/PanelTop.vue deleted file mode 100644 index 4e92f07..0000000 --- a/viewer/src/views/PanelTop.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - - - diff --git a/viewer/src/views/SplashScreen.vue b/viewer/src/views/SplashScreen.vue index 93d84a1..c6c2d09 100644 --- a/viewer/src/views/SplashScreen.vue +++ b/viewer/src/views/SplashScreen.vue @@ -1,62 +1,63 @@ + + - diff --git a/viewer/src/views/item_handlers/AudioViewer.vue b/viewer/src/views/item_handlers/AudioViewer.vue new file mode 100644 index 0000000..da9579f --- /dev/null +++ b/viewer/src/views/item_handlers/AudioViewer.vue @@ -0,0 +1,65 @@ + + + + + + + diff --git a/viewer/src/views/item_handlers/DirectoryViewer.vue b/viewer/src/views/item_handlers/DirectoryViewer.vue new file mode 100644 index 0000000..9b52fa8 --- /dev/null +++ b/viewer/src/views/item_handlers/DirectoryViewer.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/viewer/src/views/item_handlers/DownloadViewer.vue b/viewer/src/views/item_handlers/DownloadViewer.vue new file mode 100644 index 0000000..6562bee --- /dev/null +++ b/viewer/src/views/item_handlers/DownloadViewer.vue @@ -0,0 +1,66 @@ +