From 7ae68f079ddfb74c9a1b17c4f30dfe4c258d4a9f Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 20 Dec 2019 17:47:04 +0100 Subject: Viewer project foundations --- viewer/src/plugins/buefy.ts | 9 +++++++++ viewer/src/plugins/fontawesome.js | 9 +++++++++ viewer/src/plugins/i18n.ts | 23 +++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 viewer/src/plugins/buefy.ts create mode 100644 viewer/src/plugins/fontawesome.js create mode 100644 viewer/src/plugins/i18n.ts (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/buefy.ts b/viewer/src/plugins/buefy.ts new file mode 100644 index 0000000..a880cee --- /dev/null +++ b/viewer/src/plugins/buefy.ts @@ -0,0 +1,9 @@ +import Vue from "vue"; + +import Buefy from "buefy"; +import "@/assets/scss/buefy.scss"; + +Vue.use(Buefy, { + defaultIconComponent: 'fa-icon', + defaultIconPack: 'fas', +}); diff --git a/viewer/src/plugins/fontawesome.js b/viewer/src/plugins/fontawesome.js new file mode 100644 index 0000000..9bf4dba --- /dev/null +++ b/viewer/src/plugins/fontawesome.js @@ -0,0 +1,9 @@ +import Vue from "vue"; + +import { library } from "@fortawesome/fontawesome-svg-core"; +import { faExpandArrowsAlt } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; + +library.add(faExpandArrowsAlt); + +Vue.component("fa-icon", FontAwesomeIcon); diff --git a/viewer/src/plugins/i18n.ts b/viewer/src/plugins/i18n.ts new file mode 100644 index 0000000..da2cd87 --- /dev/null +++ b/viewer/src/plugins/i18n.ts @@ -0,0 +1,23 @@ +import Vue from "vue"; +import VueI18n, { LocaleMessages } from "vue-i18n"; + +Vue.use(VueI18n); + +function loadLocaleMessages(): LocaleMessages { + const locales = require.context("@/locales", true, /[A-Za-z0-9-_,\s]+\.json$/i); + const messages: LocaleMessages = {}; + locales.keys().forEach(key => { + const matched = key.match(/([A-Za-z0-9-_]+)\./i); + if (matched && matched.length > 1) { + const locale = matched[1]; + messages[locale] = locales(key); + } + }); + return messages; +} + +export default new VueI18n({ + locale: process.env.VUE_APP_I18N_LOCALE || "en", + fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || "en", + messages: loadLocaleMessages(), +}); -- cgit v1.2.3 From 62005141132da1e9761598fa3e4b35b4dab38a89 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 02:06:02 +0100 Subject: Implemented VueX and a basic UIStore with the fullscreen mutation Some renaming --- viewer/src/plugins/fontawesome.js | 9 --------- viewer/src/plugins/fontawesome.ts | 9 +++++++++ viewer/src/plugins/vuex.ts | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 9 deletions(-) delete mode 100644 viewer/src/plugins/fontawesome.js create mode 100644 viewer/src/plugins/fontawesome.ts create mode 100644 viewer/src/plugins/vuex.ts (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/fontawesome.js b/viewer/src/plugins/fontawesome.js deleted file mode 100644 index 9bf4dba..0000000 --- a/viewer/src/plugins/fontawesome.js +++ /dev/null @@ -1,9 +0,0 @@ -import Vue from "vue"; - -import { library } from "@fortawesome/fontawesome-svg-core"; -import { faExpandArrowsAlt } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; - -library.add(faExpandArrowsAlt); - -Vue.component("fa-icon", FontAwesomeIcon); diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts new file mode 100644 index 0000000..9bf4dba --- /dev/null +++ b/viewer/src/plugins/fontawesome.ts @@ -0,0 +1,9 @@ +import Vue from "vue"; + +import { library } from "@fortawesome/fontawesome-svg-core"; +import { faExpandArrowsAlt } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; + +library.add(faExpandArrowsAlt); + +Vue.component("fa-icon", FontAwesomeIcon); diff --git a/viewer/src/plugins/vuex.ts b/viewer/src/plugins/vuex.ts new file mode 100644 index 0000000..9b2fa46 --- /dev/null +++ b/viewer/src/plugins/vuex.ts @@ -0,0 +1,23 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import { extractVuexModule } from "vuex-class-component"; +import { createProxy } from "vuex-class-component"; +import UIStore from '@/store/uiStore'; + +Vue.use(Vuex) + +const store = new Vuex.Store({ + modules: { + ...extractVuexModule(UIStore) + } +}); + +Vue.use((vue) => vue.prototype.$uiStore = createProxy(store, UIStore)); + +declare module 'vue/types/vue' { + interface Vue { + $uiStore: UIStore + } +} + +export default store; -- cgit v1.2.3 From 9e4fdd6f38853d8a4a959901ab7902569de75484 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 08:08:54 +0100 Subject: viewer: Implemented the "example" project in devServer Display loader and error messages (not translated yet) Created a "GalleryStore" to fetch the JSon data from the gallery (currently from example) --- viewer/src/plugins/vuex.ts | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 viewer/src/plugins/vuex.ts (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/vuex.ts b/viewer/src/plugins/vuex.ts deleted file mode 100644 index 9b2fa46..0000000 --- a/viewer/src/plugins/vuex.ts +++ /dev/null @@ -1,23 +0,0 @@ -import Vue from 'vue' -import Vuex from 'vuex' -import { extractVuexModule } from "vuex-class-component"; -import { createProxy } from "vuex-class-component"; -import UIStore from '@/store/uiStore'; - -Vue.use(Vuex) - -const store = new Vuex.Store({ - modules: { - ...extractVuexModule(UIStore) - } -}); - -Vue.use((vue) => vue.prototype.$uiStore = createProxy(store, UIStore)); - -declare module 'vue/types/vue' { - interface Vue { - $uiStore: UIStore - } -} - -export default store; -- 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/plugins/fontawesome.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index 9bf4dba..3af77b6 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts @@ -1,9 +1,9 @@ import Vue from "vue"; import { library } from "@fortawesome/fontawesome-svg-core"; -import { faExpandArrowsAlt } from "@fortawesome/free-solid-svg-icons"; +import { faExpandArrowsAlt, faFolder, faSearch } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; -library.add(faExpandArrowsAlt); +library.add(faExpandArrowsAlt, faFolder, faSearch); Vue.component("fa-icon", FontAwesomeIcon); -- 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/plugins/fontawesome.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index 3af77b6..e129c57 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts @@ -1,9 +1,9 @@ import Vue from "vue"; import { library } from "@fortawesome/fontawesome-svg-core"; -import { faExpandArrowsAlt, faFolder, faSearch } from "@fortawesome/free-solid-svg-icons"; +import { faExpandArrowsAlt, faFolder, faSearch, faTag } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; -library.add(faExpandArrowsAlt, faFolder, faSearch); +library.add(faExpandArrowsAlt, faFolder, faSearch, faTag); Vue.component("fa-icon", FontAwesomeIcon); -- 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/plugins/fontawesome.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index e129c57..ba31c9e 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts @@ -1,9 +1,19 @@ import Vue from "vue"; import { library } from "@fortawesome/fontawesome-svg-core"; -import { faExpandArrowsAlt, faFolder, faSearch, faTag } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import { + faExpandArrowsAlt, + faFolder, + faSearch, + faTag +} from "@fortawesome/free-solid-svg-icons"; -library.add(faExpandArrowsAlt, faFolder, faSearch, faTag); +library.add( + faExpandArrowsAlt, + faFolder, + faSearch, + faTag, +); Vue.component("fa-icon", FontAwesomeIcon); -- cgit v1.2.3 From a681accaa7617892bb7c53248aa9030a4eb47f50 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 28 Dec 2019 04:52:30 +0100 Subject: viewer: Tag propositions. Disabled directory indexation. Note: The propositions are not based on the current search results, but on the searched tags, which doesn't seem to be the correct way. We'll probably have to move the search results to a store for global visibility. --- viewer/src/plugins/fontawesome.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index ba31c9e..7308afe 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts @@ -6,7 +6,9 @@ import { faExpandArrowsAlt, faFolder, faSearch, - faTag + faTag, + faPlus, + faMinus, } from "@fortawesome/free-solid-svg-icons"; library.add( @@ -14,6 +16,8 @@ library.add( faFolder, faSearch, faTag, + faPlus, + faMinus, ); Vue.component("fa-icon", FontAwesomeIcon); -- 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/plugins/fontawesome.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index 7308afe..3bd7d08 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts @@ -9,6 +9,7 @@ import { faTag, faPlus, faMinus, + faImage, } from "@fortawesome/free-solid-svg-icons"; library.add( @@ -18,6 +19,7 @@ library.add( faTag, faPlus, faMinus, + faImage, ); Vue.component("fa-icon", FontAwesomeIcon); -- cgit v1.2.3 From 27b51018525dbb7a6edb3073819d82245387ddd3 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 10 Jan 2020 22:22:22 +0100 Subject: viewer: license headers --- viewer/src/plugins/buefy.ts | 19 +++++++++++++++++++ viewer/src/plugins/fontawesome.ts | 19 +++++++++++++++++++ viewer/src/plugins/i18n.ts | 19 +++++++++++++++++++ 3 files changed, 57 insertions(+) (limited to 'viewer/src/plugins') diff --git a/viewer/src/plugins/buefy.ts b/viewer/src/plugins/buefy.ts index a880cee..9fa73b6 100644 --- a/viewer/src/plugins/buefy.ts +++ b/viewer/src/plugins/buefy.ts @@ -1,3 +1,22 @@ +/* ldgallery - A static generator which turns a collection of tagged +-- pictures into a searchable web gallery. +-- +-- Copyright (C) 2019-2020 Guillaume FOUET +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . +*/ + import Vue from "vue"; import Buefy from "buefy"; diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index 3bd7d08..7fb08a3 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts @@ -1,3 +1,22 @@ +/* ldgallery - A static generator which turns a collection of tagged +-- pictures into a searchable web gallery. +-- +-- Copyright (C) 2019-2020 Guillaume FOUET +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . +*/ + import Vue from "vue"; import { library } from "@fortawesome/fontawesome-svg-core"; diff --git a/viewer/src/plugins/i18n.ts b/viewer/src/plugins/i18n.ts index da2cd87..bc3dde5 100644 --- a/viewer/src/plugins/i18n.ts +++ b/viewer/src/plugins/i18n.ts @@ -1,3 +1,22 @@ +/* ldgallery - A static generator which turns a collection of tagged +-- pictures into a searchable web gallery. +-- +-- Copyright (C) 2019-2020 Guillaume FOUET +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . +*/ + import Vue from "vue"; import VueI18n, { LocaleMessages } from "vue-i18n"; -- cgit v1.2.3