From 3db98bcc3911531b6bc8faef8a115534199d7148 Mon Sep 17 00:00:00 2001
From: Zéro~Informatique
Date: Tue, 25 Oct 2022 02:38:42 +0200
Subject: viewer: style of item description panel has changed
github: closes #327
---
viewer/src/views/layout/left/LayoutInformation.vue | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
(limited to 'viewer/src/views/layout')
diff --git a/viewer/src/views/layout/left/LayoutInformation.vue b/viewer/src/views/layout/left/LayoutInformation.vue
index 780a458..9dfb311 100644
--- a/viewer/src/views/layout/left/LayoutInformation.vue
+++ b/viewer/src/views/layout/left/LayoutInformation.vue
@@ -67,6 +67,7 @@ const formatDate = computed(() => {
.infopanel {
padding: 2px 2px 7px 7px;
overflow-wrap: break-word;
+ max-height: 50%;
.title {
font-weight: bold;
@@ -80,13 +81,6 @@ const formatDate = computed(() => {
> * {
margin-top: 5px;
}
- ul,
- ol {
- margin-left: 1em;
- }
- ul {
- list-style-type: disc;
- }
a {
color: $palette-200;
&:hover {
--
cgit v1.2.3
From ab56530d229913a3ea0585ada802f978037b9ac2 Mon Sep 17 00:00:00 2001
From: Zéro~Informatique
Date: Tue, 25 Oct 2022 03:48:50 +0200
Subject: viewer: CTRL+K to focus in search field
github: closes #328
---
viewer/src/views/layout/left/LayoutTagInput.vue | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
(limited to 'viewer/src/views/layout')
diff --git a/viewer/src/views/layout/left/LayoutTagInput.vue b/viewer/src/views/layout/left/LayoutTagInput.vue
index a37c546..9ee6f8a 100644
--- a/viewer/src/views/layout/left/LayoutTagInput.vue
+++ b/viewer/src/views/layout/left/LayoutTagInput.vue
@@ -23,7 +23,7 @@
v-model="search"
:placeholder="t('tagInput.placeholder')"
:tabindex="50"
- @focus="e => (e.target as HTMLInputElement).select()"
+ @focus="(e: FocusEvent) => (e.target as HTMLInputElement).select()"
@keypress.enter="inputEnter"
@keydown.backspace="inputBackspace"
/>
@@ -58,7 +58,8 @@ import LdDropdown from '@/components/LdDropdown.vue';
import LdInput from '@/components/LdInput.vue';
import { useIndexFactory } from '@/services/indexFactory';
import { useGalleryStore } from '@/store/galleryStore';
-import { computedEager, useElementBounding, useFocus, useVModel } from '@vueuse/core';
+import { useUiStore } from '@/store/uiStore';
+import { computedEager, onKeyStroke, useElementBounding, useFocus, useKeyModifier, useVModel } from '@vueuse/core';
import { computed, ref, StyleValue, watchEffect } from 'vue';
import { useI18n } from 'vue-i18n';
@@ -69,6 +70,7 @@ const emit = defineEmits(['update:modelValue', 'search', 'opening', 'closing']);
const model = useVModel(props, 'modelValue', emit);
const { t } = useI18n();
+const uiStore = useUiStore();
const galeryStore = useGalleryStore();
const indexFactory = useIndexFactory();
@@ -88,6 +90,16 @@ const { focused } = useFocus(input);
// ---
+const controlState = useKeyModifier('Control');
+onKeyStroke('k', e => {
+ if (!controlState.value || focused.value) return;
+ e.preventDefault();
+ uiStore.toggleFullWidth(false);
+ focused.value = true;
+});
+
+// ---
+
const filteredTags = computed(() => indexFactory.searchTags(galeryStore.tagsIndex, search.value, false)
.filter(filterAlreadyPresent)
.sort((a, b) => b.items.length - a.items.length));
--
cgit v1.2.3
From 12eb302bcc93405f81b676b1a29a9731a5fec9be Mon Sep 17 00:00:00 2001
From: pacien
Date: Sun, 30 Oct 2022 17:40:33 +0100
Subject: viewer/command: add item download button
This adds a download button which allows the user to save the current
item as a file.
This is necessary because some item viewers do not expose a download
option on their own.
The download icon appears together with the other command buttons at the
top-left corner of the screen, replacing the listing sorting menu which
is only relevant for item lists (directory and search views).
GitHub: closes #308
---
viewer/src/views/layout/top/LayoutCommand.vue | 46 ++++++++++++++++++++++++---
viewer/src/views/layout/top/LayoutTop.vue | 5 ++-
2 files changed, 46 insertions(+), 5 deletions(-)
(limited to 'viewer/src/views/layout')
diff --git a/viewer/src/views/layout/top/LayoutCommand.vue b/viewer/src/views/layout/top/LayoutCommand.vue
index 8919da3..d930fd2 100644
--- a/viewer/src/views/layout/top/LayoutCommand.vue
+++ b/viewer/src/views/layout/top/LayoutCommand.vue
@@ -2,7 +2,7 @@
-- pictures into a searchable web gallery.
--
-- Copyright (C) 2019-2022 Guillaume FOUET
--- 2020 Pacien TRAN-GIRARD
+-- 2020-2022 Pacien TRAN-GIRARD
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as
@@ -33,7 +33,24 @@
size="lg"
/>
-
+
+
+
+
+
+
, required: true },
+ item: { type: Object as PropType- , required: true },
});
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const uiStore = useUiStore();
+const galleryStore = useGalleryStore();
+const navigation = useNavigation();
+
+const isListing = computedEager(() => !props.item || isDirectory(props.item));
+const itemFileName = computed(() => navigation.getFileName(props.item));
+const itemResourceUrl = computed(() =>
+ isDownloadableItem(props.item)
+ ? galleryStore.resourceRoot + props.item.properties.resource
+ : '',
+);
const commandToggleSearchPanelIcon = computed(() => uiStore.fullWidth ? faSearch : faAngleDoubleLeft);
const isRoot = computedEager(() => props.currentItemPath.length <= 1 && !uiStore.searchMode);
diff --git a/viewer/src/views/layout/top/LayoutTop.vue b/viewer/src/views/layout/top/LayoutTop.vue
index b755c42..0362840 100644
--- a/viewer/src/views/layout/top/LayoutTop.vue
+++ b/viewer/src/views/layout/top/LayoutTop.vue
@@ -19,7 +19,10 @@
-
+
-
-
@@ -49,7 +45,11 @@
:icon="faFileDownload"
size="lg"
/>
-
+
+
import { Item } from '@/@types/gallery';
import LdLink from '@/components/LdLink.vue';
-import { useUiStore } from '@/store/uiStore';
-import { useGalleryStore } from '@/store/galleryStore';
import { useNavigation } from '@/services/navigation';
-import { isDirectory, isDownloadableItem } from '@/services/itemGuards';
+import { useItemResource } from '@/services/ui/ldItemResourceUrl';
+import { useUiStore } from '@/store/uiStore';
import {
faAngleDoubleLeft,
faArrowLeft,
+ faFileDownload,
faFolder,
faLevelUpAlt,
faSearch,
- faFileDownload,
} from '@fortawesome/free-solid-svg-icons';
import { computedEager } from '@vueuse/shared';
-import { computed, PropType } from 'vue';
+import { computed, PropType, toRef } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import LayoutCommandSort from './LayoutCommandSort.vue';
@@ -110,16 +109,8 @@ const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const uiStore = useUiStore();
-const galleryStore = useGalleryStore();
const navigation = useNavigation();
-
-const isListing = computedEager(() => !props.item || isDirectory(props.item));
-const itemFileName = computed(() => navigation.getFileName(props.item));
-const itemResourceUrl = computed(() =>
- isDownloadableItem(props.item)
- ? galleryStore.resourceRoot + props.item.properties.resource
- : '',
-);
+const { itemResourceUrl } = useItemResource(toRef(props, 'item'));
const commandToggleSearchPanelIcon = computed(() => uiStore.fullWidth ? faSearch : faAngleDoubleLeft);
const isRoot = computedEager(() => props.currentItemPath.length <= 1 && !uiStore.searchMode);
diff --git a/viewer/src/views/layout/top/LayoutTop.vue b/viewer/src/views/layout/top/LayoutTop.vue
index 0362840..02c8b7b 100644
--- a/viewer/src/views/layout/top/LayoutTop.vue
+++ b/viewer/src/views/layout/top/LayoutTop.vue
@@ -18,7 +18,10 @@
-->
-