From 40d9439702eae41adc350c66e8f936830cb0d90d Mon Sep 17 00:00:00 2001 From: Johannes Kepper Date: Sun, 27 Aug 2023 02:05:30 +0200 Subject: [PATCH] annotated transcripts from test2 branch --- src/components/AnnotTab.vue | 38 ++++++++++-- src/components/WritingZoneDirectory.vue | 26 ++++---- src/components/shared/ImageComponent.vue | 14 ++--- src/components/shared/VerovioComponent.vue | 72 +++++++++++----------- src/config.json | 2 +- src/store/data/index.js | 67 ++++++++++++++++---- src/store/octokit/index.js | 66 ++++++++++++++++++++ src/tools/mei.js | 28 +++++++++ 8 files changed, 241 insertions(+), 72 deletions(-) diff --git a/src/components/AnnotTab.vue b/src/components/AnnotTab.vue index 8519e78..f9ef3bc 100644 --- a/src/components/AnnotTab.vue +++ b/src/components/AnnotTab.vue @@ -16,9 +16,15 @@ -

{{currentAnnotTabFileName}}

- - + + +
@@ -71,7 +77,13 @@ export default { this.verifySvgAvailable() }) + this.unwatchAnnotTransVerification = this.$store.watch((state, getters) => getters.currentWzAtPath, + (newPath, oldPath) => { + this.verifyAnnotTransLoaded() + }) + this.verifySvgAvailable() + this.verifyAnnotTransLoaded() }, beforeUnmount () { this.unwatchSvgVerification() @@ -95,6 +107,15 @@ export default { }) } }, + verifyAnnotTransLoaded () { + const atPath = this.$store.getters.currentWzAtPath + const at = this.$store.getters.annotatedTranscriptForCurrentWz + if (this.$store.getters.availableAnnotatedTranscripts.indexOf(atPath) !== -1 && !at) { + this.$store.dispatch('loadAnnotatedTranscript', { + path: atPath + }) + } + }, uploadAnnotTrans ({ target: input }) { const file = input?.files[0] console.log(file) @@ -123,13 +144,17 @@ export default { ...mapGetters(['annotTabLeftSidebarVisible', 'annotTabRightSidebarVisible', 'writingZonesOnCurrentPage', 'activeWritingZone']), showFilePicker () { const wz = this.writingZonesOnCurrentPage?.find(wz => wz.id === this.activeWritingZone) - console.log(wz) + // console.log(wz) return wz && !wz.annotTrans }, currentAnnotTabFileName () { - // TODO create / retrieve filename - // return 'NK_p005_wz02_at.xml' return this.$store.getters.currentWzAtPath + }, + annotatedTranscriptForCurrentWz () { + return this.$store.getters.annotatedTranscriptForCurrentWz + }, + previewImageUri () { + return this.$store.getters.currentWzImageUri } } } @@ -172,6 +197,7 @@ export default { flex: 1 1 auto; order: 2; height: calc(100vh - $totalHeaderHeight - $topMenuHeight - 10px); + overflow: scroll; } } } diff --git a/src/components/WritingZoneDirectory.vue b/src/components/WritingZoneDirectory.vue index ceeda43..4752047 100644 --- a/src/components/WritingZoneDirectory.vue +++ b/src/components/WritingZoneDirectory.vue @@ -17,18 +17,19 @@ -