From e9e753640f1c96ffaf91b35cfc46126fcdb15e2f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 12 Nov 2020 18:44:08 +0100 Subject: better control over cover image --- animism-align/frontend/app/constants.js | 20 ++++++++++++++- .../frontend/app/utils/annotation.utils.js | 4 ++- .../components/annotations/annotation.form.js | 17 +++---------- .../annotationForms/annotationForm.text.js | 29 ++++++++++++++++++++-- .../views/viewer/checklist/checklist.content.js | 3 ++- .../components.fullscreen/fullscreen.utility.js | 6 +++-- .../app/views/viewer/player/player.fullscreen.css | 1 + .../views/viewer/sections/viewer.sections.list.js | 12 ++++++--- .../transcript/components/elementTypes.video.js | 2 ++ .../frontend/app/views/viewer/viewer.actions.js | 11 ++++++-- 10 files changed, 79 insertions(+), 26 deletions(-) diff --git a/animism-align/frontend/app/constants.js b/animism-align/frontend/app/constants.js index b70f49c..711d979 100644 --- a/animism-align/frontend/app/constants.js +++ b/animism-align/frontend/app/constants.js @@ -1,3 +1,5 @@ +import { capitalize } from 'app/utils' + export const URLS = { audio: '/static/data_store/peaks/animism_episode_01_2810.mp3', peaks: '/static/data_store/peaks/peaks.json', @@ -44,6 +46,21 @@ export const ROMAN_NUMERALS = [ 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', ] +export const ANNOTATION_SELECT_LABELS = { + 'section_heading': 'Chapter Heading', +} + +export const ANNOTATION_SELECT_OPTIONS = [ + 'sentence', 'section_heading', 'heading_text', 'pullquote_credit', 'paragraph_end', + 'footnote', + 'text_plate', + 'video', 'subtitle', + 'image', + 'gallery', 'carousel', 'grid', 'vitrine', + 'gallery_advance', + 'curtain', 'intro', 'schedule', +].map(name => ({ name, label: ANNOTATION_SELECT_LABELS[name] || capitalize(name.replace('_', ' ')) })) + export const TEXT_ANNOTATION_TYPES = new Set([ 'section_heading', 'heading_text', 'sentence', 'paragraph_end', 'pullquote_credit', 'footnote', 'text_plate', 'subtitle', @@ -95,7 +112,7 @@ export const BLACK_WHITE_SELECT_OPTIONS = [ ] export const CURTAIN_STYLE_SELECT_OPTIONS = [ - { label: 'section heading', name: 'section_heading'}, + { label: 'chapter heading', name: 'section_heading'}, { label: 'video title', name: 'video_title'}, { label: 'default', name: 'default'}, ] @@ -116,6 +133,7 @@ export const IMAGE_BACKGROUND_SIZE_OPTIONS = [ { label: 'Contain', name: 'contain' }, { label: '90% Width', name: '90% auto' }, { label: '90% Height', name: 'auto 90%' }, + { label: 'Hidden', name: 'hidden' }, ] export const IMAGE_INLINE_SIZE_OPTIONS = [ diff --git a/animism-align/frontend/app/utils/annotation.utils.js b/animism-align/frontend/app/utils/annotation.utils.js index 5bf21b5..76175c9 100644 --- a/animism-align/frontend/app/utils/annotation.utils.js +++ b/animism-align/frontend/app/utils/annotation.utils.js @@ -87,7 +87,9 @@ export const sectionProgressPercentage = (section, play_ts) => { export const makeMediaItems = (media, types) => { const { lookup, order } = media - if (!(types instanceof Set)) { + if (types instanceof String) { + types = new Set([ types ]) + } else if (!(types instanceof Set)) { types = new Set(types) } const listItems = order.filter(id => types.has(lookup[id].type)).map(id => { 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 e0a66e4..7b1918a 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 @@ -5,24 +5,13 @@ import { connect } from 'react-redux' import actions from 'app/actions' -import { MEDIA_ANNOTATION_TYPES } from 'app/constants' -import { clamp, timestamp, capitalize } from 'app/utils' +import { ANNOTATION_SELECT_OPTIONS, MEDIA_ANNOTATION_TYPES } from 'app/constants' +import { timestamp } from 'app/utils' import { timeToPosition } from 'app/utils/align.utils' import { Select } from 'app/common' import { annotationFormLookup } from './annotationForms' -const ANNOTATION_TYPES = [ - 'sentence', 'section_heading', 'heading_text', 'pullquote_credit', 'paragraph_end', - 'footnote', - 'text_plate', - 'video', 'subtitle', - 'image', - 'gallery', 'carousel', 'grid', 'vitrine', - 'gallery_advance', - 'curtain', 'intro', 'schedule', -].map(name => ({ name, label: capitalize(name.replace('_', ' ')) })) - const annotationTextTypes = new Set([ 'sentence', 'section_heading', 'heading_text', 'pullquote_credit', 'footnote', 'text_plate', ]) @@ -148,7 +137,7 @@ class AnnotationForm extends Component { +