Commit c5346ab8 authored by dindigala's avatar dindigala
Browse files

refactor: addressing review comments

parent ec5b7981
Pipeline #219201 passed with stages
in 4 minutes and 37 seconds
...@@ -286,7 +286,10 @@ export default { ...@@ -286,7 +286,10 @@ export default {
if (id.startsWith('.')) { if (id.startsWith('.')) {
id = id.replace('.', ''); id = id.replace('.', '');
} }
prev[id] = curr.body.value; prev[id] = {
value: curr.body.value,
contentType: curr.body['x-content-type'],
};
return prev; return prev;
}, {}); }, {});
...@@ -345,12 +348,26 @@ export default { ...@@ -345,12 +348,26 @@ export default {
tooltipEl.setAttribute('data-annotation-classes', `${el.className}`); tooltipEl.setAttribute('data-annotation-classes', `${el.className}`);
tooltipEl.setAttribute('class', 'annotation-tooltip'); tooltipEl.setAttribute('class', 'annotation-tooltip');
// TODO: add translation ability to the string "Referenced Annotation"
// TODO: plural/singluar "s" to "Referenced Annotation" depending of count of annotation references
// TODO: don't list annotation references via comma, but add a linebreak instead
// TODO: start every annotation reference with the follwoing string " - "
// TODO: add icon to (before) every annotation reference // TODO: add icon to (before) every annotation reference
const text = `<span class="text-body1">Referenced Annotation:</span><br><span class="text-body2">${annotationClasses.join(', ')}</span>`; const isMultiple = annotationClasses.length > 1;
let annotationLists = '';
annotationClasses.forEach((annotationList) => {
annotationLists += `<li>
${this.createSVG(this.getIconName(annotationList.contentType)).outerHTML}
<span>
${annotationList.value}
</span>
</li>`;
});
const text = `<span class="text-body1">
${!isMultiple ? `${this.$t('toolTip_Reference')}` : `${this.$t('toolTip_References')}`} :
</span>
<br>
<div class="text-body2">
${annotationLists}
</div>`;
tooltipEl.innerHTML = text; tooltipEl.innerHTML = text;
tooltipEl.setAttribute('id', this.getTooltipId(el)); tooltipEl.setAttribute('id', this.getTooltipId(el));
...@@ -499,6 +516,21 @@ export default { ...@@ -499,6 +516,21 @@ export default {
.annotation-tooltip { .annotation-tooltip {
-webkit-touch-callout: none; -webkit-touch-callout: none;
} }
.text-body2 {
list-style-type: none;
padding: 8px;
}
.text-body2 > li {
margin: none;
text-indent: -4px;
}
.text-body2 > li::before {
content: '-';
text-indent: -4px;
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -58,6 +58,8 @@ export default { ...@@ -58,6 +58,8 @@ export default {
Title: 'Titel', Title: 'Titel',
title_homepage: 'Die syrischen und arabischen Ahiqar-Texte', title_homepage: 'Die syrischen und arabischen Ahiqar-Texte',
title_viewer: 'Edition anzeigen', title_viewer: 'Edition anzeigen',
toolTip_Reference: 'Referenzierte Annotation',
toolTip_References: 'Referenzierte Annotationen',
transcription: 'Transkription', transcription: 'Transkription',
transliteration: 'Transliteration', transliteration: 'Transliteration',
Year: 'Erstellungsjahr', Year: 'Erstellungsjahr',
......
...@@ -58,6 +58,8 @@ export default { ...@@ -58,6 +58,8 @@ export default {
Title: 'Title', Title: 'Title',
title_homepage: 'The Syriac, Arabic, and Karshuni Ahiqar Texts', title_homepage: 'The Syriac, Arabic, and Karshuni Ahiqar Texts',
title_viewer: 'Edition Viewer', title_viewer: 'Edition Viewer',
toolTip_Reference: 'Referenced Annotation',
toolTip_References: 'Referenced Annotations',
transcription: 'Transcription', transcription: 'Transcription',
transliteration: 'Transliteration', transliteration: 'Transliteration',
Year: 'Year of creation', Year: 'Year of creation',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment