summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/viewer.actions.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-10-20 19:25:35 +0200
committerJules Laplace <julescarbon@gmail.com>2020-10-20 19:25:35 +0200
commit1600ab3446f533a6824512d616131c7d02a037c7 (patch)
treeb0a3a5cf08d58583e82f9170f72201398e99cdb9 /animism-align/frontend/app/views/viewer/viewer.actions.js
parent597356b755b2453d17bc7e13e6d7f7f3d966bf6b (diff)
add footnote type and text plate type. keep track of footnotes when accumulating paragraphs.
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js12
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) => ({