latin-language-toolkit/arethusa — pull request #402 by LFDM (2014-09-13 23:57:38+00:00)
Title: WIP: Chunk changes on the fly - decoupling clickActions in token directive

We can now change the chunk loaded into state on the fly.

Currently activated is changing the size of the current chunk.

Conceptually we will support different chunk modes as well - the `navigator` has such pieces already built in and `globalSettings` shows this option already, however no other implementation has been made yet.

This required changes to the `dependencyTree` directive, which can work with multiple sentences now. It doesn't display them at the same time, but adds nice button-like bars to switch between sentences, when more than one tree is available in state.

The id system also received minor changes - the default internal id structure for now is something like `0001-0002` (this would be the second token of the first sentence).

Very good feature addition through refactor:
`state` doesn't know anything about changing heads now and neither does the `token` directive. `globalSettings` provides an API to define clickActions now (as well as defining hover events before such a clickAction is executed). Changing heads is the domain of the `depTree` plugin - it therefore adds such a clickAction to `globalSettings`.

This is already beneficial, as it fixes #98 - and in a much cleaner way than proposed there by @Christof.

Future plugins will use this to define there own click handlers. Some changes to this system will be needed, as some clickActions can be turned on at the same time, e.g. creating dependency arcs and doing a translation alignment can be live together, as different areas have to be clicked to do one or the other.

Still TODO:

- [ ] Retriever defined preselections are broken - they need to support the new ids
- [ ] artificialTokens need to use the new id system. Need to handle the old id system in the `TreebankRetriever` as well, so that we can stay backwards-compatible
- [ ] Fixing artificialTokens will also allow to refactor the text plugin a bit