diff options
author | pacien | 2023-02-17 22:57:38 +0100 |
---|---|---|
committer | pacien | 2023-02-17 22:57:38 +0100 |
commit | 46cd42de44e402fbf33522d999fa2649729ffaa8 (patch) | |
tree | 1281beefda5d9b6d2411bc47ec1327fbf0b38dde /viewer/src | |
parent | 11bbbae2850b9c45da697a8ed9626495a50a38c0 (diff) | |
parent | e939712a284dff9af6d81cc1fcd4e7f7ec9ad503 (diff) | |
download | ldgallery-46cd42de44e402fbf33522d999fa2649729ffaa8.tar.gz |
Merge branch 'develop': release v2.2v2.2
Diffstat (limited to 'viewer/src')
23 files changed, 325 insertions, 51 deletions
diff --git a/viewer/src/@types/gallery.ts b/viewer/src/@types/gallery.ts index 8c0f177..6960de2 100644 --- a/viewer/src/@types/gallery.ts +++ b/viewer/src/@types/gallery.ts | |||
@@ -64,6 +64,9 @@ export interface MarkdownProperties extends Downloadable { | |||
64 | export interface PDFProperties extends Downloadable { | 64 | export interface PDFProperties extends Downloadable { |
65 | type: ItemType.PDF; | 65 | type: ItemType.PDF; |
66 | } | 66 | } |
67 | export interface EPUBProperties extends Downloadable { | ||
68 | type: ItemType.EPUB; | ||
69 | } | ||
67 | export interface VideoProperties extends Downloadable { | 70 | export interface VideoProperties extends Downloadable { |
68 | type: ItemType.VIDEO; | 71 | type: ItemType.VIDEO; |
69 | } | 72 | } |
@@ -107,6 +110,9 @@ export interface MarkdownItem extends Item { | |||
107 | export interface PDFItem extends Item { | 110 | export interface PDFItem extends Item { |
108 | properties: PDFProperties; | 111 | properties: PDFProperties; |
109 | } | 112 | } |
113 | export interface EPUBItem extends Item { | ||
114 | properties: EPUBProperties; | ||
115 | } | ||
110 | export interface VideoItem extends Item { | 116 | export interface VideoItem extends Item { |
111 | properties: VideoProperties; | 117 | properties: VideoProperties; |
112 | } | 118 | } |
diff --git a/viewer/src/@types/itemType.ts b/viewer/src/@types/itemType.ts index ecab05c..8528728 100644 --- a/viewer/src/@types/itemType.ts +++ b/viewer/src/@types/itemType.ts | |||
@@ -23,6 +23,7 @@ export enum ItemType { | |||
23 | PLAINTEXT = 'plaintext', | 23 | PLAINTEXT = 'plaintext', |
24 | MARKDOWN = 'markdown', | 24 | MARKDOWN = 'markdown', |
25 | PDF = 'pdf', | 25 | PDF = 'pdf', |
26 | EPUB = 'epub', | ||
26 | VIDEO = 'video', | 27 | VIDEO = 'video', |
27 | AUDIO = 'audio', | 28 | AUDIO = 'audio', |
28 | DIRECTORY = 'directory', | 29 | DIRECTORY = 'directory', |
diff --git a/viewer/src/assets/scss/theme.scss b/viewer/src/assets/scss/theme.scss index 63febbf..6622fa5 100644 --- a/viewer/src/assets/scss/theme.scss +++ b/viewer/src/assets/scss/theme.scss | |||
@@ -41,6 +41,8 @@ $dropdown-item-color: $palette-600; | |||
41 | $dropdown-item-hover-color: $palette-500; | 41 | $dropdown-item-hover-color: $palette-500; |
42 | $panel-top-bgcolor: $palette-800; | 42 | $panel-top-bgcolor: $palette-800; |
43 | $panel-top-txtcolor: $primary; | 43 | $panel-top-txtcolor: $primary; |
44 | $panel-bottom-bgcolor: $palette-800; | ||
45 | $panel-bottom-txtcolor: $primary; | ||
44 | $panel-left-bgcolor: $palette-800; | 46 | $panel-left-bgcolor: $palette-800; |
45 | $panel-left-txtcolor: $primary; | 47 | $panel-left-txtcolor: $primary; |
46 | $command-buttons-bgcolor: $palette-700; | 48 | $command-buttons-bgcolor: $palette-700; |
@@ -55,6 +57,7 @@ $thumbnail-other-size: $body-line-height * 7em; | |||
55 | $proposed-category-bgcolor: $palette-700; | 57 | $proposed-category-bgcolor: $palette-700; |
56 | $viewer-text: $palette-000; | 58 | $viewer-text: $palette-000; |
57 | $viewer-text-background: $palette-900; | 59 | $viewer-text-background: $palette-900; |
60 | $viewer-epub-background: $palette-000; | ||
58 | 61 | ||
59 | // Layout | 62 | // Layout |
60 | 63 | ||
diff --git a/viewer/src/components/async/AsyncLdMarkdown.vue b/viewer/src/components/async/AsyncLdMarkdown.vue index 213c11c..c3f368a 100644 --- a/viewer/src/components/async/AsyncLdMarkdown.vue +++ b/viewer/src/components/async/AsyncLdMarkdown.vue | |||
@@ -40,7 +40,6 @@ const html = computed(() => marked(props.markdown)); | |||
40 | <style lang="scss" module> | 40 | <style lang="scss" module> |
41 | .markdown { | 41 | .markdown { |
42 | color: white; | 42 | color: white; |
43 | line-height: 1.7; | ||
44 | word-wrap: break-word; | 43 | word-wrap: break-word; |
45 | 44 | ||
46 | a { | 45 | a { |
@@ -52,19 +51,10 @@ const html = computed(() => marked(props.markdown)); | |||
52 | background-color: #666; | 51 | background-color: #666; |
53 | } | 52 | } |
54 | 53 | ||
55 | p, | ||
56 | blockquote, | ||
57 | ul, | ||
58 | ol, | ||
59 | dl, | ||
60 | table, | ||
61 | pre { | ||
62 | margin: 15px 0; | ||
63 | } | ||
64 | |||
65 | ul, | 54 | ul, |
66 | ol { | 55 | ol { |
67 | padding-left: 30px; | 56 | list-style-type: disc; |
57 | padding-left: 1em; | ||
68 | } | 58 | } |
69 | 59 | ||
70 | h1 { | 60 | h1 { |
diff --git a/viewer/src/locales/en.yml b/viewer/src/locales/en.yml index acbe24b..280f18b 100644 --- a/viewer/src/locales/en.yml +++ b/viewer/src/locales/en.yml | |||
@@ -1,6 +1,7 @@ | |||
1 | command: | 1 | command: |
2 | back: Go back | 2 | back: Go back |
3 | parent: Go to parent directory | 3 | parent: Go to parent directory |
4 | download: Download | ||
4 | search: | 5 | search: |
5 | clear: Clear | 6 | clear: Clear |
6 | search: Search | 7 | search: Search |
@@ -14,6 +15,9 @@ directory: | |||
14 | no-results: Empty directory | 15 | no-results: Empty directory |
15 | download: | 16 | download: |
16 | download-file-fmt: Download {0} | 17 | download-file-fmt: Download {0} |
18 | epubViewer: | ||
19 | previousSection: Previous section | ||
20 | nextSection: Next section | ||
17 | gallery: | 21 | gallery: |
18 | resource-loading-error: Error loading resource | 22 | resource-loading-error: Error loading resource |
19 | unknown-resource: Resource not found | 23 | unknown-resource: Resource not found |
diff --git a/viewer/src/services/navigation.ts b/viewer/src/services/navigation.ts index b2e807b..fb01169 100644 --- a/viewer/src/services/navigation.ts +++ b/viewer/src/services/navigation.ts | |||
@@ -19,7 +19,18 @@ | |||
19 | 19 | ||
20 | import { DirectoryItem, DownloadableItem, Item } from '@/@types/gallery'; | 20 | import { DirectoryItem, DownloadableItem, Item } from '@/@types/gallery'; |
21 | import { ItemType } from '@/@types/itemType'; | 21 | import { ItemType } from '@/@types/itemType'; |
22 | import { faFile, faFileAlt, faFileAudio, faFilePdf, faFileVideo, faFolder, faHome, faImage, IconDefinition } from '@fortawesome/free-solid-svg-icons'; | 22 | import { |
23 | faFile, | ||
24 | faFileAlt, | ||
25 | faFileAudio, | ||
26 | faFilePdf, | ||
27 | faBook, | ||
28 | faFileVideo, | ||
29 | faFolder, | ||
30 | faHome, | ||
31 | faImage, | ||
32 | IconDefinition, | ||
33 | } from '@fortawesome/free-solid-svg-icons'; | ||
23 | import { isDirectory } from './itemGuards'; | 34 | import { isDirectory } from './itemGuards'; |
24 | 35 | ||
25 | const ICON_BY_TYPE: Record<ItemType, IconDefinition> = { | 36 | const ICON_BY_TYPE: Record<ItemType, IconDefinition> = { |
@@ -28,6 +39,7 @@ const ICON_BY_TYPE: Record<ItemType, IconDefinition> = { | |||
28 | plaintext: faFileAlt, | 39 | plaintext: faFileAlt, |
29 | markdown: faFileAlt, | 40 | markdown: faFileAlt, |
30 | pdf: faFilePdf, | 41 | pdf: faFilePdf, |
42 | epub: faBook, | ||
31 | video: faFileVideo, | 43 | video: faFileVideo, |
32 | audio: faFileAudio, | 44 | audio: faFileAudio, |
33 | other: faFile, | 45 | other: faFile, |
diff --git a/viewer/src/services/ui/ldItemResourceUrl.ts b/viewer/src/services/ui/ldItemResourceUrl.ts index 7db7ab9..d6734b3 100644 --- a/viewer/src/services/ui/ldItemResourceUrl.ts +++ b/viewer/src/services/ui/ldItemResourceUrl.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { Item } from '@/@types/gallery'; | 1 | import { Item } from '@/@types/gallery'; |
2 | import { useGalleryStore } from '@/store/galleryStore'; | 2 | import { useGalleryStore } from '@/store/galleryStore'; |
3 | import { computed } from 'vue'; | 3 | import { computed, ToRef } from 'vue'; |
4 | import { isDownloadableItem } from '../itemGuards'; | 4 | import { isDownloadableItem } from '../itemGuards'; |
5 | 5 | ||
6 | export const useItemResource = (item: Item) => { | 6 | export const useItemResource = (item: ToRef<Item>) => { |
7 | const galleryStore = useGalleryStore(); | 7 | const galleryStore = useGalleryStore(); |
8 | const itemResourceUrl = computed(() => isDownloadableItem(item) ? galleryStore.resourceRoot + item.properties.resource : ''); | 8 | const itemResourceUrl = computed(() => isDownloadableItem(item.value) ? galleryStore.resourceRoot + item.value.properties.resource : ''); |
9 | const thumbnailResourceUrl = computed(() => item.thumbnail ? galleryStore.resourceRoot + item.thumbnail.resource : ''); | 9 | const thumbnailResourceUrl = computed(() => item.value.thumbnail ? galleryStore.resourceRoot + item.value.thumbnail.resource : ''); |
10 | 10 | ||
11 | return { | 11 | return { |
12 | itemResourceUrl, | 12 | itemResourceUrl, |
diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue index 0869aaf..b342c52 100644 --- a/viewer/src/views/GalleryNavigation.vue +++ b/viewer/src/views/GalleryNavigation.vue | |||
@@ -44,6 +44,7 @@ import { computedEager } from '@vueuse/shared'; | |||
44 | import { computed, watchEffect } from 'vue'; | 44 | import { computed, watchEffect } from 'vue'; |
45 | import { useI18n } from 'vue-i18n'; | 45 | import { useI18n } from 'vue-i18n'; |
46 | import GallerySearch from './GallerySearch.vue'; | 46 | import GallerySearch from './GallerySearch.vue'; |
47 | import { EpubViewer } from './item_handlers/async'; | ||
47 | import AudioViewer from './item_handlers/AudioViewer.vue'; | 48 | import AudioViewer from './item_handlers/AudioViewer.vue'; |
48 | import DirectoryViewer from './item_handlers/DirectoryViewer.vue'; |