From 6e7ee4d38fb3630a13d31592f0f6ae9bbe8e1bd6 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 03:32:20 +0100 Subject: Implemented global components registration Moved the fullscreen button as a global component (as demonstration) Improved the layout CSS --- viewer/src/components/LdButtonFullscreen.vue | 25 +++++++++++++++++++++++++ viewer/src/components/index.ts | 22 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 viewer/src/components/LdButtonFullscreen.vue create mode 100644 viewer/src/components/index.ts (limited to 'viewer/src/components') diff --git a/viewer/src/components/LdButtonFullscreen.vue b/viewer/src/components/LdButtonFullscreen.vue new file mode 100644 index 0000000..2302a27 --- /dev/null +++ b/viewer/src/components/LdButtonFullscreen.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/viewer/src/components/index.ts b/viewer/src/components/index.ts new file mode 100644 index 0000000..1406b34 --- /dev/null +++ b/viewer/src/components/index.ts @@ -0,0 +1,22 @@ +import Vue from 'vue' + +const requireComponent = require.context( + '@/components', + false, // Whether or not to look in subfolders + // The regular expression used to match base component filenames + /Ld[A-Z]\w+\.vue$/ +) + +requireComponent.keys().forEach(fileName => { + const componentConfig = requireComponent(fileName) + const componentName = fileName.split('/').pop()!.replace(/\.vue$/, ''); + + // Register component globally + Vue.component( + componentName, + // Look for the component options on `.default`, which will + // exist if the component was exported with `export default`, + // otherwise fall back to module's root. + componentConfig.default || componentConfig + ) +}) \ No newline at end of file -- cgit v1.2.3 From e34be1261d9219e5b2b92ebe271f609f11d55f63 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sun, 22 Dec 2019 03:50:40 +0100 Subject: vewer: Tags indexing and search input --- viewer/src/components/LdTagInput.vue | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 viewer/src/components/LdTagInput.vue (limited to 'viewer/src/components') diff --git a/viewer/src/components/LdTagInput.vue b/viewer/src/components/LdTagInput.vue new file mode 100644 index 0000000..4edc1ce --- /dev/null +++ b/viewer/src/components/LdTagInput.vue @@ -0,0 +1,40 @@ + + + + + -- cgit v1.2.3 From dc251fffc2998f1cf4f8e9631928c4b92ac0d90e Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sun, 22 Dec 2019 07:40:55 +0100 Subject: viewer: Implemented the search by tags. Pushed the special urls to ENV. --- viewer/src/components/LdModeRadio.vue | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 viewer/src/components/LdModeRadio.vue (limited to 'viewer/src/components') diff --git a/viewer/src/components/LdModeRadio.vue b/viewer/src/components/LdModeRadio.vue new file mode 100644 index 0000000..614bf33 --- /dev/null +++ b/viewer/src/components/LdModeRadio.vue @@ -0,0 +1,22 @@ + + + + + -- cgit v1.2.3 From 06c4d9299bb684805051355555fa89f0d440d194 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sun, 22 Dec 2019 11:26:53 +0100 Subject: viewer: Implemented tag category and disambiguation filtering --- viewer/src/components/LdTagInput.vue | 52 +++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 10 deletions(-) (limited to 'viewer/src/components') diff --git a/viewer/src/components/LdTagInput.vue b/viewer/src/components/LdTagInput.vue index 4edc1ce..4121cd7 100644 --- a/viewer/src/components/LdTagInput.vue +++ b/viewer/src/components/LdTagInput.vue @@ -3,14 +3,16 @@ v-model="$uiStore.currentTags" :placeholder="$t('tagInput.placeholder')" autocomplete + ellipsis + attached :data="filteredTags" field="tag" type="is-black" - size="is-large" + icon="tag" class="panelTagInput" - @typing="getFilteredTags" + @typing="searchTags" > - + @@ -20,15 +22,45 @@ import { Component, Vue } from "vue-property-decorator"; @Component export default class LdTagInput extends Vue { - filteredTags: Tag.Node[] = []; + filteredTags: Tag.Search[] = []; - getFilteredTags(filter: string) { + displayOption(option: Tag.Search): string { + return `${option.tag} (${option.items.length})`; + } + + searchTags(filter: string) { const tags = this.$galleryStore.tags; - if (tags && filter) - this.filteredTags = Object.values(tags) - .filter(node => node.tag.includes(filter)) - .sort((a, b) => b.items.length - a.items.length); - else this.filteredTags = []; + let search: Tag.Search[] = []; + if (tags && filter) { + if (filter.includes(":")) { + const filterParts = filter.split(":"); + search = this.searchTagsFromFilterWithCategory(tags, filterParts[0], filterParts[1]); + } else { + search = this.searchTagsFromFilter(tags, filter); + } + } + this.filteredTags = this.cleanupAndSort(search); + } + + searchTagsFromFilterWithCategory(tags: Tag.Index, category: string, disambiguation: string): Tag.NodeWithParent[] { + return Object.values(tags) + .filter(node => node.tag.includes(category)) + .flatMap(node => + Object.values(node.children) + .filter(child => child.tag.includes(disambiguation)) + .map(child => ({ ...child, parent: node, tag: `${node.tag}:${child.tag}` })) + ); + } + + searchTagsFromFilter(tags: Tag.Index, filter: string): Tag.Node[] { + return Object.values(tags).filter(node => node.tag.includes(filter)); + } + + cleanupAndSort(search: Tag.Search[]): Tag.Search[] { + const currentTags = this.$uiStore.currentTags; + return search + .filter(node => !currentTags.find(currentTag => currentTag.tag === node.tag)) + .sort((a, b) => b.items.length - a.items.length); } } -- cgit v1.2.3 From 7c2576b0cfb0a15b2a14f6f5ea96de16f0c23b44 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Tue, 24 Dec 2019 02:22:56 +0100 Subject: viewer: Plugin for Optional chaining and Coalesce. Implemented tag operations (intersection, addition, substraction). Unified Tag.Search --- viewer/src/components/LdTagInput.vue | 48 ++++++++++++++++++++++++++++++------ viewer/src/components/index.ts | 2 +- 2 files changed, 41 insertions(+), 9 deletions(-) (limited to 'viewer/src/components') diff --git a/viewer/src/components/LdTagInput.vue b/viewer/src/components/LdTagInput.vue index 4121cd7..daca62d 100644 --- a/viewer/src/components/LdTagInput.vue +++ b/viewer/src/components/LdTagInput.vue @@ -6,11 +6,14 @@ ellipsis attached :data="filteredTags" - field="tag" + field="display" type="is-black" icon="tag" + size="is-medium" class="panelTagInput" @typing="searchTags" + @add="onAdd" + @remove="onRemove" > @@ -19,41 +22,70 @@ + + -- cgit v1.2.3 From 89bcb2dbe5b5e6eb8e8ba13ceecee2770dfe4cd4 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Thu, 9 Jan 2020 02:10:35 +0100 Subject: viewer: Changed "image" type to "picture". Adapted the code to the current compiler output format. The currentItem and currentPath are calculated in the store for easier multi-component access. Breadcrumb for current's position and navigation. --- viewer/src/components/LdProposition.vue | 1 - 1 file changed, 1 deletion(-) (limited to 'viewer/src/components') diff --git a/viewer/src/components/LdProposition.vue b/viewer/src/components/LdProposition.vue index b23c14a..9e8d9dd 100644 --- a/viewer/src/components/LdProposition.vue +++ b/viewer/src/components/LdProposition.vue @@ -13,7 +13,6 @@