diff options
Diffstat (limited to 'viewer/src/plugins')
-rw-r--r-- | viewer/src/plugins/buefy.ts | 24 | ||||
-rw-r--r-- | viewer/src/plugins/dragscroll.ts | 23 | ||||
-rw-r--r-- | viewer/src/plugins/fontawesome.ts | 43 | ||||
-rw-r--r-- | viewer/src/plugins/lazyimage.ts | 23 | ||||
-rw-r--r-- | viewer/src/plugins/router.ts | 42 |
5 files changed, 135 insertions, 20 deletions
diff --git a/viewer/src/plugins/buefy.ts b/viewer/src/plugins/buefy.ts index 9fa73b6..0f8e16b 100644 --- a/viewer/src/plugins/buefy.ts +++ b/viewer/src/plugins/buefy.ts | |||
@@ -19,10 +19,24 @@ | |||
19 | 19 | ||
20 | import Vue from "vue"; | 20 | import Vue from "vue"; |
21 | 21 | ||
22 | import Buefy from "buefy"; | 22 | // @ts-ignore |
23 | import Taginput from "buefy/src/components/taginput"; | ||
24 | // @ts-ignore | ||
25 | import Loading from "buefy/src/components/loading"; | ||
26 | // @ts-ignore | ||
27 | import Button from "buefy/src/components/button"; | ||
28 | // @ts-ignore | ||
29 | import SnackBar from "buefy/src/components/snackbar"; | ||
30 | |||
23 | import "@/assets/scss/buefy.scss"; | 31 | import "@/assets/scss/buefy.scss"; |
24 | 32 | ||
25 | Vue.use(Buefy, { | 33 | Vue.use(Taginput); |
26 | defaultIconComponent: 'fa-icon', | 34 | Vue.use(Loading); |
27 | defaultIconPack: 'fas', | 35 | Vue.use(Button); |
28 | }); | 36 | Vue.use(SnackBar); |
37 | |||
38 | declare module "vue/types/vue" { | ||
39 | interface Vue { | ||
40 | $buefy: any; | ||
41 | } | ||
42 | } | ||
diff --git a/viewer/src/plugins/dragscroll.ts b/viewer/src/plugins/dragscroll.ts new file mode 100644 index 0000000..a10b0fd --- /dev/null +++ b/viewer/src/plugins/dragscroll.ts | |||
@@ -0,0 +1,23 @@ | |||
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 | import Vue from "vue"; | ||
21 | import VueDragscroll from "vue-dragscroll"; | ||
22 | |||
23 | Vue.use(VueDragscroll); | ||
diff --git a/viewer/src/plugins/fontawesome.ts b/viewer/src/plugins/fontawesome.ts index 7fb08a3..480e8e0 100644 --- a/viewer/src/plugins/fontawesome.ts +++ b/viewer/src/plugins/fontawesome.ts | |||
@@ -19,26 +19,39 @@ | |||
19 | 19 | ||
20 | import Vue from "vue"; | 20 | import Vue from "vue"; |
21 | 21 | ||
22 | import { library } from "@fortawesome/fontawesome-svg-core"; | 22 | import { library, config } from "@fortawesome/fontawesome-svg-core"; |
23 | import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; | 23 | import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; |
24 | import { | 24 | import { |
25 | faExpandArrowsAlt, | 25 | faFolder, |
26 | faFolder, | 26 | faEraser, |
27 | faSearch, | 27 | faSearch, |
28 | faTag, | 28 | faPlus, |
29 | faPlus, | 29 | faMinus, |
30 | faMinus, | 30 | faImage, |
31 | faImage, | 31 | faHome, |
32 | faArrowLeft, | ||
33 | faLevelUpAlt, | ||
34 | faAngleRight, | ||
35 | faAngleDoubleLeft, | ||
36 | faFile, | ||
32 | } from "@fortawesome/free-solid-svg-icons"; | 37 | } from "@fortawesome/free-solid-svg-icons"; |
33 | 38 | ||
34 | library.add( | 39 | library.add( |
35 | faExpandArrowsAlt, | 40 | faFolder, |
36 | faFolder, | 41 | faEraser, |
37 | faSearch, | 42 | faSearch, |
38 | faTag, | 43 | faPlus, |
39 | faPlus, | 44 | faMinus, |
40 | faMinus, | 45 | faImage, |
41 | faImage, | 46 | faHome, |
47 | faArrowLeft, | ||
48 | faLevelUpAlt, | ||
49 | faAngleRight, | ||
50 | faAngleDoubleLeft, | ||
51 | faFile, | ||
42 | ); | 52 | ); |
43 | 53 | ||
54 | config.autoAddCss = false; | ||
55 | import "@fortawesome/fontawesome-svg-core/styles.css"; | ||
56 | |||
44 | Vue.component("fa-icon", FontAwesomeIcon); | 57 | Vue.component("fa-icon", FontAwesomeIcon); |
diff --git a/viewer/src/plugins/lazyimage.ts b/viewer/src/plugins/lazyimage.ts new file mode 100644 index 0000000..276c7e2 --- /dev/null +++ b/viewer/src/plugins/lazyimage.ts | |||
@@ -0,0 +1,23 @@ | |||
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 | import Vue from "vue"; | ||
21 | import { VLazyImagePlugin } from "v-lazy-image"; | ||
22 | |||
23 | Vue.use(VLazyImagePlugin); | ||
diff --git a/viewer/src/plugins/router.ts b/viewer/src/plugins/router.ts new file mode 100644 index 0000000..00979c9 --- /dev/null +++ b/viewer/src/plugins/router.ts | |||
@@ -0,0 +1,42 @@ | |||
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 | import Vue from "vue"; | ||
21 | import VueRouter, { RouteConfig } from "vue-router"; | ||
22 | import GalleryNavigation from "@/views/GalleryNavigation.vue"; | ||
23 | |||
24 | Vue.use(VueRouter); | ||
25 | |||
26 | const routes: RouteConfig[] = [ | ||
27 | { | ||
28 | path: "*", | ||
29 | name: "GalleryNavigation", | ||
30 | component: GalleryNavigation, | ||
31 | props: (route) => ({ | ||
32 | path: route.params.pathMatch, | ||
33 | query: Object.keys(route.query), | ||
34 | }), | ||
35 | }, | ||
36 | ]; | ||
37 | |||
38 | const router = new VueRouter({ | ||
39 | routes, | ||
40 | }); | ||
41 | |||
42 | export default router; | ||