latin-language-toolkit/arethusa — pull request #194 by LFDM (2014-06-23 07:57:36+00:00)
Title: Preselect on retrieval

Closes #192

Adds ability to preselect tokens on retrieval. This is done by looking at the URL from within a retriever: When `state` is loading in retriever data, it tries to check the value of `retriever.preselections`, which should be an Array of ids.

The `treebankRetriever` currently provides this through looking at a configurable param. Its configuration includes a `preselector` property which should be a string which reflects the URL query param.

This query param can be used to identify a single preselection (as in `w=1`) or multiple preselections at once (by chaining w params such as `w=1&w=2&w=5`). Once #191 is merged, range strings like `w=1-5` will also be allowed, but we'll have to wait for a helper class that sits in the aforementioned PR.