diff options
Diffstat (limited to 'viewer/src/components')
23 files changed, 374 insertions, 1361 deletions
diff --git a/viewer/src/components/LdBreadcrumb.vue b/viewer/src/components/LdBreadcrumb.vue deleted file mode 100644 index 618b15a..0000000 --- a/viewer/src/components/LdBreadcrumb.vue +++ /dev/null | |||
@@ -1,127 +0,0 @@ | |||
1 | <!-- ldgallery - A static generator which turns a collection of tagged | ||
2 | -- pictures into a searchable web gallery. | ||
3 | -- | ||
4 | -- Copyright (C) 2019-2020 Guillaume FOUET | ||
5 | -- | ||
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 | ||
8 | -- published by the Free Software Foundation, either version 3 of the | ||
9 | -- License, or (at your option) any later version. | ||
10 | -- | ||
11 | -- This program is distributed in the hope that it will be useful, | ||
12 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | -- GNU Affero General Public License for more details. | ||
15 | -- | ||
16 | -- You should have received a copy of the GNU Affero General Public License | ||
17 | -- along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
18 | --> | ||
19 | |||
20 | <template> | ||
21 | <div | ||
22 | ref="breadcrumb" | ||
23 | v-dragscroll | ||
24 | class="ld-breadcrumb flex scrollbar" | ||
25 | @click.capture="e => dragScrollClickFix.onClickCapture(e)" | ||
26 | @dragscrollstart="dragScrollClickFix.onDragScrollStart()" | ||
27 | @dragscrollend="dragScrollClickFix.onDragScrollEnd()" | ||
28 | @dragscrollmove="checkForOverflowMask" | ||
29 | > | ||
30 | <div v-show="overflowMask" class="ld-breadcrumb-overflow-mask"></div> | ||
31 | <ul class="ld-breadcrumb"> | ||
32 | <li v-for="(item, idx) in currentItemPath" :key="item.path"> | ||
33 | <fa-icon v-if="idx > 0" icon="angle-right" class="disabled" /> | ||
34 | <router-link :to="item.path" class="link"> | ||
35 | <fa-icon :icon="getIcon(item)" size="lg" /> | ||
36 | {{ item.title }} | ||
37 | </router-link> | ||
38 | </li> | ||
39 | <li v-if="searchMode"> | ||
40 | <fa-icon icon="angle-right" class="disabled" /> | ||
41 | <router-link :to="$route" class="link"> | ||
42 | <fa-icon icon="search" size="lg" class="disabled" /> | ||
43 | </router-link> | ||
44 | </li> | ||
45 | </ul> | ||
46 | </div> | ||
47 | </template> | ||
48 | |||
49 | <script lang="ts"> | ||
50 | import { Component, Vue, Ref, Watch, Prop } from "vue-property-decorator"; | ||
51 | import DragScrollClickFix from "@/services/dragscrollclickfix"; | ||
52 | import Navigation from "@/services/navigation"; | ||
53 | |||
54 | @Component | ||
55 | export default class LdBreadcrumb extends Vue { | ||
56 | @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[]; | ||
57 | @Prop(Boolean) readonly searchMode!: boolean; | ||
58 | @Ref() readonly breadcrumb!: HTMLUListElement; | ||
59 | |||
60 | readonly dragScrollClickFix = new DragScrollClickFix(); | ||
61 | |||
62 | dragging: boolean = false; | ||
63 | overflowMask: boolean = false; | ||
64 | |||
65 | mounted() { | ||
66 | window.addEventListener("resize", this.checkForOverflowMask); | ||
67 | } | ||
68 | |||
69 | destroyed() { | ||
70 | window.removeEventListener("resize", this.checkForOverflowMask); | ||
71 | } | ||
72 | |||
73 | checkForOverflowMask() { | ||
74 | this.overflowMask = this.breadcrumb.scrollLeft > 1; | ||
75 | } | ||
76 | |||
77 | @Watch("currentItemPath") | ||
78 | changedCurrentItemPath() { | ||
79 | this.$nextTick(() => { | ||
80 | this.breadcrumb.scrollLeft = this.breadcrumb.scrollWidth; | ||
81 | this.checkForOverflowMask(); | ||
82 | }); | ||
83 | } | ||
84 | |||
85 | getIcon(item: Gallery.Item) { | ||
86 | return Navigation.getIcon(item); | ||
87 | } | ||
88 | } | ||
89 | </script> | ||
90 | |||
91 | <style lang="scss"> | ||
92 | @import "~@/assets/scss/theme.scss"; | ||
93 | |||
94 | .ld-breadcrumb-overflow-mask { | ||
95 | position: absolute; | ||
96 | width: 100%; | ||
97 | height: 100%; | ||
98 | background: linear-gradient( | ||
99 | to right, | ||
100 | rgba($panel-top-bgcolor, 1) $breadcrumb-margins, | ||
101 | rgba($panel-top-bgcolor, 0) $breadcrumb-overflow-mask-size | ||
102 | ); | ||
103 | pointer-events: none; | ||
104 | } | ||
105 | |||
106 | .ld-breadcrumb { | ||
107 | ul { | ||
108 | display: flex; | ||
109 | white-space: nowrap; | ||
110 | } | ||
111 | a { | ||
112 | padding: $breadcrumb-margins 0; | ||
113 | margin-left: $breadcrumb-margins; | ||
114 | } | ||
115 | li { | ||
116 | align-self: center; | ||
117 | margin-right: $breadcrumb-margins; | ||
118 | } | ||
119 | &.scrollbar { | ||
120 | overflow-y: hidden; | ||
121 | scrollbar-width: none; | ||
122 | &::-webkit-scrollbar { | ||
123 | height: 0; | ||
124 | } | ||
125 | } | ||
126 | } | ||
127 | </style> | ||
diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue deleted file mode 100644 index 6059162..0000000 --- a/viewer/src/components/LdCommand.vue +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | <!-- ldgallery - A static generator which turns a collection of tagged | ||
2 | -- pictures into a searchable web gallery. | ||
3 | -- | ||
4 | -- Copyright (C) 2019-2020 Guillaume FOUET | ||
5 | -- 2020 Pacien TRAN-GIRARD | ||
6 | -- | ||
7 | -- This program is free software: you can redistribute it and/or modify | ||
8 | -- it under the terms of the GNU Affero General Public License as | ||
9 | -- published by the Free Software Foundation, either version 3 of the | ||
10 | -- License, or (at your option) any later version. | ||
11 | -- | ||
12 | -- This program is distributed in the hope that it will be useful, | ||
13 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | -- GNU Affero General Public License for more details. | ||
16 | -- | ||
17 | -- You should have received a copy of the GNU Affero General Public License | ||
18 | -- along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
19 | --> | ||
20 | |||
21 | <template> | ||
22 | <div class="flex command-btns"> | ||
23 | <a class="link" :title="$t('command.search')" @click="$uiStore.toggleFullWidth()"> | ||
24 | <fa-icon :icon="commandToggleSearchPanelIcon" size="lg" /> | ||
25 | </a> | ||
26 | <ld-command-sort /> | ||
27 | <a | ||
28 | :class="{ disabled: isEntryPoint }" | ||
29 | class="link command-secondary" | ||
30 | :title="$t('command.back')" | ||
31 | @click="isEntryPoint || $router.back()" | ||
32 | > | ||
33 | <fa-icon icon="arrow-left" size="lg" /> | ||
34 | </a> | ||
35 | <router-link :class="{ disabled: isRoot }" :title="$t('command.parent')" :to="parent"> | ||
36 | <fa-icon icon="folder" size="xs" /> | ||
37 | <fa-icon icon="level-up-alt" size="lg" /> | ||
38 | </router-link> | ||
39 | </div> | ||
40 | </template> | ||
41 | |||
42 | <script lang="ts"> | ||
43 | import { Component, Vue, Prop } from "vue-property-decorator"; | ||
44 | import { RawLocation } from "vue-router"; | ||
45 | |||
46 | @Component | ||
47 | export default class LdCommand extends Vue { | ||
48 | @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[]; | ||
49 | |||
50 | get commandToggleSearchPanelIcon(): string { | ||
51 | return this.$uiStore.fullWidth ? "search" : "angle-double-left"; | ||
52 | } | ||
53 | |||
54 | get isRoot(): boolean { | ||
55 | return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode; | ||
56 | } | ||
57 | |||
58 | get isEntryPoint(): boolean { | ||
59 | return history.state?.ldgallery === "ENTRYPOINT"; // Set by MainLayout.vue | ||
60 | } | ||
61 | |||
62 | get parent(): RawLocation { | ||
63 | if (this.$uiStore.searchMode) return this.$route.path; | ||
64 | if (this.currentItemPath.length > 1) return this.currentItemPath[this.currentItemPath.length - 2]; | ||
65 | return ""; | ||
66 | } | ||
67 | } | ||
68 | </script> | ||
69 | |||
70 | <style lang="scss"> | ||
71 | @import "~@/assets/scss/_buefy_variables.scss"; | ||
72 | @import "~@/assets/scss/theme.scss"; | ||