diff --git a/src/components/Content/EdText.vue b/src/components/Content/EdText.vue index fa42c2b..0a9d806 100644 --- a/src/components/Content/EdText.vue +++ b/src/components/Content/EdText.vue @@ -25,7 +25,7 @@ export default { tei: String, uuid: String, textid: String, - extract: String, + extractid: String, url: String }, data: () => ({ @@ -155,8 +155,10 @@ export default { } }, parseExtract () { - console.log('Parse extract', this.extract) - let regexp = RegExp(this.extract, 'gim') + console.log('Parse extract', this.extractid) + // let regexp = RegExp(this.extract, 'gim') + let regexp = RegExp(`]* id="${this.extractid}"[^>]*>[^<]*`) + // let regexp = RegExp(`<(\w+)((?:\s+\w+(?:\s*=\s*(?:"[\s\S]*?"|'[\s\S]*?'|[^'">\s]+))?)+\s*|\s*)>([\s\S]*?)<\/\1>`) let index = 0 function marking (str) { index++ diff --git a/src/components/Content/IndexItemOcurrences.vue b/src/components/Content/IndexItemOcurrences.vue index edc31b6..b05c36a 100644 --- a/src/components/Content/IndexItemOcurrences.vue +++ b/src/components/Content/IndexItemOcurrences.vue @@ -24,7 +24,7 @@ >

diff --git a/src/components/Content/Occurence.vue b/src/components/Content/Occurence.vue index f08dcb3..803db82 100644 --- a/src/components/Content/Occurence.vue +++ b/src/components/Content/Occurence.vue @@ -2,12 +2,13 @@

( "{{ oc.form }}" ) @@ -79,15 +80,16 @@ export default { ...mapActions({ addHistoryItem: 'History/addItem' }), - onGoToText (e) { - console.log('clicked on text occurence', e, this.oc.title, this.ed) + onGoToText (e, edid, textid, ocid) { + console.log('clicked on text occurence', e, edid, textid, ocid) - if (e.target.getAttribute('eduuid')) { + if (textid) { this.addHistoryItem({ - id: e.target.getAttribute('eduuid'), - textid: e.target.getAttribute('uuid'), + id: edid, + textid: textid, title: this.oc.title, - editionTitle: this.editionTitle + editionTitle: this.editionTitle, + ocid: ocid }) // if (e.target.getAttribute('form')) { // this.$router.push({ @@ -101,9 +103,9 @@ export default { this.$router.push({ name: `editiontextextract`, params: { - id: e.target.getAttribute('eduuid'), - textid: e.target.getAttribute('uuid'), - extract: e.target.getAttribute('form') + id: edid, + textid: textid, + ocid: ocid } }) // } @@ -111,7 +113,7 @@ export default { this.$router.push({ name: `edition`, params: { - id: e.target.getAttribute('uuid') + id: edid } }) } diff --git a/src/components/Layouts/MainContentLayout.vue b/src/components/Layouts/MainContentLayout.vue index 6a79070..723426d 100644 --- a/src/components/Layouts/MainContentLayout.vue +++ b/src/components/Layouts/MainContentLayout.vue @@ -49,7 +49,7 @@ export default { }, methods: { onScrollCenter (e) { - console.log('mainLayout onScrollCenter: e', e) + // console.log('mainLayout onScrollCenter: e', e) this.$emit('onCenterScrolled', e) }, scrollToRef () { diff --git a/src/pages/Edition.vue b/src/pages/Edition.vue index 1308eb7..39fa487 100644 --- a/src/pages/Edition.vue +++ b/src/pages/Edition.vue @@ -81,7 +81,7 @@ :uuid="text.content.uuid" :url="text.content.url" :textid="textid" - :extract="extract" + :extractid="extractid" @onHoverLink="onHoverLink" @onLeaveLink="onLeaveLink" /> @@ -195,7 +195,7 @@ export default { // change also extract if exists if (to.params.extract) { console.log('extract params from route', to.params.extract) - this.extract = to.params.extract + this.extractid = to.params.ocid // scrolling is not working :( this.reftoscrollto = '#mark-1' } @@ -246,8 +246,8 @@ export default { } // get the searchkeys from route param (only comming from result item) for text highlighting - if (this.$route.params.extract) { - this.extract = this.$route.params.extract + if (this.$route.params.ocid) { + this.extractid = this.$route.params.ocid // scrolling is not working :( this.reftoscrollto = '#mark-1' } @@ -351,7 +351,7 @@ export default { }) }, onCenterScrolled (e) { - console.log('Edition centerScrolled(e)', e.target.scrollTop) + // console.log('Edition centerScrolled(e)', e.target.scrollTop) if (!this.center_scrolled && e.target.scrollTop > this.inifinite_load_distance * 1.5) { this.center_scrolled = true } diff --git a/src/router/index.js b/src/router/index.js index 7cee7e7..22879c9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -51,7 +51,7 @@ const routes = [ }, { name: 'editiontextextract', - path: '/texts/:id/:textid/:extract', + path: '/texts/:id/:textid/:ocid', component: Edition }, {