From 8a130c3efa8cccec7367298fc8bb4781f1025d73 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 5 Nov 2022 14:14:38 -0700 Subject: [PATCH] viewer: initial commit --- package-lock.json | 14 ++ package.json | 1 + src/components/Timeline.vue | 11 +- src/components/frame/Photo.vue | 1 + src/components/top-matter/OnThisDay.vue | 2 +- src/services/Utils.ts | 11 +- src/services/Viewer.ts | 270 ++++++++++++++++++------ 7 files changed, 233 insertions(+), 77 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76abefa7..7888914f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "justified-layout": "^4.1.0", "moment": "^2.29.4", "path-posix": "^1.0.0", + "photoswipe": "^5.3.3", "reflect-metadata": "^0.1.13", "vue": "^2.7.10", "vue-class-component": "^7.2.6", @@ -6673,6 +6674,14 @@ "node": ">=0.12" } }, + "node_modules/photoswipe": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/photoswipe/-/photoswipe-5.3.3.tgz", + "integrity": "sha512-BUuulwZwkYFKADSe5xf0dd+wf6dws34ZvqP8R3oYHepRauOXoQHvw600sw1HlWd8K0S3LRCS4jxyR5fTuI383Q==", + "engines": { + "node": ">= 0.12.0" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -14840,6 +14849,11 @@ "sha.js": "^2.4.8" } }, + "photoswipe": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/photoswipe/-/photoswipe-5.3.3.tgz", + "integrity": "sha512-BUuulwZwkYFKADSe5xf0dd+wf6dws34ZvqP8R3oYHepRauOXoQHvw600sw1HlWd8K0S3LRCS4jxyR5fTuI383Q==" + }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", diff --git a/package.json b/package.json index 335d8132..af15325e 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "justified-layout": "^4.1.0", "moment": "^2.29.4", "path-posix": "^1.0.0", + "photoswipe": "^5.3.3", "reflect-metadata": "^0.1.13", "vue": "^2.7.10", "vue-class-component": "^7.2.6", diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index 44b030ba..d77bdb74 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -213,11 +213,10 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) { private scrollerManager!: ScrollerManager & any; /** Nextcloud viewer proxy */ - private viewerManager = new ViewerManager( - this.deleteFromViewWithAnimation.bind(this), - this.updateLoading.bind(this), - this.$route - ); + private viewerManager = new ViewerManager({ + ondelete: this.deleteFromViewWithAnimation, + fetchDay: this.fetchDay, + }); mounted() { this.selectionManager = this.$refs.selectionManager; @@ -1141,7 +1140,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) { // selection mode this.selectionManager.selectPhoto(photo); } else { - this.viewerManager.open(photo); + this.viewerManager.open(photo, this.list); } } diff --git a/src/components/frame/Photo.vue b/src/components/frame/Photo.vue index 08416945..0c673bf2 100644 --- a/src/components/frame/Photo.vue +++ b/src/components/frame/Photo.vue @@ -1,5 +1,6 @@