latin-language-toolkit/llt-annotation_environment — pull request #60 by LFDM (2014-05-12 12:22:55+00:00)
Title: Lazy init

Closes #54.

We now start to use init methods for services and the like, 1) to load them lazily if we need data upfront (such as an initial token state) and 2) to reinit them if need be - the morphology plugins e.g. will have to retrieve new analyses once we switch to a new sentence/text.

This is handled through watching the new variable `state.allLoaded`.

Right now only the morph plugin makes use of it - if a plugin doesn't implement an `init()` function, the error is catched and nothing happens. The history plugin could flash its history store - but we wait to do that, maybe be find other solutions that can retrieve the individual change history of sentences.

A search field has been added to the top bar - this is the place for now where we define which documents to retrieve.
Pass http://services.perseids.org/llt-data/1999.02.0002.2.1.1.xml or http://services.perseids.org/llt-data/1999.02.0002.2.1.2.xml to see this in effect.

Changes of the document are currently handled through the `$location` service (wrapped inside or own `locator` service) by handling route params - e.g. one can directly go to a document by navigating to app/#/staging?treebank=http:%2F%2Fservices.perseids.org%2Fllt-data%2F1999.02.0002.2.1.2.xml

The treebankRetriever is looking for the treebank param - this is currently hardcoded but will be configurable soon.
The Search field itself will become something very different in the future - much more magical - but this is currently out of scope.