[annotator-dev] Using only part of Annotator UI (v2.0)

Randall Leeds tilgovi at hypothes.is
Thu Jun 18 02:18:56 UTC 2015

On Thu, Jun 11, 2015 at 12:10 PM Tyler Burton <btburton42 at gmail.com> wrote:

> I'm wondering if anyone has had success using only a part of the Annotator
> Core UI. Currently, it looks like `annotator.ui.main` is the only way to
> include any UI elements.

It was I who lobbied hard for something like this. I wanted to first get
all the default UI grouped into one place to demonstrate that (1) the core
could be instantiated without any UI and (2) that the whole annotator UI
could be wired up in a single, albeit not tiny (300 lines), file.

Some things could absolutely be done to modularize this more. For instance,
it does seem as though the highlighter could be an extension module and all
the hooks registered for it in the ui.main module could be moved into there.

For the rest, it's a bit hard to see how that would work. There's too much
interaction between the components to encapsulate their instantiation, I

The Editor and Viewer must be instantiated and have the desired fields
added to them. It's possible these could be done declaratively based on
configuration in the configure hook of editor and viewer extension modules,
but right now these modules are just library code rather than registry

The Adder, Editor, and Viewer need to be wired up to events to make the
flows work. I'm not sure this could be done much better.

I would start from the main function of ui.main and see if it's actually
onerous to construct a custom UI using whatever components you desire.
You'll have to read through that function and see what it's doing. The
takeaways you have would be extremely helpful for us in finalizing 2.0,

> Does the community have any general patterns or suggestions with utilizing
> a custom UI?

Not yet, beyond the 'addField' APIs for the Editor and Viewer. Help us
define them!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150618/4d7053ef/attachment-0004.html>

More information about the annotator-dev mailing list