summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-11-16 17:12:36 +0100
committerJules Laplace <julescarbon@gmail.com>2020-11-16 17:12:36 +0100
commit45d27cf690dc2a564563aebf5488e297255e5735 (patch)
tree09a4cba7210c0a4f11639ec5193b0d42f46b2929
parent92881093ae19e4d76193447c187028aee5cbe4c7 (diff)
document, remove stray console logs!
-rw-r--r--animism-align/README.md29
-rw-r--r--animism-align/cli/app/server/viewer.py36
-rw-r--r--animism-align/frontend/app/views/viewer/modals/modals.vitrine.js2
-rw-r--r--animism-align/frontend/app/views/viewer/nav/nav.parent.js2
-rw-r--r--animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.text.js2
-rw-r--r--animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.utility.js2
-rw-r--r--animism-align/frontend/app/views/viewer/player/player.container.js2
-rw-r--r--animism-align/frontend/app/views/viewer/player/player.transcript.js2
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js6
-rw-r--r--animism-align/frontend/site/site/site.reducer.js2
10 files changed, 41 insertions, 44 deletions
diff --git a/animism-align/README.md b/animism-align/README.md
index f2c226c..4c09c65 100644
--- a/animism-align/README.md
+++ b/animism-align/README.md
@@ -13,7 +13,7 @@ npm install
## Generating waveform peaks
-Make sure your source sound is encoded as a 192 kbps CBR MP3, then generate the peaks:
+Make sure your source sound is encoded as a 192 kbps CBR MP3 (for accurate time sync), then generate the peaks:
```
ffmpeg -i original.wav -ar 44100 -b:a 192k ../data_store/peaks/episode_99.mp3
@@ -54,3 +54,30 @@ Generate a new migration if you've modified the database:
./cli.py db revision --autogenerate -m 'describe the changes'
./cli.py db upgrade head
```
+
+## Export
+
+For production, export a static version of the episode. This will make an exported folder in `data_store/exports/` which you can zip and upload somewhere.
+
+```
+./cli.py site export -o animism
+./cli.py viewer run
+```
+
+* The viewer will be running on e.g. http://0.0.0.0:5000/episode1/index.html
+* Currently no `index.html` resolution is performed.
+* For now, the site structure entails:
+
+```
+/index.html # redirects to first episode
+/episode1/index.html # episode player
+/episode1/media/... # all episode media copied here
+/static/ # non-site-media, fonts, etc
+```
+
+## History
+
+- 2020.05 - Received designs from Other Means
+- 2020.06 - Development begins
+- 2020.10 - Audio re-recorded
+- 2020.11 - Site launches with Episode 1
diff --git a/animism-align/cli/app/server/viewer.py b/animism-align/cli/app/server/viewer.py
index 3eecc4e..c5496f5 100644
--- a/animism-align/cli/app/server/viewer.py
+++ b/animism-align/cli/app/server/viewer.py
@@ -18,7 +18,8 @@ from app.settings import app_cfg
def create_app(script_info=None):
"""
- functional pattern for creating the flask app
+ Instantiate a standalone viewer of an exported build.
+ Used because Flask is better than SimpleHTTPServer at serving media.
"""
logging.debug("Starting site viewer...")
# print(app_cfg.SERVER_NAME)
@@ -26,41 +27,10 @@ def create_app(script_info=None):
app.config['SERVER_NAME'] = app_cfg.SERVER_NAME
app.url_map.strict_slashes = False
- # index_html = 'site.html'
-
- # @app.route('/episode1', methods=['GET'])
- # def serve_dir_directory_index():
- # return send_from_directory(app_cfg.DIR_STATIC_SITE_VIEWER, 'episode1/index.html')
-
- # @app.errorhandler(404)
- # def page_not_found(e):
- # filename = request.url.replace(app_cfg.SERVER_NAME, '')
- # print(filename)
- # # return app.send_static_file(index_html), 200
-
- # @app.route('/<path:filename>', methods=['GET'])
- # def serve_file_in_dir(filename):
- # print(filename)
- # if os.path.isfile(os.path.join(app_cfg.DIR_STATIC_SITE_VIEWER, filename)):
- # return send_from_directory(app_cfg.DIR_STATIC_SITE_VIEWER, filename)
- # if os.path.isfile(os.path.join(app_cfg.DIR_STATIC_SITE_VIEWER, filename, 'index.html')):
- # filename = os.path.join(filename, 'index.html')
- # return send_from_directory(app_cfg.DIR_STATIC_SITE_VIEWER, filename)
- # return 404
-
- # return app.send_static_file(index_html), 200
- # path = os.path.join(os.path.dirname(__file__), 'site.html')
- # with open(path, "r") as f:
- # return f.read(), 200
-
- # @app.route('/', methods=['GET'])
- # def index():
- # return app.send_static_file('site.html')
-
@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static/img/'),
- 'favicon.ico',mimetype='image/vnd.microsoft.icon')
+ 'favicon.ico', mimetype='image/vnd.microsoft.icon')
@app.shell_context_processor
def shell_context():
diff --git a/animism-align/frontend/app/views/viewer/modals/modals.vitrine.js b/animism-align/frontend/app/views/viewer/modals/modals.vitrine.js
index 7cea428..a33bee3 100644
--- a/animism-align/frontend/app/views/viewer/modals/modals.vitrine.js
+++ b/animism-align/frontend/app/views/viewer/modals/modals.vitrine.js
@@ -15,7 +15,7 @@ class VitrineModal extends Component {
<div className='vitrine-modal'></div>
)
}
- console.log(color)
+ // console.log(color)
const className = open ? 'vitrine-modal open' : 'vitrine-modal'
const id = media.settings.image_order[index]
const image = media.settings.display_lookup[id] || media.settings.image_lookup[id]
diff --git a/animism-align/frontend/app/views/viewer/nav/nav.parent.js b/animism-align/frontend/app/views/viewer/nav/nav.parent.js
index cb83f94..0ad04c7 100644
--- a/animism-align/frontend/app/views/viewer/nav/nav.parent.js
+++ b/animism-align/frontend/app/views/viewer/nav/nav.parent.js
@@ -61,7 +61,7 @@ class NavParent extends Component {
e && e.preventDefault()
e && e.stopPropagation()
const { viewer } = this.props
- console.log('>> SEEK', viewer.nextSection)
+ // console.log('>> SEEK', viewer.nextSection)
if (viewer.nextSection) {
actions.viewer.seekToSection(viewer.nextSection)
} else {
diff --git a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.text.js b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.text.js
index d9f7117..013460f 100644
--- a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.text.js
+++ b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.text.js
@@ -1,7 +1,7 @@
import React from 'react'
export const FullscreenTextPlate = ({ element, transitionDuration }) => {
- console.log(element)
+ // console.log(element)
const { color } = element
const style = {
backgroundColor: color.backgroundColor.replace('1.0', '0.8'),
diff --git a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.utility.js b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.utility.js
index 02a9525..3c6380c 100644
--- a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.utility.js
+++ b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.utility.js
@@ -11,7 +11,7 @@ export const FullscreenCurtain = ({ element, transitionDuration }) => {
color: color.textColor,
transitionDuration,
}
- console.log(element)
+ // console.log(element)
const curtainBackground = (element.cover_style !== "hidden" && !!element.mediaItem) && {
backgroundImage: 'url(' + (displayThumbnailURL(element.mediaItem)) + ')',
backgroundSize: element.cover_style,
diff --git a/animism-align/frontend/app/views/viewer/player/player.container.js b/animism-align/frontend/app/views/viewer/player/player.container.js
index 0bf64d1..87a325b 100644
--- a/animism-align/frontend/app/views/viewer/player/player.container.js
+++ b/animism-align/frontend/app/views/viewer/player/player.container.js
@@ -83,7 +83,7 @@ class PlayerContainer extends Component {
// console.log('inCurrentSection?', inCurrentSection)
// console.log('didSeek?', didSeek)
// if the current TS isn't in the same section as the current one...
- console.log(currentSection.start_ts, play_ts, currentSection.end_ts)
+ // console.log(currentSection.start_ts, play_ts, currentSection.end_ts)
if (inCurrentSection) {
return
}
diff --git a/animism-align/frontend/app/views/viewer/player/player.transcript.js b/animism-align/frontend/app/views/viewer/player/player.transcript.js
index 9796008..3599976 100644
--- a/animism-align/frontend/app/views/viewer/player/player.transcript.js
+++ b/animism-align/frontend/app/views/viewer/player/player.transcript.js
@@ -60,7 +60,7 @@ class PlayerTranscript extends Component {
const className = "player-transcript " + color + " " + (
inlineParagraphCount > 2 ? 'scrollable' : 'not-scrollable'
)
- console.log(this.props.section)
+ // console.log(this.props.section)
return (
<div
className={className}
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js
index 1372013..71dfa46 100644
--- a/animism-align/frontend/app/views/viewer/viewer.actions.js
+++ b/animism-align/frontend/app/views/viewer/viewer.actions.js
@@ -47,7 +47,7 @@ export const loadSections = () => dispatch => {
const { order: annotationOrder, lookup: annotationLookup } = state.annotation.index
const { lookup: mediaLookup } = state.media.index
- console.log(state)
+ // console.log(state)
// loop over the annotations in time order.
annotationOrder.forEach((annotation_id, i) => {
@@ -392,7 +392,7 @@ export const setSectionFromTimestamp = play_ts => dispatch => {
/* footnotes */
export const openFootnote = (annotation) => dispatch => {
- console.log(annotation)
+ // console.log(annotation)
dispatch({ type: types.viewer.open_footnote, footnote_id: annotation.footnote_id })
hideNavElementsNotMatchedBy('footnotes')(dispatch)
showComponent('footnotes')(dispatch)
@@ -401,7 +401,7 @@ export const openFootnote = (annotation) => dispatch => {
/* vitrine modal */
export const openVitrineModal = (media, color, id) => dispatch => {
- console.log(media)
+ // console.log(media)
const index = media.settings.image_order.indexOf(id)
dispatch({ type: types.viewer.open_vitrine_modal, media, color, index })
}
diff --git a/animism-align/frontend/site/site/site.reducer.js b/animism-align/frontend/site/site/site.reducer.js
index ea10886..5c2307c 100644
--- a/animism-align/frontend/site/site/site.reducer.js
+++ b/animism-align/frontend/site/site/site.reducer.js
@@ -4,7 +4,7 @@ const initialState = {
}
export default function siteReducer(state = initialState, action) {
- console.log(action.type, action)
+ // console.log(action.type, action)
switch (action.type) {
default:
return state