Implement local save and load buttons #28

Merged
mslw merged 15 commits from local-save into master 2022-06-29 09:20:26 +00:00

15 commits

Author SHA1 Message Date
a78244ecef Add local variables to better control emacs indent behaviour 2022-06-28 18:10:21 +02:00
2e6f544044 Add prettier config 2022-06-28 18:10:21 +02:00
dc749e9d39 Prettify local loading script
Used prettier with almost default settings to convert all indents
to spaces; unify quote symbols, spaces around brackets and the like.
2022-06-28 18:10:09 +02:00
983d61509f Convert spaces to tabs in some recently changed html & js parts 2022-06-28 18:02:54 +02:00
e845d22448 Prettify local saving script
Used prettier with almost default settings to convert all indents
to spaces; unify quote symbols, spaces around brackets and the like.

Tweaked spaces between script blocks.
2022-06-28 17:52:05 +02:00
f06d6a68e7 Remove <a> element created for local download after use 2022-06-28 15:13:35 +02:00
5f9ca02489 Refuse to save locally if subject pseudonym is missing 2022-06-28 15:10:22 +02:00
5ec9c96029 Refactor local load and clean up the code
Divided the loading functions a little bit to make it clearer
how event listeners go (file loading is based on events).

Moved the invisible file input field definition to html and adjusted
the way events are triggered.
2022-06-22 19:02:26 +02:00
5d49944251 Clean the form on load and handle go/no-go
This is my best attempt at returning the form to a clean state,
so that incomplete entries don't mess with loaded ones.
Because form.reset() resets the sliders which enable/disable fields
without triggering related events, this includes explicitly setting
the disabled property.

Some go/no-go fields trigger events which show more related fields.
These get special handling in this commit.
2022-06-22 17:33:52 +02:00
cc7d66e294 Handle loading of: subject group, patient-related fields, notes 2022-06-22 16:55:00 +02:00
61d2d13ad8 Add subject-group to locally saved items 2022-06-20 17:20:21 +02:00
d4787c1a41 Draft loading of local data 2022-06-20 17:20:21 +02:00
689da1be47 Add emacs local variables (html indent width) for convenience 2022-06-14 12:19:00 +02:00
dd570fffe4 Draft the local save with JavaScript
Almost everything will change, but this commit introduces building
blocks for a functional "local save" button.
2022-06-13 20:13:29 +02:00
1ffd6b9263 Refactor getContentString()
Refactored getContentString() to allow different representations
(string, array, or object) in preparation for local saving.

This preserves getContentString() behaviour, while adding an easy
way to create an object to be saved.
2022-06-13 20:13:29 +02:00