From f38815753af0b72c0407a2efe448a6c8a027ddca Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 7 Aug 2020 18:16:54 +0200 Subject: add intro gif --- .../frontend/app/utils/transcript.utils.js | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'animism-align/frontend/app/utils/transcript.utils.js') 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 } -- cgit v1.2.3-70-g09d2