... | ... | @@ -101,8 +101,11 @@ Configures how suggestion data from external sources are mapped into inputs. Cat |
|
|
The state of the application is held in a set of object structures under the control of the Ractive.js instance. The most important part of the structure is the `inputGroups`, which is derived from the `tabs` array in the configuration enriched by the ontology. Accessing the model is done via `ractive.get()` function with a path as argument, e.g. `ractive.get('inputGroups.1.inputs.3')` which retrieves the fourth input of the second tab. Each input again has a `values` array with each element having a `current.value` and `old.value`. When values are changed, a delta is generated based on difference between a value's old and current value. The delta is then sent to back end as a `HTTP PATCH`-request. Value structs representing a link to another resource has in addition a `displayValue` field, containing the name or a more user friendly representation of the linked resource.
|
|
|
|
|
|
Below are screenshots showing input fields for main contributor and corresponding data structure at the deepest level in the state tree.
|
|
|
|
|
|
![image](files/mainresp.png)
|
|
|
|
|
|
![image](files/values.png)
|
|
|
|
|
|
### Partials
|
|
|
Even if the application's main engine is a massive block of code, the user interface is divided into a number of parts, called partials in Ractive.js lingo. Partials feed on the context in which they are invoked, such as an `input` node as the example above.
|
|
|
|
... | ... | |