latin-language-toolkit/arethusa — pull request #300 by LFDM (2014-07-29 07:30:03+00:00)
Title: Refactor unusedTokenHighligher - state.change events in relation

Finally refactors the `unusedTokenHighlighter`, which was also moved to `arethusa.core`, as it can now be used with any token attribute and not only head.ids.

This was done to implmenet the uTH in the `relation` plugin, because it was quite easy to miss an unannotated label - happened to me all the time.

For uTH to work, the `state` eventing API has to be fulfilled - this was a good incentive to put some work into the `relation` service, which now fires regular state events - this means that the `history` can now also track changes in the `relation` plugin.

Code for this is a little hacky. We need to refactor the `nestedMenu` directive pretty bad for this, but this has to be done anyway. Ideally the eventing would not flow through `relation` but through `nestedMenu` - that way all plugins that use `nestedMenu` (such as `SG`) would automatically benefit. `nestedMenu` is a bottleneck right now, but we can turn this to our advantage by doing it really right at some point.