diff options
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/viewer.actions.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js index 6894b3a..d5ad61a 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -35,6 +35,7 @@ export const loadSections = () => dispatch => { // keep track of all annotations that constitute the "text" of the essay // these include sentences, headings, and inline media. used to build paragraphs, then reset. let sectionTextAnnotationOrder = [] + let footnoteList = [] // keep track of all annotations that constitute fullscreen events. // these include curtains, title cards, and fullscreen media. @@ -56,7 +57,9 @@ export const loadSections = () => dispatch => { // finish off the previous section. if (currentSection) { currentSection.mediaLabels = Object.keys(currentMediaLabels).sort().join(', ') - currentSection.paragraphs = buildParagraphs(sectionTextAnnotationOrder, currentSection.index) + let { paragraphs, footnotes } = buildParagraphs(sectionTextAnnotationOrder, currentSection.index, footnoteList.length) + currentSection.paragraphs = paragraphs + footnoteList = footnoteList.concat(footnotes) currentSection.end_ts = currentSection.paragraphs[currentSection.paragraphs.length - 1].end_ts } // create a new section and reset state variables @@ -136,7 +139,9 @@ export const loadSections = () => dispatch => { // finished processing all annotations. finish off the last section. if (currentSection) { currentSection.mediaLabels = Object.keys(currentMediaLabels).sort().join(', ') - currentSection.paragraphs = buildParagraphs(sectionTextAnnotationOrder, currentSection.index) + let { paragraphs, footnotes } = buildParagraphs(sectionTextAnnotationOrder, currentSection.index) + currentSection.paragraphs = paragraphs + footnoteList = footnoteList.concat(footnotes) currentSection.end_ts = timeline.duration } @@ -178,8 +183,9 @@ export const loadSections = () => dispatch => { } console.log(sections) + console.log(footnoteList) // console.log(fullscreenTimeline) - dispatch({ type: types.viewer.load_sections, sections }) + dispatch({ type: types.viewer.load_sections, sections, footnoteList }) } const newSection = (annotation, index, mediaIndex) => ({ |
