summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/utils
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-08-07 18:16:54 +0200
committerJules Laplace <julescarbon@gmail.com>2020-08-07 18:17:09 +0200
commitf38815753af0b72c0407a2efe448a6c8a027ddca (patch)
tree453afeba6417cdac169fc7db46a243ab219cd17e /animism-align/frontend/app/utils
parent1f58406d9e0e4a7e2bbb4afa02d3c96b82bd0de1 (diff)
add intro gif
Diffstat (limited to 'animism-align/frontend/app/utils')
-rw-r--r--animism-align/frontend/app/utils/transcript.utils.js24
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
}