diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-20 22:49:06 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-20 22:49:06 +0100 |
| commit | 5bd7c56c63559d6f8c05d50735895efa429d6dd6 (patch) | |
| tree | 9ad77667fa8f09dec6bc28c18f8d112ce42d038f | |
| parent | daa1060ce3f953a767b88a1108185a9554d91649 (diff) | |
timestampToSeconds converts to float
| -rw-r--r-- | cli/app/site/export.py | 10 | ||||
| -rw-r--r-- | frontend/app/views/page/page.actions.js | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/cli/app/site/export.py b/cli/app/site/export.py index 4ce8b64..67b9538 100644 --- a/cli/app/site/export.py +++ b/cli/app/site/export.py @@ -101,6 +101,8 @@ def sanitize_graph(graph): tile['href'] = page_path_lookup[tile['target_page_id']] if 'url' in tile['settings'] and tile['settings']['url'].startswith('/static'): tile['settings']['url'] = '/' + graph['path'] + tile['settings']['url'] + if len(tile['settings'].get('appear_after', "")): + tile['settings']['appear_after'] = timestampToSeconds(tile['settings']['appear_after']) sanitize_tile(tile) page_path = page_path_lookup[page['id']] page_lookup[page_path] = page @@ -142,3 +144,11 @@ def sanitize_tile(data): del data['page_id'] if 'target_page_id' in data: del data['target_page_id'] + +def timestampToSeconds(time_str): + time_str_parts = list(map(float, time_str.strip().split(":"))) + if len(time_str_parts) == 3: + return (time_str_parts[0] * 60 + time_str_parts[1]) * 60 + time_str_parts[2] + if len(time_str_parts) == 2: + return time_str_parts[0] * 60 + time_str_parts[1] + return time_str_parts[0] diff --git a/frontend/app/views/page/page.actions.js b/frontend/app/views/page/page.actions.js index 0ae38e0..e42d539 100644 --- a/frontend/app/views/page/page.actions.js +++ b/frontend/app/views/page/page.actions.js @@ -63,7 +63,7 @@ export const loadPopups = (page, popups) => dispatch => { } return acc }, { ...popups }) - console.log(popups) + // console.log(popups) dispatch({ type: types.page.load_popups, popups }) } export const togglePopups = () => dispatch => { |
