diff options
author | pacien | 2022-11-06 20:23:11 +0100 |
---|---|---|
committer | GitHub | 2022-11-06 20:23:11 +0100 |
commit | bb3b0eae37a7214a3a4a6a1e4354e6f082adf15e (patch) | |
tree | 2e5436e819f8e93a1115a8142594ca80fd507bc1 /viewer/src/views/item_handlers | |
parent | f864eeca506331c1dee2cd3f5f0df4fe806f303a (diff) | |
parent | cfbff75f78963e3d24326f731590e78a4d719e9e (diff) | |
download | ldgallery-bb3b0eae37a7214a3a4a6a1e4354e6f082adf15e.tar.gz |
Merge pull request #347 from ldgallery/p_viewer_download_button
viewer/command: add item download button
Diffstat (limited to 'viewer/src/views/item_handlers')
-rw-r--r-- | viewer/src/views/item_handlers/AudioViewer.vue | 4 | ||||
-rw-r--r-- | viewer/src/views/item_handlers/DownloadViewer.vue | 4 | ||||
-rw-r--r-- | viewer/src/views/item_handlers/MarkdownViewer.vue | 4 | ||||
-rw-r--r-- | viewer/src/views/item_handlers/PdfViewer.vue | 4 | ||||
-rw-r--r-- | viewer/src/views/item_handlers/PictureViewer.vue | 4 | ||||
-rw-r--r-- | viewer/src/views/item_handlers/PlainTextViewer.vue | 4 | ||||
-rw-r--r-- | viewer/src/views/item_handlers/VideoViewer.vue | 4 |
7 files changed, 14 insertions, 14 deletions
diff --git a/viewer/src/views/item_handlers/AudioViewer.vue b/viewer/src/views/item_handlers/AudioViewer.vue index bbba7e5..124d132 100644 --- a/viewer/src/views/item_handlers/AudioViewer.vue +++ b/viewer/src/views/item_handlers/AudioViewer.vue | |||
@@ -43,7 +43,7 @@ | |||
43 | import { AudioItem } from '@/@types/gallery'; | 43 | import { AudioItem } from '@/@types/gallery'; |
44 | import { useNavigation } from '@/services/navigation'; | 44 | import { useNavigation } from '@/services/navigation'; |
45 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; | 45 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; |
46 | import { computed, PropType } from 'vue'; | 46 | import { computed, PropType, toRef } from 'vue'; |
47 | import { useI18n } from 'vue-i18n'; | 47 | import { useI18n } from 'vue-i18n'; |
48 | import ItemThumbnail from '../ItemThumbnail.vue'; | 48 | import ItemThumbnail from '../ItemThumbnail.vue'; |
49 | 49 | ||
@@ -54,7 +54,7 @@ const props = defineProps({ | |||
54 | const { t } = useI18n(); | 54 | const { t } = useI18n(); |
55 | const navigation = useNavigation(); | 55 | const navigation = useNavigation(); |
56 | 56 | ||
57 | const { itemResourceUrl } = useItemResource(props.item); | 57 | const { itemResourceUrl } = useItemResource(toRef(props, 'item')); |
58 | const itemFileName = computed(() => navigation.getFileName(props.item)); | 58 | const itemFileName = computed(() => navigation.getFileName(props.item)); |
59 | </script> | 59 | </script> |
60 | 60 | ||
diff --git a/viewer/src/views/item_handlers/DownloadViewer.vue b/viewer/src/views/item_handlers/DownloadViewer.vue index 6562bee..c627d3e 100644 --- a/viewer/src/views/item_handlers/DownloadViewer.vue +++ b/viewer/src/views/item_handlers/DownloadViewer.vue | |||
@@ -41,7 +41,7 @@ import { DownloadableItem } from '@/@types/gallery'; | |||
41 | import { useNavigation } from '@/services/navigation'; | 41 | import { useNavigation } from '@/services/navigation'; |
42 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; | 42 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; |
43 | import { faFileDownload } from '@fortawesome/free-solid-svg-icons'; | 43 | import { faFileDownload } from '@fortawesome/free-solid-svg-icons'; |
44 | import { computed, PropType } from 'vue'; | 44 | import { computed, PropType, toRef } from 'vue'; |
45 | import { useI18n } from 'vue-i18n'; | 45 | import { useI18n } from 'vue-i18n'; |
46 | 46 | ||
47 | const props = defineProps({ | 47 | const props = defineProps({ |
@@ -52,7 +52,7 @@ const { t } = useI18n(); | |||
52 | const navigation = useNavigation(); | 52 | const navigation = useNavigation(); |
53 | 53 | ||
54 | const itemFileName = computed(() => navigation.getFileName(props.item)); | 54 | const itemFileName = computed(() => navigation.getFileName(props.item)); |
55 | const { itemResourceUrl } = useItemResource(props.item); | 55 | const { itemResourceUrl } = useItemResource(toRef(props, 'item')); |
56 | </script> | 56 | </script> |
57 | 57 | ||
58 | <style lang="scss" module> | 58 | <style lang="scss" module> |
diff --git a/viewer/src/views/item_handlers/MarkdownViewer.vue b/viewer/src/views/item_handlers/MarkdownViewer.vue index d5ac7e2..574029f 100644 --- a/viewer/src/views/item_handlers/MarkdownViewer.vue +++ b/viewer/src/views/item_handlers/MarkdownViewer.vue | |||
@@ -33,13 +33,13 @@ import { LdMarkdown } from '@/components/async'; | |||
33 | import LdLoading from '@/components/LdLoading.vue'; | 33 | import LdLoading from '@/components/LdLoading.vue'; |
34 | import { useLdFetch } from '@/services/api/ldFetch'; | 34 | import { useLdFetch } from '@/services/api/ldFetch'; |
35 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; | 35 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; |
36 | import { PropType } from 'vue'; | 36 | import { PropType, toRef } from 'vue'; |
37 | 37 | ||
38 | const props = defineProps({ | 38 | const props = defineProps({ |
39 | item: { type: Object as PropType<MarkdownItem>, required: true }, | 39 | item: { type: Object as PropType<MarkdownItem>, required: true }, |
40 | }); | 40 | }); |
41 | 41 | ||
42 | const { itemResourceUrl } = useItemResource(props.item); | 42 | const { itemResourceUrl } = useItemResource(toRef(props, 'item')); |
43 | const { isFetching, data, error } = useLdFetch(itemResourceUrl).text(); | 43 | const { isFetching, data, error } = useLdFetch(itemResourceUrl).text(); |
44 | </script> | 44 | </script> |
45 | 45 | ||
diff --git a/viewer/src/views/item_handlers/PdfViewer.vue b/viewer/src/views/item_handlers/PdfViewer.vue index 29f8033..a6ba273 100644 --- a/viewer/src/views/item_handlers/PdfViewer.vue +++ b/viewer/src/views/item_handlers/PdfViewer.vue | |||
@@ -36,13 +36,13 @@ | |||
36 | <script setup lang="ts"> | 36 | <script setup lang="ts"> |
37 | import { PDFItem } from '@/@types/gallery'; | 37 | import { PDFItem } from '@/@types/gallery'; |
38 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; | 38 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; |
39 | import { PropType } from 'vue'; | 39 | import { PropType, toRef } from 'vue'; |
40 | import DownloadViewer from './DownloadViewer.vue'; | 40 | import DownloadViewer from './DownloadViewer.vue'; |
41 | 41 | ||
42 | const props = defineProps({ | 42 | const props = defineProps({ |
43 | item: { type: Object as PropType<PDFItem>, required: true }, | 43 | item: { type: Object as PropType<PDFItem>, required: true }, |
44 | }); | 44 | }); |
45 | 45 | ||
46 | const { itemResourceUrl } = useItemResource(props.item); | 46 | const { itemResourceUrl } = useItemResource(toRef(props, 'item')); |
47 | 47 | ||
48 | </script> | 48 | </script> |
diff --git a/viewer/src/views/item_handlers/PictureViewer.vue b/viewer/src/views/item_handlers/PictureViewer.vue index 10055fd..74b978f 100644 --- a/viewer/src/views/item_handlers/PictureViewer.vue +++ b/viewer/src/views/item_handlers/PictureViewer.vue | |||
@@ -46,7 +46,7 @@ import { useLdZoom } from '@/services/ui/ldZoom'; | |||
46 | import { useUiStore } from '@/store/uiStore'; | 46 | import { useUiStore } from '@/store/uiStore'; |
47 | import { unrefElement, VueInstance } from '@vueuse/core'; | 47 | import { unrefElement, VueInstance } from '@vueuse/core'; |
48 | import { createToast } from 'mosha-vue-toastify'; | 48 | import { createToast } from 'mosha-vue-toastify'; |
49 | import { CSSProperties, onMounted, onUnmounted, PropType, ref } from 'vue'; | 49 | import { CSSProperties, onMounted, onUnmounted, PropType, ref, toRef } from 'vue'; |
50 | import { useI18n } from 'vue-i18n'; | 50 | import { useI18n } from 'vue-i18n'; |
51 | 51 | ||
52 | const props = defineProps({ | 52 | const props = defineProps({ |
@@ -63,7 +63,7 @@ const loader = ref(false); | |||
63 | const containerElement = ref<HTMLDivElement>(); | 63 | const containerElement = ref<HTMLDivElement>(); |
64 | const imageElement = ref<VueInstance>(); | 64 | const imageElement = ref<VueInstance>(); |
65 | 65 | ||
66 | const { itemResourceUrl, thumbnailResourceUrl } = useItemResource(props.item); | 66 | const { itemResourceUrl, thumbnailResourceUrl } = useItemResource(toRef(props, 'item')); |
67 | 67 | ||
68 | onMounted(() => { | 68 | onMounted(() => { |
69 | generateSlowLoadingStyle(); | 69 | generateSlowLoadingStyle(); |
diff --git a/viewer/src/views/item_handlers/PlainTextViewer.vue b/viewer/src/views/item_handlers/PlainTextViewer.vue index d386437..2ab429a 100644 --- a/viewer/src/views/item_handlers/PlainTextViewer.vue +++ b/viewer/src/views/item_handlers/PlainTextViewer.vue | |||
@@ -37,13 +37,13 @@ import { PlainTextItem } from '@/@types/gallery'; | |||
37 | import LdLoading from '@/components/LdLoading.vue'; | 37 | import LdLoading from '@/components/LdLoading.vue'; |
38 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; | 38 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; |
39 | import { useFetch } from '@vueuse/core'; | 39 | import { useFetch } from '@vueuse/core'; |
40 | import { PropType } from 'vue'; | 40 | import { PropType, toRef } from 'vue'; |
41 | 41 | ||
42 | const props = defineProps({ | 42 | const props = defineProps({ |
43 | item: { type: Object as PropType<PlainTextItem>, required: true }, | 43 | item: { type: Object as PropType<PlainTextItem>, required: true }, |
44 | }); | 44 | }); |
45 | 45 | ||
46 | const { itemResourceUrl } = useItemResource(props.item); | 46 | const { itemResourceUrl } = useItemResource(toRef(props, 'item')); |
47 | const { isFinished, data } = useFetch(itemResourceUrl).text(); | 47 | const { isFinished, data } = useFetch(itemResourceUrl).text(); |
48 | </script> | 48 | </script> |
49 | 49 | ||
diff --git a/viewer/src/views/item_handlers/VideoViewer.vue b/viewer/src/views/item_handlers/VideoViewer.vue index 7d17367..8f0e775 100644 --- a/viewer/src/views/item_handlers/VideoViewer.vue +++ b/viewer/src/views/item_handlers/VideoViewer.vue | |||
@@ -36,12 +36,12 @@ | |||
36 | <script setup lang="ts"> | 36 | <script setup lang="ts"> |
37 | import { VideoItem } from '@/@types/gallery'; | 37 | import { VideoItem } from '@/@types/gallery'; |
38 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; | 38 | import { useItemResource } from '@/services/ui/ldItemResourceUrl'; |
39 | import { PropType } from 'vue'; | 39 | import { PropType, toRef } from 'vue'; |
40 | import DownloadViewer from './DownloadViewer.vue'; | 40 | import DownloadViewer from './DownloadViewer.vue'; |
41 | 41 | ||
42 | const props = defineProps({ | 42 | const props = defineProps({ |
43 | item: { type: Object as PropType<VideoItem>, required: true }, | 43 | item: { type: Object as PropType<VideoItem>, required: true }, |
44 | }); | 44 | }); |
45 | 45 | ||
46 | const { itemResourceUrl, thumbnailResourceUrl } = useItemResource(props.item); | 46 | const { itemResourceUrl, thumbnailResourceUrl } = useItemResource(toRef(props, 'item')); |
47 | </script> | 47 | </script> |