This commit is contained in:
2020-07-12 14:57:33 +02:00
parent b260758519
commit 64c39862db
4 changed files with 25 additions and 33 deletions
+1
View File
@@ -253,6 +253,7 @@ section[role="main-content"]{
@include title1black; @include title1black;
} }
aside.index-tooltip{ aside.index-tooltip{
z-index:10;
margin-top: -1.75em; margin-top: -1.75em;
position:absolute; position:absolute;
text-align: right; text-align: right;
+4 -17
View File
@@ -43,7 +43,7 @@ export default {
}, },
parseLinks () { parseLinks () {
let links = this.html.match(/<a[^<]+<\/a>/g) let links = this.html.match(/<a[^<]+<\/a>/g)
// console.log('links', links) console.log('links', links)
if (links) { if (links) {
// let domparser = new DOMParser() // let domparser = new DOMParser()
// let domlink // let domlink
@@ -51,20 +51,8 @@ export default {
let index = null let index = null
for (var i = 0; i < links.length; i++) { for (var i = 0; i < links.length; i++) {
// console.log(`link ${i}:`, links[i]) // console.log(`link ${i}:`, links[i])
linkparts = RegExp(/<a class="(.+)" href="(.+)">(.+)<\/a>/g).exec(links[i], 'g') linkparts = RegExp(/<a class="(.+)" href="(.+)" data-index="(.+)">(.+)<\/a>/g).exec(links[i], 'g')
// console.log('linkparts', linkparts) index = linkparts[3]
switch (linkparts[1]) {
case 'persName':
index = 'nominum'
break
case 'placeName':
index = 'locorum'
break
case 'objectName':
index = 'operum'
break
}
if (index) {
uuid = linkparts[2].replace('#', '') uuid = linkparts[2].replace('#', '')
newlink = `<a` + newlink = `<a` +
` class="${linkparts[1]} active-link"` + ` class="${linkparts[1]} active-link"` +
@@ -75,13 +63,12 @@ export default {
` @keyup.enter="onClickRef"` + ` @keyup.enter="onClickRef"` +
` @mouseover="onHoverLink"` + ` @mouseover="onHoverLink"` +
` @mouseleave="onLeaveLink"` + ` @mouseleave="onLeaveLink"` +
`>${linkparts[3]}` + `>${linkparts[4]}` +
`<sup class="mdi mdi-message-text-outline" />` + `<sup class="mdi mdi-message-text-outline" />` +
`</a>` `</a>`
// console.log('newlink', newlink) // console.log('newlink', newlink)
this.html = this.html.replace(links[i], newlink) this.html = this.html.replace(links[i], newlink)
} }
}
// console.log('this.html', this.html) // console.log('this.html', this.html)
} }
}, },
@@ -53,6 +53,7 @@ export default {
}), }),
methods: { methods: {
ocAsArray (oc) { ocAsArray (oc) {
// not necesseary anymore (KB #758)
console.log('Array.isArray(oc)', Array.isArray(oc)) console.log('Array.isArray(oc)', Array.isArray(oc))
return Array.isArray(oc) ? oc : [oc] return Array.isArray(oc) ? oc : [oc]
}, },
+5 -2
View File
@@ -14,13 +14,16 @@
<span v-if="indexitem == 'loading'">Loading ...</span> <span v-if="indexitem == 'loading'">Loading ...</span>
<template v-if="indexitem !== 'loading'"> <template v-if="indexitem !== 'loading'">
<h1 v-html="indexitem.title" /> <h1 v-html="indexitem.title" />
<p class="birthdeath"> <p v-if="indexitem.birthDate" class="birthdeath">
<time>{{ indexitem.birthDate }}</time>, <span class="place">{{ indexitem.birthPlace }}</span><br> <time>{{ indexitem.birthDate }}</time>, <span class="place">{{ indexitem.birthPlace }}</span><br>
<time>{{ indexitem.deathDate }}</time>, <span class="place">{{ indexitem.deathPlace }}</span> <time>{{ indexitem.deathDate }}</time>, <span class="place">{{ indexitem.deathPlace }}</span>
</p> </p>
<p class="occupation"> <p v-if="indexitem.occupation" class="occupation">
{{ indexitem.occupation }} {{ indexitem.occupation }}
</p> </p>
<p v-if="indexitem.type" class="type">
{{ indexitem.type }}
</p>
</template> </template>
</aside> </aside>