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 --- animism-align/frontend/app/constants.js | 6 ++- .../frontend/app/utils/transcript.utils.js | 24 ++++++++++- .../components/annotations/annotation.form.js | 2 +- .../annotationForms/annotationForm.utility.js | 48 ++++++++++++++++++++++ .../annotations/annotationForms/index.js | 2 + .../annotationTypes/annotationTypes.utility.js | 34 +++++++++++++++ .../annotations/annotationTypes/index.js | 2 + .../views/viewer/player/components.inline/index.js | 5 +++ .../player/components.inline/inline.utility.js | 22 ++++++++++ .../app/views/viewer/player/player.transcript.css | 31 ++++++++++++++ .../frontend/app/views/viewer/viewer.actions.js | 13 ++++-- 11 files changed, 182 insertions(+), 7 deletions(-) create mode 100644 animism-align/frontend/app/views/viewer/player/components.inline/inline.utility.js (limited to 'animism-align') diff --git a/animism-align/frontend/app/constants.js b/animism-align/frontend/app/constants.js index 2ed5563..1acdf5b 100644 --- a/animism-align/frontend/app/constants.js +++ b/animism-align/frontend/app/constants.js @@ -56,7 +56,11 @@ export const MEDIA_LABEL_TYPES = { vitrine: 'Vitrine', } -export const UTILITY_ANNOTATION_TYPES = new Set([ +export const INLINE_UTILITY_ANNOTATION_TYPES = new Set([ + 'intro', +]) + +export const FULLSCREEN_UTILITY_ANNOTATION_TYPES = new Set([ 'curtain', ]) 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 } diff --git a/animism-align/frontend/app/views/align/components/annotations/annotation.form.js b/animism-align/frontend/app/views/align/components/annotations/annotation.form.js index 5842aab..80a960f 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotation.form.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotation.form.js @@ -16,7 +16,7 @@ const ANNOTATION_TYPES = [ 'sentence', 'section_heading', 'heading_text', 'paragraph_end', 'video', 'image', 'image_carousel', - 'curtain', + 'curtain', 'intro', ].map(name => ({ name, label: capitalize(name.replace('_', ' ')) })) class AnnotationForm extends Component { diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js index 6c835c5..750c3a7 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js @@ -5,6 +5,54 @@ import { TextInput, LabelDescription, Select, Checkbox } from 'app/common' import { CURTAIN_COLOR_SELECT_OPTIONS } from 'app/constants' import { annotationFadeTimings } from 'app/utils/annotation.utils' +export const AnnotationFormIntro = ({ annotation, media, handleSettingsChange, handleSettingsSelect }) => { + if (!media.lookup) return
+ const { lookup, order } = media + const image_list_items = order.filter(id => lookup[id].type === 'file').map(id => { + const image = lookup[id] + return { + name: image.id, + label: image.title + } + }) + return ( +
+