summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/paragraph/transcript.actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/paragraph/transcript.actions.js')
-rw-r--r--animism-align/frontend/app/views/paragraph/transcript.actions.js31
1 files changed, 21 insertions, 10 deletions
diff --git a/animism-align/frontend/app/views/paragraph/transcript.actions.js b/animism-align/frontend/app/views/paragraph/transcript.actions.js
index 3d2b045..7539343 100644
--- a/animism-align/frontend/app/views/paragraph/transcript.actions.js
+++ b/animism-align/frontend/app/views/paragraph/transcript.actions.js
@@ -1,6 +1,10 @@
import * as types from 'app/types'
import { store, history, dispatch } from 'app/store'
-import { MEDIA_TYPES } from 'app/constants'
+import {
+ TEXT_ANNOTATION_TYPES,
+ MEDIA_ANNOTATION_TYPES,
+ UTILITY_ANNOTATION_TYPES,
+} from 'app/constants'
export const buildParagraphs = () => dispatch => {
const state = store.getState()
@@ -13,15 +17,22 @@ export const buildParagraphs = () => dispatch => {
annotationOrder.forEach((annotation_id, i) => {
const annotation = annotationLookup[annotation_id]
const paragraph = paragraphLookup[annotation.paragraph_id]
- // if this annotation is media, insert it after the current paragraph
- if (MEDIA_TYPES.has(annotation.type)) {
- paragraphs.push({
- id: ('index_' + i),
- type: annotation.type,
- start_ts: annotation.start_ts,
- end_ts: 0,
- annotations: [annotation],
- })
+ // if this annotation is a utility (curtain, gallery instructions), then skip it
+ if (UTILITY_ANNOTATION_TYPES.has(annotation.type)) {
+ return
+ }
+ // if this annotation is media, then insert it after the current paragraph
+ if (MEDIA_ANNOTATION_TYPES.has(annotation.type)) {
+ // add option to hide the citation from the transcript
+ if (!annotation.settings.hideCitation) {
+ paragraphs.push({
+ id: ('index_' + i),
+ type: annotation.type,
+ start_ts: annotation.start_ts,
+ end_ts: 0,
+ annotations: [annotation],
+ })
+ }
return
}
// if this annotation is from a different paragraph, make a new paragraph