diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-10-20 21:42:11 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-10-20 21:42:11 +0200 |
| commit | 9dbcd019007317bce9161a067f702edc9ca3d970 (patch) | |
| tree | 5298a76b2ec11775ca4e4bece1c50499fcae18b2 /animism-align/frontend | |
| parent | 4ca7f6ab5ff3076d86c92cda0de38de73af3da47 (diff) | |
footnotes in transcript
Diffstat (limited to 'animism-align/frontend')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js | 29 | ||||
| -rw-r--r-- | animism-align/frontend/app/views/viewer/transcript/transcript.css | 9 |
2 files changed, 30 insertions, 8 deletions
diff --git a/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js b/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js index ed90bca..64bfb63 100644 --- a/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js +++ b/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js @@ -7,20 +7,33 @@ export const Paragraph = ({ paragraph, currentParagraph, currentAnnotation, onAn let className = paragraph.type if (className !== 'paragraph') className += ' paragraph' if (currentParagraph) className += ' current' + const firstAnnotation = paragraph.annotations[0] return ( <div className={className} data-startts={paragraph.start_ts} data-endts={paragraph.end_ts} > - {paragraph.annotations.map(annotation => ( - <span - key={annotation.id} - className={annotation.id === currentAnnotation ? 'current' : ''} - onClick={e => onAnnotationClick(e, paragraph, annotation)} - dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} - /> - ))} + {paragraph.annotations.map(annotation => { + if (annotation.type === 'footnote') { + return ( + <span + key={annotation.id} + className='footnote' + onClick={e => onAnnotationClick(e, annotation, annotation)} + dangerouslySetInnerHTML={{ __html: annotation.footnote_id }} + /> + ) + } + return ( + <span + key={annotation.id} + className={annotation.id === currentAnnotation ? 'current' : ''} + onClick={e => onAnnotationClick(e, paragraph, firstAnnotation)} + dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} + /> + ) + })} </div> ) } diff --git a/animism-align/frontend/app/views/viewer/transcript/transcript.css b/animism-align/frontend/app/views/viewer/transcript/transcript.css index fbaa13f..ed479f2 100644 --- a/animism-align/frontend/app/views/viewer/transcript/transcript.css +++ b/animism-align/frontend/app/views/viewer/transcript/transcript.css @@ -125,3 +125,12 @@ color: #000; transition: all 0.2s; } + +.transcript .footnote { + font-size: 0.8rem; + position: relative; + top: -0.5rem; + left: -0.4rem; + margin-right: -0.2rem; + cursor: pointer; +}
\ No newline at end of file |
