From 964dcf5c85b68207e5bc6c36c0a438855a22e26e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 23 Oct 2020 16:58:15 +0200 Subject: footnotes in pull quotes --- .../components/annotations/annotation.index.css | 2 +- .../annotationForms/annotationForm.video.js | 14 ++++---- .../app/views/paragraph/paragraph.reducer.js | 1 + .../viewer/player/components.inline/inline.text.js | 40 +++++++++++++-------- .../transcript/components/elementTypes.text.js | 41 ++++++++++++++-------- .../viewer/transcript/transcript.container.js | 1 + 6 files changed, 64 insertions(+), 35 deletions(-) (limited to 'animism-align/frontend/app') diff --git a/animism-align/frontend/app/views/align/components/annotations/annotation.index.css b/animism-align/frontend/app/views/align/components/annotations/annotation.index.css index 5547408..af44212 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotation.index.css +++ b/animism-align/frontend/app/views/align/components/annotations/annotation.index.css @@ -52,7 +52,7 @@ width: 200px; } .annotationIndex .annotation.text_plate { - left: calc(405px + 0.5rem); + left: calc(605px + 0.5rem); } .annotation.curtain { background-image: linear-gradient(rgba(255,255,255,1.0), rgba(255,255,255,1.0)); diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js index 7bbe952..0199b46 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js @@ -56,12 +56,14 @@ export const AnnotationFormVideo = ({ annotation, media, handleSettingsSelect, h onChange={handleSettingsSelect} /> )} - + {(annotation.settings.fullscreen && !annotation.settings.inline) && ( + + )}
onAnnotationClick(e, paragraph, firstAnnotation)}>{SpeakerIcon}
- {paragraph.annotations.map(annotation => ( - onAnnotationClick(e, paragraph, firstAnnotation)} - dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} - /> - ))} + {paragraph.annotations.map(annotation => { + if (annotation.type === 'footnote') { + return ( + onAnnotationClick(e, paragraph, annotation)} + dangerouslySetInnerHTML={{ __html: annotation.footnote_id }} + /> + ) + } + return ( + onAnnotationClick(e, paragraph, firstAnnotation)} + dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} + /> + ) + })} ) } 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 64bfb63..e81ee7b 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 @@ -8,6 +8,7 @@ export const Paragraph = ({ paragraph, currentParagraph, currentAnnotation, onAn if (className !== 'paragraph') className += ' paragraph' if (currentParagraph) className += ' current' const firstAnnotation = paragraph.annotations[0] +console.log(paragraph.start_ts, paragraph) return (
- {paragraph.annotations.map(annotation => ( - onAnnotationClick(e, paragraph, annotation)} - dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} - /> - ))} + {paragraph.annotations.map(annotation => { + if (annotation.type === 'footnote') { + return ( + onAnnotationClick(e, annotation, annotation)} + dangerouslySetInnerHTML={{ __html: annotation.footnote_id }} + /> + ) + } + return ( + onAnnotationClick(e, paragraph, annotation)} + dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} + /> + ) + })}
) } diff --git a/animism-align/frontend/app/views/viewer/transcript/transcript.container.js b/animism-align/frontend/app/views/viewer/transcript/transcript.container.js index b12fc18..52ff2f6 100644 --- a/animism-align/frontend/app/views/viewer/transcript/transcript.container.js +++ b/animism-align/frontend/app/views/viewer/transcript/transcript.container.js @@ -129,6 +129,7 @@ class Transcript extends Component { render() { const { viewer, paragraphs } = this.props + console.log(paragraphs.map(p => p.annotations.filter(a => a.type === 'footnote')).filter(p => p.length)) return (