diff options
Diffstat (limited to 'animism-align/frontend/app/utils')
| -rw-r--r-- | animism-align/frontend/app/utils/transcript.utils.js | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/animism-align/frontend/app/utils/transcript.utils.js b/animism-align/frontend/app/utils/transcript.utils.js index 6400394..f6ab7a8 100644 --- a/animism-align/frontend/app/utils/transcript.utils.js +++ b/animism-align/frontend/app/utils/transcript.utils.js @@ -2,7 +2,8 @@ import { store, history, dispatch } from 'app/store' import { TEXT_ANNOTATION_TYPES, MEDIA_ANNOTATION_TYPES, - UTILITY_ANNOTATION_TYPES, + INLINE_UTILITY_ANNOTATION_TYPES, + FULLSCREEN_UTILITY_ANNOTATION_TYPES, } from 'app/constants' export const buildParagraphs = (annotationOrder, sectionCount) => { @@ -21,7 +22,26 @@ export const buildParagraphs = (annotationOrder, sectionCount) => { const paragraph = paragraphLookup[annotation.paragraph_id] // if this annotation is a utility (curtain, gallery instructions), then skip it - if (UTILITY_ANNOTATION_TYPES.has(annotation.type)) { + if (FULLSCREEN_UTILITY_ANNOTATION_TYPES.has(annotation.type)) { + return + } + + // if this annotation is an inline utility (intro div) don't skip it + if (INLINE_UTILITY_ANNOTATION_TYPES.has(annotation.type)) { + if (!annotation.settings.hideCitation) { + const item = { + id: ('index_' + annotation.id), + type: annotation.type, + start_ts: annotation.start_ts, + end_ts: 0, + annotations: [annotation], + } + if (annotation.type === 'intro') { + paragraphs.unshift(item) + } else { + paragraphs.push(item) + } + } return } |
